Passed
Push — master ( 7e81b0...7eb007 )
by Robbie
12:39 queued 11s
created

VerifyHandler::getLeadInLabel()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace SilverStripe\MFA\Tests\Stub\Null;
4
5
use SilverStripe\Control\HTTPRequest;
6
use SilverStripe\Dev\TestOnly;
7
use SilverStripe\MFA\Method\Handler\VerifyHandlerInterface;
8
use SilverStripe\MFA\Model\RegisteredMethod;
9
use SilverStripe\MFA\State\Result;
10
use SilverStripe\MFA\Store\StoreInterface;
11
12
class VerifyHandler implements VerifyHandlerInterface, TestOnly
13
{
14
    /**
15
     * Stores any data required to handle a login process with a method, and returns relevant state to be applied to the
16
     * front-end application managing the process.
17
     *
18
     * @param StoreInterface $store An object that hold session data (and the Member) that can be mutated
19
     * @param RegisteredMethod $method The RegisteredMethod instance that is being verified
20
     * @return array Props to be passed to a front-end component
21
     */
22
    public function start(StoreInterface $store, RegisteredMethod $method): array
23
    {
24
        // TODO: Implement start() method.
25
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return array. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
26
27
    /**
28
     * Verify the request has provided the right information to verify the member that aligns with any sessions state
29
     * that may have been set prior
30
     *
31
     * @param HTTPRequest $request
32
     * @param StoreInterface $store
33
     * @param RegisteredMethod $registeredMethod The RegisteredMethod instance that is being verified
34
     * @return Result
35
     */
36
    public function verify(HTTPRequest $request, StoreInterface $store, RegisteredMethod $registeredMethod): Result
37
    {
38
        // TODO: Implement verify() method.
39
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return SilverStripe\MFA\State\Result. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
40
41
    /**
42
     * Get the key that a React UI component is registered under (with @silverstripe/react-injector on the front-end)
43
     *
44
     * @return string
45
     */
46
    public function getComponent(): string
47
    {
48
        // TODO: Implement getComponent() method.
49
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return string. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
50
}
51