<commit_before><?php namespace Riari\Forum\Controllers;

use App;
use Config;
use Event;
use Input;
use Illuminate\Routing\Controller;
use Redirect;
use Riari\Forum\Events\ThreadWasViewed;
use Riari\Forum\Repositories\Categories;
use Riari\Forum\Repositories\Threads;
use Riari\Forum\Repositories\Posts;
use Riari\Forum\Libraries\AccessControl;
use Riari\Forum\Libraries\Alerts;
use Riari\Forum\Libraries\Utils;
use Riari\Forum\Libraries\Validation;
use Route;
use View;
use Validator;

abstract class BaseController extends Controller {

    // Repositories
    private $categories;
    private $threads;
    private $posts;

    // Collections cache
    private $collections = array();

    public function __construct(Categories $categories, Threads $threads, Posts $posts)
    {
        $this->categories = $categories;
        $this->threads = $threads;
        $this->posts = $posts;
    }

    protected function check404()
    {
        foreach ($this->collections as $item)
        {
            if ($item == null)
            {
                App::abort(404);
            }
        }
    }

    protected function load($select = array(), $with = array())
    {
        $map_model_repos = array(<commit_msg>Update BaseController.php<commit_after><?php namespace Riari\Forum\Controllers;

use App;
use Config;
use Event;
use Input;
use Illuminate\Routing\Controller;
use Redirect;
use Riari\Forum\Events\ThreadWasViewed;
use Riari\Forum\Repositories\Categories;
use Riari\Forum\Repositories\Threads;
use Riari\Forum\Repositories\Posts;
use Riari\Forum\Libraries\AccessControl;
use Riari\Forum\Libraries\Alerts;
use Riari\Forum\Libraries\Utils;
use Riari\Forum\Libraries\Validation;
use Route;
use View;
use Validator;

abstract class BaseController extends Controller {

    // Repositories
    protected $categories;
    protected $threads;
    protected $posts;

    // Collections cache
    protected $collections = array();

    public function __construct(Categories $categories, Threads $threads, Posts $posts)
    {
        $this->categories = $categories;
        $this->threads = $threads;
        $this->posts = $posts;
    }

    protected function check404()
    {
        foreach ($this->collections as $item)
        {
            if ($item == null)
            {
                App::abort(404);
            }
        }
    }

    protected function load($select = array(), $with = array())
    {
        $map_model_repos = array(
{'fraction_non_alphanumeric': 0.10880195599022005, 'fraction_numerical': 0.004889975550122249, 'mean_word_length': 2.90302066772655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6880246', 'n_tokens_mistral': 771, 'n_tokens_neox': 733, 'n_words': 174}