Code Duplication    Length = 6-7 lines in 2 locations

src/Container.php 1 location

@@ 126-131 (lines=6) @@
123
     */
124
    public function has($name)
125
    {
126
        if (!is_string($name)) {
127
            throw new \InvalidArgumentException(sprintf(
128
                'The name parameter must be of type string, %s given',
129
                is_object($name) ? get_class($name) : gettype($name)
130
            ));
131
        }
132
133
        $serviceName = strtolower($name);
134

src/ContainerBuilder.php 1 location

@@ 77-83 (lines=7) @@
74
     */
75
    public function addDefinitions($definitions)
76
    {
77
        if (!is_array($definitions)) {
78
            throw new \InvalidArgumentException(sprintf(
79
                '%s parameter must be an array, %s given',
80
                'ContainerBuilder::addDefinitions()',
81
                is_object($definitions) ? get_class($definitions) : gettype($definitions)
82
            ));
83
        }
84
85
        $this->definitionSources = array_merge($this->definitionSources, $definitions);
86