X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FContext%2FSnippet%2FGenerator%2FCachedContextIdentifier.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FContext%2FSnippet%2FGenerator%2FCachedContextIdentifier.php;h=0000000000000000000000000000000000000000;hp=6ff1bb662722f4c92f52c14183891ea3c16d1f61;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Generator/CachedContextIdentifier.php b/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Generator/CachedContextIdentifier.php deleted file mode 100644 index 6ff1bb662..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Snippet/Generator/CachedContextIdentifier.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Context\Snippet\Generator; - -use Behat\Behat\Context\Environment\ContextEnvironment; - -/** - * Decorates actual identifier and caches its answers per suite. - * - * @author Konstantin Kudryashov - */ -final class CachedContextIdentifier implements TargetContextIdentifier -{ - /** - * @var TargetContextIdentifier - */ - private $decoratedIdentifier; - /** - * @var array - */ - private $contextClasses = array(); - - /** - * Initialise the identifier. - * - * @param TargetContextIdentifier $identifier - */ - public function __construct(TargetContextIdentifier $identifier) - { - $this->decoratedIdentifier = $identifier; - } - - /** - * {@inheritdoc} - */ - public function guessTargetContextClass(ContextEnvironment $environment) - { - $suiteKey = $environment->getSuite()->getName(); - - if (array_key_exists($suiteKey, $this->contextClasses)) { - return $this->contextClasses[$suiteKey]; - } - - return $this->contextClasses[$suiteKey] = $this->decoratedIdentifier->guessTargetContextClass($environment); - } -}