PHP CS Fixer: clean up repo and adjust config
This commit is contained in:
parent
28485afd45
commit
b14cbc1845
|
@ -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
|
'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'),
|
'array_syntax' => array('syntax' => 'long'),
|
||||||
'protected_to_private' => false,
|
'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)
|
->setRiskyAllowed(true)
|
||||||
->setFinder(
|
->setFinder(
|
||||||
|
@ -39,5 +42,9 @@ return PhpCsFixer\Config::create()
|
||||||
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
|
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/Resources/Custom/_name_entry_label.html.php')
|
||||||
// explicit heredoc test
|
// explicit heredoc test
|
||||||
->notPath('Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php')
|
->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')
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
|
@ -89,18 +89,35 @@ class TranslationExtensionTest extends TestCase
|
||||||
array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'),
|
array('{% trans into "fr"%}Hello{% endtrans %}', 'Hello'),
|
||||||
|
|
||||||
// transchoice
|
// transchoice
|
||||||
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
array(
|
||||||
'There is no apples', array('count' => 0)),
|
'{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||||
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
'There is no apples',
|
||||||
'There is 5 apples', array('count' => 5)),
|
array('count' => 0),
|
||||||
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(
|
||||||
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
|
'{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
||||||
'There is 5 apples (Symfony)', array('count' => 5)),
|
'There is 5 apples',
|
||||||
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
|
array('count' => 5),
|
||||||
'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 %}',
|
array(
|
||||||
'There is 5 apples'),
|
'{% 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
|
// trans filter
|
||||||
array('{{ "Hello"|trans }}', 'Hello'),
|
array('{{ "Hello"|trans }}', 'Hello'),
|
||||||
|
|
|
@ -46,6 +46,8 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||||
private $resources = array();
|
private $resources = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
* Available options:
|
* Available options:
|
||||||
*
|
*
|
||||||
* * cache_dir: The cache directory (or null to disable caching)
|
* * cache_dir: The cache directory (or null to disable caching)
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test symfony_zval_info API
|
Test symfony_zval_info API
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
|
<?php if (!extension_loaded('symfony_debug')) {
|
||||||
|
echo 'skip';
|
||||||
|
} ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test symfony_debug_backtrace in case of fatal error
|
Test symfony_debug_backtrace in case of fatal error
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
|
<?php if (!extension_loaded('symfony_debug')) {
|
||||||
|
echo 'skip';
|
||||||
|
} ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test symfony_debug_backtrace in case of non fatal error
|
Test symfony_debug_backtrace in case of non fatal error
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
|
<?php if (!extension_loaded('symfony_debug')) {
|
||||||
|
echo 'skip';
|
||||||
|
} ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
--TEST--
|
--TEST--
|
||||||
Test ErrorHandler in case of fatal error
|
Test ErrorHandler in case of fatal error
|
||||||
--SKIPIF--
|
--SKIPIF--
|
||||||
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
|
<?php if (!extension_loaded('symfony_debug')) {
|
||||||
|
echo 'skip';
|
||||||
|
} ?>
|
||||||
--FILE--
|
--FILE--
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ ErrorHandler::register()->setDefaultLogger(new TestLogger());
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
|
|
||||||
throw new \Exception('foo');
|
throw new \Exception('foo');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
Uncaught Exception: foo
|
Uncaught Exception: foo
|
||||||
|
|
|
@ -24,7 +24,9 @@ var_dump(array(
|
||||||
$eHandler[0]->setExceptionHandler('print_r');
|
$eHandler[0]->setExceptionHandler('print_r');
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
class Broken implements \Serializable {};
|
class Broken implements \Serializable
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -54,6 +54,8 @@ class LegacyPdoSessionHandler implements \SessionHandlerInterface
|
||||||
private $timeCol;
|
private $timeCol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Construct new legacy PDO session handler.
|
||||||
|
*
|
||||||
* List of available options:
|
* List of available options:
|
||||||
* * db_table: The name of the table [required]
|
* * db_table: The name of the table [required]
|
||||||
* * db_id_col: The column where to store the session id [default: sess_id]
|
* * db_id_col: The column where to store the session id [default: sess_id]
|
||||||
|
|
|
@ -29,6 +29,8 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
|
||||||
private $prefix;
|
private $prefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
* List of available options:
|
* List of available options:
|
||||||
* * prefix: The prefix to use for the memcache keys in order to avoid collision
|
* * prefix: The prefix to use for the memcache keys in order to avoid collision
|
||||||
* * expiretime: The time to live in seconds
|
* * expiretime: The time to live in seconds
|
||||||
|
|
|
@ -34,6 +34,8 @@ class MemcachedSessionHandler implements \SessionHandlerInterface
|
||||||
private $prefix;
|
private $prefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
* List of available options:
|
* List of available options:
|
||||||
* * prefix: The prefix to use for the memcached keys in order to avoid collision
|
* * prefix: The prefix to use for the memcached keys in order to avoid collision
|
||||||
* * expiretime: The time to live in seconds
|
* * expiretime: The time to live in seconds
|
||||||
|
|
|
@ -29,6 +29,8 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||||
private $options;
|
private $options;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
* List of available options:
|
* List of available options:
|
||||||
* * database: The name of the database [required]
|
* * database: The name of the database [required]
|
||||||
* * collection: The name of the collection [required]
|
* * collection: The name of the collection [required]
|
||||||
|
|
|
@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @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
|
* @method Response|null getResponse() A Response instance
|
||||||
*/
|
*/
|
||||||
class Client extends BaseClient
|
class Client extends BaseClient
|
||||||
|
|
|
@ -36,6 +36,8 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
|
||||||
private $traces = array();
|
private $traces = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
* The available options are:
|
* The available options are:
|
||||||
*
|
*
|
||||||
* * debug: If true, the traces are added as a HTTP header to ease debugging
|
* * debug: If true, the traces are added as a HTTP header to ease debugging
|
||||||
|
|
|
@ -34,6 +34,8 @@ class Route implements \Serializable
|
||||||
private $compiled;
|
private $compiled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
* Available options:
|
* Available options:
|
||||||
*
|
*
|
||||||
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
|
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
|
||||||
|
|
Reference in New Issue