8000 Merge branch '4.4' into 5.3 · symfony/symfony@15e6f7e · GitHub
[go: up one dir, main page]

Skip to content

Commit 15e6f7e

Browse files
committed
Merge branch '4.4' into 5.3
* 4.4: Remove polyfills from ExpressionLanguage Update validators.tr.xlf [Form] fix typo in Danish translation Remove broken test case [PropertyInfo] Support for the never return type Show nice CLI output in Psalm action
2 parents 50194ed + 9606430 commit 15e6f7e

File tree

10 files changed

+33
-12
lines changed

10 files changed

+33
-12
lines changed

.github/patch-types.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
case false !== strpos($file, '/src/Symfony/Component/ErrorHandler/Tests/Fixtures/'):
3333
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Dummy.php'):
3434
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/ParentDummy.php'):
35+
case false !== strpos($file, '/src/Symfony/Component/PropertyInfo/Tests/Fixtures/Php81Dummy.php'):
3536
case false !== strpos($file, '/src/Symfony/Component/Runtime/Internal/ComposerPlugin.php'):
3637
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'):
3738
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):

.github/workflows/psalm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ jobs:
5252
5353
- name: Psalm
5454
run: |
55+
./vendor/bin/psalm.phar --no-progress
5556
./vendor/bin/psalm.phar --output-format=github --no-progress

src/Symfony/Component/ExpressionLanguage/Lexer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ public function tokenize(string $expression)
4848
}
4949
$tokens[] = new Token(Token::NUMBER_TYPE, $number, $cursor + 1);
5050
$cursor += \strlen($match[0]);
51-
} elseif (str_contains('([{', $expression[$cursor])) {
51+
} elseif (false !== strpos('([{', $expression[$cursor])) {
5252
// opening bracket
5353
$brackets[] = [$expression[$cursor], $cursor];
5454

5555
$tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1);
5656
++$cursor;
57-
} elseif (str_contains(')]}', $expression[$cursor])) {
57+
} elseif (false !== strpos(')]}', $expression[$cursor])) {
5858
// closing bracket
5959
if (empty($brackets)) {
6060
throw new SyntaxError(sprintf('Unexpected "%s".', $expression[$cursor]), $cursor, $expression);
@@ -75,7 +75,7 @@ public function tokenize(string $expression)
7575
// operators
7676
$tokens[] = new Token(Token::OPERATOR_TYPE, $match[0], $cursor + 1);
7777
$cursor += \strlen($match[0]);
78-
} elseif (str_contains('.,?:', $expression[$cursor])) {
78+
} elseif (false !== strpos('.,?:', $expression[$cursor])) {
7979
// punctuation
8080
$tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1);
8181
++$cursor;

src/Symfony/Component/ExpressionLanguage/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"require": {
1919
"php": ">=7.2.5",
2020
"symfony/cache": "^4.4|^5.0",
21-
"symfony/polyfill-php80": "^1.16",
2221
"symfony/service-contracts": "^1.1|^2"
2322
},
2423
"autoload": {

src/Symfony/Component/Form/Resources/translations/validators.da.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
</trans-unit>
121121
<trans-unit id="125">
122122
<source>Please enter a valid email address.</source>
123-
<target>Indtast venligst en gyldig emailaddresse.</target>
123+
<target>Indtast venligst en gyldig e-mailadresse.</target>
124124
</trans-unit>
125125
<trans-unit id="126">
126126
<source>Please select a valid option.</source>

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
class DateTimeToStringTransformerTest extends TestCase
1919
{
20-
public function dataProvider()
20+
public function dataProvider(): array
2121
{
22-
$data = [
22+
return [
2323
['Y-m-d H:i:s', '2010-02-03 16:05:06', '2010-02-03 16:05:06 UTC'],
2424
['Y-m-d H:i:00', '2010-02-03 16:05:00', '2010-02-03 16:05:00 UTC'],
2525
['Y-m-d H:i', '2010-02-03 16:05', '2010-02-03 16:05:00 UTC'],
@@ -36,7 +36,6 @@ public function dataProvider()
3636

3737
// different day representations
3838
['Y-m-j', '2010-02-3', '2010-02-03 00:00:00 UTC'],
39-
['z', '33', '1970-02-03 00:00:00 UTC'],
4039

4140
// not bijective
4241
// this will not work as PHP will use actual date to replace missing info
@@ -63,8 +62,6 @@ public function dataProvider()
6362

6463
['Y-z', '2010-33', '2010-02-03 00:00:00 UTC'],
6564
];
66-
67-
return $data;
6865
}
6966

7067
/**

src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ private function extractFromReflectionType(\ReflectionType $reflectionType, \Ref
554554

555555
foreach ($reflectionType instanceof \ReflectionUnionType ? $reflectionType->getTypes() : [$reflectionType] as $type) {
556556
$phpTypeOrClass = $reflectionType instanceof \ReflectionNamedType ? $reflectionType->getName() : (string) $type;
557-
if ('null' === $phpTypeOrClass || 'mixed' === $phpTypeOrClass) {
557+
if ('null' === $phpTypeOrClass || 'mixed' === $phpTypeOrClass || 'never' === $phpTypeOrClass) {
558558
continue;
559559
}
560560

src/Symfony/Component/PropertyInfo/Tests/Extractor/ReflectionExtractorTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function php71TypesProvider()
257257
}
258258

259259
/**
260-
* * @dataProvider php80TypesProvider
260+
* @dataProvider php80TypesProvider
261261
* @requires PHP 8
262262
*/
263263
public function testExtractPhp80Type($property, array $type = null)
@@ -279,6 +279,14 @@ public function php80TypesProvider()
279279
];
280280
}
281281

282+
/**
283+
* @requires PHP 8.1
284+
*/
285+
public function testExtractPhp81Type()
286+
{
287+
$this->assertNull($this->extractor->getTypes('Symfony\Component\PropertyInfo\Tests\Fixtures\Php81Dummy', 'nothing', []));
288+
}
289+
282290
/**
283291
* @dataProvider defaultValueProvider
284292
*/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Symfony\Component\PropertyInfo\Tests\Fixtures;
4+
5+
class Php81Dummy
6+
{
7+
public function getNothing(): never
8+
{
9+
throw new \Exception('Oops');
10+
}
11+
}

src/Symfony/Component/Validator/Resources/translations/validators.tr.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@
386386
<source>This value is not a valid International Securities Identification Number (ISIN).</source>
387387
<target>Bu değer geçerli bir Uluslararası Menkul Kıymetler Kimlik Numarası değil (ISIN).</target>
388388
</trans-unit>
389+
<trans-unit id="100">
390+
<source>This value should be a valid expression.</source>
391+
<target>Bu değer geçerli bir ifade olmalıdır.</target>
392+
</trans-unit>
389393
</body>
390394
</file>
391395
</xliff>

0 commit comments

Comments
 (0)
0