Skip to content

Commit 281d186

Browse files
Merge pull request #1 from WebdevCave/analysis-o7RvPg
Apply fixes from StyleCI
2 parents 1351bda + b82fa40 commit 281d186

File tree

10 files changed

+20
-23
lines changed

10 files changed

+20
-23
lines changed

src/Annotations/Inject.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class Inject
99
{
1010
public function __construct(
1111
public readonly ?string $index = null
12-
)
13-
{
12+
) {
1413
}
1514
}

src/Annotations/Provides.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class Provides
99
{
1010
public function __construct(
1111
public readonly string $index
12-
)
13-
{
12+
) {
1413
}
1514
}

src/Exceptions/ContainerException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class ContainerException extends Exception implements ContainerExceptionInterface
99
{
10-
1110
}

src/Exceptions/NotFoundException.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class NotFoundException extends Exception implements NotFoundExceptionInterface
99
{
10-
1110
}

src/ServiceContainer.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public function addAlias(string $alias, string $concrete): void
7171
*
7272
* @param T $id Identifier of the entry to look for.
7373
*
74-
* @return T
7574
* @throws ContainerExceptionInterface Error while retrieving the entry.
76-
*
7775
* @throws NotFoundExceptionInterface No entry was found for **this** identifier.
76+
*
77+
* @return T
7878
*/
7979
public function get(string $id): mixed
8080
{
@@ -124,10 +124,11 @@ public function has(string $id): bool
124124
* @param callable $function
125125
* @param array $arguments
126126
*
127-
* @return mixed
128127
* @throws ContainerExceptionInterface
129128
* @throws NotFoundExceptionInterface
130129
* @throws ReflectionException
130+
*
131+
* @return mixed
131132
*/
132133
public function invoke(callable $function, array $arguments = []): mixed
133134
{
@@ -142,8 +143,9 @@ public function invoke(callable $function, array $arguments = []): mixed
142143
* @param string $namespace
143144
* @param bool $enforce
144145
*
145-
* @return void
146146
* @throws ReflectionException
147+
*
148+
* @return void
147149
*/
148150
public function loadDefinitionsFromDirectory(string $directory, string $namespace, bool $enforce = false): void
149151
{
@@ -167,15 +169,16 @@ public function loadDefinitionsFromDirectory(string $directory, string $namespac
167169
* @param ReflectionMethod|ReflectionFunction $reflectionMethod
168170
* @param array $arguments
169171
*
170-
* @return array
171172
* @throws ContainerExceptionInterface
172173
* @throws NotFoundExceptionInterface
173174
* @throws ReflectionException
175+
*
176+
* @return array
174177
*/
175178
private function createArguments(
176-
ReflectionMethod|ReflectionFunction $reflectionMethod, array $arguments = []
177-
): array
178-
{
179+
ReflectionMethod|ReflectionFunction $reflectionMethod,
180+
array $arguments = []
181+
): array {
179182
foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
180183
$argumentName = $reflectionParameter->getName();
181184

tests/ExampleNamespace/ClassB.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ class ClassB
99
public function __construct(
1010
public ClassA $a,
1111
public int $count = 2
12-
)
13-
{
12+
) {
1413
static::increaseCounter();
1514
}
16-
}
15+
}

tests/ExampleNamespace/ClassC.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ class ClassC
99
public function __construct(
1010
public ClassA $a,
1111
public ClassB $b
12-
)
13-
{
12+
) {
1413
static::increaseCounter();
1514
}
1615

1716
public function sayHello()
1817
{
19-
echo "Hello World!";
18+
echo 'Hello World!';
2019
}
2120
}

tests/ExampleNamespace/CountsInstancesTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ trait CountsInstancesTrait
88

99
public static function increaseCounter(): void
1010
{
11-
static::$instancesCounter ++;
11+
static::$instancesCounter++;
1212
}
1313

1414
public static function resetCounter(): void
1515
{
1616
static::$instancesCounter = 0;
1717
}
18-
}
18+
}

tests/ExampleNamespace/InterfaceA.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
interface InterfaceA
66
{
7-
87
}

tests/ServiceContainerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
class ServiceContainerTest extends TestCase
1414
{
1515
private ?ServiceContainer $container;
16+
1617
public function testInstancing(): void
1718
{
1819
$this->assertInstanceOf(ClassA::class, $this->container->get(ClassA::class));

0 commit comments

Comments
 (0)