|
@@ -5,7 +5,7 @@ namespace App\Yr\Forecast\Tabular\Time;
|
|
|
/**
|
|
|
* Time-object entity should inherit this
|
|
|
*/
|
|
|
-abstract class AbstractUnit implements DiffInterface {
|
|
|
+abstract class AbstractUnit implements DiffInterface, \JsonSerializable {
|
|
|
const DEFAULT_VARIANCE = 2;
|
|
|
|
|
|
private $value = 0;
|
|
@@ -140,6 +140,10 @@ abstract class AbstractUnit implements DiffInterface {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ public function jsonSerialize(): string {
|
|
|
+ return $this->__toString();
|
|
|
+ }
|
|
|
+
|
|
|
public function __toString(): string {
|
|
|
return sprintf(
|
|
|
"%s: %01.1f %s", basename(str_replace(
|