@@ -51,7 +51,7 @@ public function markTestIncompleteIfSnapshotsHaveChanged()
5151
5252 public function assertMatchesSnapshot ($ actual , Driver $ driver = null ): void
5353 {
54- if (!is_null ($ driver )) {
54+ if (! is_null ($ driver )) {
5555 $ this ->doSnapshotAssertion ($ actual , $ driver );
5656
5757 return ;
@@ -68,7 +68,7 @@ public function assertMatchesSnapshot($actual, Driver $driver = null): void
6868
6969 public function assertMatchesFileHashSnapshot (string $ filePath ): void
7070 {
71- if (!file_exists ($ filePath )) {
71+ if (! file_exists ($ filePath )) {
7272 $ this ->fail ('File does not exist ' );
7373 }
7474
@@ -116,8 +116,7 @@ public function assertMatchesImageSnapshot(
116116 $ actual ,
117117 float $ threshold = 0.1 ,
118118 bool $ includeAa = true
119- ): void
120- {
119+ ): void {
121120 $ this ->assertMatchesSnapshot ($ actual , new ImageDriver (
122121 $ threshold ,
123122 $ includeAa ,
@@ -131,8 +130,8 @@ public function assertMatchesImageSnapshot(
131130 */
132131 protected function getFileSnapshotDirectory (): string
133132 {
134- return $ this ->getSnapshotDirectory () .
135- DIRECTORY_SEPARATOR .
133+ return $ this ->getSnapshotDirectory ().
134+ DIRECTORY_SEPARATOR .
136135 'files ' ;
137136 }
138137
@@ -161,7 +160,7 @@ protected function shouldUpdateSnapshots(): bool
161160 */
162161 protected function shouldCreateSnapshots (): bool
163162 {
164- return !in_array ('--without-creating-snapshots ' , $ _SERVER ['argv ' ], true )
163+ return ! in_array ('--without-creating-snapshots ' , $ _SERVER ['argv ' ], true )
165164 && getenv ('CREATE_SNAPSHOTS ' ) !== 'false ' ;
166165 }
167166
@@ -175,7 +174,7 @@ protected function doSnapshotAssertion(mixed $actual, Driver $driver)
175174 $ driver
176175 );
177176
178- if (!$ snapshot ->exists ()) {
177+ if (! $ snapshot ->exists ()) {
179178 $ this ->assertSnapshotShouldBeCreated ($ snapshot ->filename ());
180179
181180 $ this ->createSnapshotAndMarkTestIncomplete ($ snapshot , $ actual );
@@ -203,7 +202,7 @@ protected function doSnapshotAssertion(mixed $actual, Driver $driver)
203202
204203 protected function doFileSnapshotAssertion (string $ filePath ): void
205204 {
206- if (!file_exists ($ filePath )) {
205+ if (! file_exists ($ filePath )) {
207206 $ this ->fail ('File does not exist ' );
208207 }
209208
@@ -217,7 +216,7 @@ protected function doFileSnapshotAssertion(string $filePath): void
217216
218217 $ this ->snapshotIncrementor ++;
219218
220- $ snapshotId = $ this ->getSnapshotId () . '. ' . $ fileExtension ;
219+ $ snapshotId = $ this ->getSnapshotId (). '. ' . $ fileExtension ;
221220 $ snapshotId = Filename::cleanFilename ($ snapshotId );
222221
223222 // If $filePath has a different file extension than the snapshot, the test should fail
@@ -240,13 +239,13 @@ protected function doFileSnapshotAssertion(string $filePath): void
240239 $ this ->fail ("File did not match the snapshot file extension (expected: {$ expectedExtension }, was: {$ fileExtension }) " );
241240 }
242241
243- $ failedSnapshotId = $ snapshotId . '_failed. ' . $ fileExtension ;
242+ $ failedSnapshotId = $ snapshotId. '_failed. ' . $ fileExtension ;
244243
245244 if ($ fileSystem ->has ($ failedSnapshotId )) {
246245 $ fileSystem ->delete ($ failedSnapshotId );
247246 }
248247
249- if (!$ fileSystem ->has ($ snapshotId )) {
248+ if (! $ fileSystem ->has ($ snapshotId )) {
250249 $ this ->assertSnapshotShouldBeCreated ($ failedSnapshotId );
251250
252251 $ fileSystem ->copy ($ filePath , $ snapshotId );
@@ -256,7 +255,7 @@ protected function doFileSnapshotAssertion(string $filePath): void
256255 return ;
257256 }
258257
259- if (!$ fileSystem ->fileEquals ($ filePath , $ snapshotId )) {
258+ if (! $ fileSystem ->fileEquals ($ filePath , $ snapshotId )) {
260259 if ($ this ->shouldUpdateSnapshots ()) {
261260 $ fileSystem ->copy ($ filePath , $ snapshotId );
262261
@@ -289,8 +288,8 @@ protected function updateSnapshotAndMarkTestIncomplete(Snapshot $snapshot, $actu
289288
290289 protected function rethrowExpectationFailedExceptionWithUpdateSnapshotsPrompt ($ exception ): void
291290 {
292- $ newMessage = $ exception ->getMessage () . "\n\n" .
293- 'Snapshots can be updated by passing ' .
291+ $ newMessage = $ exception ->getMessage (). "\n\n" .
292+ 'Snapshots can be updated by passing ' .
294293 '`-d --update-snapshots` through PHPUnit \'s CLI arguments. ' ;
295294
296295 $ exceptionReflection = new ReflectionObject ($ exception );
@@ -314,9 +313,9 @@ protected function assertSnapshotShouldBeCreated(string $snapshotFileName): void
314313 }
315314
316315 $ this ->fail (
317- "Snapshot \"$ snapshotFileName \" does not exist. \n" .
318- 'You can automatically create it by removing ' .
319- 'the `CREATE_SNAPSHOTS=false` env var, or ' .
316+ "Snapshot \"$ snapshotFileName \" does not exist. \n" .
317+ 'You can automatically create it by removing ' .
318+ 'the `CREATE_SNAPSHOTS=false` env var, or ' .
320319 '`-d --without-creating-snapshots` of PHPUnit \'s CLI arguments. '
321320 );
322321 }
0 commit comments