@@ -83,9 +83,9 @@ |
||
83 | 83 | return ' |
84 | 84 | Basic SiteTree prune of older records. |
85 | 85 | This task will remove all versions of SiteTree records with a LastEdited date of: '. |
86 | - $this->Config()->get('delete_older_than_strtotime_phrase'). |
|
86 | + $this->Config()->get('delete_older_than_strtotime_phrase') . |
|
87 | 87 | ' or older. |
88 | - Up to '.self::MAX_ITEMS_PER_CLASS.' records will be deleted per run. |
|
88 | + Up to '.self::MAX_ITEMS_PER_CLASS . ' records will be deleted per run. |
|
89 | 89 | For a more advanced approach, you can set up a template for a pruning service.'; |
90 | 90 | } |
91 | 91 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | // DB::alteration_message('No data for: '.$className); |
56 | 56 | |
57 | 57 | $array = $runner->getTableSizes($object, true); |
58 | - if (! empty($array)) { |
|
58 | + if (!empty($array)) { |
|
59 | 59 | DB::alteration_message('... Version Records'); |
60 | 60 | foreach ($array as $table => $size) { |
61 | 61 | DB::alteration_message('... ... ' . $table . ': ' . number_format($size)); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | protected function getObjectCountPerClassName(string $className): int |
70 | 70 | { |
71 | - if (! isset($this->objectCountPerClassNameCache[$className])) { |
|
71 | + if (!isset($this->objectCountPerClassNameCache[$className])) { |
|
72 | 72 | $this->objectCountPerClassNameCache[$className] = $className::get()->count(); |
73 | 73 | } |
74 | 74 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | protected function getObjectCountForVersionsPerClassName(string $className): int |
79 | 79 | { |
80 | - if (! isset($this->objectCountForVersionsPerClassNameCache[$className])) { |
|
80 | + if (!isset($this->objectCountForVersionsPerClassNameCache[$className])) { |
|
81 | 81 | $tableName = Config::inst()->get($className, 'table_name'); |
82 | 82 | $this->objectCountForVersionsPerClassNameCache[$className] = (int) DB::query('SELECT COUNT("ID") FROM "' . $tableName . '_Versions";')->value(); |
83 | 83 | } |
@@ -93,7 +93,7 @@ |
||
93 | 93 | foreach ($classes as $className) { |
94 | 94 | $objects = $this->getObjectsPerClassName($runObject, $className); |
95 | 95 | $noData = ''; |
96 | - if (! $objects->exists()) { |
|
96 | + if (!$objects->exists()) { |
|
97 | 97 | $noData = '- nothing to do'; |
98 | 98 | } |
99 | 99 | DB::alteration_message('... Looking at ' . $className . ' ' . $noData); |
@@ -93,7 +93,7 @@ |
||
93 | 93 | |
94 | 94 | $key = implode('_', $keyArray); |
95 | 95 | |
96 | - if (! (in_array($key, $changedRecords, true))) { |
|
96 | + if (!(in_array($key, $changedRecords, true))) { |
|
97 | 97 | //mark the first one, but do not mark it to delete |
98 | 98 | $changedRecords[] = $key; |
99 | 99 | } else { |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | public function deleteSuperfluousVersions($object): int |
176 | 176 | { |
177 | 177 | $this->object = $object; |
178 | - if (! $this->isValidObject()) { |
|
178 | + if (!$this->isValidObject()) { |
|
179 | 179 | echo $object->ClassName . ' ERROR'; |
180 | 180 | |
181 | 181 | return 0; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | { |
299 | 299 | // array of version IDs to delete |
300 | 300 | // IMPORTANT |
301 | - if (! isset($this->toDelete[$this->getUniqueKey()])) { |
|
301 | + if (!isset($this->toDelete[$this->getUniqueKey()])) { |
|
302 | 302 | $this->toDelete[$this->getUniqueKey()] = []; |
303 | 303 | } |
304 | 304 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } |
370 | 370 | } |
371 | 371 | |
372 | - if (! isset($this->templatesPerClassName[$this->object->ClassName])) { |
|
372 | + if (!isset($this->templatesPerClassName[$this->object->ClassName])) { |
|
373 | 373 | $this->templatesPerClassName[$this->object->ClassName] = $templates['default'] ?? $classesWithOptions; |
374 | 374 | } |
375 | 375 | } |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | protected function getTablesForClassName(?string $className = ''): array |
406 | 406 | { |
407 | - if (! $className) { |
|
407 | + if (!$className) { |
|
408 | 408 | $className = $this->object->ClassName; |
409 | 409 | } |
410 | 410 | if (empty($this->tablesPerClassName[$className])) { |