for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jaxon\Di\Traits;
use Closure;
use Jaxon\Session\SessionInterface;
use Jaxon\Session\SessionManager;
trait SessionTrait
{
/**
* Register the values into the container
*
* @return void
*/
private function registerSessions()
// Set the default session manager
$this->set(SessionInterface::class, function() {
set()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
$this->/** @scrutinizer ignore-call */
set(SessionInterface::class, function() {
return new SessionManager();
});
}
* Get the session manager
* @return SessionInterface
public function getSessionManager(): SessionInterface
return $this->g(SessionInterface::class);
g()
return $this->/** @scrutinizer ignore-call */ g(SessionInterface::class);
* Set the session manager
* @param Closure $xClosure A closure to create the session manager instance
public function setSessionManager(Closure $xClosure)
$this->set(SessionInterface::class, $xClosure);