You are here

public static function PresignedPath::factory in AmazonS3 7.2

Create an array of PresignedPaths.

Parameters

array $patterns: An array of patterns. Each key is a regular expression, and each value is an integer of the presigned timeout in seconds.

Return value

PresignedPath[]

Overrides BasicPath::factory

2 calls to PresignedPath::factory()
PresignedPathTest::testFactory in tests/Matchable/PresignedPathTest.php
@covers Drupal\amazons3\Matchable\PresignedPath::factory
StreamWrapperTest::testPresignedPath in tests/StreamWrapperTest.php
@covers \Drupal\amazons3\StreamWrapper::getExternalUrl @covers \Drupal\amazons3\StreamWrapper::usePresigned @covers \Drupal\amazons3\StreamWrapper::getS3Url

File

src/Matchable/PresignedPath.php, line 27

Class

PresignedPath
@class PresignedPath @package Drupal\amazons3

Namespace

Drupal\amazons3\Matchable

Code

public static function factory(array $patterns) {
  $presignedPaths = array();
  foreach ($patterns as $pattern => $timeout) {
    $presignedPaths[] = new static($pattern, $timeout);
  }
  return $presignedPaths;
}