1 | <?php |
||
21 | class Config implements ConfigInterface |
||
22 | { |
||
23 | protected $cacheDir; |
||
24 | protected $installDir; |
||
25 | protected $filesystem; |
||
26 | protected $basePackagesUrl = 'http://bower.herokuapp.com/packages/'; |
||
27 | protected $allPackagesUrl = 'https://bower-component-list.herokuapp.com/'; |
||
28 | protected $saveToBowerJsonFile = false; |
||
29 | protected $bowerFileNames = ['bower.json', 'package.json']; |
||
30 | protected $stdBowerFileName = 'bower.json'; |
||
31 | protected $scripts = ['preinstall'=>[],'postinstall'=>[],'preuninstall'=>[]]; |
||
32 | |||
33 | /** |
||
34 | * @param Filesystem $filesystem |
||
35 | */ |
||
36 | public function __construct(Filesystem $filesystem) |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function getScripts() |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function getBasePackagesUrl() |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function getAllPackagesUrl() |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function getCacheDir() |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function getInstallDir() |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function isSaveToBowerJsonFile() |
||
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | public function setSaveToBowerJsonFile($flag = true) |
||
115 | |||
116 | /** |
||
117 | * {@inheritdoc} |
||
118 | */ |
||
119 | public function initBowerJsonFile(array $params) |
||
126 | |||
127 | /** |
||
128 | * {@inheritdoc} |
||
129 | */ |
||
130 | public function updateBowerJsonFile(PackageInterface $package) |
||
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | public function updateBowerJsonFile2(array $old, array $new) |
||
154 | |||
155 | /** |
||
156 | * {@inheritdoc} |
||
157 | */ |
||
158 | public function getBowerFileContent() |
||
170 | |||
171 | /** |
||
172 | * {@inheritdoc} |
||
173 | */ |
||
174 | public function getOverridesSection() |
||
185 | |||
186 | /** |
||
187 | * {@inheritdoc} |
||
188 | */ |
||
189 | public function getOverrideFor($packageName) |
||
198 | |||
199 | /** |
||
200 | * {@inheritdoc} |
||
201 | */ |
||
202 | public function getPackageBowerFileContent(PackageInterface $package) |
||
216 | |||
217 | /** |
||
218 | * {@inheritdoc} |
||
219 | */ |
||
220 | public function bowerFileExists() |
||
224 | |||
225 | /** |
||
226 | * @param array $params |
||
227 | * @return array |
||
228 | */ |
||
229 | protected function createAClearBowerFile(array $params) |
||
243 | |||
244 | /** |
||
245 | * @return string |
||
246 | */ |
||
247 | protected function getHomeDir() |
||
264 | } |
||
265 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.