Remove aligned '=>' and '='

This commit is contained in:
Disquedur 2014-10-22 20:27:13 +02:00 committed by Fabien Potencier
parent 91fde699aa
commit 51312d31cc
239 changed files with 1454 additions and 1455 deletions

View File

@ -1107,7 +1107,7 @@
```php
$view->vars = array_replace($view->vars, array(
'help' => 'A text longer than six characters',
'help' => 'A text longer than six characters',
'error_class' => 'max_length_error',
));
```

View File

@ -59,9 +59,9 @@ class DoctrineDataCollector extends DataCollector
}
$this->data = array(
'queries' => $queries,
'queries' => $queries,
'connections' => $this->connections,
'managers' => $this->managers,
'managers' => $this->managers,
);
}

View File

@ -52,7 +52,7 @@ abstract class AbstractDoctrineExtension extends Extension
foreach (array_keys($container->getParameter('kernel.bundles')) as $bundle) {
if (!isset($objectManager['mappings'][$bundle])) {
$objectManager['mappings'][$bundle] = array(
'mapping' => true,
'mapping' => true,
'is_bundle' => true,
);
}
@ -65,8 +65,8 @@ abstract class AbstractDoctrineExtension extends Extension
}
$mappingConfig = array_replace(array(
'dir' => false,
'type' => false,
'dir' => false,
'type' => false,
'prefix' => false,
), (array) $mappingConfig);

View File

@ -160,13 +160,13 @@ abstract class DoctrineType extends AbstractType
};
$resolver->setDefaults(array(
'em' => null,
'property' => null,
'query_builder' => null,
'loader' => $loader,
'choices' => null,
'choice_list' => $choiceList,
'group_by' => null,
'em' => null,
'property' => null,
'query_builder' => null,
'loader' => $loader,
'choices' => null,
'choice_list' => $choiceList,
'group_by' => null,
));
$resolver->setRequired(array('class'));

View File

@ -63,7 +63,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
$sql = 'SELECT class, username, value, lastUsed'
.' FROM rememberme_token WHERE series=:series';
$paramValues = array('series' => $series);
$paramTypes = array('series' => \PDO::PARAM_STR);
$paramTypes = array('series' => \PDO::PARAM_STR);
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
if ($row) {
@ -85,7 +85,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
{
$sql = 'DELETE FROM rememberme_token WHERE series=:series';
$paramValues = array('series' => $series);
$paramTypes = array('series' => \PDO::PARAM_STR);
$paramTypes = array('series' => \PDO::PARAM_STR);
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
}
@ -96,12 +96,12 @@ class DoctrineTokenProvider implements TokenProviderInterface
{
$sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed'
.' WHERE series=:series';
$paramValues = array('value' => $tokenValue,
$paramValues = array('value' => $tokenValue,
'lastUsed' => $lastUsed,
'series' => $series,);
$paramTypes = array('value' => \PDO::PARAM_STR,
'series' => $series,);
$paramTypes = array('value' => \PDO::PARAM_STR,
'lastUsed' => DoctrineType::DATETIME,
'series' => \PDO::PARAM_STR,);
'series' => \PDO::PARAM_STR,);
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
if ($updated < 1) {
throw new TokenNotFoundException('No token found.');
@ -116,15 +116,15 @@ class DoctrineTokenProvider implements TokenProviderInterface
$sql = 'INSERT INTO rememberme_token'
.' (class, username, series, value, lastUsed)'
.' VALUES (:class, :username, :series, :value, :lastUsed)';
$paramValues = array('class' => $token->getClass(),
$paramValues = array('class' => $token->getClass(),
'username' => $token->getUsername(),
'series' => $token->getSeries(),
'value' => $token->getTokenValue(),
'series' => $token->getSeries(),
'value' => $token->getTokenValue(),
'lastUsed' => $token->getLastUsed(),);
$paramTypes = array('class' => \PDO::PARAM_STR,
$paramTypes = array('class' => \PDO::PARAM_STR,
'username' => \PDO::PARAM_STR,
'series' => \PDO::PARAM_STR,
'value' => \PDO::PARAM_STR,
'series' => \PDO::PARAM_STR,
'value' => \PDO::PARAM_STR,
'lastUsed' => DoctrineType::DATETIME,);
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
}

View File

@ -30,8 +30,8 @@ class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase
public function testShouldSetContainerOnContainerAwareFixture()
{
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$loader = new ContainerAwareLoader($container);
$fixture = new ContainerAwareFixture();
$loader = new ContainerAwareLoader($container);
$fixture = new ContainerAwareFixture();
$loader->addFixture($fixture);

View File

@ -68,7 +68,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
;
$dbalLogger->startQuery('SQL', array(
'utf8' => 'foo',
'utf8' => 'foo',
'nonutf8' => "\x7F\xFF",
));
}
@ -97,7 +97,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
$dbalLogger->startQuery('SQL', array(
'short' => $shortString,
'long' => $longString,
'long' => $longString,
));
}
@ -135,7 +135,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
$dbalLogger->startQuery('SQL', array(
'short' => $shortString,
'long' => $longString,
'long' => $longString,
));
}
}

View File

@ -30,11 +30,11 @@ class DebugHandler extends TestHandler implements DebugLoggerInterface
$records = array();
foreach ($this->records as $record) {
$records[] = array(
'timestamp' => $record['datetime']->getTimestamp(),
'message' => $record['message'],
'priority' => $record['level'],
'timestamp' => $record['datetime']->getTimestamp(),
'message' => $record['message'],
'priority' => $record['level'],
'priorityName' => $record['level_name'],
'context' => $record['context'],
'context' => $record['context'],
);
}

View File

@ -28,11 +28,11 @@ class WebProcessorTest extends \PHPUnit_Framework_TestCase
public function testUsesRequestServerData()
{
$server = array(
'REQUEST_URI' => 'A',
'REMOTE_ADDR' => 'B',
'REQUEST_URI' => 'A',
'REMOTE_ADDR' => 'B',
'REQUEST_METHOD' => 'C',
'SERVER_NAME' => 'D',
'HTTP_REFERER' => 'E',
'SERVER_NAME' => 'D',
'HTTP_REFERER' => 'E',
);
$request = new Request();

View File

@ -55,8 +55,8 @@ class PropelDataCollector extends DataCollector
public function collect(Request $request, Response $response, \Exception $exception = null)
{
$this->data = array(
'queries' => $this->buildQueries(),
'querycount' => $this->countQueries(),
'queries' => $this->buildQueries(),
'querycount' => $this->countQueries(),
);
}
@ -118,16 +118,16 @@ class PropelDataCollector extends DataCollector
$innerGlue = $this->propelConfiguration->getParameter('debugpdo.logging.innerglue', ': ');
foreach ($this->logger->getQueries() as $q) {
$parts = explode($outerGlue, $q, 4);
$parts = explode($outerGlue, $q, 4);
$times = explode($innerGlue, $parts[0]);
$con = explode($innerGlue, $parts[2]);
$memories = explode($innerGlue, $parts[1]);
$times = explode($innerGlue, $parts[0]);
$con = explode($innerGlue, $parts[2]);
$memories = explode($innerGlue, $parts[1]);
$sql = trim($parts[3]);
$con = trim($con[1]);
$time = trim($times[1]);
$memory = trim($memories[1]);
$sql = trim($parts[3]);
$con = trim($con[1]);
$time = trim($times[1]);
$memory = trim($memories[1]);
$queries[] = array('connection' => $con, 'sql' => $sql, 'time' => $time, 'memory' => $memory);
}

View File

@ -14,7 +14,6 @@ namespace Symfony\Bridge\Propel1\Form\ChoiceList;
use \ModelCriteria;
use \BaseObject;
use \Persistent;
use Symfony\Component\Form\Exception\StringCastException;
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
@ -86,9 +85,9 @@ class ModelChoiceList extends ObjectChoiceList
*/
public function __construct($class, $labelPath = null, $choices = null, $queryObject = null, $groupPath = null, $preferred = array(), PropertyAccessorInterface $propertyAccessor = null)
{
$this->class = $class;
$this->class = $class;
$queryClass = $this->class.'Query';
$queryClass = $this->class.'Query';
if (!class_exists($queryClass)) {
if (empty($this->class)) {
throw new MissingOptionsException('The "class" parameter is empty, you should provide the model class');
@ -96,11 +95,11 @@ class ModelChoiceList extends ObjectChoiceList
throw new InvalidOptionsException(sprintf('The query class "%s" is not found, you should provide the FQCN of the model class', $queryClass));
}
$query = new $queryClass();
$query = new $queryClass();
$this->query = $queryObject ?: $query;
$this->identifier = $this->query->getTableMap()->getPrimaryKeys();
$this->loaded = is_array($choices) || $choices instanceof \Traversable;
$this->query = $queryObject ?: $query;
$this->identifier = $this->query->getTableMap()->getPrimaryKeys();
$this->loaded = is_array($choices) || $choices instanceof \Traversable;
if ($preferred instanceof ModelCriteria) {
$this->preferredQuery = $preferred->mergeWith($this->query);

View File

@ -38,22 +38,22 @@ class PropelTypeGuesser implements FormTypeGuesserInterface
if ($relation->getType() === \RelationMap::MANY_TO_ONE) {
if (strtolower($property) === strtolower($relation->getName())) {
return new TypeGuess('model', array(
'class' => $relation->getForeignTable()->getClassName(),
'class' => $relation->getForeignTable()->getClassName(),
'multiple' => false,
), Guess::HIGH_CONFIDENCE);
}
} elseif ($relation->getType() === \RelationMap::ONE_TO_MANY) {
if (strtolower($property) === strtolower($relation->getPluralName())) {
return new TypeGuess('model', array(
'class' => $relation->getForeignTable()->getClassName(),
'class' => $relation->getForeignTable()->getClassName(),
'multiple' => true,
), Guess::HIGH_CONFIDENCE);
}
} elseif ($relation->getType() === \RelationMap::MANY_TO_MANY) {
if (strtolower($property) == strtolower($relation->getPluralName())) {
return new TypeGuess('model', array(
'class' => $relation->getLocalTable()->getClassName(),
'multiple' => true,
'class' => $relation->getLocalTable()->getClassName(),
'multiple' => true,
), Guess::HIGH_CONFIDENCE);
}
}

View File

@ -84,16 +84,16 @@ class ModelType extends AbstractType
};
$resolver->setDefaults(array(
'template' => 'choice',
'multiple' => false,
'expanded' => false,
'class' => null,
'property' => null,
'query' => null,
'choices' => null,
'choice_list' => $choiceList,
'group_by' => null,
'by_reference' => false,
'template' => 'choice',
'multiple' => false,
'expanded' => false,
'class' => null,
'property' => null,
'query' => null,
'choices' => null,
'choice_list' => $choiceList,
'group_by' => null,
'by_reference' => false,
));
}

View File

@ -47,8 +47,8 @@ class PropelLogger
*/
public function __construct(LoggerInterface $logger = null, Stopwatch $stopwatch = null)
{
$this->logger = $logger;
$this->queries = array();
$this->logger = $logger;
$this->queries = array();
$this->stopwatch = $stopwatch;
$this->isPrepared = false;
}

View File

@ -63,7 +63,7 @@ class PropelUserProvider implements UserProviderInterface
public function loadUserByUsername($username)
{
$queryClass = $this->queryClass;
$query = $queryClass::create();
$query = $queryClass::create();
if (null !== $this->property) {
$filter = 'filterBy'.ucfirst($this->property);

View File

@ -45,10 +45,10 @@ class PropelDataCollectorTest extends Propel1TestCase
$this->assertEquals(array(
array(
'sql' => "SET NAMES 'utf8'",
'time' => '0.000 sec',
'sql' => "SET NAMES 'utf8'",
'time' => '0.000 sec',
'connection' => 'default',
'memory' => '1.4 MB',
'memory' => '1.4 MB',
),
), $c->getQueries());
$this->assertEquals(1, $c->getQueryCount());
@ -67,22 +67,22 @@ class PropelDataCollectorTest extends Propel1TestCase
$this->assertEquals(array(
array(
'sql' => "SET NAMES 'utf8'",
'time' => '0.000 sec',
'sql' => "SET NAMES 'utf8'",
'time' => '0.000 sec',
'connection' => 'default',
'memory' => '1.4 MB',
'memory' => '1.4 MB',
),
array(
'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12",
'time' => '0.012 sec',
'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12",
'time' => '0.012 sec',
'connection' => 'default',
'memory' => '2.4 MB',
'memory' => '2.4 MB',
),
array(
'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')",
'time' => '0.012 sec',
'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')",
'time' => '0.012 sec',
'connection' => 'default',
'memory' => '2.4 MB',
'memory' => '2.4 MB',
),
), $c->getQueries());
$this->assertEquals(3, $c->getQueryCount());

View File

@ -14,12 +14,12 @@ namespace Symfony\Bridge\Propel1\Tests\Fixtures;
class ItemQuery
{
private $map = array(
'id' => \PropelColumnTypes::INTEGER,
'value' => \PropelColumnTypes::VARCHAR,
'price' => \PropelColumnTypes::FLOAT,
'is_active' => \PropelColumnTypes::BOOLEAN,
'enabled' => \PropelColumnTypes::BOOLEAN_EMU,
'updated_at' => \PropelColumnTypes::TIMESTAMP,
'id' => \PropelColumnTypes::INTEGER,
'value' => \PropelColumnTypes::VARCHAR,
'price' => \PropelColumnTypes::FLOAT,
'is_active' => \PropelColumnTypes::BOOLEAN,
'enabled' => \PropelColumnTypes::BOOLEAN_EMU,
'updated_at' => \PropelColumnTypes::TIMESTAMP,
);
public static $result = array();

View File

@ -93,10 +93,10 @@ class CollectionToArrayTransformerTest extends Propel1TestCase
public function testReverseTransformWithData()
{
$inputData = array('foo', 'bar');
$inputData = array('foo', 'bar');
$result = $this->transformer->reverseTransform($inputData);
$data = $result->getData();
$result = $this->transformer->reverseTransform($inputData);
$data = $result->getData();
$this->assertInstanceOf('\PropelObjectCollection', $result);

View File

@ -40,9 +40,9 @@ class RuntimeInstantiatorTest extends \PHPUnit_Framework_TestCase
public function testInstantiateProxy()
{
$instance = new \stdClass();
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$definition = new Definition('stdClass');
$instance = new \stdClass();
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$definition = new Definition('stdClass');
$instantiator = function () use ($instance) {
return $instance;
};

View File

@ -50,10 +50,10 @@ class MessageDataCollector extends DataCollector
// only collect when Swiftmailer has already been initialized
if (class_exists('Swift_Mailer', false)) {
$logger = $this->container->get('swiftmailer.plugin.messagelogger');
$this->data['messages'] = $logger->getMessages();
$this->data['messages'] = $logger->getMessages();
$this->data['messageCount'] = $logger->countMessages();
} else {
$this->data['messages'] = array();
$this->data['messages'] = array();
$this->data['messageCount'] = 0;
}

View File

@ -96,7 +96,7 @@ class CodeExtension extends \Twig_Extension
$formattedValue = sprintf("<em>object</em>(<abbr title=\"%s\">%s</abbr>)", $item[1], $short);
} elseif ('array' === $item[0]) {
$formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
} elseif ('string' === $item[0]) {
} elseif ('string' === $item[0]) {
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->charset));
} elseif ('null' === $item[0]) {
$formattedValue = '<em>null</em>';

View File

@ -87,7 +87,7 @@ EOT
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
if (is_dir($originDir = $bundle->getPath().'/Resources/public')) {
$targetDir = $bundlesDir.preg_replace('/bundle$/', '', strtolower($bundle->getName()));
$targetDir = $bundlesDir.preg_replace('/bundle$/', '', strtolower($bundle->getName()));
$output->writeln(sprintf('Installing assets for <comment>%s</comment> into <comment>%s</comment>', $bundle->getNamespace(), $targetDir));

View File

@ -54,8 +54,8 @@ EOF
protected function execute(InputInterface $input, OutputInterface $output)
{
$realCacheDir = $this->getContainer()->getParameter('kernel.cache_dir');
$oldCacheDir = $realCacheDir.'_old';
$filesystem = $this->getContainer()->get('filesystem');
$oldCacheDir = $realCacheDir.'_old';
$filesystem = $this->getContainer()->get('filesystem');
if (!is_writable($realCacheDir)) {
throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $realCacheDir));
@ -132,7 +132,7 @@ EOF
}
// fix references to cached files with the real cache directory name
$search = array($warmupDir, str_replace('\\', '\\\\', $warmupDir));
$search = array($warmupDir, str_replace('\\', '\\\\', $warmupDir));
$replace = str_replace('\\', '/', $realCacheDir);
foreach (Finder::create()->files()->in($warmupDir) as $file) {
$content = str_replace($search, $replace, file_get_contents($file));
@ -140,7 +140,7 @@ EOF
}
// fix references to kernel/container related classes
$search = $tempKernel->getName().ucfirst($tempKernel->getEnvironment());
$search = $tempKernel->getName().ucfirst($tempKernel->getEnvironment());
$replace = $realKernel->getName().ucfirst($realKernel->getEnvironment());
foreach (Finder::create()->files()->name($search.'*')->in($warmupDir) as $file) {
$content = str_replace($search, $replace, file_get_contents($file));

View File

@ -99,8 +99,8 @@ EOF
$maxHost = max($maxHost, strlen($host));
}
$format = '%-'.$maxName.'s %-'.$maxMethod.'s %-'.$maxScheme.'s %-'.$maxHost.'s %s';
$formatHeader = '%-'.($maxName + 19).'s %-'.($maxMethod + 19).'s %-'.($maxScheme + 19).'s %-'.($maxHost + 19).'s %s';
$format = '%-'.$maxName.'s %-'.$maxMethod.'s %-'.$maxScheme.'s %-'.$maxHost.'s %s';
$formatHeader = '%-'.($maxName + 19).'s %-'.($maxMethod + 19).'s %-'.($maxScheme + 19).'s %-'.($maxHost + 19).'s %s';
$output->writeln(sprintf($formatHeader, '<comment>Name</comment>', '<comment>Method</comment>', '<comment>Scheme</comment>', '<comment>Host</comment>', '<comment>Path</comment>'));
foreach ($routes as $name => $route) {

View File

@ -229,7 +229,7 @@ class Configuration implements ConfigurationInterface
$organizeUrls = function ($urls) {
$urls += array(
'http' => array(),
'ssl' => array(),
'ssl' => array(),
);
foreach ($urls as $i => $url) {

View File

@ -218,13 +218,13 @@ class FrameworkExtension extends Extension
// Choose storage class based on the DSN
$supported = array(
'sqlite' => 'Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage',
'mysql' => 'Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage',
'file' => 'Symfony\Component\HttpKernel\Profiler\FileProfilerStorage',
'mongodb' => 'Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage',
'memcache' => 'Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage',
'sqlite' => 'Symfony\Component\HttpKernel\Profiler\SqliteProfilerStorage',
'mysql' => 'Symfony\Component\HttpKernel\Profiler\MysqlProfilerStorage',
'file' => 'Symfony\Component\HttpKernel\Profiler\FileProfilerStorage',
'mongodb' => 'Symfony\Component\HttpKernel\Profiler\MongoDbProfilerStorage',
'memcache' => 'Symfony\Component\HttpKernel\Profiler\MemcacheProfilerStorage',
'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage',
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage',
);
list($class, ) = explode(':', $config['dsn'], 2);
if (!isset($supported[$class])) {
@ -358,9 +358,9 @@ class FrameworkExtension extends Extension
$links = array(
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
'sublime' => 'subl://open?url=file://%%f&line=%%l',
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
'sublime' => 'subl://open?url=file://%%f&line=%%l',
);
$container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide);

View File

@ -31,12 +31,12 @@ class RedirectableUrlMatcher extends BaseMatcher
{
return array(
'_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction',
'path' => $path,
'permanent' => true,
'scheme' => $scheme,
'httpPort' => $this->context->getHttpPort(),
'httpsPort' => $this->context->getHttpsPort(),
'_route' => $route,
'path' => $path,
'permanent' => true,
'scheme' => $scheme,
'httpPort' => $this->context->getHttpPort(),
'httpsPort' => $this->context->getHttpsPort(),
'_route' => $route,
);
}
}

View File

@ -93,7 +93,7 @@ class CodeHelper extends Helper
$formattedValue = sprintf("<em>object</em>(<abbr title=\"%s\">%s</abbr>)", $item[1], $short);
} elseif ('array' === $item[0]) {
$formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
} elseif ('string' === $item[0]) {
} elseif ('string' === $item[0]) {
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset()));
} elseif ('null' === $item[0]) {
$formattedValue = '<em>null</em>';

View File

@ -23,11 +23,11 @@ class TemplateReference extends BaseTemplateReference
public function __construct($bundle = null, $controller = null, $name = null, $format = null, $engine = null)
{
$this->parameters = array(
'bundle' => $bundle,
'bundle' => $bundle,
'controller' => $controller,
'name' => $name,
'format' => $format,
'engine' => $engine,
'name' => $name,
'format' => $format,
'engine' => $engine,
);
}

View File

@ -23,7 +23,7 @@ class ControllerNameParserTest extends TestCase
{
$this->loader = new ClassLoader();
$this->loader->addPrefixes(array(
'TestBundle' => __DIR__.'/../Fixtures',
'TestBundle' => __DIR__.'/../Fixtures',
'TestApplication' => __DIR__.'/../Fixtures',
));
$this->loader->register();

View File

@ -35,7 +35,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
$processor = new Processor();
$configuration = new Configuration();
$config = $processor->processConfiguration($configuration, array(array(
'secret' => 's3cr3t',
'secret' => 's3cr3t',
'trusted_proxies' => $trustedProxies,
)));
@ -90,44 +90,44 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
{
return array(
'http_method_override' => true,
'trusted_proxies' => array(),
'ide' => null,
'default_locale' => 'en',
'form' => array('enabled' => false),
'csrf_protection' => array(
'enabled' => true,
'trusted_proxies' => array(),
'ide' => null,
'default_locale' => 'en',
'form' => array('enabled' => false),
'csrf_protection' => array(
'enabled' => true,
'field_name' => '_token',
),
'esi' => array('enabled' => false),
'fragments' => array(
'esi' => array('enabled' => false),
'fragments' => array(
'enabled' => false,
'path' => '/_fragment',
'path' => '/_fragment',
),
'profiler' => array(
'enabled' => false,
'only_exceptions' => false,
'profiler' => array(
'enabled' => false,
'only_exceptions' => false,
'only_master_requests' => false,
'dsn' => 'file:%kernel.cache_dir%/profiler',
'username' => '',
'password' => '',
'lifetime' => 86400,
'collect' => true,
'dsn' => 'file:%kernel.cache_dir%/profiler',
'username' => '',
'password' => '',
'lifetime' => 86400,
'collect' => true,
),
'translator' => array(
'enabled' => false,
'translator' => array(
'enabled' => false,
'fallback' => 'en',
),
'validation' => array(
'enabled' => false,
'validation' => array(
'enabled' => false,
'enable_annotations' => false,
'translation_domain' => 'validators',
),
'annotations' => array(
'cache' => 'file',
'annotations' => array(
'cache' => 'file',
'file_cache_dir' => '%kernel.cache_dir%/annotations',
'debug' => '%kernel.debug%',
'debug' => '%kernel.debug%',
),
'serializer' => array(
'serializer' => array(
'enabled' => false,
),
);

View File

@ -7,7 +7,7 @@ $container->loadFromExtension('framework', array(
'http_method_override' => false,
'trusted_proxies' => array('127.0.0.1', '10.0.0.1'),
'csrf_protection' => array(
'enabled' => true,
'enabled' => true,
'field_name' => '_csrf',
),
'esi' => array(
@ -18,32 +18,32 @@ $container->loadFromExtension('framework', array(
'enabled' => false,
),
'router' => array(
'resource' => '%kernel.root_dir%/config/routing.xml',
'type' => 'xml',
'resource' => '%kernel.root_dir%/config/routing.xml',
'type' => 'xml',
),
'session' => array(
'storage_id' => 'session.storage.native',
'handler_id' => 'session.handler.native_file',
'name' => '_SYMFONY',
'storage_id' => 'session.storage.native',
'handler_id' => 'session.handler.native_file',
'name' => '_SYMFONY',
'cookie_lifetime' => 86400,
'cookie_path' => '/',
'cookie_domain' => 'example.com',
'cookie_secure' => true,
'cookie_path' => '/',
'cookie_domain' => 'example.com',
'cookie_secure' => true,
'cookie_httponly' => true,
'gc_maxlifetime' => 90000,
'gc_divisor' => 108,
'gc_probability' => 1,
'save_path' => '/path/to/sessions',
'gc_maxlifetime' => 90000,
'gc_divisor' => 108,
'gc_probability' => 1,
'save_path' => '/path/to/sessions',
),
'templating' => array(
'assets_version' => 'SomeVersionScheme',
'assets_version' => 'SomeVersionScheme',
'assets_base_urls' => 'http://cdn.example.com',
'cache' => '/path/to/cache',
'engines' => array('php', 'twig'),
'loader' => array('loader.foo', 'loader.bar'),
'packages' => array(
'cache' => '/path/to/cache',
'engines' => array('php', 'twig'),
'loader' => array('loader.foo', 'loader.bar'),
'packages' => array(
'images' => array(
'version' => '1.0.0',
'version' => '1.0.0',
'base_urls' => array('http://images1.example.com', 'http://images2.example.com'),
),
'foo' => array(
@ -53,18 +53,18 @@ $container->loadFromExtension('framework', array(
'base_urls' => array('http://bar1.example.com', 'http://bar2.example.com'),
),
),
'form' => array(
'resources' => array('theme1', 'theme2'),
'form' => array(
'resources' => array('theme1', 'theme2'),
),
'hinclude_default_template' => 'global_hinclude_template',
),
'translator' => array(
'enabled' => true,
'enabled' => true,
'fallback' => 'fr',
),
'validation' => array(
'enabled' => true,
'cache' => 'apc',
'cache' => 'apc',
),
'annotations' => array(
'cache' => 'file',

View File

@ -4,8 +4,8 @@ $container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'templating' => array(
'assets_base_urls' => 'https://cdn.example.com',
'engines' => array('php', 'twig'),
'packages' => array(
'engines' => array('php', 'twig'),
'packages' => array(
'images' => array(
'base_urls' => 'https://images.example.com',
),

View File

@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'enabled' => true,
'enable_annotations' => true,
),
));

View File

@ -288,12 +288,12 @@ abstract class FrameworkExtensionTest extends TestCase
protected function createContainer(array $data = array())
{
return new ContainerBuilder(new ParameterBag(array_merge(array(
'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'),
'kernel.cache_dir' => __DIR__,
'kernel.debug' => false,
'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'),
'kernel.cache_dir' => __DIR__,
'kernel.debug' => false,
'kernel.environment' => 'test',
'kernel.name' => 'kernel',
'kernel.root_dir' => __DIR__,
'kernel.name' => 'kernel',
'kernel.root_dir' => __DIR__,
), $data)));
}

View File

@ -40,7 +40,7 @@ class TestSessionListenerTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->listener = new TestSessionListener($this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'));
$this->session = $this->getSession();
$this->session = $this->getSession();
}
protected function tearDown()

View File

@ -27,7 +27,7 @@ class SubRequestController extends ContainerAware
// simulates a failure during the rendering of a fragment...
// should render fr/json
$content = $handler->render($errorUrl, 'inline', array('alt' => $altUrl));
$content = $handler->render($errorUrl, 'inline', array('alt' => $altUrl));
// ...to check that the FragmentListener still references the right Request
// when rendering another fragment after the error occurred

View File

@ -27,12 +27,12 @@ class RedirectableUrlMatcherTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array(
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction',
'path' => '/foo/',
'permanent' => true,
'scheme' => null,
'httpPort' => $context->getHttpPort(),
'httpsPort' => $context->getHttpsPort(),
'_route' => null,
'path' => '/foo/',
'permanent' => true,
'scheme' => null,
'httpPort' => $context->getHttpPort(),
'httpsPort' => $context->getHttpsPort(),
'_route' => null,
),
$matcher->match('/foo')
);
@ -47,12 +47,12 @@ class RedirectableUrlMatcherTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array(
'_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction',
'path' => '/foo',
'permanent' => true,
'scheme' => 'https',
'httpPort' => $context->getHttpPort(),
'httpsPort' => $context->getHttpsPort(),
'_route' => 'foo',
'path' => '/foo',
'permanent' => true,
'scheme' => 'https',
'httpPort' => $context->getHttpPort(),
'httpsPort' => $context->getHttpsPort(),
'_route' => 'foo',
),
$matcher->match('/foo')
);

View File

@ -47,11 +47,11 @@ class RouterTest extends \PHPUnit_Framework_TestCase
$routes->add('foo', new Route(
'/foo',
array(
'foo' => 'before_%parameter.foo%',
'bar' => '%parameter.bar%_after',
'baz' => '%%escaped%%',
'boo' => array('%parameter%', '%%escaped_parameter%%', array('%bee_parameter%', 'bee')),
'bee' => array('bee', 'bee'),
'foo' => 'before_%parameter.foo%',
'bar' => '%parameter.bar%_after',
'baz' => '%%escaped%%',
'boo' => array('%parameter%', '%%escaped_parameter%%', array('%bee_parameter%', 'bee')),
'bee' => array('bee', 'bee'),
),
array(
)
@ -88,9 +88,9 @@ class RouterTest extends \PHPUnit_Framework_TestCase
array(
),
array(
'foo' => 'before_%parameter.foo%',
'bar' => '%parameter.bar%_after',
'baz' => '%%escaped%%',
'foo' => 'before_%parameter.foo%',
'bar' => '%parameter.bar%_after',
'baz' => '%%escaped%%',
)
));

View File

@ -207,8 +207,8 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
->expects($this->at(1))
->method('load')
->will($this->returnValue($this->getCatalogue('en', array(
'foo' => 'foo (EN)',
'bar' => 'bar (EN)',
'foo' => 'foo (EN)',
'bar' => 'bar (EN)',
'choice' => '{0} choice 0 (EN)|{1} choice 1 (EN)|]1,Inf] choice inf (EN)',
))))
;

View File

@ -51,13 +51,13 @@ class PhpStringTokenParser
{
protected static $replacements = array(
'\\' => '\\',
'$' => '$',
'n' => "\n",
'r' => "\r",
't' => "\t",
'f' => "\f",
'v' => "\v",
'e' => "\x1B",
'$' => '$',
'n' => "\n",
'r' => "\r",
't' => "\t",
'f' => "\f",
'v' => "\v",
'e' => "\x1B",
);
/**

View File

@ -49,7 +49,7 @@ class Translator extends BaseTranslator
$this->options = array(
'cache_dir' => null,
'debug' => false,
'debug' => false,
);
// check option names

View File

@ -37,27 +37,27 @@ class SecurityDataCollector extends DataCollector
{
if (null === $this->context) {
$this->data = array(
'enabled' => false,
'enabled' => false,
'authenticated' => false,
'token_class' => null,
'user' => '',
'roles' => array(),
'token_class' => null,
'user' => '',
'roles' => array(),
);
} elseif (null === $token = $this->context->getToken()) {
$this->data = array(
'enabled' => true,
'enabled' => true,
'authenticated' => false,
'token_class' => null,
'user' => '',
'roles' => array(),
'token_class' => null,
'user' => '',
'roles' => array(),
);
} else {
$this->data = array(
'enabled' => true,
'enabled' => true,
'authenticated' => $token->isAuthenticated(),
'token_class' => get_class($token),
'user' => $token->getUsername(),
'roles' => array_map(function ($role) { return $role->getRole();}, $token->getRoles()),
'token_class' => get_class($token),
'user' => $token->getUsername(),
'roles' => array_map(function ($role) { return $role->getRole();}, $token->getRoles()),
);
}
}

View File

@ -27,24 +27,24 @@ use Symfony\Component\DependencyInjection\Reference;
abstract class AbstractFactory implements SecurityFactoryInterface
{
protected $options = array(
'check_path' => '/login_check',
'use_forward' => false,
'require_previous_session' => true,
'check_path' => '/login_check',
'use_forward' => false,
'require_previous_session' => true,
);
protected $defaultSuccessHandlerOptions = array(
'always_use_default_target_path' => false,
'default_target_path' => '/',
'login_path' => '/login',
'target_path_parameter' => '_target_path',
'use_referer' => false,
'default_target_path' => '/',
'login_path' => '/login',
'target_path_parameter' => '_target_path',
'use_referer' => false,
);
protected $defaultFailureHandlerOptions = array(
'failure_path' => null,
'failure_forward' => false,
'login_path' => '/login',
'failure_path_parameter' => '_failure_path',
'failure_path' => null,
'failure_forward' => false,
'login_path' => '/login',
'failure_path_parameter' => '_failure_path',
);
public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId)

View File

@ -135,8 +135,8 @@ class SecurityExtension extends Extension
->getDefinition('security.acl.dbal.schema_listener')
->addTag('doctrine.event_listener', array(
'connection' => $config['connection'],
'event' => 'postGenerateSchema',
'lazy' => true,
'event' => 'postGenerateSchema',
'lazy' => true,
))
;
@ -281,8 +281,8 @@ class SecurityExtension extends Extension
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.logout_listener'));
$listener->replaceArgument(3, array(
'csrf_parameter' => $firewall['logout']['csrf_parameter'],
'intention' => $firewall['logout']['intention'],
'logout_path' => $firewall['logout']['path'],
'intention' => $firewall['logout']['intention'],
'logout_path' => $firewall['logout']['path'],
));
$listeners[] = new Reference($listenerId);
@ -452,7 +452,7 @@ class SecurityExtension extends Extension
// pbkdf2 encoder
if ('pbkdf2' === $config['algorithm']) {
return array(
'class' => new Parameter('security.encoder.pbkdf2.class'),
'class' => new Parameter('security.encoder.pbkdf2.class'),
'arguments' => array(
$config['hash_algorithm'],
$config['encode_as_base64'],
@ -465,14 +465,14 @@ class SecurityExtension extends Extension
// bcrypt encoder
if ('bcrypt' === $config['algorithm']) {
return array(
'class' => new Parameter('security.encoder.bcrypt.class'),
'class' => new Parameter('security.encoder.bcrypt.class'),
'arguments' => array($config['cost']),
);
}
// message digest encoder
return array(
'class' => new Parameter('security.encoder.digest.class'),
'class' => new Parameter('security.encoder.digest.class'),
'arguments' => array(
$config['algorithm'],
$config['encode_as_base64'],

View File

@ -26,9 +26,9 @@ abstract class CompleteConfigurationTest extends \PHPUnit_Framework_TestCase
{
$container = $this->getContainer('container1');
$this->assertEquals(array(
'ROLE_ADMIN' => array('ROLE_USER'),
'ROLE_ADMIN' => array('ROLE_USER'),
'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'),
'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'),
'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'),
), $container->getParameter('security.role_hierarchy.roles'));
}

View File

@ -36,7 +36,7 @@ class AbstractFactoryTest extends \PHPUnit_Framework_TestCase
'index_5' => new Reference('qux'),
'index_6' => new Reference('bar'),
'index_7' => array(
'use_forward' => true,
'use_forward' => true,
),
), $definition->getArguments());

View File

@ -22,7 +22,7 @@ class LoginController extends ContainerAware
$form = $this->container->get('form.factory')->create('user_login');
return $this->container->get('templating')->renderResponse('CsrfFormLoginBundle:Login:login.html.twig', array(
'form' => $form->createView(),
'form' => $form->createView(),
));
}

View File

@ -29,7 +29,7 @@ class LocalizedController extends ContainerAware
return $this->container->get('templating')->renderResponse('FormLoginBundle:Localized:login.html.twig', array(
// last username entered by the user
'last_username' => $this->container->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
'error' => $error,
'error' => $error,
));
}

View File

@ -30,7 +30,7 @@ class LoginController extends ContainerAware
return $this->container->get('templating')->renderResponse('FormLoginBundle:Login:login.html.twig', array(
// last username entered by the user
'last_username' => $this->container->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
'error' => $error,
'error' => $error,
));
}

View File

@ -54,10 +54,10 @@ class SwitchUserTest extends WebTestCase
public function getTestParameters()
{
return array(
'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403),
'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200),
'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403),
'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200),
'authorized_user_cannot_switch_to_non_existent' => array('user_can_switch', 'user_does_not_exist', 'user_can_switch', 500),
'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200),
'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200),
);
}

View File

@ -54,10 +54,10 @@ class ExceptionController
return new Response($this->twig->render(
(string) $this->findTemplate($request, $request->getRequestFormat(), $code, $this->debug),
array(
'status_code' => $code,
'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',
'exception' => $exception,
'logger' => $logger,
'status_code' => $code,
'status_text' => isset(Response::$statusTexts[$code]) ? Response::$statusTexts[$code] : '',
'exception' => $exception,
'logger' => $logger,
'currentContent' => $currentContent,
)
));

View File

@ -41,7 +41,7 @@ class TwigExtension extends Extension
foreach ($config['globals'] as $name => $value) {
if (is_array($value) && isset($value['key'])) {
$config['globals'][$name] = array(
'key' => $name,
'key' => $name,
'value' => $config['globals'][$name],
);
}

View File

@ -1,6 +1,6 @@
<?php
$container->loadFromExtension('twig', array(
'autoescape_service' => 'my_project.some_bundle.template_escaping_guesser',
'autoescape_service' => 'my_project.some_bundle.template_escaping_guesser',
'autoescape_service_method' => 'guess',
));

View File

@ -1,7 +1,7 @@
<?php
$container->loadFromExtension('twig', array(
'paths' => array(
'paths' => array(
'namespaced_path3' => 'namespace3',
),
));

View File

@ -9,17 +9,17 @@ $container->loadFromExtension('twig', array(
'globals' => array(
'foo' => '@bar',
'baz' => '@@qux',
'pi' => 3.14,
'pi' => 3.14,
'bad' => array('key' => 'foo'),
),
'auto_reload' => true,
'autoescape' => true,
'auto_reload' => true,
'autoescape' => true,
'base_template_class' => 'stdClass',
'cache' => '/tmp',
'charset' => 'ISO-8859-1',
'debug' => true,
'strict_variables' => true,
'paths' => array(
'cache' => '/tmp',
'charset' => 'ISO-8859-1',
'debug' => true,
'strict_variables' => true,
'paths' => array(
'path1',
'path2',
'namespaced_path1' => 'namespace1',

View File

@ -114,14 +114,14 @@ class TwigExtensionTest extends TestCase
public function testGlobalsWithDifferentTypesAndValues()
{
$globals = array(
'array' => array(),
'false' => false,
'float' => 2.0,
'array' => array(),
'false' => false,
'float' => 2.0,
'integer' => 3,
'null' => null,
'object' => new \stdClass(),
'string' => 'foo',
'true' => true,
'null' => null,
'object' => new \stdClass(),
'string' => 'foo',
'true' => true,
);
$container = $this->createContainer();
@ -183,10 +183,10 @@ class TwigExtensionTest extends TestCase
{
$container = new ContainerBuilder(new ParameterBag(array(
'kernel.cache_dir' => __DIR__,
'kernel.root_dir' => __DIR__.'/Fixtures',
'kernel.charset' => 'UTF-8',
'kernel.debug' => false,
'kernel.bundles' => array('TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle'),
'kernel.root_dir' => __DIR__.'/Fixtures',
'kernel.charset' => 'UTF-8',
'kernel.debug' => false,
'kernel.bundles' => array('TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle'),
)));
return $container;

View File

@ -65,10 +65,10 @@ class ExceptionController
return new Response($this->twig->render(
$template,
array(
'status_code' => $code,
'status_text' => Response::$statusTexts[$code],
'exception' => $exception,
'logger' => null,
'status_code' => $code,
'status_text' => Response::$statusTexts[$code],
'exception' => $exception,
'logger' => null,
'currentContent' => '',
)
), 200, array('Content-Type' => 'text/html'));

View File

@ -100,14 +100,14 @@ class ProfilerController
}
return new Response($this->twig->render($this->getTemplateManager()->getName($profile, $panel), array(
'token' => $token,
'profile' => $profile,
'token' => $token,
'profile' => $profile,
'collector' => $profile->getCollector($panel),
'panel' => $panel,
'page' => $page,
'request' => $request,
'panel' => $panel,
'page' => $page,
'request' => $request,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'is_ajax' => $request->isXmlHttpRequest(),
'is_ajax' => $request->isXmlHttpRequest(),
)), 200, array('Content-Type' => 'text/html'));
}
@ -198,11 +198,11 @@ class ProfilerController
}
return new Response($this->twig->render('@WebProfiler/Profiler/toolbar.html.twig', array(
'position' => $position,
'profile' => $profile,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'position' => $position,
'profile' => $profile,
'templates' => $this->getTemplateManager()->getTemplates($profile),
'profiler_url' => $url,
'token' => $token,
'token' => $token,
)), 200, array('Content-Type' => 'text/html'));
}
@ -224,31 +224,31 @@ class ProfilerController
$this->profiler->disable();
if (null === $session = $request->getSession()) {
$ip =
$ip =
$method =
$url =
$start =
$end =
$limit =
$token = null;
$url =
$start =
$end =
$limit =
$token = null;
} else {
$ip = $session->get('_profiler_search_ip');
$ip = $session->get('_profiler_search_ip');
$method = $session->get('_profiler_search_method');
$url = $session->get('_profiler_search_url');
$start = $session->get('_profiler_search_start');
$end = $session->get('_profiler_search_end');
$limit = $session->get('_profiler_search_limit');
$token = $session->get('_profiler_search_token');
$url = $session->get('_profiler_search_url');
$start = $session->get('_profiler_search_start');
$end = $session->get('_profiler_search_end');
$limit = $session->get('_profiler_search_limit');
$token = $session->get('_profiler_search_token');
}
return new Response($this->twig->render('@WebProfiler/Profiler/search.html.twig', array(
'token' => $token,
'ip' => $ip,
'token' => $token,
'ip' => $ip,
'method' => $method,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
)), 200, array('Content-Type' => 'text/html'));
}
@ -272,24 +272,24 @@ class ProfilerController
$profile = $this->profiler->loadProfile($token);
$ip = $request->query->get('ip');
$ip = $request->query->get('ip');
$method = $request->query->get('method');
$url = $request->query->get('url');
$start = $request->query->get('start', null);
$end = $request->query->get('end', null);
$limit = $request->query->get('limit');
$url = $request->query->get('url');
$start = $request->query->get('start', null);
$end = $request->query->get('end', null);
$limit = $request->query->get('limit');
return new Response($this->twig->render('@WebProfiler/Profiler/results.html.twig', array(
'token' => $token,
'profile' => $profile,
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
'ip' => $ip,
'method' => $method,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
'panel' => null,
'token' => $token,
'profile' => $profile,
'tokens' => $this->profiler->find($ip, $url, $limit, $method, $start, $end),
'ip' => $ip,
'method' => $method,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
'panel' => null,
)), 200, array('Content-Type' => 'text/html'));
}
@ -310,13 +310,13 @@ class ProfilerController
$this->profiler->disable();
$ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip'));
$ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip'));
$method = $request->query->get('method');
$url = $request->query->get('url');
$start = $request->query->get('start', null);
$end = $request->query->get('end', null);
$limit = $request->query->get('limit');
$token = $request->query->get('token');
$url = $request->query->get('url');
$start = $request->query->get('start', null);
$end = $request->query->get('end', null);
$limit = $request->query->get('limit');
$token = $request->query->get('token');
if (null !== $session = $request->getSession()) {
$session->set('_profiler_search_ip', $ip);
@ -335,13 +335,13 @@ class ProfilerController
$tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end);
return new RedirectResponse($this->generator->generate('_profiler_search_results', array(
'token' => $tokens ? $tokens[0]['token'] : 'empty',
'ip' => $ip,
'token' => $tokens ? $tokens[0]['token'] : 'empty',
'ip' => $ip,
'method' => $method,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
'url' => $url,
'start' => $start,
'end' => $end,
'limit' => $limit,
)), 302, array('Content-Type' => 'text/html'));
}

View File

@ -74,8 +74,8 @@ class RouterController
return new Response($this->twig->render('@WebProfiler/Router/panel.html.twig', array(
'request' => $request,
'router' => $profile->getCollector('router'),
'traces' => $matcher->getTraces($request->getPathInfo()),
'router' => $profile->getCollector('router'),
'traces' => $matcher->getTraces($request->getPathInfo()),
)), 200, array('Content-Type' => 'text/html'));
}
}

View File

@ -31,7 +31,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class WebDebugToolbarListener implements EventSubscriberInterface
{
const DISABLED = 1;
const ENABLED = 2;
const ENABLED = 2;
protected $twig;
protected $interceptRedirects;

View File

@ -133,10 +133,10 @@
function CanvasManager(requests, maxRequestTime) {
"use strict";
var _drawingColors = {{ colors|json_encode|raw }},
_storagePrefix = 'timeline/',
_threshold = 1,
_requests = requests,
var _drawingColors = {{ colors|json_encode|raw }},
_storagePrefix = 'timeline/',
_threshold = 1,
_requests = requests,
_maxRequestTime = maxRequestTime;
/**
@ -183,16 +183,16 @@
xc,
drawableEvents,
mainEvents,
elementId = 'timeline_' + request.id,
elementId = 'timeline_' + request.id,
canvasHeight = 0,
gapPerEvent = 38,
gapPerEvent = 38,
colors = _drawingColors,
space = 10.5,
ratio = (width - space * 2) / max,
space = 10.5,
ratio = (width - space * 2) / max,
h = space,
x = request.left * ratio + space, // position
canvas = cache.get(elementId) || cache.set(elementId, document.getElementById(elementId)),
ctx = canvas.getContext("2d"),
ctx = canvas.getContext("2d"),
scaleRatio,
devicePixelRatio;
@ -204,10 +204,10 @@
canvasHeight += gapPerEvent * drawableEvents.length;
// For retina displays so text and boxes will be crisp
devicePixelRatio = window.devicePixelRatio == "undefined" ? 1 : window.devicePixelRatio;
scaleRatio = devicePixelRatio / 1;
devicePixelRatio = window.devicePixelRatio == "undefined" ? 1 : window.devicePixelRatio;
scaleRatio = devicePixelRatio / 1;
canvas.width = width * scaleRatio;
canvas.width = width * scaleRatio;
canvas.height = canvasHeight * scaleRatio;
canvas.style.width = width + 'px';
@ -256,14 +256,14 @@
// For each sub event, ...
event.periods.forEach(function(period) {
// Set the drawing style.
ctx.fillStyle = colors['default'];
ctx.fillStyle = colors['default'];
ctx.strokeStyle = colors['default'];
if (colors[event.name]) {
ctx.fillStyle = colors[event.name];
ctx.fillStyle = colors[event.name];
ctx.strokeStyle = colors[event.name];
} else if (colors[event.category]) {
ctx.fillStyle = colors[event.category];
ctx.fillStyle = colors[event.category];
ctx.strokeStyle = colors[event.category];
}
@ -353,7 +353,7 @@
{
"use strict";
width = width || getContainerWidth();
width = width || getContainerWidth();
threshold = threshold || this.getThreshold();
var self = this;
@ -425,15 +425,15 @@
}
// Bind event handlers
var elementTimelineControl = query('#timeline-control'),
var elementTimelineControl = query('#timeline-control'),
elementThresholdControl = query('input[name="threshold"]');
window.onresize = canvasAutoUpdateOnResizeAndSubmit;
window.onresize = canvasAutoUpdateOnResizeAndSubmit;
elementTimelineControl.onsubmit = canvasAutoUpdateOnResizeAndSubmit;
elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
elementThresholdControl.onchange = canvasAutoUpdateOnThresholdChange;
elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
window.setTimeout(function() {
canvasAutoUpdateOnThresholdChange(null);

View File

@ -120,7 +120,7 @@ abstract class Client
public function setServerParameters(array $server)
{
$this->server = array_merge(array(
'HTTP_HOST' => 'localhost',
'HTTP_HOST' => 'localhost',
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
), $server);
}

View File

@ -62,17 +62,17 @@ class Cookie
public function __construct($name, $value, $expires = null, $path = null, $domain = '', $secure = false, $httponly = true, $encodedValue = false)
{
if ($encodedValue) {
$this->value = urldecode($value);
$this->value = urldecode($value);
$this->rawValue = $value;
} else {
$this->value = $value;
$this->value = $value;
$this->rawValue = urlencode($value);
}
$this->name = $name;
$this->expires = null === $expires ? null : (int) $expires;
$this->path = empty($path) ? '/' : $path;
$this->domain = $domain;
$this->secure = (bool) $secure;
$this->name = $name;
$this->expires = null === $expires ? null : (int) $expires;
$this->path = empty($path) ? '/' : $path;
$this->domain = $domain;
$this->secure = (bool) $secure;
$this->httponly = (bool) $httponly;
}
@ -141,12 +141,12 @@ class Cookie
list($name, $value) = explode('=', array_shift($parts), 2);
$values = array(
'name' => trim($name),
'value' => trim($value),
'expires' => null,
'path' => '/',
'domain' => '',
'secure' => false,
'name' => trim($name),
'value' => trim($value),
'expires' => null,
'path' => '/',
'domain' => '',
'secure' => false,
'httponly' => false,
'passedRawValue' => true,
);

View File

@ -39,7 +39,7 @@ class Response
public function __construct($content = '', $status = 200, array $headers = array())
{
$this->content = $content;
$this->status = $status;
$this->status = $status;
$this->headers = $headers;
}

View File

@ -456,7 +456,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$client = new TestClient();
$client->followRedirects(false);
$client->setNextResponse(new Response('', 302, array(
'Location' => 'http://www.example.com/redirected',
'Location' => 'http://www.example.com/redirected',
'Set-Cookie' => 'foo=bar',
)));
$client->request('GET', 'http://www.example.com/');
@ -468,16 +468,16 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testFollowRedirectWithHeaders()
{
$headers = array(
'HTTP_HOST' => 'www.example.com',
'HTTP_HOST' => 'www.example.com',
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
'CONTENT_TYPE' => 'application/vnd.custom+xml',
'HTTPS' => false,
'CONTENT_TYPE' => 'application/vnd.custom+xml',
'HTTPS' => false,
);
$client = new TestClient();
$client->followRedirects(false);
$client->setNextResponse(new Response('', 302, array(
'Location' => 'http://www.example.com/redirected',
'Location' => 'http://www.example.com/redirected',
)));
$client->request('GET', 'http://www.example.com/', array(), array(), array(
'CONTENT_TYPE' => 'application/vnd.custom+xml',
@ -495,15 +495,15 @@ class ClientTest extends \PHPUnit_Framework_TestCase
public function testFollowRedirectWithPort()
{
$headers = array(
'HTTP_HOST' => 'www.example.com:8080',
'HTTP_HOST' => 'www.example.com:8080',
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit',
'HTTPS' => false,
'HTTP_REFERER' => 'http://www.example.com:8080/',
'HTTPS' => false,
'HTTP_REFERER' => 'http://www.example.com:8080/',
);
$client = new TestClient();
$client->setNextResponse(new Response('', 302, array(
'Location' => 'http://www.example.com:8080/redirected',
'Location' => 'http://www.example.com:8080/redirected',
)));
$client->request('GET', 'http://www.example.com:8080/');
@ -633,10 +633,10 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('Symfony2 BrowserKit', $client->getServerParameter('HTTP_USER_AGENT'));
$client->request('GET', 'https://www.example.com/https/www.example.com', array(), array(), array(
'HTTP_HOST' => 'testhost',
'HTTP_HOST' => 'testhost',
'HTTP_USER_AGENT' => 'testua',
'HTTPS' => false,
'NEW_SERVER_KEY' => 'new-server-key-value',
'HTTPS' => false,
'NEW_SERVER_KEY' => 'new-server-key-value',
));
$this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST'));

View File

@ -37,7 +37,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
{
$response = new Response('foo', 200, array(
'Content-Type' => 'text/html',
'Set-Cookie' => array('foo=bar', 'bar=foo'),
'Set-Cookie' => array('foo=bar', 'bar=foo'),
));
$this->assertEquals('text/html', $response->getHeader('Content-Type'), '->getHeader() returns a header of the response');
@ -61,7 +61,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
{
$headers = array(
'content-type' => 'text/html; charset=utf-8',
'set-cookie' => array('foo=bar', 'bar=foo'),
'set-cookie' => array('foo=bar', 'bar=foo'),
);
$expected = 'content-type: text/html; charset=utf-8'."\n";

View File

@ -37,8 +37,8 @@ namespace Symfony\Component\ClassLoader;
* // register classes with namespaces
* $loader->registerNamespaces(array(
* 'Symfony\Component' => __DIR__.'/component',
* 'Symfony' => __DIR__.'/framework',
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
* 'Symfony' => __DIR__.'/framework',
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
* ));
*
* // register a library using the PEAR naming convention

View File

@ -86,7 +86,7 @@ class ClassMapGenerator
private static function findClasses($path)
{
$contents = file_get_contents($path);
$tokens = token_get_all($contents);
$tokens = token_get_all($contents);
$classes = array();

View File

@ -48,10 +48,10 @@ than one namespace at once:
```php
$loader->registerNamespaces(array(
'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'),
'Symfony' => array(__DIR__.'/src', __DIR__.'/symfony/src'),
'Doctrine\\Common' => __DIR__.'/vendor/doctrine-common/lib',
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
'Monolog' => __DIR__.'/vendor/monolog/src',
'Doctrine' => __DIR__.'/vendor/doctrine/lib',
'Monolog' => __DIR__.'/vendor/monolog/src',
));
```

View File

@ -72,9 +72,9 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
{
$data = array(
array(__DIR__.'/Fixtures/Namespaced', array(
'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php',
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php',
'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php',
),
),
@ -85,22 +85,22 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php',
)),
array(__DIR__.'/Fixtures/Pearlike', array(
'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php',
'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php',
'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php',
'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php',
'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php',
'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php',
'Pearlike_WithComments' => realpath(__DIR__).'/Fixtures/Pearlike/WithComments.php',
)),
array(__DIR__.'/Fixtures/classmap', array(
'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
'ClassMap\\SomeInterface' => realpath(__DIR__).'/Fixtures/classmap/SomeInterface.php',
'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php',
'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php',
'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php',
'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php',
)),
);

View File

@ -32,8 +32,8 @@ namespace Symfony\Component\ClassLoader;
* // register classes with namespaces
* $loader->registerNamespaces(array(
* 'Symfony\Component' => __DIR__.'/component',
* 'Symfony' => __DIR__.'/framework',
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
* 'Symfony' => __DIR__.'/framework',
* 'Sensio' => array(__DIR__.'/src', __DIR__.'/vendor'),
* ));
*
* // register a library using the PEAR naming convention

View File

@ -28,13 +28,13 @@ class NodeBuilder implements NodeParentInterface
public function __construct()
{
$this->nodeMapping = array(
'variable' => __NAMESPACE__.'\\VariableNodeDefinition',
'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition',
'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition',
'integer' => __NAMESPACE__.'\\IntegerNodeDefinition',
'float' => __NAMESPACE__.'\\FloatNodeDefinition',
'array' => __NAMESPACE__.'\\ArrayNodeDefinition',
'enum' => __NAMESPACE__.'\\EnumNodeDefinition',
'variable' => __NAMESPACE__.'\\VariableNodeDefinition',
'scalar' => __NAMESPACE__.'\\ScalarNodeDefinition',
'boolean' => __NAMESPACE__.'\\BooleanNodeDefinition',
'integer' => __NAMESPACE__.'\\IntegerNodeDefinition',
'float' => __NAMESPACE__.'\\FloatNodeDefinition',
'array' => __NAMESPACE__.'\\ArrayNodeDefinition',
'enum' => __NAMESPACE__.'\\EnumNodeDefinition',
);
}

View File

@ -107,13 +107,13 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase
array(
array(
0 => array(
'name' => 'something',
'name' => 'something',
),
5 => array(
0 => 'this won\'t work too',
0 => 'this won\'t work too',
'new_key' => 'some other value',
),
'string_key' => 'just value',
'string_key' => 'just value',
),
array(
0 => array (

View File

@ -754,9 +754,9 @@ class Application
$trace = $e->getTrace();
array_unshift($trace, array(
'function' => '',
'file' => $e->getFile() != null ? $e->getFile() : 'n/a',
'line' => $e->getLine() != null ? $e->getLine() : 'n/a',
'args' => array(),
'file' => $e->getFile() != null ? $e->getFile() : 'n/a',
'line' => $e->getLine() != null ? $e->getLine() : 'n/a',
'args' => array(),
));
for ($i = 0, $count = count($trace); $i < $count; $i++) {

View File

@ -30,11 +30,11 @@ class JsonDescriptor extends Descriptor
protected function describeInputArgument(InputArgument $argument, array $options = array())
{
return $this->output(array(
'name' => $argument->getName(),
'name' => $argument->getName(),
'is_required' => $argument->isRequired(),
'is_array' => $argument->isArray(),
'is_array' => $argument->isArray(),
'description' => $argument->getDescription(),
'default' => $argument->getDefault(),
'default' => $argument->getDefault(),
), $options);
}
@ -44,13 +44,13 @@ class JsonDescriptor extends Descriptor
protected function describeInputOption(InputOption $option, array $options = array())
{
return $this->output(array(
'name' => '--'.$option->getName(),
'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
'accept_value' => $option->acceptValue(),
'name' => '--'.$option->getName(),
'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
'accept_value' => $option->acceptValue(),
'is_value_required' => $option->isValueRequired(),
'is_multiple' => $option->isArray(),
'description' => $option->getDescription(),
'default' => $option->getDefault(),
'is_multiple' => $option->isArray(),
'description' => $option->getDescription(),
'default' => $option->getDefault(),
), $options);
}
@ -81,12 +81,12 @@ class JsonDescriptor extends Descriptor
$command->mergeApplicationDefinition(false);
return $this->output(array(
'name' => $command->getName(),
'usage' => $command->getSynopsis(),
'name' => $command->getName(),
'usage' => $command->getSynopsis(),
'description' => $command->getDescription(),
'help' => $command->getProcessedHelp(),
'aliases' => $command->getAliases(),
'definition' => $this->describeInputDefinition($command->getNativeDefinition(), array('as_array' => true)),
'help' => $command->getProcessedHelp(),
'aliases' => $command->getAliases(),
'definition' => $this->describeInputDefinition($command->getNativeDefinition(), array('as_array' => true)),
), $options);
}

View File

@ -21,31 +21,31 @@ namespace Symfony\Component\Console\Formatter;
class OutputFormatterStyle implements OutputFormatterStyleInterface
{
private static $availableForegroundColors = array(
'black' => 30,
'red' => 31,
'green' => 32,
'yellow' => 33,
'blue' => 34,
'magenta' => 35,
'cyan' => 36,
'white' => 37,
'black' => 30,
'red' => 31,
'green' => 32,
'yellow' => 33,
'blue' => 34,
'magenta' => 35,
'cyan' => 36,
'white' => 37,
);
private static $availableBackgroundColors = array(
'black' => 40,
'red' => 41,
'green' => 42,
'yellow' => 43,
'blue' => 44,
'magenta' => 45,
'cyan' => 46,
'white' => 47,
'black' => 40,
'red' => 41,
'green' => 42,
'yellow' => 43,
'blue' => 44,
'magenta' => 45,
'cyan' => 46,
'white' => 47,
);
private static $availableOptions = array(
'bold' => 1,
'underscore' => 4,
'blink' => 5,
'reverse' => 7,
'conceal' => 8,
'bold' => 1,
'underscore' => 4,
'blink' => 5,
'reverse' => 7,
'conceal' => 8,
);
private $foreground;

View File

@ -21,20 +21,20 @@ use Symfony\Component\Console\Output\OutputInterface;
*/
class ProgressHelper extends Helper
{
const FORMAT_QUIET = ' %percent%%';
const FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%';
const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%';
const FORMAT_QUIET_NOMAX = ' %current%';
const FORMAT_NORMAL_NOMAX = ' %current% [%bar%]';
const FORMAT_QUIET = ' %percent%%';
const FORMAT_NORMAL = ' %current%/%max% [%bar%] %percent%%';
const FORMAT_VERBOSE = ' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%';
const FORMAT_QUIET_NOMAX = ' %current%';
const FORMAT_NORMAL_NOMAX = ' %current% [%bar%]';
const FORMAT_VERBOSE_NOMAX = ' %current% [%bar%] Elapsed: %elapsed%';
// options
private $barWidth = 28;
private $barChar = '=';
private $barWidth = 28;
private $barChar = '=';
private $emptyBarChar = '-';
private $progressChar = '>';
private $format = null;
private $redrawFreq = 1;
private $format = null;
private $redrawFreq = 1;
private $lastMessagesLength;
private $barCharOriginal;
@ -92,7 +92,7 @@ class ProgressHelper extends Helper
*/
private $widths = array(
'current' => 4,
'max' => 4,
'max' => 4,
'percent' => 3,
'elapsed' => 6,
);
@ -183,9 +183,9 @@ class ProgressHelper extends Helper
public function start(OutputInterface $output, $max = null)
{
$this->startTime = time();
$this->current = 0;
$this->max = (int) $max;
$this->output = $output;
$this->current = 0;
$this->max = (int) $max;
$this->output = $output;
$this->lastMessagesLength = 0;
$this->barCharOriginal = '';
@ -332,11 +332,11 @@ class ProgressHelper extends Helper
}
if ($this->max > 0) {
$this->widths['max'] = $this->strlen($this->max);
$this->widths['max'] = $this->strlen($this->max);
$this->widths['current'] = $this->widths['max'];
} else {
$this->barCharOriginal = $this->barChar;
$this->barChar = $this->emptyBarChar;
$this->barChar = $this->emptyBarChar;
}
}
@ -349,7 +349,7 @@ class ProgressHelper extends Helper
*/
private function generate($finish = false)
{
$vars = array();
$vars = array();
$percent = 0;
if ($this->max > 0) {
$percent = (float) $this->current / $this->max;

View File

@ -49,8 +49,8 @@ class InputArgument
throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
}
$this->name = $name;
$this->mode = $mode;
$this->name = $name;
$this->mode = $mode;
$this->description = $description;
$this->setDefault($default);

View File

@ -86,9 +86,9 @@ class InputDefinition
*/
public function setArguments($arguments = array())
{
$this->arguments = array();
$this->requiredCount = 0;
$this->hasOptional = false;
$this->arguments = array();
$this->requiredCount = 0;
$this->hasOptional = false;
$this->hasAnArrayArgument = false;
$this->addArguments($arguments);
}

View File

@ -20,7 +20,7 @@ namespace Symfony\Component\Console\Input;
*/
class InputOption
{
const VALUE_NONE = 1;
const VALUE_NONE = 1;
const VALUE_REQUIRED = 2;
const VALUE_OPTIONAL = 4;
const VALUE_IS_ARRAY = 8;
@ -77,9 +77,9 @@ class InputOption
throw new \InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode));
}
$this->name = $name;
$this->shortcut = $shortcut;
$this->mode = $mode;
$this->name = $name;
$this->shortcut = $shortcut;
$this->mode = $mode;
$this->description = $description;
if ($this->isArray() && !$this->acceptValue()) {

View File

@ -22,15 +22,15 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
*/
interface OutputInterface
{
const VERBOSITY_QUIET = 0;
const VERBOSITY_NORMAL = 1;
const VERBOSITY_VERBOSE = 2;
const VERBOSITY_QUIET = 0;
const VERBOSITY_NORMAL = 1;
const VERBOSITY_VERBOSE = 2;
const VERBOSITY_VERY_VERBOSE = 3;
const VERBOSITY_DEBUG = 4;
const VERBOSITY_DEBUG = 4;
const OUTPUT_NORMAL = 0;
const OUTPUT_RAW = 1;
const OUTPUT_PLAIN = 2;
const OUTPUT_RAW = 1;
const OUTPUT_PLAIN = 2;
/**
* Writes a message to the output.

View File

@ -21,13 +21,13 @@ namespace Symfony\Component\CssSelector\Parser;
*/
class Token
{
const TYPE_FILE_END = 'eof';
const TYPE_DELIMITER = 'delimiter';
const TYPE_FILE_END = 'eof';
const TYPE_DELIMITER = 'delimiter';
const TYPE_WHITESPACE = 'whitespace';
const TYPE_IDENTIFIER = 'identifier';
const TYPE_HASH = 'hash';
const TYPE_NUMBER = 'number';
const TYPE_STRING = 'string';
const TYPE_HASH = 'hash';
const TYPE_NUMBER = 'number';
const TYPE_STRING = 'string';
/**
* @var int

View File

@ -31,13 +31,13 @@ class AttributeMatchingExtension extends AbstractExtension
{
return array(
'exists' => array($this, 'translateExists'),
'=' => array($this, 'translateEquals'),
'~=' => array($this, 'translateIncludes'),
'|=' => array($this, 'translateDashMatch'),
'^=' => array($this, 'translatePrefixMatch'),
'$=' => array($this, 'translateSuffixMatch'),
'*=' => array($this, 'translateSubstringMatch'),
'!=' => array($this, 'translateDifferent'),
'=' => array($this, 'translateEquals'),
'~=' => array($this, 'translateIncludes'),
'|=' => array($this, 'translateDashMatch'),
'^=' => array($this, 'translatePrefixMatch'),
'$=' => array($this, 'translateSuffixMatch'),
'*=' => array($this, 'translateSubstringMatch'),
'!=' => array($this, 'translateDifferent'),
);
}

View File

@ -34,12 +34,12 @@ class FunctionExtension extends AbstractExtension
public function getFunctionTranslators()
{
return array(
'nth-child' => array($this, 'translateNthChild'),
'nth-last-child' => array($this, 'translateNthLastChild'),
'nth-of-type' => array($this, 'translateNthOfType'),
'nth-child' => array($this, 'translateNthChild'),
'nth-last-child' => array($this, 'translateNthLastChild'),
'nth-of-type' => array($this, 'translateNthOfType'),
'nth-last-of-type' => array($this, 'translateNthLastOfType'),
'contains' => array($this, 'translateContains'),
'lang' => array($this, 'translateLang'),
'contains' => array($this, 'translateContains'),
'lang' => array($this, 'translateLang'),
);
}

View File

@ -45,14 +45,14 @@ class HtmlExtension extends AbstractExtension
public function getPseudoClassTranslators()
{
return array(
'checked' => array($this, 'translateChecked'),
'link' => array($this, 'translateLink'),
'checked' => array($this, 'translateChecked'),
'link' => array($this, 'translateLink'),
'disabled' => array($this, 'translateDisabled'),
'enabled' => array($this, 'translateEnabled'),
'enabled' => array($this, 'translateEnabled'),
'selected' => array($this, 'translateSelected'),
'invalid' => array($this, 'translateInvalid'),
'hover' => array($this, 'translateHover'),
'visited' => array($this, 'translateVisited'),
'invalid' => array($this, 'translateInvalid'),
'hover' => array($this, 'translateHover'),
'visited' => array($this, 'translateVisited'),
);
}

View File

@ -25,8 +25,8 @@ use Symfony\Component\CssSelector\XPath\XPathExpr;
*/
class NodeExtension extends AbstractExtension
{
const ELEMENT_NAME_IN_LOWER_CASE = 1;
const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
const ELEMENT_NAME_IN_LOWER_CASE = 1;
const ATTRIBUTE_NAME_IN_LOWER_CASE = 2;
const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4;
/**
@ -79,15 +79,15 @@ class NodeExtension extends AbstractExtension
public function getNodeTranslators()
{
return array(
'Selector' => array($this, 'translateSelector'),
'Selector' => array($this, 'translateSelector'),
'CombinedSelector' => array($this, 'translateCombinedSelector'),
'Negation' => array($this, 'translateNegation'),
'Function' => array($this, 'translateFunction'),
'Pseudo' => array($this, 'translatePseudo'),
'Attribute' => array($this, 'translateAttribute'),
'Class' => array($this, 'translateClass'),
'Hash' => array($this, 'translateHash'),
'Element' => array($this, 'translateElement'),
'Negation' => array($this, 'translateNegation'),
'Function' => array($this, 'translateFunction'),
'Pseudo' => array($this, 'translatePseudo'),
'Attribute' => array($this, 'translateAttribute'),
'Class' => array($this, 'translateClass'),
'Hash' => array($this, 'translateHash'),
'Element' => array($this, 'translateElement'),
);
}

View File

@ -30,14 +30,14 @@ class PseudoClassExtension extends AbstractExtension
public function getPseudoClassTranslators()
{
return array(
'root' => array($this, 'translateRoot'),
'first-child' => array($this, 'translateFirstChild'),
'last-child' => array($this, 'translateLastChild'),
'root' => array($this, 'translateRoot'),
'first-child' => array($this, 'translateFirstChild'),
'last-child' => array($this, 'translateLastChild'),
'first-of-type' => array($this, 'translateFirstOfType'),
'last-of-type' => array($this, 'translateLastOfType'),
'only-child' => array($this, 'translateOnlyChild'),
'only-of-type' => array($this, 'translateOnlyOfType'),
'empty' => array($this, 'translateEmpty'),
'last-of-type' => array($this, 'translateLastOfType'),
'only-child' => array($this, 'translateOnlyChild'),
'only-of-type' => array($this, 'translateOnlyOfType'),
'empty' => array($this, 'translateEmpty'),
);
}

View File

@ -27,19 +27,19 @@ class ErrorHandler
const TYPE_DEPRECATION = -100;
private $levels = array(
E_WARNING => 'Warning',
E_NOTICE => 'Notice',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice',
E_WARNING => 'Warning',
E_NOTICE => 'Notice',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice',
E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
E_DEPRECATED => 'Deprecated',
E_USER_DEPRECATED => 'User Deprecated',
E_ERROR => 'Error',
E_CORE_ERROR => 'Core Error',
E_COMPILE_ERROR => 'Compile Error',
E_PARSE => 'Parse',
E_DEPRECATED => 'Deprecated',
E_USER_DEPRECATED => 'User Deprecated',
E_ERROR => 'Error',
E_CORE_ERROR => 'Core Error',
E_COMPILE_ERROR => 'Compile Error',
E_PARSE => 'Parse',
);
private $level;

View File

@ -66,8 +66,8 @@ class FlattenException
foreach (array_merge(array($this), $this->getAllPrevious()) as $exception) {
$exceptions[] = array(
'message' => $exception->getMessage(),
'class' => $exception->getClass(),
'trace' => $exception->getTrace(),
'class' => $exception->getClass(),
'trace' => $exception->getTrace(),
);
}
@ -208,14 +208,14 @@ class FlattenException
{
$this->trace = array();
$this->trace[] = array(
'namespace' => '',
'namespace' => '',
'short_class' => '',
'class' => '',
'type' => '',
'function' => '',
'file' => $file,
'line' => $line,
'args' => array(),
'class' => '',
'type' => '',
'function' => '',
'file' => $file,
'line' => $line,
'args' => array(),
);
foreach ($trace as $entry) {
$class = '';
@ -227,14 +227,14 @@ class FlattenException
}
$this->trace[] = array(
'namespace' => $namespace,
'namespace' => $namespace,
'short_class' => $class,
'class' => isset($entry['class']) ? $entry['class'] : '',
'type' => isset($entry['type']) ? $entry['type'] : '',
'function' => isset($entry['function']) ? $entry['function'] : null,
'file' => isset($entry['file']) ? $entry['file'] : null,
'line' => isset($entry['line']) ? $entry['line'] : null,
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
'class' => isset($entry['class']) ? $entry['class'] : '',
'type' => isset($entry['type']) ? $entry['type'] : '',
'function' => isset($entry['function']) ? $entry['function'] : null,
'file' => isset($entry['file']) ? $entry['file'] : null,
'line' => isset($entry['line']) ? $entry['line'] : null,
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
);
}
}

View File

@ -298,7 +298,7 @@ EOF;
$formattedValue = sprintf("<em>object</em>(%s)", $this->abbrClass($item[1]));
} elseif ('array' === $item[0]) {
$formattedValue = sprintf("<em>array</em>(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
} elseif ('string' === $item[0]) {
} elseif ('string' === $item[0]) {
$formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES | ENT_SUBSTITUTE, $this->charset));
} elseif ('null' === $item[0]) {
$formattedValue = '<em>null</em>';

View File

@ -162,8 +162,8 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
'message' => 'test',
'class' => 'Exception',
'trace' => array(array(
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123,
'args' => array(),
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123,
'args' => array(),
)),
),
), $flattened->toArray());
@ -214,14 +214,14 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase
'class' => 'Exception',
'trace' => array(
array(
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '',
'file' => 'foo.php', 'line' => 123,
'args' => array(),
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '',
'file' => 'foo.php', 'line' => 123,
'args' => array(),
),
array(
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => 'test',
'file' => __FILE__, 'line' => 123,
'args' => array(
'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => 'test',
'file' => __FILE__, 'line' => 123,
'args' => array(
array(
'incomplete-object', 'BogusTestClass',
),

View File

@ -59,7 +59,7 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface
public function process(ContainerBuilder $container)
{
$this->container = $container;
$this->graph = $container->getCompiler()->getServiceReferenceGraph();
$this->graph = $container->getCompiler()->getServiceReferenceGraph();
$this->graph->clear();
foreach ($container->getDefinitions() as $id => $definition) {

View File

@ -58,8 +58,8 @@ class CheckCircularReferencesPass implements CompilerPassInterface
private function checkOutEdges(array $edges)
{
foreach ($edges as $edge) {
$node = $edge->getDestNode();
$id = $node->getId();
$node = $edge->getDestNode();
$id = $node->getId();
if (empty($this->checkedNodes[$id])) {
$searchKey = array_search($id, $this->currentPath);

View File

@ -87,12 +87,12 @@ class Container implements IntrospectableContainerInterface
{
$this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag;
$this->services = array();
$this->aliases = array();
$this->scopes = array();
$this->scopeChildren = array();
$this->services = array();
$this->aliases = array();
$this->scopes = array();
$this->scopeChildren = array();
$this->scopedServices = array();
$this->scopeStacks = array();
$this->scopeStacks = array();
}
/**

View File

@ -26,10 +26,10 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
interface ContainerInterface
{
const EXCEPTION_ON_INVALID_REFERENCE = 1;
const NULL_ON_INVALID_REFERENCE = 2;
const IGNORE_ON_INVALID_REFERENCE = 3;
const SCOPE_CONTAINER = 'container';
const SCOPE_PROTOTYPE = 'prototype';
const NULL_ON_INVALID_REFERENCE = 2;
const IGNORE_ON_INVALID_REFERENCE = 3;
const SCOPE_CONTAINER = 'container';
const SCOPE_PROTOTYPE = 'prototype';
/**
* Sets a service.

View File

@ -34,8 +34,8 @@ class GraphvizDumper extends Dumper
private $edges;
private $options = array(
'graph' => array('ratio' => 'compress'),
'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'),
'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5),
'node' => array('fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'),
'edge' => array('fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5),
'node.instance' => array('fillcolor' => '#9999ff', 'style' => 'filled'),
'node.definition' => array('fillcolor' => '#eeeeee'),
'node.missing' => array('fillcolor' => '#ff9999', 'style' => 'filled'),

View File

@ -96,7 +96,7 @@ class PhpDumper extends Dumper
public function dump(array $options = array())
{
$options = array_merge(array(
'class' => 'ProjectServiceContainer',
'class' => 'ProjectServiceContainer',
'base_class' => 'Container',
), $options);
@ -333,9 +333,9 @@ class PhpDumper extends Dumper
throw new InvalidArgumentException(sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id));
}
$simple = $this->isSimpleInstance($id, $definition);
$simple = $this->isSimpleInstance($id, $definition);
$isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition);
$instantiation = '';
$instantiation = '';
if (!$isProxyCandidate && ContainerInterface::SCOPE_CONTAINER === $definition->getScope()) {
$instantiation = "\$this->services['$id'] = ".($simple ? '' : '$instance');
@ -546,17 +546,17 @@ EOF;
}
if ($definition->isLazy()) {
$lazyInitialization = '$lazyLoad = true';
$lazyInitialization = '$lazyLoad = true';
$lazyInitializationDoc = "\n * @param bool \$lazyLoad whether to try lazy-loading the service with a proxy\n *";
} else {
$lazyInitialization = '';
$lazyInitialization = '';
$lazyInitializationDoc = '';
}
// with proxies, for 5.3.3 compatibility, the getter must be public to be accessible to the initializer
$isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition);
$visibility = $isProxyCandidate ? 'public' : 'protected';
$code = <<<EOF
$visibility = $isProxyCandidate ? 'public' : 'protected';
$code = <<<EOF
/**
* Gets the '$id' service.$doc

View File

@ -572,7 +572,7 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
$container->compile();
$classesPath = realpath(__DIR__.'/Fixtures/includes/classes.php');
$classesPath = realpath(__DIR__.'/Fixtures/includes/classes.php');
$matchingResources = array_filter(
$container->getResources(),
function (ResourceInterface $resource) use ($classesPath) {
@ -650,16 +650,16 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
public function testPrivateServiceUser()
{
$fooDefinition = new Definition('BarClass');
$fooDefinition = new Definition('BarClass');
$fooUserDefinition = new Definition('BarUserClass', array(new Reference('bar')));
$container = new ContainerBuilder();
$container = new ContainerBuilder();
$container->setResourceTracking(false);
$fooDefinition->setPublic(false);
$container->addDefinitions(array(
'bar' => $fooDefinition,
'bar_user' => $fooUserDefinition,
'bar' => $fooDefinition,
'bar_user' => $fooUserDefinition,
));
$container->compile();

View File

@ -41,8 +41,8 @@ class GraphvizDumperTest extends \PHPUnit_Framework_TestCase
$dumper = new GraphvizDumper($container);
$this->assertEquals($dumper->dump(array(
'graph' => array('ratio' => 'normal'),
'node' => array('fontsize' => 13, 'fontname' => 'Verdana', 'shape' => 'square'),
'edge' => array('fontsize' => 12, 'fontname' => 'Verdana', 'color' => 'white', 'arrowhead' => 'closed', 'arrowsize' => 1),
'node' => array('fontsize' => 13, 'fontname' => 'Verdana', 'shape' => 'square'),
'edge' => array('fontsize' => 12, 'fontname' => 'Verdana', 'color' => 'white', 'arrowhead' => 'closed', 'arrowsize' => 1),
'node.instance' => array('fillcolor' => 'green', 'style' => 'empty'),
'node.definition' => array('fillcolor' => 'grey'),
'node.missing' => array('fillcolor' => 'red', 'style' => 'empty'),

Some files were not shown because too many files have changed in this diff Show More