Skip to content

Commit b788264

Browse files
committed
style: tweaks constructors
1 parent 95d5457 commit b788264

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollector.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,17 @@
2424
final class AutoRouteCollector
2525
{
2626
/**
27-
* @param string $namespace namespace to search
27+
* @param string $namespace namespace to search
28+
* @param class-string[] $protectedControllers List of controllers in Defined
29+
* Routes that should not be accessed via Auto-Routing.
30+
* @param string $prefix URI prefix for Module Routing
2831
*/
2932
public function __construct(
3033
private readonly string $namespace,
3134
private readonly string $defaultController,
3235
private readonly string $defaultMethod,
3336
private readonly array $httpMethods,
34-
/**
35-
* List of controllers in Defined Routes that should not be accessed via Auto-Routing.
36-
*
37-
* @var class-string[]
38-
*/
3937
private readonly array $protectedControllers,
40-
/**
41-
* @var string URI prefix for Module Routing
42-
*/
4338
private string $prefix = ''
4439
) {
4540
}

system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ final class ControllerMethodReader
2828
private readonly bool $translateUriToCamelCase;
2929

3030
/**
31-
* @param string $namespace the default namespace
31+
* @param string $namespace the default namespace
32+
* @param list<string> $httpMethods
3233
*/
33-
public function __construct(private readonly string $namespace, /**
34-
* @var list<string>
35-
*/
36-
private readonly array $httpMethods)
37-
{
34+
public function __construct(
35+
private readonly string $namespace,
36+
private readonly array $httpMethods
37+
) {
3838
$config = config(Routing::class);
3939
$this->translateURIDashes = $config->translateURIDashes;
4040
$this->translateUriToCamelCase = $config->translateUriToCamelCase;

system/Commands/Utilities/Routes/ControllerFinder.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ final class ControllerFinder
2828
/**
2929
* @param string $namespace namespace to search
3030
*/
31-
public function __construct(private readonly string $namespace)
32-
{
31+
public function __construct(
32+
private readonly string $namespace
33+
) {
3334
$this->locator = Services::locator();
3435
}
3536

system/DataCaster/DataCaster.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,13 @@ final class DataCaster
6161
/**
6262
* @param array<string, class-string>|null $castHandlers Custom convert handlers
6363
* @param array<string, string>|null $types [field => type]
64+
* @param object|null $helper Helper object.
65+
* @param bool $strict Strict mode? Set to false for casts for Entity.
6466
*/
6567
public function __construct(
6668
?array $castHandlers = null,
6769
?array $types = null,
68-
/**
69-
* Helper object.
70-
*/
7170
private readonly ?object $helper = null,
72-
/**
73-
* Strict mode? Set to false for casts for Entity.
74-
*/
7571
private readonly bool $strict = true
7672
) {
7773
$this->castHandlers = array_merge($this->castHandlers, $castHandlers);

0 commit comments

Comments
 (0)