Code Duplication    Length = 12-15 lines in 2 locations

src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php 2 locations

@@ 339-353 (lines=15) @@
336
     *
337
     * @return bool|int
338
     */
339
    private function getObjectAceIndex(AclInterface $acl, $role)
340
    {
341
        $objectAces = $acl->getObjectAces();
342
        /* @var $ace AuditableEntryInterface */
343
        foreach ($objectAces as $index => $ace) {
344
            $securityIdentity = $ace->getSecurityIdentity();
345
            if ($securityIdentity instanceof RoleSecurityIdentity) {
346
                if ($securityIdentity->getRole() == $role) {
347
                    return $index;
348
                }
349
            }
350
        }
351
352
        return false;
353
    }
354
355
    /**
356
     * Get object ACE mask at specified index.
@@ 363-374 (lines=12) @@
360
     *
361
     * @return bool|int
362
     */
363
    private function getMaskAtIndex(AclInterface $acl, $index)
364
    {
365
        $objectAces = $acl->getObjectAces();
366
        /* @var $ace AuditableEntryInterface */
367
        $ace = $objectAces[$index];
368
        $securityIdentity = $ace->getSecurityIdentity();
369
        if ($securityIdentity instanceof RoleSecurityIdentity) {
370
            return $ace->getMask();
371
        }
372
373
        return false;
374
    }
375
}
376