PHP CS Fixer: clean up repo and adjust config

This commit is contained in:
Dariusz 2018-01-01 23:05:14 +01:00 committed by Nicolas Grekas
parent 28485afd45
commit b14cbc1845
16 changed files with 66 additions and 19 deletions

View File

@ -12,6 +12,9 @@ return PhpCsFixer\Config::create()
'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice
'array_syntax' => array('syntax' => 'long'),
'protected_to_private' => false,
// rule disabled due to https://bugs.php.net/bug.php?id=60573 bug;
// to be re-enabled (by dropping next line, rule is part of @Symfony already) on branch that requires PHP 5.4+
'self_accessor' => false,
))
->setRiskyAllowed(true)
->setFinder(
@ -39,5 +42,9 @@ return PhpCsFixer\Config::create()
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
// explicit heredoc test
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
// explicit trigger_error tests
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt')
->notPath('Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/weak.phpt')
->notPath('Symfony/Component/Debug/Tests/DebugClassLoaderTest.php')
)
;

View File

@ -89,18 +89,35 @@ class TranslationExtensionTest extends TestCase
array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'),
// transchoice
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is no apples', array('count' => 0)),
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is 5 apples', array('count' => 5)),
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')),
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
'There is 5 apples (Symfony)', array('count' => 5)),
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is no apples', array('count' => 0)),
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is 5 apples'),
array(
'{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is no apples',
array('count' => 0),
),
array(
'{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is 5 apples',
array('count' => 5),
),
array(
'{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
'There is 5 apples (Symfony)',
array('count' => 5, 'name' => 'Symfony'),
),
array(
'{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
'There is 5 apples (Symfony)',
array('count' => 5),
),
array(
'{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is no apples',
array('count' => 0),
),
array(
'{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is 5 apples',
),
// trans filter
array('{{ "Hello"|trans }}', 'Hello'),

View File

@ -46,6 +46,8 @@ class Translator extends BaseTranslator implements WarmableInterface
private $resources = array();
/**
* Constructor.
*
* Available options:
*
* * cache_dir: The cache directory (or null to disable caching)

View File

@ -1,7 +1,9 @@
--TEST--
Test symfony_zval_info API
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
<?php if (!extension_loaded('symfony_debug')) {
echo 'skip';
} ?>
--FILE--
<?php

View File

@ -1,7 +1,9 @@
--TEST--
Test symfony_debug_backtrace in case of fatal error
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
<?php if (!extension_loaded('symfony_debug')) {
echo 'skip';
} ?>
--FILE--
<?php

View File

@ -1,7 +1,9 @@
--TEST--
Test symfony_debug_backtrace in case of non fatal error
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
<?php if (!extension_loaded('symfony_debug')) {
echo 'skip';
} ?>
--FILE--
<?php

View File

@ -1,7 +1,9 @@
--TEST--
Test ErrorHandler in case of fatal error
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
<?php if (!extension_loaded('symfony_debug')) {
echo 'skip';
} ?>
--FILE--
<?php

View File

@ -26,7 +26,6 @@ ErrorHandler::register()->setDefaultLogger(new TestLogger());
ini_set('display_errors', 1);
throw new \Exception('foo');
?>
--EXPECTF--
Uncaught Exception: foo

View File

@ -24,7 +24,9 @@ var_dump(array(
$eHandler[0]->setExceptionHandler('print_r');
if (true) {
class Broken implements \Serializable {};
class Broken implements \Serializable
{
}
}
?>

View File

@ -54,6 +54,8 @@ class LegacyPdoSessionHandler implements \SessionHandlerInterface
private $timeCol;
/**
* Construct new legacy PDO session handler.
*
* List of available options:
* * db_table: The name of the table [required]
* * db_id_col: The column where to store the session id [default: sess_id]

View File

@ -29,6 +29,8 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
private $prefix;
/**
* Constructor.
*
* List of available options:
* * prefix: The prefix to use for the memcache keys in order to avoid collision
* * expiretime: The time to live in seconds

View File

@ -34,6 +34,8 @@ class MemcachedSessionHandler implements \SessionHandlerInterface
private $prefix;
/**
* Constructor.
*
* List of available options:
* * prefix: The prefix to use for the memcached keys in order to avoid collision
* * expiretime: The time to live in seconds

View File

@ -29,6 +29,8 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
private $options;
/**
* Constructor.
*
* List of available options:
* * database: The name of the database [required]
* * collection: The name of the collection [required]

View File

@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\Response;
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @method Request|null getRequest() A Request instance
* @method Request|null getRequest() A Request instance
* @method Response|null getResponse() A Response instance
*/
class Client extends BaseClient

View File

@ -36,6 +36,8 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
private $traces = array();
/**
* Constructor.
*
* The available options are:
*
* * debug: If true, the traces are added as a HTTP header to ease debugging

View File

@ -34,6 +34,8 @@ class Route implements \Serializable
private $compiled;
/**
* Constructor.
*
* Available options:
*
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)