@@ -62,25 +62,25 @@ discard block |
||
| 62 | 62 | public static function findEventListeners(Event $event): void |
| 63 | 63 | { |
| 64 | 64 | $rootPackagePath = dirname(self::getVendorDir($event->getComposer())) . DIRECTORY_SEPARATOR; |
| 65 | - if (! file_exists($rootPackagePath . '/composer.json')) { |
|
| 65 | + if (!file_exists($rootPackagePath . '/composer.json')) { |
|
| 66 | 66 | return; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $jsonRaw = file_get_contents($rootPackagePath . '/composer.json'); |
| 70 | - if (! is_string($jsonRaw)) { |
|
| 70 | + if (!is_string($jsonRaw)) { |
|
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $json = json_decode($jsonRaw, true); |
| 75 | - if (! is_array($json)) { |
|
| 75 | + if (!is_array($json)) { |
|
| 76 | 76 | return; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if (! array_key_exists('require-dev', $json)) { |
|
| 79 | + if (!array_key_exists('require-dev', $json)) { |
|
| 80 | 80 | return; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if (! is_array($json['require-dev'])) { |
|
| 83 | + if (!is_array($json['require-dev'])) { |
|
| 84 | 84 | return; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if (! $hasMakefiles) { |
|
| 95 | + if (!$hasMakefiles) { |
|
| 96 | 96 | return; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $io->write('<info>wyrihaximus/test-utilities:</info> Adding <fg=cyan>make on-install-or-update || true</> to scripts'); |
| 119 | 119 | $composerJsonString = file_get_contents($rootPackagePath . '/composer.json'); |
| 120 | - if (! is_string($composerJsonString)) { |
|
| 120 | + if (!is_string($composerJsonString)) { |
|
| 121 | 121 | $io->write('<error>wyrihaximus/test-utilities:</error> Unable to read <fg=cyan>composer.json</> aborting'); |
| 122 | 122 | |
| 123 | 123 | return; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $replacementComposerJsonString = json_encode($composerJson, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); |
| 139 | 139 | if (is_string($replacementComposerJsonString)) { |
| 140 | 140 | $replacementComposerJsonHash = hash('sha512', $replacementComposerJsonString); |
| 141 | - if (! hash_equals($composerJsonHash, $replacementComposerJsonHash)) { |
|
| 141 | + if (!hash_equals($composerJsonHash, $replacementComposerJsonHash)) { |
|
| 142 | 142 | $replacementComposerJsonString = preg_replace('/^( +?)\\1(?=[^ ])/m', '$1', $replacementComposerJsonString); |
| 143 | 143 | if (is_string($replacementComposerJsonString)) { |
| 144 | 144 | $io->write('<info>wyrihaximus/test-utilities:</info> Writing new <fg=cyan>composer.json</>'); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $replacementComposerJsonString = json_encode($composerJson, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); |
| 161 | 161 | if (is_string($replacementComposerJsonString)) { |
| 162 | 162 | $replacementComposerJsonHash = hash('sha512', $replacementComposerJsonString); |
| 163 | - if (! hash_equals($composerJsonHash, $replacementComposerJsonHash)) { |
|
| 163 | + if (!hash_equals($composerJsonHash, $replacementComposerJsonHash)) { |
|
| 164 | 164 | $replacementComposerJsonString = preg_replace('/^( +?)\\1(?=[^ ])/m', '$1', $replacementComposerJsonString); |
| 165 | 165 | if (is_string($replacementComposerJsonString)) { |
| 166 | 166 | $io->write('<info>wyrihaximus/test-utilities:</info> Writing new <fg=cyan>composer.json</>'); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | private static function getVendorDir(Composer $composer): string |
| 204 | 204 | { |
| 205 | 205 | $vendorDir = $composer->getConfig()->get('vendor-dir'); |
| 206 | - if ($vendorDir === '' || ! file_exists($vendorDir)) { |
|
| 206 | + if ($vendorDir === '' || !file_exists($vendorDir)) { |
|
| 207 | 207 | throw new Exception('vendor-dir must be a string'); |
| 208 | 208 | } |
| 209 | 209 | |