Skip to content

Commit b9df566

Browse files
committed
upsome
1 parent 5923ba7 commit b9df566

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/crontab/src/Crontab.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
use Swoft\Bean\Annotation\Mapping\Bean;
77
use Swoft\Bean\BeanFactory;
88
use Swoft\Crontab\Exception\CrontabException;
9-
use Swoft\Stdlib\Helper\PhpHelper;
109
use Swoft\Timer;
1110
use Swoole\Coroutine;
1211
use Swoole\Coroutine\Channel;
1312
use function method_exists;
1413
use 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
}

0 commit comments

Comments
 (0)