8000 [2.5] Remove aligned '=>' and '=' by polc · Pull Request #12362 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[2.5] Remove aligned '=>' and '=' #12362

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading 10000
Diff view
Diff view
Remove aligned '=>' and '='
  • Loading branch information
polc committed Oct 30, 2014
commit e638ccbe39dcaf408599ec7b8aa91ccb09ec3e47
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,9 @@ protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheD

if (!isset($cacheDriver['namespace'])) {
// generate a unique namespace for the given application
$env = $container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment');
$hash = hash('sha256', $env);
$namespace = 'sf2'.$this->getMappingResourceExtension().'_'.$objectManagerName.'_'.$hash;
$env = $container->getParameter('kernel.root_dir').$container->getParameter('kernel.environment');
$hash = hash('sha256', $env);
$namespace = 'sf2'.$this->getMappingResourceExtension().'_'.$objectManagerName.'_'.$hash;

$cacheDriver['namespace'] = $namespace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,21 @@ public function providerBasicDrivers()
*/
public function testLoadBasicCacheDriver($class, array $config, array $expectedCalls = array())
{
$container = $this->createContainer();
$cacheName = 'metadata_cache';
$objectManager = array(
'name' => 'default',
$container = $this->createContainer();
$cacheName = 'metadata_cache';
$objectManager = array(
'name' => 'default',
'metadata_cache_driver' => $config,
);

$this->invokeLoadCacheDriver($objectManager, $container, $cacheName);

$this->assertTrue($container->hasDefinition('doctrine.orm.default_metadata_cache'));

$definition = $container->getDefinition('doctrine.orm.default_metadata_cache');
$defCalls = $definition->getMethodCalls();
$definition = $container->getDefinition('doctrine.orm.default_metadata_cache');
$defCalls = $definition->getMethodCalls();
$expectedCalls[] = 'setNamespace';
$actualCalls = array_map(function ($call) {
$actualCalls = array_map(function ($call) {
return $call[0];
}, $defCalls);

Expand All @@ -98,14 +98,14 @@ public function testLoadBasicCacheDriver($class, array $config, array $expectedC

public function testServiceCacheDriver()
{
$cacheName = 'metadata_cache';
$container = $this->createContainer();
$definition = new Definition('%doctrine.orm.cache.apc.class%');
$objectManager = array(
'name' => 'default',
$cacheName = 'metadata_cache';
$container = $this->createContainer();
$definition = new Definition('%doctrine.orm.cache.apc.class%');
$objectManager = array(
'name' => 'default',
'metadata_cache_driver' => array(
'type' => 'service',
'id' => 'service_driver',
'id' => 'service_driver',
),
);

Expand All @@ -122,10 +122,10 @@ public function testServiceCacheDriver()
*/
public function testUnrecognizedCacheDriverException()
{
$cacheName = 'metadata_cache';
$container = $this->createContainer();
$objectManager = array(
'name' => 'default',
$cacheName = 'metadata_cache';
$container = $this->createContainer();
$objectManager = array(
'name' => 'default',
'metadata_cache_driver' => array(
'type' => 'unrecognized_type',
),
Expand All @@ -151,12 +151,12 @@ protected function invokeLoadCacheDriver(array $objectManager, ContainerBuilder
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)));
}
}
8 changes: 4 additions & 4 deletions src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ public function format(array $record)
{
if ($record['level'] >= Logger::ERROR) {
$record['start_tag'] = '<error>';
$record['end_tag'] = '</error>';
$record['end_tag'] = '</error>';
} elseif ($record['level'] >= Logger::NOTICE) {
$record['start_tag'] = '<comment>';
$record['end_tag'] = '</comment>';
$record['end_tag'] = '</comment>';
} elseif ($record['level'] >= Logger::INFO) {
$record['start_tag'] = '<info>';
$record['end_tag'] = '</info>';
$record['end_tag'] = '</info>';
} else {
$record['start_tag'] = '';
$record['end_tag'] = '';
$record['end_tag'] = '';
}

return parent::format($record);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ protected function getRouteData(Route $route)
unset($requirements['_scheme'], $requirements['_method']);

return array(
'path' => $route->getPath(),
'host' => '' !== $route->getHost() ? $route->getHost() : 'ANY',
'scheme' => $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY',
'method' => $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY',
'class' => get_class($route),
'defaults' => $route->getDefaults(),
'path' => $route->getPath(),
'host' => '' !== $route->getHost() ? $route->getHost() : 'ANY',
'scheme' => $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY',
'method' => $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY',
'class' => get_class($route),
'defaults' => $route->getDefaults(),
'requirements' => $requirements ?: 'NO CUSTOM',
'options' => $route->getOptions(),
'pathRegex' => $route->compile()->getRegex(),
'options' => $route->getOptions(),
'pathRegex' => $route->compile()->getRegex(),
);
}

Expand All @@ -189,11 +189,11 @@ protected function getRouteData(Route $route)
private function getContainerDefinitionData(Definition $definition, $omitTags = false)
{
$data = array(
'class' => (string) $definition->getClass(),
'scope' => $definition->getScope(),
'public' => $definition->isPublic(),
'class' => (string) $definition->getClass(),
'scope' => $definition->getScope(),
'public' => $definition->isPublic(),
'synthetic' => $definition->isSynthetic(),
'file' => $definition->getFile(),
'file' => $definition->getFile(),
);

if (!$omitTags) {
Expand All @@ -219,7 +219,7 @@ private function getContainerAliasData(Alias $alias)
{
return array(
'service' => (string) $alias,
'public' => $alias->isPublic(),
'public' => $alias->isPublic(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ private function getContainerBuilderDescriptionTestData(array $objects)
{
$variations = array(
'services' => array('show_private' => true),
'public' => array('show_private' => false),
'tag1' => array('show_private' => true, 'tag' => 'tag1'),
'tags' => array('group_by' => 'tags', 'show_private' => true),
'public' => array('show_private' => false),
'tag1' => array('show_private' => true, 'tag' => 'tag1'),
'tags' => array('group_by' => 'tags', 'show_private' => true),
);

$data = array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public static function getContainerParameters()
return array(
'parameters_1' => new ParameterBag(array(
'integer' => 12,
'string' => 'Hello world!',
'string' => 'Hello world!',
'boolean' => true,
'array' => array(12, 'Hello world!', true),
'array' => array(12, 'Hello world!', true),
)),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ protected static function getBundleDefaultConfig()
'validation' => array(
'enabled' => false,
'enable_annotations' => false,
'static_method' => array('loadValidatorMetadata'),
'static_method' => array('loadValidatorMetadata'),
'translation_domain' => 'validators',
'strict_email' => false,
'api' => version_compare(PHP_VERSION, '5.3.9', '<') ? '2.4' : '2.5-bc',
'strict_email' => false,
'api' => version_compare(PHP_VERSION, '5.3.9', '<') ? '2.4' : '2.5-bc',
),
'annotations' => array(
'cache' => 'file',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'api' => '2.4',
'enabled' => true,
'api' => '2.4',
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'api' => '2.5',
'enabled' => true,
'api' => '2.5',
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'api' => '2.5-bc',
'enabled' => true,
'api' => '2.5-bc',
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'api' => 'auto',
'enabled' => true,
'api' => 'auto',
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'enabled' => true,
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'static_method' => array('loadFoo', 'loadBar'),
'enabled' => true,
'static_method' => array('loadFoo', 'loadBar'),
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'validation' => array(
'enabled' => true,
'static_method' => false,
'enabled' => true,
'static_method' => false,
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public function testSchemeRedirect()

$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')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public function testGetInvalidHelper()
protected function getContainer()
{
$container = new Container();
$session = new Session(new MockArraySessionStorage());
$request = new Request();
$stack = new RequestStack();
$session = new Session(new MockArraySessionStorage());
$request = new Request();
$stack = new RequestStack();
$stack->push($request);

$request->setSession($session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Translator extends BaseTranslator
protected $container;
protected $options = array(
'cache_dir' => null,
'debug' => false,
'debug' => false,
);
protected $loaderIds;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ private function writeNode(NodeInterface $node, $depth = 0, $root = false, $name
// get attributes

// metadata
$name = str_replace('_', '-', $child->getName());
$name = str_replace('_', '-', $child->getName());
$value = '%%%%not_defined%%%%'; // use a string which isn't used in the normal world

// comments
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Command/HelpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$helper = new DescriptorHelper();
$helper->describe($output, $this->command, array(
'format' => $input->getOption('format'),
'raw' => $input->getOption('raw'),
'raw' => $input->getOption('raw'),
));

$this->command = null;
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Command/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ protected function execute(InputInterface $input, OutputInterface $output)

$helper = new DescriptorHelper();
$helper->describe($output, $this->getApplication(), array(
'format' => $input->getOption('format'),
'raw_text' => $input->getOption('raw'),
'format' => $input->getOption('format'),
'raw_text' => $input->getOption('raw'),
'namespace' => $input->getArgument('namespace'),
));
}
Expand Down
28 changes: 14 additions & 14 deletions src/Symfony/Component/Console/Descriptor/JsonDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ private function writeData(array $data, array $options)
private function getInputArgumentData(InputArgument $argument)
{
return 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(),
);
}

Expand All @@ -113,13 +113,13 @@ private function getInputArgumentData(InputArgument $argument)
private function getInputOptionData(InputOption $option)
{
return 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(),
);
}

Expand Down Expand Up @@ -154,12 +154,12 @@ private function getCommandData(Command $command)
$command->mergeApplicationDefinition(false);

return array(
'name' => $command->getName(),
'usage' => $command->getSynopsis(),
'name' => $command->getName(),
'usage' => $command->getSynopsis(),
'description' => $command->getDescription(),
'help' => $command->getProcessedHelp(),
'aliases' => $command->getAliases(),
'definition' => $this->getInputDefinitionData($command->getNativeDefinition()),
'help' => $command->getProcessedHelp(),
'aliases' => $command->getAliases(),
'definition' => $this->getInputDefinitionData($command->getNativeDefinition()),
);
}
}
Loading
0