for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xervice\Session;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
use Xervice\Core\Business\Model\Dependency\DependencyContainerInterface;
use Xervice\Core\Business\Model\Dependency\Provider\AbstractDependencyProvider;
class SessionDependencyProvider extends AbstractDependencyProvider
{
public const SESSION_HANDLER = 'session.handler';
/**
* @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container
*
* @return \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface
*/
public function handleDependencies(DependencyContainerInterface $container): DependencyContainerInterface
$container = $this->addSessionHandler($container);
return $container;
}
* @return \SessionHandlerInterface
* @throws \RuntimeException
* @throws \InvalidArgumentException
protected function getSessionHandler(DependencyContainerInterface $container): \SessionHandlerInterface
$container
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
protected function getSessionHandler(/** @scrutinizer ignore-unused */ DependencyContainerInterface $container): \SessionHandlerInterface
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return new NativeFileSessionHandler();
protected function addSessionHandler(
DependencyContainerInterface $container
): DependencyContainerInterface {
$container[self::SESSION_HANDLER] = function (DependencyContainerInterface $container) {
return $this->getSessionHandler($container);
};
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.