Merge branch '2.8' into 3.1
* 2.8: fixed @return when returning this or static override property constraints in child class removed unneeded comment [Console] improved code coverage of Command class [FrameworkBundle] Make TemplateController working without the Templating component Only count on arrays or countables to avoid warnings in PHP 7.2
This commit is contained in:
commit
4c453f617d
@ -42,7 +42,7 @@ class Scope
|
||||
/**
|
||||
* Opens a new child scope.
|
||||
*
|
||||
* @return Scope
|
||||
* @return self
|
||||
*/
|
||||
public function enter()
|
||||
{
|
||||
@ -52,7 +52,7 @@ class Scope
|
||||
/**
|
||||
* Closes current scope and returns parent one.
|
||||
*
|
||||
* @return Scope|null
|
||||
* @return self|null
|
||||
*/
|
||||
public function leave()
|
||||
{
|
||||
@ -67,7 +67,7 @@ class Scope
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return Scope Current scope
|
||||
* @return $this
|
||||
*
|
||||
* @throws \LogicException
|
||||
*/
|
||||
|
@ -36,8 +36,13 @@ class TemplateController implements ContainerAwareInterface
|
||||
*/
|
||||
public function templateAction($template, $maxAge = null, $sharedAge = null, $private = null)
|
||||
{
|
||||
/** @var $response \Symfony\Component\HttpFoundation\Response */
|
||||
$response = $this->container->get('templating')->renderResponse($template);
|
||||
if ($this->container->has('templating')) {
|
||||
$response = $this->container->get('templating')->renderResponse($template);
|
||||
} elseif ($this->container->has('twig')) {
|
||||
$response = new Response($this->container->get('twig')->render($template));
|
||||
} else {
|
||||
throw new \LogicException('You can not use the TemplateController if the Templating Component or the Twig Bundle are not available.');
|
||||
}
|
||||
|
||||
if ($maxAge) {
|
||||
$response->setMaxAge($maxAge);
|
||||
|
@ -0,0 +1,69 @@
|
||||
<?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\Bundle\FrameworkBundle\Tests\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\TemplateController;
|
||||
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class TemplateControllerTest extends TestCase
|
||||
{
|
||||
public function testTwig()
|
||||
{
|
||||
$twig = $this->getMockBuilder('\Twig_Environment')->disableOriginalConstructor()->getMock();
|
||||
$twig->expects($this->once())->method('render')->willReturn('bar');
|
||||
|
||||
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
|
||||
$container->expects($this->at(0))->method('has')->will($this->returnValue(false));
|
||||
$container->expects($this->at(1))->method('has')->will($this->returnValue(true));
|
||||
$container->expects($this->at(2))->method('get')->will($this->returnValue($twig));
|
||||
|
||||
$controller = new TemplateController();
|
||||
$controller->setContainer($container);
|
||||
|
||||
$this->assertEquals('bar', $controller->templateAction('mytemplate')->getContent());
|
||||
}
|
||||
|
||||
public function testTemplating()
|
||||
{
|
||||
$templating = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface')->getMock();
|
||||
$templating->expects($this->once())->method('renderResponse')->willReturn(new Response('bar'));
|
||||
|
||||
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
|
||||
$container->expects($this->at(0))->method('has')->willReturn(true);
|
||||
$container->expects($this->at(1))->method('get')->will($this->returnValue($templating));
|
||||
|
||||
$controller = new TemplateController();
|
||||
$controller->setContainer($container);
|
||||
|
||||
$this->assertEquals('bar', $controller->templateAction('mytemplate')->getContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \LogicException
|
||||
* @expectedExceptionMessage You can not use the TemplateController if the Templating Component or the Twig Bundle are not available.
|
||||
*/
|
||||
public function testNoTwigNorTemplating()
|
||||
{
|
||||
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
|
||||
$container->expects($this->at(0))->method('has')->willReturn(false);
|
||||
$container->expects($this->at(1))->method('has')->willReturn(false);
|
||||
|
||||
$controller = new TemplateController();
|
||||
$controller->setContainer($container);
|
||||
|
||||
$controller->templateAction('mytemplate')->getContent();
|
||||
}
|
||||
}
|
@ -121,7 +121,7 @@ class Cookie
|
||||
* @param string $cookie A Set-Cookie header value
|
||||
* @param string $url The base URL
|
||||
*
|
||||
* @return Cookie A Cookie instance
|
||||
* @return static
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
|
@ -86,7 +86,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
* If this function has been called and the node is not set during the finalization
|
||||
* phase, it's default value will be derived from its children default values.
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function addDefaultsIfNotSet()
|
||||
{
|
||||
@ -102,7 +102,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* This method is applicable to prototype nodes only.
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function addDefaultChildrenIfNoneSet($children = null)
|
||||
{
|
||||
@ -116,7 +116,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* This method is applicable to prototype nodes only.
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function requiresAtLeastOneElement()
|
||||
{
|
||||
@ -130,7 +130,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* If used all keys have to be defined in the same configuration file.
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function disallowNewKeysInSubsequentConfigs()
|
||||
{
|
||||
@ -145,7 +145,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
* @param string $singular The key to remap
|
||||
* @param string $plural The plural of the key for irregular plurals
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function fixXmlConfig($singular, $plural = null)
|
||||
{
|
||||
@ -180,7 +180,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
* @param string $name The name of the key
|
||||
* @param bool $removeKeyItem Whether or not the key item should be removed
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function useAttributeAsKey($name, $removeKeyItem = true)
|
||||
{
|
||||
@ -195,7 +195,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* @param bool $allow
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function canBeUnset($allow = true)
|
||||
{
|
||||
@ -217,7 +217,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
* enableableArrayNode: {enabled: false, ...} # The config is disabled
|
||||
* enableableArrayNode: false # The config is disabled
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function canBeEnabled()
|
||||
{
|
||||
@ -247,7 +247,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* By default, the section is enabled.
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function canBeDisabled()
|
||||
{
|
||||
@ -267,7 +267,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
/**
|
||||
* Disables the deep merging of the node.
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function performNoDeepMerging()
|
||||
{
|
||||
@ -287,7 +287,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* @param bool $remove Whether to remove the extra keys
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function ignoreExtraKeys($remove = true)
|
||||
{
|
||||
@ -302,7 +302,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* @param bool $bool Whether to enable key normalization
|
||||
*
|
||||
* @return ArrayNodeDefinition
|
||||
* @return $this
|
||||
*/
|
||||
public function normalizeKeys($bool)
|
||||
{
|
||||
@ -324,7 +324,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
||||
*
|
||||
* @param NodeDefinition $node A NodeDefinition instance
|
||||
*
|
||||
* @return ArrayNodeDefinition This node
|
||||
* @return $this
|
||||
*/
|
||||
public function append(NodeDefinition $node)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@ class EnumNodeDefinition extends ScalarNodeDefinition
|
||||
/**
|
||||
* @param array $values
|
||||
*
|
||||
* @return EnumNodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function values(array $values)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ class ExprBuilder
|
||||
*
|
||||
* @param \Closure $then
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function always(\Closure $then = null)
|
||||
{
|
||||
@ -60,7 +60,7 @@ class ExprBuilder
|
||||
*
|
||||
* @param \Closure $closure
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function ifTrue(\Closure $closure = null)
|
||||
{
|
||||
@ -76,7 +76,7 @@ class ExprBuilder
|
||||
/**
|
||||
* Tests if the value is a string.
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function ifString()
|
||||
{
|
||||
@ -88,7 +88,7 @@ class ExprBuilder
|
||||
/**
|
||||
* Tests if the value is null.
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function ifNull()
|
||||
{
|
||||
@ -100,7 +100,7 @@ class ExprBuilder
|
||||
/**
|
||||
* Tests if the value is an array.
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function ifArray()
|
||||
{
|
||||
@ -114,7 +114,7 @@ class ExprBuilder
|
||||
*
|
||||
* @param array $array
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function ifInArray(array $array)
|
||||
{
|
||||
@ -128,7 +128,7 @@ class ExprBuilder
|
||||
*
|
||||
* @param array $array
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function ifNotInArray(array $array)
|
||||
{
|
||||
@ -142,7 +142,7 @@ class ExprBuilder
|
||||
*
|
||||
* @param \Closure $closure
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function then(\Closure $closure)
|
||||
{
|
||||
@ -154,7 +154,7 @@ class ExprBuilder
|
||||
/**
|
||||
* Sets a closure returning an empty array.
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function thenEmptyArray()
|
||||
{
|
||||
@ -170,7 +170,7 @@ class ExprBuilder
|
||||
*
|
||||
* @param string $message
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
@ -184,7 +184,7 @@ class ExprBuilder
|
||||
/**
|
||||
* Sets a closure unsetting this key of the array at validation time.
|
||||
*
|
||||
* @return ExprBuilder
|
||||
* @return $this
|
||||
*
|
||||
* @throws UnsetKeyException
|
||||
*/
|
||||
|
@ -37,7 +37,7 @@ class MergeBuilder
|
||||
*
|
||||
* @param bool $allow
|
||||
*
|
||||
* @return MergeBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function allowUnset($allow = true)
|
||||
{
|
||||
@ -51,7 +51,7 @@ class MergeBuilder
|
||||
*
|
||||
* @param bool $deny Whether the overwriting is forbidden or not
|
||||
*
|
||||
* @return MergeBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function denyOverwrite($deny = true)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ class NodeBuilder implements NodeParentInterface
|
||||
*
|
||||
* @param ParentNodeDefinitionInterface $parent The parent node
|
||||
*
|
||||
* @return NodeBuilder This node builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setParent(ParentNodeDefinitionInterface $parent = null)
|
||||
{
|
||||
@ -182,7 +182,7 @@ class NodeBuilder implements NodeParentInterface
|
||||
*
|
||||
* @param NodeDefinition $node
|
||||
*
|
||||
* @return NodeBuilder This node builder
|
||||
* @return $this
|
||||
*/
|
||||
public function append(NodeDefinition $node)
|
||||
{
|
||||
@ -207,7 +207,7 @@ class NodeBuilder implements NodeParentInterface
|
||||
* @param string $type The name of the type
|
||||
* @param string $class The fully qualified name the node definition class
|
||||
*
|
||||
* @return NodeBuilder This node builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setNodeClass($type, $class)
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param NodeParentInterface $parent The parent
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function setParent(NodeParentInterface $parent)
|
||||
{
|
||||
@ -70,7 +70,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param string $info The info text
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function info($info)
|
||||
{
|
||||
@ -82,7 +82,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param string|array $example
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function example($example)
|
||||
{
|
||||
@ -95,7 +95,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function attribute($key, $value)
|
||||
{
|
||||
@ -146,7 +146,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param mixed $value The default value
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function defaultValue($value)
|
||||
{
|
||||
@ -159,7 +159,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
/**
|
||||
* Sets the node as required.
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function isRequired()
|
||||
{
|
||||
@ -173,7 +173,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function treatNullLike($value)
|
||||
{
|
||||
@ -187,7 +187,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function treatTrueLike($value)
|
||||
{
|
||||
@ -201,7 +201,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function treatFalseLike($value)
|
||||
{
|
||||
@ -213,7 +213,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
/**
|
||||
* Sets null as the default value.
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function defaultNull()
|
||||
{
|
||||
@ -223,7 +223,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
/**
|
||||
* Sets true as the default value.
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function defaultTrue()
|
||||
{
|
||||
@ -233,7 +233,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
/**
|
||||
* Sets false as the default value.
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function defaultFalse()
|
||||
{
|
||||
@ -253,7 +253,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
/**
|
||||
* Denies the node value being empty.
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function cannotBeEmpty()
|
||||
{
|
||||
@ -281,7 +281,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
*
|
||||
* @param bool $deny Whether the overwriting is forbidden or not
|
||||
*
|
||||
* @return NodeDefinition|$this
|
||||
* @return $this
|
||||
*/
|
||||
public function cannotBeOverwritten($deny = true)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ class NormalizationBuilder
|
||||
* @param string $key The key to remap
|
||||
* @param string $plural The plural of the key in case of irregular plural
|
||||
*
|
||||
* @return NormalizationBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function remap($key, $plural = null)
|
||||
{
|
||||
@ -52,7 +52,7 @@ class NormalizationBuilder
|
||||
*
|
||||
* @param \Closure $closure
|
||||
*
|
||||
* @return ExprBuilder|NormalizationBuilder
|
||||
* @return ExprBuilder|$this
|
||||
*/
|
||||
public function before(\Closure $closure = null)
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ abstract class NumericNodeDefinition extends ScalarNodeDefinition
|
||||
*
|
||||
* @param mixed $max
|
||||
*
|
||||
* @return NumericNodeDefinition
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException when the constraint is inconsistent
|
||||
*/
|
||||
@ -47,7 +47,7 @@ abstract class NumericNodeDefinition extends ScalarNodeDefinition
|
||||
*
|
||||
* @param mixed $min
|
||||
*
|
||||
* @return NumericNodeDefinition
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException when the constraint is inconsistent
|
||||
*/
|
||||
|
@ -57,7 +57,7 @@ abstract class Loader implements LoaderInterface
|
||||
* @param mixed $resource A resource
|
||||
* @param string|null $type The resource type or null if unknown
|
||||
*
|
||||
* @return LoaderInterface A LoaderInterface instance
|
||||
* @return $this|LoaderInterface
|
||||
*
|
||||
* @throws FileLoaderLoadException If no loader is found
|
||||
*/
|
||||
|
@ -746,7 +746,7 @@ class Application
|
||||
* @param int $width The width
|
||||
* @param int $height The height
|
||||
*
|
||||
* @return Application The current application
|
||||
* @return $this
|
||||
*/
|
||||
public function setTerminalDimensions($width, $height)
|
||||
{
|
||||
|
@ -265,7 +265,7 @@ class Command
|
||||
*
|
||||
* @param callable $code A callable(InputInterface $input, OutputInterface $output)
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
@ -325,7 +325,7 @@ class Command
|
||||
*
|
||||
* @param array|InputDefinition $definition An array of argument and option instances or a definition instance
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefinition($definition)
|
||||
{
|
||||
@ -373,7 +373,7 @@ class Command
|
||||
* @param string $description A description text
|
||||
* @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addArgument($name, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
@ -391,7 +391,7 @@ class Command
|
||||
* @param string $description A description text
|
||||
* @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
|
||||
{
|
||||
@ -410,7 +410,7 @@ class Command
|
||||
*
|
||||
* @param string $name The command name
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException When the name is invalid
|
||||
*/
|
||||
@ -433,7 +433,7 @@ class Command
|
||||
*
|
||||
* @param string $title The process title
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setProcessTitle($title)
|
||||
{
|
||||
@ -457,7 +457,7 @@ class Command
|
||||
*
|
||||
* @param string $description The description for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
@ -481,7 +481,7 @@ class Command
|
||||
*
|
||||
* @param string $help The help for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setHelp($help)
|
||||
{
|
||||
@ -527,7 +527,7 @@ class Command
|
||||
*
|
||||
* @param string[] $aliases An array of aliases for the command
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException When an alias is invalid
|
||||
*/
|
||||
@ -579,7 +579,7 @@ class Command
|
||||
*
|
||||
* @param string $usage The usage, it'll be prefixed with the command name
|
||||
*
|
||||
* @return Command The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addUsage($usage)
|
||||
{
|
||||
|
@ -208,7 +208,7 @@ class OutputFormatter implements OutputFormatterInterface
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return OutputFormatterStyle|bool false if string is not format string
|
||||
* @return OutputFormatterStyle|false false if string is not format string
|
||||
*/
|
||||
private function createStyleFromString($string)
|
||||
{
|
||||
|
@ -104,7 +104,7 @@ class OutputFormatterStyleStack
|
||||
/**
|
||||
* @param OutputFormatterStyleInterface $emptyStyle
|
||||
*
|
||||
* @return OutputFormatterStyleStack
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle)
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ class DescriptorHelper extends Helper
|
||||
* @param string $format
|
||||
* @param DescriptorInterface $descriptor
|
||||
*
|
||||
* @return DescriptorHelper
|
||||
* @return $this
|
||||
*/
|
||||
public function register($format, DescriptorInterface $descriptor)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ abstract class Helper implements HelperInterface
|
||||
/**
|
||||
* Gets the helper set associated with this helper.
|
||||
*
|
||||
* @return HelperSet A HelperSet instance
|
||||
* @return HelperSet|null
|
||||
*/
|
||||
public function getHelperSet()
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ class Table
|
||||
*
|
||||
* @param string $name The style name
|
||||
*
|
||||
* @return TableStyle A TableStyle instance
|
||||
* @return TableStyle
|
||||
*/
|
||||
public static function getStyleDefinition($name)
|
||||
{
|
||||
@ -127,7 +127,7 @@ class Table
|
||||
*
|
||||
* @param TableStyle|string $name The style name or a TableStyle instance
|
||||
*
|
||||
* @return Table
|
||||
* @return $this
|
||||
*/
|
||||
public function setStyle($name)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $paddingChar
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaddingChar($paddingChar)
|
||||
{
|
||||
@ -65,7 +65,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $horizontalBorderChar
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setHorizontalBorderChar($horizontalBorderChar)
|
||||
{
|
||||
@ -89,7 +89,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $verticalBorderChar
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setVerticalBorderChar($verticalBorderChar)
|
||||
{
|
||||
@ -113,7 +113,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $crossingChar
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setCrossingChar($crossingChar)
|
||||
{
|
||||
@ -137,7 +137,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $cellHeaderFormat
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setCellHeaderFormat($cellHeaderFormat)
|
||||
{
|
||||
@ -161,7 +161,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $cellRowFormat
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setCellRowFormat($cellRowFormat)
|
||||
{
|
||||
@ -185,7 +185,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $cellRowContentFormat
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setCellRowContentFormat($cellRowContentFormat)
|
||||
{
|
||||
@ -209,7 +209,7 @@ class TableStyle
|
||||
*
|
||||
* @param string $borderFormat
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setBorderFormat($borderFormat)
|
||||
{
|
||||
@ -233,7 +233,7 @@ class TableStyle
|
||||
*
|
||||
* @param int $padType STR_PAD_*
|
||||
*
|
||||
* @return TableStyle
|
||||
* @return $this
|
||||
*/
|
||||
public function setPadType($padType)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ class ChoiceQuestion extends Question
|
||||
*
|
||||
* @param bool $multiselect
|
||||
*
|
||||
* @return ChoiceQuestion The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setMultiselect($multiselect)
|
||||
{
|
||||
@ -93,7 +93,7 @@ class ChoiceQuestion extends Question
|
||||
*
|
||||
* @param string $prompt
|
||||
*
|
||||
* @return ChoiceQuestion The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrompt($prompt)
|
||||
{
|
||||
@ -109,7 +109,7 @@ class ChoiceQuestion extends Question
|
||||
*
|
||||
* @param string $errorMessage
|
||||
*
|
||||
* @return ChoiceQuestion The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setErrorMessage($errorMessage)
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ class Question
|
||||
*
|
||||
* @param bool $hidden
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws LogicException In case the autocompleter is also used
|
||||
*/
|
||||
@ -107,7 +107,7 @@ class Question
|
||||
*
|
||||
* @param bool $fallback
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setHiddenFallback($fallback)
|
||||
{
|
||||
@ -131,7 +131,7 @@ class Question
|
||||
*
|
||||
* @param null|array|\Traversable $values
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @throws LogicException
|
||||
@ -162,7 +162,7 @@ class Question
|
||||
*
|
||||
* @param null|callable $validator
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setValidator(callable $validator = null)
|
||||
{
|
||||
@ -188,7 +188,7 @@ class Question
|
||||
*
|
||||
* @param null|int $attempts
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException In case the number of attempts is invalid.
|
||||
*/
|
||||
@ -222,7 +222,7 @@ class Question
|
||||
*
|
||||
* @param callable $normalizer
|
||||
*
|
||||
* @return Question The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setNormalizer(callable $normalizer)
|
||||
{
|
||||
|
@ -54,6 +54,14 @@ class CommandTest extends \PHPUnit_Framework_TestCase
|
||||
$command = new \TestCommand();
|
||||
$command->setApplication($application);
|
||||
$this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application');
|
||||
$this->assertEquals($application->getHelperSet(), $command->getHelperSet());
|
||||
}
|
||||
|
||||
public function testSetApplicationNull()
|
||||
{
|
||||
$command = new \TestCommand();
|
||||
$command->setApplication(null);
|
||||
$this->assertNull($command->getHelperSet());
|
||||
}
|
||||
|
||||
public function testSetGetDefinition()
|
||||
@ -156,6 +164,13 @@ class CommandTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases');
|
||||
}
|
||||
|
||||
public function testSetAliasesNull()
|
||||
{
|
||||
$command = new \TestCommand();
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
$command->setAliases(null);
|
||||
}
|
||||
|
||||
public function testGetSynopsis()
|
||||
{
|
||||
$command = new \TestCommand();
|
||||
@ -164,6 +179,15 @@ class CommandTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('namespace:name [--foo] [--] [<bar>]', $command->getSynopsis(), '->getSynopsis() returns the synopsis');
|
||||
}
|
||||
|
||||
public function testAddGetUsages()
|
||||
{
|
||||
$command = new \TestCommand();
|
||||
$command->addUsage('foo1');
|
||||
$command->addUsage('foo2');
|
||||
$this->assertContains('namespace:name foo1', $command->getUsages());
|
||||
$this->assertContains('namespace:name foo2', $command->getUsages());
|
||||
}
|
||||
|
||||
public function testGetHelper()
|
||||
{
|
||||
$application = new Application();
|
||||
@ -275,8 +299,8 @@ class CommandTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$command = $this->getMockBuilder('TestCommand')->setMethods(array('execute'))->getMock();
|
||||
$command->expects($this->once())
|
||||
->method('execute')
|
||||
->will($this->returnValue('2.3'));
|
||||
->method('execute')
|
||||
->will($this->returnValue('2.3'));
|
||||
$exitCode = $command->run(new StringInput(''), new NullOutput());
|
||||
$this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)');
|
||||
}
|
||||
@ -297,6 +321,17 @@ class CommandTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
|
||||
}
|
||||
|
||||
public function testRunWithProcessTitle()
|
||||
{
|
||||
$command = new \TestCommand();
|
||||
$command->setApplication(new Application());
|
||||
$command->setProcessTitle('foo');
|
||||
$this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
|
||||
if (function_exists('cli_set_process_title')) {
|
||||
$this->assertEquals('foo', cli_get_process_title());
|
||||
}
|
||||
}
|
||||
|
||||
public function testSetCode()
|
||||
{
|
||||
$command = new \TestCommand();
|
||||
|
@ -27,7 +27,7 @@ class SyntaxErrorException extends ParseException
|
||||
* @param string $expectedValue
|
||||
* @param Token $foundToken
|
||||
*
|
||||
* @return SyntaxErrorException
|
||||
* @return self
|
||||
*/
|
||||
public static function unexpectedToken($expectedValue, Token $foundToken)
|
||||
{
|
||||
@ -38,7 +38,7 @@ class SyntaxErrorException extends ParseException
|
||||
* @param string $pseudoElement
|
||||
* @param string $unexpectedLocation
|
||||
*
|
||||
* @return SyntaxErrorException
|
||||
* @return self
|
||||
*/
|
||||
public static function pseudoElementFound($pseudoElement, $unexpectedLocation)
|
||||
{
|
||||
@ -48,7 +48,7 @@ class SyntaxErrorException extends ParseException
|
||||
/**
|
||||
* @param int $position
|
||||
*
|
||||
* @return SyntaxErrorException
|
||||
* @return self
|
||||
*/
|
||||
public static function unclosedString($position)
|
||||
{
|
||||
@ -56,7 +56,7 @@ class SyntaxErrorException extends ParseException
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SyntaxErrorException
|
||||
* @return self
|
||||
*/
|
||||
public static function nestedNot()
|
||||
{
|
||||
@ -64,7 +64,7 @@ class SyntaxErrorException extends ParseException
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SyntaxErrorException
|
||||
* @return self
|
||||
*/
|
||||
public static function stringAsFunctionArgument()
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ class Specificity
|
||||
/**
|
||||
* @param Specificity $specificity
|
||||
*
|
||||
* @return Specificity
|
||||
* @return self
|
||||
*/
|
||||
public function plus(Specificity $specificity)
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ class TokenStream
|
||||
*
|
||||
* @param Token $token
|
||||
*
|
||||
* @return TokenStream
|
||||
* @return $this
|
||||
*/
|
||||
public function push(Token $token)
|
||||
{
|
||||
@ -73,7 +73,7 @@ class TokenStream
|
||||
/**
|
||||
* Freezes stream.
|
||||
*
|
||||
* @return TokenStream
|
||||
* @return $this
|
||||
*/
|
||||
public function freeze()
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ class NodeExtension extends AbstractExtension
|
||||
* @param int $flag
|
||||
* @param bool $on
|
||||
*
|
||||
* @return NodeExtension
|
||||
* @return $this
|
||||
*/
|
||||
public function setFlag($flag, $on)
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ class Translator implements TranslatorInterface
|
||||
*
|
||||
* @param Extension\ExtensionInterface $extension
|
||||
*
|
||||
* @return Translator
|
||||
* @return $this
|
||||
*/
|
||||
public function registerExtension(Extension\ExtensionInterface $extension)
|
||||
{
|
||||
@ -182,7 +182,7 @@ class Translator implements TranslatorInterface
|
||||
*
|
||||
* @param ParserInterface $shortcut
|
||||
*
|
||||
* @return Translator
|
||||
* @return $this
|
||||
*/
|
||||
public function registerParserShortcut(ParserInterface $shortcut)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ class XPathExpr
|
||||
/**
|
||||
* @param $condition
|
||||
*
|
||||
* @return XPathExpr
|
||||
* @return $this
|
||||
*/
|
||||
public function addCondition($condition)
|
||||
{
|
||||
@ -84,7 +84,7 @@ class XPathExpr
|
||||
}
|
||||
|
||||
/**
|
||||
* @return XPathExpr
|
||||
* @return $this
|
||||
*/
|
||||
public function addNameTest()
|
||||
{
|
||||
@ -97,7 +97,7 @@ class XPathExpr
|
||||
}
|
||||
|
||||
/**
|
||||
* @return XPathExpr
|
||||
* @return $this
|
||||
*/
|
||||
public function addStarPrefix()
|
||||
{
|
||||
@ -112,7 +112,7 @@ class XPathExpr
|
||||
* @param string $combiner
|
||||
* @param XPathExpr $expr
|
||||
*
|
||||
* @return XPathExpr
|
||||
* @return $this
|
||||
*/
|
||||
public function join($combiner, XPathExpr $expr)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ class ExceptionHandler
|
||||
* @param string|null $charset The charset used by exception messages
|
||||
* @param string|null $fileLinkFormat The IDE link template
|
||||
*
|
||||
* @return ExceptionHandler The registered exception handler
|
||||
* @return static
|
||||
*/
|
||||
public static function register($debug = true, $charset = null, $fileLinkFormat = null)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ class ServiceReferenceGraph
|
||||
*
|
||||
* @param string $id The id to retrieve
|
||||
*
|
||||
* @return ServiceReferenceGraphNode The node matching the supplied identifier
|
||||
* @return ServiceReferenceGraphNode
|
||||
*
|
||||
* @throws InvalidArgumentException if no node matches the supplied identifier
|
||||
*/
|
||||
@ -61,7 +61,7 @@ class ServiceReferenceGraph
|
||||
/**
|
||||
* Returns all nodes.
|
||||
*
|
||||
* @return ServiceReferenceGraphNode[] An array of all ServiceReferenceGraphNode objects
|
||||
* @return ServiceReferenceGraphNode[]
|
||||
*/
|
||||
public function getNodes()
|
||||
{
|
||||
|
@ -195,7 +195,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*
|
||||
* @param ResourceInterface $resource A resource instance
|
||||
*
|
||||
* @return ContainerBuilder The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addResource(ResourceInterface $resource)
|
||||
{
|
||||
@ -213,7 +213,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*
|
||||
* @param ResourceInterface[] $resources An array of resources
|
||||
*
|
||||
* @return ContainerBuilder The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setResources(array $resources)
|
||||
{
|
||||
@ -231,7 +231,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*
|
||||
* @param object $object An object instance
|
||||
*
|
||||
* @return ContainerBuilder The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addObjectResource($object)
|
||||
{
|
||||
@ -247,7 +247,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*
|
||||
* @param \ReflectionClass $class
|
||||
*
|
||||
* @return ContainerBuilder The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addClassResource(\ReflectionClass $class)
|
||||
{
|
||||
@ -270,7 +270,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* @param string $extension The extension alias or namespace
|
||||
* @param array $values An array of values that customizes the extension
|
||||
*
|
||||
* @return ContainerBuilder The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws BadMethodCallException When this ContainerBuilder is frozen
|
||||
* @throws \LogicException if the container is frozen
|
||||
@ -294,7 +294,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
* @param CompilerPassInterface $pass A compiler pass
|
||||
* @param string $type The type of compiler pass
|
||||
*
|
||||
* @return ContainerBuilder The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ class Definition
|
||||
*
|
||||
* @param string|array $factory A PHP function or an array containing a class/Reference and a method to call
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setFactory($factory)
|
||||
{
|
||||
@ -86,7 +86,7 @@ class Definition
|
||||
* @param null|string $renamedId The new decorated service id
|
||||
* @param int $priority The priority of decoration
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException In case the decorated service id and the new decorated service id are equals.
|
||||
*/
|
||||
@ -120,7 +120,7 @@ class Definition
|
||||
*
|
||||
* @param string $class The service class
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setClass($class)
|
||||
{
|
||||
@ -144,7 +144,7 @@ class Definition
|
||||
*
|
||||
* @param array $arguments An array of arguments
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setArguments(array $arguments)
|
||||
{
|
||||
@ -177,7 +177,7 @@ class Definition
|
||||
*
|
||||
* @param mixed $argument An argument
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addArgument($argument)
|
||||
{
|
||||
@ -192,7 +192,7 @@ class Definition
|
||||
* @param int $index
|
||||
* @param mixed $argument
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws OutOfBoundsException When the replaced argument does not exist
|
||||
*/
|
||||
@ -240,7 +240,7 @@ class Definition
|
||||
*
|
||||
* @param array $calls An array of method calls
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethodCalls(array $calls = array())
|
||||
{
|
||||
@ -258,7 +258,7 @@ class Definition
|
||||
* @param string $method The method name to call
|
||||
* @param array $arguments An array of arguments to pass to the method call
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException on empty $method param
|
||||
*/
|
||||
@ -277,7 +277,7 @@ class Definition
|
||||
*
|
||||
* @param string $method The method name to remove
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function removeMethodCall($method)
|
||||
{
|
||||
@ -324,7 +324,7 @@ class Definition
|
||||
*
|
||||
* @param array $tags
|
||||
*
|
||||
* @return Definition the current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setTags(array $tags)
|
||||
{
|
||||
@ -361,7 +361,7 @@ class Definition
|
||||
* @param string $name The tag name
|
||||
* @param array $attributes An array of attributes
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addTag($name, array $attributes = array())
|
||||
{
|
||||
@ -387,7 +387,7 @@ class Definition
|
||||
*
|
||||
* @param string $name The tag name
|
||||
*
|
||||
* @return Definition
|
||||
* @return $this
|
||||
*/
|
||||
public function clearTag($name)
|
||||
{
|
||||
@ -399,7 +399,7 @@ class Definition
|
||||
/**
|
||||
* Clears the tags for this definition.
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function clearTags()
|
||||
{
|
||||
@ -413,7 +413,7 @@ class Definition
|
||||
*
|
||||
* @param string $file A full pathname to include
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setFile($file)
|
||||
{
|
||||
@ -461,7 +461,7 @@ class Definition
|
||||
*
|
||||
* @param bool $boolean
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setPublic($boolean)
|
||||
{
|
||||
@ -485,7 +485,7 @@ class Definition
|
||||
*
|
||||
* @param bool $lazy
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setLazy($lazy)
|
||||
{
|
||||
@ -510,7 +510,7 @@ class Definition
|
||||
*
|
||||
* @param bool $boolean
|
||||
*
|
||||
* @return Definition the current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setSynthetic($boolean)
|
||||
{
|
||||
@ -536,7 +536,7 @@ class Definition
|
||||
*
|
||||
* @param bool $boolean
|
||||
*
|
||||
* @return Definition the current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setAbstract($boolean)
|
||||
{
|
||||
@ -614,7 +614,7 @@ class Definition
|
||||
*
|
||||
* @param callable $callable A PHP callable
|
||||
*
|
||||
* @return Definition The current instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setConfigurator($callable)
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ class DefinitionDecorator extends Definition
|
||||
* @param int $index
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return DefinitionDecorator the current instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException when $index isn't an integer
|
||||
*/
|
||||
|
@ -337,7 +337,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*
|
||||
* @param int $position The position
|
||||
*
|
||||
* @return Crawler A new instance of the Crawler with the selected node, or an empty Crawler if it does not exist
|
||||
* @return self
|
||||
*/
|
||||
public function eq($position)
|
||||
{
|
||||
@ -380,7 +380,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
* @param int $offset
|
||||
* @param int $length
|
||||
*
|
||||
* @return Crawler A Crawler instance with the sliced nodes
|
||||
* @return self
|
||||
*/
|
||||
public function slice($offset = 0, $length = null)
|
||||
{
|
||||
@ -394,7 +394,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*
|
||||
* @param \Closure $closure An anonymous function
|
||||
*
|
||||
* @return Crawler A Crawler instance with the selected nodes
|
||||
* @return self
|
||||
*/
|
||||
public function reduce(\Closure $closure)
|
||||
{
|
||||
@ -411,7 +411,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
/**
|
||||
* Returns the first node of the current selection.
|
||||
*
|
||||
* @return Crawler A Crawler instance with the first selected node
|
||||
* @return self
|
||||
*/
|
||||
public function first()
|
||||
{
|
||||
@ -421,7 +421,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
/**
|
||||
* Returns the last node of the current selection.
|
||||
*
|
||||
* @return Crawler A Crawler instance with the last selected node
|
||||
* @return self
|
||||
*/
|
||||
public function last()
|
||||
{
|
||||
@ -431,7 +431,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
/**
|
||||
* Returns the siblings nodes of the current selection.
|
||||
*
|
||||
* @return Crawler A Crawler instance with the sibling nodes
|
||||
* @return self
|
||||
*
|
||||
* @throws \InvalidArgumentException When current node is empty
|
||||
*/
|
||||
@ -447,7 +447,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
/**
|
||||
* Returns the next siblings nodes of the current selection.
|
||||
*
|
||||
* @return Crawler A Crawler instance with the next sibling nodes
|
||||
* @return self
|
||||
*
|
||||
* @throws \InvalidArgumentException When current node is empty
|
||||
*/
|
||||
@ -463,7 +463,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
/**
|
||||
* Returns the previous sibling nodes of the current selection.
|
||||
*
|
||||
* @return Crawler A Crawler instance with the previous sibling nodes
|
||||
* @return self
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
@ -479,7 +479,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
/**
|
||||
* Returns the parents nodes of the current selection.
|
||||
*
|
||||
* @return Crawler A Crawler instance with the parents nodes of the current selection
|
||||
* @return self
|
||||
*
|
||||
* @throws \InvalidArgumentException When current node is empty
|
||||
*/
|
||||
@ -504,7 +504,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
/**
|
||||
* Returns the children nodes of the current selection.
|
||||
*
|
||||
* @return Crawler A Crawler instance with the children nodes
|
||||
* @return self
|
||||
*
|
||||
* @throws \InvalidArgumentException When current node is empty
|
||||
*/
|
||||
@ -637,7 +637,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*
|
||||
* @param string $xpath An XPath expression
|
||||
*
|
||||
* @return Crawler A new instance of Crawler with the filtered list of nodes
|
||||
* @return self
|
||||
*/
|
||||
public function filterXPath($xpath)
|
||||
{
|
||||
@ -658,7 +658,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*
|
||||
* @param string $selector A CSS selector
|
||||
*
|
||||
* @return Crawler A new instance of Crawler with the filtered list of nodes
|
||||
* @return self
|
||||
*
|
||||
* @throws \RuntimeException if the CssSelector Component is not available
|
||||
*/
|
||||
@ -679,7 +679,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*
|
||||
* @param string $value The link text
|
||||
*
|
||||
* @return Crawler A new instance of Crawler with the filtered list of nodes
|
||||
* @return self
|
||||
*/
|
||||
public function selectLink($value)
|
||||
{
|
||||
@ -708,7 +708,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*
|
||||
* @param string $value The button text
|
||||
*
|
||||
* @return Crawler A new instance of Crawler with the filtered list of nodes
|
||||
* @return self
|
||||
*/
|
||||
public function selectButton($value)
|
||||
{
|
||||
@ -910,7 +910,7 @@ class Crawler implements \Countable, \IteratorAggregate
|
||||
*
|
||||
* @param string $xpath
|
||||
*
|
||||
* @return Crawler
|
||||
* @return self
|
||||
*/
|
||||
private function filterRelativeXPath($xpath)
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ class Form extends Link implements \ArrayAccess
|
||||
*
|
||||
* @param array $values An array of field values
|
||||
*
|
||||
* @return Form
|
||||
* @return $this
|
||||
*/
|
||||
public function setValues(array $values)
|
||||
{
|
||||
@ -279,7 +279,7 @@ class Form extends Link implements \ArrayAccess
|
||||
/**
|
||||
* Gets all fields.
|
||||
*
|
||||
* @return FormField[] An array of fields
|
||||
* @return FormField[]
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
|
@ -151,7 +151,7 @@ class FormFieldRegistry
|
||||
* @param string $base The fully qualified name of the base field
|
||||
* @param array $values The values of the fields
|
||||
*
|
||||
* @return FormFieldRegistry
|
||||
* @return static
|
||||
*/
|
||||
private static function create($base, array $values)
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
* @param string $key Argument name
|
||||
* @param mixed $value Value
|
||||
*
|
||||
* @return GenericEvent
|
||||
* @return $this
|
||||
*/
|
||||
public function setArgument($key, $value)
|
||||
{
|
||||
@ -104,7 +104,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
|
||||
*
|
||||
* @param array $args Arguments
|
||||
*
|
||||
* @return GenericEvent
|
||||
* @return $this
|
||||
*/
|
||||
public function setArguments(array $args = array())
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ class Compiler
|
||||
*
|
||||
* @param Node\Node $node The node to compile
|
||||
*
|
||||
* @return Compiler The current compiler instance
|
||||
* @return $this
|
||||
*/
|
||||
public function compile(Node\Node $node)
|
||||
{
|
||||
@ -80,7 +80,7 @@ class Compiler
|
||||
*
|
||||
* @param string $string The string
|
||||
*
|
||||
* @return Compiler The current compiler instance
|
||||
* @return $this
|
||||
*/
|
||||
public function raw($string)
|
||||
{
|
||||
@ -94,7 +94,7 @@ class Compiler
|
||||
*
|
||||
* @param string $value The string
|
||||
*
|
||||
* @return Compiler The current compiler instance
|
||||
* @return $this
|
||||
*/
|
||||
public function string($value)
|
||||
{
|
||||
@ -108,7 +108,7 @@ class Compiler
|
||||
*
|
||||
* @param mixed $value The value to convert
|
||||
*
|
||||
* @return Compiler The current compiler instance
|
||||
* @return $this
|
||||
*/
|
||||
public function repr($value)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Creates a new Finder.
|
||||
*
|
||||
* @return Finder A new Finder instance
|
||||
* @return static
|
||||
*/
|
||||
public static function create()
|
||||
{
|
||||
@ -82,7 +82,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Restricts the matching to directories only.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function directories()
|
||||
{
|
||||
@ -94,7 +94,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Restricts the matching to files only.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function files()
|
||||
{
|
||||
@ -113,7 +113,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string|int $level The depth level expression
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see DepthRangeFilterIterator
|
||||
* @see NumberComparator
|
||||
@ -137,7 +137,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $date A date range string
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see strtotime
|
||||
* @see DateRangeFilterIterator
|
||||
@ -161,7 +161,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp, a glob, or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@ -177,7 +177,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp, a glob, or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@ -198,7 +198,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (string or regexp)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilecontentFilterIterator
|
||||
*/
|
||||
@ -219,7 +219,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (string or regexp)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilecontentFilterIterator
|
||||
*/
|
||||
@ -242,7 +242,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@ -265,7 +265,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $pattern A pattern (a regexp or a string)
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see FilenameFilterIterator
|
||||
*/
|
||||
@ -285,7 +285,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string|int $size A size range string or an integer
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SizeRangeFilterIterator
|
||||
* @see NumberComparator
|
||||
@ -302,7 +302,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string|array $dirs A directory path or an array of directories
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see ExcludeDirectoryFilterIterator
|
||||
*/
|
||||
@ -318,7 +318,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param bool $ignoreDotFiles Whether to exclude "hidden" files or not
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see ExcludeDirectoryFilterIterator
|
||||
*/
|
||||
@ -338,7 +338,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param bool $ignoreVCS Whether to exclude VCS files or not
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see ExcludeDirectoryFilterIterator
|
||||
*/
|
||||
@ -378,7 +378,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param \Closure $closure An anonymous function
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@ -394,7 +394,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@ -410,7 +410,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@ -428,7 +428,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@ -448,7 +448,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@ -466,7 +466,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* This can be slow as all the matching files and directories must be retrieved for comparison.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see SortableIterator
|
||||
*/
|
||||
@ -485,7 +485,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param \Closure $closure An anonymous function
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @see CustomFilterIterator
|
||||
*/
|
||||
@ -499,7 +499,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Forces the following of symlinks.
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function followLinks()
|
||||
{
|
||||
@ -515,7 +515,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param bool $ignore
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*/
|
||||
public function ignoreUnreadableDirs($ignore = true)
|
||||
{
|
||||
@ -529,7 +529,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string|array $dirs A directory path or an array of directories
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The current Finder instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException if one of the directories does not exist
|
||||
*/
|
||||
@ -590,7 +590,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param mixed $iterator
|
||||
*
|
||||
* @return Finder|SplFileInfo[] The finder
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException When the given argument is not iterable.
|
||||
*/
|
||||
|
@ -369,7 +369,7 @@ class Button implements \IteratorAggregate, FormInterface
|
||||
* @param null|string $submittedData The data
|
||||
* @param bool $clearMissing Not used
|
||||
*
|
||||
* @return Button The button instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws Exception\AlreadySubmittedException If the button has already been submitted.
|
||||
*/
|
||||
|
@ -286,7 +286,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
|
||||
*
|
||||
* @param bool $disabled Whether the button is disabled
|
||||
*
|
||||
* @return ButtonBuilder The button builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setDisabled($disabled)
|
||||
{
|
||||
@ -398,7 +398,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
|
||||
*
|
||||
* @param ResolvedFormTypeInterface $type The type of the button
|
||||
*
|
||||
* @return ButtonBuilder The button builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setType(ResolvedFormTypeInterface $type)
|
||||
{
|
||||
@ -490,7 +490,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
|
||||
*
|
||||
* @param bool $initialize
|
||||
*
|
||||
* @return ButtonBuilder
|
||||
* @return $this
|
||||
*
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
|
@ -713,7 +713,7 @@ class Form implements \IteratorAggregate, FormInterface
|
||||
|
||||
return FormUtil::isEmpty($this->modelData) ||
|
||||
// arrays, countables
|
||||
0 === count($this->modelData) ||
|
||||
((is_array($this->modelData) || $this->modelData instanceof \Countable) && 0 === count($this->modelData)) ||
|
||||
// traversables that are not countable
|
||||
($this->modelData instanceof \Traversable && 0 === iterator_count($this->modelData));
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ class FormBuilder extends FormConfigBuilder implements \IteratorAggregate, FormB
|
||||
*
|
||||
* @param string $name The name of the unresolved child
|
||||
*
|
||||
* @return FormBuilder The created instance
|
||||
* @return self The created instance
|
||||
*/
|
||||
private function resolveChild($name)
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild
|
||||
* @param string|null $type
|
||||
* @param array $options
|
||||
*
|
||||
* @return FormBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function add($child, $type = null, array $options = array());
|
||||
|
||||
@ -38,7 +38,7 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild
|
||||
* @param string|null $type The type of the form or null if name is a property
|
||||
* @param array $options The options
|
||||
*
|
||||
* @return FormBuilderInterface The created builder
|
||||
* @return self
|
||||
*/
|
||||
public function create($name, $type = null, array $options = array());
|
||||
|
||||
@ -47,7 +47,7 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild
|
||||
*
|
||||
* @param string $name The name of the child
|
||||
*
|
||||
* @return FormBuilderInterface The builder for the child
|
||||
* @return self
|
||||
*
|
||||
* @throws Exception\InvalidArgumentException if the given child does not exist
|
||||
*/
|
||||
@ -58,7 +58,7 @@ interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuild
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return FormBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function remove($name);
|
||||
|
||||
|
@ -23,7 +23,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param ResolvedFormTypeFactoryInterface $resolvedTypeFactory
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setResolvedTypeFactory(ResolvedFormTypeFactoryInterface $resolvedTypeFactory);
|
||||
|
||||
@ -32,7 +32,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormExtensionInterface $extension The extension
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addExtension(FormExtensionInterface $extension);
|
||||
|
||||
@ -41,7 +41,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormExtensionInterface[] $extensions The extensions
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addExtensions(array $extensions);
|
||||
|
||||
@ -50,7 +50,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormTypeInterface $type The form type
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addType(FormTypeInterface $type);
|
||||
|
||||
@ -59,7 +59,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormTypeInterface[] $types The form types
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addTypes(array $types);
|
||||
|
||||
@ -68,7 +68,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormTypeExtensionInterface $typeExtension The form type extension
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addTypeExtension(FormTypeExtensionInterface $typeExtension);
|
||||
|
||||
@ -77,7 +77,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormTypeExtensionInterface[] $typeExtensions The form type extensions
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addTypeExtensions(array $typeExtensions);
|
||||
|
||||
@ -86,7 +86,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormTypeGuesserInterface $typeGuesser The type guesser
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addTypeGuesser(FormTypeGuesserInterface $typeGuesser);
|
||||
|
||||
@ -95,7 +95,7 @@ interface FormFactoryBuilderInterface
|
||||
*
|
||||
* @param FormTypeGuesserInterface[] $typeGuessers The type guessers
|
||||
*
|
||||
* @return FormFactoryBuilderInterface The builder
|
||||
* @return $this
|
||||
*/
|
||||
public function addTypeGuessers(array $typeGuessers);
|
||||
|
||||
|
@ -25,7 +25,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
*
|
||||
* @param FormInterface|null $parent The parent form or null if it's the root
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return self
|
||||
*
|
||||
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
|
||||
* @throws Exception\LogicException When trying to set a parent for a form with
|
||||
@ -36,7 +36,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
/**
|
||||
* Returns the parent form.
|
||||
*
|
||||
* @return FormInterface|null The parent form or null if there is none
|
||||
* @return self|null The parent form or null if there is none
|
||||
*/
|
||||
public function getParent();
|
||||
|
||||
@ -47,7 +47,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
* @param string|null $type The child's type, if a name was passed
|
||||
* @param array $options The child's options, if a name was passed
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return self
|
||||
*
|
||||
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
|
||||
* @throws Exception\LogicException When trying to add a child to a non-compound form.
|
||||
@ -60,7 +60,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
*
|
||||
* @param string $name The name of the child
|
||||
*
|
||||
* @return FormInterface The child form
|
||||
* @return self
|
||||
*
|
||||
* @throws \OutOfBoundsException If the named child does not exist.
|
||||
*/
|
||||
@ -80,7 +80,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
*
|
||||
* @param string $name The name of the child to remove
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
|
||||
*/
|
||||
@ -89,7 +89,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
/**
|
||||
* Returns all children in this group.
|
||||
*
|
||||
* @return FormInterface[] An array of FormInterface instances
|
||||
* @return self[]
|
||||
*/
|
||||
public function all();
|
||||
|
||||
@ -110,7 +110,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
*
|
||||
* @param mixed $modelData The data formatted as expected for the underlying object
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
|
||||
* @throws Exception\LogicException If listeners try to call setData in a cycle. Or if
|
||||
@ -182,7 +182,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
*
|
||||
* @param FormError $error
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addError(FormError $error);
|
||||
|
||||
@ -248,7 +248,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
*
|
||||
* Should be called on the root form after constructing the tree.
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return $this
|
||||
*/
|
||||
public function initialize();
|
||||
|
||||
@ -262,7 +262,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
*
|
||||
* @param mixed $request The request to handle
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return $this
|
||||
*/
|
||||
public function handleRequest($request = null);
|
||||
|
||||
@ -274,7 +274,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
* when they are missing in the
|
||||
* submitted data.
|
||||
*
|
||||
* @return FormInterface The form instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
|
||||
*/
|
||||
@ -283,7 +283,7 @@ interface FormInterface extends \ArrayAccess, \Traversable, \Countable
|
||||
/**
|
||||
* Returns the root of the form tree.
|
||||
*
|
||||
* @return FormInterface The root of the tree
|
||||
* @return self The root of the tree
|
||||
*/
|
||||
public function getRoot();
|
||||
|
||||
|
@ -81,7 +81,7 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
|
||||
/**
|
||||
* Marks the view as rendered.
|
||||
*
|
||||
* @return FormView The view object
|
||||
* @return $this
|
||||
*/
|
||||
public function setRendered()
|
||||
{
|
||||
@ -95,7 +95,7 @@ class FormView implements \ArrayAccess, \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $name The child name
|
||||
*
|
||||
* @return FormView The child view
|
||||
* @return self The child view
|
||||
*/
|
||||
public function offsetGet($name)
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ abstract class Guess
|
||||
*
|
||||
* @param Guess[] $guesses An array of guesses
|
||||
*
|
||||
* @return Guess|null The guess with the highest confidence
|
||||
* @return self|null
|
||||
*/
|
||||
public static function getBestGuess(array $guesses)
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ class SubmitButton extends Button implements ClickableInterface
|
||||
* @param null|string $submittedData The data
|
||||
* @param bool $clearMissing Not used
|
||||
*
|
||||
* @return SubmitButton The button instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws Exception\AlreadySubmittedException If the form has already been submitted.
|
||||
*/
|
||||
|
@ -48,7 +48,7 @@ class AcceptHeader
|
||||
*
|
||||
* @param string $headerValue
|
||||
*
|
||||
* @return AcceptHeader
|
||||
* @return self
|
||||
*/
|
||||
public static function fromString($headerValue)
|
||||
{
|
||||
@ -101,7 +101,7 @@ class AcceptHeader
|
||||
*
|
||||
* @param AcceptHeaderItem $item
|
||||
*
|
||||
* @return AcceptHeader
|
||||
* @return $this
|
||||
*/
|
||||
public function add(AcceptHeaderItem $item)
|
||||
{
|
||||
@ -128,7 +128,7 @@ class AcceptHeader
|
||||
*
|
||||
* @param string $pattern
|
||||
*
|
||||
* @return AcceptHeader
|
||||
* @return self
|
||||
*/
|
||||
public function filter($pattern)
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ class AcceptHeaderItem
|
||||
*
|
||||
* @param string $itemValue
|
||||
*
|
||||
* @return AcceptHeaderItem
|
||||
* @return self
|
||||
*/
|
||||
public static function fromString($itemValue)
|
||||
{
|
||||
@ -103,7 +103,7 @@ class AcceptHeaderItem
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return AcceptHeaderItem
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
@ -127,7 +127,7 @@ class AcceptHeaderItem
|
||||
*
|
||||
* @param float $quality
|
||||
*
|
||||
* @return AcceptHeaderItem
|
||||
* @return $this
|
||||
*/
|
||||
public function setQuality($quality)
|
||||
{
|
||||
@ -151,7 +151,7 @@ class AcceptHeaderItem
|
||||
*
|
||||
* @param int $index
|
||||
*
|
||||
* @return AcceptHeaderItem
|
||||
* @return $this
|
||||
*/
|
||||
public function setIndex($index)
|
||||
{
|
||||
@ -211,7 +211,7 @@ class AcceptHeaderItem
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*
|
||||
* @return AcceptHeaderItem
|
||||
* @return $this
|
||||
*/
|
||||
public function setAttribute($name, $value)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ class BinaryFileResponse extends Response
|
||||
* @param bool $autoEtag Whether the ETag header should be automatically set
|
||||
* @param bool $autoLastModified Whether the Last-Modified header should be automatically set
|
||||
*
|
||||
* @return BinaryFileResponse The created response
|
||||
* @return static
|
||||
*/
|
||||
public static function create($file = null, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
|
||||
{
|
||||
@ -81,7 +81,7 @@ class BinaryFileResponse extends Response
|
||||
* @param bool $autoEtag
|
||||
* @param bool $autoLastModified
|
||||
*
|
||||
* @return BinaryFileResponse
|
||||
* @return $this
|
||||
*
|
||||
* @throws FileException
|
||||
*/
|
||||
@ -153,7 +153,7 @@ class BinaryFileResponse extends Response
|
||||
* @param string $filename Optionally use this filename instead of the real name of the file
|
||||
* @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
|
||||
*
|
||||
* @return BinaryFileResponse
|
||||
* @return $this
|
||||
*/
|
||||
public function setContentDisposition($disposition, $filename = '', $filenameFallback = '')
|
||||
{
|
||||
@ -348,7 +348,7 @@ class BinaryFileResponse extends Response
|
||||
*
|
||||
* @param bool $shouldDelete
|
||||
*
|
||||
* @return BinaryFileResponse
|
||||
* @return $this
|
||||
*/
|
||||
public function deleteFileAfterSend($shouldDelete)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ class File extends \SplFileInfo
|
||||
* @param string $directory The destination folder
|
||||
* @param string $name The new file name
|
||||
*
|
||||
* @return File A File object representing the new file
|
||||
* @return self A File object representing the new file
|
||||
*
|
||||
* @throws FileException if the target file could not be created
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ class ExtensionGuesser implements ExtensionGuesserInterface
|
||||
/**
|
||||
* Returns the singleton instance.
|
||||
*
|
||||
* @return ExtensionGuesser
|
||||
* @return self
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface
|
||||
/**
|
||||
* Returns the singleton instance.
|
||||
*
|
||||
* @return MimeTypeGuesser
|
||||
* @return self
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ class JsonResponse extends Response
|
||||
* @param int $status The response status code
|
||||
* @param array $headers An array of response headers
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @return static
|
||||
*/
|
||||
public static function create($data = null, $status = 200, $headers = array())
|
||||
{
|
||||
@ -74,7 +74,7 @@ class JsonResponse extends Response
|
||||
*
|
||||
* @param string|null $callback The JSONP callback or null to use none
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException When the callback name is not valid
|
||||
*/
|
||||
@ -125,7 +125,7 @@ class JsonResponse extends Response
|
||||
*
|
||||
* @param mixed $data
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
@ -172,7 +172,7 @@ class JsonResponse extends Response
|
||||
*
|
||||
* @param int $encodingOptions
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @return $this
|
||||
*/
|
||||
public function setEncodingOptions($encodingOptions)
|
||||
{
|
||||
@ -184,7 +184,7 @@ class JsonResponse extends Response
|
||||
/**
|
||||
* Updates the content and headers according to the JSON data and callback.
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @return $this
|
||||
*/
|
||||
protected function update()
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ class RedirectResponse extends Response
|
||||
*
|
||||
* @param string $url The URL to redirect to
|
||||
*
|
||||
* @return RedirectResponse The current response
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
|
@ -261,7 +261,7 @@ class Request
|
||||
/**
|
||||
* Creates a new request with values from PHP's super globals.
|
||||
*
|
||||
* @return Request A new request
|
||||
* @return static
|
||||
*/
|
||||
public static function createFromGlobals()
|
||||
{
|
||||
@ -304,7 +304,7 @@ class Request
|
||||
* @param array $server The server parameters ($_SERVER)
|
||||
* @param string $content The raw body data
|
||||
*
|
||||
* @return Request A Request instance
|
||||
* @return static
|
||||
*/
|
||||
public static function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null)
|
||||
{
|
||||
@ -422,7 +422,7 @@ class Request
|
||||
* @param array $files The FILES parameters
|
||||
* @param array $server The SERVER parameters
|
||||
*
|
||||
* @return Request The duplicated request
|
||||
* @return static
|
||||
*/
|
||||
public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
|
||||
{
|
||||
|
@ -215,7 +215,7 @@ class Response
|
||||
* @param int $status The response status code
|
||||
* @param array $headers An array of response headers
|
||||
*
|
||||
* @return Response
|
||||
* @return static
|
||||
*/
|
||||
public static function create($content = '', $status = 200, $headers = array())
|
||||
{
|
||||
@ -258,7 +258,7 @@ class Response
|
||||
*
|
||||
* @param Request $request A Request instance
|
||||
*
|
||||
* @return Response The current response
|
||||
* @return $this
|
||||
*/
|
||||
public function prepare(Request $request)
|
||||
{
|
||||
@ -320,7 +320,7 @@ class Response
|
||||
/**
|
||||
* Sends HTTP headers.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function sendHeaders()
|
||||
{
|
||||
@ -358,7 +358,7 @@ class Response
|
||||
/**
|
||||
* Sends content for the current web response.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function sendContent()
|
||||
{
|
||||
@ -370,7 +370,7 @@ class Response
|
||||
/**
|
||||
* Sends HTTP headers and content.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function send()
|
||||
{
|
||||
@ -393,7 +393,7 @@ class Response
|
||||
*
|
||||
* @param mixed $content Content that can be cast to string
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*
|
||||
* @throws \UnexpectedValueException
|
||||
*/
|
||||
@ -423,7 +423,7 @@ class Response
|
||||
*
|
||||
* @param string $version The HTTP protocol version
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setProtocolVersion($version)
|
||||
{
|
||||
@ -451,7 +451,7 @@ class Response
|
||||
* If the status text is null it will be automatically populated for the known
|
||||
* status codes and left empty otherwise.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException When the HTTP status code is not valid
|
||||
*/
|
||||
@ -494,7 +494,7 @@ class Response
|
||||
*
|
||||
* @param string $charset Character set
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setCharset($charset)
|
||||
{
|
||||
@ -567,7 +567,7 @@ class Response
|
||||
*
|
||||
* It makes the response ineligible for serving other clients.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrivate()
|
||||
{
|
||||
@ -582,7 +582,7 @@ class Response
|
||||
*
|
||||
* It makes the response eligible for serving other clients.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setPublic()
|
||||
{
|
||||
@ -628,7 +628,7 @@ class Response
|
||||
*
|
||||
* @param \DateTime $date A \DateTime instance
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setDate(\DateTime $date)
|
||||
{
|
||||
@ -655,7 +655,7 @@ class Response
|
||||
/**
|
||||
* Marks the response stale by setting the Age header to be equal to the maximum age of the response.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function expire()
|
||||
{
|
||||
@ -688,7 +688,7 @@ class Response
|
||||
*
|
||||
* @param \DateTime|null $date A \DateTime instance or null to remove the header
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpires(\DateTime $date = null)
|
||||
{
|
||||
@ -734,7 +734,7 @@ class Response
|
||||
*
|
||||
* @param int $value Number of seconds
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setMaxAge($value)
|
||||
{
|
||||
@ -750,7 +750,7 @@ class Response
|
||||
*
|
||||
* @param int $value Number of seconds
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setSharedMaxAge($value)
|
||||
{
|
||||
@ -784,7 +784,7 @@ class Response
|
||||
*
|
||||
* @param int $seconds Number of seconds
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setTtl($seconds)
|
||||
{
|
||||
@ -800,7 +800,7 @@ class Response
|
||||
*
|
||||
* @param int $seconds Number of seconds
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setClientTtl($seconds)
|
||||
{
|
||||
@ -828,7 +828,7 @@ class Response
|
||||
*
|
||||
* @param \DateTime|null $date A \DateTime instance or null to remove the header
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setLastModified(\DateTime $date = null)
|
||||
{
|
||||
@ -859,7 +859,7 @@ class Response
|
||||
* @param string|null $etag The ETag unique identifier or null to remove the header
|
||||
* @param bool $weak Whether you want a weak ETag or not
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setEtag($etag = null, $weak = false)
|
||||
{
|
||||
@ -883,7 +883,7 @@ class Response
|
||||
*
|
||||
* @param array $options An array of cache options
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
@ -934,7 +934,7 @@ class Response
|
||||
* This sets the status, removes the body, and discards any headers
|
||||
* that MUST NOT be included in 304 responses.
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*
|
||||
* @see http://tools.ietf.org/html/rfc2616#section-10.3.5
|
||||
*/
|
||||
@ -986,7 +986,7 @@ class Response
|
||||
* @param string|array $headers
|
||||
* @param bool $replace Whether to replace the actual value or not (true by default)
|
||||
*
|
||||
* @return Response
|
||||
* @return $this
|
||||
*/
|
||||
public function setVary($headers, $replace = true)
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ class StreamedResponse extends Response
|
||||
* @param int $status The response status code
|
||||
* @param array $headers An array of response headers
|
||||
*
|
||||
* @return StreamedResponse
|
||||
* @return static
|
||||
*/
|
||||
public static function create($callback = null, $status = 200, $headers = array())
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ class Profile
|
||||
/**
|
||||
* Sets the parent token.
|
||||
*
|
||||
* @param Profile $parent The parent Profile
|
||||
* @param Profile $parent
|
||||
*/
|
||||
public function setParent(Profile $parent)
|
||||
{
|
||||
@ -86,7 +86,7 @@ class Profile
|
||||
/**
|
||||
* Returns the parent profile.
|
||||
*
|
||||
* @return Profile The parent profile
|
||||
* @return self
|
||||
*/
|
||||
public function getParent()
|
||||
{
|
||||
@ -191,7 +191,7 @@ class Profile
|
||||
/**
|
||||
* Finds children profilers.
|
||||
*
|
||||
* @return Profile[] An array of Profile
|
||||
* @return self[]
|
||||
*/
|
||||
public function getChildren()
|
||||
{
|
||||
@ -201,7 +201,7 @@ class Profile
|
||||
/**
|
||||
* Sets children profiler.
|
||||
*
|
||||
* @param Profile[] $children An array of Profile
|
||||
* @param Profile[] $children
|
||||
*/
|
||||
public function setChildren(array $children)
|
||||
{
|
||||
@ -214,7 +214,7 @@ class Profile
|
||||
/**
|
||||
* Adds the child token.
|
||||
*
|
||||
* @param Profile $child The child Profile
|
||||
* @param Profile $child
|
||||
*/
|
||||
public function addChild(Profile $child)
|
||||
{
|
||||
|
@ -88,7 +88,7 @@ class Collator
|
||||
*
|
||||
* @param string $locale The locale code. The only currently supported locale is "en" (or null using the default locale, i.e. "en")
|
||||
*
|
||||
* @return Collator
|
||||
* @return self
|
||||
*
|
||||
* @throws MethodArgumentValueNotImplementedException When $locale different than "en" or null is passed
|
||||
*/
|
||||
|
@ -173,7 +173,7 @@ class IntlDateFormatter
|
||||
* One of the calendar constants.
|
||||
* @param string $pattern Optional pattern to use when formatting
|
||||
*
|
||||
* @return IntlDateFormatter
|
||||
* @return self
|
||||
*
|
||||
* @see http://www.php.net/manual/en/intldateformatter.create.php
|
||||
* @see http://userguide.icu-project.org/formatparse/datetime
|
||||
|
@ -304,7 +304,7 @@ class NumberFormatter
|
||||
* NumberFormat::PATTERN_RULEBASED. It must conform to the syntax
|
||||
* described in the ICU DecimalFormat or ICU RuleBasedNumberFormat documentation
|
||||
*
|
||||
* @return NumberFormatter
|
||||
* @return self
|
||||
*
|
||||
* @see http://www.php.net/manual/en/numberformatter.create.php
|
||||
* @see http://www.icu-project.org/apiref/icu4c/classDecimalFormat.html#_details
|
||||
|
@ -42,7 +42,7 @@ class SvnRepository
|
||||
* @param string $url The URL to download from
|
||||
* @param string $targetDir The directory in which to store the repository
|
||||
*
|
||||
* @return SvnRepository The directory where the data is stored
|
||||
* @return static
|
||||
*
|
||||
* @throws RuntimeException If an error occurs during the download.
|
||||
*/
|
||||
|
@ -145,7 +145,7 @@ class OptionsResolver implements Options
|
||||
* @param string $option The name of the option
|
||||
* @param mixed $value The default value of the option
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
@ -208,7 +208,7 @@ class OptionsResolver implements Options
|
||||
*
|
||||
* @param array $defaults The default values to set
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
@ -241,7 +241,7 @@ class OptionsResolver implements Options
|
||||
*
|
||||
* @param string|string[] $optionNames One or more option names
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
@ -322,7 +322,7 @@ class OptionsResolver implements Options
|
||||
*
|
||||
* @param string|string[] $optionNames One or more option names
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
@ -389,7 +389,7 @@ class OptionsResolver implements Options
|
||||
* @param string $option The option name
|
||||
* @param \Closure $normalizer The normalizer
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws UndefinedOptionsException If the option is undefined
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
@ -432,7 +432,7 @@ class OptionsResolver implements Options
|
||||
* @param string $option The option name
|
||||
* @param mixed $allowedValues One or more acceptable values/closures
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws UndefinedOptionsException If the option is undefined
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
@ -477,7 +477,7 @@ class OptionsResolver implements Options
|
||||
* @param string $option The option name
|
||||
* @param mixed $allowedValues One or more acceptable values/closures
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws UndefinedOptionsException If the option is undefined
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
@ -522,7 +522,7 @@ class OptionsResolver implements Options
|
||||
* @param string $option The option name
|
||||
* @param string|string[] $allowedTypes One or more accepted types
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws UndefinedOptionsException If the option is undefined
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
@ -561,7 +561,7 @@ class OptionsResolver implements Options
|
||||
* @param string $option The option name
|
||||
* @param string|string[] $allowedTypes One or more accepted types
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws UndefinedOptionsException If the option is undefined
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
@ -599,7 +599,7 @@ class OptionsResolver implements Options
|
||||
*
|
||||
* @param string|string[] $optionNames One or more option names
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
@ -620,7 +620,7 @@ class OptionsResolver implements Options
|
||||
/**
|
||||
* Removes all options.
|
||||
*
|
||||
* @return OptionsResolver This instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws AccessException If called from a lazy option or normalizer
|
||||
*/
|
||||
|
@ -318,7 +318,7 @@ class Process implements \IteratorAggregate
|
||||
* @param callable|null $callback A PHP callback to run whenever there is some
|
||||
* output available on STDOUT or STDERR
|
||||
*
|
||||
* @return Process The new process
|
||||
* @return $this
|
||||
*
|
||||
* @throws RuntimeException When process can't be launched
|
||||
* @throws RuntimeException When process is already running
|
||||
@ -398,7 +398,7 @@ class Process implements \IteratorAggregate
|
||||
*
|
||||
* @param int $signal A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php)
|
||||
*
|
||||
* @return Process
|
||||
* @return $this
|
||||
*
|
||||
* @throws LogicException In case the process is not running
|
||||
* @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed
|
||||
@ -414,7 +414,7 @@ class Process implements \IteratorAggregate
|
||||
/**
|
||||
* Disables fetching output and error output from the underlying process.
|
||||
*
|
||||
* @return Process
|
||||
* @return $this
|
||||
*
|
||||
* @throws RuntimeException In case the process is already running
|
||||
* @throws LogicException if an idle timeout is set
|
||||
@ -436,7 +436,7 @@ class Process implements \IteratorAggregate
|
||||
/**
|
||||
* Enables fetching output and error output from the underlying process.
|
||||
*
|
||||
* @return Process
|
||||
* @return $this
|
||||
*
|
||||
* @throws RuntimeException In case the process is already running
|
||||
*/
|
||||
@ -565,7 +565,7 @@ class Process implements \IteratorAggregate
|
||||
/**
|
||||
* Clears the process output.
|
||||
*
|
||||
* @return Process
|
||||
* @return $this
|
||||
*/
|
||||
public function clearOutput()
|
||||
{
|
||||
@ -624,7 +624,7 @@ class Process implements \IteratorAggregate
|
||||
/**
|
||||
* Clears the process output.
|
||||
*
|
||||
* @return Process
|
||||
* @return $this
|
||||
*/
|
||||
public function clearErrorOutput()
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param string[] $arguments An array of arguments
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return static
|
||||
*/
|
||||
public static function create(array $arguments = array())
|
||||
{
|
||||
@ -58,7 +58,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param string $argument A command argument
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function add($argument)
|
||||
{
|
||||
@ -74,7 +74,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param string|array $prefix A command prefix or an array of command prefixes
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrefix($prefix)
|
||||
{
|
||||
@ -91,7 +91,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param string[] $arguments
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function setArguments(array $arguments)
|
||||
{
|
||||
@ -105,7 +105,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param null|string $cwd The working directory
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function setWorkingDirectory($cwd)
|
||||
{
|
||||
@ -119,7 +119,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param bool $inheritEnv
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function inheritEnvironmentVariables($inheritEnv = true)
|
||||
{
|
||||
@ -137,7 +137,7 @@ class ProcessBuilder
|
||||
* @param string $name The variable name
|
||||
* @param null|string $value The variable value
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnv($name, $value)
|
||||
{
|
||||
@ -155,7 +155,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param array $variables The variables
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function addEnvironmentVariables(array $variables)
|
||||
{
|
||||
@ -169,7 +169,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param resource|scalar|\Traversable|null $input The input content
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException In case the argument is invalid
|
||||
*/
|
||||
@ -187,7 +187,7 @@ class ProcessBuilder
|
||||
*
|
||||
* @param float|null $timeout
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
@ -216,7 +216,7 @@ class ProcessBuilder
|
||||
* @param string $name The option name
|
||||
* @param string $value The option value
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function setOption($name, $value)
|
||||
{
|
||||
@ -228,7 +228,7 @@ class ProcessBuilder
|
||||
/**
|
||||
* Disables fetching output and error output from the underlying process.
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function disableOutput()
|
||||
{
|
||||
@ -240,7 +240,7 @@ class ProcessBuilder
|
||||
/**
|
||||
* Enables fetching output and error output from the underlying process.
|
||||
*
|
||||
* @return ProcessBuilder
|
||||
* @return $this
|
||||
*/
|
||||
public function enableOutput()
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ final class PropertyAccess
|
||||
/**
|
||||
* Creates a property accessor with the default configuration.
|
||||
*
|
||||
* @return PropertyAccessor The new property accessor
|
||||
* @return PropertyAccessor
|
||||
*/
|
||||
public static function createPropertyAccessor()
|
||||
{
|
||||
@ -31,7 +31,7 @@ final class PropertyAccess
|
||||
/**
|
||||
* Creates a property accessor builder.
|
||||
*
|
||||
* @return PropertyAccessorBuilder The new property accessor builder
|
||||
* @return PropertyAccessor
|
||||
*/
|
||||
public static function createPropertyAccessorBuilder()
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ class PropertyAccessorBuilder
|
||||
/**
|
||||
* Enables the use of "__call" by the PropertyAccessor.
|
||||
*
|
||||
* @return PropertyAccessorBuilder The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function enableMagicCall()
|
||||
{
|
||||
@ -43,7 +43,7 @@ class PropertyAccessorBuilder
|
||||
/**
|
||||
* Disables the use of "__call" by the PropertyAccessor.
|
||||
*
|
||||
* @return PropertyAccessorBuilder The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function disableMagicCall()
|
||||
{
|
||||
@ -66,7 +66,7 @@ class PropertyAccessorBuilder
|
||||
* This has no influence on writing non-existing indices with PropertyAccessorInterface::setValue()
|
||||
* which are always created on-the-fly.
|
||||
*
|
||||
* @return PropertyAccessorBuilder The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function enableExceptionOnInvalidIndex()
|
||||
{
|
||||
@ -80,7 +80,7 @@ class PropertyAccessorBuilder
|
||||
*
|
||||
* Instead, null is returned when calling PropertyAccessorInterface::getValue() on a non-existing index.
|
||||
*
|
||||
* @return PropertyAccessorBuilder The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function disableExceptionOnInvalidIndex()
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ class DumperCollection implements \IteratorAggregate
|
||||
/**
|
||||
* Returns the root of the collection.
|
||||
*
|
||||
* @return DumperCollection The root collection
|
||||
* @return self The root collection
|
||||
*/
|
||||
public function getRoot()
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ class DumperPrefixCollection extends DumperCollection
|
||||
*
|
||||
* @param DumperRoute $route The route
|
||||
*
|
||||
* @return DumperPrefixCollection The node the route was added to
|
||||
* @return self
|
||||
*
|
||||
* @throws \LogicException
|
||||
*/
|
||||
|
@ -66,7 +66,7 @@ class RequestContext
|
||||
*
|
||||
* @param Request $request A Request instance
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function fromRequest(Request $request)
|
||||
{
|
||||
@ -97,7 +97,7 @@ class RequestContext
|
||||
*
|
||||
* @param string $baseUrl The base URL
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setBaseUrl($baseUrl)
|
||||
{
|
||||
@ -121,7 +121,7 @@ class RequestContext
|
||||
*
|
||||
* @param string $pathInfo The path info
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setPathInfo($pathInfo)
|
||||
{
|
||||
@ -147,7 +147,7 @@ class RequestContext
|
||||
*
|
||||
* @param string $method The HTTP method
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethod($method)
|
||||
{
|
||||
@ -173,7 +173,7 @@ class RequestContext
|
||||
*
|
||||
* @param string $host The HTTP host
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setHost($host)
|
||||
{
|
||||
@ -197,7 +197,7 @@ class RequestContext
|
||||
*
|
||||
* @param string $scheme The HTTP scheme
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setScheme($scheme)
|
||||
{
|
||||
@ -221,7 +221,7 @@ class RequestContext
|
||||
*
|
||||
* @param int $httpPort The HTTP port
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setHttpPort($httpPort)
|
||||
{
|
||||
@ -245,7 +245,7 @@ class RequestContext
|
||||
*
|
||||
* @param int $httpsPort The HTTPS port
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setHttpsPort($httpsPort)
|
||||
{
|
||||
@ -269,7 +269,7 @@ class RequestContext
|
||||
*
|
||||
* @param string $queryString The query string (after "?")
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setQueryString($queryString)
|
||||
{
|
||||
@ -294,7 +294,7 @@ class RequestContext
|
||||
*
|
||||
* @param array $parameters The parameters
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setParameters(array $parameters)
|
||||
{
|
||||
@ -333,7 +333,7 @@ class RequestContext
|
||||
* @param string $name A parameter name
|
||||
* @param mixed $parameter The parameter value
|
||||
*
|
||||
* @return RequestContext The current instance, implementing a fluent interface
|
||||
* @return $this
|
||||
*/
|
||||
public function setParameter($name, $parameter)
|
||||
{
|
||||
|
@ -149,7 +149,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string $pattern The path pattern
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setPath($pattern)
|
||||
{
|
||||
@ -178,7 +178,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string $pattern The host pattern
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setHost($pattern)
|
||||
{
|
||||
@ -207,7 +207,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string|array $schemes The scheme or an array of schemes
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setSchemes($schemes)
|
||||
{
|
||||
@ -248,7 +248,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string|array $methods The method or an array of methods
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setMethods($methods)
|
||||
{
|
||||
@ -275,7 +275,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $options The options
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
@ -293,7 +293,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $options The options
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addOptions(array $options)
|
||||
{
|
||||
@ -313,7 +313,7 @@ class Route implements \Serializable
|
||||
* @param string $name An option name
|
||||
* @param mixed $value The option value
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setOption($name, $value)
|
||||
{
|
||||
@ -364,7 +364,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $defaults The defaults
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefaults(array $defaults)
|
||||
{
|
||||
@ -380,7 +380,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $defaults The defaults
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addDefaults(array $defaults)
|
||||
{
|
||||
@ -422,7 +422,7 @@ class Route implements \Serializable
|
||||
* @param string $name A variable name
|
||||
* @param mixed $default The default value
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setDefault($name, $default)
|
||||
{
|
||||
@ -449,7 +449,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $requirements The requirements
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequirements(array $requirements)
|
||||
{
|
||||
@ -465,7 +465,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param array $requirements The requirements
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function addRequirements(array $requirements)
|
||||
{
|
||||
@ -507,7 +507,7 @@ class Route implements \Serializable
|
||||
* @param string $key The key
|
||||
* @param string $regex The regex
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequirement($key, $regex)
|
||||
{
|
||||
@ -534,7 +534,7 @@ class Route implements \Serializable
|
||||
*
|
||||
* @param string $condition The condition
|
||||
*
|
||||
* @return Route The current Route instance
|
||||
* @return $this
|
||||
*/
|
||||
public function setCondition($condition)
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ class Section
|
||||
*
|
||||
* @param string|null $id null to create a new section, the identifier to re-open an existing one
|
||||
*
|
||||
* @return Section A child section
|
||||
* @return self
|
||||
*/
|
||||
public function open($id)
|
||||
{
|
||||
@ -93,7 +93,7 @@ class Section
|
||||
*
|
||||
* @param string $id The session identifier
|
||||
*
|
||||
* @return Section The current section
|
||||
* @return $this
|
||||
*/
|
||||
public function setId($id)
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ class Stopwatch
|
||||
* @param string $name The event name
|
||||
* @param string $category The event category
|
||||
*
|
||||
* @return StopwatchEvent A StopwatchEvent instance
|
||||
* @return StopwatchEvent
|
||||
*/
|
||||
public function start($name, $category = null)
|
||||
{
|
||||
@ -114,7 +114,7 @@ class Stopwatch
|
||||
*
|
||||
* @param string $name The event name
|
||||
*
|
||||
* @return StopwatchEvent A StopwatchEvent instance
|
||||
* @return StopwatchEvent
|
||||
*/
|
||||
public function stop($name)
|
||||
{
|
||||
@ -126,7 +126,7 @@ class Stopwatch
|
||||
*
|
||||
* @param string $name The event name
|
||||
*
|
||||
* @return StopwatchEvent A StopwatchEvent instance
|
||||
* @return StopwatchEvent
|
||||
*/
|
||||
public function lap($name)
|
||||
{
|
||||
@ -138,7 +138,7 @@ class Stopwatch
|
||||
*
|
||||
* @param string $name The event name
|
||||
*
|
||||
* @return StopwatchEvent A StopwatchEvent instance
|
||||
* @return StopwatchEvent
|
||||
*/
|
||||
public function getEvent($name)
|
||||
{
|
||||
@ -150,7 +150,7 @@ class Stopwatch
|
||||
*
|
||||
* @param string $id A section identifier
|
||||
*
|
||||
* @return StopwatchEvent[] An array of StopwatchEvent instances
|
||||
* @return StopwatchEvent[]
|
||||
*/
|
||||
public function getSectionEvents($id)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ class StopwatchEvent
|
||||
/**
|
||||
* Starts a new event period.
|
||||
*
|
||||
* @return StopwatchEvent The event
|
||||
* @return $this
|
||||
*/
|
||||
public function start()
|
||||
{
|
||||
@ -87,7 +87,7 @@ class StopwatchEvent
|
||||
/**
|
||||
* Stops the last started event period.
|
||||
*
|
||||
* @return StopwatchEvent The event
|
||||
* @return $this
|
||||
*
|
||||
* @throws \LogicException When stop() is called without a matching call to start()
|
||||
*/
|
||||
@ -115,7 +115,7 @@ class StopwatchEvent
|
||||
/**
|
||||
* Stops the current period and then starts a new one.
|
||||
*
|
||||
* @return StopwatchEvent The event
|
||||
* @return $this
|
||||
*/
|
||||
public function lap()
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ interface TemplateReferenceInterface
|
||||
* @param string $name The parameter name
|
||||
* @param string $value The parameter value
|
||||
*
|
||||
* @return TemplateReferenceInterface The TemplateReferenceInterface instance
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException if the parameter name is not supported
|
||||
*/
|
||||
|
@ -105,7 +105,7 @@ interface MessageCatalogueInterface
|
||||
*
|
||||
* The two catalogues must have the same locale.
|
||||
*
|
||||
* @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance
|
||||
* @param self $catalogue
|
||||
*/
|
||||
public function addCatalogue(MessageCatalogueInterface $catalogue);
|
||||
|
||||
@ -115,14 +115,14 @@ interface MessageCatalogueInterface
|
||||
*
|
||||
* This is used to provide default translations when they do not exist for the current locale.
|
||||
*
|
||||
* @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance
|
||||
* @param self $catalogue
|
||||
*/
|
||||
public function addFallbackCatalogue(MessageCatalogueInterface $catalogue);
|
||||
|
||||
/**
|
||||
* Gets the fallback catalogue.
|
||||
*
|
||||
* @return MessageCatalogueInterface|null A MessageCatalogueInterface instance or null when no fallback has been set
|
||||
* @return self|null A MessageCatalogueInterface instance or null when no fallback has been set
|
||||
*/
|
||||
public function getFallbackCatalogue();
|
||||
|
||||
|
@ -219,7 +219,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
|
||||
* @param string $property The name of the property
|
||||
* @param Constraint $constraint The constraint
|
||||
*
|
||||
* @return ClassMetadata This object
|
||||
* @return $this
|
||||
*/
|
||||
public function addPropertyConstraint($property, Constraint $constraint)
|
||||
{
|
||||
@ -240,7 +240,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
|
||||
* @param string $property
|
||||
* @param Constraint[] $constraints
|
||||
*
|
||||
* @return ClassMetadata
|
||||
* @return $this
|
||||
*/
|
||||
public function addPropertyConstraints($property, array $constraints)
|
||||
{
|
||||
@ -260,7 +260,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
|
||||
* @param string $property The name of the property
|
||||
* @param Constraint $constraint The constraint
|
||||
*
|
||||
* @return ClassMetadata This object
|
||||
* @return $this
|
||||
*/
|
||||
public function addGetterConstraint($property, Constraint $constraint)
|
||||
{
|
||||
@ -281,7 +281,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
|
||||
* @param string $property
|
||||
* @param Constraint[] $constraints
|
||||
*
|
||||
* @return ClassMetadata
|
||||
* @return $this
|
||||
*/
|
||||
public function addGetterConstraints($property, array $constraints)
|
||||
{
|
||||
@ -304,6 +304,10 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
|
||||
}
|
||||
|
||||
foreach ($source->getConstrainedProperties() as $property) {
|
||||
if ($this->hasPropertyMetadata($property)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($source->getPropertyMetadata($property) as $member) {
|
||||
$member = clone $member;
|
||||
|
||||
@ -360,7 +364,7 @@ class ClassMetadata extends GenericMetadata implements ClassMetadataInterface
|
||||
*
|
||||
* @param array $groupSequence An array of group names
|
||||
*
|
||||
* @return ClassMetadata
|
||||
* @return $this
|
||||
*
|
||||
* @throws GroupDefinitionException
|
||||
*/
|
||||
|
@ -116,7 +116,7 @@ class GenericMetadata implements MetadataInterface
|
||||
*
|
||||
* @param Constraint $constraint The constraint to add
|
||||
*
|
||||
* @return GenericMetadata This object
|
||||
* @return $this
|
||||
*
|
||||
* @throws ConstraintDefinitionException When trying to add the
|
||||
* {@link Traverse} constraint
|
||||
@ -157,7 +157,7 @@ class GenericMetadata implements MetadataInterface
|
||||
*
|
||||
* @param Constraint[] $constraints The constraints to add
|
||||
*
|
||||
* @return GenericMetadata This object
|
||||
* @return $this
|
||||
*/
|
||||
public function addConstraints(array $constraints)
|
||||
{
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\Validator\Tests\Mapping;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
use Symfony\Component\Validator\Constraints\Valid;
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
use Symfony\Component\Validator\Tests\Fixtures\ConstraintA;
|
||||
@ -295,4 +296,29 @@ class ClassMetadataTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->assertCount(0, $this->metadata->getPropertyMetadata('foo'), '->getPropertyMetadata() returns an empty collection if no metadata is configured for the given property');
|
||||
}
|
||||
|
||||
public function testMergeDoesOverrideConstraintsFromParentClassIfPropertyIsOverriddenInChildClass()
|
||||
{
|
||||
$parentMetadata = new ClassMetadata('\Symfony\Component\Validator\Tests\Mapping\ParentClass');
|
||||
$parentMetadata->addPropertyConstraint('example', new GreaterThan(0));
|
||||
|
||||
$childMetadata = new ClassMetadata('\Symfony\Component\Validator\Tests\Mapping\ChildClass');
|
||||
$childMetadata->addPropertyConstraint('example', new GreaterThan(1));
|
||||
$childMetadata->mergeConstraints($parentMetadata);
|
||||
|
||||
$expectedMetadata = new ClassMetadata('\Symfony\Component\Validator\Tests\Mapping\ChildClass');
|
||||
$expectedMetadata->addPropertyConstraint('example', new GreaterThan(1));
|
||||
|
||||
$this->assertEquals($expectedMetadata, $childMetadata);
|
||||
}
|
||||
}
|
||||
|
||||
class ParentClass
|
||||
{
|
||||
public $example = 0;
|
||||
}
|
||||
|
||||
class ChildClass extends ParentClass
|
||||
{
|
||||
public $example = 1; // overrides parent property of same name
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ interface ContextualValidatorInterface
|
||||
*
|
||||
* @param string $path The path to append
|
||||
*
|
||||
* @return ContextualValidatorInterface This validator
|
||||
* @return $this
|
||||
*/
|
||||
public function atPath($path);
|
||||
|
||||
@ -46,7 +46,7 @@ interface ContextualValidatorInterface
|
||||
* validate. If none is given,
|
||||
* "Default" is assumed
|
||||
*
|
||||
* @return ContextualValidatorInterface This validator
|
||||
* @return $this
|
||||
*/
|
||||
public function validate($value, $constraints = null, $groups = null);
|
||||
|
||||
@ -59,7 +59,7 @@ interface ContextualValidatorInterface
|
||||
* @param array|null $groups The validation groups to validate. If
|
||||
* none is given, "Default" is assumed
|
||||
*
|
||||
* @return ContextualValidatorInterface This validator
|
||||
* @return $this
|
||||
*/
|
||||
public function validateProperty($object, $propertyName, $groups = null);
|
||||
|
||||
@ -74,7 +74,7 @@ interface ContextualValidatorInterface
|
||||
* @param array|null $groups The validation groups to validate. If
|
||||
* none is given, "Default" is assumed
|
||||
*
|
||||
* @return ContextualValidatorInterface This validator
|
||||
* @return $this
|
||||
*/
|
||||
public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null);
|
||||
|
||||
|
@ -29,7 +29,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param ObjectInitializerInterface $initializer The initializer
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addObjectInitializer(ObjectInitializerInterface $initializer);
|
||||
|
||||
@ -38,7 +38,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param array $initializers The initializer
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addObjectInitializers(array $initializers);
|
||||
|
||||
@ -47,7 +47,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param string $path The path to the mapping file
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addXmlMapping($path);
|
||||
|
||||
@ -56,7 +56,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param array $paths The paths to the mapping files
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addXmlMappings(array $paths);
|
||||
|
||||
@ -65,7 +65,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param string $path The path to the mapping file
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addYamlMapping($path);
|
||||
|
||||
@ -74,7 +74,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param array $paths The paths to the mapping files
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addYamlMappings(array $paths);
|
||||
|
||||
@ -83,7 +83,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param string $methodName The name of the method
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addMethodMapping($methodName);
|
||||
|
||||
@ -92,7 +92,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param array $methodNames The names of the methods
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function addMethodMappings(array $methodNames);
|
||||
|
||||
@ -101,14 +101,14 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param Reader $annotationReader The annotation reader to be used
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function enableAnnotationMapping(Reader $annotationReader = null);
|
||||
|
||||
/**
|
||||
* Disables annotation based constraint mapping.
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function disableAnnotationMapping();
|
||||
|
||||
@ -117,7 +117,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param MetadataFactoryInterface $metadataFactory The metadata factory
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function setMetadataFactory(MetadataFactoryInterface $metadataFactory);
|
||||
|
||||
@ -126,7 +126,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param CacheInterface $cache The cache instance
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function setMetadataCache(CacheInterface $cache);
|
||||
|
||||
@ -135,7 +135,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param ConstraintValidatorFactoryInterface $validatorFactory The validator factory
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $validatorFactory);
|
||||
|
||||
@ -144,7 +144,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param TranslatorInterface $translator The translator instance
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function setTranslator(TranslatorInterface $translator);
|
||||
|
||||
@ -157,7 +157,7 @@ interface ValidatorBuilderInterface
|
||||
*
|
||||
* @param string $translationDomain The translation domain of the violation messages
|
||||
*
|
||||
* @return ValidatorBuilderInterface The builder object
|
||||
* @return $this
|
||||
*/
|
||||
public function setTranslationDomain($translationDomain);
|
||||
|
||||
|
@ -31,7 +31,7 @@ interface ConstraintViolationBuilderInterface
|
||||
*
|
||||
* @param string $path The property path
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*/
|
||||
public function atPath($path);
|
||||
|
||||
@ -41,7 +41,7 @@ interface ConstraintViolationBuilderInterface
|
||||
* @param string $key The name of the parameter
|
||||
* @param string $value The value to be inserted in the parameter's place
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setParameter($key, $value);
|
||||
|
||||
@ -52,7 +52,7 @@ interface ConstraintViolationBuilderInterface
|
||||
* the values to be inserted in their place as
|
||||
* values
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setParameters(array $parameters);
|
||||
|
||||
@ -62,7 +62,7 @@ interface ConstraintViolationBuilderInterface
|
||||
*
|
||||
* @param string $translationDomain The translation domain
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*
|
||||
* @see \Symfony\Component\Translation\TranslatorInterface
|
||||
*/
|
||||
@ -73,7 +73,7 @@ interface ConstraintViolationBuilderInterface
|
||||
*
|
||||
* @param mixed $invalidValue The invalid value
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setInvalidValue($invalidValue);
|
||||
|
||||
@ -83,7 +83,7 @@ interface ConstraintViolationBuilderInterface
|
||||
*
|
||||
* @param int $number The number for determining the plural form
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*
|
||||
* @see \Symfony\Component\Translation\TranslatorInterface::transChoice()
|
||||
*/
|
||||
@ -94,7 +94,7 @@ interface ConstraintViolationBuilderInterface
|
||||
*
|
||||
* @param string|null $code The violation code
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code);
|
||||
|
||||
@ -103,7 +103,7 @@ interface ConstraintViolationBuilderInterface
|
||||
*
|
||||
* @param mixed $cause The cause of the violation
|
||||
*
|
||||
* @return ConstraintViolationBuilderInterface This builder
|
||||
* @return $this
|
||||
*/
|
||||
public function setCause($cause);
|
||||
|
||||
|
Reference in New Issue
Block a user