OblistCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10
c 1
b 0
f 0
wmc 3
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
A get() 0 4 2
1
<?php
2
3
/**
4
 * @file
5
 * Contains the state of oblists.
6
 */
7
8
namespace Itafroma\Zork\State;
9
10
class OblistCollection extends AbstractCollection
11
{
12
    /**
13
     * Creates a new oblist within the collection.
14
     *
15
     * @param string $name The name of the oblist to create.
16
     * @return Itafroma\Zork\State\Oblist The oblist created.
17
     */
18 1
    public function create($name)
19
    {
20 1
        $this->atoms[$name] = new Oblist();
21
22 1
        return $this->atoms[$name];
23
    }
24
25
    /**
26
     * Retrieves an oblist by name.
27
     *
28
     * @param string $name The name of the oblist to retrieve.
29
     * @return Itafroma\Zork\State\Oblist The oblist retrieved if it exists, null otherwise.
30
     */
31 2
    public function get($name)
32
    {
33 2
        return isset($this->atoms[$name]) ? $this->atoms[$name] : null;
34
    }
35
}
36