Add phpdoc_align rule

This commit is contained in:
Lance Pioch 2024-10-19 18:42:23 -04:00
parent 1bf6a880fb
commit d21740d458
19 changed files with 24 additions and 25 deletions

View File

@ -114,7 +114,7 @@ class Handler extends ExceptionHandler
/** /**
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* *
* @throws \Throwable * @throws \Throwable
*/ */
@ -140,7 +140,7 @@ class Handler extends ExceptionHandler
* Transform a validation exception into a consistent format to be returned for * Transform a validation exception into a consistent format to be returned for
* calls to the API. * calls to the API.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
*/ */
public function invalidJson($request, ValidationException $exception): JsonResponse public function invalidJson($request, ValidationException $exception): JsonResponse
{ {
@ -236,7 +236,7 @@ class Handler extends ExceptionHandler
/** /**
* Convert an authentication exception into an unauthenticated response. * Convert an authentication exception into an unauthenticated response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
*/ */
protected function unauthenticated($request, AuthenticationException $exception): JsonResponse|RedirectResponse protected function unauthenticated($request, AuthenticationException $exception): JsonResponse|RedirectResponse
{ {

View File

@ -145,7 +145,7 @@ class BackupManager
/** /**
* Unset the given adapter instances. * Unset the given adapter instances.
* *
* @param string|string[] $adapter * @param string|string[] $adapter
*/ */
public function forget(array|string $adapter): self public function forget(array|string $adapter): self
{ {

View File

@ -51,7 +51,7 @@ abstract class ApplicationApiController extends Controller
* *
* @template T of \App\Transformers\Api\Application\BaseTransformer * @template T of \App\Transformers\Api\Application\BaseTransformer
* *
* @param class-string<T> $abstract * @param class-string<T> $abstract
* *
* @return T * @return T
* *

View File

@ -41,7 +41,7 @@ abstract class ClientApiController extends ApplicationApiController
* *
* @template T of \App\Transformers\Api\Client\BaseClientTransformer * @template T of \App\Transformers\Api\Client\BaseClientTransformer
* *
* @param class-string<T> $abstract * @param class-string<T> $abstract
* *
* @return T * @return T
* *

View File

@ -29,7 +29,7 @@ class ForgotPasswordController extends Controller
/** /**
* Get the response for a successful password reset link. * Get the response for a successful password reset link.
* *
* @param string $response * @param string $response
*/ */
protected function sendResetLinkResponse(Request $request, $response): JsonResponse protected function sendResetLinkResponse(Request $request, $response): JsonResponse
{ {

View File

@ -64,8 +64,8 @@ class ResetPasswordController extends Controller
* account do not automatically log them in. In those cases, send the user back to the login * account do not automatically log them in. In those cases, send the user back to the login
* form with a note telling them their password was changed and to log back in. * form with a note telling them their password was changed and to log back in.
* *
* @param \Illuminate\Contracts\Auth\CanResetPassword|\App\Models\User $user * @param \Illuminate\Contracts\Auth\CanResetPassword|\App\Models\User $user
* @param string $password * @param string $password
* *
* @throws \App\Exceptions\Model\DataValidationException * @throws \App\Exceptions\Model\DataValidationException
*/ */

View File

@ -74,7 +74,7 @@ abstract class ApplicationApiRequest extends FormRequest
* *
* @template T of \Illuminate\Database\Eloquent\Model * @template T of \Illuminate\Database\Eloquent\Model
* *
* @param class-string<T> $expect * @param class-string<T> $expect
* *
* @return T * @return T
* *

View File

@ -11,7 +11,7 @@ class AdminServerFilter implements Filter
* A multi-column filter for the servers table that allows an administrative user to search * A multi-column filter for the servers table that allows an administrative user to search
* across UUID, name, owner username, and owner email. * across UUID, name, owner username, and owner email.
* *
* @param string $value * @param string $value
*/ */
public function __invoke(Builder $query, $value, string $property) public function __invoke(Builder $query, $value, string $property)
{ {

View File

@ -19,7 +19,7 @@ class MultiFieldServerFilter implements Filter
* search across multiple columns. This allows us to provide a very generic search ability for * search across multiple columns. This allows us to provide a very generic search ability for
* the frontend. * the frontend.
* *
* @param string $value * @param string $value
*/ */
public function __invoke(Builder $query, $value, string $property) public function __invoke(Builder $query, $value, string $property)
{ {

View File

@ -234,7 +234,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
/** /**
* Send the password reset notification. * Send the password reset notification.
* *
* @param string $token * @param string $token
*/ */
public function sendPasswordResetNotification($token) public function sendPasswordResetNotification($token)
{ {

View File

@ -15,7 +15,7 @@ class DaemonFileRepository extends DaemonRepository
/** /**
* Return the contents of a given file. * Return the contents of a given file.
* *
* @param int|null $notLargerThan the maximum content length in bytes * @param int|null $notLargerThan the maximum content length in bytes
* *
* @throws \GuzzleHttp\Exception\TransferException * @throws \GuzzleHttp\Exception\TransferException
* @throws \App\Exceptions\Http\Server\FileSizeTooLargeException * @throws \App\Exceptions\Http\Server\FileSizeTooLargeException

View File

@ -17,8 +17,8 @@ class Username implements Rule
* *
* Allowed characters: a-z0-9_-. * Allowed characters: a-z0-9_-.
* *
* @param string $attribute * @param string $attribute
* @param mixed $value * @param mixed $value
*/ */
public function passes($attribute, $value): bool public function passes($attribute, $value): bool
{ {

View File

@ -64,7 +64,7 @@ class ActivityLogService
* *
* @template T extends \Illuminate\Database\Eloquent\Model|\Illuminate\Contracts\Auth\Authenticatable * @template T extends \Illuminate\Database\Eloquent\Model|\Illuminate\Contracts\Auth\Authenticatable
* *
* @param T|T[]|null $subjects * @param T|T[]|null $subjects
*/ */
public function subject(...$subjects): self public function subject(...$subjects): self
{ {
@ -100,8 +100,8 @@ class ActivityLogService
/** /**
* Sets a custom property on the activity log instance. * Sets a custom property on the activity log instance.
* *
* @param string|array $key * @param string|array $key
* @param mixed $value * @param mixed $value
*/ */
public function property($key, $value = null): self public function property($key, $value = null): self
{ {

View File

@ -43,7 +43,7 @@ class InitiateBackupService
/** /**
* Sets the files to be ignored by this backup. * Sets the files to be ignored by this backup.
* *
* @param string[]|null $ignored * @param string[]|null $ignored
*/ */
public function setIgnoredFiles(?array $ignored): self public function setIgnoredFiles(?array $ignored): self
{ {

View File

@ -89,7 +89,7 @@ abstract class BaseTransformer extends TransformerAbstract
* *
* @template T of \App\Transformers\Api\Application\BaseTransformer * @template T of \App\Transformers\Api\Application\BaseTransformer
* *
* @param class-string<T> $abstract * @param class-string<T> $abstract
* *
* @return T * @return T
* *

View File

@ -3,7 +3,6 @@
"rules": { "rules": {
"not_operator_with_successor_space": false, "not_operator_with_successor_space": false,
"ordered_imports": false, "ordered_imports": false,
"phpdoc_align": false,
"phpdoc_separation": false "phpdoc_separation": false
} }
} }

View File

@ -11,7 +11,7 @@ use App\Models\ActivityLogSubject;
trait AssertsActivityLogged trait AssertsActivityLogged
{ {
/** /**
* @param \Illuminate\Database\Eloquent\Model|array $subjects * @param \Illuminate\Database\Eloquent\Model|array $subjects
*/ */
public function assertActivityFor(string $event, ?Model $actor, ...$subjects): void public function assertActivityFor(string $event, ?Model $actor, ...$subjects): void
{ {

View File

@ -14,7 +14,7 @@ class PowerControllerTest extends ClientApiIntegrationTestCase
* an error in response. This checks against the specific permission needed to send * an error in response. This checks against the specific permission needed to send
* the command to the server. * the command to the server.
* *
* @param string[] $permissions * @param string[] $permissions
* *
* @dataProvider invalidPermissionDataProvider * @dataProvider invalidPermissionDataProvider
*/ */

View File

@ -65,7 +65,7 @@ trait CreatesTestModels
* Generates a user and a server for that user. If an array of permissions is passed it * Generates a user and a server for that user. If an array of permissions is passed it
* is assumed that the user is actually a subuser of the server. * is assumed that the user is actually a subuser of the server.
* *
* @param string[] $permissions * @param string[] $permissions
* *
* @return array{\App\Models\User, \App\Models\Server} * @return array{\App\Models\User, \App\Models\Server}
*/ */