Completed
Branch master (597d40)
by Douglas
02:41 queued 01:20
created

CompassMove::southward()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * (c) 2018 Douglas Reith.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
declare(strict_types=1);
10
11
namespace Reith\ToyRobot\Domain\Robot;
12
13
/**
14
 * Model movement as the application of a Vector (place)
15
 * in a 2 dimensional space.
16
 */
17
class CompassMove
18
{
19 2
    public static function northward(): Place
20
    {
21 2
        return Place::create([0, 1]);
22
    }
23
24 1
    public static function eastward(): Place
25
    {
26 1
        return Place::create([1, 0]);
27
    }
28
29 2
    public static function southward(): Place
30
    {
31 2
        return Place::create([0, -1]);
32
    }
33
34 2
    public static function westward(): Place
35
    {
36 2
        return Place::create([-1, 0]);
37
    }
38
}
39