You are here

private function PharInvocationCollection::triggerDuplicateAliasWarning in Drupal 7

Triggers warning for invocations with same alias and same confirmation state.

Parameters

PharInvocation $invocation:

See also

\TYPO3\PharStreamWrapper\PharStreamWrapper::collectInvocation()

1 call to PharInvocationCollection::triggerDuplicateAliasWarning()
PharInvocationCollection::collect in misc/typo3/phar-stream-wrapper/src/Resolver/PharInvocationCollection.php

File

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

Class

PharInvocationCollection

Namespace

TYPO3\PharStreamWrapper\Resolver

Code

private function triggerDuplicateAliasWarning(PharInvocation $invocation) {
  $sameAliasInvocation = $this
    ->findByCallback(function (PharInvocation $candidate) use ($invocation) {
    return $candidate
      ->isConfirmed() === $invocation
      ->isConfirmed() && $candidate
      ->getAlias() === $invocation
      ->getAlias();
  }, true);
  if ($sameAliasInvocation === null) {
    return;
  }
  trigger_error(sprintf('Alias %s cannot be used by %s, already used by %s', $invocation
    ->getAlias(), $invocation
    ->getBaseName(), $sameAliasInvocation
    ->getBaseName()), E_USER_WARNING);
}