canvural
Repos
45
Followers
144
Following
88

Library to generate fake data for OpenAPI request/response/schemas

81
3

Extra strict and opinionated PHPStan rules for Laravel.

60
3

Set of routes to manage your data in E2E tests

5
0

⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

4224
295

PHPStan rule for static analysis of Blade templates

51
2

PHP Static Analysis Tool - discover bugs in your code without running it!

11347
782

Events

issue comment
Larastan is not auto-discovering service providers.

Just an idea, I added a ComposerHelper class to PHPStan

Where does $root come from? All those helpers need that.

$root is current working directory. We can get that from PHPStan config.

Created at 4 hours ago
issue comment
Larastan is not auto-discovering service providers.

Just an idea, I added a ComposerHelper class to PHPStan a while back: https://github.com/phpstan/phpstan-src/blob/5cf39bc960b4b9dbc01be6906cbc1d71285118f7/src/Internal/ComposerHelper.php

Could we use the same logic here also?

Created at 4 hours ago
Created at 19 hours ago
Created at 2 days ago
closed issue
[Issue] Nova: Main Menu does not understand the larastan
  • Larastan Version: 2.2.0
  • --level used: 8

Description

  • Larastan does not understand the return array when I create the custom mainmenu.

Laravel code where the issue was found

Nova::mainMenu(fn (Request $request, Menu $menu): array => [
    MenuSection::make('ABC', [
        MenuItem::resource(ABC::class),
        MenuItem::resource(XYZ::class),
    ])->icon('abc-xyz-group'),
]);

Vendor File of mainMenu

/**
* Set the main menu for Nova.
*
* @param  (\Closure(\Illuminate\Http\Request, \Laravel\Nova\Menu\Menu):\Laravel\Nova\Menu\Menu|array)  $callback
* @return static
*/
public static function mainMenu($callback)
{
    static::$mainMenuCallback = $callback;

    return new static();
}

Error

Parameter #1 $callback of static method Laravel\Nova\Nova::mainMenu() expects
  array|(Closure(Illuminate\Http\Request, Laravel\Nova\Menu\Menu): Laravel\Nova\Menu\Menu),
  Closure(Illuminate\Http\Request, Laravel\Nova\Menu\Menu): array{Laravel\Nova\Menu\MenuSection, Laravel\Nova\Menu\MenuSection, Laravel\Nova\Menu\MenuSection, Laravel\Nova\Menu\MenuSection} given.
Created at 4 days ago
issue comment
[Issue] Nova: Main Menu does not understand the larastan

Hi,

The Laravel Nova team needs to fix their typehints. Please report it there.

Thank you.

Created at 4 days ago
closed issue
Console Command

Hi, in my local projects i created a Laravel command to run Larastan as we run the test suites:

php artisan analyse

It's basically a super simplified version of the standard Laravel php artisan test command. Would it be interesting as a PR to the project?

Created at 4 days ago
issue comment
Console Command

Hi,

In the early versions of Larastan there was actually an Artisan command php artisan code:analyse But it was causing too many issues later on, so we removed it.

As Larastan is just a PHPStan extension, I don't see a need for a command.

Thank you.

Created at 4 days ago
Created at 4 days ago
canvural delete branch dependabot/composer/orchestra/testbench-tw-7.8.0
Created at 4 days ago

build(deps-dev): update orchestra/testbench requirement from ^7.7.1 to ^7.8.0 (#103)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Created at 4 days ago
pull request closed
build(deps-dev): update orchestra/testbench requirement from ^7.7.1 to ^7.8.0

Updates the requirements on orchestra/testbench to permit the latest version.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Created at 4 days ago
closed issue
Missing `Collection::mapWithKeys` support
  • Larastan Version: 1.0.3

Description

Would be nice if PHPStan could resolve the new type of a Collection when I call a mapWithKeys function on it.

I'm currently using this stub as a workaround:

/**
 * @template TReturnIndex of array-key
 * @template TReturnValue
 * @param callable(TValue, TKey): array<TReturnIndex, TReturnValue> $callable
 * @return static<TReturnIndex, TReturnValue>
 */
public function mapWithKeys($callable) {}

I realize that I'm using an older version of the package, so the latest version might already support this but I've not been able to find the method mapWithKeys in any version.

Created at 5 days ago
issue comment
Missing `Collection::mapWithKeys` support

Hi,

With Laravel 9 all the collection types are now moved to Laravel itself. For mapWithKeys you can see it here: https://github.com/laravel/framework/blob/d65260d12656e41a371a054a60dbe6e2163ebcd5/src/Illuminate/Collections/Enumerable.php#L678

Larastan 2 has support for Laravel 9. So you should already have the types. If you are using Larastan 1.x though, we do not maintain that version any more.

Created at 5 days ago
canvural delete branch dependabot/composer/orchestra/testbench-tw-7.7.1
Created at 5 days ago

build(deps-dev): update orchestra/testbench requirement from ^7.5.0 to ^7.7.1 (#102)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Created at 5 days ago
pull request closed
build(deps-dev): update orchestra/testbench requirement from ^7.5.0 to ^7.7.1

Updates the requirements on orchestra/testbench to permit the latest version.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Created at 5 days ago
Created at 6 days ago
issue comment
Fig does 'nothing' and fig doctor reports no socket file in tmp (Linux, Ubuntu)

I have the same issue. And a temporary solution is to run fig restart After that it starts working again.

Created at 6 days ago
issue comment
casting of enum values

This is correct. In PHP numeric strings in array keys are cast to int: https://3v4l.org/MDqMd

Created at 6 days ago
issue comment
callable(mixed...) : mixed accepts callables with incompatible argument types

This is now reported in level 9 (checkExplicitMixed: true): https://phpstan.org/r/27028b40-abff-42c5-b92a-d8d515b59aeb

Created at 6 days ago
issue comment
curl_setopt with CURLOPT_POSTFIELDS → Parameter #3 $value of function curl_setopt expects non-empty-string, string given.

@dwenaus You don't need to disable PHPStan. You can easily ignore the errors until it gets fixed.

Created at 6 days ago
canvural delete branch dependabot/composer/phpstan/phpstan-tw-1.8.6
Created at 1 week ago

build(deps): update phpstan/phpstan requirement from ^1.8.5 to ^1.8.6 (#101)

Created at 1 week ago
pull request closed
build(deps): update phpstan/phpstan requirement from ^1.8.5 to ^1.8.6

Updates the requirements on phpstan/phpstan to permit the latest version.

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Created at 1 week ago
pull request closed
Add @mixin Query\Builder to EloquentBuilder.stub
  • [ ] Added or updated tests (in progress, failing tests at the moment)
  • [x] Documented user facing changes (not needed)
  • [x] Updated CHANGELOG.md

Changes

Resolves #1346 as @xwillq is proposing in the issues comments.

As larastan is reading docblocks from stubs instead from source code, we need to add the mixins from Query\Builder in the Eloquent\Builder stub.

Reference: Laravel 9 docblock source code of Eloquent\Builder

Breaking changes

No breaking changes, only functionality is added

Created at 1 week ago
issue comment
Add @mixin Query\Builder to EloquentBuilder.stub

Hi,

The underlying issue of #1346 is more complicated. And this fix is not correct. We already have an extension that handles the normal query builder calls on Eloquent builder.

Thank you though.

Created at 1 week ago
started
Created at 1 week ago
Created at 1 week ago
Created at 1 week ago