Merge pull request #20 from JeppeKnockaert/fix-php84-deprecations

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