Skip to content

ModelsCommand generates warning when using PHP 8.4 due to deprecated implicitly nullable parameter declarationsΒ #1626

@Balothar12

Description

@Balothar12

Versions:

  • ide-helper Version: 3.2.2
  • Laravel Version: 11.34.2
  • PHP Version: 8.4.1

Description:

PHP 8.4 deprecates implicitly nullable parameter declarations (see https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated). However, ModelsCommand uses one in getReturnTypeFromDocBlock(), for $reflectorForContext (see below).

grafik

This does not cause any errors, but it does generate warnings every time any artisan command is run (doesn't have to be ModelsCommand).

grafik

From what I can see, the fix should simply be using ?\Reflector $reflectorForContext = null.

Steps To Reproduce:

  • Use a Laravel project with PHP 8.4
  • Install the ide-helper package
  • Run any artisan command

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions