Skip to content

Commit dbfaf0b

Browse files
author
Emil Masiakowski
committed
Fix code style
1 parent c82446b commit dbfaf0b

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

.php-cs-fixer.dist.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'modernize_types_casting' => true, // Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator.
2525
'multiline_whitespace_before_semicolons' => true, // Forbid multi-line whitespace before the closing semicolon or move the semicolon to the new line for chained calls.
2626
'no_unreachable_default_argument_value' => true, // In function arguments there must not be arguments with default values before non-default ones.
27-
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],// To avoid problems of compatibility with the old php-cs-fixer version used on PHP 7.3
27+
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], // To avoid problems of compatibility with the old php-cs-fixer version used on PHP 7.3
2828
'no_useless_else' => true,
2929
'no_useless_return' => true,
3030
'ordered_class_elements' => true, // Orders the elements of classes/interfaces/traits.
@@ -40,5 +40,8 @@
4040
'list_syntax' => ['syntax' => 'short'],
4141
'phpdoc_to_comment' => false,
4242
'php_unit_method_casing' => ['case' => 'snake_case'],
43-
'function_to_constant' => false
43+
'function_to_constant' => false,
44+
'trailing_comma_in_multiline' => [
45+
'elements' => ['array_destructuring', 'arrays'],
46+
],
4447
]);

src/Analyzer/ClassDescription.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class ClassDescription
4444
/**
4545
* @param list<ClassDependency> $dependencies
4646
* @param list<FullyQualifiedClassName> $interfaces
47-
* @param ?FullyQualifiedClassName $extends
4847
* @param list<FullyQualifiedClassName> $attributes
4948
*/
5049
public function __construct(

src/CLI/Command/Check.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
125125
$this->printHeadingLine($output);
126126

127127
$rulesFilename = $this->getConfigFilename($input);
128-
$output->writeln(sprintf("Config file: %s\n", $rulesFilename));
128+
$output->writeln(\sprintf("Config file: %s\n", $rulesFilename));
129129

130130
$config = new Config();
131131

@@ -239,14 +239,14 @@ private function getConfigFilename(InputInterface $input): string
239239
private function printViolations(Violations $violations, OutputInterface $output): void
240240
{
241241
$output->writeln('<error>ERRORS!</error>');
242-
$output->writeln(sprintf('%s', $violations->toString()));
243-
$output->writeln(sprintf('<error>%s VIOLATIONS DETECTED!</error>', \count($violations)));
242+
$output->writeln(\sprintf('%s', $violations->toString()));
243+
$output->writeln(\sprintf('<error>%s VIOLATIONS DETECTED!</error>', \count($violations)));
244244
}
245245

246246
private function printParsedErrors(ParsingErrors $parsingErrors, OutputInterface $output): void
247247
{
248248
$output->writeln('<error>ERROR ON PARSING THESE FILES:</error>');
249-
$output->writeln(sprintf('%s', $parsingErrors->toString()));
249+
$output->writeln(\sprintf('%s', $parsingErrors->toString()));
250250
}
251251

252252
private function printNoViolationsDetectedMessage(OutputInterface $output): void

src/CLI/PhpArkitectApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public function __construct()
2828

2929
public function getLongVersion(): string
3030
{
31-
return sprintf("%s\n\n<info>%s</info> version <comment>%s</comment>", self::$logo, $this->getName(), $this->getVersion());
31+
return \sprintf("%s\n\n<info>%s</info> version <comment>%s</comment>", self::$logo, $this->getName(), $this->getVersion());
3232
}
3333
}

src/Exceptions/IndexNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class IndexNotFoundException extends \Exception
77
{
88
public function __construct(int $index)
99
{
10-
parent::__construct(sprintf('Index not found %d', $index));
10+
parent::__construct(\sprintf('Index not found %d', $index));
1111
}
1212
}

src/Exceptions/PhpVersionNotValidException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class PhpVersionNotValidException extends \Exception
77
{
88
public function __construct(string $phpVersion)
99
{
10-
parent::__construct(sprintf('PHP version not valid for PHPArkitect parser %s', $phpVersion));
10+
parent::__construct(\sprintf('PHP version not valid for PHPArkitect parser %s', $phpVersion));
1111
}
1212
}

tests/Unit/Rules/ConstraintsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ConstraintsTest extends TestCase
1818
{
1919
public function test_it_should_not_add_to_violation_if_constraint_is_not_violated(): void
2020
{
21-
$trueExpression = new class() implements Expression {
21+
$trueExpression = new class implements Expression {
2222
public function describe(ClassDescription $theClass, string $because): Description
2323
{
2424
return new Description('', '');
@@ -48,7 +48,7 @@ public function evaluate(ClassDescription $theClass, Violations $violations, str
4848

4949
public function test_it_should_add_to_violation_store_if_constraint_is_violated(): void
5050
{
51-
$falseExpression = new class() implements Expression {
51+
$falseExpression = new class implements Expression {
5252
public function describe(ClassDescription $theClass, string $because): Description
5353
{
5454
return new Description('bar', 'we want to add this rule');

0 commit comments

Comments
 (0)