<commit_before><?php

namespace Zhiyi\Plus\Support;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;

abstract class ServiceProvider extends BaseServiceProvider
{
    protected static $manages = [];

    /**
     * Get the manages for the provider.
     *
     * @return array
     * @author <NAME> <<EMAIL>>
     */
    public static function getManages(): array
    {
        $manages = [];
        foreach (static::$manages as $item) {
            $name = $item['name'];
            $uri = $item['uri'];
            $option = $item['option'];

            $isRoute = $option['route'] ?? false;
            $parameters = (array) ($option['parameters'] ?? []);
            $absolute = $option['absolute'] ?? true;
            $icon = $option['icon'] ?? null;

            $manages[] = [
                'name' => $name,
                'icon' => $icon,
                'uri' => ! $isRoute ? $uri : route($uri, $parameters, $absolute),
            ];
        }

        return $manages;
    }

    /**
     * Push manage url.
     *
     * @param string $name
     * @param string $uri
     * @param array $option
     * @return void
     * @author <NAME> <<EMAIL>>
     */
    public function loadManageFrom(string $name, string $uri, array $option = [])
    {
        static::$manages[] = [
            'name' => $name,
            'uri' => $uri,
            'option' => $option
        ];
    }

    /**
     * Load service provider.
     *
     * @param array|string $provider
     * @return void
     * @author <NAME> <<EMAIL>>
     */
    protected function loadProvider($providers)
    {
        if (is_string($providers)) {
            $providers = [$providers];
        }

        $this->app->make(ProviderRepository::class)->load($providers);
    }

    /**
     * 转换处理方法名称为显示名称.
     *
     * @param string $handle
     * @return string
     * @author <NAME> <<EMAIL>>
     */
    public function formatHandleToDisplay(string $handle): string
    {
        if (strtolower(substr($handle, -6)) === 'handle') {<commit_msg>Apply fixes from StyleCI<commit_after><?php

namespace Zhiyi\Plus\Support;

use Illuminate\Support\ServiceProvider as BaseServiceProvider;

abstract class ServiceProvider extends BaseServiceProvider
{
    protected static $manages = [];

    /**
     * Get the manages for the provider.
     *
     * @return array
     * @author <NAME> <<EMAIL>>
     */
    public static function getManages(): array
    {
        $manages = [];
        foreach (static::$manages as $item) {
            $name = $item['name'];
            $uri = $item['uri'];
            $option = $item['option'];

            $isRoute = $option['route'] ?? false;
            $parameters = (array) ($option['parameters'] ?? []);
            $absolute = $option['absolute'] ?? true;
            $icon = $option['icon'] ?? null;

            $manages[] = [
                'name' => $name,
                'icon' => $icon,
                'uri' => ! $isRoute ? $uri : route($uri, $parameters, $absolute),
            ];
        }

        return $manages;
    }

    /**
     * Push manage url.
     *
     * @param string $name
     * @param string $uri
     * @param array $option
     * @return void
     * @author <NAME> <<EMAIL>>
     */
    public function loadManageFrom(string $name, string $uri, array $option = [])
    {
        static::$manages[] = [
            'name' => $name,
            'uri' => $uri,
            'option' => $option,
        ];
    }

    /**
     * Load service provider.
     *
     * @param array|string $provider
     * @return void
     * @author <NAME> <<EMAIL>>
     */
    protected function loadProvider($providers)
    {
        if (is_string($providers)) {
            $providers = [$providers];
        }

        $this->app->make(ProviderRepository::class)->load($providers);
    }

    /**
     * 转换处理方法名称为显示名称.
     *
     * @param string $handle
     * @return string
     * @author <NAME> <<EMAIL>>
     */
    public function formatHandleToDisplay(string $handle): string
    {
        if (strtolower(substr($handle, -6)) === 'handle') {
{'fraction_non_alphanumeric': 0.15716374269005848, 'fraction_numerical': 0.0004873294346978557, 'mean_word_length': 1.8586350974930361, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 45, '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': '6936003', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1217, 'n_words': 275}