You are here

public function PharInvocationCollection::collect in Drupal 7

Parameters

PharInvocation $invocation:

null|int $flags:

Return value

bool

Overrides Collectable::collect

File

misc/typo3/phar-stream-wrapper/src/Resolver/PharInvocationCollection.php, line 41

Class

PharInvocationCollection

Namespace

TYPO3\PharStreamWrapper\Resolver

Code

public function collect(PharInvocation $invocation, $flags = null) {
  if ($flags === null) {
    $flags = static::UNIQUE_INVOCATION | static::DUPLICATE_ALIAS_WARNING;
  }
  if ($invocation
    ->getBaseName() === '' || $invocation
    ->getAlias() === '' || !$this
    ->assertUniqueBaseName($invocation, $flags) || !$this
    ->assertUniqueInvocation($invocation, $flags)) {
    return false;
  }
  if ($flags & static::DUPLICATE_ALIAS_WARNING) {
    $this
      ->triggerDuplicateAliasWarning($invocation);
  }
  $this->invocations[] = $invocation;
  return true;
}