Skip to content

Commit 883766e

Browse files
Merge branch '5.3' into 5.4
* 5.3: Backport type fixes fix annot Backport type fixes Fix CS Avoid triggering the autoloader in Deprecation::isLegacy() fix markdown markup Backport type fixes uzb translation [DependencyInjection] Fix doc blocks [DependencyInjection] Turn $defaultDeprecationTemplate into a constant [GHA] restore phpunit-bridge job rethrow caught exception [Form] better form doc types to support static analysis
2 parents b28b63c + 6b3e305 commit 883766e

File tree

202 files changed

+398
-711
lines changed

Some content is hidden

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

202 files changed

+398
-711
lines changed

.github/workflows/phpunit-bridge.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PhpUnitBridge
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/Symfony/Bridge/PhpUnit/**'
7+
pull_request:
8+
paths:
9+
- 'src/Symfony/Bridge/PhpUnit/**'
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
lint:
17+
name: Lint
18+
runs-on: Ubuntu-20.04
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
coverage: "none"
28+
php-version: "7.1"
29+
30+
- name: Lint
31+
run: find ./src/Symfony/Bridge/PhpUnit -name '*.php' | grep -v -e /Tests/ -e ForV7 -e ForV8 -e ForV9 -e ConstraintLogicTrait | parallel -j 4 php -l {}

UPGRADE-5.2.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ Form
2222

2323
* Deprecated `PropertyPathMapper` in favor of `DataMapper` and `PropertyPathAccessor`.
2424

25-
Before:
25+
Before:
2626

27-
```php
28-
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
27+
```php
28+
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
2929

30-
$builder->setDataMapper(new PropertyPathMapper());
31-
```
30+
$builder->setDataMapper(new PropertyPathMapper());
31+
```
3232

33-
After:
33+
After:
3434

35-
```php
36-
use Symfony\Component\Form\Extension\Core\DataAccessor\PropertyPathAccessor;
37-
use Symfony\Component\Form\Extension\Core\DataMapper\DataMapper;
35+
```php
36+
use Symfony\Component\Form\Extension\Core\DataAccessor\PropertyPathAccessor;
37+
use Symfony\Component\Form\Extension\Core\DataMapper\DataMapper;
3838

39-
$builder->setDataMapper(new DataMapper(new PropertyPathAccessor()));
40-
```
39+
$builder->setDataMapper(new DataMapper(new PropertyPathAccessor()));
40+
```
4141

4242
HttpFoundation
4343
--------------

src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function configureOptions(OptionsResolver $resolver)
5050
*
5151
* @return ORMQueryBuilderLoader
5252
*/
53-
public function getLoader(ObjectManager $manager, $queryBuilder, string $class)
53+
public function getLoader(ObjectManager $manager, object $queryBuilder, string $class)
5454
{
5555
if (!$queryBuilder instanceof QueryBuilder) {
5656
throw new \TypeError(sprintf('Expected an instance of "%s", but got "%s".', QueryBuilder::class, get_debug_type($queryBuilder)));
@@ -76,7 +76,7 @@ public function getBlockPrefix()
7676
* @internal This method is public to be usable as callback. It should not
7777
* be used in user code.
7878
*/
79-
public function getQueryBuilderPartsForCachingHash($queryBuilder): ?array
79+
public function getQueryBuilderPartsForCachingHash(object $queryBuilder): ?array
8080
{
8181
if (!$queryBuilder instanceof QueryBuilder) {
8282
throw new \TypeError(sprintf('Expected an instance of "%s", but got "%s".', QueryBuilder::class, get_debug_type($queryBuilder)));

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public function updateExistingToken(PersistentTokenInterface $token, string $tok
200200
$this->conn->commit();
201201
} catch (\Exception $e) {
202202
$this->conn->rollBack();
203+
throw $e;
203204
}
204205
}
205206

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
use PHPUnit\Framework\TestCase;
1515
use PHPUnit\Framework\TestSuite;
1616
use PHPUnit\Metadata\Api\Groups;
17-
use PHPUnit\Util\Error\Handler;
1817
use PHPUnit\Util\Test;
1918
use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor;
2019
use Symfony\Component\Debug\DebugClassLoader as LegacyDebugClassLoader;
2120
use Symfony\Component\ErrorHandler\DebugClassLoader;
2221

22+
class_exists(Groups::class);
23+
2324
/**
2425
* @internal
2526
*/
@@ -203,7 +204,7 @@ public function isLegacy()
203204
}
204205

205206
$method = $this->originatingMethod();
206-
$groups = class_exists(Groups::class) ? [new Groups(), 'groups'] : [Test::class, 'getGroups'];
207+
$groups = class_exists(Groups::class, false) ? [new Groups(), 'groups'] : [Test::class, 'getGroups'];
207208

208209
return 0 === strpos($method, 'testLegacy')
209210
|| 0 === strpos($method, 'provideLegacy')

src/Symfony/Bridge/Twig/Node/DumpNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class DumpNode extends Node
2121
{
2222
private $varPrefix;
2323

24-
public function __construct($varPrefix, ?Node $values, int $lineno, string $tag = null)
24+
public function __construct(string $varPrefix, ?Node $values, int $lineno, string $tag = null)
2525
{
2626
$nodes = [];
2727
if (null !== $values) {

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/CachePoolClearerCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(Psr6CacheClearer $poolClearer, array $pools = [])
3939
*
4040
* @return string[]
4141
*/
42-
public function warmUp($cacheDirectory): array
42+
public function warmUp(string $cacheDirectory): array
4343
{
4444
foreach ($this->pools as $pool) {
4545
if ($this->poolClearer->hasPool($pool)) {

src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
120120
return 0;
121121
}
122122

123-
private function searchForEvent(EventDispatcherInterface $dispatcher, $needle): array
123+
private function searchForEvent(EventDispatcherInterface $dispatcher, string $needle): array
124124
{
125125
$output = [];
126126
$lcNeedle = strtolower($needle);

src/Symfony/Bundle/FrameworkBundle/Console/Application.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI
109109
/**
110110
* {@inheritdoc}
111111
*/
112-
public function find($name)
112+
public function find(string $name)
113113
{
114114
$this->registerCommands();
115115

@@ -119,7 +119,7 @@ public function find($name)
119119
/**
120120
* {@inheritdoc}
121121
*/
122-
public function get($name)
122+
public function get(string $name)
123123
{
124124
$this->registerCommands();
125125

@@ -135,7 +135,7 @@ public function get($name)
135135
/**
136136
* {@inheritdoc}
137137
*/
138-
public function all($namespace = null)
138+
public function all(string $namespace = null)
139139
{
140140
$this->registerCommands();
141141

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ abstract protected function describeContainerTags(ContainerBuilder $builder, arr
113113
*
114114
* @param Definition|Alias|object $service
115115
*/
116-
abstract protected function describeContainerService($service, array $options = [], ContainerBuilder $builder = null);
116+
abstract protected function describeContainerService(object $service, array $options = [], ContainerBuilder $builder = null);
117117

118118
/**
119119
* Describes container services.

0 commit comments

Comments
 (0)