File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,15 @@ class Expression
60
60
'dec ' => 12 ,
61
61
];
62
62
63
+ public function instance ()
64
+ {
65
+ if (null === static ::$ instance ) {
66
+ static ::$ instance = new static ;
67
+ }
68
+
69
+ return static ::$ instance ;
70
+ }
71
+
63
72
/**
64
73
* Parse cron expression to decide if it can be run on given time (or default now).
65
74
*
@@ -70,11 +79,7 @@ class Expression
70
79
*/
71
80
public static function isDue ($ expr , $ time = null )
72
81
{
73
- if (null === static ::$ instance ) {
74
- static ::$ instance = new static ;
75
- }
76
-
77
- return static ::$ instance ->isCronDue ($ expr , $ time );
82
+ return static ::instance ()->isCronDue ($ expr , $ time );
78
83
}
79
84
80
85
/**
@@ -87,11 +92,7 @@ public static function isDue($expr, $time = null)
87
92
*/
88
93
public static function getDues (array $ jobs , $ time = null )
89
94
{
90
- if (null === static ::$ instance ) {
91
- static ::$ instance = new static ;
92
- }
93
-
94
- return static ::$ instance ->filter ($ jobs , $ time );
95
+ return static ::instance ()->filter ($ jobs , $ time );
95
96
}
96
97
97
98
/**
You can’t perform that action at this time.
0 commit comments