Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC in barryvdh/laravel-ide-helper - FakeModelsCommand::getPropertiesFromTable() changed from protected to public #137

Closed
caugner opened this issue Apr 2, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@caugner
Copy link
Contributor

caugner commented Apr 2, 2021

Describe the bug
After updating barryvdh/laravel-ide-helper from 2.9.0 to 2.9.3, Psalm fails with the following fatal error:

$ vendor/bin/psalm --report=junit.xml
Scanning files...
Exception: No application encryption key has been specified.
Skipping \Illuminate\Support\Facades\Crypt.
Exception: No application encryption key has been specified.
Skipping \Illuminate\Support\Facades\Crypt.
   Symfony\Component\ErrorHandler\Error\FatalError 
  Access level to Psalm\LaravelPlugin\FakeModelsCommand::getPropertiesFromTable() must be public (as in class Barryvdh\LaravelIdeHelper\Console\ModelsCommand)
  at vendor/psalm/plugin-laravel/src/FakeModelsCommand.php:50
     46▕      * Load the properties from the database table.
     47▕      *
     48▕      * @param \Illuminate\Database\Eloquent\Model $model
     49▕      */
  ➜  50▕     protected function getPropertiesFromTable($model) : void
     51▕     {
     52▕         $table_name = $model->getTable();
     53▕ 
     54▕         if (!isset($this->schema->tables[$table_name])) {
   Whoops\Exception\ErrorException 
  Access level to Psalm\LaravelPlugin\FakeModelsCommand::getPropertiesFromTable() must be public (as in class Barryvdh\LaravelIdeHelper\Console\ModelsCommand)
  at vendor/psalm/plugin-laravel/src/FakeModelsCommand.php:50
     46▕      * Load the properties from the database table.
     47▕      *
     48▕      * @param \Illuminate\Database\Eloquent\Model $model
     49▕      */
  ➜  50▕     protected function getPropertiesFromTable($model) : void
     51▕     {
     52▕         $table_name = $model->getTable();
     53▕ 
     54▕         if (!isset($this->schema->tables[$table_name])) {
      +1 vendor frames 
  2   [internal]:0
      Whoops\Run::handleShutdown()

Impacted Versions

composer show | grep -E 'psalm|laravel'
andrey-helldar/laravel-lang-publisher v8.4.0    Publisher lang files for the Laravel Framework + Laravel Jetstream from Laravel-Lang/lang
barryvdh/laravel-ide-helper           v2.9.3    Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
beyondcode/laravel-dump-server        1.7.0     Symfony Var-Dump Server for Laravel
fruitcake/laravel-cors                v2.0.3    Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
laravel-lang/lang                     8.1.1     Languages for Laravel
laravel/framework                     v8.35.1   The Laravel Framework.
laravel/sanctum                       v2.9.3    Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.
laravel/tinker                        v2.6.1    Powerful REPL for the Laravel framework.
laravel/ui                            v3.2.0    Laravel UI utilities and presets.
psalm/plugin-laravel                  v1.4.2    A Laravel plugin for Psalm
sentry/sentry-laravel                 2.4.2     Laravel SDK for Sentry (https://sentry.io)
spatie/laravel-ray                    1.17.1    Easily debug Laravel apps
vimeo/psalm                           4.7.0     A static analysis tool for finding errors in PHP applications

Additional context
This breaking change was introduced in barryvdh/laravel-ide-helper 2.9.2: barryvdh/laravel-ide-helper@f0c138c (in barryvdh/laravel-ide-helper#945)

See the corresponding blame: https://github.com/barryvdh/laravel-ide-helper/blame/1010cdbd2612f8cbfce18c9efa3588a3c6bc57ff/src/Console/ModelsCommand.php#L419

@caugner caugner added the bug Something isn't working label Apr 2, 2021
@caugner
Copy link
Contributor Author

caugner commented Apr 2, 2021

See also #136.

@mr-feek
Copy link
Collaborator

mr-feek commented Jun 29, 2021

I'm gonna close this for now and say that we only support "barryvdh/laravel-ide-helper": ">=2.8.0 <2.9.2". I'm working on removing ide-helper completely at the moment.

@mr-feek mr-feek closed this as completed Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants