Skip to content

Commit 20d4b87

Browse files
committed
Realodix: Remove concat_space rule, aligning with Laravel defaults
This commit removes the explicit `concat_space` rule, effectively setting it to 'none' and aligning with Laravel's coding standards.
1 parent f225a76 commit 20d4b87

File tree

13 files changed

+16
-17
lines changed

13 files changed

+16
-17
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
->setRules($localRules)
1717
->setFinder($finder)
1818
->setParallelConfig(\PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
19-
->setCacheFile(__DIR__ . '/.tmp/.php-cs-fixer.cache');
19+
->setCacheFile(__DIR__.'/.tmp/.php-cs-fixer.cache');

bin/relax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
$require = true;
77
if ($require) {
88
// OK, it's not, let give Composer autoloader a try!
9-
$possibleFiles = [__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'];
9+
$possibleFiles = [__DIR__.'/../../../autoload.php', __DIR__.'/../vendor/autoload.php', __DIR__.'/vendor/autoload.php'];
1010
$file = null;
1111
foreach ($possibleFiles as $possibleFile) {
1212
if (file_exists($possibleFile)) {

src/Commands/GenerateConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function overwriteExistingFile($input, $output): bool
6565
*/
6666
protected function getOutputFilename(): string
6767
{
68-
return getcwd() . DIRECTORY_SEPARATOR . self::FILE_NAME;
68+
return getcwd().DIRECTORY_SEPARATOR.self::FILE_NAME;
6969
}
7070

7171
/**

src/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function create($ruleSet = null)
5353

5454
// If the rule set is a string, we try to find it in the RuleSet namespace
5555
if (is_string($ruleSet)) {
56-
$relaxRuleset = 'Realodix\Relax\RuleSet\Sets\\' . ucfirst($ruleSet);
56+
$relaxRuleset = 'Realodix\Relax\RuleSet\Sets\\'.ucfirst($ruleSet);
5757

5858
if (!class_exists($relaxRuleset)) {
5959
throw new RulesetNotFoundException($ruleSet);

src/RuleSet/AbstractRuleSet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public function name(): string
1010
{
1111
$name = substr(static::class, 1 + strrpos(static::class, '\\'));
1212

13-
return '@' . $name;
13+
return '@'.$name;
1414
}
1515
}

src/RuleSet/Sets/Relax.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public function mainRules(): array
6262
'default' => 'single_space',
6363
'operators' => ['=>' => 'at_least_single_space'],
6464
],
65-
'concat_space' => ['spacing' => 'one'],
6665
'class_attributes_separation' => [
6766
'elements' => [
6867
'trait_import' => 'none',

tests/Fixtures/Ruleset/relax-commonbox_expected.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ final class SelfStaticAccessor
217217

218218
public function getBar()
219219
{
220-
return self::class . self::test() . self::$A;
220+
return self::class.self::test().self::$A;
221221
}
222222
}
223223

tests/Fixtures/Ruleset/relax_actual.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ public function operator__binary_operator_spaces()
347347

348348
public function operator__concat_space()
349349
{
350-
$foo = 'bar'. 3 . 'baz'.'qux';
350+
return 'bar'. 3 . 'baz'.'qux';
351351
}
352352

353353
public function operator__increment_style()

tests/Fixtures/Ruleset/relax_expected.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public function operator__binary_operator_spaces()
353353

354354
public function operator__concat_space()
355355
{
356-
$foo = 'bar' . 3 . 'bazqux';
356+
return 'bar'. 3 .'bazqux';
357357
}
358358

359359
public function operator__increment_style()

tests/Integration/IntegrationTestCase.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ protected function testFixture(string $name, ?string $suffix = null): void
2525
$fileName = $name;
2626

2727
if (!is_null($suffix)) {
28-
$fileName = $fileName . '-' . $suffix;
28+
$fileName = $fileName.'-'.$suffix;
2929
}
3030

31-
copy(__DIR__ . "/../Fixtures/Ruleset/{$fileName}_actual.php", __DIR__ . "/tmp/{$fileName}.php");
31+
copy(__DIR__."/../Fixtures/Ruleset/{$fileName}_actual.php", __DIR__."/tmp/{$fileName}.php");
3232

3333
$this->assertTrue(
3434
$this->runFixer($name),
3535
"Fixture fixtures/{$fileName} was not proceeded properly.",
3636
);
3737

3838
$this->assertFileEquals(
39-
__DIR__ . "/../Fixtures/Ruleset/{$fileName}_expected.php",
40-
__DIR__ . "/tmp/{$fileName}.php",
39+
__DIR__."/../Fixtures/Ruleset/{$fileName}_expected.php",
40+
__DIR__."/tmp/{$fileName}.php",
4141
"Result of proceeded fixture fixtures/{$fileName} is not equal to expected.",
4242
);
4343
}
@@ -61,7 +61,7 @@ protected function runFixer(string $name): bool
6161

6262
protected function clearTempDirectory(): void
6363
{
64-
$files = glob(__DIR__ . '/tmp/*.php');
64+
$files = glob(__DIR__.'/tmp/*.php');
6565

6666
foreach ($files as $file) {
6767
unlink($file);

0 commit comments

Comments
 (0)