RepositoryCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A put() 0 7 2
1
<?php
2
3
namespace App\Satis\Collections;
4
5
use \InvalidArgumentException;
6
use App\Satis\Model\Repository;
7
use Illuminate\Support\Collection;
8
9
/**
10
 * @author Lukas Homza <[email protected]>
11
 */
12
class RepositoryCollection extends Collection {
13
    /**
14
     * Put an item in the collection by key.
15
     *
16
     * @param  mixed  $key
17
     * @param  mixed  $value
18
     * @return $this
19
     */
20
    public function put($key, $value) {
21
        if(!$value instanceof Repository) {
22
            throw new InvalidArgumentException('RepositoryCollection accepts only elements of "Repository" type.');
23
        }
24
25
        return parent::put($key, $value);
26
    }
27
}
28