BrokenInboundPathProcessor.php in Zircon Profile 8.0
File
core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php
View source
<?php
namespace Drupal\update_script_test\PathProcessor;
use Drupal\Core\PathProcessor\InboundPathProcessorInterface;
use Drupal\Core\State\StateInterface;
use Symfony\Component\HttpFoundation\Request;
class BrokenInboundPathProcessor implements InboundPathProcessorInterface {
protected $state;
public function __construct(StateInterface $state) {
$this->state = $state;
}
public function processInbound($path, Request $request) {
if ($this->state
->get('update_script_test_broken_inbound', FALSE)) {
throw new \RuntimeException();
}
else {
return $path;
}
}
}