Passed
Push — master ( 58f2a7...57b220 )
by Jakub
06:37
created

NotificationsRepository::findByUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 2
ccs 1
cts 1
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Orm;
5
6
use Nextras\Orm\Collection\ICollection;
7
8
/**
9
 * @author Jakub Konečný
10
 * @method Notification|null getById(int $id)
11
 * @method Notification|null getBy(array $conds)
12
 * @method ICollection|Notification[] findBy(array $conds)
13
 * @method ICollection|Notification[] findAll()
14
 */
15
final class NotificationsRepository extends \Nextras\Orm\Repository\Repository {
16
  public static function getEntityClassNames(): array {
17 1
    return [Notification::class];
18
  }
19
  
20
  /**
21
   * @param User|int $user
22
   * @return ICollection|Notification[]
23
   */
24
  public function findByUser($user): ICollection {
25 1
    return $this->findBy(["user" => $user]);
26
  }
27
}
28
?>