Completed
Push — master ( 406296...0a0b96 )
by Daniel
07:00 queued 04:29
created

RowData   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A fromObject() 0 14 2
A getObject() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid;
6
7
/**
8
 * TODO: Tests for this class.
9
 */
10
final class RowData
11
{
12
    private $object;
13
14
    private function __construct()
15
    {
16
    }
17
18
    public static function fromObject($object): RowData
19
    {
20
        if (!is_object($object)) {
21
            throw new \InvalidArgumentException(sprintf(
22
                'Object must be an object, got: "%s"',
23
                gettype($object)
24
            ));
25
        }
26
27
        $instance = new self();
28
        $instance->object = $object;
29
30
        return $instance;
31
    }
32
33
    public function getObject()
34
    {
35
        return $this->object;
36
    }
37
}
38