Skip to content

Commit a4f9266

Browse files
committed
fabot
1 parent 92e008e commit a4f9266

File tree

8 files changed

+20
-23
lines changed

8 files changed

+20
-23
lines changed

src/TwigComponent/src/Attribute/AsTwigComponent.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ public function serviceConfig(): array
8282
* @return \ReflectionMethod[]
8383
*
8484
* @internal
85-
*
86-
* @deprecated since 2.22 - to be removed in 3.0
8785
*/
8886
protected static function attributeMethodsByPriorityFor(object|string $component, string $attributeClass): array
8987
{
@@ -100,8 +98,6 @@ protected static function attributeMethodsByPriorityFor(object|string $component
10098
* @return \Traversable<\ReflectionMethod>
10199
*
102100
* @internal
103-
*
104-
* @deprecated since 2.22 - to be removed in 3.0
105101
*/
106102
protected static function attributeMethodsFor(string $attribute, object|string $component): \Traversable
107103
{

src/TwigComponent/src/ComponentFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private function mount(object $component, array &$data, ComponentMetadata $compo
165165
} elseif ($refParameter->isDefaultValueAvailable()) {
166166
$parameters[] = $refParameter->getDefaultValue();
167167
} else {
168-
throw new \LogicException(\sprintf('%s::mount() has a required $%s parameter. Make sure to pass it or give it a default value.', $component::class, $name));
168+
throw new \LogicException(\sprintf('%s() has a required $%s parameter. Make sure to pass it or give it a default value.', $component::class.'::mount()', $name));
169169
}
170170
}
171171

src/TwigComponent/src/ComponentMetadata.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getAttributesVar(): string
6969

7070
/**
7171
* @return list<string>
72-
*
72+
*
7373
* @internal
7474
*/
7575
public function getPreMounts(): array
@@ -79,7 +79,7 @@ public function getPreMounts(): array
7979

8080
/**
8181
* @return list<string>
82-
*
82+
*
8383
* @internal
8484
*/
8585
public function getMounts(): array
@@ -89,7 +89,7 @@ public function getMounts(): array
8989

9090
/**
9191
* @return list<string>
92-
*
92+
*
9393
* @internal
9494
*/
9595
public function getPostMounts(): array

src/TwigComponent/src/DependencyInjection/Compiler/TwigComponentPass.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ private function calculateTemplate(string $componentName, ?array $defaults): str
114114

115115
/**
116116
* @param class-string $component
117+
*
117118
* @return array{preMount: string[], mount: string[], postMount: string[]}
118119
*/
119120
private function getMountMethods(string $component): array
@@ -131,9 +132,9 @@ private function getMountMethods(string $component): array
131132
}
132133
}
133134

134-
arsort($preMount, SORT_NUMERIC);
135-
arsort($mount, SORT_NUMERIC);
136-
arsort($postMount, SORT_NUMERIC);
135+
arsort($preMount, \SORT_NUMERIC);
136+
arsort($mount, \SORT_NUMERIC);
137+
arsort($postMount, \SORT_NUMERIC);
137138

138139
return [
139140
'pre_mount' => array_keys($preMount),

src/TwigComponent/tests/Integration/ComponentFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function testExceptionThrownIfRequiredMountParameterIsMissingFromPassedDa
9494

9595
public function testStringableObjectCanBePassedToComponent(): void
9696
{
97-
$attributes = $this->factory()->create('component_a', ['propB' => 'B', 'data-item-id-param' => new class () {
97+
$attributes = $this->factory()->create('component_a', ['propB' => 'B', 'data-item-id-param' => new class {
9898
public function __toString(): string
9999
{
100100
return 'test';

src/TwigComponent/tests/Unit/ComponentAttributesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testCanConvertToString(): void
2727
{
2828
$attributes = new ComponentAttributes([
2929
'class' => 'foo',
30-
'style' => new class () {
30+
'style' => new class {
3131
public function __toString(): string
3232
{
3333
return 'color:black;';
@@ -216,7 +216,7 @@ public function testRenderSingleAttribute(): void
216216
public function testRenderingSingleAttributeExcludesFromString(): void
217217
{
218218
$attributes = new ComponentAttributes([
219-
'attr1' => new class () {
219+
'attr1' => new class {
220220
public function __toString(): string
221221
{
222222
return 'value1';

src/TwigComponent/tests/Unit/ComputedPropertiesProxyTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class ComputedPropertiesProxyTest extends TestCase
2121
{
2222
public function testProxyCachesGetMethodReturns(): void
2323
{
24-
$proxy = new ComputedPropertiesProxy(new class () {
24+
$proxy = new ComputedPropertiesProxy(new class {
2525
private int $count = 0;
2626

2727
public function getCount(): int
@@ -37,7 +37,7 @@ public function getCount(): int
3737

3838
public function testProxyCachesIsMethodReturns(): void
3939
{
40-
$proxy = new ComputedPropertiesProxy(new class () {
40+
$proxy = new ComputedPropertiesProxy(new class {
4141
private int $count = 0;
4242

4343
public function isCount(): int
@@ -53,7 +53,7 @@ public function isCount(): int
5353

5454
public function testProxyCachesHasMethodReturns(): void
5555
{
56-
$proxy = new ComputedPropertiesProxy(new class () {
56+
$proxy = new ComputedPropertiesProxy(new class {
5757
private int $count = 0;
5858

5959
public function hasCount(): int
@@ -69,7 +69,7 @@ public function hasCount(): int
6969

7070
public function testCanProxyPublicProperties(): void
7171
{
72-
$proxy = new ComputedPropertiesProxy(new class () {
72+
$proxy = new ComputedPropertiesProxy(new class {
7373
public $foo = 'bar';
7474
});
7575

@@ -78,7 +78,7 @@ public function testCanProxyPublicProperties(): void
7878

7979
public function testCanProxyArrayAccess(): void
8080
{
81-
$proxy = new ComputedPropertiesProxy(new class () implements \ArrayAccess {
81+
$proxy = new ComputedPropertiesProxy(new class implements \ArrayAccess {
8282
private $array = ['foo' => 'bar'];
8383

8484
public function offsetExists(mixed $offset): bool
@@ -105,7 +105,7 @@ public function offsetUnset(mixed $offset): void
105105

106106
public function testCannotProxyMethodsThatDoNotExist(): void
107107
{
108-
$proxy = new ComputedPropertiesProxy(new class () {});
108+
$proxy = new ComputedPropertiesProxy(new class {});
109109

110110
$this->expectException(\InvalidArgumentException::class);
111111

@@ -114,7 +114,7 @@ public function testCannotProxyMethodsThatDoNotExist(): void
114114

115115
public function testCannotPassArgumentsToProxiedMethods(): void
116116
{
117-
$proxy = new ComputedPropertiesProxy(new class () {});
117+
$proxy = new ComputedPropertiesProxy(new class {});
118118

119119
$this->expectException(\InvalidArgumentException::class);
120120

@@ -123,7 +123,7 @@ public function testCannotPassArgumentsToProxiedMethods(): void
123123

124124
public function testCannotProxyMethodsWithRequiredArguments(): void
125125
{
126-
$proxy = new ComputedPropertiesProxy(new class () {
126+
$proxy = new ComputedPropertiesProxy(new class {
127127
public function getValue(int $value): int
128128
{
129129
return $value;

src/TwigComponent/tests/Unit/DependencyInjection/TwigComponentExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private function createContainer()
9898
'kernel.debug' => true,
9999
'kernel.project_dir' => __DIR__,
100100
'kernel.bundles' => [
101-
'TwigBundle' => new class () {},
101+
'TwigBundle' => new class {},
102102
'TwigComponentBundle' => TwigComponentBundle::class,
103103
],
104104
]));

0 commit comments

Comments
 (0)