@@ -26,56 +26,56 @@ discard block |
||
| 26 | 26 | const ERROR_NO_DATE_FROM_SET = 43401; |
| 27 | 27 | |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * @var int |
|
| 31 | - */ |
|
| 29 | + /** |
|
| 30 | + * @var int |
|
| 31 | + */ |
|
| 32 | 32 | protected $dateFrom; |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @var int |
|
| 36 | - */ |
|
| 34 | + /** |
|
| 35 | + * @var int |
|
| 36 | + */ |
|
| 37 | 37 | protected $dateTo; |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @var bool |
|
| 41 | - */ |
|
| 39 | + /** |
|
| 40 | + * @var bool |
|
| 41 | + */ |
|
| 42 | 42 | protected $future = false; |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * @var string |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * @var string |
|
| 46 | + */ |
|
| 47 | 47 | protected $interval = ''; |
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @var int |
|
| 51 | - */ |
|
| 49 | + /** |
|
| 50 | + * @var int |
|
| 51 | + */ |
|
| 52 | 52 | protected $difference = 0; |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @var int |
|
| 56 | - */ |
|
| 54 | + /** |
|
| 55 | + * @var int |
|
| 56 | + */ |
|
| 57 | 57 | protected $dateDiff = 0; |
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * @var array |
|
| 61 | - */ |
|
| 59 | + /** |
|
| 60 | + * @var array |
|
| 61 | + */ |
|
| 62 | 62 | protected static $texts; |
| 63 | 63 | |
| 64 | 64 | public function __construct() |
| 65 | 65 | { |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - /** |
|
| 69 | - * Sets the origin date to calculate from. |
|
| 70 | - * |
|
| 71 | - * NOTE: if this is further in the future than |
|
| 72 | - * the to: date, it will be considered as a |
|
| 73 | - * calculation for something to come, i.e. |
|
| 74 | - * "In two days". |
|
| 75 | - * |
|
| 76 | - * @param \DateTime $date |
|
| 77 | - * @return ConvertHelper_DurationConverter |
|
| 78 | - */ |
|
| 68 | + /** |
|
| 69 | + * Sets the origin date to calculate from. |
|
| 70 | + * |
|
| 71 | + * NOTE: if this is further in the future than |
|
| 72 | + * the to: date, it will be considered as a |
|
| 73 | + * calculation for something to come, i.e. |
|
| 74 | + * "In two days". |
|
| 75 | + * |
|
| 76 | + * @param \DateTime $date |
|
| 77 | + * @return ConvertHelper_DurationConverter |
|
| 78 | + */ |
|
| 79 | 79 | public function setDateFrom(\DateTime $date) : ConvertHelper_DurationConverter |
| 80 | 80 | { |
| 81 | 81 | $this->dateFrom = ConvertHelper::date2timestamp($date); |
@@ -83,13 +83,13 @@ discard block |
||
| 83 | 83 | return $this; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * Sets the date to calculate to. Defaults to |
|
| 88 | - * the current time if not set. |
|
| 89 | - * |
|
| 90 | - * @param \DateTime $date |
|
| 91 | - * @return ConvertHelper_DurationConverter |
|
| 92 | - */ |
|
| 86 | + /** |
|
| 87 | + * Sets the date to calculate to. Defaults to |
|
| 88 | + * the current time if not set. |
|
| 89 | + * |
|
| 90 | + * @param \DateTime $date |
|
| 91 | + * @return ConvertHelper_DurationConverter |
|
| 92 | + */ |
|
| 93 | 93 | public function setDateTo(\DateTime $date) : ConvertHelper_DurationConverter |
| 94 | 94 | { |
| 95 | 95 | $this->dateTo = ConvertHelper::date2timestamp($date); |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | return $this; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - /** |
|
| 101 | - * Converts the specified dates to a human readable string. |
|
| 102 | - * |
|
| 103 | - * @throws ConvertHelper_Exception |
|
| 104 | - * @return string |
|
| 105 | - * |
|
| 106 | - * @see ConvertHelper_DurationConverter::ERROR_NO_DATE_FROM_SET |
|
| 107 | - */ |
|
| 100 | + /** |
|
| 101 | + * Converts the specified dates to a human readable string. |
|
| 102 | + * |
|
| 103 | + * @throws ConvertHelper_Exception |
|
| 104 | + * @return string |
|
| 105 | + * |
|
| 106 | + * @see ConvertHelper_DurationConverter::ERROR_NO_DATE_FROM_SET |
|
| 107 | + */ |
|
| 108 | 108 | public function convert() : string |
| 109 | 109 | { |
| 110 | 110 | $this->initTexts(); |