laravel-actions
laravel-actions copied to clipboard
PHP Stan support
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...