for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the LightSAML-Core package.
*
* (c) Milos Tomic <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace LightSaml\Context\Profile;
class ExceptionContext extends AbstractProfileContext
{
/** @var \Exception */
protected $exception;
/** @var ExceptionContext|null */
protected $nextExceptionContext;
public function __construct(\Exception $exception = null)
$this->exception = $exception;
}
/**
* @return \Exception
public function getException()
return $this->exception;
* @return \Exception|null
public function getLastException()
if (null == $this->nextExceptionContext) {
return $this->nextExceptionContext->getException();
* @return ExceptionContext|null
public function getNextExceptionContext()
return $this->nextExceptionContext;
* @return ExceptionContext
public function addException(\Exception $exception)
if ($this->exception) {
$this->nextExceptionContext = new self($exception);
} else {
return $this->nextExceptionContext->addException($exception);
return $this;