Code Duplication    Length = 51-51 lines in 2 locations

src/system/UsersModule/HookSubscriber/RegistrationUiHooksSubscriber.php 1 location

@@ 18-68 (lines=51) @@
15
use Zikula\Bundle\HookBundle\HookSubscriberInterface;
16
use Zikula\Common\Translator\TranslatorInterface;
17
18
class RegistrationUiHooksSubscriber implements HookSubscriberInterface
19
{
20
    const REGISTRATION_DISPLAY = 'users.ui_hooks.registration.display_view';
21
    const REGISTRATION_FORM = 'users.ui_hooks.registration.form_edit';
22
    const REGISTRATION_VALIDATE = 'users.ui_hooks.registration.validate_edit';
23
    const REGISTRATION_PROCESS = 'users.ui_hooks.registration.process_edit';
24
    const REGISTRATION_DELETE_FORM = 'users.ui_hooks.registration.form_delete';
25
    const REGISTRATION_DELETE_VALIDATE = 'users.ui_hooks.registration.validate_delete';
26
    const REGISTRATION_DELETE_PROCESS = 'users.ui_hooks.registration.process_delete';
27
28
    /**
29
     * @var TranslatorInterface
30
     */
31
    private $translator;
32
33
    /**
34
     * @param TranslatorInterface $translator
35
     */
36
    public function __construct(TranslatorInterface $translator)
37
    {
38
        $this->translator = $translator;
39
    }
40
41
    public function getOwner()
42
    {
43
        return 'ZikulaUsersModule';
44
    }
45
46
    public function getCategory()
47
    {
48
        return UiHooksCategory::NAME;
49
    }
50
51
    public function getTitle()
52
    {
53
        return $this->translator->__('Registration management hooks');
54
    }
55
56
    public function getEvents()
57
    {
58
        return [
59
            UiHooksCategory::TYPE_DISPLAY_VIEW => self::REGISTRATION_DISPLAY,
60
            UiHooksCategory::TYPE_FORM_EDIT => self::REGISTRATION_FORM,
61
            UiHooksCategory::TYPE_VALIDATE_EDIT => self::REGISTRATION_VALIDATE,
62
            UiHooksCategory::TYPE_PROCESS_EDIT => self::REGISTRATION_PROCESS,
63
            UiHooksCategory::TYPE_FORM_DELETE => self::REGISTRATION_DELETE_FORM,
64
            UiHooksCategory::TYPE_VALIDATE_DELETE => self::REGISTRATION_DELETE_VALIDATE,
65
            UiHooksCategory::TYPE_PROCESS_DELETE => self::REGISTRATION_DELETE_PROCESS,
66
        ];
67
    }
68
}
69

src/system/UsersModule/HookSubscriber/UserManagementUiHooksSubscriber.php 1 location

@@ 18-68 (lines=51) @@
15
use Zikula\Bundle\HookBundle\HookSubscriberInterface;
16
use Zikula\Common\Translator\TranslatorInterface;
17
18
class UserManagementUiHooksSubscriber implements HookSubscriberInterface
19
{
20
    const EDIT_DISPLAY = 'users.ui_hooks.user.display_view';
21
    const EDIT_FORM = 'users.ui_hooks.user.form_edit';
22
    const EDIT_VALIDATE = 'users.ui_hooks.user.validate_edit';
23
    const EDIT_PROCESS = 'users.ui_hooks.user.process_edit';
24
    const DELETE_FORM = 'users.ui_hooks.user.form_delete';
25
    const DELETE_VALIDATE = 'users.ui_hooks.user.validate_delete';
26
    const DELETE_PROCESS = 'users.ui_hooks.user.process_delete';
27
28
    /**
29
     * @var TranslatorInterface
30
     */
31
    private $translator;
32
33
    /**
34
     * @param TranslatorInterface $translator
35
     */
36
    public function __construct(TranslatorInterface $translator)
37
    {
38
        $this->translator = $translator;
39
    }
40
41
    public function getOwner()
42
    {
43
        return 'ZikulaUsersModule';
44
    }
45
46
    public function getCategory()
47
    {
48
        return UiHooksCategory::NAME;
49
    }
50
51
    public function getTitle()
52
    {
53
        return $this->translator->__('User management hooks');
54
    }
55
56
    public function getEvents()
57
    {
58
        return [
59
            UiHooksCategory::TYPE_DISPLAY_VIEW => self::EDIT_DISPLAY,
60
            UiHooksCategory::TYPE_FORM_EDIT => self::EDIT_FORM,
61
            UiHooksCategory::TYPE_VALIDATE_EDIT => self::EDIT_VALIDATE,
62
            UiHooksCategory::TYPE_PROCESS_EDIT => self::EDIT_PROCESS,
63
            UiHooksCategory::TYPE_FORM_DELETE => self::DELETE_FORM,
64
            UiHooksCategory::TYPE_VALIDATE_DELETE => self::DELETE_VALIDATE,
65
            UiHooksCategory::TYPE_PROCESS_DELETE => self::DELETE_PROCESS,
66
        ];
67
    }
68
}
69