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
6060 'dec ' => 12 ,
6161 ];
6262
63+ public function instance ()
64+ {
65+ if (null === static ::$ instance ) {
66+ static ::$ instance = new static ;
67+ }
68+
69+ return static ::$ instance ;
70+ }
71+
6372 /**
6473 * Parse cron expression to decide if it can be run on given time (or default now).
6574 *
@@ -70,11 +79,7 @@ class Expression
7079 */
7180 public static function isDue ($ expr , $ time = null )
7281 {
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 );
7883 }
7984
8085 /**
@@ -87,11 +92,7 @@ public static function isDue($expr, $time = null)
8792 */
8893 public static function getDues (array $ jobs , $ time = null )
8994 {
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 );
9596 }
9697
9798 /**
You can’t perform that action at this time.
0 commit comments