4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Behat\Transformation;
13 use Behat\Testwork\Call\Callee;
14 use Behat\Testwork\Environment\Environment;
15 use Behat\Testwork\Environment\EnvironmentManager;
18 * Provides transformations using environment manager.
20 * @author Konstantin Kudryashov <ever.zet@gmail.com>
22 final class TransformationRepository
25 * @var EnvironmentManager
27 private $environmentManager;
30 * Initializes repository.
32 * @param EnvironmentManager $environmentManager
34 public function __construct(EnvironmentManager $environmentManager)
36 $this->environmentManager = $environmentManager;
40 * Returns all available definitions for a specific environment.
42 * @param Environment $environment
44 * @return Transformation[]
46 public function getEnvironmentTransformations(Environment $environment)
49 $this->environmentManager->readEnvironmentCallees($environment),
50 function (Callee $callee) {
51 return $callee instanceof Transformation;