From 6bdd5d0bff02f7b901408f83ba9cc08d7654cd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Sun, 2 May 2021 20:24:57 +0000 Subject: [PATCH] Obey PSR-2 --- phpcs.xml | 7 ++++++- tests/Unit/PrefixerTest.php | 4 ++-- tests/integration/Util/IntegrationTestCase.php | 17 ++++++++--------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index 542b9d7f..7e931063 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -2,7 +2,12 @@ Coding standard ruleset based on the PSR-2 coding standard. - + + + + + */tests/* + ./src ./tests \ No newline at end of file diff --git a/tests/Unit/PrefixerTest.php b/tests/Unit/PrefixerTest.php index 640fb133..a400b682 100644 --- a/tests/Unit/PrefixerTest.php +++ b/tests/Unit/PrefixerTest.php @@ -657,8 +657,8 @@ public function testItReplacesNamespaceConcatenatedStringConst() /** * Another mpdf issue where the class "Mpdf" is in the namespace "Mpdf" and incorrect replacements are being made. */ - public function testClassnameNotConfusedWithNamespace() { - + public function testClassnameNotConfusedWithNamespace() + { $contents = '$default_font_size = $mmsize * (Mpdf::SCALE);'; $expected = $contents; diff --git a/tests/integration/Util/IntegrationTestCase.php b/tests/integration/Util/IntegrationTestCase.php index b25c819e..39bf9802 100644 --- a/tests/integration/Util/IntegrationTestCase.php +++ b/tests/integration/Util/IntegrationTestCase.php @@ -11,8 +11,8 @@ use RecursiveDirectoryIterator; use RecursiveIteratorIterator; -class IntegrationTestCase extends TestCase { - +class IntegrationTestCase extends TestCase +{ protected $testsWorkingDir; public function setUp(): void @@ -22,10 +22,10 @@ public function setUp(): void $this->testsWorkingDir = __DIR__ . '/temptestdir/'; if (file_exists($this->testsWorkingDir)) { - $this->deleteDir( $this->testsWorkingDir ); + $this->deleteDir($this->testsWorkingDir); } - @mkdir($this->testsWorkingDir, ); + @mkdir($this->testsWorkingDir); } @@ -52,9 +52,9 @@ protected function deleteDir($dir) $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); foreach ($files as $file) { - if( is_link( $file ) ) { - unlink( $file ); - }elseif ($file->isDir()) { + if (is_link($file)) { + unlink $file); + } elseif ($file->isDir()) { rmdir($file->getRealPath()); } else { unlink($file->getRealPath()); @@ -62,5 +62,4 @@ protected function deleteDir($dir) } rmdir($dir); } - -} \ No newline at end of file +}