Skip to content

Commit e30c5fb

Browse files
committed
code formating
1 parent 18ea778 commit e30c5fb

181 files changed

Lines changed: 2079 additions & 1785 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Application/Application.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class Application extends Router
7070
/**
7171
* Application constructor
7272
*
73-
* @param Request $request
74-
* @param Response $response
73+
* @param Request $request
74+
* @param Response $response
7575
* @throws BadRequestException
7676
*/
7777
public function __construct(Request $request, Response $response)
@@ -192,8 +192,8 @@ public function send(): bool
192192
/**
193193
* Send the answer to the customer
194194
*
195-
* @param mixed $response
196-
* @param int $code
195+
* @param mixed $response
196+
* @param int $code
197197
* @return void
198198
*/
199199
private function sendResponse(mixed $response, int $code = 200): void
@@ -219,9 +219,9 @@ public function disablePoweredByMention(): void
219219
/**
220220
* Make the REST API base on route and resource controller.
221221
*
222-
* @param string $url
223-
* @param string|array $controller_name
224-
* @param array $where
222+
* @param string $url
223+
* @param string|array $controller_name
224+
* @param array $where
225225
* @return Application
226226
*
227227
* @throws ApplicationException
@@ -273,8 +273,8 @@ public function rest(string $url, string|array $controller_name, array $where =
273273
/**
274274
* Build the application
275275
*
276-
* @param Request $request
277-
* @param Response $response
276+
* @param Request $request
277+
* @param Response $response
278278
* @return Application
279279
* @throws BadRequestException
280280
*/
@@ -290,9 +290,9 @@ public static function make(Request $request, Response $response): Application
290290
/**
291291
* Abort application
292292
*
293-
* @param int $code
294-
* @param string $message
295-
* @param array $headers
293+
* @param int $code
294+
* @param string $message
295+
* @param array $headers
296296
* @return void
297297
*
298298
* @throws HttpException
@@ -315,8 +315,8 @@ public function abort(int $code = 500, string $message = '', array $headers = []
315315
/**
316316
* Build dependence
317317
*
318-
* @param ?string $name
319-
* @param ?callable $callable
318+
* @param ?string $name
319+
* @param ?callable $callable
320320
* @return mixed
321321
* @throws ApplicationException
322322
*/
@@ -344,7 +344,7 @@ public function container(?string $name = null, ?callable $callable = null): mix
344344
/**
345345
* Configuration Association
346346
*
347-
* @param Loader $config
347+
* @param Loader $config
348348
* @return void
349349
*/
350350
public function bind(Loader $config): void
@@ -384,7 +384,7 @@ private function boot(): void
384384
*
385385
* This point method on the container system
386386
*
387-
* @param array $params
387+
* @param array $params
388388
* @return mixed
389389
* @throws ApplicationException
390390
*/

src/Application/Exception/BaseErrorHandler.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class BaseErrorHandler
1717
/**
1818
* Render view as response
1919
*
20-
* @param string $view
21-
* @param array $data
20+
* @param string $view
21+
* @param array $data
2222
* @return string
2323
*/
2424
protected function render(string $view, array $data = []): string
@@ -29,11 +29,11 @@ protected function render(string $view, array $data = []): string
2929
/**
3030
* Send the json as response
3131
*
32-
* @param $exception
33-
* @param mixed|null $code
32+
* @param $exception
33+
* @param mixed|null $code
3434
* @return void
3535
*/
36-
#[NoReturn] protected function json($exception, mixed $code = null): void
36+
protected function json($exception, mixed $code = null): void
3737
{
3838
if ($exception instanceof TokenInvalidException) {
3939
$code = 'TOKEN_INVALID';

src/Auth/Auth.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Auth
3636
/**
3737
* Configure Auth system
3838
*
39-
* @param array $config
39+
* @param array $config
4040
* @return ?GuardContract
4141
* @throws AuthenticationException
4242
*/
@@ -54,7 +54,7 @@ public static function configure(array $config): ?GuardContract
5454
/**
5555
* Check if user is authenticated
5656
*
57-
* @param null|string $guard
57+
* @param null|string $guard
5858
* @return GuardContract
5959
* @throws AuthenticationException
6060
*/
@@ -100,8 +100,8 @@ public static function getInstance(): ?GuardContract
100100
/**
101101
* __callStatic
102102
*
103-
* @param string $method
104-
* @param array $params
103+
* @param string $method
104+
* @param array $params
105105
* @return ?GuardContract
106106
* @throws ErrorException
107107
*/

src/Auth/AuthenticationConfiguration.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ class AuthenticationConfiguration extends Configuration
1414
*/
1515
public function create(Loader $config): void
1616
{
17-
$this->container->bind('auth', function () use ($config) {
18-
return Auth::configure($config['auth']);
19-
});
17+
$this->container->bind(
18+
'auth',
19+
function () use ($config) {
20+
return Auth::configure($config['auth']);
21+
}
22+
);
2023
}
2124

2225
/**

src/Auth/Guards/GuardContract.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ abstract public function logout(): bool;
5151
/**
5252
* Logout
5353
*
54-
* @param Authentication $user
54+
* @param Authentication $user
5555
* @return bool
5656
*/
5757
abstract public function login(Authentication $user): bool;
@@ -66,7 +66,7 @@ abstract public function user(): ?Authentication;
6666
/**
6767
* Check if user is authenticated
6868
*
69-
* @param array $credentials
69+
* @param array $credentials
7070
* @return bool
7171
*/
7272
abstract public function attempts(array $credentials): bool;
@@ -84,11 +84,11 @@ public function getName(): string
8484
/**
8585
* Load the guard
8686
*
87-
* @param string|null $guard
87+
* @param string|null $guard
8888
* @return GuardContract
8989
* @throws AuthenticationException
9090
*/
91-
public function guard(string $guard = null): GuardContract
91+
public function guard(?string $guard = null): GuardContract
9292
{
9393
if ($guard) {
9494
$this->guard = $guard;

src/Auth/Guards/JwtGuard.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class JwtGuard extends GuardContract
3333
/**
3434
* JwtGuard constructor.
3535
*
36-
* @param array $provider
37-
* @param string $guard
36+
* @param array $provider
37+
* @param string $guard
3838
* @throws AuthenticationException
3939
*/
4040
public function __construct(array $provider, string $guard)
@@ -50,7 +50,7 @@ public function __construct(array $provider, string $guard)
5050
/**
5151
* Check if user is authenticated
5252
*
53-
* @param array $credentials
53+
* @param array $credentials
5454
* @return bool
5555
* @throws AuthenticationException
5656
* @throws Exception
@@ -142,16 +142,19 @@ private function getPolicier(): Policier
142142
/**
143143
* Make direct login
144144
*
145-
* @param Authentication $user
145+
* @param Authentication $user
146146
* @return bool
147147
* @throws Exception
148148
*/
149149
public function login(Authentication $user): bool
150150
{
151-
$attributes = array_merge($user->customJwtAttributes(), [
151+
$attributes = array_merge(
152+
$user->customJwtAttributes(),
153+
[
152154
"id" => $user->getAuthenticateUserId(),
153155
"logged" => true
154-
]);
156+
]
157+
);
155158

156159
$this->token = $this->getPolicier()->encode($user->getAuthenticateUserId(), $attributes);
157160

src/Auth/Guards/SessionGuard.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class SessionGuard extends GuardContract
3232
/**
3333
* SessionGuard constructor.
3434
*
35-
* @param array $provider
35+
* @param array $provider
3636
* @param string $guard
3737
*/
3838
public function __construct(array $provider, string $guard)
@@ -45,7 +45,7 @@ public function __construct(array $provider, string $guard)
4545
/**
4646
* Check if user is authenticated
4747
*
48-
* @param array $credentials
48+
* @param array $credentials
4949
* @return bool
5050
* @throws AuthenticationException|SessionException
5151
*/
@@ -112,7 +112,7 @@ public function guest(): bool
112112
/**
113113
* Make direct login
114114
*
115-
* @param mixed $user
115+
* @param mixed $user
116116
* @return bool
117117
* @throws AuthenticationException|SessionException
118118
*/

src/Auth/Traits/LoginUserTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait LoginUserTrait
1313
/**
1414
* Make login
1515
*
16-
* @param array $credentials
16+
* @param array $credentials
1717
* @return ?Authentication
1818
* @throws AuthenticationException
1919
*/
@@ -45,8 +45,8 @@ private function makeLogin(array $credentials): ?Authentication
4545
/**
4646
* Get user by key
4747
*
48-
* @param string $key
49-
* @param float|int|string $value
48+
* @param string $key
49+
* @param float|int|string $value
5050
* @return Model|null
5151
*/
5252
private function getUserBy(string $key, float|int|string $value): ?Authentication

src/Cache/Adapters/CacheAdapterInterface.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,95 +7,95 @@ interface CacheAdapterInterface
77
/**
88
* Add new enter in the cache system
99
*
10-
* @param string $key
11-
* @param mixed $data
12-
* @param ?int $time
10+
* @param string $key
11+
* @param mixed $data
12+
* @param ?int $time
1313
* @return bool
1414
*/
1515
public function add(string $key, mixed $data, ?int $time = null): bool;
1616

1717
/**
1818
* Set a new enter
1919
*
20-
* @param string $key
21-
* @param mixed $data
22-
* @param ?int $time
20+
* @param string $key
21+
* @param mixed $data
22+
* @param ?int $time
2323
* @return bool
2424
*/
2525
public function set(string $key, mixed $data, ?int $time = null): bool;
2626

2727
/**
2828
* Add many item
2929
*
30-
* @param array $data
30+
* @param array $data
3131
* @return bool
3232
*/
3333
public function addMany(array $data): bool;
3434

3535
/**
3636
* Adds a cache that will persist
3737
*
38-
* @param string $key The cache key
39-
* @param mixed $data
38+
* @param string $key The cache key
39+
* @param mixed $data
4040
* @return bool
4141
*/
4242
public function forever(string $key, mixed $data): bool;
4343

4444
/**
4545
* Add new enter in the cache system
4646
*
47-
* @param string $key The cache key
48-
* @param mixed $data
47+
* @param string $key The cache key
48+
* @param mixed $data
4949
* @return bool
5050
*/
5151
public function push(string $key, array $data): bool;
5252

5353
/**
5454
* Retrieve an entry in the cache
5555
*
56-
* @param string $key
57-
* @param mixed $default
56+
* @param string $key
57+
* @param mixed $default
5858
* @return mixed
5959
*/
6060
public function get(string $key, mixed $default = null): mixed;
6161

6262
/**
6363
* Increase the cache expiration time
6464
*
65-
* @param string $key
66-
* @param int $time
65+
* @param string $key
66+
* @param int $time
6767
* @return bool
6868
*/
6969
public function addTime(string $key, int $time): bool;
7070

7171
/**
7272
* Retrieves the cache expiration time
7373
*
74-
* @param string $key
74+
* @param string $key
7575
* @return int|bool|string
7676
*/
7777
public function timeOf(string $key): int|bool|string;
7878

7979
/**
8080
* Delete an entry in the cache
8181
*
82-
* @param string $key
82+
* @param string $key
8383
* @return bool
8484
*/
8585
public function forget(string $key): bool;
8686

8787
/**
8888
* Check for an entry in the cache.
8989
*
90-
* @param string $key
90+
* @param string $key
9191
* @return bool
9292
*/
9393
public function has(string $key): bool;
9494

9595
/**
9696
* Check if the cache has expired
9797
*
98-
* @param string $key
98+
* @param string $key
9999
* @return bool
100100
*/
101101
public function expired(string $key): bool;

0 commit comments

Comments
 (0)