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

UserFinder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A forHash() 0 5 1
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