@@ -14,10 +14,10 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public static function generate_hash(int $length = 64): string |
| 16 | 16 | { |
| 17 | - $pieces = []; |
|
| 17 | + $pieces = [ ]; |
|
| 18 | 18 | $max = mb_strlen(self::CHARS, '8bit') - 1; |
| 19 | 19 | for ($i = 0; $i < $length; ++$i) { |
| 20 | - $pieces[] = self::CHARS[random_int(0, $max)]; |
|
| 20 | + $pieces[ ] = self::CHARS[ random_int(0, $max) ]; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | return implode('', $pieces); |
@@ -36,14 +36,14 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $owner = $this->getOwner(); |
| 38 | 38 | if ($owner->RequiresUUID) { |
| 39 | - if(!$owner->UUID) { |
|
| 39 | + if (!$owner->UUID) { |
|
| 40 | 40 | $owner->UUID = $this->getHashID(); |
| 41 | 41 | } |
| 42 | 42 | } else { |
| 43 | 43 | $this->UUIDNeverAgainRaceCondition = true; |
| 44 | 44 | $owner->UUID = ''; |
| 45 | 45 | } |
| 46 | - if (! $owner->PublicUUID || 'ERROR' === $owner->PublicUUID) { |
|
| 46 | + if (!$owner->PublicUUID || 'ERROR' === $owner->PublicUUID) { |
|
| 47 | 47 | $owner->PublicUUID = $this->calculatePublicUUID(); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | public function onAfterWrite() |
| 52 | 52 | { |
| 53 | 53 | $owner = $this->getOwner(); |
| 54 | - if (! $owner->UUID && false === $this->UUIDNeverAgainRaceCondition) { |
|
| 54 | + if (!$owner->UUID && false === $this->UUIDNeverAgainRaceCondition) { |
|
| 55 | 55 | $this->UUIDNeverAgainRaceCondition = true; |
| 56 | 56 | $owner->write(); |
| 57 | 57 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function updateCMSFields(FieldList $fields) |
| 66 | 66 | { |
| 67 | 67 | $owner = $this->owner; |
| 68 | - if (! ($owner instanceof SiteTree)) { |
|
| 68 | + if (!($owner instanceof SiteTree)) { |
|
| 69 | 69 | $this->updateCMSFieldsForHashId($fields); |
| 70 | 70 | } |
| 71 | 71 | } |