Completed
Push — master ( e955b9...2ea211 )
by Abdelrahman
04:33 queued 01:46
created

routes/breadcrumbs/adminarea.php (3 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
declare(strict_types=1);
4
5
use Cortex\Pages\Models\Page;
6
use DaveJamesMiller\Breadcrumbs\Facades\Breadcrumbs;
7
use DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator;
8
9
Breadcrumbs::register('adminarea.pages.index', function (BreadcrumbsGenerator $breadcrumbs) {
10
    $breadcrumbs->push('<i class="fa fa-dashboard"></i> '.config('app.name'), route('adminarea.home'));
11
    $breadcrumbs->push(trans('cortex/pages::common.pages'), route('adminarea.pages.index'));
12
});
13
14
Breadcrumbs::register('adminarea.pages.import', function (BreadcrumbsGenerator $breadcrumbs) {
15
    $breadcrumbs->parent('adminarea.pages.index');
16
    $breadcrumbs->push(trans('cortex/pages::common.import'), route('adminarea.pages.import'));
17
});
18
19
Breadcrumbs::register('adminarea.pages.import.logs', function (BreadcrumbsGenerator $breadcrumbs) {
20
    $breadcrumbs->parent('adminarea.pages.index');
21
    $breadcrumbs->push(trans('cortex/pages::common.import'), route('adminarea.pages.import'));
22
    $breadcrumbs->push(trans('cortex/pages::common.logs'), route('adminarea.pages.import.logs'));
23
});
24
25
Breadcrumbs::register('adminarea.pages.create', function (BreadcrumbsGenerator $breadcrumbs) {
26
    $breadcrumbs->parent('adminarea.pages.index');
27
    $breadcrumbs->push(trans('cortex/pages::common.create_page'), route('adminarea.pages.create'));
28
});
29
30
Breadcrumbs::register('adminarea.pages.edit', function (BreadcrumbsGenerator $breadcrumbs, Page $page) {
31
    $breadcrumbs->parent('adminarea.pages.index');
32
    $breadcrumbs->push($page->title, route('adminarea.pages.edit', ['page' => $page]));
0 ignored issues
show
$page->title is of type array, but the function expects a string.

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);
Loading history...
33
});
34
35
Breadcrumbs::register('adminarea.pages.logs', function (BreadcrumbsGenerator $breadcrumbs, Page $page) {
36
    $breadcrumbs->parent('adminarea.pages.index');
37
    $breadcrumbs->push($page->title, route('adminarea.pages.edit', ['page' => $page]));
0 ignored issues
show
$page->title is of type array, but the function expects a string.

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);
Loading history...
38
    $breadcrumbs->push(trans('cortex/pages::common.logs'), route('adminarea.pages.logs', ['page' => $page]));
39
});
40
41
Breadcrumbs::register('adminarea.pages.media.index', function (BreadcrumbsGenerator $breadcrumbs, Page $page) {
42
    $breadcrumbs->parent('adminarea.pages.index');
43
    $breadcrumbs->push($page->title, route('adminarea.pages.edit', ['page' => $page]));
0 ignored issues
show
$page->title is of type array, but the function expects a string.

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);
Loading history...
44
    $breadcrumbs->push(trans('cortex/pages::common.media'), route('adminarea.pages.media.index', ['page' => $page]));
45
});
46