Skip to content

Commit

Permalink
TransformersParser constructor add keyword, type args.
Browse files Browse the repository at this point in the history
  • Loading branch information
Moln committed Aug 10, 2021
1 parent 995b4c8 commit ed59e7c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Opis/TransformersParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ class TransformersParser extends KeywordParser
{
use VariablesTrait;
private Resolver\ResolverInterface $resolver;

public function __construct(Resolver\ResolverInterface $resolver)
{
parent::__construct('$transformers');
private string $type;

public function __construct(
Resolver\ResolverInterface $resolver,
string $keyword = '$transformers',
string $type = self::TYPE_BEFORE
) {
parent::__construct($keyword);
$this->resolver = $resolver;
$this->type = $type;
}

public function type(): string
{
return self::TYPE_BEFORE;
return $this->type;
}

public function parse(SchemaInfo $info, SchemaParser $parser, object $shared): ?Keyword
Expand Down

0 comments on commit ed59e7c

Please sign in to comment.