Skip to content
/ boot Public

Commit 52ecdd2

Browse files
committed
Fix code style (#1248)
1 parent 6810d3a commit 52ecdd2

File tree

10 files changed

+53
-53
lines changed

10 files changed

+53
-53
lines changed

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
],
3535
"require": {
3636
"php": ">=8.1",
37-
"spiral/core": "^3.16",
38-
"spiral/files": "^3.16",
39-
"spiral/config": "^3.16",
40-
"spiral/debug": "^3.16",
41-
"spiral/exceptions": "^3.16",
37+
"spiral/core": "^3.17",
38+
"spiral/files": "^3.17",
39+
"spiral/config": "^3.17",
40+
"spiral/debug": "^3.17",
41+
"spiral/exceptions": "^3.17",
4242
"spiral/attributes": "^2.8|^3.0",
43-
"spiral/events": "^3.16"
43+
"spiral/events": "^3.17"
4444
},
4545
"require-dev": {
4646
"phpunit/phpunit": "^10.5.41",
@@ -62,7 +62,7 @@
6262
},
6363
"extra": {
6464
"branch-alias": {
65-
"dev-master": "3.16.x-dev"
65+
"dev-master": "3.17.x-dev"
6666
}
6767
},
6868
"config": {

src/Attribute/AbstractMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/**
88
* Abstract base class for method attributes used in bootloaders.
9-
*
9+
*
1010
* This abstract class serves as a base for all method-level attributes in the bootloader system,
1111
* providing common functionality for managing binding aliases.
1212
*

src/Attribute/BindAlias.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
/**
88
* Attribute to define additional aliases for a method.
9-
*
9+
*
1010
* This attribute allows defining multiple aliases for a method in a bootloader class.
1111
* It can be used to bind a method's return value to multiple interface or class names.
12-
*
12+
*
1313
* This attribute can be applied multiple times to the same method.
14-
*
14+
*
1515
* Example usage:
1616
* ```php
1717
* class MyBootloader extends Bootloader
@@ -24,8 +24,8 @@
2424
* }
2525
* }
2626
* ```
27-
*
28-
* The above example binds the returned Logger instance to LoggerInterface,
27+
*
28+
* The above example binds the returned Logger instance to LoggerInterface,
2929
* PsrLoggerInterface, and MonologLoggerInterface.
3030
*/
3131
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]

src/Attribute/BindMethod.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
/**
88
* Attribute for marking methods that provide container bindings.
9-
*
9+
*
1010
* Methods marked with this attribute will be invoked each time the container
1111
* needs to resolve the dependency, creating a new instance each time.
1212
* The return value of the method will be bound to the specified alias
1313
* or to all interfaces/classes in the return type.
14-
*
14+
*
1515
* Example usage:
1616
* ```php
1717
* class MyBootloader extends Bootloader
@@ -22,15 +22,15 @@
2222
* {
2323
* return new HttpClient();
2424
* }
25-
*
25+
*
2626
* // Method will be called each time the container resolves DbFactory
2727
* // instead of its return type (DatabaseFactory)
2828
* #[BindMethod(alias: DbFactory::class)]
2929
* public function createDatabaseFactory(): DatabaseFactory
3030
* {
3131
* return new DatabaseFactory();
3232
* }
33-
*
33+
*
3434
* // Method will be called each time the container resolves either
3535
* // LogManagerInterface or its return type (LogManager)
3636
* #[BindMethod(alias: LogManagerInterface::class, aliasesFromReturnType: true)]
@@ -40,10 +40,10 @@
4040
* }
4141
* }
4242
* ```
43-
*
43+
*
4444
* This attribute is similar to defining bindings via the `defineBindings()` method,
4545
* but with a more expressive and type-safe approach.
46-
*
46+
*
4747
* @see SingletonMethod For binding singleton instances
4848
* @see InjectorMethod For binding injector methods
4949
*/

src/Attribute/BootMethod.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
/**
88
* Attribute for marking methods that should be called during the boot phase.
9-
*
9+
*
1010
* Methods marked with this attribute will be called during the bootloader's
1111
* boot phase, after all initialization methods have been called.
1212
* The boot phase is where you typically configure services, register event listeners,
1313
* or perform other setup tasks.
14-
*
14+
*
1515
* The priority parameter determines the order in which boot methods are called.
1616
* Higher priority values are executed first.
17-
*
17+
*
1818
* Example usage:
1919
* ```php
2020
* class MyBootloader extends Bootloader
@@ -25,14 +25,14 @@
2525
* {
2626
* $router->addRoute('home', '/');
2727
* }
28-
*
28+
*
2929
* // Called during boot phase with high priority (10)
3030
* #[BootMethod(priority: 10)]
3131
* public function configureDatabase(DatabaseInterface $db): void
3232
* {
3333
* $db->setDefaultConnection('default');
3434
* }
35-
*
35+
*
3636
* // Called during boot phase with low priority (-10)
3737
* #[BootMethod(priority: -10)]
3838
* public function registerEventListeners(EventDispatcherInterface $dispatcher): void
@@ -41,9 +41,9 @@
4141
* }
4242
* }
4343
* ```
44-
*
44+
*
4545
* Boot methods are executed after all bootloaders' init methods have been called.
46-
*
46+
*
4747
* @see InitMethod For methods to be called during initialization phase
4848
*/
4949
#[\Attribute(\Attribute::TARGET_METHOD)]

src/Attribute/BootloadConfig.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
/**
88
* Attribute to configure bootloader behavior.
9-
*
9+
*
1010
* This attribute allows defining configuration for bootloaders, including
1111
* constructor arguments, enabling/disabling based on environment variables,
1212
* and controlling how configuration overrides work.
13-
*
13+
*
1414
* Example usage:
1515
* ```php
1616
* // Basic configuration with constructor arguments
@@ -20,10 +20,10 @@
2020
* public function __construct(
2121
* private readonly string $defaultConnection
2222
* ) {}
23-
*
23+
*
2424
* // ...
2525
* }
26-
*
26+
*
2727
* // Conditionally enable based on environment
2828
* #[BootloadConfig(
2929
* allowEnv: ['APP_ENV' => ['local', 'development']],
@@ -34,7 +34,7 @@
3434
* // Only loaded in local or development environments
3535
* // And not when TESTING is true
3636
* }
37-
*
37+
*
3838
* // Prevent runtime configuration from overriding attribute configuration
3939
* #[BootloadConfig(args: ['debug' => true], override: false)]
4040
* class DebugBootloader extends Bootloader
@@ -43,7 +43,7 @@
4343
* // configuration is provided at runtime
4444
* }
4545
* ```
46-
*
46+
*
4747
* When a bootloader has both runtime configuration and a BootloadConfig attribute,
4848
* the override parameter controls which configuration takes precedence.
4949
*/

src/Attribute/InitMethod.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
/**
88
* Attribute for marking methods that should be called during the initialization phase.
9-
*
9+
*
1010
* Methods marked with this attribute will be called during the bootloader's
1111
* initialization phase, before the boot phase begins. This is where you typically
1212
* set up container bindings, register services, or perform other initialization tasks.
13-
*
13+
*
1414
* The priority parameter determines the order in which init methods are called.
1515
* Higher priority values are executed first.
16-
*
16+
*
1717
* Example usage:
1818
* ```php
1919
* class MyBootloader extends Bootloader
@@ -24,14 +24,14 @@
2424
* {
2525
* $container->bindSingleton(MyService::class, MyServiceImplementation::class);
2626
* }
27-
*
27+
*
2828
* // Called during initialization phase with high priority (10)
2929
* #[InitMethod(priority: 10)]
3030
* public function setupCore(): void
3131
* {
3232
* // Setup core components first
3333
* }
34-
*
34+
*
3535
* // Called during initialization phase with low priority (-10)
3636
* #[InitMethod(priority: -10)]
3737
* public function setupExtensions(): void
@@ -40,9 +40,9 @@
4040
* }
4141
* }
4242
* ```
43-
*
43+
*
4444
* Init methods are executed before any bootloader's boot methods are called.
45-
*
45+
*
4646
* @see BootMethod For methods to be called during boot phase
4747
*/
4848
#[\Attribute(\Attribute::TARGET_METHOD)]

src/Attribute/InjectorMethod.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
/**
88
* Attribute for marking methods that provide a custom injector.
9-
*
9+
*
1010
* Methods marked with this attribute will be used as injectors for the specified
1111
* alias type. An injector is responsible for creating and configuring instances
1212
* of a specific type when they're requested from the container.
13-
*
13+
*
1414
* Unlike BindMethod and SingletonMethod which bind the return value of the method,
1515
* InjectorMethod binds the method itself as an injector for the specified type.
16-
*
16+
*
1717
* Example usage:
1818
* ```php
1919
* class MyBootloader extends Bootloader
@@ -24,7 +24,7 @@
2424
* {
2525
* return new Logger($channel);
2626
* }
27-
*
27+
*
2828
* // Method will be used as injector for ConnectionInterface
2929
* #[InjectorMethod(ConnectionInterface::class)]
3030
* public function createDatabaseConnection(string $name = null): ConnectionInterface
@@ -35,13 +35,13 @@
3535
* }
3636
* }
3737
* ```
38-
*
38+
*
3939
* With the above example, any time a LoggerInterface is requested from the container,
4040
* the createLogger method will be called with any provided constructor arguments.
41-
*
41+
*
4242
* Injectors are powerful for types that need custom creation logic or that
4343
* accept additional parameters during construction.
44-
*
44+
*
4545
* @see BindMethod For simple method bindings
4646
* @see SingletonMethod For singleton method bindings
4747
*/

src/Attribute/SingletonMethod.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
/**
88
* Attribute for marking methods that provide singleton container bindings.
9-
*
9+
*
1010
* Methods marked with this attribute will be invoked only once, and the
1111
* return value will be cached and reused for subsequent resolutions.
1212
* The return value of the method will be bound to the specified alias
1313
* or to all interfaces/classes in the return type.
14-
*
14+
*
1515
* Example usage:
1616
* ```php
1717
* class MyBootloader extends Bootloader
@@ -22,15 +22,15 @@
2222
* {
2323
* return new HttpClient();
2424
* }
25-
*
25+
*
2626
* // Method will be called once and the result will be bound to DbFactory
2727
* // instead of its return type (DatabaseFactory)
2828
* #[SingletonMethod(alias: DbFactory::class)]
2929
* public function createDatabaseFactory(): DatabaseFactory
3030
* {
3131
* return new DatabaseFactory();
3232
* }
33-
*
33+
*
3434
* // Method will be called once and the result will be bound to both
3535
* // LogManagerInterface and its return type (LogManager)
3636
* #[SingletonMethod(alias: LogManagerInterface::class, aliasesFromReturnType: true)]
@@ -40,10 +40,10 @@
4040
* }
4141
* }
4242
* ```
43-
*
43+
*
4444
* This attribute is similar to defining singletons via the `defineSingletons()` method,
4545
* but with a more expressive and type-safe approach.
46-
*
46+
*
4747
* @see BindMethod For non-singleton bindings
4848
* @see InjectorMethod For binding injector methods
4949
*/

src/Injector/EnumInjector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use UnitEnum;
1313

1414
/**
15-
* @implements InjectorInterface<UnitEnum>
15+
* @implements InjectorInterface<\UnitEnum>
1616
*
1717
* @internal
1818
*/

0 commit comments

Comments
 (0)