Conditions | 5 |
Paths | 12 |
Total Lines | 44 |
Lines | 0 |
Ratio | 0 % |
Tests | 23 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
26 | 2 | public function autorun() |
|
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); |
|
|
|||
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); |
|
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); |
|
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: