Merge branch '2.8' into 3.4
* 2.8: improve docblocks around group sequences [WebProfilerBundle] added a note in the README [Filesystem] Skip tests on readable file when run with root user [FWBundle] Fix an error in WebTestCase::createClient's PHPDoc [HttpFoundation][Security] forward locale and format to subrequests [Console] Send the right exit code to console.terminate listeners Caching missed templates on cache warmup
This commit is contained in:
commit
592bbf3470
@ -23,7 +23,7 @@ abstract class WebTestCase extends KernelTestCase
|
|||||||
/**
|
/**
|
||||||
* Creates a Client.
|
* Creates a Client.
|
||||||
*
|
*
|
||||||
* @param array $options An array of options to pass to the createKernel class
|
* @param array $options An array of options to pass to the createKernel method
|
||||||
* @param array $server An array of server parameters
|
* @param array $server An array of server parameters
|
||||||
*
|
*
|
||||||
* @return Client A Client instance
|
* @return Client A Client instance
|
||||||
|
@ -63,7 +63,7 @@ class TemplateIterator implements \IteratorAggregate
|
|||||||
$this->templates = array_merge(
|
$this->templates = array_merge(
|
||||||
$this->templates,
|
$this->templates,
|
||||||
$this->findTemplatesInDirectory($bundle->getPath().'/Resources/views', $name),
|
$this->findTemplatesInDirectory($bundle->getPath().'/Resources/views', $name),
|
||||||
$this->findTemplatesInDirectory($this->rootDir.'/'.$bundle->getName().'/views', $name),
|
$this->findTemplatesInDirectory($this->rootDir.'/Resources/'.$bundle->getName().'/views', $name),
|
||||||
$this->findTemplatesInDirectory($this->defaultPath.'/bundles/'.$bundle->getName(), $name)
|
$this->findTemplatesInDirectory($this->defaultPath.'/bundles/'.$bundle->getName(), $name)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ class TemplateIteratorTest extends TestCase
|
|||||||
sort($sorted);
|
sort($sorted);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
array(
|
array(
|
||||||
|
'@Bar/base.html.twig',
|
||||||
'@Bar/index.html.twig',
|
'@Bar/index.html.twig',
|
||||||
'@Bar/layout.html.twig',
|
'@Bar/layout.html.twig',
|
||||||
'@Foo/index.html.twig',
|
'@Foo/index.html.twig',
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
WebProfilerBundle
|
WebProfilerBundle
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
The Web profiler bundle is a **development tool** that gives detailed
|
||||||
|
information about the execution of any request.
|
||||||
|
|
||||||
|
**Never** enable it on production servers as it will lead to major security
|
||||||
|
vulnerabilities in your project.
|
||||||
|
|
||||||
Resources
|
Resources
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
@ -153,15 +153,7 @@ class Application
|
|||||||
|
|
||||||
$renderException($e);
|
$renderException($e);
|
||||||
|
|
||||||
$exitCode = $e->getCode();
|
$exitCode = $this->getExitCodeForThrowable($e);
|
||||||
if (is_numeric($exitCode)) {
|
|
||||||
$exitCode = (int) $exitCode;
|
|
||||||
if (0 === $exitCode) {
|
|
||||||
$exitCode = 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$exitCode = 1;
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
// if the exception handler changed, keep it
|
// if the exception handler changed, keep it
|
||||||
// otherwise, unregister $renderException
|
// otherwise, unregister $renderException
|
||||||
@ -1220,4 +1212,26 @@ class Application
|
|||||||
$this->add($command);
|
$this->add($command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type hint omitted to be PHP5 compatible.
|
||||||
|
*
|
||||||
|
* @param \Exception|\Throwable $throwable
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
private function getExitCodeForThrowable($throwable)
|
||||||
|
{
|
||||||
|
$exitCode = $throwable->getCode();
|
||||||
|
if (is_numeric($exitCode)) {
|
||||||
|
$exitCode = (int) $exitCode;
|
||||||
|
if (0 === $exitCode) {
|
||||||
|
$exitCode = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$exitCode = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $exitCode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -912,6 +912,31 @@ class ApplicationTest extends TestCase
|
|||||||
$this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception');
|
$this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testRunDispatchesIntegerExitCode()
|
||||||
|
{
|
||||||
|
$passedRightValue = false;
|
||||||
|
|
||||||
|
// We can assume here that some other test asserts that the event is dispatched at all
|
||||||
|
$dispatcher = new EventDispatcher();
|
||||||
|
$self = $this;
|
||||||
|
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
|
||||||
|
$passedRightValue = (4 === $event->getExitCode());
|
||||||
|
});
|
||||||
|
|
||||||
|
$application = new Application();
|
||||||
|
$application->setDispatcher($dispatcher);
|
||||||
|
$application->setAutoExit(false);
|
||||||
|
|
||||||
|
$application->register('test')->setCode(function (InputInterface $input, OutputInterface $output) {
|
||||||
|
throw new \Exception('', 4);
|
||||||
|
});
|
||||||
|
|
||||||
|
$tester = new ApplicationTester($application);
|
||||||
|
$tester->run(array('command' => 'test'));
|
||||||
|
|
||||||
|
$this->assertTrue($passedRightValue, '-> exit code 4 was passed in the console.terminate event');
|
||||||
|
}
|
||||||
|
|
||||||
public function testRunReturnsExitCodeOneForExceptionCodeZero()
|
public function testRunReturnsExitCodeOneForExceptionCodeZero()
|
||||||
{
|
{
|
||||||
$exception = new \Exception('', 0);
|
$exception = new \Exception('', 0);
|
||||||
@ -927,6 +952,31 @@ class ApplicationTest extends TestCase
|
|||||||
$this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0');
|
$this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testRunDispatchesExitCodeOneForExceptionCodeZero()
|
||||||
|
{
|
||||||
|
$passedRightValue = false;
|
||||||
|
|
||||||
|
// We can assume here that some other test asserts that the event is dispatched at all
|
||||||
|
$dispatcher = new EventDispatcher();
|
||||||
|
$self = $this;
|
||||||
|
$dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($self, &$passedRightValue) {
|
||||||
|
$passedRightValue = (1 === $event->getExitCode());
|
||||||
|
});
|
||||||
|
|
||||||
|
$application = new Application();
|
||||||
|
$application->setDispatcher($dispatcher);
|
||||||
|
$application->setAutoExit(false);
|
||||||
|
|
||||||
|
$application->register('test')->setCode(function (InputInterface $input, OutputInterface $output) {
|
||||||
|
throw new \Exception();
|
||||||
|
});
|
||||||
|
|
||||||
|
$tester = new ApplicationTester($application);
|
||||||
|
$tester->run(array('command' => 'test'));
|
||||||
|
|
||||||
|
$this->assertTrue($passedRightValue, '-> exit code 1 was passed in the console.terminate event');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \LogicException
|
* @expectedException \LogicException
|
||||||
* @expectedExceptionMessage An option with shortcut "e" already exists.
|
* @expectedExceptionMessage An option with shortcut "e" already exists.
|
||||||
|
@ -50,6 +50,10 @@ class FilesystemTest extends FilesystemTestCase
|
|||||||
$this->markTestSkipped('This test cannot run on Windows.');
|
$this->markTestSkipped('This test cannot run on Windows.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!getenv('USER') || 'root' === getenv('USER')) {
|
||||||
|
$this->markTestSkipped('This test will fail if run under superuser');
|
||||||
|
}
|
||||||
|
|
||||||
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
|
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
|
||||||
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
|
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
|
||||||
|
|
||||||
@ -124,6 +128,10 @@ class FilesystemTest extends FilesystemTestCase
|
|||||||
$this->markTestSkipped('This test cannot run on Windows.');
|
$this->markTestSkipped('This test cannot run on Windows.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!getenv('USER') || 'root' === getenv('USER')) {
|
||||||
|
$this->markTestSkipped('This test will fail if run under superuser');
|
||||||
|
}
|
||||||
|
|
||||||
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
|
$sourceFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_source_file';
|
||||||
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
|
$targetFilePath = $this->workspace.\DIRECTORY_SEPARATOR.'copy_target_file';
|
||||||
|
|
||||||
|
@ -52,6 +52,10 @@ class LockHandlerTest extends TestCase
|
|||||||
$this->markTestSkipped('This test cannot run on Windows.');
|
$this->markTestSkipped('This test cannot run on Windows.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!getenv('USER') || 'root' === getenv('USER')) {
|
||||||
|
$this->markTestSkipped('This test will fail if run under superuser');
|
||||||
|
}
|
||||||
|
|
||||||
$lockPath = sys_get_temp_dir().'/'.uniqid('', true);
|
$lockPath = sys_get_temp_dir().'/'.uniqid('', true);
|
||||||
$e = null;
|
$e = null;
|
||||||
$wrongMessage = null;
|
$wrongMessage = null;
|
||||||
|
@ -137,7 +137,7 @@ class FormValidator extends ConstraintValidator
|
|||||||
/**
|
/**
|
||||||
* Returns the validation groups of the given form.
|
* Returns the validation groups of the given form.
|
||||||
*
|
*
|
||||||
* @return array The validation groups
|
* @return string|GroupSequence|(string|GroupSequence)[] The validation groups
|
||||||
*/
|
*/
|
||||||
private static function getValidationGroups(FormInterface $form)
|
private static function getValidationGroups(FormInterface $form)
|
||||||
{
|
{
|
||||||
@ -172,10 +172,10 @@ class FormValidator extends ConstraintValidator
|
|||||||
/**
|
/**
|
||||||
* Post-processes the validation groups option for a given form.
|
* Post-processes the validation groups option for a given form.
|
||||||
*
|
*
|
||||||
* @param array|callable $groups The validation groups
|
* @param string|GroupSequence|(string|GroupSequence)[]|callable $groups The validation groups
|
||||||
* @param FormInterface $form The validated form
|
* @param FormInterface $form The validated form
|
||||||
*
|
*
|
||||||
* @return array The validation groups
|
* @return (string|GroupSequence)[] The validation groups
|
||||||
*/
|
*/
|
||||||
private static function resolveValidationGroups($groups, FormInterface $form)
|
private static function resolveValidationGroups($groups, FormInterface $form)
|
||||||
{
|
{
|
||||||
|
@ -1460,7 +1460,7 @@ class Request
|
|||||||
* * _format request attribute
|
* * _format request attribute
|
||||||
* * $default
|
* * $default
|
||||||
*
|
*
|
||||||
* @param string $default The default format
|
* @param string|null $default The default format
|
||||||
*
|
*
|
||||||
* @return string The request format
|
* @return string The request format
|
||||||
*/
|
*/
|
||||||
|
@ -122,6 +122,13 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer
|
|||||||
$subRequest->setSession($session);
|
$subRequest->setSession($session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('_format')) {
|
||||||
|
$subRequest->attributes->set('_format', $request->get('_format'));
|
||||||
|
}
|
||||||
|
if ($request->getDefaultLocale() !== $request->getLocale()) {
|
||||||
|
$subRequest->setLocale($request->getLocale());
|
||||||
|
}
|
||||||
|
|
||||||
return $subRequest;
|
return $subRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,6 +189,26 @@ class InlineFragmentRendererTest extends TestCase
|
|||||||
$this->assertEquals('Foo', ob_get_clean());
|
$this->assertEquals('Foo', ob_get_clean());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testLocaleAndFormatAreIsKeptInSubrequest()
|
||||||
|
{
|
||||||
|
$expectedSubRequest = Request::create('/');
|
||||||
|
$expectedSubRequest->attributes->set('_format', 'foo');
|
||||||
|
$expectedSubRequest->setLocale('fr');
|
||||||
|
if (Request::getTrustedHeaderName(Request::HEADER_CLIENT_IP)) {
|
||||||
|
$expectedSubRequest->headers->set('x-forwarded-for', array('127.0.0.1'));
|
||||||
|
$expectedSubRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1');
|
||||||
|
}
|
||||||
|
$expectedSubRequest->headers->set('forwarded', array('for="127.0.0.1";host="localhost";proto=http'));
|
||||||
|
$expectedSubRequest->server->set('HTTP_FORWARDED', 'for="127.0.0.1";host="localhost";proto=http');
|
||||||
|
|
||||||
|
$strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest($expectedSubRequest));
|
||||||
|
|
||||||
|
$request = Request::create('/');
|
||||||
|
$request->attributes->set('_format', 'foo');
|
||||||
|
$request->setLocale('fr');
|
||||||
|
$strategy->render('/', $request);
|
||||||
|
}
|
||||||
|
|
||||||
public function testESIHeaderIsKeptInSubrequest()
|
public function testESIHeaderIsKeptInSubrequest()
|
||||||
{
|
{
|
||||||
$expectedSubRequest = Request::create('/');
|
$expectedSubRequest = Request::create('/');
|
||||||
|
@ -91,6 +91,13 @@ class HttpUtils
|
|||||||
$newRequest->attributes->set(Security::LAST_USERNAME, $request->attributes->get(Security::LAST_USERNAME));
|
$newRequest->attributes->set(Security::LAST_USERNAME, $request->attributes->get(Security::LAST_USERNAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->get('_format')) {
|
||||||
|
$newRequest->attributes->set('_format', $request->get('_format'));
|
||||||
|
}
|
||||||
|
if ($request->getDefaultLocale() !== $request->getLocale()) {
|
||||||
|
$newRequest->setLocale($request->getLocale());
|
||||||
|
}
|
||||||
|
|
||||||
return $newRequest;
|
return $newRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Validator;
|
namespace Symfony\Component\Validator;
|
||||||
|
|
||||||
|
use Symfony\Component\Validator\Constraints\GroupSequence;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the interface for a group sequence provider.
|
* Defines the interface for a group sequence provider.
|
||||||
*/
|
*/
|
||||||
@ -20,7 +22,7 @@ interface GroupSequenceProviderInterface
|
|||||||
* Returns which validation groups should be used for a certain state
|
* Returns which validation groups should be used for a certain state
|
||||||
* of the object.
|
* of the object.
|
||||||
*
|
*
|
||||||
* @return array An array of validation groups
|
* @return string[]|GroupSequence An array of validation groups
|
||||||
*/
|
*/
|
||||||
public function getGroupSequence();
|
public function getGroupSequence();
|
||||||
}
|
}
|
||||||
|
@ -397,7 +397,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
|
|||||||
/**
|
/**
|
||||||
* Sets the default group sequence for this class.
|
* Sets the default group sequence for this class.
|
||||||
*
|
*
|
||||||
* @param array $groupSequence An array of group names
|
* @param string[]|GroupSequence $groupSequence An array of group names
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*
|
*
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Component\Validator\Validator;
|
namespace Symfony\Component\Validator\Validator;
|
||||||
|
|
||||||
use Symfony\Component\Validator\Constraint;
|
use Symfony\Component\Validator\Constraint;
|
||||||
|
use Symfony\Component\Validator\Constraints\GroupSequence;
|
||||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,12 +40,9 @@ interface ContextualValidatorInterface
|
|||||||
* If no constraint is passed, the constraint
|
* If no constraint is passed, the constraint
|
||||||
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
|
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
|
||||||
*
|
*
|
||||||
* @param mixed $value The value to validate
|
* @param mixed $value The value to validate
|
||||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate
|
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
|
||||||
* against
|
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||||
* @param array|null $groups The validation groups to
|
|
||||||
* validate. If none is given,
|
|
||||||
* "Default" is assumed
|
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
@ -54,10 +52,9 @@ interface ContextualValidatorInterface
|
|||||||
* Validates a property of an object against the constraints specified
|
* Validates a property of an object against the constraints specified
|
||||||
* for this property.
|
* for this property.
|
||||||
*
|
*
|
||||||
* @param object $object The object
|
* @param object $object The object
|
||||||
* @param string $propertyName The name of the validated property
|
* @param string $propertyName The name of the validated property
|
||||||
* @param array|null $groups The validation groups to validate. If
|
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||||
* none is given, "Default" is assumed
|
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
@ -67,12 +64,10 @@ interface ContextualValidatorInterface
|
|||||||
* Validates a value against the constraints specified for an object's
|
* Validates a value against the constraints specified for an object's
|
||||||
* property.
|
* property.
|
||||||
*
|
*
|
||||||
* @param object|string $objectOrClass The object or its class name
|
* @param object|string $objectOrClass The object or its class name
|
||||||
* @param string $propertyName The name of the property
|
* @param string $propertyName The name of the property
|
||||||
* @param mixed $value The value to validate against the
|
* @param mixed $value The value to validate against the property's constraints
|
||||||
* property's constraints
|
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||||
* @param array|null $groups The validation groups to validate. If
|
|
||||||
* none is given, "Default" is assumed
|
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
|
@ -272,9 +272,9 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
/**
|
/**
|
||||||
* Normalizes the given group or list of groups to an array.
|
* Normalizes the given group or list of groups to an array.
|
||||||
*
|
*
|
||||||
* @param mixed $groups The groups to normalize
|
* @param string|GroupSequence|(string|GroupSequence)[] $groups The groups to normalize
|
||||||
*
|
*
|
||||||
* @return array A group array
|
* @return (string|GroupSequence)[] A group array
|
||||||
*/
|
*/
|
||||||
protected function normalizeGroups($groups)
|
protected function normalizeGroups($groups)
|
||||||
{
|
{
|
||||||
@ -295,7 +295,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
*
|
*
|
||||||
* @param object $object The object to cascade
|
* @param object $object The object to cascade
|
||||||
* @param string $propertyPath The current property path
|
* @param string $propertyPath The current property path
|
||||||
* @param string[] $groups The validated groups
|
* @param (string|GroupSequence)[] $groups The validated groups
|
||||||
* @param int $traversalStrategy The strategy for traversing the
|
* @param int $traversalStrategy The strategy for traversing the
|
||||||
* cascaded object
|
* cascaded object
|
||||||
* @param ExecutionContextInterface $context The current execution context
|
* @param ExecutionContextInterface $context The current execution context
|
||||||
@ -355,10 +355,10 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
* objects are iterated as well. Nested arrays are always iterated,
|
* objects are iterated as well. Nested arrays are always iterated,
|
||||||
* regardless of the value of $recursive.
|
* regardless of the value of $recursive.
|
||||||
*
|
*
|
||||||
* @param iterable $collection The collection
|
* @param iterable $collection The collection
|
||||||
* @param string $propertyPath The current property path
|
* @param string $propertyPath The current property path
|
||||||
* @param string[] $groups The validated groups
|
* @param (string|GroupSequence)[] $groups The validated groups
|
||||||
* @param ExecutionContextInterface $context The current execution context
|
* @param ExecutionContextInterface $context The current execution context
|
||||||
*
|
*
|
||||||
* @see ClassNode
|
* @see ClassNode
|
||||||
* @see CollectionNode
|
* @see CollectionNode
|
||||||
@ -424,7 +424,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
* the object
|
* the object
|
||||||
* @param string $propertyPath The property path leading
|
* @param string $propertyPath The property path leading
|
||||||
* to the object
|
* to the object
|
||||||
* @param string[] $groups The groups in which the
|
* @param (string|GroupSequence)[] $groups The groups in which the
|
||||||
* object should be validated
|
* object should be validated
|
||||||
* @param string[]|null $cascadedGroups The groups in which
|
* @param string[]|null $cascadedGroups The groups in which
|
||||||
* cascaded objects should
|
* cascaded objects should
|
||||||
@ -608,7 +608,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
|||||||
* value
|
* value
|
||||||
* @param string $propertyPath The property path leading
|
* @param string $propertyPath The property path leading
|
||||||
* to the value
|
* to the value
|
||||||
* @param string[] $groups The groups in which the
|
* @param (string|GroupSequence)[] $groups The groups in which the
|
||||||
* value should be validated
|
* value should be validated
|
||||||
* @param string[]|null $cascadedGroups The groups in which
|
* @param string[]|null $cascadedGroups The groups in which
|
||||||
* cascaded objects should
|
* cascaded objects should
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Component\Validator\Validator;
|
namespace Symfony\Component\Validator\Validator;
|
||||||
|
|
||||||
use Symfony\Component\Validator\Constraint;
|
use Symfony\Component\Validator\Constraint;
|
||||||
|
use Symfony\Component\Validator\Constraints\GroupSequence;
|
||||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
|
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
|
||||||
@ -29,12 +30,9 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
|||||||
* If no constraint is passed, the constraint
|
* If no constraint is passed, the constraint
|
||||||
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
|
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
|
||||||
*
|
*
|
||||||
* @param mixed $value The value to validate
|
* @param mixed $value The value to validate
|
||||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate
|
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
|
||||||
* against
|
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||||
* @param array|null $groups The validation groups to
|
|
||||||
* validate. If none is given,
|
|
||||||
* "Default" is assumed
|
|
||||||
*
|
*
|
||||||
* @return ConstraintViolationListInterface A list of constraint violations
|
* @return ConstraintViolationListInterface A list of constraint violations
|
||||||
* If the list is empty, validation
|
* If the list is empty, validation
|
||||||
@ -46,10 +44,9 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
|||||||
* Validates a property of an object against the constraints specified
|
* Validates a property of an object against the constraints specified
|
||||||
* for this property.
|
* for this property.
|
||||||
*
|
*
|
||||||
* @param object $object The object
|
* @param object $object The object
|
||||||
* @param string $propertyName The name of the validated property
|
* @param string $propertyName The name of the validated property
|
||||||
* @param array|null $groups The validation groups to validate. If
|
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||||
* none is given, "Default" is assumed
|
|
||||||
*
|
*
|
||||||
* @return ConstraintViolationListInterface A list of constraint violations
|
* @return ConstraintViolationListInterface A list of constraint violations
|
||||||
* If the list is empty, validation
|
* If the list is empty, validation
|
||||||
@ -61,12 +58,10 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
|||||||
* Validates a value against the constraints specified for an object's
|
* Validates a value against the constraints specified for an object's
|
||||||
* property.
|
* property.
|
||||||
*
|
*
|
||||||
* @param object|string $objectOrClass The object or its class name
|
* @param object|string $objectOrClass The object or its class name
|
||||||
* @param string $propertyName The name of the property
|
* @param string $propertyName The name of the property
|
||||||
* @param mixed $value The value to validate against the
|
* @param mixed $value The value to validate against the property's constraints
|
||||||
* property's constraints
|
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||||
* @param array|null $groups The validation groups to validate. If
|
|
||||||
* none is given, "Default" is assumed
|
|
||||||
*
|
*
|
||||||
* @return ConstraintViolationListInterface A list of constraint violations
|
* @return ConstraintViolationListInterface A list of constraint violations
|
||||||
* If the list is empty, validation
|
* If the list is empty, validation
|
||||||
|
Reference in New Issue
Block a user