Skip to content

Commit

Permalink
Merge pull request #20 from JeppeKnockaert/fix-php84-deprecations
Browse files Browse the repository at this point in the history
Fix PHP 8.4 deprecations
  • Loading branch information
barryvdh authored Nov 27, 2024
2 parents 67e478e + 0fd348d commit fba297a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/Barryvdh/Reflection/DocBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Barryvdh/Reflection/DocBlock/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -190,7 +190,7 @@ public function getDocBlock()
*
* @return $this
*/
public function setDocBlock(DocBlock $docblock = null)
public function setDocBlock(?DocBlock $docblock = null)
{
$this->docblock = $docblock;

Expand Down
12 changes: 6 additions & 6 deletions src/Barryvdh/Reflection/DocBlock/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -194,8 +194,8 @@ final public static function registerTagHandler($tag, $handler)
public function __construct(
$name,
$content,
DocBlock $docblock = null,
Location $location = null
?DocBlock $docblock = null,
?Location $location = null
) {
$this
->setName($name)
Expand Down Expand Up @@ -323,7 +323,7 @@ public function getDocBlock()
*
* @return $this
*/
public function setDocBlock(DocBlock $docblock = null)
public function setDocBlock(?DocBlock $docblock = null)
{
$this->docblock = $docblock;

Expand All @@ -347,7 +347,7 @@ public function getLocation()
*
* @return $this
*/
public function setLocation(Location $location = null)
public function setLocation(?Location $location = null)
{
$this->location = $location;

Expand Down
2 changes: 1 addition & 1 deletion src/Barryvdh/Reflection/DocBlock/Type/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit fba297a

Please sign in to comment.