Skip to content

Commit 4b68da3

Browse files
Merge branch '6.4' into 7.0
* 6.4: [DependencyInjection] Remove inaccurate `@throws` on `Container::get()` Add annotation -> attribute aliases
2 parents 6e8975b + 61023a7 commit 4b68da3

File tree

100 files changed

+659
-454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+659
-454
lines changed

src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/SerializerModelFixture.php

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

33
namespace Symfony\Bridge\Twig\Tests\Extension\Fixtures;
44

5-
use Symfony\Component\Serializer\Annotation\Groups;
5+
use Symfony\Component\Serializer\Attribute\Groups;
66

77
/**
88
* @author Jesse Rushlow <jr@rushlow.dev>

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/RoutingConditionServiceBundle/Controller/DefaultController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\RoutingConditionServiceBundle\Controller;
1313

1414
use Symfony\Component\HttpFoundation\Response;
15-
use Symfony\Component\Routing\Annotation\Route;
15+
use Symfony\Component\Routing\Attribute\Route;
1616

1717
class DefaultController
1818
{

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/AnnotatedController.php

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

1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Response;
16-
use Symfony\Component\Routing\Annotation\Route;
16+
use Symfony\Component\Routing\Attribute\Route;
1717

1818
class AnnotatedController
1919
{

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/UidController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller;
1313

1414
use Symfony\Component\HttpFoundation\Response;
15-
use Symfony\Component\Routing\Annotation\Route;
15+
use Symfony\Component\Routing\Attribute\Route;
1616
use Symfony\Component\Uid\Ulid;
1717
use Symfony\Component\Uid\UuidV1;
1818

src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/flex-style/src/FlexStyleMicroKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Symfony\Component\Filesystem\Filesystem;
1919
use Symfony\Component\HttpFoundation\Response;
2020
use Symfony\Component\HttpKernel\Kernel;
21-
use Symfony\Component\Routing\Annotation\Route;
21+
use Symfony\Component\Routing\Attribute\Route;
2222
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
2323

2424
class FlexStyleMicroKernel extends Kernel

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ public function has(string $id): bool
192192
*
193193
* @throws ServiceCircularReferenceException When a circular reference is detected
194194
* @throws ServiceNotFoundException When the service is not defined
195-
* @throws \Exception if an exception has been thrown when the service has been resolved
196195
*
197196
* @see Reference
198197
*/

src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php

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

1212
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
1313

14-
use Symfony\Component\Serializer\Annotation\Groups;
14+
use Symfony\Component\Serializer\Attribute\Groups;
1515

1616
/**
1717
* @author Kévin Dunglas <dunglas@gmail.com>

src/Symfony/Component/PropertyInfo/Tests/Fixtures/IgnorePropertyDummy.php

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

1212
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
1313

14-
use Symfony\Component\Serializer\Annotation\Groups;
15-
use Symfony\Component\Serializer\Annotation\Ignore;
14+
use Symfony\Component\Serializer\Attribute\Groups;
15+
use Symfony\Component\Serializer\Attribute\Ignore;
1616

1717
/**
1818
* @author Vadim Borodavko <vadim.borodavko@gmail.com>

src/Symfony/Component/Routing/Annotation/Route.php

Lines changed: 5 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -11,182 +11,13 @@
1111

1212
namespace Symfony\Component\Routing\Annotation;
1313

14-
/**
15-
* @author Fabien Potencier <fabien@symfony.com>
16-
* @author Alexander M. Turek <me@derrabus.de>
17-
*/
18-
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)]
19-
class Route
20-
{
21-
private ?string $path = null;
22-
private array $localizedPaths = [];
23-
private array $methods;
24-
private array $schemes;
25-
26-
/**
27-
* @param array<string|\Stringable> $requirements
28-
* @param string[]|string $methods
29-
* @param string[]|string $schemes
30-
*/
31-
public function __construct(
32-
string|array $path = null,
33-
private ?string $name = null,
34-
private array $requirements = [],
35-
private array $options = [],
36-
private array $defaults = [],
37-
private ?string $host = null,
38-
array|string $methods = [],
39-
array|string $schemes = [],
40-
private ?string $condition = null,
41-
private ?int $priority = null,
42-
string $locale = null,
43-
string $format = null,
44-
bool $utf8 = null,
45-
bool $stateless = null,
46-
private ?string $env = null
47-
) {
48-
if (\is_array($path)) {
49-
$this->localizedPaths = $path;
50-
} else {
51-
$this->path = $path;
52-
}
53-
$this->setMethods($methods);
54-
$this->setSchemes($schemes);
55-
56-
if (null !== $locale) {
57-
$this->defaults['_locale'] = $locale;
58-
}
59-
60-
if (null !== $format) {
61-
$this->defaults['_format'] = $format;
62-
}
63-
64-
if (null !== $utf8) {
65-
$this->options['utf8'] = $utf8;
66-
}
67-
68-
if (null !== $stateless) {
69-
$this->defaults['_stateless'] = $stateless;
70-
}
71-
}
72-
73-
public function setPath(string $path): void
74-
{
75-
$this->path = $path;
76-
}
77-
78-
public function getPath(): ?string
79-
{
80-
return $this->path;
81-
}
82-
83-
public function setLocalizedPaths(array $localizedPaths): void
84-
{
85-
$this->localizedPaths = $localizedPaths;
86-
}
87-
88-
public function getLocalizedPaths(): array
89-
{
90-
return $this->localizedPaths;
91-
}
14+
// do not deprecate in 6.4/7.0, to make it easier for the ecosystem to support 6.4, 7.4 and 8.0 simultaneously
9215

93-
public function setHost(string $pattern): void
94-
{
95-
$this->host = $pattern;
96-
}
97-
98-
public function getHost(): ?string
99-
{
100-
return $this->host;
101-
}
102-
103-
public function setName(string $name): void
104-
{
105-
$this->name = $name;
106-
}
107-
108-
public function getName(): ?string
109-
{
110-
return $this->name;
111-
}
112-
113-
public function setRequirements(array $requirements): void
114-
{
115-
$this->requirements = $requirements;
116-
}
117-
118-
public function getRequirements(): array
119-
{
120-
return $this->requirements;
121-
}
122-
123-
public function setOptions(array $options): void
124-
{
125-
$this->options = $options;
126-
}
127-
128-
public function getOptions(): array
129-
{
130-
return $this->options;
131-
}
132-
133-
public function setDefaults(array $defaults): void
134-
{
135-
$this->defaults = $defaults;
136-
}
137-
138-
public function getDefaults(): array
139-
{
140-
return $this->defaults;
141-
}
142-
143-
public function setSchemes(array|string $schemes): void
144-
{
145-
$this->schemes = (array) $schemes;
146-
}
147-
148-
public function getSchemes(): array
149-
{
150-
return $this->schemes;
151-
}
152-
153-
public function setMethods(array|string $methods): void
154-
{
155-
$this->methods = (array) $methods;
156-
}
157-
158-
public function getMethods(): array
159-
{
160-
return $this->methods;
161-
}
162-
163-
public function setCondition(?string $condition): void
164-
{
165-
$this->condition = $condition;
166-
}
167-
168-
public function getCondition(): ?string
169-
{
170-
return $this->condition;
171-
}
172-
173-
public function setPriority(int $priority): void
174-
{
175-
$this->priority = $priority;
176-
}
177-
178-
public function getPriority(): ?int
179-
{
180-
return $this->priority;
181-
}
182-
183-
public function setEnv(?string $env): void
184-
{
185-
$this->env = $env;
186-
}
16+
class_exists(\Symfony\Component\Routing\Attribute\Route::class);
18717

188-
public function getEnv(): ?string
18+
if (false) {
19+
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)]
20+
class Route
18921
{
190-
return $this->env;
19122
}
19223
}

0 commit comments

Comments
 (0)