@@ -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 |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | protected function init() |
449 | 449 | { |
450 | 450 | parent::init(); |
451 | - if (! Permission::check('ADMIN')) { |
|
451 | + if (!Permission::check('ADMIN')) { |
|
452 | 452 | return Security::permissionFailure($this); |
453 | 453 | } |
454 | 454 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | |
493 | 493 | $extensions = $this->request->getVar('extensions'); |
494 | 494 | if ($extensions) { |
495 | - if (! is_array($extensions)) { |
|
495 | + if (!is_array($extensions)) { |
|
496 | 496 | $extensions = [$extensions]; |
497 | 497 | } |
498 | 498 | |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | $i = 0; |
765 | 765 | if ($this->totalFileCountRaw > $step) { |
766 | 766 | for ($i = $step; ($i - $step) < $this->totalFileCountFiltered; $i += $step) { |
767 | - if ($i > $this->limit && ! isset($array[$this->limit])) { |
|
767 | + if ($i > $this->limit && !isset($array[$this->limit])) { |
|
768 | 768 | $array[$this->limit] = $this->limit; |
769 | 769 | } |
770 | 770 |
@@ -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 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $localPath = $oneFileInfoArray['Path']; |
25 | 25 | if ($oneFileInfoArray['IsDir']) { |
26 | 26 | DB::alteration_message('Skipping ' . $pathFromAssetsFolder . ' as this is a folder', ''); |
27 | - } elseif (! empty($oneFileInfoArray['IsResizedImage'])) { |
|
27 | + } elseif (!empty($oneFileInfoArray['IsResizedImage'])) { |
|
28 | 28 | if (file_exists($localPath)) { |
29 | 29 | DB::alteration_message('Deleting ' . $pathFromAssetsFolder, 'deleted'); |
30 | 30 | //unlink($localPath); |
@@ -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) { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public static function getStagingData(string $pathFromAssets, ?int $id = 0): array |
126 | 126 | { |
127 | - if (! $id) { |
|
127 | + if (!$id) { |
|
128 | 128 | $id = self::$databaseLookupListStaging[$pathFromAssets] ?? 0; |
129 | 129 | } |
130 | 130 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public static function getLiveData(string $pathFromAssets, ?int $id = 0): array |
140 | 140 | { |
141 | - if (! $id) { |
|
141 | + if (!$id) { |
|
142 | 142 | $id = self::$databaseLookupListLive[$pathFromAssets] ?? 0; |
143 | 143 | } |
144 | 144 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | protected function registerFile($path, ?bool $inFileSystem = true) |
223 | 223 | { |
224 | 224 | if ($path) { |
225 | - if (! isset(self::$listOfFiles[$path])) { |
|
225 | + if (!isset(self::$listOfFiles[$path])) { |
|
226 | 226 | self::$listOfFiles[$path] = $inFileSystem; |
227 | 227 | if ($inFileSystem) { |
228 | 228 | echo '✓ '; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | protected static function findIdFromFileName(array $data, string $filename): int |
240 | 240 | { |
241 | 241 | $id = self::findInData($data, 'FileFilename', $filename); |
242 | - if (! $id) { |
|
242 | + if (!$id) { |
|
243 | 243 | $id = self::findInData($data, 'Filename', $filename); |
244 | 244 | } |
245 | 245 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $fileName = basename($path); |
275 | 275 | |
276 | - return ! ('error' === substr((string) $fileName, 0, 5) && '.html' === substr((string) $fileName, -5)); |
|
276 | + return !('error' === substr((string) $fileName, 0, 5) && '.html' === substr((string) $fileName, -5)); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | protected function getArrayOfFilesOnDisk(): array |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $files = File::get()->filter(['ClassName:not' => Folder::class]); |
309 | 309 | foreach ($files as $file) { |
310 | 310 | $row = $file->toMap(); |
311 | - $absoluteLocation = $this->path . DIRECTORY_SEPARATOR . $file->getFilename(); |
|
311 | + $absoluteLocation = $this->path . DIRECTORY_SEPARATOR . $file->getFilename(); |
|
312 | 312 | if ('Stage' === $stage) { |
313 | 313 | self::$dataStaging[$row['ID']] = $row; |
314 | 314 | self::$databaseLookupListStaging[$absoluteLocation] = $row['ID']; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | public function toArray(): array |
78 | 78 | { |
79 | 79 | $cachekey = $this->getCacheKey(); |
80 | - if (! $this->hasCacheKey($cachekey)) { |
|
80 | + if (!$this->hasCacheKey($cachekey)) { |
|
81 | 81 | $this->getUncachedIntel(); |
82 | 82 | if ($this->intel['ErrorHasAnyError']) { |
83 | 83 | echo 'x '; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | protected function addFolderDetails($dbFileData) |
231 | 231 | { |
232 | 232 | $folder = []; |
233 | - if (! empty($dbFileData['ParentID'])) { |
|
233 | + if (!empty($dbFileData['ParentID'])) { |
|
234 | 234 | if (isset($this->folderCache[$dbFileData['ParentID']])) { |
235 | 235 | $folder = $this->folderCache[$dbFileData['ParentID']]; |
236 | 236 | } else { |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | if (empty($folder)) { |
246 | - $this->intel['ErrorFindingFolder'] = ! empty($dbFileData['ParentID']); |
|
246 | + $this->intel['ErrorFindingFolder'] = !empty($dbFileData['ParentID']); |
|
247 | 247 | $this->intel['FolderID'] = 0; |
248 | 248 | } else { |
249 | 249 | $this->intel['ErrorFindingFolder'] = false; |
@@ -284,10 +284,10 @@ discard block |
||
284 | 284 | $this->intel['DBFilename'] = $dbFileData['Name'] ?: basename($this->intel['DBPath']); |
285 | 285 | $existsOnStaging = AllFilesInfo::existsOnStaging($this->intel['DBID']); |
286 | 286 | $existsOnLive = AllFilesInfo::existsOnLive($this->intel['DBID']); |
287 | - $this->intel['ErrorDBNotPresentStaging'] = ! $existsOnStaging; |
|
288 | - $this->intel['ErrorDBNotPresentLive'] = ! $existsOnLive; |
|
289 | - $this->intel['ErrorInDraftOnly'] = $existsOnStaging && ! $existsOnLive; |
|
290 | - $this->intel['ErrorNotInDraft'] = ! $existsOnStaging && $existsOnLive; |
|
287 | + $this->intel['ErrorDBNotPresentStaging'] = !$existsOnStaging; |
|
288 | + $this->intel['ErrorDBNotPresentLive'] = !$existsOnLive; |
|
289 | + $this->intel['ErrorInDraftOnly'] = $existsOnStaging && !$existsOnLive; |
|
290 | + $this->intel['ErrorNotInDraft'] = !$existsOnStaging && $existsOnLive; |
|
291 | 291 | $this->intel['DBCMSEditLink'] = '/admin/assets/EditForm/field/File/item/' . $this->intel['DBID'] . '/edit'; |
292 | 292 | $this->intel['DBTitle'] = $dbFileData['Title']; |
293 | 293 | $this->intel['DBFilenameSS4'] = $dbFileData['FileFilename']; |