Passed
Push — master ( 7c5543...bc6bd7 )
by Austin
02:05
created

SecurityTxtController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A show() 0 6 2
1
<?php
2
/**
3
 * src/SecurityTxtController.php
4
 *
5
 * @package     laravel-security-txt
6
 * @author      Austin Heap <[email protected]>
7
 * @version     v0.3.0
8
 */
9
10
declare(strict_types=1);
11
12
namespace AustinHeap\Security\Txt;
13
14
/**
15
 * SecurityTxtController
16
 *
17
 * @link        https://github.com/austinheap/laravel-security-txt
18
 * @link        https://packagist.org/packages/austinheap/laravel-security-txt
19
 * @link        https://austinheap.github.io/laravel-security-txt/classes/AustinHeap.Security.Txt.SecurityTxtController.html
20
 */
21
class SecurityTxtController extends \App\Http\Controllers\Controller
0 ignored issues
show
Bug introduced by
The type App\Http\Controllers\Controller 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...
22
{
23
24
    /**
25
     * Show the security.txt file.
26
     *
27
     * @return \Illuminate\Http\Response
28
     */
29
    public function show()
30
    {
31
        if (!config('security-txt.enabled', false))
32
            abort(404);
33
34
        return \Response::make((new SecurityTxtHelper)->fetch(), 200, ['Content-Type' => 'text/plain']);
35
    }
36
37
}
38