This commit is contained in:
Fabien Potencier 2012-05-21 22:25:19 +02:00
parent b206519671
commit c01fed0c89
15 changed files with 20 additions and 20 deletions

View File

@ -604,7 +604,7 @@ class FrameworkExtension extends Extension
->replaceArgument(2, $config['debug'])
;
$container->setAlias('annotation_reader', 'annotations.file_cache_reader');
} else if('none' !== $config['cache']) {
} elseif ('none' !== $config['cache']) {
$container
->getDefinition('annotations.cached_reader')
->replaceArgument(1, new Reference($config['cache']))

View File

@ -4,5 +4,5 @@ name="<?php echo $view->escape($full_name) ?>"
<?php if ($required): ?>required="required" <?php endif ?>
<?php if ($max_length): ?>maxlength="<?php echo $view->escape($max_length) ?>" <?php endif ?>
<?php if ($pattern): ?>pattern="<?php echo $view->escape($pattern) ?>" <?php endif ?>
<?php foreach($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>
<?php foreach ($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>

View File

@ -1,2 +1,2 @@
id="<?php echo $view->escape($id) ?>"
<?php foreach($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>
<?php foreach ($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>

View File

@ -1,2 +1,2 @@
<?php if ($required) { $attr['class'] = (isset($attr['class']) ? $attr['class'] : '').' required'; } ?>
<label for="<?php echo $view->escape($id) ?>" <?php foreach($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>><?php echo $view->escape($view['translator']->trans($label)) ?></label>
<label for="<?php echo $view->escape($id) ?>" <?php foreach ($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>><?php echo $view->escape($view['translator']->trans($label)) ?></label>

View File

@ -1,2 +1,2 @@
<?php if ($required) { $attr['class'] = (isset($attr['class']) ? $attr['class'] : '').' required'; } ?>
<label <?php foreach($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>><?php echo $view->escape($view['translator']->trans($label)) ?></label>
<label <?php foreach ($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>><?php echo $view->escape($view['translator']->trans($label)) ?></label>

View File

@ -240,7 +240,7 @@ class FormHelper extends Helper
return $html;
}
} while (--$typeIndex >= 0);
} while (--$typeIndex >= 0);
throw new FormException(sprintf(
'Unable to render the form as none of the following blocks exist: "%s".',

View File

@ -192,7 +192,7 @@ class PropertyPath implements \IteratorAggregate
$value = $this->readProperty($objectOrArray, $i);
// arrays need to be treated separately (due to PHP bug?)
// http://bugs.php.net/bug.php?id=52133
} elseif (is_array($objectOrArray)){
} elseif (is_array($objectOrArray)) {
$property = $this->elements[$i];
if (!array_key_exists($property, $objectOrArray)) {
$objectOrArray[$property] = $i + 1 < $this->length ? array() : null;

View File

@ -74,7 +74,7 @@ class ExceptionHandler
$code = $exception instanceof HttpExceptionInterface ? $exception->getStatusCode() : 500;
$exception = FlattenException::create($exception);
switch($code) {
switch ($code) {
case 404:
$title = 'Sorry, the page you are looking for could not be found.';
break;

View File

@ -135,7 +135,7 @@ class ApacheMatcherDumper extends MatcherDumper
{
$escaped = false;
$output = '';
foreach(str_split($string) as $symbol) {
foreach (str_split($string) as $symbol) {
if ($escaped) {
$output .= $symbol;
$escaped = false;

View File

@ -101,7 +101,7 @@ class RouteCompiler implements RouteCompilerInterface
private function computeRegexp(array $tokens, $index, $firstOptional)
{
$token = $tokens[$index];
if('text' === $token[0]) {
if ('text' === $token[0]) {
// Text tokens
return preg_quote($token[1], '#');
} else {

View File

@ -41,14 +41,14 @@ class CsvFileLoader extends ArrayLoader implements LoaderInterface
try {
$file = new \SplFileObject($resource, 'rb');
} catch(\RuntimeException $e) {
} catch (\RuntimeException $e) {
throw new \InvalidArgumentException(sprintf('Error opening file "%s".', $resource));
}
$file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY);
$file->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
foreach($file as $data) {
foreach ($file as $data) {
if (substr($data[0], 0, 1) === '#') {
continue;
}

View File

@ -57,12 +57,12 @@ class EntityTypeTest extends TypeTestCase
try {
$schemaTool->dropSchema($classes);
} catch(\Exception $e) {
} catch (\Exception $e) {
}
try {
$schemaTool->createSchema($classes);
} catch(\Exception $e) {
} catch (\Exception $e) {
}
}

View File

@ -246,7 +246,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
$paths = array();
foreach($finder as $file) {
foreach ($finder as $file) {
$paths[] = $file->getRelativePath();
}
@ -266,7 +266,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
$paths = array();
foreach($finder as $file) {
foreach ($finder as $file) {
$paths[] = $file->getRelativePathname();
}

View File

@ -308,14 +308,14 @@ class ResponseTest extends \PHPUnit_Framework_TestCase
try {
$response->setStatusCode(99);
$this->fail();
} catch(\InvalidArgumentException $e) {
} catch (\InvalidArgumentException $e) {
$this->assertTrue($response->isInvalid());
}
try {
$response->setStatusCode(650);
$this->fail();
} catch(\InvalidArgumentException $e) {
} catch (\InvalidArgumentException $e) {
$this->assertTrue($response->isInvalid());
}

View File

@ -55,7 +55,7 @@ class ExceptionListenerTest extends \PHPUnit_Framework_TestCase
try {
$l->onKernelException($event2);
} catch(\Exception $e) {
} catch (\Exception $e) {
$this->assertSame('foo', $e->getMessage());
}
@ -77,7 +77,7 @@ class ExceptionListenerTest extends \PHPUnit_Framework_TestCase
try {
$l->onKernelException($event2);
} catch(\Exception $e) {
} catch (\Exception $e) {
$this->assertSame('foo', $e->getMessage());
}