<commit_before><?php

declare(strict_types=1);

namespace Orchid\Screen;

/*
 * Class Layouts.
 *
 * @method static Layouts blank(array $name)
 * @method static Layouts tabs(array $name)
 * @method static Layouts columns(array $name)
 * @method static Layouts modals(array $name)
 * @method static Layouts div(array $name)
 * @method static Layouts view(string $name)
 */

use Illuminate\Support\Facades\Route;

class Layouts
{
    /**
     * @var null
     */
    public $active = null;

    /**
     * @var array
     */
    public $templates = [
        'blank'   => 'platform::container.layouts.blank',
        'tabs'    => 'platform::container.layouts.tabs',
        'columns' => 'platform::container.layouts.columns',
        'modals'  => 'platform::container.layouts.modals',
        'div'     => 'platform::container.layouts.div',
    ];

    /**
     * @var array
     */
    public $layouts = [];

    /**
     * @var array
     */
    public $asyncMethod;

    /**
     * @var array
     */
    public $asyncRoute;

    /**
     * @var bool
     */
    public $async = false;

    /**
     * @var bool
     */
    public $asyncSaveAjax = false;

    /**
     * @var
     */
    public $slug;

    /**
     * @var array
     */
    public $compose = [];

    /**
     * Layouts constructor.
     */
    public function __construct()
    {
        $this->slug = sha1(serialize($this));
    }

    /**
     * @param $name
     * @param $arguments
     *
     * @return mixed
     */
    public static function __callStatic($name, $arguments)
    {
        $new = new self();
        $new->active = $name;

        return call_user_func_array([$new, 'setLayouts'], $arguments);
    }

    /**
     * @param $name
     * @param $arguments
     *
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        if (is_null($name)) {
            $this->active = $name;

            return call_user_func_array([$this, 'setLayouts'], $arguments);
        }

        $this->compose[$name] = array_shift($arguments);

        return $this;
    }

    /**
     * @param $property
     *
     * @return mixed
     */
    protected function setLayouts($property)
    {
        $this->layouts = $property;
        $this->slug = sha1(serialize($this));

        return $this;
    }

    /**
     * @param $post
     *
     * @throws \Throwable
     *
     * @return array
     */
    public function build(Repository $post, $async = false)
    {
        foreach ($this->layouts as $key => $layouts) {
            foreach ($layouts as $layout) {
                if (! is_object($layout)) {
                    $layout = new $layout();
                }
                $build[$key][] = $layout->build($post);
            }
        }

        return view($async ? 'platform::container.layouts.async' : $this->templates[$this->active], [
            'manyForms' => $build ?? [],
            'compose'   => $this->compose,
            'templateSlug'  => $this->slug,
            'templateAsync' => $this->async,
            'templateAsyncMethod' => $this->asyncMethod,
            'templateAsyncRoute'  => $this->asyncRoute,
            'templateSaveAjax'    => $this->asyncSaveAjax,
        ]);
    }

    /**
     * @param string $method
     * @param bool   $async
     *
     * @return \Orchid\Screen\Layouts
     */
    public function async(string $method, string $route = null, $async = true, $saveajax = false) : self
    {
        $this->async = $async;
        $this->asyncMethod = $method;
        $this->asyncRoute  = $route;
        $this->asyncSaveAjax = $saveajax;    

        return $this;
    }
}<commit_msg>Apply fixes from StyleCI<commit_after><?php

declare(strict_types=1);

namespace Orchid\Screen;

/*
 * Class Layouts.
 *
 * @method static Layouts blank(array $name)
 * @method static Layouts tabs(array $name)
 * @method static Layouts columns(array $name)
 * @method static Layouts modals(array $name)
 * @method static Layouts div(array $name)
 * @method static Layouts view(string $name)
 */

class Layouts
{
    /**
     * @var null
     */
    public $active = null;

    /**
     * @var array
     */
    public $templates = [
        'blank'   => 'platform::container.layouts.blank',
        'tabs'    => 'platform::container.layouts.tabs',
        'columns' => 'platform::container.layouts.columns',
        'modals'  => 'platform::container.layouts.modals',
        'div'     => 'platform::container.layouts.div',
    ];

    /**
     * @var array
     */
    public $layouts = [];

    /**
     * @var array
     */
    public $asyncMethod;

    /**
     * @var array
     */
    public $asyncRoute;

    /**
     * @var bool
     */
    public $async = false;

    /**
     * @var bool
     */
    public $asyncSaveAjax = false;

    /**
     * @var
     */
    public $slug;

    /**
     * @var array
     */
    public $compose = [];

    /**
     * Layouts constructor.
     */
    public function __construct()
    {
        $this->slug = sha1(serialize($this));
    }

    /**
     * @param $name
     * @param $arguments
     *
     * @return mixed
     */
    public static function __callStatic($name, $arguments)
    {
        $new = new self();
        $new->active = $name;

        return call_user_func_array([$new, 'setLayouts'], $arguments);
    }

    /**
     * @param $name
     * @param $arguments
     *
     * @return mixed
     */
    public function __call($name, $arguments)
    {
        if (is_null($name)) {
            $this->active = $name;

            return call_user_func_array([$this, 'setLayouts'], $arguments);
        }

        $this->compose[$name] = array_shift($arguments);

        return $this;
    }

    /**
     * @param $property
     *
     * @return mixed
     */
    protected function setLayouts($property)
    {
        $this->layouts = $property;
        $this->slug = sha1(serialize($this));

        return $this;
    }

    /**
     * @param $post
     *
     * @throws \Throwable
     *
     * @return array
     */
    public function build(Repository $post, $async = false)
    {
        foreach ($this->layouts as $key => $layouts) {
            foreach ($layouts as $layout) {
                if (! is_object($layout)) {
                    $layout = new $layout();
                }
                $build[$key][] = $layout->build($post);
            }
        }

        return view($async ? 'platform::container.layouts.async' : $this->templates[$this->active], [
            'manyForms' => $build ?? [],
            'compose'   => $this->compose,
            'templateSlug'  => $this->slug,
            'templateAsync' => $this->async,
            'templateAsyncMethod' => $this->asyncMethod,
            'templateAsyncRoute'  => $this->asyncRoute,
            'templateSaveAjax'    => $this->asyncSaveAjax,
        ]);
    }

    /**
     * @param string $method
     * @param bool   $async
     *
     * @return \Orchid\Screen\Layouts
     */
    public function async(string $method, string $route = null, $async = true, $saveajax = false) : self
    {
        $this->async = $async;
        $this->asyncMethod = $method;
        $this->asyncRoute = $route;
        $this->asyncSaveAjax = $saveajax;

        return $this;
    }
}
{'fraction_non_alphanumeric': 0.1552461050599752, 'fraction_numerical': 0.0008272438990762443, 'mean_word_length': 1.8083623693379791, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 69, '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': '200414', 'n_tokens_mistral': 2258, 'n_tokens_neox': 2219, 'n_words': 453}