Completed
Push — master ( 541b76...aec89b )
by Henry
05:33
created

includes/Bootstrap/Session.php (1 issue)

Severity

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 1
	 *
23
	 * @since 3.1.0
24 1
	 */
25 1
26
	protected function _autorun()
27
	{
28
		session_start();
29 1
		$this->_request->refreshSession();
30
31 1
		/* prevent hijacking */
32
33 1
		if (!$this->_request->getSession('regenerateId'))
34 1
		{
35
			$this->_request->setSession('regenerateId', 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
		$this->_registry->set('sessionStatus', session_status());
38
	}
39
}
40