Skip to content

Commit

Permalink
Merge pull request coenjacobs#4 from szepeviktor/phpcs
Browse files Browse the repository at this point in the history
Obey PSR-2
  • Loading branch information
BrianHenryIE authored May 4, 2021
2 parents 4480bf2 + 6bdd5d0 commit b31b347
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
7 changes: 6 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
<!--suppress XmlUnboundNsPrefix -->
<ruleset name="mozart">
<description>Coding standard ruleset based on the PSR-2 coding standard.</description>
<rule ref="PSR2"/>
<rule ref="PSR2">
<exclude name="Generic.Files.LineLength.TooLong"/>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<file>./src</file>
<file>./tests</file>
</ruleset>
4 changes: 2 additions & 2 deletions tests/Unit/PrefixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
17 changes: 8 additions & 9 deletions tests/integration/Util/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

class IntegrationTestCase extends TestCase {

class IntegrationTestCase extends TestCase
{
protected $testsWorkingDir;

public function setUp(): void
Expand All @@ -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);
}


Expand All @@ -52,15 +52,14 @@ 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());
}
}
rmdir($dir);
}

}
}

0 comments on commit b31b347

Please sign in to comment.