Completed
Push — master ( 5f51e9...d8eebf )
by Michael
04:28
created

pedigreeUtilities::prepareFolder()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 8
rs 9.4285
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: Mamba
6
 * Date: 2014-11-19
7
 * Time: 3:05
8
 */
9
class pedigreeUtilities
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
{
11
12
    /**
13
     * Function responsible for checking if a directory exists, we can also write in and create an index.html file
14
     *
15
     * @param string $folder Le chemin complet du répertoire à vérifier
16
     *
17
     * @return void
18
     */
19
    public static function prepareFolder($folder)
20
    {
21
        if (!is_dir($folder)) {
22
            mkdir($folder, 0777);
23
            file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
24
        }
25
        chmod($folder, 0777);
26
    }
27
}
28