addDefinitions([ Config::class => function () { $configPath = getcwd() . '/a11y.yaml'; return Config::fromYaml($configPath); }, Scanner::class => function () { return new Scanner(); }, Analyser::class => function (ContainerInterface $c) { $config = $c->get(Config::class); $scanner = $c->get(Scanner::class); return new Analyser( $config instanceof Config ? $config : null, $scanner instanceof Scanner ? $scanner : null ); }, ScanCommand::class => function () { return new ScanCommand(); }, FixCommand::class => function () { return new FixCommand(); }, InitCommand::class => function () { return new InitCommand(); }, RulesCommand::class => function () { return new RulesCommand(); }, WatchCommand::class => function () { return new WatchCommand(); }, ]); return $builder->build(); } }