|
4 | 4 |
|
5 | 5 | namespace Tamedevelopers\Support\Traits; |
6 | 6 |
|
| 7 | +use Closure; |
7 | 8 | use DateTime; |
8 | 9 | use Tamedevelopers\Support\Str; |
| 10 | +use Tamedevelopers\Support\Time; |
9 | 11 | use Tamedevelopers\Support\Country; |
10 | 12 | use Tamedevelopers\Support\Capsule\TimeHelper; |
11 | 13 | use Tamedevelopers\Support\Capsule\CustomException; |
|
16 | 18 | * |
17 | 19 | * Internal helpers used by the Time class for cloning, timezone handling, |
18 | 20 | * and common operations. Public API is provided by Time and dynamic dispatch. |
| 21 | + * @property mixed $staticData |
19 | 22 | */ |
20 | 23 | trait TimeTrait{ |
| 24 | + |
| 25 | + /** |
| 26 | + * Determine whether the static context already holds a Time instance. |
| 27 | + * |
| 28 | + * @return bool |
| 29 | + */ |
| 30 | + static protected function isTimeInstance() |
| 31 | + { |
| 32 | + return static::$staticData instanceof self; |
| 33 | + } |
21 | 34 |
|
22 | 35 | /** |
23 | 36 | * Clone a new instance of the owning class. |
@@ -294,7 +307,7 @@ private static function nonExistMethod($method = null, $args = null, $clone = nu |
294 | 307 | 'endofweek' => 'endOfWeek', |
295 | 308 | 'startofmonth' => 'startOfMonth', |
296 | 309 | 'endofmonth' => 'endOfMonth', |
297 | | - 'startofyear' => 'startOfYear', |
| 310 | + 'startofyear', 'startofyears' => 'startOfYear', |
298 | 311 | 'endofyear' => 'endOfYear', |
299 | 312 | 'issameday' => 'isSameDay', |
300 | 313 | 'issamemonth' => 'isSameMonth', |
|
0 commit comments