Skip to content

Commit e9d3258

Browse files
committed
docblock + naming nitpicks
1 parent 9a8df2e commit e9d3258

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/Fractal.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Fractal
4848
/**
4949
* @var string
5050
*/
51-
protected $resource_name;
51+
protected $resourceName;
5252

5353
/**
5454
* @param \League\Fractal\Manager $manager
@@ -63,12 +63,13 @@ public function __construct(Manager $manager)
6363
*
6464
* @param mixed $data
6565
* @param \League\Fractal\TransformerAbstract|Callable|null $transformer
66+
* @param string|null $resourceName
6667
*
6768
* @return $this
6869
*/
69-
public function collection($data, $transformer = null, $resource_name = null)
70+
public function collection($data, $transformer = null, $resourceName = null)
7071
{
71-
$this->resource_name = $resource_name;
72+
$this->resourceName = $resourceName;
7273

7374
return $this->data('collection', $data, $transformer);
7475
}
@@ -78,12 +79,13 @@ public function collection($data, $transformer = null, $resource_name = null)
7879
*
7980
* @param mixed $data
8081
* @param \League\Fractal\TransformerAbstract|Callable|null $transformer
82+
* @param string|null $resourceName
8183
*
8284
* @return $this
8385
*/
84-
public function item($data, $transformer = null, $resource_name = null)
86+
public function item($data, $transformer = null, $resourceName = null)
8587
{
86-
$this->resource_name = $resource_name;
88+
$this->resourceName = $resourceName;
8789

8890
return $this->data('item', $data, $transformer);
8991
}
@@ -127,7 +129,7 @@ public function transformWith($transformer)
127129
/**
128130
* Set a Fractal paginator for the data.
129131
*
130-
* @param PaginatorInterface $paginator
132+
* @param \League\Fractal\Pagination\PaginatorInterface $paginator
131133
*
132134
* @return $this
133135
*/
@@ -159,6 +161,9 @@ public function parseIncludes($includes)
159161
/**
160162
* Support for magic methods to included data.
161163
*
164+
* @param string $name
165+
* @param array $arguments
166+
*
162167
* @return $this
163168
*/
164169
public function __call($name, array $arguments)
@@ -189,13 +194,13 @@ public function serializeWith(SerializerAbstract $serializer)
189194
/**
190195
* Set the resource name, to replace 'data' as the root of the collection or item.
191196
*
192-
* @param $resource_name
197+
* @param string $resourceName
193198
*
194199
* @return $this
195200
*/
196-
public function resourceName($resource_name)
201+
public function resourceName($resourceName)
197202
{
198-
$this->resource_name = $resource_name;
203+
$this->resourceName = $resourceName;
199204

200205
return $this;
201206
}
@@ -279,7 +284,7 @@ public function getResource()
279284
throw new InvalidTransformation();
280285
}
281286

282-
$resource = new $resourceClass($this->data, $this->transformer, $this->resource_name);
287+
$resource = new $resourceClass($this->data, $this->transformer, $this->resourceName);
283288

284289
if (!is_null($this->paginator)) {
285290
$resource->setPaginator($this->paginator);

0 commit comments

Comments
 (0)