Skip to content

Commit

Permalink
.phpcs.xml config fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnessworthy committed Mar 13, 2023
1 parent ca7baa4 commit 18b5f29
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
</rule>

<rule ref="PSR12.ControlStructures.BooleanOperatorPlacement">
<properties>
<property name="allowOnly" value="first"/>
</properties>
</rule>

<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
Expand Down
20 changes: 14 additions & 6 deletions app/Commands/FixCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,13 @@ public function handle()

protected function runPint()
{
$configFile = tempnam(sys_get_temp_dir(), "pint");
rename($configFile, $configFile .= '.json');
file_put_contents($configFile, file_get_contents(base_path() . '/pint.json'));
if (file_exists('pint.json')) {
$configFile = 'pint.json';
} else {
$configFile = tempnam(sys_get_temp_dir(), "pint");
rename($configFile, $configFile .= '.json');
file_put_contents($configFile, file_get_contents(base_path() . '/pint.json'));
}

$bin = tempnam(sys_get_temp_dir(), "pint");
file_put_contents($bin, file_get_contents(base_path() . '/tools/pint'));
Expand Down Expand Up @@ -158,9 +162,13 @@ protected function runPint()

protected function runPHPCS()
{
$configFile = tempnam(sys_get_temp_dir(), "phpcs");
rename($configFile, $configFile .= '.xml');
file_put_contents($configFile, file_get_contents(base_path() . '/.phpcs.xml'));
if (file_exists('.phpcs.xml')) {
$configFile = './.phpcs.xml';
} else {
$configFile = tempnam(sys_get_temp_dir(), "phpcs");
rename($configFile, $configFile .= '.xml');
file_put_contents($configFile, file_get_contents(base_path() . '/.phpcs.xml'));
}

$bin = tempnam(sys_get_temp_dir(), "phpcbf");
file_put_contents($bin, file_get_contents(base_path() . '/tools/phpcbf'));
Expand Down
Binary file modified builds/ringier-code-style
Binary file not shown.

0 comments on commit 18b5f29

Please sign in to comment.