@@ -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); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | protected function init() |
327 | 327 | { |
328 | 328 | parent::init(); |
329 | - if (! Permission::check('ADMIN')) { |
|
329 | + if (!Permission::check('ADMIN')) { |
|
330 | 330 | return Security::permissionFailure($this); |
331 | 331 | } |
332 | 332 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | |
372 | 372 | $extensions = $this->request->getVar('extensions'); |
373 | 373 | if ($extensions) { |
374 | - if (! is_array($extensions)) { |
|
374 | + if (!is_array($extensions)) { |
|
375 | 375 | $extensions = [$extensions]; |
376 | 376 | } |
377 | 377 | |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | $i = 0; |
522 | 522 | if ($this->getAllFilesInfoProvider()->getTotalFileCountRaw() > $step) { |
523 | 523 | for ($i = $step; ($i - $step) < $this->totalFileCountFiltered; $i += $step) { |
524 | - if ($i > $this->limit && ! isset($array[$this->limit])) { |
|
524 | + if ($i > $this->limit && !isset($array[$this->limit])) { |
|
525 | 525 | $array[$this->limit] = $this->limit; |
526 | 526 | } |
527 | 527 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | public function toArray(?bool $recalc = false): array |
93 | 93 | { |
94 | 94 | $cachekey = $this->getCacheKey(); |
95 | - if (! $this->hasCacheKey($cachekey) || $recalc) { |
|
95 | + if (!$this->hasCacheKey($cachekey) || $recalc) { |
|
96 | 96 | $this->getUncachedIntel(); |
97 | 97 | if ($this->debug) { |
98 | 98 | echo $this->intel['ErrorHasAnyError'] ? 'x ' : '✓ '; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | protected function addFolderDetails($dbFileData) |
246 | 246 | { |
247 | 247 | $folder = []; |
248 | - if (! empty($dbFileData['ParentID'])) { |
|
248 | + if (!empty($dbFileData['ParentID'])) { |
|
249 | 249 | if (isset($this->folderCache[$dbFileData['ParentID']])) { |
250 | 250 | $folder = $this->folderCache[$dbFileData['ParentID']]; |
251 | 251 | } else { |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | if (empty($folder)) { |
261 | - $this->intel['ErrorFindingFolder'] = ! empty($dbFileData['ParentID']); |
|
261 | + $this->intel['ErrorFindingFolder'] = !empty($dbFileData['ParentID']); |
|
262 | 262 | $this->intel['FolderID'] = 0; |
263 | 263 | } else { |
264 | 264 | $this->intel['ErrorFindingFolder'] = false; |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | $this->intel['DBFilename'] = $dbFileData['Name'] ?: basename($this->intel['DBPath']); |
304 | 304 | $existsOnStaging = $obj->existsOnStaging($this->intel['DBID']); |
305 | 305 | $existsOnLive = $obj->existsOnLive($this->intel['DBID']); |
306 | - $this->intel['ErrorDBNotPresentStaging'] = ! $existsOnStaging; |
|
307 | - $this->intel['ErrorDBNotPresentLive'] = ! $existsOnLive; |
|
308 | - $this->intel['ErrorInDraftOnly'] = $existsOnStaging && ! $existsOnLive; |
|
309 | - $this->intel['ErrorNotInDraft'] = ! $existsOnStaging && $existsOnLive; |
|
306 | + $this->intel['ErrorDBNotPresentStaging'] = !$existsOnStaging; |
|
307 | + $this->intel['ErrorDBNotPresentLive'] = !$existsOnLive; |
|
308 | + $this->intel['ErrorInDraftOnly'] = $existsOnStaging && !$existsOnLive; |
|
309 | + $this->intel['ErrorNotInDraft'] = !$existsOnStaging && $existsOnLive; |
|
310 | 310 | $this->intel['DBCMSEditLink'] = '/admin/assets/EditForm/field/File/item/' . $this->intel['DBID'] . '/edit'; |
311 | 311 | $this->intel['DBTitle'] = $dbFileData['Title']; |
312 | 312 | $this->intel['DBFilenameSS4'] = $dbFileData['FileFilename'] ?? 'none'; |
313 | - $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none';; |
|
313 | + $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none'; ; |
|
314 | 314 | $this->intel['ErrorInFilename'] = $this->intel['Path'] !== $this->intel['DBPath']; |
315 | 315 | $ss3FileName = $dbFileData['Filename'] ?? ''; |
316 | 316 | if ('assets/' === substr((string) $ss3FileName, 0, strlen('assets/'))) { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function getStagingData(string $pathFromAssets, ?int $id = 0): array |
213 | 213 | { |
214 | - if (! $id) { |
|
214 | + if (!$id) { |
|
215 | 215 | $id = $this->databaseLookupListStaging[$pathFromAssets] ?? 0; |
216 | 216 | } |
217 | 217 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function getLiveData(string $pathFromAssets, ?int $id = 0): array |
227 | 227 | { |
228 | - if (! $id) { |
|
228 | + if (!$id) { |
|
229 | 229 | $id = $this->databaseLookupListLive[$pathFromAssets] ?? 0; |
230 | 230 | } |
231 | 231 | |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | protected function registerFile($path, ?bool $inFileSystem = true) |
519 | 519 | { |
520 | 520 | if ($path) { |
521 | - if (! isset($this->listOfFiles[$path])) { |
|
521 | + if (!isset($this->listOfFiles[$path])) { |
|
522 | 522 | $this->listOfFiles[$path] = $inFileSystem; |
523 | 523 | if ($this->verbose) { |
524 | 524 | echo $inFileSystem ? '✓ ' : 'x '; |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | |
559 | 559 | $fileName = basename($absolutePath); |
560 | 560 | $isErrorPage = ('error' === substr((string) $fileName, 0, 5) && '.html' === substr((string) $fileName, -5)); |
561 | - return ! $isErrorPage; |
|
561 | + return !$isErrorPage; |
|
562 | 562 | } |
563 | 563 | |
564 | 564 | protected function getArrayOfFilesOnDisk(): array |