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
|
||||
'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')
|
||||
)
|
||||
;
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ ErrorHandler::register()->setDefaultLogger(new TestLogger());
|
|||
ini_set('display_errors', 1);
|
||||
|
||||
throw new \Exception('foo');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Uncaught Exception: foo
|
||||
|
|
|
@ -24,7 +24,9 @@ var_dump(array(
|
|||
$eHandler[0]->setExceptionHandler('print_r');
|
||||
|
||||
if (true) {
|
||||
class Broken implements \Serializable {};
|
||||
class Broken implements \Serializable
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Reference in New Issue