@@ -67,7 +67,7 @@ |
||
67 | 67 | protected function init() |
68 | 68 | { |
69 | 69 | parent::init(); |
70 | - if (! Permission::check('ADMIN')) { |
|
70 | + if (!Permission::check('ADMIN')) { |
|
71 | 71 | return Security::permissionFailure($this); |
72 | 72 | } |
73 | 73 |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $list = $list->{$filterMethod}([$field => 0]); |
122 | 122 | } else { |
123 | 123 | $list = $list->filterByCallBack( |
124 | - function ($item) use ($fieldUsed, $existsValue) { |
|
124 | + function($item) use ($fieldUsed, $existsValue) { |
|
125 | 125 | return (bool) $item->{$fieldUsed}()->exists() === $existsValue; |
126 | 126 | } |
127 | 127 | ); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function sourceQuery($params) |
145 | 145 | { |
146 | - if (! $this->hasMethod('sourceRecords')) { |
|
146 | + if (!$this->hasMethod('sourceRecords')) { |
|
147 | 147 | throw new \RuntimeException( |
148 | 148 | 'Please override sourceQuery()/sourceRecords() and columns() or, if necessary, override getReportField()' |
149 | 149 | ); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | protected function getBaseFolder(): string |
40 | 40 | { |
41 | - if (! $this->baseFolder) { |
|
41 | + if (!$this->baseFolder) { |
|
42 | 42 | $this->baseFolder = rtrim(Director::baseFolder(), DIRECTORY_SEPARATOR); |
43 | 43 | } |
44 | 44 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | protected function getPublicBaseFolder(): string |
49 | 49 | { |
50 | - if (! $this->publicBaseFolder) { |
|
50 | + if (!$this->publicBaseFolder) { |
|
51 | 51 | $this->publicBaseFolder = rtrim(Director::publicFolder(), DIRECTORY_SEPARATOR); |
52 | 52 | } |
53 | 53 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function getAssetsBaseFolder(): string |
58 | 58 | { |
59 | - if (! $this->assetsBaseFolder) { |
|
59 | + if (!$this->assetsBaseFolder) { |
|
60 | 60 | $this->assetsBaseFolder = rtrim(ASSETS_PATH, DIRECTORY_SEPARATOR); |
61 | 61 | } |
62 | 62 |
@@ -10,7 +10,7 @@ |
||
10 | 10 | $i1 = $this->createImage($a); |
11 | 11 | $i2 = $this->createImage($b); |
12 | 12 | |
13 | - if (! $i1 || ! $i2) { |
|
13 | + if (!$i1 || !$i2) { |
|
14 | 14 | return false; |
15 | 15 | } |
16 | 16 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | foreach ($a as $file) { |
19 | 19 | $nameOne = $file->Path; |
20 | 20 | $nameOneFromAssets = $file->PathFromAssetsFolder; |
21 | - if (! in_array($nameOne, $alreadyDone, true)) { |
|
21 | + if (!in_array($nameOne, $alreadyDone, true)) { |
|
22 | 22 | $easyFind = false; |
23 | 23 | $sortArray = []; |
24 | 24 | foreach ($b as $compareImage) { |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $fieldLabels = $obj->fieldLabels(true); |
24 | 24 | foreach ($types as $type) { |
25 | 25 | $rels = Config::inst()->get($className, $type, Config::UNINHERITED); |
26 | - if (is_array($rels) && ! empty($rels)) { |
|
26 | + if (is_array($rels) && !empty($rels)) { |
|
27 | 27 | foreach ($rels as $relName => $relType) { |
28 | 28 | if (is_a($relType, File::class, true)) { |
29 | 29 | $title = $obj->i18n_singular_name() . ' - ' . ($fieldLabels[$relName] ?? $relName); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | protected function init() |
356 | 356 | { |
357 | 357 | parent::init(); |
358 | - if (! Permission::check('ADMIN')) { |
|
358 | + if (!Permission::check('ADMIN')) { |
|
359 | 359 | return Security::permissionFailure($this); |
360 | 360 | } |
361 | 361 | |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | |
401 | 401 | $extensions = $this->request->getVar('extensions'); |
402 | 402 | if ($extensions) { |
403 | - if (! is_array($extensions)) { |
|
403 | + if (!is_array($extensions)) { |
|
404 | 404 | $extensions = [$extensions]; |
405 | 405 | } |
406 | 406 | |
@@ -548,11 +548,11 @@ discard block |
||
548 | 548 | $step = 100; |
549 | 549 | $array = []; |
550 | 550 | $i = 0; |
551 | - $totalRaw = (int) $this->getAllFilesInfoProvider()->getTotalFileCountRaw(); |
|
552 | - $totalFiltered = (int) $this->getAllFilesInfoProvider()->getTotalFileCountFiltered(); |
|
551 | + $totalRaw = (int) $this->getAllFilesInfoProvider()->getTotalFileCountRaw(); |
|
552 | + $totalFiltered = (int) $this->getAllFilesInfoProvider()->getTotalFileCountFiltered(); |
|
553 | 553 | if ($totalRaw > $step) { |
554 | 554 | for ($i = $step; ($i - $step) < $totalFiltered; $i += $step) { |
555 | - if ($i > $this->limit && ! isset($array[$this->limit])) { |
|
555 | + if ($i > $this->limit && !isset($array[$this->limit])) { |
|
556 | 556 | $array[$this->limit] = $this->limit; |
557 | 557 | } |
558 | 558 |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | */ |
220 | 220 | public function getStagingData(string $pathFromAssets, ?int $id = 0): array |
221 | 221 | { |
222 | - if (! $id) { |
|
222 | + if (!$id) { |
|
223 | 223 | $id = $this->databaseLookupListStaging[$pathFromAssets] ?? 0; |
224 | 224 | } |
225 | 225 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function getLiveData(string $pathFromAssets, ?int $id = 0): array |
235 | 235 | { |
236 | - if (! $id) { |
|
236 | + if (!$id) { |
|
237 | 237 | $id = $this->databaseLookupListLive[$pathFromAssets] ?? 0; |
238 | 238 | } |
239 | 239 | |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | protected function registerFile($path, ?bool $inFileSystem = true) |
528 | 528 | { |
529 | 529 | if ($path) { |
530 | - if (! isset($this->listOfFiles[$path])) { |
|
530 | + if (!isset($this->listOfFiles[$path])) { |
|
531 | 531 | $this->listOfFiles[$path] = $inFileSystem; |
532 | 532 | if ($this->verbose) { |
533 | 533 | if ($inFileSystem) { |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | |
572 | 572 | $fileName = basename($absolutePath); |
573 | 573 | $isErrorPage = ('error' === substr((string) $fileName, 0, 5) && '.html' === substr((string) $fileName, -5)); |
574 | - return ! $isErrorPage; |
|
574 | + return !$isErrorPage; |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | protected function getArrayOfFilesOnDisk(): array |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function toArray(): array |
116 | 116 | { |
117 | 117 | $cachekey = $this->getCacheKey(); |
118 | - if (! $this->hasCacheKey($cachekey) || $this->noCache) { |
|
118 | + if (!$this->hasCacheKey($cachekey) || $this->noCache) { |
|
119 | 119 | $this->collateIntel(); |
120 | 120 | if ($this->debug) { |
121 | 121 | if ($this->intel['ErrorHasAnyError']) { |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | } else { |
256 | 256 | $this->intel['ImageRatio'] = 0; |
257 | 257 | } |
258 | - $this->intel['ImagePixels'] = $this->intel['ImageHeight'] * $this->intel['ImageWidth']; |
|
258 | + $this->intel['ImagePixels'] = $this->intel['ImageHeight'] * $this->intel['ImageWidth']; |
|
259 | 259 | $this->intel['IsResizedImage'] = (bool) strpos($this->intel['PathFileName'], '__'); |
260 | 260 | } |
261 | 261 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | protected function addFolderDetails($dbFileData) |
265 | 265 | { |
266 | 266 | $folder = []; |
267 | - if (! empty($dbFileData['ParentID'])) { |
|
267 | + if (!empty($dbFileData['ParentID'])) { |
|
268 | 268 | if (isset($this->folderCache[$dbFileData['ParentID']])) { |
269 | 269 | $folder = $this->folderCache[$dbFileData['ParentID']]; |
270 | 270 | } else { |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | |
279 | 279 | if (empty($folder)) { |
280 | - $this->intel['ErrorFindingFolder'] = ! empty($dbFileData['ParentID']); |
|
280 | + $this->intel['ErrorFindingFolder'] = !empty($dbFileData['ParentID']); |
|
281 | 281 | $this->intel['FolderID'] = 0; |
282 | 282 | } else { |
283 | 283 | $this->intel['ErrorFindingFolder'] = false; |
@@ -322,14 +322,14 @@ discard block |
||
322 | 322 | $this->intel['DBFilename'] = $dbFileData['Name'] ?: basename($this->intel['DBPath']); |
323 | 323 | $existsOnStaging = $obj->existsOnStaging($this->intel['DBID']); |
324 | 324 | $existsOnLive = $obj->existsOnLive($this->intel['DBID']); |
325 | - $this->intel['ErrorDBNotPresentStaging'] = ! $existsOnStaging; |
|
326 | - $this->intel['ErrorDBNotPresentLive'] = ! $existsOnLive; |
|
327 | - $this->intel['ErrorInDraftOnly'] = $existsOnStaging && ! $existsOnLive; |
|
328 | - $this->intel['ErrorNotInDraft'] = ! $existsOnStaging && $existsOnLive; |
|
325 | + $this->intel['ErrorDBNotPresentStaging'] = !$existsOnStaging; |
|
326 | + $this->intel['ErrorDBNotPresentLive'] = !$existsOnLive; |
|
327 | + $this->intel['ErrorInDraftOnly'] = $existsOnStaging && !$existsOnLive; |
|
328 | + $this->intel['ErrorNotInDraft'] = !$existsOnStaging && $existsOnLive; |
|
329 | 329 | $this->intel['DBCMSEditLink'] = '/admin/assets/EditForm/field/File/item/' . $this->intel['DBID'] . '/edit'; |
330 | 330 | $this->intel['DBTitle'] = $dbFileData['Title']; |
331 | 331 | $this->intel['DBFilenameSS4'] = $dbFileData['FileFilename'] ?? 'none'; |
332 | - $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none';; |
|
332 | + $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none'; ; |
|
333 | 333 | $this->intel['ErrorInFilename'] = $this->intel['Path'] !== $this->intel['DBPath']; |
334 | 334 | $ss3FileName = $dbFileData['Filename'] ?? ''; |
335 | 335 | if ('assets/' === substr((string) $ss3FileName, 0, strlen('assets/'))) { |