src/Manager/Breads.php
File Breads.php
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Voyager\Admin\Manager;
use Illuminate\Container\Container;
Breads
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Breads
{
protected Collection $formfields;
protected string $path;
protected ?Collection $breads = null;
Method getModelRelationships
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getModelRelationships(\ReflectionClass $reflection, Model $model, bool $resolve = false): Collection
{
$single = [
BelongsTo::class,
HasOne::class,
Method getFormfields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getFormfields()
{
return $this->formfields->map(function ($formfield) {
$component = 'Formfield'.Str::studly($formfield->type());
$builder_component = 'Formfield'.Str::studly($formfield->type()).'Builder';
Method getBreads
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getBreads()
{
if (!$this->breads) {
VoyagerFacade::ensureDirectoryExists($this->path);
$this->breads = collect(File::files($this->path))->transform(function ($bread) {
Avoid too many return
statements within this method. Wontfix
Wontfix
return $this->breads;
Avoid too many return
statements within this method. Open
Open
return [$value->name_singular => $value];