for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\Fractal\Hal;
use League\Fractal\TransformerAbstract;
/**
* Class responsible for the Hypertext Application Language (HAL) transformation.
*
* @package League\Fractal\Hal
*/
class HalTransformer extends TransformerAbstract
{
* List of resources to automatically include.
* @var array
protected $defaultIncludes = [
'curries'
];
* Transform data to output.
* @param HalInterface $resource Links to the current data.
* @return array List with transformed data.
public function transform(HalInterface $resource)
return [
'self' => $resource->getSelfLink(),
'next' => $resource->getNextLink(),
'previous' => $resource->getPreviousLink()
}
* Include resources locations.
* @return \League\Fractal\Resource\Item Fractal resource item OBJ.
public function includeCurries(HalInterface $resource)
return $this->collection($resource->getCurries(), new CurrieTransformer());
new \League\Fractal\Hal\CurrieTransformer()
object<League\Fractal\Hal\CurrieTransformer>
callable
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: