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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value of checkOctaneCompatibility #979

Closed
bytestream opened this issue Oct 25, 2021 · 9 comments
Closed

Default value of checkOctaneCompatibility #979

bytestream opened this issue Oct 25, 2021 · 9 comments

Comments

@bytestream
Copy link

bytestream commented Oct 25, 2021

  • Larastan Version: 6.20.36
  • --level used: 8

Description

Upgrading from v0.7.13 to v0.7.14 produces:

Consider using bind method instead or pass a closure.            
 馃挕 See: https://laravel.com/docs/octane#dependency-injection-and-octane  

The default is supposed to be off. I suspect it's occurring due to changes to extension.neon in c7e41a8

@szepeviktor szepeviktor changed the title checkOctaneCompatibility default NoModelMake should default to false Oct 26, 2021
@szepeviktor
Copy link
Collaborator

szepeviktor commented Oct 26, 2021

@szepeviktor szepeviktor changed the title NoModelMake should default to false Default value of checkOctaneCompatibility Oct 26, 2021
@canvural
Copy link
Collaborator

Hi,

Default value is still off. I tested in a couple of projects, and it seems fine.

@bytestream
Copy link
Author

@canvural Sorry I should have provided a reproducer. Try using the below - it's reproducable in a fresh laravel 6 install with the below

<?php declare(strict_types=1);

namespace App\Providers;

use Illuminate\Support\Manager;
use Illuminate\Support\ServiceProvider;

class WidgetServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->app->singleton('core.plugins.widgetFactory', function () {
            return $this->app->make(Manager::class)->driver('widget');
        });
    }
}
includes:
    - ./vendor/nunomaduro/larastan/extension.neon

parameters:
    level: 8
    paths:
        - app/Providers/WidgetServiceProvider.php
$ ./vendor/bin/phpstan analyse
Note: Using configuration file /larastan-test/phpstan.neon.dist.
 1/1 [鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔] 100%

 ------ ------------------------------------------------------------------------ 
  Line   WidgetServiceProvider.php                                               
 ------ ------------------------------------------------------------------------ 
  13     Consider using bind method instead or pass a closure.                   
         馃挕 See: https://laravel.com/docs/octane#dependency-injection-and-octane  
 ------ ------------------------------------------------------------------------ 

                                                                                                                   
 [ERROR] Found 1 error                                                                                             
                                                                                                                  

Switch back:

$ composer require nunomaduro/larastan:0.7.13 --dev
./composer.json has been updated
Running composer update nunomaduro/larastan
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Downgrading nunomaduro/larastan (v0.7.14 => v0.7.13)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading nunomaduro/larastan (v0.7.13)
  - Downgrading nunomaduro/larastan (v0.7.14 => v0.7.13): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
78 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

$ ./vendor/bin/phpstan analyse
Note: Using configuration file /larastan-test/phpstan.neon.dist.
 1/1 [鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔] 100%


                                                                                                                   
 [OK] No errors                                                                                                    
                                                                                                                   

@szepeviktor szepeviktor reopened this Oct 26, 2021
@szepeviktor
Copy link
Collaborator

Where is Octane in it??

@bytestream
Copy link
Author

Where is Octane in it??

What do you mean? I'm not using Octane.

@canvural
Copy link
Collaborator

Oh I see the error. c7e41a8 added tags to rules in extension.neon

Fix is easy but how to release it? 馃槄 We have changes in master that shouldn't be in the release.

Creating new branch from the 0.7.14 tag and release on that branch?

@szepeviktor
Copy link
Collaborator

Creating new branch from the 0.7.14 tag and release on that branch?

Yes!

@canvural
Copy link
Collaborator

Ok https://github.com/nunomaduro/larastan/releases/tag/v0.7.15 should fix the issue!

@bytestream
Copy link
Author

Yep that did the trick. Thanks guys 鉂わ笍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants