laravel-actions icon indicating copy to clipboard operation
laravel-actions copied to clipboard

PHP Stan support

Open sandeshjangam opened this issue 1 year ago • 6 comments

It doesn't throw errors in PHPStan if args type, numbers etc. mismatches...

namespace App\Authentication\Actions;

use Lorisleiva\Actions\Concerns\AsAction;

class UpdateUserPassword
{
    use AsAction;

    public function handle(User $user, string $newPassword)
    {
        $user->password = Hash::make($newPassword);
        $user->save();
    }
}
// Equivalent to "UpdateUserPassword::make()->handle($user, 'secret')".
UpdateUserPassword::run($user, 'secret');

If I use this - UpdateUserPassword::make()->handle($user, 'secret') Larstan properly check args type, count etc

For this - UpdateUserPassword::run($user, 'secret') Larstand doesn't trigger any error

How can I add support to this? I am open to creating a PR. A little head start will be good...

sandeshjangam avatar Oct 03 '23 09:10 sandeshjangam