Skip to content

Fix: Run 'php-cs-fixer fix' in 4.4 #40197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Doctrine/Tests/ManagerRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ManagerRegistryTest extends TestCase
{
public static function setUpBeforeClass(): void
{
if (!class_exists(\PHPUnit_Framework_TestCase::class)) {
if (!class_exists(\PHPUnit\Framework\TestCase::class)) {
self::markTestSkipped('proxy-manager-bridge is not yet compatible with namespaced phpunit versions.');
}
$test = new PhpDumperTest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public static function fromUrlEncodedString($serializedConfiguration)
}

return new self(
isset($normalizedConfiguration['max']) ? $normalizedConfiguration['max'] : [],
$normalizedConfiguration['max'] ?? [],
'',
$verboseOutput
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private static function getVendors()
foreach (get_declared_classes() as $class) {
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
$r = new \ReflectionClass($class);
$v = \dirname(\dirname($r->getFileName()));
$v = \dirname($r->getFileName(), 2);
if (file_exists($v.'/composer/installed.json')) {
self::$vendors[] = $v;
$loader = require $v.'/autoload.php';
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Bridge/PhpUnit/Tests/BootstrapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ class BootstrapTest extends TestCase
public function testAliasingOfErrorClasses()
{
$this->assertInstanceOf(
\PHPUnit_Framework_Error::class,
\PHPUnit\Framework\Error\Error::class,
new \PHPUnit\Framework\Error\Error('message', 0, __FILE__, __LINE__)
);
$this->assertInstanceOf(
\PHPUnit_Framework_Error_Deprecated::class,
\PHPUnit\Framework\Error\Deprecated::class,
new \PHPUnit\Framework\Error\Deprecated('message', 0, __FILE__, __LINE__)
);
$this->assertInstanceOf(
\PHPUnit_Framework_Error_Notice::class,
\PHPUnit\Framework\Error\Notice::class,
new \PHPUnit\Framework\Error\Notice('message', 0, __FILE__, __LINE__)
);
$this->assertInstanceOf(
\PHPUnit_Framework_Error_Warning::class,
\PHPUnit\Framework\Error\Warning::class,
new \PHPUnit\Framework\Error\Warning('message', 0, __FILE__, __LINE__)
);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
error_reporting(-1);

global $argv, $argc;
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : [];
$argc = isset($_SERVER['argc']) ? $_SERVER['argc'] : 0;
$argv = $_SERVER['argv'] ?? [];
$argc = $_SERVER['argc'] ?? 0;
$getEnvVar = function ($name, $default = false) use ($argv) {
if (false !== $value = getenv($name)) {
return $value;
Expand Down Expand Up @@ -151,9 +151,9 @@
}

$COMPOSER = file_exists($COMPOSER = $oldPwd.'/composer.phar')
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer.phar`) : `which composer.phar 2> /dev/null`))
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', `where.exe composer`) : `which composer 2> /dev/null`))
|| file_exists($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? `git rev-parse --show-toplevel 2> NUL` : `git rev-parse --show-toplevel 2> /dev/null`).\DIRECTORY_SEPARATOR.'composer.phar')
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', shell_exec('where.exe composer.phar')) : shell_exec('which composer.phar 2> /dev/null')))
|| ($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? preg_replace('/[\r\n].*/', '', shell_exec('where.exe composer')) : shell_exec('which composer 2> /dev/null')))
|| file_exists($COMPOSER = rtrim('\\' === \DIRECTORY_SEPARATOR ? shell_exec('git rev-parse --show-toplevel 2> NUL') : shell_exec('git rev-parse --show-toplevel 2> /dev/null')).\DIRECTORY_SEPARATOR.'composer.phar')
? ('#!/usr/bin/env php' === file_get_contents($COMPOSER, false, null, 0, 18) ? $PHP : '').' '.escapeshellarg($COMPOSER) // detect shell wrappers by looking at the shebang
: 'composer';

Expand Down Expand Up @@ -360,7 +360,7 @@ class_exists(\SymfonyExcludeListSimplePhpunit::class, false) && PHPUnit\Util\Bla
}

if ($components) {
$skippedTests = isset($_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS']) ? $_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS'] : false;
$skippedTests = $_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS'] ?? false;
$runningProcs = [];

foreach ($components as $component) {
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/PhpUnit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Doctrine\Common\Annotations\AnnotationRegistry;
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;

if (class_exists(\PHPUnit_Runner_Version::class) && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
if (class_exists(\PHPUnit\Runner\Version::class) && version_compare(\PHPUnit\Runner\Version::id(), '6.0.0', '<')) {
$classes = [
'PHPUnit_Framework_Assert', // override PhpUnit's ForwardCompat child class
'PHPUnit_Framework_AssertionFailedError', // override PhpUnit's ForwardCompat child class
Expand Down Expand Up @@ -110,7 +110,7 @@ class_alias('PHPUnit_Framework_Error', 'PHPUnit\Framework\Error\Error');
}

// Detect if we're loaded by an actual run of phpunit
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists(\PHPUnit_TextUI_Command::class, false) && !class_exists(\PHPUnit\TextUI\Command::class, false)) {
if (!defined('PHPUNIT_COMPOSER_INSTALL') && !class_exists(\PHPUnit\TextUI\Command::class, false) && !class_exists(\PHPUnit\TextUI\Command::class, false)) {
return;
}

Expand Down
16 changes: 8 additions & 8 deletions src/Symfony/Bridge/Twig/Tests/Command/DebugCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getDebugTemplateNameTestData()
(None) templates%e%A
%A
@Twig templates/bundles/TwigBundle%e%A
vendors/twig-bundle/Resources/views%e%A
vendors/twig-bundle/Resources/views%e%A
----------- -------------------------------------%A


Expand Down Expand Up @@ -213,12 +213,12 @@ public function getDebugTemplateNameTestData()
Configured Paths
----------------

----------- --------------------------------------
----------- --------------------------------------
Namespace Paths%A
----------- --------------------------------------
----------- --------------------------------------
@Twig templates/bundles/TwigBundle%e%A
vendors/twig-bundle/Resources/views%e%A
----------- --------------------------------------
----------- --------------------------------------


TXT
Expand Down Expand Up @@ -265,12 +265,12 @@ public function getDebugTemplateNameTestData()
Configured Paths
----------------

----------- --------------------------------------
Namespace Paths
----------- --------------------------------------
----------- --------------------------------------
Namespace Paths
----------- --------------------------------------
@Twig templates/bundles/TwigBundle%e%A
vendors/twig-bundle/Resources/views%e%A
----------- --------------------------------------
----------- --------------------------------------


TXT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<table <?php echo $view['form']->block($form, 'widget_container_attributes'); ?>>
<?php if (!$form->parent && $errors): ?>
<?php if (!$form->parent && $errors) { ?>
<tr>
<td colspan="2">
<?php echo $view['form']->errors($form); ?>
</td>
</tr>
<?php endif; ?>
<?php } ?>
<?php echo $view['form']->block($form, 'form_rows'); ?>
<?php echo $view['form']->rest($form); ?>
</table>
2 changes: 1 addition & 1 deletion src/Symfony/Component/BrowserKit/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ protected function doRequestInProcess($request)
foreach ($deprecations ? unserialize($deprecations) : [] as $deprecation) {
if ($deprecation[0]) {
// unsilenced on purpose
trigger_error($deprecation[1], \E_USER_DEPRECATED);
@trigger_error($deprecation[1], \E_USER_DEPRECATED);
} else {
@trigger_error($deprecation[1], \E_USER_DEPRECATED);
}
Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Component/Cache/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@
*/
abstract class AbstractAdapter implements AdapterInterface, CacheInterface, LoggerAwareInterface, ResettableInterface
{
use AbstractAdapterTrait;
use ContractsTrait;
/**
* @internal
*/
protected const NS_SEPARATOR = ':';

use AbstractAdapterTrait;
use ContractsTrait;

private static $apcuSupported;
private static $phpFilesSupported;

Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/Cache/Adapter/Psr16Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
*/
class Psr16Adapter extends AbstractAdapter implements PruneableInterface, ResettableInterface
{
use ProxyTrait;
/**
* @internal
*/
protected const NS_SEPARATOR = '_';

use ProxyTrait;

private $miss;

public function __construct(CacheInterface $pool, string $namespace = '', int $defaultLifetime = 0)
Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
*/
class TagAwareAdapter implements TagAwareAdapterInterface, TagAwareCacheInterface, PruneableInterface, ResettableInterface
{
public const TAGS_PREFIX = "\0tags\0";

use ContractsTrait;
use ProxyTrait;
public const TAGS_PREFIX = "\0tags\0";

private $deferred = [];
private $createCacheItem;
Expand Down
9 changes: 4 additions & 5 deletions src/Symfony/Component/Cache/Simple/AbstractCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@
*/
abstract class AbstractCache implements Psr16CacheInterface, LoggerAwareInterface, ResettableInterface
{
/**
* @internal
*/
protected const NS_SEPARATOR = ':';

use AbstractTrait {
deleteItems as private;
AbstractTrait::deleteItem as delete;
AbstractTrait::hasItem as has;
}
/**
* @internal
*/
protected const NS_SEPARATOR = ':';

private $defaultLifetime;

Expand Down
12 changes: 6 additions & 6 deletions src/Symfony/Component/Console/Tests/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,12 +501,12 @@ public function testDontRunAlternativeNamespaceName()
$tester = new ApplicationTester($application);
$tester->run(['command' => 'foos:bar1'], ['decorated' => false]);
$this->assertSame('
There are no commands defined in the "foos" namespace.
Did you mean this?
foo

There are no commands defined in the "foos" namespace.

Did you mean this?
foo


', $tester->getDisplay(true));
}
Expand Down
26 changes: 13 additions & 13 deletions src/Symfony/Component/Console/Tests/Helper/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public function renderProvider()
$books,
'compact',
<<<'TABLE'
ISBN Title Author
99921-58-10-7 Divine Comedy Dante Alighieri
9971-5-0210-0 A Tale of Two Cities Charles Dickens
960-425-059-0 The Lord of the Rings J. R. R. Tolkien
80-902734-1-6 And Then There Were None Agatha Christie
ISBN Title Author
99921-58-10-7 Divine Comedy Dante Alighieri
9971-5-0210-0 A Tale of Two Cities Charles Dickens
960-425-059-0 The Lord of the Rings J. R. R. Tolkien
80-902734-1-6 And Then There Were None Agatha Christie

TABLE
],
Expand All @@ -131,14 +131,14 @@ public function renderProvider()
$books,
'borderless',
<<<'TABLE'
=============== ========================== ==================
ISBN Title Author
=============== ========================== ==================
99921-58-10-7 Divine Comedy Dante Alighieri
9971-5-0210-0 A Tale of Two Cities Charles Dickens
960-425-059-0 The Lord of the Rings J. R. R. Tolkien
80-902734-1-6 And Then There Were None Agatha Christie
=============== ========================== ==================
=============== ========================== ==================
ISBN Title Author
=============== ========================== ==================
99921-58-10-7 Divine Comedy Dante Alighieri
9971-5-0210-0 A Tale of Two Cities Charles Dickens
960-425-059-0 The Lord of the Rings J. R. R. Tolkien
80-902734-1-6 And Then There Were None Agatha Christie
=============== ========================== ==================

TABLE
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
*/
class AliasConfigurator extends AbstractServiceConfigurator
{
public const FACTORY = 'alias';

use Traits\DeprecateTrait;
use Traits\PublicTrait;
public const FACTORY = 'alias';

public function __construct(ServicesConfigurator $parent, Alias $alias)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
*/
class DefaultsConfigurator extends AbstractServiceConfigurator
{
public const FACTORY = 'defaults';

use Traits\AutoconfigureTrait;
use Traits\AutowireTrait;
use Traits\BindTrait;
use Traits\PublicTrait;
public const FACTORY = 'defaults';

private $path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
class InlineServiceConfigurator extends AbstractConfigurator
{
public const FACTORY = 'inline';

use Traits\ArgumentTrait;
use Traits\AutowireTrait;
use Traits\BindTrait;
Expand All @@ -28,6 +26,7 @@ class InlineServiceConfigurator extends AbstractConfigurator
use Traits\LazyTrait;
use Traits\ParentTrait;
use Traits\TagTrait;
public const FACTORY = 'inline';

private $id = '[inline]';
private $allowParent = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
class InstanceofConfigurator extends AbstractServiceConfigurator
{
public const FACTORY = 'instanceof';

use Traits\AutowireTrait;
use Traits\BindTrait;
use Traits\CallTrait;
Expand All @@ -29,6 +27,7 @@ class InstanceofConfigurator extends AbstractServiceConfigurator
use Traits\PublicTrait;
use Traits\ShareTrait;
use Traits\TagTrait;
public const FACTORY = 'instanceof';

private $path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
*/
class PrototypeConfigurator extends AbstractServiceConfigurator
{
public const FACTORY = 'load';

use Traits\AbstractTrait;
use Traits\ArgumentTrait;
use Traits\AutoconfigureTrait;
Expand All @@ -36,6 +34,7 @@ class PrototypeConfigurator extends AbstractServiceConfigurator
use Traits\PublicTrait;
use Traits\ShareTrait;
use Traits\TagTrait;
public const FACTORY = 'load';

private $loader;
private $resource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
*/
class ServiceConfigurator extends AbstractServiceConfigurator
{
public const FACTORY = 'services';

use Traits\AbstractTrait;
use Traits\ArgumentTrait;
use Traits\AutoconfigureTrait;
Expand All @@ -41,6 +39,7 @@ class ServiceConfigurator extends AbstractServiceConfigurator
use Traits\ShareTrait;
use Traits\SyntheticTrait;
use Traits\TagTrait;
public const FACTORY = 'services';

private $container;
private $instanceof;
Expand Down
Loading