<commit_before><?php

namespace Oro\Bundle\SecurityBundle\Owner;

use Doctrine\Common\Cache\CacheProvider;
use Doctrine\ORM\EntityManager;

/**
 * Class OwnerTreeProvider
 * @package Oro\Bundle\SecurityBundle\Owner
 */
class OwnerTreeProvider
{
    const CACHE_NAMESPACE = 'OwnerTree';
    const CACHE_KEY = 'OwnerTreeData';

    /**
     * @var EntityManager
     */
    protected $em;

    /**
     * @var OwnerTree
     */
    protected $tree;

    /**
     * @var CacheProvider
     */
    protected $cache;

    /**
     * @param EntityManager $em
     * @param CacheProvider $cache
     */
    public function __construct(EntityManager $em, CacheProvider $cache)
    {
        $this->cache = $cache;
        $this->em = $em;
    }


    /**
     * Get ACL tree
     *
     * @return OwnerTree
     * @throws \Exception
     */
    public function getTree()
    {
        $this->ensureTreeLoaded();

        if ($this->tree === null) {
            throw new \Exception('ACL tree cache was not warmed');
        }

        return $this->tree;
    }
<commit_msg>BAP-2130: Fix create and update report on wrong validation<commit_after><?php

namespace Oro\Bundle\SecurityBundle\Owner;

use Doctrine\Common\Cache\CacheProvider;
use Doctrine\ORM\EntityManager;

/**
 * Class OwnerTreeProvider
 * @package Oro\Bundle\SecurityBundle\Owner
 */
class OwnerTreeProvider
{
    const CACHE_NAMESPACE = 'OwnerTree';
    const CACHE_KEY = 'OwnerTreeData';

    /**
     * @var EntityManager
     */
    protected $em;

    /**
     * @var OwnerTree
     */
    protected $tree;

    /**
     * @var CacheProvider
     */
    protected $cache;

    /**
     * @param EntityManager $em
     * @param CacheProvider $cache
     */
    public function __construct(EntityManager $em, CacheProvider $cache)
    {
        $this->cache = $cache;
        $this->em = $em;
    }

    /**
     * Get ACL tree
     *
     * @return OwnerTree
     * @throws \Exception
     */
    public function getTree()
    {
        $this->ensureTreeLoaded();

        if ($this->tree === null) {
            throw new \Exception('ACL tree cache was not warmed');
        }

        return $this->tree;
    }

{'fraction_non_alphanumeric': 0.125114995400184, 'fraction_numerical': 0.0018399264029438822, 'mean_word_length': 2.12051649928264, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '5214415', 'n_tokens_mistral': 673, 'n_tokens_neox': 647, 'n_words': 150}