You are here

class FeedsExJmesPathV1Wrapper in Feeds extensible parsers 7

Converts version 1 runtimes to version 2.

Hierarchy

Expanded class hierarchy of FeedsExJmesPathV1Wrapper

File

src/FeedsExJmesPath.inc, line 285
Contains FeedsExJmesPath.

View source
class FeedsExJmesPathV1Wrapper {

  /**
   * The version 1 runtime.
   *
   * @var \JmesPath\Runtime\RuntimeInterface
   */
  protected $runtime;

  /**
   * Constructs a FeedsExJmesPathV1Wrapper object.
   *
   * @param \JmesPath\Runtime\RuntimeInterface $runtime
   *   A version 1 JMESPath runtime object.
   */
  public function __construct(RuntimeInterface $runtime) {
    $this->runtime = $runtime;
  }

  /**
   * Version 2 runtimes are invokable objects.
   */
  public function __invoke($expression, $data) {
    return $this->runtime
      ->search($expression, $data);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsExJmesPathV1Wrapper::$runtime protected property The version 1 runtime.
FeedsExJmesPathV1Wrapper::__construct public function Constructs a FeedsExJmesPathV1Wrapper object.
FeedsExJmesPathV1Wrapper::__invoke public function Version 2 runtimes are invokable objects.