| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function run($request) { |
||
| 18 | $buckets = Config::inst()->get('CloudAssets', 'map'); |
||
| 19 | |||
| 20 | foreach ($buckets as $basePath => $cfg) { |
||
|
|
|||
| 21 | echo "processing $basePath...\n"; |
||
| 22 | $files = File::get()->filter('Filename:StartsWith', ltrim($basePath, '/')); |
||
| 23 | foreach ($files as $f) { |
||
| 24 | echo " - {$f->Filename}: {$f->CloudStatus} - placeholder={$f->containsPlaceholder()}\n"; |
||
| 25 | $f->updateCloudStatus(); |
||
| 26 | $f->createLocalIfNeeded(); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | echo "done\n\n"; |
||
| 31 | } |
||
| 32 | |||
| 33 | } |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.