IndexController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 24
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 5 1
A learn() 0 5 1
1
<?php
2
3
namespace Bone\App\Controller;
4
5
use Bone\Controller\Controller;
6
use Bone\Http\Response\HtmlResponse;
7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
10
/**
11
 * Class IndexController
12
 * If you need to create a constructor, edit the package class to set it  up automatically via dependency injection
13
 *
14
 * The below annotations are for use with delboy1978uk/bone-open-api, you can remove them if you wont be using it
15
 * @OA\Info(
16
 *     version="1.0.0",
17
 *     title="Bone Framework API",
18
 *     description="This be a swashbucklin' API."
19
 * )
20
 * @OA\ExternalDocumentation(
21
 *     description="By delboy1978uk",
22
 *     url="https://github.com/delboy1978uk/boneframework"
23
 * )
24
 * @OA\SecurityScheme(
25
 *     type="oauth2",
26
 *     name="bone-oauth2",
27
 *     securityScheme="bone-oauth2",
28
 *     @OA\Flow(
29
 *         flow="authorizationCode",
30
 *         authorizationUrl="https://awesome.scot/oauth2/authorize",
31
 *         scopes={
32
 *             "basic": "Access public API data",
33
 *             "register-client": "Create and rewgistger clients",
34
 *         }
35
 *     )
36
 * )
37
 * @OA\SecurityScheme(
38
 *     type="apiKey",
39
 *     in="header",
40
 *     securityScheme="api_key",
41
 *     name="api_key"
42
 * )
43
 */
44
class IndexController extends Controller
45
{
46
    /**
47
     * @param ServerRequestInterface $request
48
     * @param array $args
49
     * @return ResponseInterface
50
     */
51 1
    public function index(ServerRequestInterface $request) : ResponseInterface
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

51
    public function index(/** @scrutinizer ignore-unused */ ServerRequestInterface $request) : ResponseInterface

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
52
    {
53 1
        $body = $this->view->render('app::index');
54
55 1
        return new HtmlResponse($body);
56
    }
57
58
    /**
59
     * @param ServerRequestInterface $request
60
     * @param array $args
61
     * @return ResponseInterface
62
     */
63 1
    public function learn(ServerRequestInterface $request) : ResponseInterface
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

63
    public function learn(/** @scrutinizer ignore-unused */ ServerRequestInterface $request) : ResponseInterface

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
64
    {
65 1
        $body = $this->view->render('app::learn');
66
67 1
        return new HtmlResponse($body);
68
    }
69
}
70