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() public function testLegacyFoo()
{ {
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED); @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() public function testNonLegacyBar()
{ {
@trigger_error('silenced bar deprecation', E_USER_DEPRECATED); @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() public function testLegacyFoo()
{ {
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED); @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 // transchoice
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', 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 %}', 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 %}', 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 %}', 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 %}', 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 %}', 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 // trans filter
array('{{ "Hello"|trans }}', 'Hello'), 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) { <?php if (!$label) { $label = isset($label_format)
$label = isset($label_format)
? strtr($label_format, array('%name%' => $name, '%id%' => $id)) ? 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> <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 +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 (false !== $label): ?>
<?php if ($required) { <?php if ($required) { $label_attr['class'] = trim((isset($label_attr['class']) ? $label_attr['class'] : '').' 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 (!$compound) {
$label_attr['for'] = $id;
} ?>
<?php if (!$label) {
$label = isset($label_format)
? strtr($label_format, array('%name%' => $name, '%id%' => $id)) ? strtr($label_format, array('%name%' => $name, '%id%' => $id))
: $view['form']->humanize($name); : $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>
<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 ?> <?php endif ?>

View File

@ -1,8 +1,6 @@
<?php $method = strtoupper($method) ?> <?php $method = strtoupper($method) ?>
<?php $form_method = $method === 'GET' || $method === 'POST' ? $method : 'POST' ?> <?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) { <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 ?>>
printf(' %s="%s"', $view->escape($k), $view->escape($v));
} ?><?php if ($multipart): ?> enctype="multipart/form-data"<?php endif ?>>
<?php if ($form_method !== $method): ?> <?php if ($form_method !== $method): ?>
<input type="hidden" name="_method" value="<?php echo $method ?>" /> <input type="hidden" name="_method" value="<?php echo $method ?>" />
<?php endif ?> <?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) { <?php if (!$label) { $label = $view['form']->humanize($name); } ?>
$label = $view['form']->humanize($name);
} ?>
<label>Custom name label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label> <label>Custom name label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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 * @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; use Symfony\Component\DependencyInjection\ContainerBuilder;
/* /**
* This file is included in Tests\Dumper\GraphvizDumperTest::testDumpWithFrozenCustomClassContainer * This file is included in Tests\Dumper\GraphvizDumperTest::testDumpWithFrozenCustomClassContainer
* and Tests\Dumper\XmlDumperTest::testCompiledContainerCanBeDumped. * and Tests\Dumper\XmlDumperTest::testCompiledContainerCanBeDumped.
*/ */

View File

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

View File

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

View File

@ -248,7 +248,7 @@ class ProjectServiceContainer extends Container
if ($this->has('foobaz')) { if ($this->has('foobaz')) {
$instance->setBar($this->get('foobaz', ContainerInterface::NULL_ON_INVALID_REFERENCE)); $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; return $instance;
} }

View File

@ -253,8 +253,8 @@ class ProjectServiceContainer extends Container
$this->services['method_call1'] = $instance = new \Bar\FooClass(); $this->services['method_call1'] = $instance = new \Bar\FooClass();
$instance->setBar($this->get('foo')); $instance->setBar($this->get('foo'));
$instance->setBar(null); $instance->setBar(NULL);
$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; return $instance;
} }

View File

@ -29,7 +29,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// foo // foo
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#s', $pathinfo, $matches)) { 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')) { if (0 === strpos($pathinfo, '/bar')) {
@ -54,6 +54,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
} }
not_barhead: not_barhead:
} }
if (0 === strpos($pathinfo, '/test')) { if (0 === strpos($pathinfo, '/test')) {
@ -72,6 +73,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/test/baz3/') { if ($pathinfo === '/test/baz3/') {
return array('_route' => 'baz3'); return array('_route' => 'baz3');
} }
} }
// baz4 // baz4
@ -100,11 +102,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
} }
not_bazbaz6: not_bazbaz6:
} }
// foofoo // foofoo
if ($pathinfo === '/foofoo') { if ($pathinfo === '/foofoo') {
return array('def' => 'test', '_route' => 'foofoo'); return array ( 'def' => 'test', '_route' => 'foofoo',);
} }
// quoter // quoter
@ -128,6 +131,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) { 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 // overridden
@ -145,13 +149,15 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) { 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')) { if (0 === strpos($pathinfo, '/multi')) {
// helloWorld // helloWorld
if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) { 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 // overridden2
@ -163,6 +169,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/multi/hey/') { if ($pathinfo === '/multi/hey/') {
return array('_route' => 'hey'); return array('_route' => 'hey');
} }
} }
// foo3 // foo3
@ -185,6 +192,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { 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(); $host = $this->context->getHost();
@ -199,6 +207,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/c2/route2') { if ($pathinfo === '/c2/route2') {
return array('_route' => 'route2'); return array('_route' => 'route2');
} }
} }
if (preg_match('#^b\\.example\\.com$#si', $host, $hostMatches)) { 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') { if ($pathinfo === '/c2/route3') {
return array('_route' => 'route3'); return array('_route' => 'route3');
} }
} }
if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) { if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) {
@ -213,6 +223,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/route4') { if ($pathinfo === '/route4') {
return array('_route' => 'route4'); return array('_route' => 'route4');
} }
} }
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) { if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
@ -220,6 +231,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if ($pathinfo === '/route5') { if ($pathinfo === '/route5') {
return array('_route' => 'route5'); return array('_route' => 'route5');
} }
} }
// route6 // route6
@ -236,7 +248,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// route12 // route12
if ($pathinfo === '/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 // route13
@ -246,9 +258,11 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// route14 // route14
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { 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)) { if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
@ -256,18 +270,20 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { 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')) { if (0 === strpos($pathinfo, '/route1')) {
// route16 // route16
if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { 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 // route17
if ($pathinfo === '/route17') { if ($pathinfo === '/route17') {
return array('_route' => 'route17'); return array('_route' => 'route17');
} }
} }
if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a')) {
@ -286,7 +302,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) { 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(); 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 // foo
if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#s', $pathinfo, $matches)) { 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')) { if (0 === strpos($pathinfo, '/bar')) {
@ -54,6 +54,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
} }
not_barhead: not_barhead:
} }
if (0 === strpos($pathinfo, '/test')) { if (0 === strpos($pathinfo, '/test')) {
@ -76,6 +77,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return array('_route' => 'baz3'); return array('_route' => 'baz3');
} }
} }
// baz4 // baz4
@ -108,11 +110,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
} }
not_bazbaz6: not_bazbaz6:
} }
// foofoo // foofoo
if ($pathinfo === '/foofoo') { if ($pathinfo === '/foofoo') {
return array('def' => 'test', '_route' => 'foofoo'); return array ( 'def' => 'test', '_route' => 'foofoo',);
} }
// quoter // quoter
@ -136,6 +139,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) { 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 // overridden
@ -153,13 +157,15 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) { 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')) { if (0 === strpos($pathinfo, '/multi')) {
// helloWorld // helloWorld
if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) { 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 // overridden2
@ -175,6 +181,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return array('_route' => 'hey'); return array('_route' => 'hey');
} }
} }
// foo3 // foo3
@ -197,6 +204,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { 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(); $host = $this->context->getHost();
@ -211,6 +219,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if ($pathinfo === '/c2/route2') { if ($pathinfo === '/c2/route2') {
return array('_route' => 'route2'); return array('_route' => 'route2');
} }
} }
if (preg_match('#^b\\.example\\.com$#si', $host, $hostMatches)) { 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') { if ($pathinfo === '/c2/route3') {
return array('_route' => 'route3'); return array('_route' => 'route3');
} }
} }
if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) { 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') { if ($pathinfo === '/route4') {
return array('_route' => 'route4'); return array('_route' => 'route4');
} }
} }
if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) { 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') { if ($pathinfo === '/route5') {
return array('_route' => 'route5'); return array('_route' => 'route5');
} }
} }
// route6 // route6
@ -248,7 +260,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// route12 // route12
if ($pathinfo === '/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 // route13
@ -258,9 +270,11 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// route14 // route14
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { 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)) { if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
@ -268,18 +282,20 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { 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')) { if (0 === strpos($pathinfo, '/route1')) {
// route16 // route16
if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { 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 // route17
if ($pathinfo === '/route17') { if ($pathinfo === '/route17') {
return array('_route' => 'route17'); return array('_route' => 'route17');
} }
} }
if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a')) {
@ -298,12 +314,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) { 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 // secure
if ($pathinfo === '/secure') { if ($pathinfo === '/secure') {
$requiredSchemes = array('https' => 0); $requiredSchemes = array ( 'https' => 0,);
if (!isset($requiredSchemes[$this->context->getScheme()])) { if (!isset($requiredSchemes[$this->context->getScheme()])) {
return $this->redirect($pathinfo, 'secure', key($requiredSchemes)); return $this->redirect($pathinfo, 'secure', key($requiredSchemes));
} }
@ -313,7 +331,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// nonsecure // nonsecure
if ($pathinfo === '/nonsecure') { if ($pathinfo === '/nonsecure') {
$requiredSchemes = array('http' => 0); $requiredSchemes = array ( 'http' => 0,);
if (!isset($requiredSchemes[$this->context->getScheme()])) { if (!isset($requiredSchemes[$this->context->getScheme()])) {
return $this->redirect($pathinfo, 'nonsecure', key($requiredSchemes)); return $this->redirect($pathinfo, 'nonsecure', key($requiredSchemes));
} }

View File

@ -37,10 +37,11 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^/rootprefix/(?P<var>[^/]++)$#s', $pathinfo, $matches)) { 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 // with-condition
if ($pathinfo === '/with-condition' && ($context->getMethod() == 'GET')) { if ($pathinfo === '/with-condition' && ($context->getMethod() == "GET")) {
return array('_route' => 'with-condition'); return array('_route' => 'with-condition');
} }

View File

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

View File

@ -31,13 +31,13 @@ class Escaper
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", "\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('\\\\', '\\"', '\\\\', '\\"', private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a', '\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f', '\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17', '\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f', '\\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. * Determines if a PHP value would require double quoting in YAML.