X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FContext%2FReader%2FContextReaderCachedPerSuite.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FContext%2FReader%2FContextReaderCachedPerSuite.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=4a8bfd5c6f975621d1f6704fcbc7ee1b8fadac0f;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Behat/Context/Reader/ContextReaderCachedPerSuite.php b/vendor/behat/behat/src/Behat/Behat/Context/Reader/ContextReaderCachedPerSuite.php deleted file mode 100644 index 4a8bfd5c6..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Context/Reader/ContextReaderCachedPerSuite.php +++ /dev/null @@ -1,69 +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\Reader; - -use Behat\Behat\Context\Environment\ContextEnvironment; - -/** - * Proxies call to another reader and caches callees for a length of an entire suite. - * - * @author Konstantin Kudryashov - */ -final class ContextReaderCachedPerSuite implements ContextReader -{ - /** - * @var ContextReader - */ - private $childReader; - /** - * @var array[] - */ - private $cachedCallees = array(); - - /** - * Initializes reader. - * - * @param ContextReader $childReader - */ - public function __construct(ContextReader $childReader) - { - $this->childReader = $childReader; - } - - /** - * {@inheritdoc} - */ - public function readContextCallees(ContextEnvironment $environment, $contextClass) - { - $key = $this->generateCacheKey($environment, $contextClass); - - if (isset($this->cachedCallees[$key])) { - return $this->cachedCallees[$key]; - } - - return $this->cachedCallees[$key] = $this->childReader->readContextCallees( - $environment, $contextClass - ); - } - - /** - * Generates cache key. - * - * @param ContextEnvironment $environment - * @param string $contextClass - * - * @return string - */ - private function generateCacheKey(ContextEnvironment $environment, $contextClass) - { - return $environment->getSuite()->getName() . $contextClass; - } -}