X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FDefinition%2FContext%2FAnnotation%2FDefinitionAnnotationReader.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FDefinition%2FContext%2FAnnotation%2FDefinitionAnnotationReader.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=baa6c88ecbc8e1f3f500a596c41ea96a3fb9bd54;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Behat/Definition/Context/Annotation/DefinitionAnnotationReader.php b/vendor/behat/behat/src/Behat/Behat/Definition/Context/Annotation/DefinitionAnnotationReader.php deleted file mode 100644 index baa6c88ec..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Definition/Context/Annotation/DefinitionAnnotationReader.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Definition\Context\Annotation; - -use Behat\Behat\Context\Annotation\AnnotationReader; -use ReflectionMethod; - -/** - * Reads definition annotations from the context class. - * - * @author Konstantin Kudryashov - */ -final class DefinitionAnnotationReader implements AnnotationReader -{ - /** - * @var string - */ - private static $regex = '/^\@(given|when|then)\s+(.+)$/i'; - /** - * @var string[] - */ - private static $classes = array( - 'given' => 'Behat\Behat\Definition\Call\Given', - 'when' => 'Behat\Behat\Definition\Call\When', - 'then' => 'Behat\Behat\Definition\Call\Then', - ); - - /** - * {@inheritdoc} - */ - public function readCallee($contextClass, ReflectionMethod $method, $docLine, $description) - { - if (!preg_match(self::$regex, $docLine, $match)) { - return null; - } - - $type = strtolower($match[1]); - $class = self::$classes[$type]; - $pattern = $match[2]; - $callable = array($contextClass, $method->getName()); - - return new $class($pattern, $callable, $description); - } -}