Code Duplication    Length = 9-11 lines in 2 locations

src/Authorization/AuthorizationRulesTrait.php 2 locations

@@ 110-118 (lines=9) @@
107
     *
108
     * @return bool
109
     */
110
    protected static function ctxHasCurrentAccount(ContextInterface $context): bool
111
    {
112
        /** @var AccountManagerInterface $manager */
113
        $container = static::ctxGetContainer($context);
114
        $manager   = $container->get(AccountManagerInterface::class);
115
        $account   = $manager->getAccount();
116
117
        return $account !== null;
118
    }
119
120
    /**
121
     * @param ContextInterface $context
@@ 125-135 (lines=11) @@
122
     *
123
     * @return AccountInterface
124
     */
125
    protected static function ctxGetCurrentAccount(ContextInterface $context): AccountInterface
126
    {
127
        assert(static::ctxHasCurrentAccount($context));
128
129
        /** @var AccountManagerInterface $manager */
130
        $container = static::ctxGetContainer($context);
131
        $manager   = $container->get(AccountManagerInterface::class);
132
        $account   = $manager->getAccount();
133
134
        return $account;
135
    }
136
137
    /**
138
     * @param ContextInterface $context