Skip to content

Commit 0d06f47

Browse files
committed
Merge branch '2.15' into 2.16
2 parents c0f3b0a + 382e00e commit 0d06f47

File tree

12 files changed

+55
-40
lines changed

12 files changed

+55
-40
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ jobs:
8383
<<: *STANDARD_TEST_JOB
8484
stage: Test
8585
php: 7.1
86-
name: 7.1 | Symfony 4.1
86+
name: 7.1 | Symfony ~4.1.0
8787
env: SYMFONY_DEPRECATIONS_HELPER=disabled PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER=1 SYMFONY_VERSION="~4.1.0"
8888

8989
-
9090
<<: *STANDARD_TEST_JOB
9191
stage: Test
9292
php: 7.2
93-
name: 7.2 | Symfony 5.0
93+
name: 7.2 | Symfony ^5.0
9494
env: SYMFONY_DEPRECATIONS_HELPER=disabled PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER=1 SYMFONY_VERSION="^5.0"
9595

9696
-

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1",
4343
"phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1",
4444
"phpunitgoodpractices/traits": "^1.8",
45-
"symfony/phpunit-bridge": "^4.3 || ^5.0",
45+
"symfony/phpunit-bridge": "^5.1",
4646
"symfony/yaml": "^3.0 || ^4.0 || ^5.0"
4747
},
4848
"suggest": {

dev-tools/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bin/checkbashisms --version
3232

3333
echo λλλ shellcheck
3434
if [ ! -x bin/shellcheck ]; then
35-
wget -qO- "https://storage.googleapis.com/shellcheck/shellcheck-${VERSION_SC}.linux.x86_64.tar.xz" \
35+
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${VERSION_SC}/shellcheck-${VERSION_SC}.linux.x86_64.tar.xz" \
3636
| tar -xJv -O shellcheck-${VERSION_SC}/shellcheck \
3737
> bin/shellcheck
3838
chmod u+x bin/shellcheck

php-cs-fixer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
if (getenv('PHP_CS_FIXER_FUTURE_MODE')) {
15-
error_reporting(-1);
15+
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
1616
}
1717

1818
if (defined('HHVM_VERSION_ID')) {

src/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class Application extends BaseApplication
4646
public function __construct()
4747
{
4848
if (!getenv('PHP_CS_FIXER_FUTURE_MODE')) {
49-
error_reporting(-1);
49+
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
5050
}
5151

5252
parent::__construct('PHP CS Fixer', self::VERSION);

tests/Fixer/CastNotation/LowercaseCastFixerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace PhpCsFixer\Tests\Fixer\CastNotation;
1414

1515
use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
16+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1617

1718
/**
1819
* @author SpacePossum
@@ -23,6 +24,8 @@
2324
*/
2425
final class LowercaseCastFixerTest extends AbstractFixerTestCase
2526
{
27+
use ExpectDeprecationTrait;
28+
2629
/**
2730
* @param string $expected
2831
* @param null|string $input
@@ -55,14 +58,11 @@ public function testFix74($expected, $input = null)
5558
* @dataProvider provideFixDeprecatedCases
5659
* @requires PHP 7.4
5760
* @group legacy
58-
* @expectedDeprecation Unsilenced deprecation: The (real) cast is deprecated, use (float) instead
59-
* @expectedDeprecation Unsilenced deprecation: The (real) cast is deprecated, use (float) instead
60-
* @expectedDeprecation Unsilenced deprecation: The (real) cast is deprecated, use (float) instead
61-
* @expectedDeprecation Unsilenced deprecation: The (real) cast is deprecated, use (float) instead
62-
* @expectedDeprecation Unsilenced deprecation: The (real) cast is deprecated, use (float) instead
6361
*/
6462
public function testFix74Deprecated($expected, $input = null)
6563
{
64+
$this->expectDeprecation('The (real) cast is deprecated, use (float) instead');
65+
6666
$this->doTest($expected, $input);
6767
}
6868

tests/Fixer/CastNotation/ShortScalarCastFixerTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
namespace PhpCsFixer\Tests\Fixer\CastNotation;
1414

1515
use PhpCsFixer\Tests\Test\AbstractFixerTestCase;
16+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1617

1718
/**
1819
* @author SpacePossum
@@ -23,6 +24,8 @@
2324
*/
2425
final class ShortScalarCastFixerTest extends AbstractFixerTestCase
2526
{
27+
use ExpectDeprecationTrait;
28+
2629
/**
2730
* @param string $expected
2831
* @param null|string $input
@@ -55,10 +58,11 @@ public function testFix74($expected, $input = null)
5558
* @dataProvider provideFixDeprecatedCases
5659
* @requires PHP 7.4
5760
* @group legacy
58-
* @expectedDeprecation Unsilenced deprecation: The (real) cast is deprecated, use (float) instead
5961
*/
6062
public function testFix74Deprecated($expected, $input = null)
6163
{
64+
$this->expectDeprecation('The (real) cast is deprecated, use (float) instead');
65+
6266
$this->doTest($expected, $input);
6367
}
6468

tests/Fixer/Comment/HeaderCommentFixerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ public function testLegacyMisconfiguration()
517517
public function testMisconfiguration($configuration, $exceptionMessage)
518518
{
519519
$this->expectException(\PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException::class);
520-
$this->expectExceptionMessage('[header_comment] '.$exceptionMessage);
520+
$this->expectExceptionMessageRegExp("#^\\[header_comment\\] {$exceptionMessage}$#");
521521

522522
$this->configureFixerWithAliasedOptions($configuration);
523523
}
@@ -528,35 +528,35 @@ public function provideMisconfigurationCases()
528528
[[], 'Missing required configuration: The required option "header" is missing.'],
529529
[
530530
['header' => 1],
531-
'Invalid configuration: The option "header" with value 1 is expected to be of type "string", but is of type "integer".',
531+
'Invalid configuration: The option "header" with value 1 is expected to be of type "string", but is of type "(int|integer)"\.',
532532
],
533533
[
534534
[
535535
'header' => '',
536536
'comment_type' => 'foo',
537537
],
538-
'Invalid configuration: The option "comment_type" with value "foo" is invalid. Accepted values are: "PHPDoc", "comment".',
538+
'Invalid configuration: The option "comment_type" with value "foo" is invalid\. Accepted values are: "PHPDoc", "comment"\.',
539539
],
540540
[
541541
[
542542
'header' => '',
543543
'comment_type' => new \stdClass(),
544544
],
545-
'Invalid configuration: The option "comment_type" with value stdClass is invalid. Accepted values are: "PHPDoc", "comment".',
545+
'Invalid configuration: The option "comment_type" with value stdClass is invalid\. Accepted values are: "PHPDoc", "comment"\.',
546546
],
547547
[
548548
[
549549
'header' => '',
550550
'location' => new \stdClass(),
551551
],
552-
'Invalid configuration: The option "location" with value stdClass is invalid. Accepted values are: "after_open", "after_declare_strict".',
552+
'Invalid configuration: The option "location" with value stdClass is invalid\. Accepted values are: "after_open", "after_declare_strict"\.',
553553
],
554554
[
555555
[
556556
'header' => '',
557557
'separate' => new \stdClass(),
558558
],
559-
'Invalid configuration: The option "separate" with value stdClass is invalid. Accepted values are: "both", "top", "bottom", "none".',
559+
'Invalid configuration: The option "separate" with value stdClass is invalid\. Accepted values are: "both", "top", "bottom", "none"\.',
560560
],
561561
];
562562
}

tests/Fixer/ControlStructure/YodaStyleFixerTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,7 @@ public function testComplexConfiguration()
700700
public function testInvalidConfig(array $config, $expectedMessage)
701701
{
702702
$this->expectException(\PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException::class);
703-
$this->expectExceptionMessageRegExp(sprintf(
704-
'#^\[%s\] %s$#',
705-
$this->fixer->getName(),
706-
preg_quote($expectedMessage, '#')
707-
));
703+
$this->expectExceptionMessageRegExp("#^\\[{$this->fixer->getName()}\\] {$expectedMessage}$#");
708704

709705
$this->fixer->configure($config);
710706
}
@@ -715,8 +711,8 @@ public function testInvalidConfig(array $config, $expectedMessage)
715711
public function provideInvalidConfigurationCases()
716712
{
717713
return [
718-
[['equal' => 2], 'Invalid configuration: The option "equal" with value 2 is expected to be of type "bool" or "null", but is of type "integer".'],
719-
[['_invalid_' => true], 'Invalid configuration: The option "_invalid_" does not exist. Defined options are: "always_move_variable", "equal", "identical", "less_and_greater".'],
714+
[['equal' => 2], 'Invalid configuration: The option "equal" with value 2 is expected to be of type "bool" or "null", but is of type "(int|integer)"\.'],
715+
[['_invalid_' => true], 'Invalid configuration: The option "_invalid_" does not exist\. Defined options are: "always_move_variable", "equal", "identical", "less_and_greater"\.'],
720716
];
721717
}
722718

tests/Fixer/LanguageConstruct/IsNullFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testConfigurationWrongOption()
4040
public function testConfigurationWrongValue()
4141
{
4242
$this->expectException(\PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException::class);
43-
$this->expectExceptionMessage('[is_null] Invalid configuration: The option "use_yoda_style" with value -1 is expected to be of type "bool", but is of type "integer".');
43+
$this->expectExceptionMessageRegExp('#^\[is_null\] Invalid configuration: The option "use_yoda_style" with value -1 is expected to be of type "bool", but is of type "(int|integer)"\.$#');
4444
$this->fixer->configure(['use_yoda_style' => -1]);
4545
}
4646

0 commit comments

Comments
 (0)