Code Duplication    Length = 14-14 lines in 3 locations

src/Transfer/EzPlatform/Repository/Manager/ContentTypeManager.php 1 location

@@ 92-105 (lines=14) @@
89
     *
90
     * @throws NotFoundException
91
     */
92
    public function find(ValueObject $object, $throwException = false)
93
    {
94
        if (isset($object->data['identifier'])) {
95
            try {
96
                $contentType = $this->contentTypeService->loadContentTypeByIdentifier($object->data['identifier']);
97
            } catch (NotFoundException $notFoundException) {
98
                if($throwException) {
99
                    throw $notFoundException;
100
                }
101
            }
102
        }
103
104
        return isset($contentType) ? $contentType : false;
105
    }
106
107
    /**
108
     * {@inheritdoc}

src/Transfer/EzPlatform/Repository/Manager/LanguageManager.php 1 location

@@ 80-93 (lines=14) @@
77
     *
78
     * @throws NotFoundException
79
     */
80
    public function find(ValueObject $object, $throwExceptions = false)
81
    {
82
        if (isset($object->data['code'])) {
83
            try {
84
                $language = $this->languageService->loadLanguage($object->data['code']);
85
            } catch (NotFoundException $notFoundException) {
86
                if($throwExceptions) {
87
                    throw $notFoundException;
88
                }
89
            }
90
        }
91
92
        return isset($language) ? $language : false;
93
    }
94
95
    /**
96
     * {@inheritdoc}

src/Transfer/EzPlatform/Repository/Manager/UserManager.php 1 location

@@ 86-99 (lines=14) @@
83
     *
84
     * @throws NotFoundException
85
     */
86
    public function find(ValueObject $object, $throwException = false)
87
    {
88
        try {
89
            if (isset($object->data['username'])) {
90
                $user = $this->userService->loadUserByLogin($object->data['username']);
91
            }
92
        } catch (NotFoundException $notFoundException) {
93
            if($throwException) {
94
                throw $notFoundException;
95
            }
96
        }
97
        
98
        return isset($user) ? $user : false;
99
    }
100
101
    /**
102
     * {@inheritdoc}