Issues (281)

src/Definition/Traits/ExtensionsAwareTrait.php (1 issue)

1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Definition\Traits;
12
13
use Ynlo\GraphQLBundle\Definition\InterfaceExtensionDefinition;
14
15
/**
16
 * ExtensionsAwareTrait
17
 */
18
trait ExtensionsAwareTrait
19
{
20
    /**
21
     * @var string[]
22
     */
23
    protected $extensions = [];
24
25
    /**
26
     * @return InterfaceExtensionDefinition[]
27
     */
28 3
    public function getExtensions(): array
29
    {
30 3
        return $this->extensions;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->extensions returns the type string[] which is incompatible with the documented return type Ynlo\GraphQLBundle\Defin...ceExtensionDefinition[].
Loading history...
31
    }
32
33
    /**
34
     * @param string $class
35
     */
36 2
    public function addExtension($class)
37
    {
38 2
        $this->extensions[$class] = new InterfaceExtensionDefinition($class);
39 2
    }
40
}
41