You are here

class BrokenInboundPathProcessor in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php \Drupal\update_script_test\PathProcessor\BrokenInboundPathProcessor
  2. 10 core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php \Drupal\update_script_test\PathProcessor\BrokenInboundPathProcessor

Example path processor which breaks on inbound.

Hierarchy

Expanded class hierarchy of BrokenInboundPathProcessor

1 string reference to 'BrokenInboundPathProcessor'
update_script_test.services.yml in core/modules/system/tests/modules/update_script_test/update_script_test.services.yml
core/modules/system/tests/modules/update_script_test/update_script_test.services.yml
1 service uses BrokenInboundPathProcessor
update_script_test.broken_path_processor in core/modules/system/tests/modules/update_script_test/update_script_test.services.yml
Drupal\update_script_test\PathProcessor\BrokenInboundPathProcessor

File

core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php, line 12

Namespace

Drupal\update_script_test\PathProcessor
View source
class BrokenInboundPathProcessor implements InboundPathProcessorInterface {

  /**
   * The state.
   *
   * @var \Drupal\Core\State\StateInterface
   */
  protected $state;

  /**
   * Constructs a new BrokenInboundPathProcessor instance.
   *
   * @param \Drupal\Core\State\StateInterface $state
   *   The state.
   */
  public function __construct(StateInterface $state) {
    $this->state = $state;
  }

  /**
   * {@inheritdoc}
   */
  public function processInbound($path, Request $request) {
    if ($this->state
      ->get('update_script_test_broken_inbound', FALSE)) {
      throw new \RuntimeException();
    }
    else {
      return $path;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrokenInboundPathProcessor::$state protected property The state.
BrokenInboundPathProcessor::processInbound public function Processes the inbound path. Overrides InboundPathProcessorInterface::processInbound
BrokenInboundPathProcessor::__construct public function Constructs a new BrokenInboundPathProcessor instance.