Skip to content

Commit b38b806

Browse files
committed
ecs: add to makefile and IDE
1 parent 2b7cfef commit b38b806

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

ecs.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use CodelyTv\CodingStyle;
44
use PhpCsFixer\Fixer\ClassNotation\FinalClassFixer;
5+
use PhpCsFixer\Fixer\ClassNotation\SelfStaticAccessorFixer;
56
use Symplify\EasyCodingStandard\Config\ECSConfig;
67

78
return function (ECSConfig $ecsConfig): void {
@@ -13,7 +14,7 @@
1314
FinalClassFixer::class => [
1415
__DIR__ . '/src/Shared/Types/Domain/',
1516
],
16-
\PhpCsFixer\Fixer\ClassNotation\SelfStaticAccessorFixer::class => [
17+
SelfStaticAccessorFixer::class => [
1718
__DIR__ . '/src/Shared/Types/Domain/',
1819
],
1920
]);

makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,7 @@ install: ## Install dependencies
6868
.PHONY: test
6969
test: ## Execute unit test
7070
$(DOCKER_COMPOSE_RUN) php bin/phpunit
71+
72+
.PHONY: ecs
73+
ecs: ## Run ecs
74+
$(DOCKER_COMPOSE_RUN) ./vendor/bin/ecs check --fix

src/Shared/Types/Domain/Scalar/IntegerValue.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ public function __construct(int $value)
1818

1919
public static function createFromInt(int $value)
2020
{
21-
return new static($value);
21+
return new static($value);
2222
}
2323

2424
public function value(): int
2525
{
2626
return $this->value;
2727
}
2828

29-
protected function guard(int $value): void
29+
protected function guard(int $value): void
3030
{
3131
Assert::integer($value, 'It\'s not integer value');
3232
}
3333

3434
public static function random(): static
3535
{
36-
return new static(self::randomValue());
36+
return new static(self::randomValue());
3737
}
3838

3939
protected static function randomValue(): int

src/Shared/Types/Domain/Scalar/NaturalInteger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static function createFromInt(int $value)
1515

1616
public static function random(): static
1717
{
18-
return new static(static::randomValue());
18+
return new static(static::randomValue());
1919
}
2020

2121
protected function guard(int $value): void

src/Shared/Types/Domain/Scalar/StringValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static function create(string $value): static
3636
return new static($value);
3737
}
3838

39-
public static function random(): StringValue
39+
public static function random(): self
4040
{
4141
return new static(static::randomValue());
4242
}

0 commit comments

Comments
 (0)