| Total Complexity | 5 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | final class Framework implements \JsonSerializable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string|null |
||
| 12 | */ |
||
| 13 | private $name; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string|null |
||
| 17 | */ |
||
| 18 | private $version; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param string|null $name |
||
| 22 | * @param string|null $version |
||
| 23 | */ |
||
| 24 | 16 | public function __construct($name = null, $version = null) |
|
| 25 | { |
||
| 26 | 16 | $this->name = $name; |
|
| 27 | 16 | $this->version = $version; |
|
| 28 | 16 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param CoreConfiguration $coreConfiguration |
||
| 32 | * |
||
| 33 | * @return Framework |
||
| 34 | */ |
||
| 35 | 13 | public static function create(CoreConfiguration $coreConfiguration) |
|
| 36 | { |
||
| 37 | 13 | return new self( |
|
| 38 | 13 | $coreConfiguration->frameworkName(), |
|
| 39 | 13 | $coreConfiguration->frameworkVersion() |
|
| 40 | 13 | ); |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return string|null |
||
| 45 | */ |
||
| 46 | 2 | public function name() |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return string|null |
||
| 53 | */ |
||
| 54 | 2 | public function version() |
|
| 55 | { |
||
| 56 | 2 | return $this->version; |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | 1 | public function jsonSerialize() |
|
| 67 | 1 | ]; |
|
| 68 | } |
||
| 70 |