These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Bootstrap; |
||
3 | |||
4 | use Redaxscript\Dater; |
||
5 | use Redaxscript\Model; |
||
6 | use Redaxscript\Module; |
||
7 | |||
8 | /** |
||
9 | * children class to boot the cronjob |
||
10 | * |
||
11 | * @since 3.1.0 |
||
12 | * |
||
13 | * @package Redaxscript |
||
14 | * @category Bootstrap |
||
15 | * @author Henry Ruhs |
||
16 | */ |
||
17 | |||
18 | class Cronjob extends BootstrapAbstract |
||
19 | { |
||
20 | /** |
||
21 | * automate run |
||
22 | * |
||
23 | * @since 3.1.0 |
||
24 | */ |
||
25 | |||
26 | 2 | public function autorun() : void |
|
27 | { |
||
28 | 2 | $dater = new Dater(); |
|
29 | 2 | $dater->init(); |
|
30 | 2 | $this->_registry->set('now', $dater->getDateTime()->getTimestamp()); |
|
31 | 2 | $this->_registry->set('cronUpdate', false); |
|
0 ignored issues
–
show
|
|||
32 | |||
33 | /* set the update */ |
||
34 | |||
35 | 2 | if (!$this->_request->getSession('nextUpdate')) |
|
36 | { |
||
37 | 1 | $this->_request->setSession('nextUpdate', $dater->getDateTime()->modify('+1 minute')->getTimestamp()); |
|
38 | 1 | $this->_registry->set('cronUpdate', true); |
|
0 ignored issues
–
show
true is of type boolean , but the function expects a string|array|null .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
39 | } |
||
40 | |||
41 | /* reset the update */ |
||
42 | |||
43 | 2 | if ($this->_request->getSession('nextUpdate') < $this->_registry->get('now')) |
|
44 | { |
||
45 | 1 | $this->_request->setSession('nextUpdate', false); |
|
0 ignored issues
–
show
false is of type boolean , but the function expects a string|array|null .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
Loading history...
|
|||
46 | } |
||
47 | |||
48 | /* trigger update */ |
||
49 | |||
50 | 2 | if ($this->_registry->get('cronUpdate')) |
|
51 | { |
||
52 | 1 | Module\Hook::trigger('cronUpdate'); |
|
53 | 1 | if ($this->_registry->get('dbStatus') === 2) |
|
54 | { |
||
55 | 1 | $categoryModel = new Model\Category(); |
|
56 | 1 | $articleModel = new Model\Article(); |
|
57 | 1 | $commentModel = new Model\Comment(); |
|
58 | 1 | $extraModel = new Model\Extra(); |
|
59 | 1 | $now = $this->_registry->get('now'); |
|
60 | |||
61 | /* publish by date */ |
||
62 | |||
63 | 1 | $categoryModel->publishByDate($now); |
|
64 | 1 | $articleModel->publishByDate($now); |
|
65 | 1 | $commentModel->publishByDate($now); |
|
66 | 1 | $extraModel->publishByDate($now); |
|
67 | } |
||
68 | } |
||
69 | 2 | } |
|
70 | } |
||
71 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: