Passed
Pull Request — master (#50)
by Ronan
10:11
created

UserFinder::forHash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace App\Model\Finder;
4
5
use App\Model\User;
6
use Ronanchilvers\Orm\Finder;
7
use ClanCats\Hydrahon\Query\Expression;
8
9
/**
10
 * Finder for user models
11
 *
12
 * @author Ronan Chilvers <[email protected]>
13
 */
14
class UserFinder extends Finder
15
{
16
    /**
17
     * Get a user by hash
18
     *
19
     * @param string $hash
20
     * @return \App\Model\User
21
     * @author Ronan Chilvers <[email protected]>
22
     */
23
    public function forHash($hash)
24
    {
25
        return $this->select()
26
            ->where(User::prefix('hash'), $hash)
27
            ->one();
28
    }
29
}
30