home.social

#larastan — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #larastan, aggregated by home.social.

fetched live
  1. Any PHPStan/Larastan experts out there? Currently on level 2 and getting an error about a missing var. I don't really want to add another line to fix nor do I want to ignore this line, is there a better way?

    Maybe @jclermont knows?

    #laravel #larastan

  2. - "My library has 100% code coverage!"
    - "How so?"
    - "Because I test thoroughly"

    * opens editor *

    * CTRL+F *

    * @phpstan-ignore-line *

    * Found 587 occurrences *

    #Programming #PHP #PHPStan #Larastan #Laravel #Symfony #CodeCoverage #Coding #Code #SoftwareDevelopment #Software #WebDevelopment #WebDev

  3. Setting up #PHPStorm to handle #PHPStan / #Larastan, Laravel Pint, Code Sniffer and CS_Fixer (not sure if this is needed with Laravel Pint). What is the best way to set this up so I don't have to set this up for every project? Tried to point to a globally installed version of each but wasn't able to easily do this.

    Suggestions or a pointer to a tutorial would be fabuluous!

  4. New plugin for #PHP #Pest to give you type coverage right in Pest. Simply `composer require pestphp/pest-plugin-type-coverage —dev` and then run Pest with `pest —type-coverage -min=100` Perhaps you won’t need #PHPStan or #LaraStan anymore.

    Four other great new features in Pest in Like Downing’s video on Laracasts here laracasts.com/series/lukes-lar

  5. Last two days I struggled getting #larastan to accept

    $response = collect($rows->response);

    The error was 'Unable to resolve the template type TKey/TValue in call to function collect‘.

    The solution (for me) is to add the type onto a variable first, and then use that variable in the #laravel collect() method. Hope this helps others, or if you feel this can be improved upon, please do let me know (suggestion came from this issue github.com/nunomaduro/larastan)

  6. Using #larastan (level 6), down to 11 errors now. Struggling to get my arrays typed correctly, and handling property assignments now. Otherwise, enjoying the massive cleanup of my code.