<commit_before><?php

declare(strict_types=1);

/*
 * This file is part of the ************************ package.
 * _____________                           _______________
 *  ______/     \__  _____  ____  ______  / /_  _________
 *   ____/ __   / / / / _ \/ __`\/ / __ \/ __ \/ __ \___
 *    __/ / /  / /_/ /  __/ /  \  / /_/ / / / / /_/ /__
 *      \_\ \_/\____/\___/_/   / / .___/_/ /_/ .___/
 *         \_\                /_/_/         /_/
 *
 * The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple>
 * (c) 2010-2020 http://queryphp.com All rights reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Leevel\Encryption\Proxy;

use Leevel\Di\Container;
use Leevel\Encryption\Encryption as BaseEncryption;

/**
 * 代理 encryption.
 *
 * @codeCoverageIgnore
 */
class Encryption
{
    /**
     * call.
     *
     * @return mixed
     */
    public static function __callStatic(string $method, array $args)
    {
        return self::proxy()->{$method}(...$args);
    }

    /**
     * 加密.
     */
    public static function encrypt(string $value, int $expiry = 0): string
    {
        return self::proxy()->encrypt($value, $expiry);
    }

    /**
     * 解密.
     */
    public static function decrypt(string $value): string
    {
        return self::proxy()->decrypt($value);
    }

    /**
     * 代理服务.
     */
    public static function proxy(): BaseEncryption
    {
        return Container::singletons()->make('encryption');
    }
}
<commit_msg>refactor(encryption): use @ method to implement proxy ide helper<commit_after><?php

declare(strict_types=1);

/*
 * This file is part of the ************************ package.
 * _____________                           _______________
 *  ______/     \__  _____  ____  ______  / /_  _________
 *   ____/ __   / / / / _ \/ __`\/ / __ \/ __ \/ __ \___
 *    __/ / /  / /_/ /  __/ /  \  / /_/ / / / / /_/ /__
 *      \_\ \_/\____/\___/_/   / / .___/_/ /_/ .___/
 *         \_\                /_/_/         /_/
 *
 * The PHP Framework For Code Poem As Free As Wind. <Query Yet Simple>
 * (c) 2010-2020 http://queryphp.com All rights reserved.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Leevel\Encryption\Proxy;

use Leevel\Di\Container;
use Leevel\Encryption\Encryption as BaseEncryption;

/**
 * 代理 encryption.
 *
 * @method static string encrypt(string $value, int $expiry = 0) 加密.
 * @method static string decrypt(string $value)                  解密.
 */
class Encryption
{
    /**
     * call.
     *
     * @return mixed
     */
    public static function __callStatic(string $method, array $args)
    {
        return self::proxy()->{$method}(...$args);
    }

    /**
     * 代理服务.
     */
    public static function proxy(): BaseEncryption
    {
        return Container::singletons()->make('encryption');
    }
}

{'fraction_non_alphanumeric': 0.1607501674480911, 'fraction_numerical': 0.006697923643670462, 'mean_word_length': 1.833965844402277, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '3858929', 'n_tokens_mistral': 988, 'n_tokens_neox': 942, 'n_words': 203}