RoomRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A findOneByXandY() 0 4 1
A findAllRooms() 0 4 1
1
<?php
2
3
namespace Rottenwood\KingdomBundle\Entity\Infrastructure;
4
5
use Rottenwood\KingdomBundle\Entity\Room;
6
7
/** {@inheritDoc} */
8
class RoomRepository extends AbstractRepository
9
{
10
11
    /**
12
     * Поиск по координатам
13
     * @param int $x
14
     * @param int $y
15
     * @return Room|null
16
     */
17
    public function findOneByXandY($x, $y)
18
    {
19
        return $this->findOneBy(['x' => $x, 'y' => $y]);
20
    }
21
22
    /**
23
     * Поиск всех комнат
24
     * @return Room[]
25
     */
26
    public function findAllRooms()
27
    {
28
        return $this->findAll();
29
    }
30
}
31