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
- class \Drupal\amazons3\Matchable\MatchablePaths implements Matchable
Expanded class hierarchy of MatchablePaths
4 files declare their use of MatchablePaths
File
- src/
Matchable/ MatchablePaths.php, line 11
Namespace
Drupal\amazons3\MatchableView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MatchablePaths:: |
protected | property | An array of paths to match against. | |
MatchablePaths:: |
public | function |
Return the first object that matches a subject. Overrides Matchable:: |
|
MatchablePaths:: |
public | function | Construct a new set of MatchablePaths. | |
MatchablePaths:: |
public | function |