This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
20
{
21
/**
22
* @var DefinitionValidator|null
23
*/
24
private $validator;
25
26
/**
27
* Repository constructor.
28
*
29
* @param DefinitionValidator|null $validator
30
*/
31
public function __construct(DefinitionValidator $validator = null)
32
{
33
$this->validator = $validator;
34
}
35
36
/**
37
* @param string $uri
38
* @param \stdClass $definition
39
*
40
* @return Description
41
*/
42
public function build(string $uri, \stdClass $definition): Description
43
{
44
$resolver = new RefResolver($definition, $uri);
45
46
/** @var \stdClass $definition */
47
$description = new RamlDescription(new Document($uri, $definition = $resolver->resolve()));
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.