From 8b4d52cd09f7f6bd97a378b6a212e4340cd916e0 Mon Sep 17 00:00:00 2001 From: Sean Mangar Date: Mon, 31 Oct 2016 14:46:22 +0400 Subject: [PATCH] Rename Resource class name Rename class name resource to RestResource Renamed Resource class to RestResource and updated all references to the class in code. Resource is a soft reserved keyword. Usage is highly discouraged as it may be used in future versions of PHP. http://php.net/manual/en/reserved.other-reserved-words.php Resolves: #46 --- src/Action.php | 6 +++--- src/Blueprint.php | 10 +++++----- src/{Resource.php => RestResource.php} | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename src/{Resource.php => RestResource.php} (99%) diff --git a/src/Action.php b/src/Action.php index f6a8b94..9d88824 100644 --- a/src/Action.php +++ b/src/Action.php @@ -25,7 +25,7 @@ class Action extends Section /** * Parent resource of the action. * - * @var \Dingo\Blueprint\Resource + * @var \Dingo\Blueprint\RestResource */ protected $resource; @@ -178,11 +178,11 @@ public function getMethod() /** * Set the parent resource on the action. * - * @param \Dingo\Blueprint\Resource $resource + * @param \Dingo\Blueprint\RestResource $resource * * @return void */ - public function setResource(Resource $resource) + public function setResource(RestResource $resource) { $this->resource = $resource; } diff --git a/src/Blueprint.php b/src/Blueprint.php index edceccd..c50b64c 100644 --- a/src/Blueprint.php +++ b/src/Blueprint.php @@ -108,7 +108,7 @@ public function generate(Collection $controllers, $name, $version, $includePath) $annotations = new Collection($this->reader->getClassAnnotations($controller)); - return new Resource($controller->getName(), $controller, $annotations, $actions); + return new RestResource($controller->getName(), $controller, $annotations, $actions); }); $contents = $this->generateContentsFromResources($resources, $name); @@ -268,11 +268,11 @@ protected function appendParameters(&$contents, Collection $parameters) * * @param string $contents * @param \Dingo\Blueprint\Annotation\Response $response - * @param \Dingo\Blueprint\Resource $resource + * @param \Dingo\Blueprint\RestResource $resource * * @return void */ - protected function appendResponse(&$contents, Annotation\Response $response, Resource $resource) + protected function appendResponse(&$contents, Annotation\Response $response, RestResource $resource) { $this->appendSection($contents, sprintf('Response %s', $response->statusCode)); @@ -298,11 +298,11 @@ protected function appendResponse(&$contents, Annotation\Response $response, Res * * @param string $contents * @param \Dingo\Blueprint\Annotation\Request $request - * @param \Dingo\Blueprint\Resource $resource + * @param \Dingo\Blueprint\RestResource $resource * * @return void */ - protected function appendRequest(&$contents, $request, Resource $resource) + protected function appendRequest(&$contents, $request, RestResource $resource) { $this->appendSection($contents, 'Request'); diff --git a/src/Resource.php b/src/RestResource.php similarity index 99% rename from src/Resource.php rename to src/RestResource.php index 103e40e..fe6194b 100644 --- a/src/Resource.php +++ b/src/RestResource.php @@ -5,7 +5,7 @@ use Illuminate\Support\Collection; use ReflectionClass; -class Resource extends Section +class RestResource extends Section { /** * Resource identifier.