Merge branch '3.4' into 4.0
* 3.4: (22 commits) [DI] Add tests for EnvVarProcessor [Bridge\PhpUnit] Fix #26430 Cannot autoload listeners Make sure we always render errors. Eventhough labels are disabled Make sure form errors is valid HTML [HttpKernel] Allow generators in registerBundle [TwigBundle] document TwigRenderer BC break in UPGRADE-3.4 Extra line to bootstrap 3 horizontal layout [Serializer] Remove const override Update Client.php [PhpUnitBridge] Ability to use different composer.json file [DomCrawler] FormField: remove an useless return statement [Config] ReflectionClassResource check abstract ServiceSubscriberInterface and EventSubscriberInterface Display the Welcome Page when there is no homepage defined fix regression when extending the Container class without a constructor fix the updating of timestamp in the MemcachedSessionHandler [SecurityBundle] Make extra character non mandatory in regex [Config] Add characters to the regex bumped Symfony version to 3.4.7 updated VERSION for 3.4.6 updated CHANGELOG for 3.4.6 ...
This commit is contained in:
commit
72041c8821
@ -18,3 +18,9 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve
|
||||
} else {
|
||||
class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV7', 'Symfony\Bridge\PhpUnit\CoverageListener');
|
||||
}
|
||||
|
||||
if (false) {
|
||||
class CoverageListener
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -18,3 +18,9 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve
|
||||
} else {
|
||||
class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7', 'Symfony\Bridge\PhpUnit\SymfonyTestsListener');
|
||||
}
|
||||
|
||||
if (false) {
|
||||
class SymfonyTestsListener
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -26,8 +26,13 @@ if (PHP_VERSION_ID >= 70200) {
|
||||
$PHPUNIT_VERSION = '4.8';
|
||||
}
|
||||
|
||||
if ('composer.json' !== $COMPOSER_JSON = getenv('COMPOSER') ?: 'composer.json') {
|
||||
putenv('COMPOSER=composer.json');
|
||||
$_SERVER['COMPOSER'] = $_ENV['COMPOSER'] = 'composer.json';
|
||||
}
|
||||
|
||||
$root = __DIR__;
|
||||
while (!file_exists($root.'/composer.json') || file_exists($root.'/DeprecationErrorHandler.php')) {
|
||||
while (!file_exists($root.'/'.$COMPOSER_JSON) || file_exists($root.'/DeprecationErrorHandler.php')) {
|
||||
if ($root === dirname($root)) {
|
||||
break;
|
||||
}
|
||||
|
@ -203,7 +203,13 @@
|
||||
{% set label = name|humanize %}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{{- form_errors(form) -}}</{{ element|default('label') }}>
|
||||
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}{% block form_label_errors %}{{- form_errors(form) -}}{% endblock form_label_errors %}</{{ element|default('label') }}>
|
||||
{%- else -%}
|
||||
{%- if errors|length > 0 -%}
|
||||
<div id="{{ id }}_errors" class="mb-2">
|
||||
{{- form_errors(form) -}}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endblock form_label %}
|
||||
|
||||
@ -261,12 +267,12 @@
|
||||
|
||||
{% block form_errors -%}
|
||||
{%- if errors|length > 0 -%}
|
||||
<div class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
|
||||
<ul class="list-unstyled mb-0">
|
||||
<span class="{% if form is not rootform %}invalid-feedback d-block{% else %}alert alert-danger{% endif %}">
|
||||
{%- for error in errors -%}
|
||||
<li><span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span></li>
|
||||
<span class="mb-0 d-block">
|
||||
<span class="initialism form-error-icon badge badge-danger">{{ 'Error'|trans({}, 'validators') }}</span> <span class="form-error-message">{{ error.message }}</span>
|
||||
</span>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
{%- endif %}
|
||||
{%- endblock form_errors %}
|
||||
|
@ -317,7 +317,14 @@
|
||||
</td>
|
||||
<td>
|
||||
{% if decision.attributes|length == 1 %}
|
||||
{{ decision.attributes|first }}
|
||||
{% set attribute = decision.attributes|first %}
|
||||
{% if attribute.expression is defined %}
|
||||
Expression: <pre><code>{{ attribute.expression }}</code></pre>
|
||||
{% elseif attribute.type == 'string' %}
|
||||
{{ attribute }}
|
||||
{% else %}
|
||||
{{ profiler_dump(attribute) }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ profiler_dump(decision.attributes) }}
|
||||
{% endif %}
|
||||
|
@ -86,7 +86,7 @@ class UserPasswordEncoderCommandTest extends WebTestCase
|
||||
$this->assertContains('Password encoding succeeded', $output);
|
||||
|
||||
$encoder = new Argon2iPasswordEncoder();
|
||||
preg_match('# Encoded password\s+(\$argon2id\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
|
||||
preg_match('# Encoded password\s+(\$argon2id?\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
|
||||
$hash = $matches[1];
|
||||
$this->assertTrue($encoder->isPasswordValid($hash, 'password', null));
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ abstract class Client
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum number of requests that crawler can follow.
|
||||
* Sets the maximum number of redirects that crawler can follow.
|
||||
*
|
||||
* @param int $maxRedirects
|
||||
*/
|
||||
@ -89,7 +89,7 @@ abstract class Client
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum number of requests that crawler can follow.
|
||||
* Returns the maximum number of redirects that crawler can follow.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
|
@ -148,12 +148,16 @@ class ReflectionClassResource implements SelfCheckingResourceInterface, \Seriali
|
||||
yield print_r($defaults, true);
|
||||
}
|
||||
|
||||
if ($class->isSubclassOf(EventSubscriberInterface::class)) {
|
||||
if ($class->isAbstract() || $class->isInterface() || $class->isTrait()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (interface_exists(EventSubscriberInterface::class, false) && $class->isSubclassOf(EventSubscriberInterface::class)) {
|
||||
yield EventSubscriberInterface::class;
|
||||
yield print_r(\call_user_func(array($class->name, 'getSubscribedEvents')), true);
|
||||
}
|
||||
|
||||
if ($class->isSubclassOf(ServiceSubscriberInterface::class)) {
|
||||
if (interface_exists(ServiceSubscriberInterface::class, false) && $class->isSubclassOf(ServiceSubscriberInterface::class)) {
|
||||
yield ServiceSubscriberInterface::class;
|
||||
yield print_r(\call_user_func(array($class->name, 'getSubscribedServices')), true);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class XmlUtilsTest extends TestCase
|
||||
XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate'));
|
||||
$this->fail();
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->assertRegExp('/The XML file "[\w:\/\\\.-]+" is not valid\./', $e->getMessage());
|
||||
$this->assertRegExp('/The XML file "[\w:\/\\\.~+-]+" is not valid\./', $e->getMessage());
|
||||
}
|
||||
|
||||
$this->assertInstanceOf('DOMDocument', XmlUtils::loadFile($fixtures.'valid.xml', array($mock, 'validate')));
|
||||
|
@ -920,9 +920,13 @@ EOF;
|
||||
|
||||
if (Container::class !== $baseClassWithNamespace) {
|
||||
$r = $this->container->getReflectionClass($baseClassWithNamespace, false);
|
||||
|
||||
if (null !== $r && (null !== $constructor = $r->getConstructor()) && 0 === $constructor->getNumberOfRequiredParameters()) {
|
||||
$code .= " parent::__construct();\n\n";
|
||||
if (null !== $r
|
||||
&& (null !== $constructor = $r->getConstructor())
|
||||
&& 0 === $constructor->getNumberOfRequiredParameters()
|
||||
&& Container::class !== $constructor->getDeclaringClass()->name
|
||||
) {
|
||||
$code .= " parent::__construct();\n";
|
||||
$code .= " \$this->parameterBag = null;\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,304 @@
|
||||
<?php
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\Container;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\EnvVarProcessor;
|
||||
|
||||
class EnvVarProcessorTest extends TestCase
|
||||
{
|
||||
const TEST_CONST = 'test';
|
||||
|
||||
/**
|
||||
* @dataProvider validStrings
|
||||
*/
|
||||
public function testGetEnvString($value, $processed)
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$container->setParameter('env(foo)', $value);
|
||||
$container->compile();
|
||||
|
||||
$processor = new EnvVarProcessor($container);
|
||||
|
||||
$result = $processor->getEnv('string', 'foo', function () {
|
||||
$this->fail('Should not be called');
|
||||
});
|
||||
|
||||
$this->assertSame($processed, $result);
|
||||
}
|
||||
|
||||
public function validStrings()
|
||||
{
|
||||
return array(
|
||||
array('hello', 'hello'),
|
||||
array('true', 'true'),
|
||||
array('false', 'false'),
|
||||
array('null', 'null'),
|
||||
array('1', '1'),
|
||||
array('0', '0'),
|
||||
array('1.1', '1.1'),
|
||||
array('1e1', '1e1'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider validBools
|
||||
*/
|
||||
public function testGetEnvBool($value, $processed)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$result = $processor->getEnv('bool', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return $value;
|
||||
});
|
||||
|
||||
$this->assertSame($processed, $result);
|
||||
}
|
||||
|
||||
public function validBools()
|
||||
{
|
||||
return array(
|
||||
array('true', true),
|
||||
array('false', false),
|
||||
array('null', false),
|
||||
array('1', true),
|
||||
array('0', false),
|
||||
array('1.1', true),
|
||||
array('1e1', true),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider validInts
|
||||
*/
|
||||
public function testGetEnvInt($value, $processed)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$result = $processor->getEnv('int', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return $value;
|
||||
});
|
||||
|
||||
$this->assertSame($processed, $result);
|
||||
}
|
||||
|
||||
public function validInts()
|
||||
{
|
||||
return array(
|
||||
array('1', 1),
|
||||
array('1.1', 1),
|
||||
array('1e1', 10),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Non-numeric env var
|
||||
* @dataProvider invalidInts
|
||||
*/
|
||||
public function testGetEnvIntInvalid($value)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$processor->getEnv('int', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return $value;
|
||||
});
|
||||
}
|
||||
|
||||
public function invalidInts()
|
||||
{
|
||||
return array(
|
||||
array('foo'),
|
||||
array('true'),
|
||||
array('null'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider validFloats
|
||||
*/
|
||||
public function testGetEnvFloat($value, $processed)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$result = $processor->getEnv('float', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return $value;
|
||||
});
|
||||
|
||||
$this->assertSame($processed, $result);
|
||||
}
|
||||
|
||||
public function validFloats()
|
||||
{
|
||||
return array(
|
||||
array('1', 1.0),
|
||||
array('1.1', 1.1),
|
||||
array('1e1', 10.0),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Non-numeric env var
|
||||
* @dataProvider invalidFloats
|
||||
*/
|
||||
public function testGetEnvFloatInvalid($value)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$processor->getEnv('float', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return $value;
|
||||
});
|
||||
}
|
||||
|
||||
public function invalidFloats()
|
||||
{
|
||||
return array(
|
||||
array('foo'),
|
||||
array('true'),
|
||||
array('null'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider validConsts
|
||||
*/
|
||||
public function testGetEnvConst($value, $processed)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$result = $processor->getEnv('const', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return $value;
|
||||
});
|
||||
|
||||
$this->assertSame($processed, $result);
|
||||
}
|
||||
|
||||
public function validConsts()
|
||||
{
|
||||
return array(
|
||||
array('Symfony\Component\DependencyInjection\Tests\EnvVarProcessorTest::TEST_CONST', self::TEST_CONST),
|
||||
array('E_ERROR', E_ERROR),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage undefined constant
|
||||
* @dataProvider invalidConsts
|
||||
*/
|
||||
public function testGetEnvConstInvalid($value)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$processor->getEnv('const', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return $value;
|
||||
});
|
||||
}
|
||||
|
||||
public function invalidConsts()
|
||||
{
|
||||
return array(
|
||||
array('Symfony\Component\DependencyInjection\Tests\EnvVarProcessorTest::UNDEFINED_CONST'),
|
||||
array('UNDEFINED_CONST'),
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetEnvBase64()
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$result = $processor->getEnv('base64', 'foo', function ($name) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return base64_encode('hello');
|
||||
});
|
||||
|
||||
$this->assertSame('hello', $result);
|
||||
}
|
||||
|
||||
public function testGetEnvJson()
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$result = $processor->getEnv('json', 'foo', function ($name) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return json_encode(array(1));
|
||||
});
|
||||
|
||||
$this->assertSame(array(1), $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Syntax error
|
||||
*/
|
||||
public function testGetEnvInvalidJson()
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$processor->getEnv('json', 'foo', function ($name) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return 'invalid_json';
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Invalid JSON env var
|
||||
* @dataProvider otherJsonValues
|
||||
*/
|
||||
public function testGetEnvJsonOther($value)
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$processor->getEnv('json', 'foo', function ($name) use ($value) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return json_encode($value);
|
||||
});
|
||||
}
|
||||
|
||||
public function otherJsonValues()
|
||||
{
|
||||
return array(
|
||||
array(1),
|
||||
array(1.1),
|
||||
array(true),
|
||||
array(false),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
|
||||
* @expectedExceptionMessage Unsupported env var prefix
|
||||
*/
|
||||
public function testGetEnvUnknown()
|
||||
{
|
||||
$processor = new EnvVarProcessor(new Container());
|
||||
|
||||
$processor->getEnv('unknown', 'foo', function ($name) {
|
||||
$this->assertSame('foo', $name);
|
||||
|
||||
return 'foo';
|
||||
});
|
||||
}
|
||||
}
|
@ -2,6 +2,8 @@
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Fixtures\Container;
|
||||
|
||||
class NoConstructorContainer
|
||||
use Symfony\Component\DependencyInjection\Container;
|
||||
|
||||
class NoConstructorContainer extends Container
|
||||
{
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->parameterBag = null;
|
||||
|
||||
$this->services = $this->privates = array();
|
||||
|
||||
|
@ -29,6 +29,7 @@ class ProjectServiceContainer extends \Symfony\Component\DependencyInjection\Tes
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->parameterBag = null;
|
||||
|
||||
$this->services = $this->privates = array();
|
||||
|
||||
|
@ -75,8 +75,6 @@ abstract class FormField
|
||||
if ($labels->length > 0) {
|
||||
return $labels->item(0);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,14 +32,12 @@ abstract class AbstractBootstrap4HorizontalLayoutTest extends AbstractBootstrap4
|
||||
[
|
||||
./label[@for="name"]
|
||||
[
|
||||
./div[
|
||||
./ul
|
||||
[./li
|
||||
./span[@class="alert alert-danger"]
|
||||
[./span[@class="mb-0 d-block"]
|
||||
[./span[.="[trans]Error[/trans]"]]
|
||||
[./span[.="[trans]Error![/trans]"]]
|
||||
]
|
||||
[count(./li)=1]
|
||||
]
|
||||
[count(./span)=1]
|
||||
]
|
||||
/following-sibling::div[./input[@id="name"]]
|
||||
]
|
||||
|
@ -32,14 +32,12 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
||||
[
|
||||
./label[@for="name"]
|
||||
[
|
||||
./div[
|
||||
./ul
|
||||
[./li
|
||||
./span[@class="alert alert-danger"]
|
||||
[./span[@class="mb-0 d-block"]
|
||||
[./span[.="[trans]Error[/trans]"]]
|
||||
[./span[.="[trans]Error![/trans]"]]
|
||||
]
|
||||
[count(./li)=1]
|
||||
]
|
||||
[count(./span)=1]
|
||||
]
|
||||
/following-sibling::input[@id="name"]
|
||||
]
|
||||
@ -162,26 +160,32 @@ abstract class AbstractBootstrap4LayoutTest extends AbstractBootstrap3LayoutTest
|
||||
$html = $this->renderErrors($view);
|
||||
|
||||
$this->assertMatchesXpath($html,
|
||||
'/div
|
||||
'/span
|
||||
[@class="alert alert-danger"]
|
||||
[
|
||||
./ul
|
||||
[@class="list-unstyled mb-0"]
|
||||
[
|
||||
./li
|
||||
./span[@class="mb-0 d-block"]
|
||||
[./span[.="[trans]Error[/trans]"]]
|
||||
[./span[.="[trans]Error 1[/trans]"]]
|
||||
|
||||
/following-sibling::li
|
||||
/following-sibling::span[@class="mb-0 d-block"]
|
||||
[./span[.="[trans]Error[/trans]"]]
|
||||
[./span[.="[trans]Error 2[/trans]"]]
|
||||
]
|
||||
[count(./li)=2]
|
||||
]
|
||||
[count(./span)=2]
|
||||
'
|
||||
);
|
||||
}
|
||||
|
||||
public function testErrorWithNoLabel()
|
||||
{
|
||||
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', array('label'=>false));
|
||||
$form->addError(new FormError('[trans]Error 1[/trans]'));
|
||||
$view = $form->createView();
|
||||
$html = $this->renderLabel($view);
|
||||
|
||||
$this->assertMatchesXpath($html, '//span[.="[trans]Error[/trans]"]');
|
||||
}
|
||||
|
||||
public function testCheckedCheckbox()
|
||||
{
|
||||
$form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', true);
|
||||
|
@ -80,7 +80,9 @@ class MemcachedSessionHandler extends AbstractSessionHandler
|
||||
*/
|
||||
public function updateTimestamp($sessionId, $data)
|
||||
{
|
||||
return $this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl);
|
||||
$this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable
|
||||
/**
|
||||
* Returns an array of bundles to register.
|
||||
*
|
||||
* @return BundleInterface[] An array of bundle instances
|
||||
* @return iterable|BundleInterface[] An iterable of bundle instances
|
||||
*/
|
||||
public function registerBundles();
|
||||
|
||||
|
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
<div id="comment">
|
||||
<p>
|
||||
You're seeing this message because you have debug mode enabled and you haven't configured any URLs.
|
||||
You're seeing this page because debug mode is enabled and you haven't configured any homepage URL.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -153,11 +153,10 @@ EOF;
|
||||
}
|
||||
}
|
||||
|
||||
if ('' === $code) {
|
||||
// used to display the Welcome Page in apps that don't define a homepage
|
||||
$code .= " if ('/' === \$pathinfo) {\n";
|
||||
$code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n";
|
||||
$code .= " }\n";
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (0 === count($this->routes) && '/' === $pathinfo) {
|
||||
if ('/' === $pathinfo) {
|
||||
throw new NoConfigurationException();
|
||||
}
|
||||
|
||||
|
@ -309,6 +309,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
|
@ -371,6 +371,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
||||
}
|
||||
not_nonsecure:
|
||||
|
||||
if ('/' === $pathinfo) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
return array('_route' => 'with-condition');
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
|
@ -103,6 +103,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
|
@ -200,6 +200,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
||||
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
|
@ -204,6 +204,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
|
||||
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
|
@ -240,6 +240,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
|
||||
|
||||
}
|
||||
|
||||
if ('/' === $pathinfo) {
|
||||
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ abstract class AbstractObjectNormalizer extends AbstractNormalizer
|
||||
{
|
||||
const ENABLE_MAX_DEPTH = 'enable_max_depth';
|
||||
const DEPTH_KEY_PATTERN = 'depth_%s::%s';
|
||||
const ALLOW_EXTRA_ATTRIBUTES = 'allow_extra_attributes';
|
||||
const DISABLE_TYPE_ENFORCEMENT = 'disable_type_enforcement';
|
||||
|
||||
private $propertyTypeExtractor;
|
||||
|
Reference in New Issue
Block a user