@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->year = $year; |
50 | 50 | $this->month = $month; |
51 | 51 | $this->day = $day; |
52 | - $this->native = new \DateTime($year . '-' . $month . '-' . $day); |
|
52 | + $this->native = new \DateTime($year.'-'.$month.'-'.$day); |
|
53 | 53 | $this->timestamp = $this->native->getTimeStamp(); |
54 | 54 | parent::__construct([ $year, $month, $day ]); |
55 | 55 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function __toString() |
82 | 82 | { |
83 | - return $this->year . '-' . $this->month . '-' . $this->day; |
|
83 | + return $this->year.'-'.$this->month.'-'.$this->day; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public static function fromNative(\DateTime $native) |
52 | 52 | { |
53 | - return new static(floatval('0.' . $native->format('u'))); |
|
53 | + return new static(floatval('0.'.$native->format('u'))); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -86,6 +86,6 @@ |
||
86 | 86 | */ |
87 | 87 | public function addDay($days) |
88 | 88 | { |
89 | - return static::fromNative($this->native->modify($days . ' day')); |
|
89 | + return static::fromNative($this->native->modify($days.' day')); |
|
90 | 90 | } |
91 | 91 | } |
@@ -121,6 +121,6 @@ |
||
121 | 121 | */ |
122 | 122 | public function __toString() |
123 | 123 | { |
124 | - return $this->hour . ':' . $this->minute . ':' . $this->second; |
|
124 | + return $this->hour.':'.$this->minute.':'.$this->second; |
|
125 | 125 | } |
126 | 126 | } |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace BestServedCold\PhalueObjects; |
4 | 4 | |
5 | -use phpDocumentor\Compiler\Pass\PackageTreeBuilder; |
|
6 | - |
|
7 | 5 | /** |
8 | 6 | * Class ValueObject |
9 | 7 | * |
@@ -133,7 +133,7 @@ |
||
133 | 133 | |
134 | 134 | /** |
135 | 135 | * @param ValueObject $object |
136 | - * @return array|mixed |
|
136 | + * @return ValueObject |
|
137 | 137 | */ |
138 | 138 | public function diff(ValueObject $object) |
139 | 139 | { |
@@ -16,6 +16,6 @@ |
||
16 | 16 | */ |
17 | 17 | public static function now() |
18 | 18 | { |
19 | - return new static(get_defined_functions()['user']); |
|
19 | + return new static(get_defined_functions()[ 'user' ]); |
|
20 | 20 | } |
21 | 21 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | public static function now() |
21 | 21 | { |
22 | - return new static(get_defined_constants(true)['user']); |
|
22 | + return new static(get_defined_constants(true)[ 'user' ]); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | /** |
10 | 10 | * @var array $units |
11 | 11 | */ |
12 | - private $units = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; |
|
12 | + private $units = [ "Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" ]; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @var integer $power |
@@ -55,6 +55,6 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function __toString() |
57 | 57 | { |
58 | - return $this->getValue() ? $this->power() . ' ' . $this->getUnit() : '0 bytes'; |
|
58 | + return $this->getValue() ? $this->power().' '.$this->getUnit() : '0 bytes'; |
|
59 | 59 | } |
60 | 60 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @param array $array |
45 | - * @return array |
|
45 | + * @return string |
|
46 | 46 | */ |
47 | 47 | public function arrayToAttributeArray(array $array) |
48 | 48 | { |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function arrayToPairString(array $array) |
37 | 37 | { |
38 | - return implode(',', array_map(function ($key, $value) { |
|
39 | - return $key . '=' . $value; |
|
38 | + return implode(',', array_map(function($key, $value) { |
|
39 | + return $key.'='.$value; |
|
40 | 40 | }, array_keys($array), $array)); |
41 | 41 | } |
42 | 42 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function arrayToAttributeArray(array $array) |
48 | 48 | { |
49 | 49 | return implode(' ', array_map(function($key, $value) { |
50 | - return is_null($value) ? $key : $key . '="' . $value . '"'; |
|
50 | + return is_null($value) ? $key : $key.'="'.$value.'"'; |
|
51 | 51 | }, array_keys($array), $array)); |
52 | 52 | } |
53 | 53 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public static function nullIfNotSet(array $array, $key = false) |
101 | 101 | { |
102 | - return isset($array[$key]) ? $array[$key] : null; |
|
102 | + return isset($array[ $key ]) ? $array[ $key ] : null; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -109,6 +109,6 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public static function falseIfNotSet(array $array, $key = false) |
111 | 111 | { |
112 | - return isset($array[$key]) ? $array[$key] : false; |
|
112 | + return isset($array[ $key ]) ? $array[ $key ] : false; |
|
113 | 113 | } |
114 | 114 | } |