Completed
Push — master ( bd4c23...b341c0 )
by Filipe
10:29
created

NameSpaceCollection::add()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of slick/mvc package
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 Slick\Mvc\Console\Command\Task\AskForNamespace;
11
12
use Slick\Common\Utils\Collection\AbstractCollection;
13
use Slick\Common\Utils\CollectionInterface;
14
15
/**
16
 * NameSpaceCollection
17
 *
18
 * @package Slick\Mvc\Console\Command\Task\AskForNamespace
19
 * @author  Filipe Silva <[email protected]>
20
 */
21
class NameSpaceCollection extends AbstractCollection implements
22
    CollectionInterface
23
{
24
25
    public function offsetSet($offset, $value)
26
    {
27
        $this->add($value);
28
    }
29
30
    /**
31
     * Adds an item to the collection
32
     *
33
     * @param NameSpaceEntry $nameSpace
34
     *
35
     * @return NameSpaceCollection
36
     */
37
    public function add(NameSpaceEntry $nameSpace)
38
    {
39
        $this->data[] = $nameSpace;
40
        return $this;
41
    }
42
}