Merge branch '3.4'
* 3.4: Misspelled word Display a better error design when the toolbar cannot be displayed fixed CS do not validate empty values [Cache] fix cleanup of expired items for PdoAdapter [Dotenv] clean up before running assertions [Console] fix description of INF default values parse escaped quotes in unquoted env var values [PropertyAccess] Fix TypeError discard [Validator] Throw exception on Comparison constraints null options [FrameworkBundle] Display a proper warning on cache:clear without the --no-warmup option [Security] Fix Firewall ExceptionListener priority Allow * to bind all interfaces (as INADDR_ANY) Identify tty tests in Component/Process [Workflow] Added more events to the announce function [Validator] Remove property path suggestion for using the Expression validator [WebProfilerBundle] Fix css trick used for offsetting html anchor from fixed header disable unusable fragment renderers [Stopwatch] Add a reset method [Security] Fix annotation
This commit is contained in:
commit
3041b4cac1
@ -63,6 +63,10 @@ class UniqueEntityValidator extends ConstraintValidator
|
|||||||
throw new ConstraintDefinitionException('At least one field has to be specified.');
|
throw new ConstraintDefinitionException('At least one field has to be specified.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (null === $entity) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($constraint->em) {
|
if ($constraint->em) {
|
||||||
$em = $this->registry->getManager($constraint->em);
|
$em = $this->registry->getManager($constraint->em);
|
||||||
|
|
||||||
|
@ -331,6 +331,8 @@ class FrameworkExtension extends Extension
|
|||||||
private function registerEsiConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
private function registerEsiConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
||||||
{
|
{
|
||||||
if (!$this->isConfigEnabled($container, $config)) {
|
if (!$this->isConfigEnabled($container, $config)) {
|
||||||
|
$container->removeDefinition('fragment.renderer.esi');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,6 +349,8 @@ class FrameworkExtension extends Extension
|
|||||||
private function registerSsiConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
private function registerSsiConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
||||||
{
|
{
|
||||||
if (!$this->isConfigEnabled($container, $config)) {
|
if (!$this->isConfigEnabled($container, $config)) {
|
||||||
|
$container->removeDefinition('fragment.renderer.ssi');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,6 +367,8 @@ class FrameworkExtension extends Extension
|
|||||||
private function registerFragmentsConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
private function registerFragmentsConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
||||||
{
|
{
|
||||||
if (!$this->isConfigEnabled($container, $config)) {
|
if (!$this->isConfigEnabled($container, $config)) {
|
||||||
|
$container->removeDefinition('fragment.renderer.hinclude');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$container->loadFromExtension('framework', array(
|
||||||
|
'fragments' => array(
|
||||||
|
'enabled' => false,
|
||||||
|
),
|
||||||
|
'esi' => array(
|
||||||
|
'enabled' => true,
|
||||||
|
),
|
||||||
|
'ssi' => array(
|
||||||
|
'enabled' => true,
|
||||||
|
),
|
||||||
|
));
|
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$container->loadFromExtension('framework', array(
|
||||||
|
'esi' => array(
|
||||||
|
'enabled' => false,
|
||||||
|
),
|
||||||
|
));
|
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$container->loadFromExtension('framework', array(
|
||||||
|
'ssi' => array(
|
||||||
|
'enabled' => false,
|
||||||
|
),
|
||||||
|
));
|
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<container xmlns="http://symfony.com/schema/dic/services"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:framework="http://symfony.com/schema/dic/symfony"
|
||||||
|
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
|
||||||
|
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
|
||||||
|
|
||||||
|
<framework:config>
|
||||||
|
<framework:fragments enabled="false" />
|
||||||
|
<framework:esi enabled="true" />
|
||||||
|
<framework:ssi enabled="true" />
|
||||||
|
</framework:config>
|
||||||
|
</container>
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<container xmlns="http://symfony.com/schema/dic/services"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:framework="http://symfony.com/schema/dic/symfony"
|
||||||
|
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
|
||||||
|
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
|
||||||
|
|
||||||
|
<framework:config>
|
||||||
|
<framework:esi enabled="false" />
|
||||||
|
</framework:config>
|
||||||
|
</container>
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<container xmlns="http://symfony.com/schema/dic/services"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns:framework="http://symfony.com/schema/dic/symfony"
|
||||||
|
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
|
||||||
|
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
|
||||||
|
|
||||||
|
<framework:config>
|
||||||
|
<framework:ssi enabled="false" />
|
||||||
|
</framework:config>
|
||||||
|
</container>
|
@ -0,0 +1,7 @@
|
|||||||
|
framework:
|
||||||
|
fragments:
|
||||||
|
enabled: false
|
||||||
|
esi:
|
||||||
|
enabled: true
|
||||||
|
ssi:
|
||||||
|
enabled: true
|
@ -0,0 +1,3 @@
|
|||||||
|
framework:
|
||||||
|
esi:
|
||||||
|
enabled: false
|
@ -0,0 +1,3 @@
|
|||||||
|
framework:
|
||||||
|
ssi:
|
||||||
|
enabled: false
|
@ -132,6 +132,14 @@ abstract class FrameworkExtensionTest extends TestCase
|
|||||||
$container = $this->createContainerFromFile('full');
|
$container = $this->createContainerFromFile('full');
|
||||||
|
|
||||||
$this->assertTrue($container->hasDefinition('esi'), '->registerEsiConfiguration() loads esi.xml');
|
$this->assertTrue($container->hasDefinition('esi'), '->registerEsiConfiguration() loads esi.xml');
|
||||||
|
$this->assertTrue($container->hasDefinition('fragment.renderer.esi'), 'The ESI fragment renderer is registered');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testEsiDisabled()
|
||||||
|
{
|
||||||
|
$container = $this->createContainerFromFile('esi_disabled');
|
||||||
|
|
||||||
|
$this->assertFalse($container->hasDefinition('fragment.renderer.esi'), 'The ESI fragment renderer is not registered');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSsi()
|
public function testSsi()
|
||||||
@ -139,6 +147,23 @@ abstract class FrameworkExtensionTest extends TestCase
|
|||||||
$container = $this->createContainerFromFile('full');
|
$container = $this->createContainerFromFile('full');
|
||||||
|
|
||||||
$this->assertTrue($container->hasDefinition('ssi'), '->registerSsiConfiguration() loads ssi.xml');
|
$this->assertTrue($container->hasDefinition('ssi'), '->registerSsiConfiguration() loads ssi.xml');
|
||||||
|
$this->assertTrue($container->hasDefinition('fragment.renderer.ssi'), 'The SSI fragment renderer is registered');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSsiDisabled()
|
||||||
|
{
|
||||||
|
$container = $this->createContainerFromFile('ssi_disabled');
|
||||||
|
|
||||||
|
$this->assertFalse($container->hasDefinition('fragment.renderer.ssi'), 'The SSI fragment renderer is not registered');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testEsiAndSsiWithoutFragments()
|
||||||
|
{
|
||||||
|
$container = $this->createContainerFromFile('esi_and_ssi_without_fragments');
|
||||||
|
|
||||||
|
$this->assertFalse($container->hasDefinition('fragment.renderer.hinclude'), 'The HInclude fragment renderer is not registered');
|
||||||
|
$this->assertTrue($container->hasDefinition('fragment.renderer.esi'), 'The ESI fragment renderer is registered');
|
||||||
|
$this->assertTrue($container->hasDefinition('fragment.renderer.ssi'), 'The SSI fragment renderer is registered');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEnabledProfiler()
|
public function testEnabledProfiler()
|
||||||
|
@ -61,10 +61,7 @@ class ExtensionPass implements CompilerPassInterface
|
|||||||
$container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension');
|
$container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension');
|
||||||
|
|
||||||
// inject Twig in the hinclude service if Twig is the only registered templating engine
|
// inject Twig in the hinclude service if Twig is the only registered templating engine
|
||||||
if (
|
if ((!$container->hasParameter('templating.engines') || array('twig') == $container->getParameter('templating.engines')) && $container->hasDefinition('fragment.renderer.hinclude')) {
|
||||||
!$container->hasParameter('templating.engines')
|
|
||||||
|| array('twig') == $container->getParameter('templating.engines')
|
|
||||||
) {
|
|
||||||
$container->getDefinition('fragment.renderer.hinclude')
|
$container->getDefinition('fragment.renderer.hinclude')
|
||||||
->addTag('kernel.fragment_renderer', array('alias' => 'hinclude'))
|
->addTag('kernel.fragment_renderer', array('alias' => 'hinclude'))
|
||||||
->replaceArgument(0, new Reference('twig'))
|
->replaceArgument(0, new Reference('twig'))
|
||||||
|
@ -64,7 +64,7 @@ a.doc:hover {
|
|||||||
|
|
||||||
.anchor {
|
.anchor {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-top: 7em;
|
display: block;
|
||||||
margin-top: -7em;
|
top: -7em;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
@ -540,3 +540,33 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Error Toolbar *****/
|
||||||
|
.sf-error-toolbar .sf-toolbarreset {
|
||||||
|
background: #222;
|
||||||
|
color: #f5f5f5;
|
||||||
|
font: 13px/36px Arial, sans-serif;
|
||||||
|
height: 36px;
|
||||||
|
padding: 0 15px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf-error-toolbar .sf-toolbarreset svg {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf-error-toolbar .sf-toolbarreset a {
|
||||||
|
color: #99cdd8;
|
||||||
|
margin-left: 5px;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf-error-toolbar .sf-toolbarreset a:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sf-error-toolbar .sf-toolbarreset .sf-toolbar-icon {
|
||||||
|
float: left;
|
||||||
|
padding: 5px 0;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
@ -100,17 +100,15 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(xhr) {
|
function(xhr) {
|
||||||
var errorToolbarHtml = '
|
|
||||||
<style>
|
|
||||||
.sfErrorToolbar { background: #222; bottom: 0; color: #f5f5f5; font: 13px/36px Arial, sans-serif; height: 36px; padding: 0 15px; position: fixed; width: 100%; }
|
|
||||||
.sfErrorToolbar a { color: #99cdd8; margin-left: 5px; text-decoration: underline; }
|
|
||||||
.sfErrorToolbar a:hover { text-decoration: none; }
|
|
||||||
</style>
|
|
||||||
<div class="sfErrorToolbar">An error occurred while loading the web debug toolbar. <a href="{{ path("_profiler", { "token": token }) }}">Open the web profiler.</a></div>
|
|
||||||
';
|
|
||||||
|
|
||||||
if (xhr.status !== 0) {
|
if (xhr.status !== 0) {
|
||||||
window.document.body.insertAdjacentHTML('beforeend', errorToolbarHtml);
|
var sfwdt = document.getElementById('sfwdt{{ token }}');
|
||||||
|
sfwdt.innerHTML = '\
|
||||||
|
<div class="sf-toolbarreset">\
|
||||||
|
<div class="sf-toolbar-icon"><svg width="26" height="28" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 26 28" enable-background="new 0 0 26 28" xml:space="preserve"><path fill="#FFFFFF" d="M13 0C5.8 0 0 5.8 0 13c0 7.2 5.8 13 13 13c7.2 0 13-5.8 13-13C26 5.8 20.2 0 13 0z M20 7.5 c-0.6 0-1-0.3-1-0.9c0-0.2 0-0.4 0.2-0.6c0.1-0.3 0.2-0.3 0.2-0.4c0-0.3-0.5-0.4-0.7-0.4c-2 0.1-2.5 2.7-2.9 4.8l-0.2 1.1 c1.1 0.2 1.9 0 2.4-0.3c0.6-0.4-0.2-0.8-0.1-1.3C18 9.2 18.4 9 18.7 8.9c0.5 0 0.8 0.5 0.8 1c0 0.8-1.1 2-3.3 1.9 c-0.3 0-0.5 0-0.7-0.1L15 14.1c-0.4 1.7-0.9 4.1-2.6 6.2c-1.5 1.8-3.1 2.1-3.8 2.1c-1.3 0-2.1-0.6-2.2-1.6c0-0.9 0.8-1.4 1.3-1.4 c0.7 0 1.2 0.5 1.2 1.1c0 0.5-0.2 0.6-0.4 0.7c-0.1 0.1-0.3 0.2-0.3 0.4c0 0.1 0.1 0.3 0.4 0.3c0.5 0 0.9-0.3 1.2-0.5 c1.3-1 1.7-2.9 2.4-6.2l0.1-0.8c0.2-1.1 0.5-2.3 0.8-3.5c-0.9-0.7-1.4-1.5-2.6-1.8c-0.8-0.2-1.3 0-1.7 0.4C8.4 10 8.6 10.7 9 11.1 l0.7 0.7c0.8 0.9 1.3 1.7 1.1 2.7c-0.3 1.6-2.1 2.8-4.3 2.1c-1.9-0.6-2.2-1.9-2-2.7c0.2-0.6 0.7-0.8 1.2-0.6 c0.5 0.2 0.7 0.8 0.6 1.3c0 0.1 0 0.1-0.1 0.3C6 15 5.9 15.2 5.9 15.3c-0.1 0.4 0.4 0.7 0.8 0.8c0.8 0.3 1.7-0.2 1.9-0.9 c0.2-0.6-0.2-1.1-0.4-1.2l-0.8-0.9c-0.4-0.4-1.2-1.5-0.8-2.8c0.2-0.5 0.5-1 0.9-1.4c1-0.7 2-0.8 3-0.6c1.3 0.4 1.9 1.2 2.8 1.9 c0.5-1.3 1.1-2.6 2-3.8c0.9-1 2-1.7 3.3-1.8C20 4.8 21 5.4 21 6.3C21 6.7 20.8 7.5 20 7.5z"/></svg></div>\
|
||||||
|
An error occurred while loading the web debug toolbar. <a href="{{ path("_profiler", { "token": token }) }}">Open the web profiler.</a>\
|
||||||
|
</div>\
|
||||||
|
';
|
||||||
|
sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ maxTries: 5 }
|
{ maxTries: 5 }
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
3.4.0
|
||||||
|
-----
|
||||||
|
|
||||||
|
* WebServer can now use '*' as a wildcard to bind to 0.0.0.0 (INADDR_ANY)
|
||||||
|
|
||||||
3.3.0
|
3.3.0
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -54,6 +54,9 @@ class WebServerConfig
|
|||||||
$this->port = $this->findBestPort();
|
$this->port = $this->findBestPort();
|
||||||
} elseif (false !== $pos = strrpos($address, ':')) {
|
} elseif (false !== $pos = strrpos($address, ':')) {
|
||||||
$this->hostname = substr($address, 0, $pos);
|
$this->hostname = substr($address, 0, $pos);
|
||||||
|
if ('*' === $this->hostname) {
|
||||||
|
$this->hostname = '0.0.0.0';
|
||||||
|
}
|
||||||
$this->port = substr($address, $pos + 1);
|
$this->port = substr($address, $pos + 1);
|
||||||
} elseif (ctype_digit($address)) {
|
} elseif (ctype_digit($address)) {
|
||||||
$this->hostname = '127.0.0.1';
|
$this->hostname = '127.0.0.1';
|
||||||
|
@ -41,4 +41,30 @@ class PdoAdapterTest extends AdapterTestCase
|
|||||||
{
|
{
|
||||||
return new PdoAdapter('sqlite:'.self::$dbFile, 'ns', $defaultLifetime);
|
return new PdoAdapter('sqlite:'.self::$dbFile, 'ns', $defaultLifetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testCleanupExpiredItems()
|
||||||
|
{
|
||||||
|
$pdo = new \PDO('sqlite:'.self::$dbFile);
|
||||||
|
|
||||||
|
$getCacheItemCount = function () use ($pdo) {
|
||||||
|
return (int) $pdo->query('SELECT COUNT(*) FROM cache_items')->fetch(\PDO::FETCH_COLUMN);
|
||||||
|
};
|
||||||
|
|
||||||
|
$this->assertSame(0, $getCacheItemCount());
|
||||||
|
|
||||||
|
$cache = $this->createCachePool();
|
||||||
|
|
||||||
|
$item = $cache->getItem('some_nice_key');
|
||||||
|
$item->expiresAfter(1);
|
||||||
|
$item->set(1);
|
||||||
|
|
||||||
|
$cache->save($item);
|
||||||
|
$this->assertSame(1, $getCacheItemCount());
|
||||||
|
|
||||||
|
sleep(2);
|
||||||
|
|
||||||
|
$newItem = $cache->getItem($item->getKey());
|
||||||
|
$this->assertFalse($newItem->isHit());
|
||||||
|
$this->assertSame(0, $getCacheItemCount(), 'PDOAdapter must clean up expired items');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ trait PdoTrait
|
|||||||
foreach ($expired as $id) {
|
foreach ($expired as $id) {
|
||||||
$stmt->bindValue(++$i, $id);
|
$stmt->bindValue(++$i, $id);
|
||||||
}
|
}
|
||||||
$stmt->execute($expired);
|
$stmt->execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ class JsonDescriptor extends Descriptor
|
|||||||
'is_required' => $argument->isRequired(),
|
'is_required' => $argument->isRequired(),
|
||||||
'is_array' => $argument->isArray(),
|
'is_array' => $argument->isArray(),
|
||||||
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()),
|
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()),
|
||||||
'default' => $argument->getDefault(),
|
'default' => INF === $argument->getDefault() ? 'INF' : $argument->getDefault(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ class JsonDescriptor extends Descriptor
|
|||||||
'is_value_required' => $option->isValueRequired(),
|
'is_value_required' => $option->isValueRequired(),
|
||||||
'is_multiple' => $option->isArray(),
|
'is_multiple' => $option->isArray(),
|
||||||
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()),
|
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()),
|
||||||
'default' => $option->getDefault(),
|
'default' => INF === $option->getDefault() ? 'INF' : $option->getDefault(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,6 +278,10 @@ class TextDescriptor extends Descriptor
|
|||||||
*/
|
*/
|
||||||
private function formatDefaultValue($default)
|
private function formatDefaultValue($default)
|
||||||
{
|
{
|
||||||
|
if (INF === $default) {
|
||||||
|
return 'INF';
|
||||||
|
}
|
||||||
|
|
||||||
if (is_string($default)) {
|
if (is_string($default)) {
|
||||||
$default = OutputFormatter::escape($default);
|
$default = OutputFormatter::escape($default);
|
||||||
} elseif (is_array($default)) {
|
} elseif (is_array($default)) {
|
||||||
|
@ -32,6 +32,7 @@ class ObjectsProvider
|
|||||||
'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
|
'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
|
||||||
'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
|
'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
|
||||||
'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', '<comment>style</>'),
|
'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', '<comment>style</>'),
|
||||||
|
'input_argument_with_default_inf_value' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', INF),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ class ObjectsProvider
|
|||||||
'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
|
'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
|
||||||
'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', '<comment>style</>'),
|
'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', '<comment>style</>'),
|
||||||
'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('<comment>Hello</comment>', '<info>world</info>')),
|
'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('<comment>Hello</comment>', '<info>world</info>')),
|
||||||
|
'input_option_with_default_inf_value' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', INF),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "argument_name",
|
||||||
|
"is_required": false,
|
||||||
|
"is_array": false,
|
||||||
|
"description": "argument description",
|
||||||
|
"default": "INF"
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
**argument_name:**
|
||||||
|
|
||||||
|
* Name: argument_name
|
||||||
|
* Is required: no
|
||||||
|
* Is array: no
|
||||||
|
* Description: argument description
|
||||||
|
* Default: `INF`
|
@ -0,0 +1 @@
|
|||||||
|
<info>argument_name</info> argument description<comment> [default: INF]</comment>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<argument name="argument_name" is_required="0" is_array="0">
|
||||||
|
<description>argument description</description>
|
||||||
|
<defaults>
|
||||||
|
<default>INF</default>
|
||||||
|
</defaults>
|
||||||
|
</argument>
|
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "--option_name",
|
||||||
|
"shortcut": "-o",
|
||||||
|
"accept_value": true,
|
||||||
|
"is_value_required": false,
|
||||||
|
"is_multiple": false,
|
||||||
|
"description": "option description",
|
||||||
|
"default": "INF"
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
**option_name:**
|
||||||
|
|
||||||
|
* Name: `--option_name`
|
||||||
|
* Shortcut: `-o`
|
||||||
|
* Accept value: yes
|
||||||
|
* Is value required: no
|
||||||
|
* Is multiple: no
|
||||||
|
* Description: option description
|
||||||
|
* Default: `INF`
|
@ -0,0 +1 @@
|
|||||||
|
<info>-o, --option_name[=OPTION_NAME]</info> option description<comment> [default: INF]</comment>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<option name="--option_name" shortcut="-o" accept_value="1" is_value_required="0" is_multiple="0">
|
||||||
|
<description>option description</description>
|
||||||
|
<defaults>
|
||||||
|
<default>INF</default>
|
||||||
|
</defaults>
|
||||||
|
</option>
|
@ -216,6 +216,10 @@ final class Dotenv
|
|||||||
$notQuoted = true;
|
$notQuoted = true;
|
||||||
$prevChr = $this->data[$this->cursor - 1];
|
$prevChr = $this->data[$this->cursor - 1];
|
||||||
while ($this->cursor < $this->end && "\n" !== $this->data[$this->cursor] && !((' ' === $prevChr || "\t" === $prevChr) && '#' === $this->data[$this->cursor])) {
|
while ($this->cursor < $this->end && "\n" !== $this->data[$this->cursor] && !((' ' === $prevChr || "\t" === $prevChr) && '#' === $this->data[$this->cursor])) {
|
||||||
|
if ('\\' === $this->data[$this->cursor] && isset($this->data[$this->cursor + 1]) && ('"' === $this->data[$this->cursor + 1] || "'" === $this->data[$this->cursor + 1])) {
|
||||||
|
++$this->cursor;
|
||||||
|
}
|
||||||
|
|
||||||
$value .= $prevChr = $this->data[$this->cursor];
|
$value .= $prevChr = $this->data[$this->cursor];
|
||||||
++$this->cursor;
|
++$this->cursor;
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,9 @@ class DotenvTest extends TestCase
|
|||||||
array('FOO=" "', array('FOO' => ' ')),
|
array('FOO=" "', array('FOO' => ' ')),
|
||||||
array('PATH="c:\\\\"', array('PATH' => 'c:\\')),
|
array('PATH="c:\\\\"', array('PATH' => 'c:\\')),
|
||||||
array("FOO=\"bar\nfoo\"", array('FOO' => "bar\nfoo")),
|
array("FOO=\"bar\nfoo\"", array('FOO' => "bar\nfoo")),
|
||||||
|
array('FOO=BAR\\"', array('FOO' => 'BAR"')),
|
||||||
|
array("FOO=BAR\\'BAZ", array('FOO' => "BAR'BAZ")),
|
||||||
|
array('FOO=\\"BAR', array('FOO' => '"BAR')),
|
||||||
|
|
||||||
// concatenated values
|
// concatenated values
|
||||||
|
|
||||||
@ -148,6 +151,13 @@ class DotenvTest extends TestCase
|
|||||||
|
|
||||||
public function testLoad()
|
public function testLoad()
|
||||||
{
|
{
|
||||||
|
unset($_ENV['FOO']);
|
||||||
|
unset($_ENV['BAR']);
|
||||||
|
unset($_SERVER['FOO']);
|
||||||
|
unset($_SERVER['BAR']);
|
||||||
|
putenv('FOO');
|
||||||
|
putenv('BAR');
|
||||||
|
|
||||||
@mkdir($tmpdir = sys_get_temp_dir().'/dotenv');
|
@mkdir($tmpdir = sys_get_temp_dir().'/dotenv');
|
||||||
|
|
||||||
$path1 = tempnam($tmpdir, 'sf-');
|
$path1 = tempnam($tmpdir, 'sf-');
|
||||||
@ -158,14 +168,17 @@ class DotenvTest extends TestCase
|
|||||||
|
|
||||||
(new DotEnv())->load($path1, $path2);
|
(new DotEnv())->load($path1, $path2);
|
||||||
|
|
||||||
$this->assertSame('BAR', getenv('FOO'));
|
$foo = getenv('FOO');
|
||||||
$this->assertSame('BAZ', getenv('BAR'));
|
$bar = getenv('BAR');
|
||||||
|
|
||||||
putenv('FOO');
|
putenv('FOO');
|
||||||
putenv('BAR');
|
putenv('BAR');
|
||||||
unlink($path1);
|
unlink($path1);
|
||||||
unlink($path2);
|
unlink($path2);
|
||||||
rmdir($tmpdir);
|
rmdir($tmpdir);
|
||||||
|
|
||||||
|
$this->assertSame('BAR', $foo);
|
||||||
|
$this->assertSame('BAZ', $bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -429,6 +429,9 @@ class ProcessTest extends TestCase
|
|||||||
$this->assertGreaterThan(0, $process->getExitCode());
|
$this->assertGreaterThan(0, $process->getExitCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group tty
|
||||||
|
*/
|
||||||
public function testTTYCommand()
|
public function testTTYCommand()
|
||||||
{
|
{
|
||||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||||
@ -444,6 +447,9 @@ class ProcessTest extends TestCase
|
|||||||
$this->assertSame(Process::STATUS_TERMINATED, $process->getStatus());
|
$this->assertSame(Process::STATUS_TERMINATED, $process->getStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group tty
|
||||||
|
*/
|
||||||
public function testTTYCommandExitCode()
|
public function testTTYCommandExitCode()
|
||||||
{
|
{
|
||||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||||
|
@ -179,7 +179,7 @@ class PropertyAccessor implements PropertyAccessorInterface
|
|||||||
|
|
||||||
private static function throwInvalidArgumentException($message, $trace, $i)
|
private static function throwInvalidArgumentException($message, $trace, $i)
|
||||||
{
|
{
|
||||||
if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file']) {
|
if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file'] && isset($trace[$i]['args'][0])) {
|
||||||
$pos = strpos($message, $delim = 'must be of the type ') ?: (strpos($message, $delim = 'must be an instance of ') ?: strpos($message, $delim = 'must implement interface '));
|
$pos = strpos($message, $delim = 'must be of the type ') ?: (strpos($message, $delim = 'must be an instance of ') ?: strpos($message, $delim = 'must implement interface '));
|
||||||
$pos += strlen($delim);
|
$pos += strlen($delim);
|
||||||
$type = $trace[$i]['args'][0];
|
$type = $trace[$i]['args'][0];
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\PropertyAccess\Tests\Fixtures;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||||
|
*/
|
||||||
|
class ReturnTyped
|
||||||
|
{
|
||||||
|
public function getFoos(): array
|
||||||
|
{
|
||||||
|
return 'It doesn\'t respect the return type on purpose';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addFoo(\DateTime $dateTime)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeFoo(\DateTime $dateTime)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase;
|
|||||||
use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
use Symfony\Component\Cache\Adapter\ArrayAdapter;
|
||||||
use Symfony\Component\PropertyAccess\Exception\NoSuchIndexException;
|
use Symfony\Component\PropertyAccess\Exception\NoSuchIndexException;
|
||||||
use Symfony\Component\PropertyAccess\PropertyAccessor;
|
use Symfony\Component\PropertyAccess\PropertyAccessor;
|
||||||
|
use Symfony\Component\PropertyAccess\Tests\Fixtures\ReturnTyped;
|
||||||
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClass;
|
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClass;
|
||||||
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicCall;
|
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicCall;
|
||||||
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicGet;
|
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicGet;
|
||||||
@ -650,4 +651,16 @@ class PropertyAccessorTest extends TestCase
|
|||||||
|
|
||||||
$this->propertyAccessor->setValue($object, 'property', 'foo');
|
$this->propertyAccessor->setValue($object, 'property', 'foo');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @requires PHP 7
|
||||||
|
*
|
||||||
|
* @expectedException \TypeError
|
||||||
|
*/
|
||||||
|
public function testDoNotDiscardReturnTypeError()
|
||||||
|
{
|
||||||
|
$object = new ReturnTyped();
|
||||||
|
|
||||||
|
$this->propertyAccessor->setValue($object, 'foos', array(new \DateTime()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ class UsernamePasswordToken extends AbstractToken
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
|
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
|
||||||
* @param string $credentials This usually is the password of the user
|
* @param mixed $credentials This usually is the password of the user
|
||||||
* @param string $providerKey The provider key
|
* @param string $providerKey The provider key
|
||||||
* @param (Role|string)[] $roles An array of roles
|
* @param (Role|string)[] $roles An array of roles
|
||||||
*
|
*
|
||||||
|
@ -39,6 +39,10 @@ class UserPasswordValidator extends ConstraintValidator
|
|||||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UserPassword');
|
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UserPassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (null === $password || '' === $password) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$user = $this->tokenStorage->getToken()->getUser();
|
$user = $this->tokenStorage->getToken()->getUser();
|
||||||
|
|
||||||
if (!$user instanceof UserInterface) {
|
if (!$user instanceof UserInterface) {
|
||||||
|
@ -72,7 +72,7 @@ class ExceptionListener
|
|||||||
*/
|
*/
|
||||||
public function register(EventDispatcherInterface $dispatcher)
|
public function register(EventDispatcherInterface $dispatcher)
|
||||||
{
|
{
|
||||||
$dispatcher->addListener(KernelEvents::EXCEPTION, array($this, 'onKernelException'));
|
$dispatcher->addListener(KernelEvents::EXCEPTION, array($this, 'onKernelException'), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +30,7 @@ class Stopwatch
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->sections = $this->activeSections = array('__root__' => new Section('__root__'));
|
$this->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,4 +156,12 @@ class Stopwatch
|
|||||||
{
|
{
|
||||||
return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : array();
|
return isset($this->sections[$id]) ? $this->sections[$id]->getEvents() : array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets the stopwatch to its original state.
|
||||||
|
*/
|
||||||
|
public function reset()
|
||||||
|
{
|
||||||
|
$this->sections = $this->activeSections = array('__root__' => new Section('__root__'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,4 +153,16 @@ class StopwatchTest extends TestCase
|
|||||||
$stopwatch = new Stopwatch();
|
$stopwatch = new Stopwatch();
|
||||||
$stopwatch->openSection('section');
|
$stopwatch->openSection('section');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testReset()
|
||||||
|
{
|
||||||
|
$stopwatch = new Stopwatch();
|
||||||
|
|
||||||
|
$stopwatch->openSection();
|
||||||
|
$stopwatch->start('foo', 'cat');
|
||||||
|
|
||||||
|
$stopwatch->reset();
|
||||||
|
|
||||||
|
$this->assertEquals(new Stopwatch(), $stopwatch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,10 @@ abstract class AbstractComparison extends Constraint
|
|||||||
*/
|
*/
|
||||||
public function __construct($options = null)
|
public function __construct($options = null)
|
||||||
{
|
{
|
||||||
|
if (null === $options) {
|
||||||
|
$options = array();
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($options) && !isset($options['value'])) {
|
if (is_array($options) && !isset($options['value'])) {
|
||||||
throw new ConstraintDefinitionException(sprintf(
|
throw new ConstraintDefinitionException(sprintf(
|
||||||
'The %s constraint requires the "value" option to be set.',
|
'The %s constraint requires the "value" option to be set.',
|
||||||
|
@ -48,7 +48,7 @@ class UrlValidator extends ConstraintValidator
|
|||||||
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url');
|
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $value) {
|
if (null === $value || '' === $value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="19">
|
<trans-unit id="19">
|
||||||
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
|
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
|
||||||
<target>Cette chaine est trop longue. Elle doit avoir au maximum {{ limit }} caractère.|Cette chaine est trop longue. Elle doit avoir au maximum {{ limit }} caractères.</target>
|
<target>Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractère.|Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractères.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="20">
|
<trans-unit id="20">
|
||||||
<source>This value should be {{ limit }} or more.</source>
|
<source>This value should be {{ limit }} or more.</source>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="21">
|
<trans-unit id="21">
|
||||||
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
|
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
|
||||||
<target>Cette chaine est trop courte. Elle doit avoir au minimum {{ limit }} caractère.|Cette chaine est trop courte. Elle doit avoir au minimum {{ limit }} caractères.</target>
|
<target>Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractère.|Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractères.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="22">
|
<trans-unit id="22">
|
||||||
<source>This value should not be blank.</source>
|
<source>This value should not be blank.</source>
|
||||||
@ -180,7 +180,7 @@
|
|||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="48">
|
<trans-unit id="48">
|
||||||
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
|
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
|
||||||
<target>Cette chaine doit avoir exactement {{ limit }} caractère.|Cette chaine doit avoir exactement {{ limit }} caractères.</target>
|
<target>Cette chaîne doit avoir exactement {{ limit }} caractère.|Cette chaîne doit avoir exactement {{ limit }} caractères.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="49">
|
<trans-unit id="49">
|
||||||
<source>The file was only partially uploaded.</source>
|
<source>The file was only partially uploaded.</source>
|
||||||
|
@ -65,14 +65,21 @@ abstract class AbstractComparisonValidatorTestCase extends ConstraintValidatorTe
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function provideInvalidConstraintOptions()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array(null),
|
||||||
|
array(array()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @dataProvider provideInvalidConstraintOptions
|
||||||
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
|
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
|
||||||
*/
|
*/
|
||||||
public function testThrowsConstraintExceptionIfNoValueOrProperty()
|
public function testThrowsConstraintExceptionIfNoValueOrProperty($options)
|
||||||
{
|
{
|
||||||
$comparison = $this->createConstraint(array());
|
$this->createConstraint($options);
|
||||||
|
|
||||||
$this->validator->validate('some value', $comparison);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -163,11 +170,11 @@ abstract class AbstractComparisonValidatorTestCase extends ConstraintValidatorTe
|
|||||||
abstract public function provideInvalidComparisons();
|
abstract public function provideInvalidComparisons();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $options Options for the constraint
|
* @param array|null $options Options for the constraint
|
||||||
*
|
*
|
||||||
* @return Constraint
|
* @return Constraint
|
||||||
*/
|
*/
|
||||||
abstract protected function createConstraint(array $options);
|
abstract protected function createConstraint(array $options = null);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string|null
|
* @return string|null
|
||||||
|
@ -24,7 +24,7 @@ class EqualToValidatorTest extends AbstractComparisonValidatorTestCase
|
|||||||
return new EqualToValidator();
|
return new EqualToValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new EqualTo($options);
|
return new EqualTo($options);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class GreaterThanOrEqualValidatorTest extends AbstractComparisonValidatorTestCas
|
|||||||
return new GreaterThanOrEqualValidator();
|
return new GreaterThanOrEqualValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new GreaterThanOrEqual($options);
|
return new GreaterThanOrEqual($options);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class GreaterThanValidatorTest extends AbstractComparisonValidatorTestCase
|
|||||||
return new GreaterThanValidator();
|
return new GreaterThanValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new GreaterThan($options);
|
return new GreaterThan($options);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class IdenticalToValidatorTest extends AbstractComparisonValidatorTestCase
|
|||||||
return new IdenticalToValidator();
|
return new IdenticalToValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new IdenticalTo($options);
|
return new IdenticalTo($options);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class LessThanOrEqualValidatorTest extends AbstractComparisonValidatorTestCase
|
|||||||
return new LessThanOrEqualValidator();
|
return new LessThanOrEqualValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new LessThanOrEqual($options);
|
return new LessThanOrEqual($options);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class LessThanValidatorTest extends AbstractComparisonValidatorTestCase
|
|||||||
return new LessThanValidator();
|
return new LessThanValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new LessThan($options);
|
return new LessThan($options);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class NotEqualToValidatorTest extends AbstractComparisonValidatorTestCase
|
|||||||
return new NotEqualToValidator();
|
return new NotEqualToValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new NotEqualTo($options);
|
return new NotEqualTo($options);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class NotIdenticalToValidatorTest extends AbstractComparisonValidatorTestCase
|
|||||||
return new NotIdenticalToValidator();
|
return new NotIdenticalToValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createConstraint(array $options)
|
protected function createConstraint(array $options = null)
|
||||||
{
|
{
|
||||||
return new NotIdenticalTo($options);
|
return new NotIdenticalTo($options);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
"symfony/yaml": "",
|
"symfony/yaml": "",
|
||||||
"symfony/config": "",
|
"symfony/config": "",
|
||||||
"egulias/email-validator": "Strict (RFC compliant) email validation",
|
"egulias/email-validator": "Strict (RFC compliant) email validation",
|
||||||
"symfony/property-access": "For using the Expression validator",
|
|
||||||
"symfony/expression-language": "For using the Expression validator"
|
"symfony/expression-language": "For using the Expression validator"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -263,6 +263,8 @@ class WorkflowTest extends TestCase
|
|||||||
'workflow.workflow_name.entered.b',
|
'workflow.workflow_name.entered.b',
|
||||||
'workflow.workflow_name.entered.c',
|
'workflow.workflow_name.entered.c',
|
||||||
// Following events are fired because of announce() method
|
// Following events are fired because of announce() method
|
||||||
|
'workflow.announce',
|
||||||
|
'workflow.workflow_name.announce',
|
||||||
'workflow.guard',
|
'workflow.guard',
|
||||||
'workflow.workflow_name.guard',
|
'workflow.workflow_name.guard',
|
||||||
'workflow.workflow_name.guard.t2',
|
'workflow.workflow_name.guard.t2',
|
||||||
|
@ -300,6 +300,9 @@ class Workflow
|
|||||||
|
|
||||||
$event = new Event($subject, $marking, $initialTransition);
|
$event = new Event($subject, $marking, $initialTransition);
|
||||||
|
|
||||||
|
$this->dispatcher->dispatch('workflow.announce', $event);
|
||||||
|
$this->dispatcher->dispatch(sprintf('workflow.%s.announce', $this->name), $event);
|
||||||
|
|
||||||
foreach ($this->getEnabledTransitions($subject) as $transition) {
|
foreach ($this->getEnabledTransitions($subject) as $transition) {
|
||||||
$this->dispatcher->dispatch(sprintf('workflow.%s.announce.%s', $this->name, $transition->getName()), $event);
|
$this->dispatcher->dispatch(sprintf('workflow.%s.announce.%s', $this->name, $transition->getName()), $event);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user