|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace PrettyBx\Support\Filesystem; |
|
6
|
|
|
|
|
7
|
|
|
class Manager |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* file_get_contents wrapper |
|
11
|
|
|
* |
|
12
|
|
|
* @access public |
|
13
|
|
|
* @param string $filename |
|
14
|
|
|
* @param mixed $data |
|
15
|
|
|
* @return mixed |
|
16
|
|
|
*/ |
|
17
|
|
|
public function getContents(string $filename, $data) |
|
18
|
|
|
{ |
|
19
|
|
|
return file_get_contents($filename, $data); |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* file_put_contents wrapper |
|
24
|
|
|
* |
|
25
|
|
|
* @access public |
|
26
|
|
|
* @param string $filename |
|
27
|
|
|
* @param mixed $data |
|
28
|
|
|
* @return mixed |
|
29
|
|
|
*/ |
|
30
|
|
|
public function putContents(string $filename, $data) |
|
31
|
|
|
{ |
|
32
|
|
|
return file_put_contents($filename, $data); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* rename wrapper |
|
37
|
|
|
* |
|
38
|
|
|
* @access public |
|
39
|
|
|
* @param string $oldnam |
|
40
|
|
|
* @param string $newname |
|
41
|
|
|
* @return bool |
|
42
|
|
|
*/ |
|
43
|
|
|
public function rename(string $oldname , string $newname): bool |
|
44
|
|
|
{ |
|
45
|
|
|
return rename($oldname, $newname); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Returns true if file exists |
|
50
|
|
|
* |
|
51
|
|
|
* @access public |
|
52
|
|
|
* @param string $filename |
|
53
|
|
|
* @return bool |
|
54
|
|
|
*/ |
|
55
|
|
|
public function exists(string $filename): bool |
|
56
|
|
|
{ |
|
57
|
|
|
return file_exists($filename); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* mkdir wrapper |
|
62
|
|
|
* |
|
63
|
|
|
* @access public |
|
64
|
|
|
* @param string $pathname |
|
65
|
|
|
* @param integer $mode Default: 0777 |
|
66
|
|
|
* @param boolean $recursive Default: false |
|
67
|
|
|
* @return bool |
|
68
|
|
|
*/ |
|
69
|
|
|
public function mkdir(string $pathname, int $mode = 0777, bool $recursive = false): bool |
|
70
|
|
|
{ |
|
71
|
|
|
return mkdir($pathname, $mode, $recursive); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* rename wrapper |
|
76
|
|
|
* |
|
77
|
|
|
* @access public |
|
78
|
|
|
* @param string $oldname |
|
79
|
|
|
* @param string $newname |
|
80
|
|
|
* @param resource $context |
|
81
|
|
|
* @return bool |
|
82
|
|
|
*/ |
|
83
|
|
|
public function rename(string $oldname, string $newname, resource $context = null): bool |
|
|
|
|
|
|
84
|
|
|
{ |
|
85
|
|
|
return rename($oldname, $newname, $context); |
|
|
|
|
|
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* touch wrapper |
|
90
|
|
|
* |
|
91
|
|
|
* @access public |
|
92
|
|
|
* @param string $filename |
|
93
|
|
|
* @param int $time Default: null |
|
94
|
|
|
* @param int $atime Default: null |
|
95
|
|
|
* @return bool |
|
96
|
|
|
*/ |
|
97
|
|
|
public function touch(string $filename, int $time = null, int $atime = null): bool |
|
98
|
|
|
{ |
|
99
|
|
|
return touch($filename, $time, $atime); |
|
100
|
|
|
} |
|
101
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths