| @@ -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 | ); | 
| @@ -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 |                  $this->flushNow('x ', '', false); | 
| @@ -173,8 +173,8 @@ discard block | ||
| 173 | 173 | $this->intel['PathExtensionAsLower'] = (string) strtolower($this->intel['PathExtension']); | 
| 174 | 174 | $this->intel['ErrorExtensionMisMatch'] = $this->intel['PathExtension'] !== $this->intel['PathExtensionAsLower']; | 
| 175 | 175 | $pathExtensionWithDot = '.' . $this->intel['PathExtension']; | 
| 176 | - $extensionLength = strlen( (string) $pathExtensionWithDot); | |
| 177 | - $pathLength = strlen( (string) $this->intel['PathFileName']); | |
| 176 | + $extensionLength = strlen((string) $pathExtensionWithDot); | |
| 177 | + $pathLength = strlen((string) $this->intel['PathFileName']); | |
| 178 | 178 |          if (substr((string) $this->intel['PathFileName'], (-1 * $extensionLength)) === $pathExtensionWithDot) { | 
| 179 | 179 | $this->intel['PathFileName'] = substr((string) $this->intel['PathFileName'], 0, ($pathLength - $extensionLength)); | 
| 180 | 180 | } | 
| @@ -220,7 +220,7 @@ discard block | ||
| 220 | 220 | protected function addFolderDetails($dbFileData) | 
| 221 | 221 |      { | 
| 222 | 222 | $folder = []; | 
| 223 | -        if (! empty($dbFileData['ParentID'])) { | |
| 223 | +        if (!empty($dbFileData['ParentID'])) { | |
| 224 | 224 |              if (isset($this->folderCache[$dbFileData['ParentID']])) { | 
| 225 | 225 | $folder = $this->folderCache[$dbFileData['ParentID']]; | 
| 226 | 226 |              } else { | 
| @@ -233,7 +233,7 @@ discard block | ||
| 233 | 233 | } | 
| 234 | 234 | |
| 235 | 235 |          if (empty($folder)) { | 
| 236 | - $this->intel['ErrorFindingFolder'] = ! empty($dbFileData['ParentID']); | |
| 236 | + $this->intel['ErrorFindingFolder'] = !empty($dbFileData['ParentID']); | |
| 237 | 237 | $this->intel['FolderID'] = 0; | 
| 238 | 238 |          } else { | 
| 239 | 239 | $this->intel['ErrorFindingFolder'] = false; | 
| @@ -274,10 +274,10 @@ discard block | ||
| 274 | 274 | $this->intel['DBFilename'] = $dbFileData['Name'] ?: basename($this->intel['DBPath']); | 
| 275 | 275 | $existsOnStaging = AllFilesInfo::existsOnStaging($this->intel['DBID']); | 
| 276 | 276 | $existsOnLive = AllFilesInfo::existsOnLive($this->intel['DBID']); | 
| 277 | - $this->intel['ErrorDBNotPresentStaging'] = ! $existsOnStaging; | |
| 278 | - $this->intel['ErrorDBNotPresentLive'] = ! $existsOnLive; | |
| 279 | - $this->intel['ErrorInDraftOnly'] = $existsOnStaging && ! $existsOnLive; | |
| 280 | - $this->intel['ErrorNotInDraft'] = ! $existsOnStaging && $existsOnLive; | |
| 277 | + $this->intel['ErrorDBNotPresentStaging'] = !$existsOnStaging; | |
| 278 | + $this->intel['ErrorDBNotPresentLive'] = !$existsOnLive; | |
| 279 | + $this->intel['ErrorInDraftOnly'] = $existsOnStaging && !$existsOnLive; | |
| 280 | + $this->intel['ErrorNotInDraft'] = !$existsOnStaging && $existsOnLive; | |
| 281 | 281 | $this->intel['DBCMSEditLink'] = '/admin/assets/EditForm/field/File/item/' . $this->intel['DBID'] . '/edit'; | 
| 282 | 282 | $this->intel['DBTitle'] = $dbFileData['Title']; | 
| 283 | 283 | $this->intel['DBFilenameSS4'] = $dbFileData['FileFilename']; | 
| @@ -123,7 +123,7 @@ discard block | ||
| 123 | 123 | */ | 
| 124 | 124 | public static function getStagingData(string $pathFromAssets, ?int $id = 0): array | 
| 125 | 125 |      { | 
| 126 | -        if (! $id) { | |
| 126 | +        if (!$id) { | |
| 127 | 127 | $id = self::$databaseLookupListStaging[$pathFromAssets] ?? 0; | 
| 128 | 128 | } | 
| 129 | 129 | |
| @@ -137,7 +137,7 @@ discard block | ||
| 137 | 137 | */ | 
| 138 | 138 | public static function getLiveData(string $pathFromAssets, ?int $id = 0): array | 
| 139 | 139 |      { | 
| 140 | -        if (! $id) { | |
| 140 | +        if (!$id) { | |
| 141 | 141 | $id = self::$databaseLookupListLive[$pathFromAssets] ?? 0; | 
| 142 | 142 | } | 
| 143 | 143 | |
| @@ -183,7 +183,7 @@ discard block | ||
| 183 | 183 |      { | 
| 184 | 184 |          if ([] === self::$listOfFiles) { | 
| 185 | 185 | $cachekey = $this->getCacheKey(); | 
| 186 | -            if (! $this->hasCacheKey($cachekey)) { | |
| 186 | +            if (!$this->hasCacheKey($cachekey)) { | |
| 187 | 187 |                  $this->flushNow('<h1>Analysing files</h1>'); | 
| 188 | 188 | //disk | 
| 189 | 189 | $diskArray = $this->getArrayOfFilesOnDisk(); | 
| @@ -221,7 +221,7 @@ discard block | ||
| 221 | 221 | protected function registerFile($path, $inFileSystem) | 
| 222 | 222 |      { | 
| 223 | 223 |          if ($path) { | 
| 224 | -            if (! isset(self::$listOfFiles[$path])) { | |
| 224 | +            if (!isset(self::$listOfFiles[$path])) { | |
| 225 | 225 | self::$listOfFiles[$path] = $inFileSystem; | 
| 226 | 226 |                  if ($inFileSystem) { | 
| 227 | 227 |                      $this->flushNow('. ', '', false); | 
| @@ -238,7 +238,7 @@ discard block | ||
| 238 | 238 | protected static function findIdFromFileName(array $data, string $filename): int | 
| 239 | 239 |      { | 
| 240 | 240 | $id = self::findInData($data, 'FileFilename', $filename); | 
| 241 | -        if (! $id) { | |
| 241 | +        if (!$id) { | |
| 242 | 242 | $id = self::findInData($data, 'Filename', $filename); | 
| 243 | 243 | } | 
| 244 | 244 | |
| @@ -272,7 +272,7 @@ discard block | ||
| 272 | 272 | |
| 273 | 273 | $fileName = basename($path); | 
| 274 | 274 | |
| 275 | -        return ! ('error' === substr((string) $fileName, 0, 5) && '.html' === substr((string) $fileName, -5)); | |
| 275 | +        return !('error' === substr((string) $fileName, 0, 5) && '.html' === substr((string) $fileName, -5)); | |
| 276 | 276 | } | 
| 277 | 277 | |
| 278 | 278 | protected function getArrayOfFilesOnDisk(): array | 
| @@ -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) { |