Code Duplication    Length = 7-7 lines in 2 locations

src/EntityManager/OrmEntityAbstractFactory.php 1 location

@@ 77-83 (lines=7) @@
74
     */
75
    public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
76
    {
77
        if (array_key_exists($requestedName, $this->prototype)) {
78
            if (!is_object($this->prototype[$requestedName])) {
79
                $errMsg = sprintf('Invalid prototype for %s', $requestedName);
80
                throw new Exception\RuntimeException($errMsg);
81
            }
82
            return clone $this->prototype[$requestedName];
83
        }
84
85
        $appServiceLocator = $serviceLocator;
86
        if ($serviceLocator instanceof AbstractPluginManager) {

src/EntityManager/EntityMapAbstractFactory.php 1 location

@@ 157-163 (lines=7) @@
154
    {
155
        $this->init($serviceLocator);
156
157
        if (array_key_exists($requestedName, $this->prototype)) {
158
            if (!is_object($this->prototype[$requestedName])) {
159
                $errMsg = sprintf('Invalid prototype for %s', $requestedName);
160
                throw new Exception\RuntimeException($errMsg);
161
            }
162
            return clone $this->prototype[$requestedName];
163
        }
164
165
        $className = $this->getClassNameByInterface($requestedName);
166
        if (false === $className) {