Replace implicitly nullable parameters for PHP 8.4

This commit is contained in:
Jeppe Knockaert
2024-11-27 11:22:09 +01:00
parent 67e478e26a
commit 0fd348d3fe
4 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ class DocBlock implements \Reflector
*/
public function __construct(
$docblock,
Context $context = null,
Location $location = null
?Context $context = null,
?Location $location = null
) {
if (is_object($docblock)) {
if (!method_exists($docblock, 'getDocComment')) {
@@ -38,7 +38,7 @@ class Description implements \Reflector
* @param string $content The description's conetnts.
* @param DocBlock $docblock The DocBlock which this description belongs to.
*/
public function __construct($content, DocBlock $docblock = null)
public function __construct($content, ?DocBlock $docblock = null)
{
$this->setContent($content)->setDocBlock($docblock);
}
@@ -190,7 +190,7 @@ class Description implements \Reflector
*
* @return $this
*/
public function setDocBlock(DocBlock $docblock = null)
public function setDocBlock(?DocBlock $docblock = null)
{
$this->docblock = $docblock;
+6 -6
View File
@@ -113,8 +113,8 @@ class Tag implements \Reflector
*/
final public static function createInstance(
$tag_line,
DocBlock $docblock = null,
Location $location = null
?DocBlock $docblock = null,
?Location $location = null
) {
if (!preg_match(
'/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us',
@@ -194,8 +194,8 @@ class Tag implements \Reflector
public function __construct(
$name,
$content,
DocBlock $docblock = null,
Location $location = null
?DocBlock $docblock = null,
?Location $location = null
) {
$this
->setName($name)
@@ -323,7 +323,7 @@ class Tag implements \Reflector
*
* @return $this
*/
public function setDocBlock(DocBlock $docblock = null)
public function setDocBlock(?DocBlock $docblock = null)
{
$this->docblock = $docblock;
@@ -347,7 +347,7 @@ class Tag implements \Reflector
*
* @return $this
*/
public function setLocation(Location $location = null)
public function setLocation(?Location $location = null)
{
$this->location = $location;
@@ -60,7 +60,7 @@ class Collection extends \ArrayObject
*/
public function __construct(
array $types = array(),
Context $context = null
?Context $context = null
) {
$this->context = null === $context ? new Context() : $context;