From 83291e94c034f9cc51fe2df1034b53adfd505cbd Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Mon, 24 Feb 2020 22:04:58 +0800 Subject: [PATCH] Update code structure. Signed-off-by: Mior Muhammad Zaki --- Concerns/PassThrough.php | 1 - Concerns/Transformable.php | 13 --------- Middleware/NotModified.php | 1 - Middleware/RequireCsrfToken.php | 6 +--- Providers/VersionServiceProvider.php | 4 --- RouteManager.php | 38 ------------------------ RouteResolver.php | 42 --------------------------- Transformer.php | 1 - Transformer/InteractsWithDateTime.php | 6 ---- VersionControl.php | 13 --------- 10 files changed, 1 insertion(+), 124 deletions(-) diff --git a/Concerns/PassThrough.php b/Concerns/PassThrough.php index c11f9ee..8811f46 100644 --- a/Concerns/PassThrough.php +++ b/Concerns/PassThrough.php @@ -15,7 +15,6 @@ trait PassThrough * Determine if the request has a URI that should pass through CSRF verification. * * @param \Illuminate\Http\Request $request - * @param array $routesToExclude * * @return bool */ diff --git a/Concerns/Transformable.php b/Concerns/Transformable.php index 2f0e379..d8125bc 100644 --- a/Concerns/Transformable.php +++ b/Concerns/Transformable.php @@ -31,8 +31,6 @@ trait Transformable /** * Add options. * - * @param array $options - * * @return $this */ public function options(array $options = []) @@ -78,9 +76,6 @@ public function setRequest($request) * Merge meta options. * * @param string|array $meta - * @param array $options - * - * @return array */ protected function merge($meta, array $options = []): array { @@ -104,11 +99,7 @@ protected function merge($meta, array $options = []): array /** * Resolve includes for transformer. * - * @param string $group - * @param array $data * @param mixed $parameters - * - * @return array */ protected function transformByMeta(string $meta, array $data, ...$parameters): array { @@ -136,10 +127,6 @@ protected function transformByMeta(string $meta, array $data, ...$parameters): a /** * Get option by group. - * - * @param string $name - * - * @return void */ protected function filterMetaType(string $name): void { diff --git a/Middleware/NotModified.php b/Middleware/NotModified.php index 8a709eb..3392891 100644 --- a/Middleware/NotModified.php +++ b/Middleware/NotModified.php @@ -10,7 +10,6 @@ class NotModified * Handle the given request and get the response. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * * @return \Illuminate\Http\Response */ diff --git a/Middleware/RequireCsrfToken.php b/Middleware/RequireCsrfToken.php index be07f30..b33564e 100644 --- a/Middleware/RequireCsrfToken.php +++ b/Middleware/RequireCsrfToken.php @@ -12,7 +12,7 @@ class RequireCsrfToken /** * The application instance. * - * @var \Illuminate\Foundation\Application + * @var \Illuminate\Contracts\Foundation\Application */ protected $app; @@ -25,9 +25,6 @@ class RequireCsrfToken /** * Create a new filter instance. - * - * @param \Illuminate\Foundation\Application $app - * @param \Illuminate\Contracts\Encryption\Encrypter $encrypter */ public function __construct(Application $app, Encrypter $encrypter) { @@ -39,7 +36,6 @@ public function __construct(Application $app, Encrypter $encrypter) * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * * @return mixed */ diff --git a/Providers/VersionServiceProvider.php b/Providers/VersionServiceProvider.php index 1137948..9fd160a 100644 --- a/Providers/VersionServiceProvider.php +++ b/Providers/VersionServiceProvider.php @@ -37,10 +37,6 @@ public function register() /** * Register supported version. - * - * @param \Orchestra\Http\VersionControl $version - * - * @return void */ protected function registerSupportedVersions(VersionControl $version): void { diff --git a/RouteManager.php b/RouteManager.php index f21c671..234a102 100644 --- a/RouteManager.php +++ b/RouteManager.php @@ -32,9 +32,6 @@ abstract class RouteManager implements RouteManagerContract /** * Construct a new instance. - * - * @param \Illuminate\Contracts\Container\Container $app - * @param \Orchestra\Http\RouteResolver|null $resolver */ public function __construct(Container $app, ?RouteResolver $resolver = null) { @@ -46,8 +43,6 @@ public function __construct(Container $app, ?RouteResolver $resolver = null) /** * Resolve application router. * - * @param \Illuminate\Contracts\Container\Container $app - * * @return mixed */ protected function resolveApplicationRouter(Container $app) @@ -58,12 +53,7 @@ protected function resolveApplicationRouter(Container $app) /** * Return route group dispatch for a package/app. * - * @param string $name - * @param string $default * @param array|\Closure $attributes - * @param \Closure|null $callback - * - * @return array */ public function group(string $name, string $default, $attributes = [], Closure $callback = null): array { @@ -85,11 +75,6 @@ public function group(string $name, string $default, $attributes = [], Closure $ /** * Return locate handles configuration for a package/app. - * - * @param string $path - * @param array $options - * - * @return array */ public function locate(string $path, array $options = []): array { @@ -98,11 +83,6 @@ public function locate(string $path, array $options = []): array /** * Return handles URL for a package/app. - * - * @param string $path - * @param array $options - * - * @return string */ public function handles(string $path, array $options = []): string { @@ -111,10 +91,6 @@ public function handles(string $path, array $options = []): string /** * Return if handles URL match given string. - * - * @param string $path - * - * @return bool */ public function is(string $path): bool { @@ -123,15 +99,11 @@ public function is(string $path): bool /** * Get installation status. - * - * @return bool */ abstract public function installed(): bool; /** * Get application status. - * - * @return string */ public function mode(): string { @@ -141,9 +113,6 @@ public function mode(): string /** * Get extension route. * - * @param string $name - * @param string $default - * * @return \Orchestra\Contracts\Extension\UrlGenerator */ public function route(string $name, string $default = '/') @@ -154,10 +123,7 @@ public function route(string $name, string $default = '/') /** * Run the callback when route is matched. * - * @param string $path * @param mixed $listener - * - * @return void */ public function when(string $path, $listener): void { @@ -167,11 +133,7 @@ public function when(string $path, $listener): void /** * Run the callback when route is matched. * - * @param string $path - * @param string $on * @param mixed $listener - * - * @return void */ public function whenOn(string $path, string $on, $listener): void { diff --git a/RouteResolver.php b/RouteResolver.php index cc43f4d..a414249 100644 --- a/RouteResolver.php +++ b/RouteResolver.php @@ -51,8 +51,6 @@ class RouteResolver /** * Construct a new instance. - * - * @param \Illuminate\Contracts\Container\Container $app */ public function __construct(Container $app) { @@ -64,10 +62,6 @@ public function __construct(Container $app) /** * Integrate with Orchestra Extension. - * - * @param \Illuminate\Contracts\Container\Container $app - * - * @return void */ protected function integrateWithExtension(Container $app): void { @@ -82,10 +76,6 @@ protected function integrateWithExtension(Container $app): void /** * Return if handles URL match given string. - * - * @param string $path - * - * @return bool */ public function is(string $path): bool { @@ -96,11 +86,6 @@ public function is(string $path): bool /** * Return locate handles configuration for a package/app. - * - * @param string $path - * @param array $options - * - * @return array */ public function locate(string $path, array $options = []): array { @@ -127,9 +112,6 @@ public function locate(string $path, array $options = []): array /** * Get extension route. * - * @param string $name - * @param string $default - * * @return \Orchestra\Contracts\Extension\UrlGenerator */ public function route(string $name, string $default = '/') @@ -143,8 +125,6 @@ public function route(string $name, string $default = '/') /** * Get application mode. - * - * @return string */ public function mode(): string { @@ -157,11 +137,6 @@ public function mode(): string /** * Return handles URL for a package/app. - * - * @param string $path - * @param array $options - * - * @return string */ public function to(string $path, array $options = []): string { @@ -182,9 +157,6 @@ public function to(string $path, array $options = []): string /** * Generate route by name. * - * @param string $name - * @param string $default - * * @return \Orchestra\Contracts\Extension\UrlGenerator */ protected function generateRouteByName(string $name, string $default) @@ -199,13 +171,6 @@ protected function generateRouteByName(string $name, string $default) /** * Prepare valid route, since we already extract package from route * we can re-append query string to route value. - * - * @param string $route - * @param string|null $item - * @param string $query - * @param array $options - * - * @return string */ protected function prepareValidRoute(string $route, ?string $item, string $query, array $options): string { @@ -231,11 +196,6 @@ protected function prepareValidRoute(string $route, ?string $item, string $query /** * Prepare HTTP query string. - * - * @param string $query - * @param array $appends - * - * @return string */ protected function prepareHttpQueryString(string $query, array $appends = []): string { @@ -248,8 +208,6 @@ protected function prepareHttpQueryString(string $query, array $appends = []): s /** * Get CSRF Token. - * - * @return string|null */ protected function getCsrfToken(): ?string { diff --git a/Transformer.php b/Transformer.php index a3dd364..28cb509 100644 --- a/Transformer.php +++ b/Transformer.php @@ -12,7 +12,6 @@ abstract class Transformer extends BaseTransformer * Invoke the transformation. * * @param mixed $instance - * @param array $options * * @return mixed */ diff --git a/Transformer/InteractsWithDateTime.php b/Transformer/InteractsWithDateTime.php index d483b14..af9ff1a 100644 --- a/Transformer/InteractsWithDateTime.php +++ b/Transformer/InteractsWithDateTime.php @@ -15,8 +15,6 @@ trait InteractsWithDateTime /** * Get timezone from request header. - * - * @return string */ protected function getTimezoneFromRequestHeader(): string { @@ -30,8 +28,6 @@ protected function getTimezoneFromRequestHeader(): string /** * Convert Carbon to datetime string or return null. * - * @param \Carbon\Carbon|null $datetime - * * @return string|null */ protected function toDateString(Carbon $datetime = null) @@ -44,8 +40,6 @@ protected function toDateString(Carbon $datetime = null) /** * Convert Carbon to datetime string or return null. * - * @param \Carbon\Carbon|null $datetime - * * @return string|null */ protected function toDatetimeString(Carbon $datetime = null) diff --git a/VersionControl.php b/VersionControl.php index ecc47d8..b84d7d4 100644 --- a/VersionControl.php +++ b/VersionControl.php @@ -23,10 +23,6 @@ class VersionControl /** * Add version. * - * @param string $code - * @param string $namespace - * @param bool $default - * * @return $this */ public function addVersion(string $code, string $namespace, bool $default = false) @@ -43,8 +39,6 @@ public function addVersion(string $code, string $namespace, bool $default = fals /** * Set default version. * - * @param string $code - * * @throws \InvalidArgumentException * * @return $this @@ -62,13 +56,6 @@ public function setDefaultVersion(string $code) /** * Resolve version for requested class. - * - * @param string $namespace - * @param string $version - * @param string $group - * @param string $name - * - * @return string */ public function resolve(string $namespace, string $version, string $name): string {