<commit_before><?php

namespace Problematic\AclManagerBundle\Acl;

use Symfony\Component\Security\Acl\Dbal\MutableAclProvider;
use Symfony\Component\Security\Acl\Domain\Acl;
use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface;
use Symfony\Component\Security\Acl\Permission\MaskBuilder;
use Symfony\Component\Security\Core\SecurityContext;

class AclManager extends AbstractAclManager {
    protected $maskBuilder;
    protected $permissionContextCollection = array();
    
    public function __construct(SecurityContext $securityContext, MutableAclProvider $aclProvider) {
        parent::__construct($securityContext, $aclProvider);
        
        $this->maskBuilder = new MaskBuilder();
    }
    
    public function processPermissions($reset = false) {
        foreach ($this->permissionContextCollection as $permissionContext) {
            $this->applyPermission($permissionContext);
        }
        $this->updateAcl();
        
        if ($reset) {
            $this->permissionContextCollection = array();
        }
        
        return $this;
    }
    
    public function createPermissionContext($type, $securityIdentity, $mask, $granting = true) {
        return $this->doCreatePermissionContext($type, $securityIdentity, $mask, $granting);
    }
    public function addPermissionContext(PermissionContextInterface $permissionContext, $key = null) {
        if (null === $key) {
            $this->permissionContextCollection[] = $permissionContext;
        } else {
            $this->permissionContextCollection[$key] = $permissionContext;
        }
    }
    public function getPermissionContextCollection() {
        return $this->permissionContextCollection;
    }
    public function getPermissionContext($key) {
        return $this->permissionContextCollection[$key];
    }
    
    public function createSecurityIdentity($identity) {
        return $this->doCreateSecurityIdentity($identity);
    }
    
    public function loadAcl($entity) {
        if (null === $entity || !is_object($entity)) {
            throw new Exception("Provide a valid entity context before trying to load an ACL");<commit_msg>removed unnecessary methods<commit_after><?php

namespace Problematic\AclManagerBundle\Acl;

use Symfony\Component\Security\Acl\Dbal\MutableAclProvider;
use Symfony\Component\Security\Acl\Domain\Acl;
use Symfony\Component\Security\Acl\Model\SecurityIdentityInterface;
use Symfony\Component\Security\Acl\Permission\MaskBuilder;
use Symfony\Component\Security\Core\SecurityContext;

class AclManager extends AbstractAclManager {
    protected $maskBuilder;
    protected $permissionContextCollection = array();
    
    public function __construct(SecurityContext $securityContext, MutableAclProvider $aclProvider) {
        parent::__construct($securityContext, $aclProvider);
        
        $this->maskBuilder = new MaskBuilder();
    }
    
    public function processPermissions($reset = false) {
        foreach ($this->permissionContextCollection as $permissionContext) {
            $this->applyPermission($permissionContext);
        }
        $this->updateAcl();
        
        if ($reset) {
            $this->permissionContextCollection = array();
        }
        
        return $this;
    }
    
    public function createPermissionContext($type, $securityIdentity, $mask, $granting = true) {
        return $this->doCreatePermissionContext($type, $securityIdentity, $mask, $granting);
    }
    public function addPermissionContext(PermissionContextInterface $permissionContext, $key = null) {
        if (null === $key) {
            $this->permissionContextCollection[] = $permissionContext;
        } else {
            $this->permissionContextCollection[$key] = $permissionContext;
        }
    }
    
    public function createSecurityIdentity($identity) {
        return $this->doCreateSecurityIdentity($identity);
    }
    
    public function loadAcl($entity) {
        if (null === $entity || !is_object($entity)) {
            throw new Exception("Provide a valid entity context before trying to load an ACL");
{'fraction_non_alphanumeric': 0.10366748166259168, 'fraction_numerical': 0.0, 'mean_word_length': 3.3475026567481403, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4508231', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1024, 'n_words': 211}