minor #33300 Add missing return annotations on magic methods (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
Add missing return annotations on magic methods
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
My script had a bug, spotted by reviewing #33267
These annotations express our intention to add real return types in a future major release (likely v6)
Commits
-------
10983fcb17
Add missing return annotations on magic methods
This commit is contained in:
commit
5255ab89d2
@ -83,6 +83,8 @@ class Cookie
|
||||
|
||||
/**
|
||||
* Returns the HTTP representation of the Cookie.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
@ -59,6 +59,9 @@ class ReferenceConfigurator extends AbstractConfigurator
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->id;
|
||||
|
@ -33,6 +33,9 @@ class Variable
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->name;
|
||||
|
@ -33,6 +33,9 @@ class Node
|
||||
$this->attributes = $attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$attributes = [];
|
||||
|
@ -114,6 +114,9 @@ abstract class DataCollector implements DataCollectorInterface
|
||||
return $casters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
if (__CLASS__ !== $c = (new \ReflectionMethod($this, 'serialize'))->getDeclaringClass()->name) {
|
||||
|
@ -870,6 +870,9 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
$this->__construct($environment, $debug);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
if (__CLASS__ !== $c = (new \ReflectionMethod($this, 'serialize'))->getDeclaringClass()->name) {
|
||||
|
@ -288,6 +288,9 @@ class Profile
|
||||
return isset($this->collectors[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
return ['token', 'parent', 'children', 'collectors', 'ip', 'method', 'url', 'time', 'statusCode'];
|
||||
|
@ -125,6 +125,9 @@ class DataPart extends TextPart
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
// converts the body to a string
|
||||
|
@ -179,6 +179,9 @@ class TextPart extends AbstractPart
|
||||
return 'quoted-printable';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function __sleep()
|
||||
{
|
||||
// convert resources to strings for serialization
|
||||
|
@ -26,6 +26,9 @@ class ConstStub extends Stub
|
||||
$this->value = 1 < \func_num_args() ? $value : $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->value;
|
||||
|
@ -137,6 +137,9 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($key)
|
||||
{
|
||||
return null !== $this->seek($key);
|
||||
@ -165,6 +168,9 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
throw new \BadMethodCallException(self::class.' objects are immutable.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$value = $this->getValue();
|
||||
|
Reference in New Issue
Block a user