Completed
Push — master ( 2e26b5...b4f6b0 )
by Sören
02:18
created

AbstractWishlistManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A findWishlistById() 0 4 1
A findWishlistBySharingCode() 0 4 1
A createWishlist() 0 7 1
1
<?php
2
3
/*
4
 * (c) Soeren Martius
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace SoerenMartius\Component\Wishlist\Manager;
11
12
use SoerenMartius\Component\Wishlist\Model\WishlistInterface;
13
14
/**
15
 * @author Soeren Martius <[email protected]>
16
 */
17
abstract class AbstractWishlistManager implements
18
    WishlistManagerInterface,
19
    ManagerInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function findWishlistById($id)
25
    {
26
        return $this->findWishlistBy(['id' => $id]);
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function findWishlistBySharingCode(string $sharingCode)
33
    {
34
        return $this->findWishlistBy(['sharingCode' => $sharingCode]);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function createWishlist(): WishlistInterface
41
    {
42
        $class = $this->getClass();
43
        $wishlist = new $class();
44
45
        return $wishlist;
46
    }
47
}
48