Passed
Push — master ( 7beac6...14a552 )
by Matthijs
02:01
created

ShopRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A findUrl() 0 3 1
A selectAll() 0 3 1
1
<?php
2
namespace Hideyo\Ecommerce\Framework\Services\Shop\Entity;
3
 
4
use Hideyo\Ecommerce\Framework\Services\Shop\Entity\Shop;
5
use Hideyo\Ecommerce\Framework\Services\BaseRepository;
6
7
class ShopRepository extends BaseRepository
8
{
9
    protected $model;
10
11
    public function __construct(Shop $model)
12
    {
13
        $this->model = $model;
14
    }
15
  
16
    public function selectAll()
17
    {
18
        return $this->model->get();
19
    }    
20
21
    public function findUrl($shopUrl)
22
    {
23
        return $result = $this->model->where('url', '=', $shopUrl)->get()->first();     
0 ignored issues
show
Unused Code introduced by
The assignment to $result is dead and can be removed.
Loading history...
24
    }    
25
}