diff --git a/src/Api.php b/src/Api.php index b08574e..67e4955 100644 --- a/src/Api.php +++ b/src/Api.php @@ -49,7 +49,7 @@ class Api implements \JsonSerializable protected $swagger; /** - * @var array|PathParameter[] + * @var array|\LaravelApi\Endpoints\Parameters\PathParameter[] */ protected $parameters = []; diff --git a/src/Auth/ApiKeySecurity.php b/src/Auth/ApiKeySecurity.php index 2c1fc6d..fd5da33 100644 --- a/src/Auth/ApiKeySecurity.php +++ b/src/Auth/ApiKeySecurity.php @@ -24,7 +24,7 @@ public function __construct() /** * @param string $name - * @return $this + * @return \LaravelApi\Auth\ApiKeySecurity */ public function parameterName($name) { @@ -34,7 +34,7 @@ public function parameterName($name) } /** - * @return $this + * @return \LaravelApi\Auth\ApiKeySecurity */ public function inHeader() { @@ -44,7 +44,7 @@ public function inHeader() } /** - * @return $this + * @return \LaravelApi\Auth\ApiKeySecurity */ public function inQuery() { diff --git a/src/Auth/BasicAuthenticationSecurity.php b/src/Auth/BasicAuthenticationSecurity.php index 63445df..10ce4bd 100644 --- a/src/Auth/BasicAuthenticationSecurity.php +++ b/src/Auth/BasicAuthenticationSecurity.php @@ -19,7 +19,7 @@ public function __construct() /** * @param string $description - * @return $this + * @return \LaravelApi\Auth\BasicAuthenticationSecurity */ final public function description($description) { @@ -28,6 +28,9 @@ final public function description($description) return $this; } + /** + * @return \Calcinai\Strut\Definitions\BasicAuthenticationSecurity + */ final public function toBase() { return $this->security; diff --git a/src/Console/ApiClearCommand.php b/src/Console/ApiClearCommand.php index da3ab2d..08cec4c 100644 --- a/src/Console/ApiClearCommand.php +++ b/src/Console/ApiClearCommand.php @@ -30,14 +30,17 @@ class ApiClearCommand extends Command protected $files; /** - * @var Api + * @var \LaravelApi\Api */ protected $api; + /** * Create a new route clear command instance. * * @param \Illuminate\Filesystem\Filesystem $files + * @param \LaravelApi\Api $api + * * @return void */ public function __construct(Filesystem $files, Api $api) diff --git a/src/Definition.php b/src/Definition.php index e5f3130..35bc707 100644 --- a/src/Definition.php +++ b/src/Definition.php @@ -18,7 +18,7 @@ public function __construct($data = []) /** * @param string $name - * @return Definition + * @return \LaravelApi\Definition */ public function setName($name) { @@ -32,7 +32,7 @@ public function setName($name) * @param string $type * @param string $description * @param string $default - * @return Definition + * @return \LaravelApi\Definition * * @throws \Exception */ @@ -46,7 +46,7 @@ public function addProperty($name, $description = null, $default = null, $type = } /** - * @return Schema + * @return \Calcinai\Strut\Definitions\Schema */ public function toRef() { diff --git a/src/Endpoints/Endpoint.php b/src/Endpoints/Endpoint.php index e38d862..cf9a846 100644 --- a/src/Endpoints/Endpoint.php +++ b/src/Endpoints/Endpoint.php @@ -9,9 +9,9 @@ class Endpoint extends PathItem { /** * @param string $method - * @param Route $route + * @param \Illuminate\Routing\Route $route * @param array $parameters - * @return Operation + * @return \Calcinai\Strut\Definitions\Operation */ public function getOperation($method, Route $route, array $parameters = []) { @@ -21,7 +21,7 @@ public function getOperation($method, Route $route, array $parameters = []) /** * @param string $method - * @return Operation + * @return \Calcinai\Strut\Definitions\Operation */ public function setMethod($method) { diff --git a/src/Endpoints/ModelsEndpointRegistry.php b/src/Endpoints/ModelsEndpointRegistry.php index 841b262..0e509dc 100644 --- a/src/Endpoints/ModelsEndpointRegistry.php +++ b/src/Endpoints/ModelsEndpointRegistry.php @@ -17,7 +17,7 @@ class ModelsEndpointRegistry protected $registry = []; /** - * @var Api + * @var \LaravelApi\Api */ protected $api; @@ -27,7 +27,7 @@ class ModelsEndpointRegistry protected $parameters = []; /** - * @param Api $api + * @param \LaravelApi\Api $api */ public function __construct(Api $api) { @@ -61,7 +61,7 @@ protected function retrieveParameters() /** * @param array $models - * @return $this + * @return \LaravelApi\Endpoints\ModelsEndpointRegistry */ public function add(array $models) { @@ -93,7 +93,7 @@ protected function getModelName($model) /** * @param array $names - * @return $this + * @return \LaravelApi\Endpoints\ModelsEndpointRegistry */ protected function addOptionsToParameters(array $names) { @@ -108,7 +108,7 @@ protected function addOptionsToParameters(array $names) /** * @param string $name - * @return Model + * @return \Illuminate\Database\Eloquent\Model */ public function resolve($name) { @@ -131,7 +131,7 @@ public function has($name) } /** - * @return $this + * @return \LaravelApi\Endpoints\ModelsEndpointRegistry */ public function clear() { diff --git a/src/Endpoints/Operation.php b/src/Endpoints/Operation.php index 5d0c0b7..0979017 100644 --- a/src/Endpoints/Operation.php +++ b/src/Endpoints/Operation.php @@ -55,7 +55,7 @@ public function __construct($data = []) /** * @param \Illuminate\Routing\Route $route * @param array $parameters - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function setRoute(Route $route, array $parameters = []) { @@ -76,7 +76,7 @@ public function setRoute(Route $route, array $parameters = []) /** * @param array $tags - * @return $this + * @return \LaravelApi\Endpoints\Operation */ protected function initTags(array $tags) { @@ -89,7 +89,7 @@ protected function initTags(array $tags) /** * @param \Illuminate\Routing\Route $route - * @return $this + * @return \LaravelApi\Endpoints\Operation */ protected function initOperationId(Route $route) { @@ -101,7 +101,7 @@ protected function initOperationId(Route $route) /** * @param string $uri * @param array $parameters - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function parseRouteParameters($uri, array $parameters = []) { @@ -151,7 +151,7 @@ public function __call($name, $arguments) * @param string|callable $descriptionOrCallback * @param bool $required * @param string $type - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function addHeaderParameter($name, $descriptionOrCallback = null, $required = false, $type = 'string') { @@ -169,7 +169,7 @@ public function addHeaderParameter($name, $descriptionOrCallback = null, $requir * @param string|callable $descriptionOrCallback * @param bool $required * @param string $type - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function addQueryParameter($name, $descriptionOrCallback = null, $required = false, $type = 'string') { @@ -187,7 +187,7 @@ public function addQueryParameter($name, $descriptionOrCallback = null, $require * @param string|callable $descriptionOrCallback * @param bool $required * @param string $type - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function addPathParameter($name, $descriptionOrCallback = null, $required = false, $type = 'string') { @@ -205,7 +205,7 @@ public function addPathParameter($name, $descriptionOrCallback = null, $required * @param string|callable $descriptionOrCallback * @param bool $required * @param string $type - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function addFormDataParameter($name, $descriptionOrCallback = null, $required = false, $type = 'string') { @@ -226,7 +226,7 @@ public function addFormDataParameter($name, $descriptionOrCallback = null, $requ * @param string $name * @param string|callable $descriptionOrCallback * @param bool $required - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function addBodyParameter($name, $descriptionOrCallback = null, $required = false) { @@ -239,7 +239,7 @@ public function addBodyParameter($name, $descriptionOrCallback = null, $required * @param string|callable $descriptionOrCallback * @param bool $required * @param string $type - * @return $this + * @return \LaravelApi\Endpoints\Operation */ protected function registerParameter( $parameterType, @@ -306,7 +306,7 @@ function ($param) use ($name, $type) { /** * @param int $code * @param string $description - * @return $this + * @return \LaravelApi\Endpoints\Operation * * @throws \Exception */ @@ -319,7 +319,7 @@ public function addResponse($code, $description) /** * @param string $request - * @return $this + * @return \LaravelApi\Endpoints\Operation */ public function bindRequest($request) { @@ -332,7 +332,7 @@ public function bindRequest($request) /** * @param array $requestRules - * @return $this + * @return \LaravelApi\Endpoints\Operation */ protected function bindRules(array $requestRules) { @@ -364,7 +364,7 @@ protected function getValidationRuleParser() /** * @param string $name * @param array $scopes - * @return $this + * @return \LaravelApi\Endpoints\Operation * * @throws \Exception */ diff --git a/src/Endpoints/ResourceEndpoint.php b/src/Endpoints/ResourceEndpoint.php index b79e25c..97883a6 100644 --- a/src/Endpoints/ResourceEndpoint.php +++ b/src/Endpoints/ResourceEndpoint.php @@ -2,7 +2,6 @@ namespace LaravelApi\Endpoints; -use Calcinai\Strut\Definitions\SecurityRequirement; use Illuminate\Routing\PendingResourceRegistration; use Illuminate\Support\Arr; use Illuminate\Support\Str; @@ -11,12 +10,12 @@ class ResourceEndpoint extends PendingResourceRegistration { /** - * @var Api + * @var \LaravelApi\Api */ protected $api; /** - * @var SecurityRequirement + * @var \Calcinai\Strut\Definitions\SecurityRequirement */ protected $auth; @@ -27,7 +26,7 @@ class ResourceEndpoint extends PendingResourceRegistration /** * @param Api $api - * @return ResourceEndpoint + * @return \LaravelApi\Endpoints\ResourceEndpoint */ public function setApi(Api $api) { @@ -162,7 +161,7 @@ protected function getResourceMethods() /** * @param string $name * @param array $scopes - * @return $this + * @return \LaravelApi\Endpoints\ResourceEndpoint * * @throws \Exception */ diff --git a/src/Http/Controllers/DocsController.php b/src/Http/Controllers/DocsController.php index 628d0e5..8626385 100644 --- a/src/Http/Controllers/DocsController.php +++ b/src/Http/Controllers/DocsController.php @@ -11,7 +11,7 @@ class DocsController extends IlluminateController { /** - * @var Api + * @var \LaravelApi\Api */ protected $api;