class BrokenInboundPathProcessor

Same name in other branches
  1. 9 core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php \Drupal\update_script_test\PathProcessor\BrokenInboundPathProcessor
  2. 8.9.x core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php \Drupal\update_script_test\PathProcessor\BrokenInboundPathProcessor
  3. 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 14

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

Title Sort descending Modifiers Object type Summary Overriden Title
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.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.