Skip to content

Commit 4f6d6eb

Browse files
authored
Fix deprecated nullable type declarations for PHP 8.4+ compatibility (#146)
* Fix deprecated nullable type declarations in ComposerLocator and ReflectionProperty
1 parent 611b220 commit 4f6d6eb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Locator/ComposerLocator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ComposerLocator implements LocatorInterface
2828
*/
2929
private $loader;
3030

31-
public function __construct(ClassLoader $composerLoader = null)
31+
public function __construct(?ClassLoader $composerLoader = null)
3232
{
3333
if ($composerLoader === null) {
3434
$loaders = spl_autoload_functions();

src/ReflectionProperty.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class ReflectionProperty extends BaseReflectionProperty
6868
public function __construct(
6969
string $className,
7070
string $propertyName,
71-
Property|Param $propertyOrPromotedParam = null,
72-
PropertyItem|Param $propertyItemOrPromotedParam = null
71+
Property|Param|null $propertyOrPromotedParam = null,
72+
PropertyItem|Param|null $propertyItemOrPromotedParam = null
7373
) {
7474
$this->className = ltrim($className, '\\');
7575
if (!$propertyOrPromotedParam || !$propertyItemOrPromotedParam) {

0 commit comments

Comments
 (0)