<commit_before><?php

namespace Askedio\Laravel5ApiController\Exceptions;

use Exception;

abstract class ApiException extends Exception
{
    /** @var array */
    private $exceptionDetails;

    /** @var array */
    private $exceptionErrors;

    /**
     * @var string
     */
    protected $error;

    /**
     * @var int
     */
    protected $status;

    /**
     * Get the error.
     *
     * @return mixed
     */
    public function getErrors()
    {
        return $this->getDetails($this->error);
    }

    /**
     * Get the status.
     *
     * @return int
     */
    public function getStatusCode()
    {
        return (int) $this->status;
    }

    /**
     * Store exception details.
     *
     * @param mixed $details
     */
    public function withDetails($details)
    {
        $this->exceptionDetails = $details;

        return $this;
    }

    /**
     * Store exception errors details.
     *
     * @param array $details
     */
    public function withErrors($errors)
    {
        $this->exceptionErrors = $errors;

        return $this;
    }

    /**
     * Build the error results.
     *
     * @return array
     */
    public function getDetails($template)
    {
        if ($this->exceptionErrors) {
            return $this->exceptionErrors;
        }
        $details = $this->exceptionDetails;

        /* Not pre-rendered errors, build from template */
        if (! is_array($details)) {
            $details = [$details];
        }
        return array_map(function ($detail) use ($template) {
            return $this->item($template, $detail);
        }, $details);<commit_msg>Applied fixes from StyleCI<commit_after><?php

namespace Askedio\Laravel5ApiController\Exceptions;

use Exception;

abstract class ApiException extends Exception
{
    /** @var array */
    private $exceptionDetails;

    /** @var array */
    private $exceptionErrors;

    /**
     * @var string
     */
    protected $error;

    /**
     * @var int
     */
    protected $status;

    /**
     * Get the error.
     *
     * @return mixed
     */
    public function getErrors()
    {
        return $this->getDetails($this->error);
    }

    /**
     * Get the status.
     *
     * @return int
     */
    public function getStatusCode()
    {
        return (int) $this->status;
    }

    /**
     * Store exception details.
     *
     * @param mixed $details
     */
    public function withDetails($details)
    {
        $this->exceptionDetails = $details;

        return $this;
    }

    /**
     * Store exception errors details.
     *
     * @param array $details
     */
    public function withErrors($errors)
    {
        $this->exceptionErrors = $errors;

        return $this;
    }

    /**
     * Build the error results.
     *
     * @return array
     */
    public function getDetails($template)
    {
        if ($this->exceptionErrors) {
            return $this->exceptionErrors;
        }
        $details = $this->exceptionDetails;

        /* Not pre-rendered errors, build from template */
        if (! is_array($details)) {
            $details = [$details];
        }

        return array_map(function ($detail) use ($template) {
            return $this->item($template, $detail);
        }, $details);
{'fraction_non_alphanumeric': 0.12698412698412698, 'fraction_numerical': 0.0006105006105006105, 'mean_word_length': 1.7560975609756098, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '4530860', 'n_tokens_mistral': 934, 'n_tokens_neox': 908, 'n_words': 218}