Skip to content

Commit

Permalink
Added docBlock annotations to assist with IDE auto complete for Actio…
Browse files Browse the repository at this point in the history
…ns (#252)

Co-authored-by: Travis Austin <[email protected]>
  • Loading branch information
travisaustin and Travis Austin authored Aug 24, 2023
1 parent 0b1896c commit 5250614
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Concerns/AsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

namespace Lorisleiva\Actions\Concerns;

/**
* @property-read string $commandSignature
* @method string getCommandSignature()
*
* @property-read string $commandName
* @method string getCommandName()
*
* @property-read string $commandDescription
* @method string getCommandDescription()
*
* @property-read string $commandHelp
* @method string getCommandHelp()
*
* @property-read bool $commandHidden
* @method bool isCommandHidden()
*/
trait AsCommand
{
//
Expand Down
7 changes: 7 additions & 0 deletions src/Concerns/AsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

namespace Lorisleiva\Actions\Concerns;

/**
* @method array getControllerMiddleware()
* @method \Illuminate\Http\Resources\Json\JsonResource jsonResponse()
* @method \Illuminate\Http\Response htmlResponse()
* @method void routes(\Illuminate\Routing\Router $router)
* @method \Illuminate\Http\Response asController()
*/
trait AsController
{
/**
Expand Down
34 changes: 33 additions & 1 deletion src/Concerns/AsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,39 @@
use Lorisleiva\Actions\Decorators\JobDecorator;
use Lorisleiva\Actions\Decorators\UniqueJobDecorator;
use PHPUnit\Framework\Assert as PHPUnit;

use Throwable;

/**
* @property-read string $jobConnection
* @property-read string $jobQueue
* @property-read int $jobTries
* @property-read int $jobMaxExceptions
* @property-read int $jobTimeout
* @method void configureJob(JobDecorator|UniqueJobDecorator $job)
*
* @property-read int|array $jobBackoff
* @method int|array getJobBackoff(...$parameters)
*
* @property-read \DateTime|int $jobRetryUntil
* @method \DateTime|int getJobRetryUntil(...$parameters)
*
* @method array getJobMiddleware(...$parameters)
*
* @method void jobFailed(Throwable $e, ...$parameters)
*
* @method string getJobDisplayName(...$parameters)
*
* @method array getJobTags(...$parameters)
*
* @property-read int $jobUniqueFor
* @method int getJobUniqueFor(...$parameters)
*
* @property-read int $jobUniqueId
* @method int getJobUniqueId(...$parameters)
*
* @method int getJobUniqueVia(...$parameters)
*
*/
trait AsJob
{
/**
Expand Down
4 changes: 4 additions & 0 deletions src/Concerns/AsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace Lorisleiva\Actions\Concerns;

/**
* @method void asListener()
* @method bool shouldQueue()
*/
trait AsListener
{
//
Expand Down
15 changes: 15 additions & 0 deletions src/Concerns/WithAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
use Illuminate\Support\Arr;
use Lorisleiva\Actions\AttributeValidator;

/**
* @method void prepareForValidation(\Lorisleiva\Actions\ActionRequest $request)
* @method bool|\Illuminate\Auth\Access\Response authorize(\Lorisleiva\Actions\ActionRequest $request)
* @method array rules()
* @method void withValidator(\Illuminate\Validation\Validator $validator, \Lorisleiva\Actions\ActionRequest $request)
* @method void afterValidator(\Illuminate\Validation\Validator $validator, \Lorisleiva\Actions\ActionRequest $request)
* @method \Illuminate\Validation\Validator getValidator(\Illuminate\Validation\Factory $factory, \Lorisleiva\Actions\ActionRequest $request)
* @method array getValidationData(\Lorisleiva\Actions\ActionRequest $request)
* @method array getValidationMessages()
* @method array getValidationAttributes()
* @method string getValidationRedirect(\Illuminate\Routing\UrlGenerator $url)
* @method string getValidationErrorBag()
* @method void getValidationFailure()
* @method void getAuthorizationFailure()
*/
trait WithAttributes
{
protected array $attributes = [];
Expand Down

0 comments on commit 5250614

Please sign in to comment.