NullStorageAdapter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAchievementsForUser() 0 4 1
A awardAchievementToUser() 0 4 1
A removeAchievementFromUser() 0 4 1
1
<?php
2
/**
3
 * The NullStorageAdapter doesn't actually store any achievements.
4
 * It just receives them and send them into the void.
5
 *
6
 * @category  AxalianAchievements\StorageAdapter
7
 * @package   AxalianAchievements\StorageAdapter
8
 * @author    Michel Maas <[email protected]>
9
 */
10
11
namespace AxalianAchievements\StorageAdapter;
12
13
use AxalianAchievements\Entity\Achievement;
14
use AxalianAchievements\User\UserInterface;
15
16
class NullStorageAdapter implements StorageAdapterInterface
17
{
18
19
    /**
20
     * {@inheritDoc}
21
     */
22
    public function getAchievementsForUser(UserInterface $user)
23
    {
24
        return array();
25
    }
26
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function awardAchievementToUser(Achievement $achievement, UserInterface $user)
31
    {
32
        return true;
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38
    public function removeAchievementFromUser(Achievement $achievement, UserInterface $user)
39
    {
40
        return true;
41
    }
42
}
43