for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Phossa Project
*
* PHP version 5.4
* @category Library
* @package Phossa2\Session
* @copyright Copyright (c) 2016 phossa.com
* @license http://mit-license.org/ MIT License
* @link http://www.phossa.com/
*/
/*# declare(strict_types=1); */
namespace Phossa2\Session\Traits;
use Phossa2\Session\Interfaces\SessionInterface;
use Phossa2\Session\Interfaces\SessionAwareInterface;
* SessionAwareTrait
* @author Hong Zhang <[email protected]>
* @see SessionAwareInterface
* @version 2.1.0
* @since 2.1.0 added
trait SessionAwareTrait
{
use DefaultSessionAwareTrait;
* @var SessionInterface
* @access protected
protected $session;
* {@inheritDoc}
public function setSession(SessionInterface $session = null)
$this->session = $session;
return $this;
}
public function getSession()/*# : SessionInterface */
if (null === $this->session) {
return static::getDefaultSession();
} else {
return $this->session;