File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 66use Swoft \Bean \Annotation \Mapping \Bean ;
77use Swoft \Bean \BeanFactory ;
88use Swoft \Crontab \Exception \CrontabException ;
9- use Swoft \Stdlib \Helper \PhpHelper ;
109use Swoft \Timer ;
1110use Swoole \Coroutine ;
1211use Swoole \Coroutine \Channel ;
1312use function method_exists ;
1413use function sprintf ;
14+ use function time ;
1515
1616/**
1717 * Class Crontab
@@ -88,20 +88,18 @@ public function dispatch(): void
8888
8989 /**
9090 * @param string $beanName
91- * @param string $methodName
91+ * @param string $method
9292 *
9393 * @throws CrontabException
9494 */
95- public function execute (string $ beanName , string $ methodName ): void
95+ public function execute (string $ beanName , string $ method ): void
9696 {
9797 $ object = BeanFactory::getBean ($ beanName );
9898
99- if (!method_exists ($ object , $ methodName )) {
100- throw new CrontabException (sprintf ('Crontab(name=%s method=%s) method is not exist! ' , $ beanName ,
101- $ methodName ));
99+ if (!method_exists ($ object , $ method )) {
100+ throw new CrontabException (sprintf ('Crontab(name=%s method=%s) method is not exist! ' , $ beanName , $ method ));
102101 }
103102
104- // TODO $object->$methodName();
105- PhpHelper::call ([$ object , $ methodName ]);
103+ $ object ->$ method ();
106104 }
107105}
You can’t perform that action at this time.
0 commit comments