Skip to content

Commit

Permalink
[CS Fix] Consistent coding-style of concatenation operator usage
Browse files Browse the repository at this point in the history
  • Loading branch information
canni committed Apr 2, 2013
1 parent 54b32f1 commit 7c47e34
Show file tree
Hide file tree
Showing 107 changed files with 305 additions and 305 deletions.
4 changes: 2 additions & 2 deletions UPGRADE-2.1.md
Expand Up @@ -901,7 +901,7 @@
public function guessPattern($class, $property)
{
if (/* condition */) {
return new ValueGuess('.{' . $minLength . ',}', Guess::LOW_CONFIDENCE);
return new ValueGuess('.{'.$minLength.',}', Guess::LOW_CONFIDENCE);
}
}
```
Expand Down Expand Up @@ -1189,7 +1189,7 @@
public function isPropertyValid(ExecutionContext $context)
{
// ...
$propertyPath = $context->getPropertyPath() . '.property';
$propertyPath = $context->getPropertyPath().'.property';
$context->setPropertyPath($propertyPath);
$context->addViolation('Error Message', array(), null);
}
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE-2.2.md
Expand Up @@ -464,7 +464,7 @@
$path .= '.';
}
$context->getGraphWalker()->walkReference($someObject, $group, $path . 'myProperty', false);
$context->getGraphWalker()->walkReference($someObject, $group, $path.'myProperty', false);
}
}
```
Expand Down
Expand Up @@ -304,7 +304,7 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container)
protected function loadObjectManagerCacheDriver(array $objectManager, ContainerBuilder $container, $cacheName)
{
$cacheDriver = $objectManager[$cacheName.'_driver'];
$cacheDriverService = $this->getObjectManagerElementName($objectManager['name'] . '_' . $cacheName);
$cacheDriverService = $this->getObjectManagerElementName($objectManager['name'].'_'.$cacheName);

switch ($cacheDriver['type']) {
case 'service':
Expand Down
Expand Up @@ -51,21 +51,21 @@ public function process(ContainerBuilder $container)
*/
private function updateValidatorMappingFiles(ContainerBuilder $container, $mapping, $extension)
{
if ( ! $container->hasParameter('validator.mapping.loader.' . $mapping . '_files_loader.mapping_files')) {
if ( ! $container->hasParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files')) {
return;
}

$files = $container->getParameter('validator.mapping.loader.' . $mapping . '_files_loader.mapping_files');
$validationPath = 'Resources/config/validation.' . $this->managerType . '.' . $extension;
$files = $container->getParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files');
$validationPath = 'Resources/config/validation.'.$this->managerType.'.'.$extension;

foreach ($container->getParameter('kernel.bundles') as $bundle) {
$reflection = new \ReflectionClass($bundle);
if (is_file($file = dirname($reflection->getFilename()) . '/' . $validationPath)) {
if (is_file($file = dirname($reflection->getFilename()).'/'.$validationPath)) {
$files[] = realpath($file);
$container->addResource(new FileResource($file));
}
}

$container->setParameter('validator.mapping.loader.' . $mapping . '_files_loader.mapping_files', $files);
$container->setParameter('validator.mapping.loader.'.$mapping.'_files_loader.mapping_files', $files);
}
}
Expand Up @@ -120,7 +120,7 @@ public function testCollapsedEntityField()
*/
public function testCollapsedEntityFieldWithChoices()
{
$choices = $this->em->createQuery('SELECT c FROM ' . self::ENTITY_CLASS . ' c')->getResult();
$choices = $this->em->createQuery('SELECT c FROM '.self::ENTITY_CLASS.' c')->getResult();
$this->setMaxRunningTime(1);

for ($i = 0; $i < 40; ++$i) {
Expand All @@ -139,7 +139,7 @@ public function testCollapsedEntityFieldWithChoices()
*/
public function testCollapsedEntityFieldWithPreferredChoices()
{
$choices = $this->em->createQuery('SELECT c FROM ' . self::ENTITY_CLASS . ' c')->getResult();
$choices = $this->em->createQuery('SELECT c FROM '.self::ENTITY_CLASS.' c')->getResult();
$this->setMaxRunningTime(1);

for ($i = 0; $i < 40; ++$i) {
Expand Down
Expand Up @@ -95,7 +95,7 @@ public function validate($entity, Constraint $constraint)
if (count($relatedId) > 1) {
throw new ConstraintDefinitionException(
"Associated entities are not allowed to have more than one identifier field to be " .
"part of a unique constraint in: " . $class->getName() . "#" . $fieldName
"part of a unique constraint in: ".$class->getName()."#".$fieldName
);
}
$criteria[$fieldName] = array_pop($relatedId);
Expand Down
Expand Up @@ -84,7 +84,7 @@ public function __construct($class, $labelPath = null, $choices = null, $queryOb
{
$this->class = $class;

$queryClass = $this->class . 'Query';
$queryClass = $this->class.'Query';
$query = new $queryClass();

$this->identifier = $query->getTableMap()->getPrimaryKeys();
Expand Down Expand Up @@ -198,7 +198,7 @@ public function getChoicesForValues(array $values)
{
if (!$this->loaded) {
if (1 === count($this->identifier)) {
$filterBy = 'filterBy' . current($this->identifier)->getPhpName();
$filterBy = 'filterBy'.current($this->identifier)->getPhpName();

return (array) $this->query->create()
->$filterBy($values)
Expand Down
Expand Up @@ -53,7 +53,7 @@ class PropelUserProvider implements UserProviderInterface
public function __construct($class, $property = null)
{
$this->class = $class;
$this->queryClass = $class . 'Query';
$this->queryClass = $class.'Query';
$this->property = $property;
}

Expand All @@ -66,7 +66,7 @@ public function loadUserByUsername($username)
$query = $queryClass::create();

if (null !== $this->property) {
$filter = 'filterBy' . ucfirst($this->property);
$filter = 'filterBy'.ucfirst($this->property);
$query->$filter($username);
} else {
$query->filterByUsername($username);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php
Expand Up @@ -29,7 +29,7 @@ public function compile(\Twig_Compiler $compiler)

if (isset($arguments[0])) {
$compiler->subcompile($arguments[0]);
$compiler->raw(', \'' . $blockNameSuffix . '\'');
$compiler->raw(', \''.$blockNameSuffix.'\'');

if (isset($arguments[1])) {
if ('label' === $blockNameSuffix) {
Expand Down
Expand Up @@ -134,7 +134,7 @@ public function isSelectedChoiceProvider()
*/
public function testIsChoiceSelected($expected, $choice, $value)
{
$choice = new ChoiceView($choice, $choice, $choice . ' label');
$choice = new ChoiceView($choice, $choice, $choice.' label');

$this->assertSame($expected, $this->extension->isSelectedChoice($choice, $value));
}
Expand Down
Expand Up @@ -184,7 +184,7 @@ private function formatConfigs(array $array)
$string = '';
ksort($array);
foreach ($array as $name => $value) {
$string .= ($string ? "\n" . str_repeat(' ', 13) : '') . $name . ': ' . $this->formatValue($value);
$string .= ($string ? "\n".str_repeat(' ', 13) : '').$name.': '.$this->formatValue($value);
}

return $string;
Expand Down
Expand Up @@ -21,10 +21,10 @@
* @author: Albert Jessurum <ajessu@gmail.com>
*/

if (is_file($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . $_SERVER['SCRIPT_NAME'])) {
if (is_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_NAME'])) {
return false;
}

$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'app_dev.php';
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.'app_dev.php';

require 'app_dev.php';
Expand Up @@ -47,7 +47,7 @@ protected function getExtensions()
// should be moved to the Form component once absolute file paths are supported
// by the default name parser in the Templating component
$reflClass = new \ReflectionClass('Symfony\Bundle\FrameworkBundle\FrameworkBundle');
$root = realpath(dirname($reflClass->getFileName()) . '/Resources/views');
$root = realpath(dirname($reflClass->getFileName()).'/Resources/views');
$rootTheme = realpath(__DIR__.'/Resources');
$templateNameParser = new StubTemplateNameParser($root, $rootTheme);
$loader = new FilesystemLoader(array());
Expand Down
Expand Up @@ -47,7 +47,7 @@ protected function getExtensions()
// should be moved to the Form component once absolute file paths are supported
// by the default name parser in the Templating component
$reflClass = new \ReflectionClass('Symfony\Bundle\FrameworkBundle\FrameworkBundle');
$root = realpath(dirname($reflClass->getFileName()) . '/Resources/views');
$root = realpath(dirname($reflClass->getFileName()).'/Resources/views');
$rootTheme = realpath(__DIR__.'/Resources');
$templateNameParser = new StubTemplateNameParser($root, $rootTheme);
$loader = new FilesystemLoader(array());
Expand Down
Expand Up @@ -59,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
try {
$schema->addToSchema($connection->getSchemaManager()->createSchema());
} catch (SchemaException $e) {
$output->writeln("Aborting: " . $e->getMessage());
$output->writeln("Aborting: ".$e->getMessage());

return 1;
}
Expand Down
Expand Up @@ -101,10 +101,10 @@ private function generateLogoutUrl($key, $referenceType)
if ('/' === $logoutPath[0]) {
$request = $this->container->get('request');

$url = UrlGeneratorInterface::ABSOLUTE_URL === $referenceType ? $request->getUriForPath($logoutPath) : $request->getBasePath() . $logoutPath;
$url = UrlGeneratorInterface::ABSOLUTE_URL === $referenceType ? $request->getUriForPath($logoutPath) : $request->getBasePath().$logoutPath;

if (!empty($parameters)) {
$url .= '?' . http_build_query($parameters);
$url .= '?'.http_build_query($parameters);
}
} else {
$url = $this->router->generate($logoutPath, $parameters, $referenceType);
Expand Down
Expand Up @@ -23,7 +23,7 @@ public function testSwitchUser($originalUser, $targetUser, $expectedUser, $expec
{
$client = $this->createAuthenticatedClient($originalUser);

$client->request('GET', '/profile?_switch_user=' . $targetUser);
$client->request('GET', '/profile?_switch_user='.$targetUser);

$this->assertEquals($expectedStatus, $client->getResponse()->getStatusCode());
$this->assertEquals($expectedUser, $client->getProfile()->getCollector('security')->getUser());
Expand Down
Expand Up @@ -60,7 +60,7 @@ protected static function createKernel(array $options = array())
return new $class(
$options['test_case'],
isset($options['root_config']) ? $options['root_config'] : 'config.yml',
isset($options['environment']) ? $options['environment'] : 'securitybundletest' . strtolower($options['test_case']),
isset($options['environment']) ? $options['environment'] : 'securitybundletest'.strtolower($options['test_case']),
isset($options['debug']) ? $options['debug'] : true
);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Symfony/Component/ClassLoader/ClassLoader.php
Expand Up @@ -170,29 +170,29 @@ public function findFile($class)

if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
$className = substr($class, $pos + 1);
} else {
// PEAR-like class name
$classPath = null;
$className = $class;
}

$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
$classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';

foreach ($this->prefixes as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
return $dir . DIRECTORY_SEPARATOR . $classPath;
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
return $dir.DIRECTORY_SEPARATOR.$classPath;
}
}
}
}

foreach ($this->fallbackDirs as $dir) {
if (file_exists($dir . DIRECTORY_SEPARATOR . $classPath)) {
return $dir . DIRECTORY_SEPARATOR . $classPath;
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
return $dir.DIRECTORY_SEPARATOR.$classPath;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/ClassLoader/ClassMapGenerator.php
Expand Up @@ -121,7 +121,7 @@ private static function findClasses($path)
}
}

$classes[] = ltrim($namespace . $class, '\\');
$classes[] = ltrim($namespace.$class, '\\');
break;
default:
break;
Expand Down
Expand Up @@ -100,7 +100,7 @@ public function testUseIncludePath()
$loader->setUseIncludePath(true);
$this->assertTrue($loader->getUseIncludePath());

set_include_path(__DIR__.'/Fixtures/includepath' . PATH_SEPARATOR . $includePath);
set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath);

$this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));

Expand Down
Expand Up @@ -125,7 +125,7 @@ public function testCreateMapFinderSupport()
}

$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->in(__DIR__ . '/Fixtures/beta/NamespaceCollision');
$finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision');

$this->assertEqualsNormalized(array(
'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
Expand Down
Expand Up @@ -49,7 +49,7 @@ public function testUseIncludePath()
$loader->useIncludePath(true);
$this->assertTrue($loader->getUseIncludePath());

set_include_path(__DIR__.'/Fixtures/includepath' . PATH_SEPARATOR . $includePath);
set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath);

$this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));

Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Config/Definition/ReferenceDumper.php
Expand Up @@ -115,12 +115,12 @@ private function writeNode(NodeInterface $node, $depth = 0)
$default = (string) $default != '' ? ' '.$default : '';
$comments = count($comments) ? '# '.implode(', ', $comments) : '';

$text = rtrim(sprintf('%-20s %s %s', $node->getName() . ':', $default, $comments), ' ');
$text = rtrim(sprintf('%-20s %s %s', $node->getName().':', $default, $comments), ' ');

if ($info = $node->getInfo()) {
$this->writeLine('');
// indenting multi-line info
$info = str_replace("\n", sprintf("\n%" . $depth * 4 . "s# ", ' '), $info);
$info = str_replace("\n", sprintf("\n%".$depth * 4 . "s# ", ' '), $info);
$this->writeLine('# '.$info, $depth * 4);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/Helper/DialogHelper.php
Expand Up @@ -178,7 +178,7 @@ public function ask(OutputInterface $output, $question, $default = null, array $
// Save cursor position
$output->write("\0337");
// Write highlighted text
$output->write('<hl>' . substr($matches[$ofs], $i) . '</hl>');
$output->write('<hl>'.substr($matches[$ofs], $i).'</hl>');
// Restore cursor position
$output->write("\0338");
}
Expand Down Expand Up @@ -230,11 +230,11 @@ public function askConfirmation(OutputInterface $output, $question, $default = t
public function askHiddenResponse(OutputInterface $output, $question, $fallback = true)
{
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
$exe = __DIR__ . '/../Resources/bin/hiddeninput.exe';
$exe = __DIR__.'/../Resources/bin/hiddeninput.exe';

// handle code running from a phar
if ('phar:' === substr(__FILE__, 0, 5)) {
$tmpExe = sys_get_temp_dir() . '/hiddeninput.exe';
$tmpExe = sys_get_temp_dir().'/hiddeninput.exe';
copy($exe, $tmpExe);
$exe = $tmpExe;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Helper/ProgressHelper.php
Expand Up @@ -402,7 +402,7 @@ private function humaneTime($secs)
$text = $format[1];
break;
} else {
$text = ceil($secs / $format[2]) . ' ' . $format[1];
$text = ceil($secs / $format[2]).' '.$format[1];
break;
}
}
Expand Down
Expand Up @@ -37,15 +37,15 @@ public function testFormatBlock()
);

$this->assertEquals(
'<error> Some text to display </error>' . "\n" .
'<error> Some text to display </error>'."\n" .
'<error> foo bar </error>',
$formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'),
'::formatBlock() formats a message in a block'
);

$this->assertEquals(
'<error> </error>' . "\n" .
'<error> Some text to display </error>' . "\n" .
'<error> </error>'."\n" .
'<error> Some text to display </error>'."\n" .
'<error> </error>',
$formatter->formatBlock('Some text to display', 'error', true),
'::formatBlock() formats a message in a block'
Expand All @@ -61,8 +61,8 @@ public function testFormatBlockWithDiacriticLetters()
$formatter = new FormatterHelper();

$this->assertEquals(
'<error> </error>' . "\n" .
'<error> Du texte à afficher </error>' . "\n" .
'<error> </error>'."\n" .
'<error> Du texte à afficher </error>'."\n" .
'<error> </error>',
$formatter->formatBlock('Du texte à afficher', 'error', true),
'::formatBlock() formats a message in a block'
Expand All @@ -74,8 +74,8 @@ public function testFormatBlockLGEscaping()
$formatter = new FormatterHelper();

$this->assertEquals(
'<error> </error>' . "\n" .
'<error> \<info>some info\</info> </error>' . "\n" .
'<error> </error>'."\n" .
'<error> \<info>some info\</info> </error>'."\n" .
'<error> </error>',
$formatter->formatBlock('<info>some info</info>', 'error', true),
'::formatBlock() escapes \'<\' chars'
Expand Down
Expand Up @@ -85,7 +85,7 @@ public function getConfiguration(array $config, ContainerBuilder $container)
$reflected = new \ReflectionClass($this);
$namespace = $reflected->getNamespaceName();

$class = $namespace . '\\Configuration';
$class = $namespace.'\\Configuration';
if (class_exists($class)) {
$r = new \ReflectionClass($class);
$container->addResource(new FileResource($r->getFileName()));
Expand Down

0 comments on commit 7c47e34

Please sign in to comment.