Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
minor #21054 Fix @return statements to use $this or static when relev…
…ant (fabpot)

This PR was merged into the 2.7 branch.

Discussion
----------

Fix @return statements to use $this or static when relevant

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20290
| License       | MIT
| Doc PR        | n/a

see #20290

Commits
-------

3c0693d fixed @return when returning this or static
  • Loading branch information
fabpot committed Dec 27, 2016
2 parents 2e0b61e + 3c0693d commit eeb9192
Show file tree
Hide file tree
Showing 96 changed files with 465 additions and 467 deletions.
6 changes: 3 additions & 3 deletions src/Symfony/Bridge/Twig/NodeVisitor/Scope.php
Expand Up @@ -42,7 +42,7 @@ public function __construct(Scope $parent = null)
/**
* Opens a new child scope.
*
* @return Scope
* @return self
*/
public function enter()
{
Expand All @@ -52,7 +52,7 @@ public function enter()
/**
* Closes current scope and returns parent one.
*
* @return Scope|null
* @return self|null
*/
public function leave()
{
Expand All @@ -67,7 +67,7 @@ public function leave()
* @param string $key
* @param mixed $value
*
* @return Scope Current scope
* @return $this
*
* @throws \LogicException
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/BrowserKit/Cookie.php
Expand Up @@ -121,7 +121,7 @@ public function __toString()
* @param string $cookie A Set-Cookie header value
* @param string $url The base URL
*
* @return Cookie A Cookie instance
* @return static
*
* @throws \InvalidArgumentException
*/
Expand Down
Expand Up @@ -85,7 +85,7 @@ public function prototype($type)
* 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()
{
Expand All @@ -101,7 +101,7 @@ public function addDefaultsIfNotSet()
*
* This method is applicable to prototype nodes only.
*
* @return ArrayNodeDefinition
* @return $this
*/
public function addDefaultChildrenIfNoneSet($children = null)
{
Expand All @@ -115,7 +115,7 @@ public function addDefaultChildrenIfNoneSet($children = null)
*
* This method is applicable to prototype nodes only.
*
* @return ArrayNodeDefinition
* @return $this
*/
public function requiresAtLeastOneElement()
{
Expand All @@ -129,7 +129,7 @@ public function requiresAtLeastOneElement()
*
* If used all keys have to be defined in the same configuration file.
*
* @return ArrayNodeDefinition
* @return $this
*/
public function disallowNewKeysInSubsequentConfigs()
{
Expand All @@ -144,7 +144,7 @@ public function disallowNewKeysInSubsequentConfigs()
* @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)
{
Expand Down Expand Up @@ -179,7 +179,7 @@ public function fixXmlConfig($singular, $plural = null)
* @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)
{
Expand All @@ -194,7 +194,7 @@ public function useAttributeAsKey($name, $removeKeyItem = true)
*
* @param bool $allow
*
* @return ArrayNodeDefinition
* @return $this
*/
public function canBeUnset($allow = true)
{
Expand All @@ -216,7 +216,7 @@ public function canBeUnset($allow = true)
* enableableArrayNode: {enabled: false, ...} # The config is disabled
* enableableArrayNode: false # The config is disabled
*
* @return ArrayNodeDefinition
* @return $this
*/
public function canBeEnabled()
{
Expand Down Expand Up @@ -246,7 +246,7 @@ public function canBeEnabled()
*
* By default, the section is enabled.
*
* @return ArrayNodeDefinition
* @return $this
*/
public function canBeDisabled()
{
Expand All @@ -266,7 +266,7 @@ public function canBeDisabled()
/**
* Disables the deep merging of the node.
*
* @return ArrayNodeDefinition
* @return $this
*/
public function performNoDeepMerging()
{
Expand All @@ -284,7 +284,7 @@ public function performNoDeepMerging()
* you want to send an entire configuration array through a special
* tree that processes only part of the array.
*
* @return ArrayNodeDefinition
* @return $this
*/
public function ignoreExtraKeys()
{
Expand All @@ -298,7 +298,7 @@ public function ignoreExtraKeys()
*
* @param bool $bool Whether to enable key normalization
*
* @return ArrayNodeDefinition
* @return $this
*/
public function normalizeKeys($bool)
{
Expand All @@ -320,7 +320,7 @@ public function normalizeKeys($bool)
*
* @param NodeDefinition $node A NodeDefinition instance
*
* @return ArrayNodeDefinition This node
* @return $this
*/
public function append(NodeDefinition $node)
{
Expand Down
Expand Up @@ -25,7 +25,7 @@ class EnumNodeDefinition extends ScalarNodeDefinition
/**
* @param array $values
*
* @return EnumNodeDefinition|$this
* @return $this
*/
public function values(array $values)
{
Expand Down
22 changes: 11 additions & 11 deletions src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
Expand Up @@ -40,7 +40,7 @@ public function __construct(NodeDefinition $node)
*
* @param \Closure $then
*
* @return ExprBuilder
* @return $this
*/
public function always(\Closure $then = null)
{
Expand All @@ -60,7 +60,7 @@ public function always(\Closure $then = null)
*
* @param \Closure $closure
*
* @return ExprBuilder
* @return $this
*/
public function ifTrue(\Closure $closure = null)
{
Expand All @@ -76,7 +76,7 @@ public function ifTrue(\Closure $closure = null)
/**
* Tests if the value is a string.
*
* @return ExprBuilder
* @return $this
*/
public function ifString()
{
Expand All @@ -88,7 +88,7 @@ public function ifString()
/**
* Tests if the value is null.
*
* @return ExprBuilder
* @return $this
*/
public function ifNull()
{
Expand All @@ -100,7 +100,7 @@ public function ifNull()
/**
* Tests if the value is an array.
*
* @return ExprBuilder
* @return $this
*/
public function ifArray()
{
Expand All @@ -114,7 +114,7 @@ public function ifArray()
*
* @param array $array
*
* @return ExprBuilder
* @return $this
*/
public function ifInArray(array $array)
{
Expand All @@ -128,7 +128,7 @@ public function ifInArray(array $array)
*
* @param array $array
*
* @return ExprBuilder
* @return $this
*/
public function ifNotInArray(array $array)
{
Expand All @@ -142,7 +142,7 @@ public function ifNotInArray(array $array)
*
* @param \Closure $closure
*
* @return ExprBuilder
* @return $this
*/
public function then(\Closure $closure)
{
Expand All @@ -154,7 +154,7 @@ public function then(\Closure $closure)
/**
* Sets a closure returning an empty array.
*
* @return ExprBuilder
* @return $this
*/
public function thenEmptyArray()
{
Expand All @@ -170,7 +170,7 @@ public function thenEmptyArray()
*
* @param string $message
*
* @return ExprBuilder
* @return $this
*
* @throws \InvalidArgumentException
*/
Expand All @@ -184,7 +184,7 @@ public function thenInvalid($message)
/**
* Sets a closure unsetting this key of the array at validation time.
*
* @return ExprBuilder
* @return $this
*
* @throws UnsetKeyException
*/
Expand Down
Expand Up @@ -37,7 +37,7 @@ public function __construct(NodeDefinition $node)
*
* @param bool $allow
*
* @return MergeBuilder
* @return $this
*/
public function allowUnset($allow = true)
{
Expand All @@ -51,7 +51,7 @@ public function allowUnset($allow = true)
*
* @param bool $deny Whether the overwriting is forbidden or not
*
* @return MergeBuilder
* @return $this
*/
public function denyOverwrite($deny = true)
{
Expand Down
Expand Up @@ -42,7 +42,7 @@ public function __construct()
*
* @param ParentNodeDefinitionInterface $parent The parent node
*
* @return NodeBuilder This node builder
* @return $this
*/
public function setParent(ParentNodeDefinitionInterface $parent = null)
{
Expand Down Expand Up @@ -182,7 +182,7 @@ public function node($name, $type)
*
* @param NodeDefinition $node
*
* @return NodeBuilder This node builder
* @return $this
*/
public function append(NodeDefinition $node)
{
Expand All @@ -207,7 +207,7 @@ public function append(NodeDefinition $node)
* @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)
{
Expand Down

0 comments on commit eeb9192

Please sign in to comment.