Completed
Push — master ( 0ea243...da58d4 )
by Henry
10:25 queued 33s
created

includes/Bootstrap/Session.php (1 issue)

mismatching argument types.

Documentation Minor

Upgrade to new PHP Analysis Engine

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 function session_regenerate_id;
5
use function session_start;
6
use function session_status;
7
8
/**
9
 * children class to boot the session
10
 *
11
 * @since 3.1.0
12
 *
13
 * @package Redaxscript
14
 * @category Bootstrap
15
 * @author Henry Ruhs
16
 */
17
18
class Session extends BootstrapAbstract
19
{
20
	/**
21
	 * automate run
22
	 *
23
	 * @since 3.1.0
24
	 */
25
26 1
	public function autorun() : void
27
	{
28 1
		session_start();
29 1
		$this->_request->refreshSession();
30
31
		/* session guard */
32
33 1
		if (!$this->_request->getSession('sessionGuard'))
34
		{
35 1
			$this->_request->setSession('sessionGuard', session_regenerate_id());
0 ignored issues
show
\session_regenerate_id() 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...
36
		}
37 1
		$this->_registry->set('sessionStatus', session_status());
38 1
	}
39
}
40