You are here

class MatchablePaths in AmazonS3 7.2

A list of paths that can be matched against a regular expression.

@class MatchablePaths @package Drupal\amazons3\Matchable

Hierarchy

Expanded class hierarchy of MatchablePaths

4 files declare their use of MatchablePaths
MatchablePathsTest.php in tests/Matchable/MatchablePathsTest.php
StreamWrapperConfiguration.php in src/StreamWrapperConfiguration.php
StreamWrapperConfigurationTest.php in tests/StreamWrapperConfigurationTest.php
StreamWrapperTest.php in tests/StreamWrapperTest.php

File

src/Matchable/MatchablePaths.php, line 11

Namespace

Drupal\amazons3\Matchable
View source
class MatchablePaths implements Matchable {

  /**
   * An array of paths to match against.
   *
   * @var Matchable[]
   */
  protected $paths;

  /**
   * Construct a new set of MatchablePaths.
   *
   * @param Matchable[] $paths
   *   An array of Matchable objects.
   */
  public function __construct(array $paths = array()) {
    $this->paths = $paths;
  }

  /**
   * Return the first object that matches a subject.
   *
   * {@inheritdoc}
   */
  public function match($subject) {
    foreach ($this->paths as $path) {
      if ($path
        ->match($subject)) {
        return $path;
      }
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function __toString() {
    return implode('|', $this->paths);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MatchablePaths::$paths protected property An array of paths to match against.
MatchablePaths::match public function Return the first object that matches a subject. Overrides Matchable::match
MatchablePaths::__construct public function Construct a new set of MatchablePaths.
MatchablePaths::__toString public function