<commit_before><?php

namespace Helldar\ApiResponse\Wrappers;

use Helldar\ApiResponse\Contracts\Resolver as ResolverContract;
use Helldar\Support\Facades\Arr;
use Helldar\Support\Traits\Makeable;

final class Resolver implements ResolverContract
{
    use Makeable;

    protected $with = [];

    protected $data;

    protected $is_error = false;

    protected $allow_with = true;

    protected $wrap = true;

    public function with(array $with, bool $allow = true): ResolverContract
    {
        $this->with       = $with;
        $this->allow_with = $allow;

        return $this;
    }

    public function wrap(bool $allow = true): ResolverContract
    {
        $this->wrap = $allow;

        return $this;
    }

    public function data($data): ResolverContract
    {
        $this->data = $data;

        return $this;
    }

    public function isError(bool $is_error = false): ResolverContract
    {
        $this->is_error = $is_error;

        return $this;
    }

    /**
     * @return array|string|int|null
     */
    public function get()
    {
        return $this->is_error ? $this->failed() : $this->success();
    }

    /**
     * @return array|string|int|null
     */
    protected function success()
    {
        $data = $this->data;
<commit_msg>Apply fixes from StyleCI<commit_after><?php

namespace Helldar\ApiResponse\Wrappers;

use Helldar\ApiResponse\Contracts\Resolver as ResolverContract;
use Helldar\Support\Facades\Arr;
use Helldar\Support\Traits\Makeable;

final class Resolver implements ResolverContract
{
    use Makeable;

    protected $with = [];

    protected $data;

    protected $is_error = false;

    protected $allow_with = true;

    protected $wrap = true;

    public function with(array $with, bool $allow = true): ResolverContract
    {
        $this->with       = $with;
        $this->allow_with = $allow;

        return $this;
    }

    public function wrap(bool $allow = true): ResolverContract
    {
        $this->wrap = $allow;

        return $this;
    }

    public function data($data): ResolverContract
    {
        $this->data = $data;

        return $this;
    }

    public function isError(bool $is_error = false): ResolverContract
    {
        $this->is_error = $is_error;

        return $this;
    }

    /**
     * @return array|int|string|null
     */
    public function get()
    {
        return $this->is_error ? $this->failed() : $this->success();
    }

    /**
     * @return array|int|string|null
     */
    protected function success()
    {
        $data = $this->data;

{'fraction_non_alphanumeric': 0.11989100817438691, 'fraction_numerical': 0.0, 'mean_word_length': 2.372703412073491, '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': '6686945', 'n_tokens_mistral': 804, 'n_tokens_neox': 776, 'n_words': 181}