Skip to content

Commit f736723

Browse files
committed
fix(foxy): Refactor constructors and interfaces for concise syntax.
1 parent b36422d commit f736723

File tree

8 files changed

+14
-23
lines changed

8 files changed

+14
-23
lines changed

.styleci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ enabled:
1717
- combine_nested_dirname
1818
- declare_strict_types
1919
- dir_constant
20-
- fully_qualified_strict_types
20+
- empty_loop_body_braces
2121
- function_to_constant
2222
- hash_to_slash_comment
23+
- integer_literal_case
2324
- is_null
2425
- logical_operators
2526
- magic_constant_casing
@@ -56,7 +57,6 @@ enabled:
5657
- phpdoc_order
5758
- phpdoc_property
5859
- phpdoc_scalar
59-
- phpdoc_separation
6060
- phpdoc_singular_inheritdoc
6161
- phpdoc_trim
6262
- phpdoc_trim_consecutive_blank_line_separation
@@ -78,9 +78,10 @@ enabled:
7878
- trailing_comma_in_multiline_array
7979
- unalign_double_arrow
8080
- unalign_equals
81-
- empty_loop_body_braces
82-
- integer_literal_case
8381
- union_type_without_spaces
8482

8583
disabled:
8684
- function_declaration
85+
- new_with_parentheses
86+
- psr12_braces
87+
- psr12_class_definition

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/console": "^6.0|^7.0"
2222
},
2323
"require-dev": {
24-
"infection/infection": "^0.27|^0.32",
24+
"infection/infection": "^0.28|^0.32",
2525
"maglnet/composer-require-checker": "^4.7",
2626
"php-forge/support": "^0.3",
2727
"phpstan/extension-installer": "^1.4",

src/Config/Config.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ class Config
2626
* @param array $config The config.
2727
* @param array $defaults The default values.
2828
*/
29-
public function __construct(private readonly array $config, private readonly array $defaults = [])
30-
{
31-
}
29+
public function __construct(private readonly array $config, private readonly array $defaults = []) {}
3230

3331
/**
3432
* Get the config value.

src/Exception/ExceptionInterface.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
namespace Foxy\Exception;
66

7-
interface ExceptionInterface
8-
{
9-
}
7+
interface ExceptionInterface {}

src/Exception/RuntimeException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
namespace Foxy\Exception;
66

7-
class RuntimeException extends \RuntimeException implements ExceptionInterface
8-
{
9-
}
7+
class RuntimeException extends \RuntimeException implements ExceptionInterface {}

src/Solver/Solver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public function __construct(
3535
private readonly Config $config,
3636
private readonly Filesystem $fs,
3737
private readonly FallbackInterface|null $composerFallback = null,
38-
) {
39-
}
38+
) {}
4039

4140
public function setUpdatable($updatable): self
4241
{

tests/Fixtures/Asset/StubAssetManager.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public function __construct(
1919
Config $config,
2020
ProcessExecutor $executor,
2121
Filesystem $fs,
22-
) {
23-
}
22+
) {}
2423

2524
public function addDependencies(RootPackageInterface $rootPackage, array $dependencies): AssetPackageInterface
2625
{
@@ -82,7 +81,5 @@ public function setUpdatable(bool $updatable): self
8281
return $this;
8382
}
8483

85-
public function validate(): void
86-
{
87-
}
84+
public function validate(): void {}
8885
}

tests/Support/InternalMockerExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ final class InternalMockerExtension implements Extension
1515
public function bootstrap(Configuration $configuration, Facade $facade, ParameterCollection $parameters): void
1616
{
1717
$facade->registerSubscribers(
18-
new class () implements StartedSubscriber {
18+
new class implements StartedSubscriber {
1919
public function notify(Started $event): void
2020
{
2121
InternalMockerExtension::load();
2222
}
2323
},
24-
new class () implements PreparationStartedSubscriber {
24+
new class implements PreparationStartedSubscriber {
2525
public function notify(PreparationStarted $event): void
2626
{
2727
MockerState::resetState();

0 commit comments

Comments
 (0)