Skip to content

Commit 7611486

Browse files
authored
Merge branch '1.14' into upmerge/1.13_1.14
2 parents 9302384 + 6197587 commit 7611486

File tree

116 files changed

+5652
-435
lines changed

Some content is hidden

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

116 files changed

+5652
-435
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
!/ecs.php
66
!/phpspec.yml.dist
77
!/phpstan.neon
8+
!/phpstan-baseline.neon
89
!/phpunit.xml.dist
910
!/psalm.xml
1011
!/rector.php

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/Makefile export-ignore
1010
/phpspec.yml.dist export-ignore
1111
/phpstan.neon export-ignore
12+
/phpstan-baseline.neon export-ignore
1213
/phpunit.xml.dist export-ignore
1314
/psalm.xml export-ignore
1415
/rector.php

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ jobs:
7575
(cd tests/Application && bin/console doctrine:schema:create)
7676
7777
-
78-
name: Run Psalm
79-
run: vendor/bin/psalm --php-version=${{ matrix.php }}
78+
name: Run PHPStan
79+
run: vendor/bin/phpstan analyse --ansi --memory-limit=-1 -c phpstan.neon src
8080

8181
-
8282
name: Run analysis
@@ -183,6 +183,7 @@ jobs:
183183
-
184184
name: Create-project with skeleton
185185
run: |
186+
set -x
186187
composer create-project --ansi "symfony/skeleton:${{ matrix.skeleton }}" skeleton_app
187188
cd skeleton_app
188189
composer config extra.symfony.allow-contrib true

.github/workflows/upmerge_pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
matrix:
2222
include:
2323
-
24-
base_branch: "1.12"
25-
target_branch: "1.13"
24+
base_branch: "1.13"
25+
target_branch: "1.14"
2626

2727
steps:
2828
-

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"friendsofsymfony/rest-bundle": "^3.7",
6262
"jms/serializer-bundle": "^3.5 || ^4.0 || ^5.0",
6363
"lchrusciel/api-test-case": "^5.0",
64-
"matthiasnoback/symfony-dependency-injection-test": "^4.2.1 || ^5.1",
64+
"matthiasnoback/symfony-dependency-injection-test": "^6.1.0",
6565
"pagerfanta/pagerfanta": "^4.4",
6666
"pamil/phpspec-skip-example-extension": "^4.2",
6767
"phpspec/phpspec": "^7.5",
@@ -138,7 +138,7 @@
138138
"analyse": [
139139
"@composer validate --strict",
140140
"vendor/bin/ecs check",
141-
"vendor/bin/phpstan analyse --ansi --memory-limit=256M -c phpstan.neon -l max src"
141+
"vendor/bin/phpstan analyse --ansi --memory-limit=256M -c phpstan.neon src"
142142
],
143143
"fix": [
144144
"vendor/bin/ecs check --fix"

phpstan-baseline.neon

Lines changed: 2711 additions & 0 deletions
Large diffs are not rendered by default.

phpstan.neon

Lines changed: 96 additions & 96 deletions
Large diffs are not rendered by default.

psalm.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
<InvalidReturnType>
123123
<errorLevel type="suppress">
124124
<file name="src/Component/src/Doctrine/Persistence/InMemoryRepository.php" />
125+
<file name="src/Component/src/Metadata/Extractor/PhpFileResourceExtractor.php" />
125126
</errorLevel>
126127
</InvalidReturnType>
127128

@@ -175,6 +176,12 @@
175176
</errorLevel>
176177
</MoreSpecificImplementedParamType>
177178

179+
<NullableReturnStatement>
180+
<errorLevel type="suppress">
181+
<file name="src/Component/src/Metadata/Extractor/PhpFileResourceExtractor.php" />
182+
</errorLevel>
183+
</NullableReturnStatement>
184+
178185
<NullArgument>
179186
<errorLevel type="suppress">
180187
<directory name="src" />
@@ -190,6 +197,7 @@
190197
<PossiblyNullArgument>
191198
<errorLevel type="suppress">
192199
<file name="src/Bundle/Grid/Parser/OptionsParser.php" />
200+
<file name="src/Component/src/Metadata/Operation/HttpOperationInitiator.php" />
193201
</errorLevel>
194202
</PossiblyNullArgument>
195203

@@ -323,6 +331,12 @@
323331
</errorLevel>
324332
</UnrecognizedStatement>
325333

334+
<UnresolvableInclude>
335+
<errorLevel type="suppress">
336+
<file name="src/Component/src/Metadata/Extractor/PhpFileResourceExtractor.php" />
337+
</errorLevel>
338+
</UnresolvableInclude>
339+
326340
<UnsupportedReferenceUsage>
327341
<errorLevel type="suppress">
328342
<file name="src/Component/src/Doctrine/Persistence/InMemoryRepository.php" />

src/Bundle/Context/Initiator/LegacyRequestContextInitiator.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Sylius\Resource\Context\Initiator\RequestContextInitiatorInterface;
2020
use Sylius\Resource\Context\Option\MetadataOption;
2121
use Sylius\Resource\Metadata\RegistryInterface;
22+
use Sylius\Resource\Symfony\ExpressionLanguage\VarsResolverInterface;
2223
use Symfony\Component\HttpFoundation\Request;
2324

2425
final class LegacyRequestContextInitiator implements RequestContextInitiatorInterface
@@ -27,7 +28,17 @@ public function __construct(
2728
private RegistryInterface $resourceRegistry,
2829
private RequestConfigurationFactoryInterface $requestConfigurationFactory,
2930
private RequestContextInitiatorInterface $decorated,
31+
private ?VarsResolverInterface $varsResolver = null,
3032
) {
33+
if (null === $varsResolver) {
34+
trigger_deprecation(
35+
'sylius/resource-bundle',
36+
'1.14',
37+
'Not passing an instance of "%s" as the fourth constructor argument for "%s" is deprecated and will not be supported in 2.0.',
38+
VarsResolverInterface::class,
39+
self::class,
40+
);
41+
}
3142
}
3243

3344
public function initializeContext(Request $request): Context
@@ -49,7 +60,19 @@ public function initializeContext(Request $request): Context
4960
}
5061

5162
$configuration = $this->requestConfigurationFactory->create($metadata, $request);
63+
$configurationVars = $this->resolveVars($configuration->getVars());
64+
65+
$configuration->getParameters()->set('vars', $configurationVars);
5266

5367
return $context->with(new MetadataOption($metadata), new RequestConfigurationOption($configuration));
5468
}
69+
70+
private function resolveVars(array $vars): array
71+
{
72+
if (null === $this->varsResolver) {
73+
return $vars;
74+
}
75+
76+
return $this->varsResolver->resolve($vars);
77+
}
5578
}

src/Bundle/Controller/RequestConfiguration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getDefaultTemplate($name)
8383
$templatesNamespace = (string) $this->metadata->getTemplatesNamespace();
8484

8585
if (false !== strpos($templatesNamespace, ':')) {
86-
return sprintf('%s:%s.%s', $templatesNamespace ?: ':', $name, 'twig');
86+
return sprintf('%s:%s.%s', $templatesNamespace, $name, 'twig');
8787
}
8888

8989
return sprintf('%s/%s.%s', $templatesNamespace, $name, 'twig');

0 commit comments

Comments
 (0)