<commit_before><?php namespace Strimoid\Http\Controllers\Api;

use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller;
use League\Fractal\Manager;
use League\Fractal\Resource\Collection;
use League\Fractal\Resource\Item;
use Response;

class BaseController extends Controller
{
    use ValidatesRequests;

    /**
     * @param Manager $fractal
     */
    public function __construct(Manager $fractal)
    {
        $this->fractal = $fractal;
    }

    /**
     * Respond with transformed item.
     *
     * @param $item
     * @param $callback
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    protected function respondWithItem($item, $callback)
    {
        $resource = new Item($item, $callback);
        $rootScope = $this->fractal->createData($resource);

        return Response::json($rootScope->toArray());
    }

    /**
     * Respond with transformed collection.
     *
     * @param $collection
     * @param $callback
     *
     * @return \Symfony\Component\HttpFoundation\Response
     */
    protected function respondWithCollection($collection, $callback)
    {
        $resource = new Collection($collection, $callback);
        $rootScope = $this->fractal->createData($resource);

        return Response::json($rootScope->toArray());
    }
}<commit_msg>Fix BaseController<commit_after><?php namespace Strimoid\Http\Controllers\Api;

use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller;

abstract class BaseController extends Controller
{
    use ValidatesRequests;
}
{'fraction_non_alphanumeric': 0.11502199874292897, 'fraction_numerical': 0.0, 'mean_word_length': 3.3027027027027027, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '5097080', 'n_tokens_mistral': 442, 'n_tokens_neox': 451, 'n_words': 89}