Skip to content

Commit 0e1b7eb

Browse files
authored
Merge pull request #354 from norkunas/fix-deprecation
Fix deprecation and CS
2 parents 7024d70 + 8d7ec63 commit 0e1b7eb

15 files changed

+46
-653
lines changed

.github/workflows/ci.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/checkout@v4
2323

2424
- name: "Install Composer dependencies"
25-
uses: "ramsey/composer-install@v2"
25+
uses: "ramsey/composer-install@v3"
2626
with:
2727
composer-options: "--optimize-autoloader"
2828

@@ -47,7 +47,7 @@ jobs:
4747
uses: actions/checkout@v4
4848

4949
- name: "Install Composer dependencies"
50-
uses: "ramsey/composer-install@v2"
50+
uses: "ramsey/composer-install@v3"
5151
with:
5252
composer-options: "--optimize-autoloader"
5353

@@ -64,13 +64,13 @@ jobs:
6464
dependencies: ['highest']
6565
php: [ '7.4', '8.0', '8.1', '8.2' ]
6666
sf_version: [ '4.4.*', '5.4.*', '6.4.*', '7.0.*' ]
67-
include:
68-
- php: '7.4'
69-
sf_version: '4.4.*'
70-
dependencies: 'lowest'
71-
- php: '7.4'
72-
sf_version: '5.4.*'
73-
dependencies: 'lowest'
67+
# include:
68+
# - php: '7.4'
69+
# sf_version: '4.4.*'
70+
# dependencies: 'lowest'
71+
# - php: '7.4'
72+
# sf_version: '5.4.*'
73+
# dependencies: 'lowest'
7474
exclude:
7575
- php: '7.4'
7676
sf_version: '4.4.*'
@@ -98,12 +98,12 @@ jobs:
9898
- name: "Install Composer dependencies"
9999
env:
100100
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
101-
uses: "ramsey/composer-install@v2"
101+
uses: "ramsey/composer-install@v3"
102102
with:
103103
composer-options: "--optimize-autoloader"
104104
dependency-versions: "${{ matrix.dependencies }}"
105105

106106
- name: "Run tests"
107107
env:
108-
SYMFONY_DEPRECATIONS_HELPER: 'baselineFile=./tests/allowed.json'
108+
SYMFONY_DEPRECATIONS_HELPER: 'ignoreFile=./tests/baseline-ignore'
109109
run: ./vendor/bin/simple-phpunit -v

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"psr/simple-cache": "^1.0 || ^2.0",
7070
"symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0",
7171
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
72-
"symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0",
72+
"symfony/phpunit-bridge": "^6.1",
7373
"symfony/validator": "^4.4 || ^5.0 || ^6.0 || ^7.0",
7474
"symfony/var-exporter": "^5.0 || ^6.0 || ^7.0",
7575
"symfony/yaml": "^4.4 || ^5.0 || ^6.0 || ^7.0"

phpstan-baseline.neon

+1-6
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ parameters:
5555
count: 1
5656
path: src/DependencyInjection/BazingaGeocoderExtension.php
5757

58-
-
59-
message: "#^Cannot cast mixed to int\\.$#"
60-
count: 2
61-
path: src/DependencyInjection/BazingaGeocoderExtension.php
62-
6358
-
6459
message: "#^Cannot cast mixed to string\\.$#"
6560
count: 1
@@ -82,7 +77,7 @@ parameters:
8277

8378
-
8479
message: "#^Parameter \\#1 \\$id of class Symfony\\\\Component\\\\DependencyInjection\\\\Reference constructor expects string, mixed given\\.$#"
85-
count: 3
80+
count: 1
8681
path: src/DependencyInjection/BazingaGeocoderExtension.php
8782

8883
-

src/DataCollector/GeocoderDataCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function reset()
4747
/**
4848
* @return void
4949
*/
50-
public function collect(Request $request, Response $response, \Throwable $exception = null)
50+
public function collect(Request $request, Response $response, ?\Throwable $exception = null)
5151
{
5252
if (!empty($this->data['queries'])) {
5353
// To avoid collection more that once.

src/DependencyInjection/BazingaGeocoderExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
use Symfony\Component\Config\FileLocator;
3131
use Symfony\Component\DependencyInjection\ContainerBuilder;
3232
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
33+
use Symfony\Component\DependencyInjection\Extension\Extension;
3334
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
3435
use Symfony\Component\DependencyInjection\Reference;
35-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
3636

3737
/**
3838
* @author William Durand <[email protected]>.

src/Plugin/FakeIpPlugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FakeIpPlugin implements Plugin
3030
private ?string $replacement;
3131
private ?Generator $faker = null;
3232

33-
public function __construct(?string $needle, string $replacement = null, bool $useFaker = false)
33+
public function __construct(?string $needle, ?string $replacement = null, bool $useFaker = false)
3434
{
3535
$this->needle = $needle;
3636
$this->replacement = $replacement;

src/ProviderFactory/AbstractFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ abstract class AbstractFactory implements ProviderFactoryInterface
3232

3333
protected ?ClientInterface $httpClient;
3434

35-
public function __construct(ClientInterface $httpClient = null)
35+
public function __construct(?ClientInterface $httpClient = null)
3636
{
3737
$this->httpClient = $httpClient;
3838
}

src/Validator/Constraint/Address.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Address extends Constraint
4949
/**
5050
* @param string[]|null $options
5151
*/
52-
public function __construct(array $options = null, string $message = null, array $groups = null, $payload = null)
52+
public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, $payload = null)
5353
{
5454
parent::__construct($options, $groups, $payload);
5555

tests/Functional/CustomTestKernel.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function getKernelParameters(): array
8080
/**
8181
* @internal
8282
*/
83-
public function setAnnotatedClassCache(array $annotatedClasses)
83+
public function setAnnotatedClassCache(array $annotatedClasses): void
8484
{
8585
file_put_contents(($this->warmupDir ?: $this->getBuildDir()).'/annotations.map', sprintf('<?php return %s;', var_export($annotatedClasses, true)));
8686
}
@@ -91,7 +91,7 @@ public function setAnnotatedClassCache(array $annotatedClasses)
9191
* The built version of the service container is used when fresh, otherwise the
9292
* container is built.
9393
*/
94-
protected function initializeContainer()
94+
protected function initializeContainer(): void
9595
{
9696
$class = $this->getContainerClass();
9797
$buildDir = $this->warmupDir ?: $this->getBuildDir();

tests/Functional/GeocoderListenerTest.php

+11
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Psr\Http\Message\RequestInterface;
2929
use Psr\Http\Message\ResponseInterface;
3030
use Psr\Http\Message\StreamInterface;
31+
use Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver;
3132
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
3233
use Symfony\Component\DependencyInjection\ContainerBuilder;
3334
use Symfony\Component\HttpKernel\Kernel;
@@ -78,6 +79,16 @@ protected static function createKernel(array $options = []): KernelInterface
7879
],
7980
]);
8081
}
82+
83+
if (class_exists(EntityValueResolver::class)) {
84+
$container->prependExtensionConfig('doctrine', [
85+
'orm' => [
86+
'controller_resolver' => [
87+
'auto_mapping' => false,
88+
],
89+
],
90+
]);
91+
}
8192
});
8293
}
8394
$kernel->handleOptions($options);

tests/Functional/Helper/CacheHelperV8.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function get(string $key, mixed $default = null): mixed
2323
{
2424
}
2525

26-
public function set(string $key, mixed $value, int|\DateInterval $ttl = null): bool
26+
public function set(string $key, mixed $value, int|\DateInterval|null $ttl = null): bool
2727
{
2828
return true;
2929
}
@@ -43,7 +43,7 @@ public function getMultiple(iterable $keys, mixed $default = null): iterable
4343
return [];
4444
}
4545

46-
public function setMultiple(iterable $values, int|\DateInterval $ttl = null): bool
46+
public function setMultiple(iterable $values, int|\DateInterval|null $ttl = null): bool
4747
{
4848
return true;
4949
}

tests/Functional/config/listener.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ doctrine:
88
orm:
99
auto_generate_proxy_classes: true
1010
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
11-
auto_mapping: true
11+
auto_mapping: false
1212

1313
bazinga_geocoder:
1414
profiling:

0 commit comments

Comments
 (0)