Skip to content

Commit

Permalink
refactor: update php docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Apr 8, 2022
1 parent 513428c commit a5d8769
Show file tree
Hide file tree
Showing 17 changed files with 75 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\Actions;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Exceptions\LoginFailedException;
use App\Containers\AppSection\Authentication\Tasks\CallOAuthServerTask;
use App\Containers\AppSection\Authentication\Tasks\ExtractLoginCustomAttributeTask;
Expand All @@ -12,7 +13,10 @@
class ApiLoginProxyForWebClientAction extends Action
{
/**
* @param LoginProxyPasswordGrantRequest $request
* @return array
* @throws LoginFailedException
* @throws IncorrectIdException
*/
public function run(LoginProxyPasswordGrantRequest $request): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\Actions;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Exceptions\LoginFailedException;
use App\Containers\AppSection\Authentication\Exceptions\RefreshTokenMissedException;
use App\Containers\AppSection\Authentication\Tasks\CallOAuthServerTask;
Expand All @@ -13,8 +14,11 @@
class ApiRefreshProxyForWebClientAction extends Action
{
/**
* @throws RefreshTokenMissedException
* @param RefreshProxyRequest $request
* @return array
* @throws LoginFailedException
* @throws RefreshTokenMissedException
* @throws IncorrectIdException
*/
public function run(RefreshProxyRequest $request): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\Actions;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Mails\ForgotPassword;
use App\Containers\AppSection\Authentication\Tasks\CreatePasswordResetTokenTask;
use App\Containers\AppSection\Authentication\UI\API\Requests\ForgotPasswordRequest;
Expand All @@ -12,6 +13,11 @@

class ForgotPasswordAction extends Action
{
/**
* @param ForgotPasswordRequest $request
* @return bool
* @throws IncorrectIdException
*/
public function run(ForgotPasswordRequest $request): bool
{
$sanitizedData = $request->sanitizeInput([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\Actions;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Notifications\Welcome;
use App\Containers\AppSection\Authentication\Tasks\CreateUserByCredentialsTask;
use App\Containers\AppSection\Authentication\Tasks\SendVerificationEmailTask;
Expand All @@ -13,7 +14,10 @@
class RegisterUserAction extends Action
{
/**
* @param RegisterUserRequest $request
* @return User
* @throws CreateResourceFailedException
* @throws IncorrectIdException
*/
public function run(RegisterUserRequest $request): User
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\Actions;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Exceptions\InvalidResetPasswordTokenException;
use App\Containers\AppSection\Authentication\Notifications\PasswordReset;
use App\Containers\AppSection\Authentication\UI\API\Requests\ResetPasswordRequest;
Expand All @@ -16,9 +17,12 @@
class ResetPasswordAction extends Action
{
/**
* @throws NotFoundException
* @param ResetPasswordRequest $request
* @return mixed
* @throws InvalidResetPasswordTokenException
* @throws NotFoundException
* @throws UpdateResourceFailedException
* @throws IncorrectIdException
*/
public function run(ResetPasswordRequest $request): mixed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\Actions;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Exceptions\LoginFailedException;
use App\Containers\AppSection\Authentication\Tasks\ExtractLoginCustomAttributeTask;
use App\Containers\AppSection\Authentication\Tasks\LoginTask;
Expand All @@ -14,7 +15,10 @@
class WebLoginAction extends Action
{
/**
* @param LoginRequest $request
* @return User|Authenticatable|null
* @throws LoginFailedException
* @throws IncorrectIdException
*/
public function run(LoginRequest $request): User|Authenticatable|null
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

namespace App\Containers\AppSection\Authentication\UI\API\Controllers;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Actions\ForgotPasswordAction;
use App\Containers\AppSection\Authentication\UI\API\Requests\ForgotPasswordRequest;
use App\Ship\Exceptions\NotFoundException;
use App\Ship\Parents\Controllers\ApiController;
use Illuminate\Http\JsonResponse;

class ForgotPasswordController extends ApiController
{
/**
* @throws NotFoundException
* @param ForgotPasswordRequest $request
* @return JsonResponse
* @throws IncorrectIdException
*/
public function forgotPassword(ForgotPasswordRequest $request): JsonResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Containers\AppSection\Authentication\UI\API\Controllers;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Actions\ApiLoginProxyForWebClientAction;
use App\Containers\AppSection\Authentication\Exceptions\LoginFailedException;
use App\Containers\AppSection\Authentication\Exceptions\EmailNotVerifiedException;
use App\Containers\AppSection\Authentication\UI\API\Requests\LoginProxyPasswordGrantRequest;
use App\Ship\Parents\Controllers\ApiController;
use Illuminate\Http\JsonResponse;
Expand All @@ -22,6 +22,7 @@ class LoginProxyForWebClientController extends ApiController
* @param LoginProxyPasswordGrantRequest $request
* @return JsonResponse
* @throws LoginFailedException
* @throws IncorrectIdException
*/
public function loginProxyForWebClient(LoginProxyPasswordGrantRequest $request): JsonResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\UI\API\Controllers;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Actions\ApiRefreshProxyForWebClientAction;
use App\Containers\AppSection\Authentication\Exceptions\LoginFailedException;
use App\Containers\AppSection\Authentication\Exceptions\RefreshTokenMissedException;
Expand All @@ -19,7 +20,11 @@ class RefreshProxyForWebClientController extends ApiController
* This is only to help the Web Apps (JavaScript clients) hide
* their ID's and Secrets when contacting the OAuth server and obtain Tokens.
*
* @throws RefreshTokenMissedException|LoginFailedException
* @param RefreshProxyRequest $request
* @return JsonResponse
* @throws LoginFailedException
* @throws RefreshTokenMissedException
* @throws IncorrectIdException
*/
public function refreshProxyForWebClient(RefreshProxyRequest $request): JsonResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\UI\API\Controllers;

use Apiato\Core\Exceptions\IncorrectIdException;
use Apiato\Core\Exceptions\InvalidTransformerException;
use App\Containers\AppSection\Authentication\Actions\RegisterUserAction;
use App\Containers\AppSection\Authentication\UI\API\Requests\RegisterUserRequest;
Expand All @@ -12,8 +13,11 @@
class RegisterUserController extends ApiController
{
/**
* @throws InvalidTransformerException
* @param RegisterUserRequest $request
* @return array
* @throws CreateResourceFailedException
* @throws InvalidTransformerException
* @throws IncorrectIdException
*/
public function registerUser(RegisterUserRequest $request): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\Authentication\UI\API\Controllers;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\Authentication\Actions\ResetPasswordAction;
use App\Containers\AppSection\Authentication\Exceptions\InvalidResetPasswordTokenException;
use App\Containers\AppSection\Authentication\UI\API\Requests\ResetPasswordRequest;
Expand All @@ -13,9 +14,12 @@
class ResetPasswordController extends ApiController
{
/**
* @param ResetPasswordRequest $request
* @return JsonResponse
* @throws InvalidResetPasswordTokenException
* @throws NotFoundException
* @throws UpdateResourceFailedException
* @throws IncorrectIdException
*/
public function resetPassword(ResetPasswordRequest $request): JsonResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

use App\Containers\AppSection\Authentication\Actions\SendVerificationEmailAction;
use App\Containers\AppSection\Authentication\UI\API\Requests\SendVerificationEmailRequest;
use App\Ship\Exceptions\NotFoundException;
use App\Ship\Parents\Controllers\ApiController;
use Illuminate\Http\JsonResponse;

class SendVerificationEmailController extends ApiController
{
/**
* @throws NotFoundException
* @param SendVerificationEmailRequest $request
* @return JsonResponse
*/
public function sendVerificationEmail(SendVerificationEmailRequest $request): JsonResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
use App\Containers\AppSection\Authorization\Tasks\DeleteRoleTask;
use App\Containers\AppSection\Authorization\UI\API\Requests\DeleteRoleRequest;
use App\Ship\Exceptions\DeleteResourceFailedException;
use App\Ship\Exceptions\NotFoundException;
use App\Ship\Parents\Actions\Action;

class DeleteRoleAction extends Action
{
/**
* @param DeleteRoleRequest $request
* @throws DeleteResourceFailedException
* @throws NotFoundException
*/
public function run(DeleteRoleRequest $request): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@

namespace App\Containers\AppSection\Authorization\Actions;

use Apiato\Core\Exceptions\CoreInternalErrorException;
use App\Containers\AppSection\Authorization\Tasks\FindRoleTask;
use App\Containers\AppSection\Authorization\Tasks\GetAllPermissionsTask;
use App\Ship\Exceptions\NotFoundException;
use App\Ship\Parents\Actions\Action;
use Prettus\Repository\Exceptions\RepositoryException;

class GiveAllPermissionsToRoleAction extends Action
{
/**
* @param string $roleName
* @return array
* @throws NotFoundException
* @throws CoreInternalErrorException
* @throws RepositoryException
*/
public function run(string $roleName): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
use App\Containers\AppSection\Authorization\Actions\DeleteRoleAction;
use App\Containers\AppSection\Authorization\UI\API\Requests\DeleteRoleRequest;
use App\Ship\Exceptions\DeleteResourceFailedException;
use App\Ship\Exceptions\NotFoundException;
use App\Ship\Parents\Controllers\ApiController;
use Illuminate\Http\JsonResponse;

class DeleteRoleController extends ApiController
{
/**
* @param DeleteRoleRequest $request
* @return JsonResponse
* @throws DeleteResourceFailedException
* @throws NotFoundException
*/
public function deleteRole(DeleteRoleRequest $request): JsonResponse
{
Expand Down
7 changes: 6 additions & 1 deletion app/Containers/AppSection/User/Actions/UpdateUserAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\User\Actions;

use Apiato\Core\Exceptions\IncorrectIdException;
use App\Containers\AppSection\User\Models\User;
use App\Containers\AppSection\User\Tasks\UpdateUserTask;
use App\Containers\AppSection\User\UI\API\Requests\UpdateUserRequest;
Expand All @@ -12,7 +13,11 @@
class UpdateUserAction extends Action
{
/**
* @throws UpdateResourceFailedException|NotFoundException
* @param UpdateUserRequest $request
* @return User
* @throws NotFoundException
* @throws UpdateResourceFailedException
* @throws IncorrectIdException
*/
public function run(UpdateUserRequest $request): User
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Containers\AppSection\User\UI\API\Controllers;

use Apiato\Core\Exceptions\IncorrectIdException;
use Apiato\Core\Exceptions\InvalidTransformerException;
use App\Containers\AppSection\User\Actions\UpdateUserAction;
use App\Containers\AppSection\User\UI\API\Requests\UpdateUserRequest;
Expand All @@ -13,9 +14,12 @@
class UpdateUserController extends ApiController
{
/**
* @throws UpdateResourceFailedException
* @param UpdateUserRequest $request
* @return array
* @throws InvalidTransformerException
* @throws NotFoundException
* @throws UpdateResourceFailedException
* @throws IncorrectIdException
*/
public function updateUser(UpdateUserRequest $request): array
{
Expand Down

0 comments on commit a5d8769

Please sign in to comment.