Revert "fixed typo"

This reverts commit 6830d9f4c9.
This commit is contained in:
Fabien Potencier 2017-01-21 08:37:26 -08:00
parent 2b317c1de1
commit 735d0a6ce7
46 changed files with 149 additions and 134 deletions

View File

@ -31,14 +31,14 @@ class FooTestCase
public function testLegacyFoo()
{
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
@trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
@trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
}
public function testNonLegacyBar()
{
@trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
@trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
}
}

View File

@ -23,7 +23,7 @@ class FooTestCase
public function testLegacyFoo()
{
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
@trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
}
}

View File

@ -87,17 +87,17 @@ class TranslationExtensionTest extends \PHPUnit_Framework_TestCase
// transchoice
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is no apples', array('count' => 0), ),
'There is no apples', array('count' => 0)),
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is 5 apples', array('count' => 5), ),
'There is 5 apples', array('count' => 5)),
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony'), ),
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')),
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
'There is 5 apples (Symfony)', array('count' => 5), ),
'There is 5 apples (Symfony)', array('count' => 5)),
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is no apples', array('count' => 0), ),
'There is no apples', array('count' => 0)),
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
'There is 5 apples', ),
'There is 5 apples'),
// trans filter
array('{{ "Hello"|trans }}', 'Hello'),

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'widget_attributes');
<?php echo $view['form']->block($form, 'widget_attributes') ?>

View File

@ -1,6 +1,4 @@
<?php if (!$label) {
$label = isset($label_format)
<?php if (!$label) { $label = isset($label_format)
? strtr($label_format, array('%name%' => $name, '%id%' => $id))
: $view['form']->humanize($name);
} ?>
: $view['form']->humanize($name); } ?>
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></button>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'choice_widget_options');
<?php echo $view['form']->block($form, 'choice_widget_options') ?>

View File

@ -1,6 +1,6 @@
<?php use Symfony\Component\Form\ChoiceList\View\ChoiceGroupView;
$translatorHelper = $view['translator']; // outside of the loop for performance reasons!?>
$translatorHelper = $view['translator']; // outside of the loop for performance reasons! ?>
<?php $formHelper = $view['form']; ?>
<?php foreach ($choices as $group_label => $choice): ?>
<?php if (is_array($choice) || $choice instanceof ChoiceGroupView): ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'widget_container_attributes');
<?php echo $view['form']->block($form, 'widget_container_attributes') ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'email'));
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'email')) ?>

View File

@ -1,16 +1,8 @@
<?php if (false !== $label): ?>
<?php if ($required) {
$label_attr['class'] = trim((isset($label_attr['class']) ? $label_attr['class'] : '').' required');
} ?>
<?php if (!$compound) {
$label_attr['for'] = $id;
} ?>
<?php if (!$label) {
$label = isset($label_format)
<?php if ($required) { $label_attr['class'] = trim((isset($label_attr['class']) ? $label_attr['class'] : '').' required'); } ?>
<?php if (!$compound) { $label_attr['for'] = $id; } ?>
<?php if (!$label) { $label = isset($label_format)
? strtr($label_format, array('%name%' => $name, '%id%' => $id))
: $view['form']->humanize($name);
} ?>
<label <?php foreach ($label_attr as $k => $v) {
printf('%s="%s" ', $view->escape($k), $view->escape($v));
} ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, array(), $translation_domain) : $label) ?></label>
: $view['form']->humanize($name); } ?>
<label <?php foreach ($label_attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($label, array(), $translation_domain) : $label) ?></label>
<?php endif ?>

View File

@ -1,8 +1,6 @@
<?php $method = strtoupper($method) ?>
<?php $form_method = $method === 'GET' || $method === 'POST' ? $method : 'POST' ?>
<form name="<?php echo $name ?>" method="<?php echo strtolower($form_method) ?>" action="<?php echo $action ?>"<?php foreach ($attr as $k => $v) {
printf(' %s="%s"', $view->escape($k), $view->escape($v));
} ?><?php if ($multipart): ?> enctype="multipart/form-data"<?php endif ?>>
<form name="<?php echo $name ?>" method="<?php echo strtolower($form_method) ?>" action="<?php echo $action ?>"<?php foreach ($attr as $k => $v) { printf(' %s="%s"', $view->escape($k), $view->escape($v)); } ?><?php if ($multipart): ?> enctype="multipart/form-data"<?php endif ?>>
<?php if ($form_method !== $method): ?>
<input type="hidden" name="_method" value="<?php echo $method ?>" />
<?php endif ?>

View File

@ -1 +1 @@
<?php echo $view['form']->widget($form);
<?php echo $view['form']->widget($form) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'hidden'));
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'hidden')) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'number'));
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'number')) ?>

View File

@ -1 +1 @@
<?php echo str_replace('{{ widget }}', $view['form']->block($form, 'form_widget_simple'), $money_pattern);
<?php echo str_replace('{{ widget }}', $view['form']->block($form, 'form_widget_simple'), $money_pattern) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text'));
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password'));
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password')) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_rows');
<?php echo $view['form']->block($form, 'form_rows') ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset'));
<?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search'));
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search')) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit'));
<?php echo $view['form']->block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?>

View File

@ -1 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url'));
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url')) ?>

View File

@ -1,4 +1,2 @@
<?php if (!$label) {
$label = $view['form']->humanize($name);
} ?>
<?php if (!$label) { $label = $view['form']->humanize($name); } ?>
<label>Custom name label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label>

View File

@ -1,9 +1,7 @@
--TEST--
Test symfony_zval_info API
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) {
print 'skip';
} ?>
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
--FILE--
<?php

View File

@ -1,9 +1,7 @@
--TEST--
Test symfony_debug_backtrace in case of fatal error
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) {
print 'skip';
} ?>
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
--FILE--
<?php

View File

@ -1,9 +1,7 @@
--TEST--
Test symfony_debug_backtrace in case of non fatal error
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) {
print 'skip';
} ?>
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
--FILE--
<?php

View File

@ -1,9 +1,7 @@
--TEST--
Test ErrorHandler in case of fatal error
--SKIPIF--
<?php if (!extension_loaded('symfony_debug')) {
print 'skip';
} ?>
<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?>
--FILE--
<?php

View File

@ -176,7 +176,7 @@ class DebugClassLoaderTest extends \PHPUnit_Framework_TestCase
{
set_error_handler(function () { return false; });
$e = error_reporting(0);
@trigger_error('', E_USER_DEPRECATED);
trigger_error('', E_USER_DEPRECATED);
class_exists('Test\\'.__NAMESPACE__.'\\'.$class, true);

View File

@ -60,6 +60,7 @@ class CheckCircularReferencesPass implements CompilerPassInterface
$id = $node->getId();
if (empty($this->checkedNodes[$id])) {
// don't check circular dependencies for lazy services
if (!$node->getValue() || !$node->getValue()->isLazy()) {
$searchKey = array_search($id, $this->currentPath);

View File

@ -219,7 +219,7 @@ class Container implements IntrospectableContainerInterface
*/
public function has($id)
{
for ($i = 2; ;) {
for ($i = 2;;) {
if ('service_container' === $id
|| isset($this->aliases[$id])
|| isset($this->services[$id])
@ -258,7 +258,7 @@ class Container implements IntrospectableContainerInterface
// available services. Service IDs are case insensitive, however since
// this method can be called thousands of times during a request, avoid
// calling strtolower() unless necessary.
for ($i = 2; ;) {
for ($i = 2;;) {
if ('service_container' === $id) {
return $this;
}

View File

@ -158,7 +158,7 @@ class Definition
}
/**
* Gets the service that this service is decorating.
* Gets the service that decorates this service.
*
* @return null|array An array composed of the decorated service id and the new id for it, null if no service is decorated
*/

View File

@ -4,7 +4,7 @@ namespace Container14;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/*
/**
* This file is included in Tests\Dumper\GraphvizDumperTest::testDumpWithFrozenCustomClassContainer
* and Tests\Dumper\XmlDumperTest::testCompiledContainerCanBeDumped.
*/

View File

@ -1,5 +1,4 @@
<?php
namespace Symfony\Component\DependencyInjection\Dump;
use Symfony\Component\DependencyInjection\ContainerInterface;

View File

@ -42,7 +42,7 @@ class ProjectServiceContainer extends Container
'values' => array(
0 => true,
1 => false,
2 => null,
2 => NULL,
3 => 0,
4 => 1000.3,
5 => 'true',

View File

@ -248,7 +248,7 @@ class ProjectServiceContainer extends Container
if ($this->has('foobaz')) {
$instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE));
}
$instance->setBar(($this->get('foo')->foo().(($this->hasParameter('foo')) ? ($this->getParameter('foo')) : ('default'))));
$instance->setBar(($this->get("foo")->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
return $instance;
}

View File

@ -253,8 +253,8 @@ class ProjectServiceContainer extends Container
$this->services['method_call1'] = $instance = new \Bar\FooClass();
$instance->setBar($this->get('foo'));
$instance->setBar(null);
$instance->setBar(($this->get('foo')->foo().(($this->hasParameter('foo')) ? ($this->getParameter('foo')) : ('default'))));
$instance->setBar(NULL);
$instance->setBar(($this->get("foo")->foo() . (($this->hasParameter("foo")) ? ($this->getParameter("foo")) : ("default"))));
return $instance;
}

View File

@ -298,7 +298,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
{
$html = '';
$dumper = new HtmlDumper(function ($line) use (&$html) {$html .= $line; }, $this->charset);
$dumper = new HtmlDumper(function ($line) use (&$html) {$html .= $line;}, $this->charset);
$dumper->setDumpHeader('');
$dumper->setDumpBoundaries('', '');

View File

@ -109,7 +109,7 @@ abstract class AbstractPipes implements PipesInterface
}
if ($input) {
for (; ;) {
for (;;) {
$data = fread($input, self::CHUNK_SIZE);
if (!isset($data[0])) {
break;

View File

@ -55,7 +55,7 @@ class WindowsPipes extends AbstractPipes
$tmpDir = sys_get_temp_dir();
$lastError = 'unknown reason';
set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; });
for ($i = 0; ; ++$i) {
for ($i = 0;; ++$i) {
foreach ($pipes as $pipe => $name) {
$file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name);
if (file_exists($file) && !unlink($file)) {

View File

@ -29,7 +29,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// foo
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array('def' => 'test'));
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',));
}
if (0 === strpos($pathinfo, '/bar')) {
@ -40,7 +40,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
goto not_bar;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ());
}
not_bar:
@ -51,9 +51,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
goto not_barhead;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
}
not_barhead:
}
if (0 === strpos($pathinfo, '/test')) {
@ -72,11 +73,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/test/baz3/') {
return array('_route' => 'baz3');
}
}
// baz4
if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
}
// baz5
@ -86,7 +88,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
goto not_baz5;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ());
}
not_baz5:
@ -97,19 +99,20 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
goto not_bazbaz6;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
}
not_bazbaz6:
}
// foofoo
if ($pathinfo === '/foofoo') {
return array('def' => 'test', '_route' => 'foofoo');
return array ( 'def' => 'test', '_route' => 'foofoo',);
}
// quoter
if (preg_match('#^/(?P<quoter>[\']+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ());
}
// space
@ -121,37 +124,40 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo1
if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ());
}
// bar1
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ());
}
}
// overridden
if (preg_match('#^/a/(?P<var>.*)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ());
}
if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo2
if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ());
}
// bar2
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ());
}
}
}
if (0 === strpos($pathinfo, '/multi')) {
// helloWorld
if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array('who' => 'World!'));
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',));
}
// overridden2
@ -163,16 +169,17 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/multi/hey/') {
return array('_route' => 'hey');
}
}
// foo3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ());
}
// bar3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ());
}
if (0 === strpos($pathinfo, '/aba')) {
@ -183,8 +190,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// foo4
if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ());
}
}
$host = $this->context->getHost();
@ -199,6 +207,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/c2/route2') {
return array('_route' => 'route2');
}
}
if (preg_match('#^b\\.example\\.com$#si', $host, $hostMatches)) {
@ -206,6 +215,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/c2/route3') {
return array('_route' => 'route3');
}
}
if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) {
@ -213,6 +223,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/route4') {
return array('_route' => 'route4');
}
}
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
@ -220,6 +231,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/route5') {
return array('_route' => 'route5');
}
}
// route6
@ -231,43 +243,47 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/route1')) {
// route11
if ($pathinfo === '/route11') {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array());
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ());
}
// route12
if ($pathinfo === '/route12') {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array('var1' => 'val'));
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',));
}
// route13
if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array());
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ());
}
// route14
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array('var1' => 'val'));
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',));
}
}
}
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
// route15
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ());
}
}
if (0 === strpos($pathinfo, '/route1')) {
// route16
if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array('var1' => 'val'));
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',));
}
// route17
if ($pathinfo === '/route17') {
return array('_route' => 'route17');
}
}
if (0 === strpos($pathinfo, '/a')) {
@ -279,14 +295,16 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/a/b')) {
// b
if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ());
}
// c
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ());
}
}
}
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();

View File

@ -29,7 +29,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// foo
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array('def' => 'test'));
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',));
}
if (0 === strpos($pathinfo, '/bar')) {
@ -40,7 +40,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
goto not_bar;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ());
}
not_bar:
@ -51,9 +51,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
goto not_barhead;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
}
not_barhead:
}
if (0 === strpos($pathinfo, '/test')) {
@ -76,6 +77,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return array('_route' => 'baz3');
}
}
// baz4
@ -84,7 +86,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return $this->redirect($pathinfo.'/', 'baz4');
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
}
// baz5
@ -94,7 +96,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
goto not_baz5;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ());
}
not_baz5:
@ -105,19 +107,20 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
goto not_bazbaz6;
}
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
}
not_bazbaz6:
}
// foofoo
if ($pathinfo === '/foofoo') {
return array('def' => 'test', '_route' => 'foofoo');
return array ( 'def' => 'test', '_route' => 'foofoo',);
}
// quoter
if (preg_match('#^/(?P<quoter>[\']+)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ());
}
// space
@ -129,37 +132,40 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo1
if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ());
}
// bar1
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ());
}
}
// overridden
if (preg_match('#^/a/(?P<var>.*)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ());
}
if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo2
if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ());
}
// bar2
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ());
}
}
}
if (0 === strpos($pathinfo, '/multi')) {
// helloWorld
if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array('who' => 'World!'));
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',));
}
// overridden2
@ -175,16 +181,17 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return array('_route' => 'hey');
}
}
// foo3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ());
}
// bar3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ());
}
if (0 === strpos($pathinfo, '/aba')) {
@ -195,8 +202,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// foo4
if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ());
}
}
$host = $this->context->getHost();
@ -211,6 +219,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if ($pathinfo === '/c2/route2') {
return array('_route' => 'route2');
}
}
if (preg_match('#^b\\.example\\.com$#si', $host, $hostMatches)) {
@ -218,6 +227,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if ($pathinfo === '/c2/route3') {
return array('_route' => 'route3');
}
}
if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) {
@ -225,6 +235,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if ($pathinfo === '/route4') {
return array('_route' => 'route4');
}
}
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
@ -232,6 +243,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if ($pathinfo === '/route5') {
return array('_route' => 'route5');
}
}
// route6
@ -243,43 +255,47 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/route1')) {
// route11
if ($pathinfo === '/route11') {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array());
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ());
}
// route12
if ($pathinfo === '/route12') {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array('var1' => 'val'));
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',));
}
// route13
if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array());
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ());
}
// route14
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array('var1' => 'val'));
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',));
}
}
}
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
// route15
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ());
}
}
if (0 === strpos($pathinfo, '/route1')) {
// route16
if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array('var1' => 'val'));
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',));
}
// route17
if ($pathinfo === '/route17') {
return array('_route' => 'route17');
}
}
if (0 === strpos($pathinfo, '/a')) {
@ -291,19 +307,21 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/a/b')) {
// b
if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ());
}
// c
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ());
}
}
}
// secure
if ($pathinfo === '/secure') {
$requiredSchemes = array('https' => 0);
$requiredSchemes = array ( 'https' => 0,);
if (!isset($requiredSchemes[$this->context->getScheme()])) {
return $this->redirect($pathinfo, 'secure', key($requiredSchemes));
}
@ -313,7 +331,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// nonsecure
if ($pathinfo === '/nonsecure') {
$requiredSchemes = array('http' => 0);
$requiredSchemes = array ( 'http' => 0,);
if (!isset($requiredSchemes[$this->context->getScheme()])) {
return $this->redirect($pathinfo, 'nonsecure', key($requiredSchemes));
}

View File

@ -35,12 +35,13 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// dynamic
if (preg_match('#^/rootprefix/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'dynamic')), array());
return $this->mergeDefaults(array_replace($matches, array('_route' => 'dynamic')), array ());
}
}
// with-condition
if ($pathinfo === '/with-condition' && ($context->getMethod() == 'GET')) {
if ($pathinfo === '/with-condition' && ($context->getMethod() == "GET")) {
return array('_route' => 'with-condition');
}

View File

@ -1 +1 @@
<?php echo $foo;
<?php echo $foo ?>

View File

@ -1,5 +1,5 @@
<?php
return array(
return array (
'foo' => 'bar',
);

View File

@ -125,9 +125,9 @@ class CliDumper extends AbstractDumper
$style = 'num';
switch (true) {
case INF === $value: $value = 'INF'; break;
case INF === $value: $value = 'INF'; break;
case -INF === $value: $value = '-INF'; break;
case is_nan($value): $value = 'NAN'; break;
case is_nan($value): $value = 'NAN'; break;
default:
$value = (string) $value;
if (false === strpos($value, $this->decimalPoint)) {

View File

@ -31,13 +31,13 @@ class Escaper
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9", );
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9");
private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
'\\N', '\\_', '\\L', '\\P', );
'\\N', '\\_', '\\L', '\\P');
/**
* Determines if a PHP value would require double quoting in YAML.