Issues (283)

src/Parser/ParserResolver.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * This file is part of graze/unicontroller-client.
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/unicontroller-client/blob/master/LICENSE.md
11
 * @link https://github.com/graze/unicontroller-client
12
 */
13
namespace Graze\UnicontrollerClient\Parser;
14
15
class ParserResolver
16
{
17
    /**
18
     * @param string $name
19
     * @return Graze\UnicontrollerClient\Parser\Parser\ParserInterface
0 ignored issues
show
The type Graze\UnicontrollerClien...\Parser\ParserInterface was not found. Did you mean Graze\UnicontrollerClien...\Parser\ParserInterface? If so, make sure to prefix the type with \.
Loading history...
20
     */
21 19
    public function resolve($name)
22
    {
23 19
        $parserNamespace = 'Graze\\UnicontrollerClient\\Parser\\Parser\\Parser%s';
24 19
        $className = sprintf($parserNamespace, $name);
25 19
        if (!class_exists($className)) {
26
            $className = sprintf($parserNamespace, 'Generic');
27
        }
28
29 19
        return $className::factory();
30
    }
31
}
32