Back to SessionGcCommand class

Method getSessionService

private \Joomla\Session\SessionInterface
getSessionService
(string $application)
Get the session service for the requested application.
Parameters
  • string $application The application session service to retrieve
Returns
  • \Joomla\Session\SessionInterface
Since
  • 4.0.0

Method getSessionService - Source code

/**
 * Get the session service for the requested application.
 *
 * @param   string  $application  The application session service to retrieve
 *
 * @return  SessionInterface
 *
 * @since   4.0.0
 */
private function getSessionService(string $application) : SessionInterface
{
    if (!$this->getContainer()->has("session.web.{$application}")) {
        throw new \InvalidArgumentException(sprintf('The `%s` application is not a valid option.', $application));
    }
    return $this->getContainer()->get("session.web.{$application}");
}