Skip to content

Commit

Permalink
Update phpdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
fsavina committed Sep 22, 2022
1 parent 9e0e41e commit f82e1c8
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Api implements \JsonSerializable
protected $swagger;

/**
* @var array|PathParameter[]
* @var array|\LaravelApi\Endpoints\Parameters\PathParameter[]
*/
protected $parameters = [];

Expand Down
6 changes: 3 additions & 3 deletions src/Auth/ApiKeySecurity.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct()

/**
* @param string $name
* @return $this
* @return \LaravelApi\Auth\ApiKeySecurity
*/
public function parameterName($name)
{
Expand All @@ -34,7 +34,7 @@ public function parameterName($name)
}

/**
* @return $this
* @return \LaravelApi\Auth\ApiKeySecurity
*/
public function inHeader()
{
Expand All @@ -44,7 +44,7 @@ public function inHeader()
}

/**
* @return $this
* @return \LaravelApi\Auth\ApiKeySecurity
*/
public function inQuery()
{
Expand Down
5 changes: 4 additions & 1 deletion src/Auth/BasicAuthenticationSecurity.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct()

/**
* @param string $description
* @return $this
* @return \LaravelApi\Auth\BasicAuthenticationSecurity
*/
final public function description($description)
{
Expand All @@ -28,6 +28,9 @@ final public function description($description)
return $this;
}

/**
* @return \Calcinai\Strut\Definitions\BasicAuthenticationSecurity
*/
final public function toBase()
{
return $this->security;
Expand Down
5 changes: 4 additions & 1 deletion src/Console/ApiClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct($data = [])

/**
* @param string $name
* @return Definition
* @return \LaravelApi\Definition
*/
public function setName($name)
{
Expand All @@ -32,7 +32,7 @@ public function setName($name)
* @param string $type
* @param string $description
* @param string $default
* @return Definition
* @return \LaravelApi\Definition
*
* @throws \Exception
*/
Expand All @@ -46,7 +46,7 @@ public function addProperty($name, $description = null, $default = null, $type =
}

/**
* @return Schema
* @return \Calcinai\Strut\Definitions\Schema
*/
public function toRef()
{
Expand Down
6 changes: 3 additions & 3 deletions src/Endpoints/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
{
Expand All @@ -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)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Endpoints/ModelsEndpointRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ModelsEndpointRegistry
protected $registry = [];

/**
* @var Api
* @var \LaravelApi\Api
*/
protected $api;

Expand All @@ -27,7 +27,7 @@ class ModelsEndpointRegistry
protected $parameters = [];

/**
* @param Api $api
* @param \LaravelApi\Api $api
*/
public function __construct(Api $api)
{
Expand Down Expand Up @@ -61,7 +61,7 @@ protected function retrieveParameters()

/**
* @param array $models
* @return $this
* @return \LaravelApi\Endpoints\ModelsEndpointRegistry
*/
public function add(array $models)
{
Expand Down Expand Up @@ -93,7 +93,7 @@ protected function getModelName($model)

/**
* @param array $names
* @return $this
* @return \LaravelApi\Endpoints\ModelsEndpointRegistry
*/
protected function addOptionsToParameters(array $names)
{
Expand All @@ -108,7 +108,7 @@ protected function addOptionsToParameters(array $names)

/**
* @param string $name
* @return Model
* @return \Illuminate\Database\Eloquent\Model
*/
public function resolve($name)
{
Expand All @@ -131,7 +131,7 @@ public function has($name)
}

/**
* @return $this
* @return \LaravelApi\Endpoints\ModelsEndpointRegistry
*/
public function clear()
{
Expand Down
28 changes: 14 additions & 14 deletions src/Endpoints/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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 = [])
{
Expand Down Expand Up @@ -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')
{
Expand All @@ -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')
{
Expand All @@ -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')
{
Expand All @@ -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')
{
Expand All @@ -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)
{
Expand All @@ -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,
Expand Down Expand Up @@ -306,7 +306,7 @@ function ($param) use ($name, $type) {
/**
* @param int $code
* @param string $description
* @return $this
* @return \LaravelApi\Endpoints\Operation
*
* @throws \Exception
*/
Expand All @@ -319,7 +319,7 @@ public function addResponse($code, $description)

/**
* @param string $request
* @return $this
* @return \LaravelApi\Endpoints\Operation
*/
public function bindRequest($request)
{
Expand All @@ -332,7 +332,7 @@ public function bindRequest($request)

/**
* @param array $requestRules
* @return $this
* @return \LaravelApi\Endpoints\Operation
*/
protected function bindRules(array $requestRules)
{
Expand Down Expand Up @@ -364,7 +364,7 @@ protected function getValidationRuleParser()
/**
* @param string $name
* @param array $scopes
* @return $this
* @return \LaravelApi\Endpoints\Operation
*
* @throws \Exception
*/
Expand Down
9 changes: 4 additions & 5 deletions src/Endpoints/ResourceEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace LaravelApi\Endpoints;

use Calcinai\Strut\Definitions\SecurityRequirement;
use Illuminate\Routing\PendingResourceRegistration;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
Expand All @@ -11,12 +10,12 @@
class ResourceEndpoint extends PendingResourceRegistration
{
/**
* @var Api
* @var \LaravelApi\Api
*/
protected $api;

/**
* @var SecurityRequirement
* @var \Calcinai\Strut\Definitions\SecurityRequirement
*/
protected $auth;

Expand All @@ -27,7 +26,7 @@ class ResourceEndpoint extends PendingResourceRegistration

/**
* @param Api $api
* @return ResourceEndpoint
* @return \LaravelApi\Endpoints\ResourceEndpoint
*/
public function setApi(Api $api)
{
Expand Down Expand Up @@ -162,7 +161,7 @@ protected function getResourceMethods()
/**
* @param string $name
* @param array $scopes
* @return $this
* @return \LaravelApi\Endpoints\ResourceEndpoint
*
* @throws \Exception
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/DocsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class DocsController extends IlluminateController
{
/**
* @var Api
* @var \LaravelApi\Api
*/
protected $api;

Expand Down

0 comments on commit f82e1c8

Please sign in to comment.