Code Duplication    Length = 9-9 lines in 2 locations

eZ/Bundle/EzPublishCoreBundle/ApiLoader/RepositoryFactory.php 1 location

@@ 142-150 (lines=9) @@
139
     *
140
     * @return mixed
141
     */
142
    public function buildService(Repository $repository, $serviceName)
143
    {
144
        $methodName = 'get' . $serviceName . 'Service';
145
        if (!method_exists($repository, $methodName)) {
146
            throw new InvalidArgumentException($serviceName, 'No such service');
147
        }
148
149
        return $repository->$methodName();
150
    }
151
}
152

eZ/Publish/Core/Base/Container/ApiLoader/RepositoryFactory.php 1 location

@@ 120-128 (lines=9) @@
117
     *
118
     * @return mixed
119
     */
120
    public function buildService(Repository $repository, $serviceName)
121
    {
122
        $methodName = 'get' . $serviceName . 'Service';
123
        if (!method_exists($repository, $methodName)) {
124
            throw new InvalidArgumentException($serviceName, 'No such service');
125
        }
126
127
        return $repository->$methodName();
128
    }
129
}
130