Completed
Push — 0.3 ( da43ab...625b56 )
by Ben
96:17 queued 52:29
created

DemoPageController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 3
dl 0
loc 7
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A show() 0 3 1
1
<?php
2
3
namespace Thinktomorrow\Chief\Demo\Http\Controllers;
4
5
use Thinktomorrow\Chief\App\Http\Controllers\Controller;
6
use Thinktomorrow\Chief\Concerns\Publishable\CheckPreviewTrait;
7
use Thinktomorrow\Chief\Pages\Page;
8
use Thinktomorrow\Chief\Pages\PageRepository;
0 ignored issues
show
Bug introduced by
The type Thinktomorrow\Chief\Pages\PageRepository was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Illuminate\Http\Request;
10
use Thinktomorrow\Chief\Urls\ChiefResponse;
11
12
class DemoPageController extends Controller
13
{
14
    use CheckPreviewTrait;
15
16 2
    public function show(Request $request)
17
    {
18 2
        return ChiefResponse::fromSlug($request->slug);
19
//        if ($this->isPreviewAllowed()) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
20
//            $page = Page::findBySlug($request->slug);
21
//        } else {
22
//            $page = Page::findPublishedBySlug($request->slug);
23
//        }
24
//
25
//        if (!$page) {
26
//            return redirect()->route('demo.pages.index')->with('note.default', 'Geen resultaten gevonden.');
27
//        }
28
//
29
//        return view('demo::pagedetail', compact('page'));
30
    }
31
}
32