Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

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