for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: arthur
* Date: 29.10.18
* Time: 09:38.
*/
namespace Modules\Schedule\Transformers;
use Foundation\Abstracts\Transformers\Transformer;
use Foundation\Exceptions\Exception;
use Modules\Schedule\Entities\Schedule;
use Modules\User\Transformers\UserTransformer;
class ScheduleTransformer extends Transformer
{
public $available = [
'user' => UserTransformer::class,
];
* Transform the resource into an array.
*
* @throws Exception
* @return array
public function transformResource(Schedule $schedule)
return [
'id' => $schedule->id,
'alias' => $schedule->alias,
alias
Modules\Schedule\Entities\Schedule
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.
'timezone' => $schedule->timezone,
timezone
'week_days' => $schedule->week_days,
week_days
'exceptions' => $schedule->exceptions,
exceptions
'randomize' => $schedule->randomize,
randomize
'times' => $schedule->times, //$this->buildTimes($schedule->week_days),
times
timestamps
'accounts' => [],
'created_at' => $schedule->created_at,
'updated_at' => $schedule->updated_at,
}
public function buildTimes($weekDays): array
$weekDays
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function buildTimes(/** @scrutinizer ignore-unused */ $weekDays): array
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return [];
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.