X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FTransformation%2FContext%2FAnnotation%2FTransformationAnnotationReader.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FTransformation%2FContext%2FAnnotation%2FTransformationAnnotationReader.php;h=0000000000000000000000000000000000000000;hp=a32ac5ccace170b3084b5daed2fcceb9f916eb12;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Behat/Transformation/Context/Annotation/TransformationAnnotationReader.php b/vendor/behat/behat/src/Behat/Behat/Transformation/Context/Annotation/TransformationAnnotationReader.php deleted file mode 100644 index a32ac5cca..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Transformation/Context/Annotation/TransformationAnnotationReader.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Transformation\Context\Annotation; - -use Behat\Behat\Context\Annotation\AnnotationReader; -use Behat\Behat\Transformation\Transformation\PatternTransformation; -use Behat\Behat\Transformation\Transformation; -use ReflectionMethod; - -/** - * Step transformation annotation reader. - * - * Reads step transformations from a context method annotation. - * - * @author Konstantin Kudryashov - */ -class TransformationAnnotationReader implements AnnotationReader -{ - /** - * @var string - */ - private static $regex = '/^\@transform\s*+(.*+)$/i'; - - /** - * Loads step callees (if exist) associated with specific method. - * - * @param string $contextClass - * @param ReflectionMethod $method - * @param string $docLine - * @param string $description - * - * @return null|Transformation - */ - public function readCallee($contextClass, ReflectionMethod $method, $docLine, $description) - { - if (!preg_match(self::$regex, $docLine, $match)) { - return null; - } - - $pattern = $match[1]; - $callable = array($contextClass, $method->getName()); - - foreach ($this->simpleTransformations() as $transformation) { - if ($transformation::supportsPatternAndMethod($pattern, $method)) { - return new $transformation($pattern, $callable, $description); - } - } - - return new PatternTransformation($pattern, $callable, $description); - } - - /** - * Returns list of default transformations. - * - * @return array - */ - private function simpleTransformations() - { - $transformations = array(); - $transformations[] = 'Behat\Behat\Transformation\Transformation\RowBasedTableTransformation'; - $transformations[] = 'Behat\Behat\Transformation\Transformation\ColumnBasedTableTransformation'; - $transformations[] = 'Behat\Behat\Transformation\Transformation\TableRowTransformation'; - - if (PHP_VERSION_ID >= 70000) { - $transformations[] = 'Behat\Behat\Transformation\Transformation\TokenNameAndReturnTypeTransformation'; - $transformations[] = 'Behat\Behat\Transformation\Transformation\ReturnTypeTransformation'; - } - - $transformations[] = 'Behat\Behat\Transformation\Transformation\TokenNameTransformation'; - - return $transformations; - } -}