for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Astrotomic\Stancy\Factories;
use Astrotomic\Stancy\Contracts\Page as PageContract;
use Astrotomic\Stancy\Contracts\PageFactory as PageFactoryContract;
use Astrotomic\Stancy\Exceptions\SheetCollectionNotFoundException;
use Astrotomic\Stancy\Exceptions\SheetNotFoundException;
use RuntimeException;
use Spatie\Sheets\Facades\Sheets;
use Spatie\Sheets\Sheet;
class PageFactory implements PageFactoryContract
{
public function make(array $data = [], ?string $page = null): PageContract
return app(PageContract::class, [
'data' => $data,
'page' => $page,
]);
}
public function makeFromSheet(Sheet $sheet, ?string $page = null): PageContract
return static::make($sheet->toArray(), $page);
Astrotomic\Stancy\Factories\PageFactory::make()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return static::/** @scrutinizer ignore-call */ make($sheet->toArray(), $page);
public function makeFromSheetName(string $collection, string $name, ?string $page = null): PageContract
try {
$sheet = Sheets::collection($collection)->get($name);
} catch (RuntimeException $exception) {
throw SheetCollectionNotFoundException::make($collection, $exception);
if ($sheet === null) {
throw SheetNotFoundException::make($collection, $name);
return static::makeFromSheet($sheet, $page);
Astrotomic\Stancy\Factor...actory::makeFromSheet()
return static::/** @scrutinizer ignore-call */ makeFromSheet($sheet, $page);