From cb5a3e3084214c25a159819f5e7506a56638e22a Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sun, 24 Dec 2023 10:10:03 +0100 Subject: [PATCH] Fix CS/WS issues --- src/CodeExporter.php | 6 +++--- src/Restorer.php | 4 ++-- src/Snapshot.php | 4 ++-- tests/unit/CodeExporterTest.php | 4 ++-- tests/unit/ExcludeListTest.php | 26 +++++++++++++------------- tests/unit/SnapshotTest.php | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/CodeExporter.php b/src/CodeExporter.php index e7c5fd0..6b72081 100644 --- a/src/CodeExporter.php +++ b/src/CodeExporter.php @@ -27,7 +27,7 @@ public function constants(Snapshot $snapshot): string 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, - $this->exportVariable($value) + $this->exportVariable($value), ); } @@ -53,7 +53,7 @@ function () $result .= sprintf( '$GLOBALS[%s] = %s;' . PHP_EOL, $this->exportVariable($name), - $this->exportVariable($value) + $this->exportVariable($value), ); } @@ -68,7 +68,7 @@ public function iniSettings(Snapshot $snapshot): string $result .= sprintf( '@ini_set(%s, %s);' . "\n", $this->exportVariable($key), - $this->exportVariable($value) + $this->exportVariable($value), ); } diff --git a/src/Restorer.php b/src/Restorer.php index 6eec759..d84e155 100644 --- a/src/Restorer.php +++ b/src/Restorer.php @@ -90,8 +90,8 @@ private function restoreSuperGlobalArray(Snapshot $snapshot, string $superGlobal $keys = array_keys( array_merge( $GLOBALS[$superGlobalArray], - $superGlobalVariables[$superGlobalArray] - ) + $superGlobalVariables[$superGlobalArray], + ), ); foreach ($keys as $key) { diff --git a/src/Snapshot.php b/src/Snapshot.php index ad94be7..43e2730 100644 --- a/src/Snapshot.php +++ b/src/Snapshot.php @@ -330,7 +330,7 @@ private function enumerateObjectsAndResources(mixed $variable, Context $processe /** @noinspection SlowArrayOperationsInLoopInspection */ $result = array_merge( $result, - $this->enumerateObjectsAndResources($element, $processed) + $this->enumerateObjectsAndResources($element, $processed), ); } else { $result[] = $element; @@ -348,7 +348,7 @@ private function enumerateObjectsAndResources(mixed $variable, Context $processe /** @noinspection SlowArrayOperationsInLoopInspection */ $result = array_merge( $result, - $this->enumerateObjectsAndResources($value, $processed) + $this->enumerateObjectsAndResources($value, $processed), ); } else { $result[] = $value; diff --git a/tests/unit/CodeExporterTest.php b/tests/unit/CodeExporterTest.php index ab01e19..a7da662 100644 --- a/tests/unit/CodeExporterTest.php +++ b/tests/unit/CodeExporterTest.php @@ -61,7 +61,7 @@ public function testCanExportIniSettingsToCode(): void $this->assertMatchesRegularExpression( $pattern, - $export + $export, ); } @@ -75,7 +75,7 @@ public function testCanExportConstantsToCode(): void $this->assertStringContainsString( "if (!defined('FOO')) define('FOO', 'BAR');", - $exporter->constants($snapshot) + $exporter->constants($snapshot), ); } diff --git a/tests/unit/ExcludeListTest.php b/tests/unit/ExcludeListTest.php index bf83832..cb34aa9 100644 --- a/tests/unit/ExcludeListTest.php +++ b/tests/unit/ExcludeListTest.php @@ -43,8 +43,8 @@ public function testStaticPropertyThatIsNotExcludedIsNotTreatedAsExcluded(): voi $this->assertFalse( $this->excludeList->isStaticPropertyExcluded( ExcludedClass::class, - 'property' - ) + 'property', + ), ); } @@ -55,8 +55,8 @@ public function testClassCanBeExcluded(): void $this->assertTrue( $this->excludeList->isStaticPropertyExcluded( ExcludedClass::class, - 'property' - ) + 'property', + ), ); } @@ -67,8 +67,8 @@ public function testSubclassesCanBeExcluded(): void $this->assertTrue( $this->excludeList->isStaticPropertyExcluded( ExcludedChildClass::class, - 'property' - ) + 'property', + ), ); } @@ -79,8 +79,8 @@ public function testImplementorsCanBeExcluded(): void $this->assertTrue( $this->excludeList->isStaticPropertyExcluded( ExcludedImplementor::class, - 'property' - ) + 'property', + ), ); } @@ -91,8 +91,8 @@ public function testClassNamePrefixesCanBeExcluded(): void $this->assertTrue( $this->excludeList->isStaticPropertyExcluded( ExcludedClass::class, - 'property' - ) + 'property', + ), ); } @@ -100,14 +100,14 @@ public function testStaticPropertyCanBeExcluded(): void { $this->excludeList->addStaticProperty( ExcludedClass::class, - 'property' + 'property', ); $this->assertTrue( $this->excludeList->isStaticPropertyExcluded( ExcludedClass::class, - 'property' - ) + 'property', + ), ); } } diff --git a/tests/unit/SnapshotTest.php b/tests/unit/SnapshotTest.php index 8073901..5e832ad 100644 --- a/tests/unit/SnapshotTest.php +++ b/tests/unit/SnapshotTest.php @@ -99,7 +99,7 @@ public function testConstructorExcludesAspectsWhenTheyShouldNotBeIncluded(): voi false, false, false, - false + false, ); $this->assertEmpty($snapshot->constants()); @@ -126,7 +126,7 @@ public function testExcludeListCanBeAccessed(): void false, false, false, - false + false, ); $this->assertSame($this->excludeList, $snapshot->excludeList());