Completed
Push — fix_travis_behat ( 3c7f1b...b1b900 )
by
unknown
54:25 queued 34:54
created

Authenticator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * File containing the Authenticator base class.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\REST\Server;
10
11
use eZ\Publish\API\Repository\Repository;
12
use Qafoo\RMF;
13
14
/**
15
 * Authenticator base class.
16
 */
17
abstract class Authenticator
18
{
19
    /**
20
     * Creates an new Authenticator to $repository.
21
     *
22
     * @param \eZ\Publish\API\Repository\Repository $repository
23
     */
24
    public function __construct(Repository $repository)
25
    {
26
        $this->repository = $repository;
0 ignored issues
show
Bug introduced by
The property repository does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
27
    }
28
29
    /**
30
     * Authenticates the user based on the given request.
31
     *
32
     * Performs an authentication based on the given $request and sets the
33
     * authenticated user into the $repository. Returns true on success, false
34
     * of authentication was not possible or did not succeed.
35
     *
36
     * @param RMF\Request $request
37
     *
38
     * @return bool
39
     */
40
    abstract public function authenticate(RMF\Request $request);
41
}
42