for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Hechoenlaravel\JarvisFoundation\Flows\Transformers;
use Hechoenlaravel\JarvisFoundation\Flows\Flow;
use League\Fractal\TransformerAbstract;
/**
* Class FlowTransformer
* @package Hechoenlaravel\JarvisFoundation\Flows\Transformers
*/
class FlowTransformer extends TransformerAbstract
{
* @var array
protected $availableIncludes = ['steps'];
* @param Flow $flow
* @return array
public function transform(Flow $flow)
return [
'id' => (int) $flow->id,
'name' => $flow->name,
'description' => $flow->description,
'created' => $flow->created_at,
'updated' => $flow->updated_at,
'active' => $flow->active
];
}
* @return \League\Fractal\Resource\Collection|null
public function includeSteps(Flow $flow)
if ($flow->steps->count() > 0) {
return $this->collection($flow->steps, new StepTransformer());
new \Hechoenlaravel\Jarv...rmers\StepTransformer()
object<Hechoenlaravel\Ja...ormers\StepTransformer>
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);
return null;
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: