diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..dde70ae --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,25 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v1.0.0 + +name: Release + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7fbb3a5..8a57053 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,47 +1,43 @@ name: tests -on: [push] +on: + push: + pull_request: + schedule: + - cron: '0 2 * * *' jobs: build: - runs-on: ${{ matrix.operating-system }} - + name: Test on PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} + runs-on: "${{ matrix.os }}" strategy: - max-parallel: 15 + max-parallel: 32 matrix: - operating-system: [ubuntu-latest] - php-versions: ["8.0", "8.1"] - name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} - + os: [ubuntu-latest] + php: ['8.0', '8.1', '8.2'] + laravel: ['9', '10'] + exclude: + - php: 8.0 + laravel: 10 steps: - name: Checkout uses: actions/checkout@master - - name: Install PHP uses: shivammathur/setup-php@master - with: - php-version: ${{ matrix.php-versions }} + php-version: ${{ matrix.php }} extension-csv: mbstring, xdebug ini-values-csv: "post_max_size=256M, short_open_tag=On" coverage: xdebug - - name: Check PHP Version run: php -v - - name: Check Composer Version run: composer -V - - name: Check PHP Extensions run: php -m - - # - uses: actions/checkout@v1 - - - name: Install dependencies + - name: Install Dependencies run: | - composer install --dev - + composer require "laravel/framework:^${{ matrix.laravel }}" --no-update + composer update --prefer-dist --no-interaction --no-progress - name: Test - run: | - composer test - # vendor/bin/phpunit + run: composer test diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 3a6d243..acbdbfd 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -2,98 +2,33 @@ declare(strict_types=1); /** - * This file is part of hyperf/helpers. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md * @contact huangdijia@gmail.com */ -$header = <<<'EOF' -This file is part of laravel-youdu. +use Huangdijia\PhpCsFixer\Config; -@link https://github.com/huangdijia/laravel-youdu -@document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md -@contact huangdijia@gmail.com -EOF; +require __DIR__ . '/vendor/autoload.php'; -return (new PhpCsFixer\Config()) - ->setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - '@Symfony' => true, - '@DoctrineAnnotation' => true, - '@PhpCsFixer' => true, - 'header_comment' => [ - 'comment_type' => 'PHPDoc', - 'header' => $header, - 'separate' => 'none', - 'location' => 'after_declare_strict', +return (new Config()) + ->setHeaderComment( + projectName: 'huangdijia/laravel-youdu', + projectLink: 'https://github.com/huangdijia/laravel-youdu', + projectDocument: 'https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md', + contacts: [ + 'huangdijia@gmail.com', ], - 'array_syntax' => [ - 'syntax' => 'short', - ], - 'list_syntax' => [ - 'syntax' => 'short', - ], - 'concat_space' => [ - 'spacing' => 'one', - ], - 'blank_line_before_statement' => [ - 'statements' => [ - 'declare', - ], - ], - 'general_phpdoc_annotation_remove' => [ - 'annotations' => [ - 'author', - ], - ], - 'ordered_imports' => [ - 'imports_order' => [ - 'class', 'function', 'const', - ], - 'sort_algorithm' => 'alpha', - ], - 'single_line_comment_style' => [ - 'comment_types' => [ - ], - ], - 'yoda_style' => [ - 'always_move_variable' => false, - 'equal' => false, - 'identical' => false, - ], - 'phpdoc_align' => [ - 'align' => 'left', - ], - 'multiline_whitespace_before_semicolons' => [ - 'strategy' => 'no_multi_line', - ], - 'constant_case' => [ - 'case' => 'lower', - ], - 'class_attributes_separation' => true, - 'combine_consecutive_unsets' => true, - 'declare_strict_types' => true, - 'linebreak_after_opening_tag' => true, - 'lowercase_static_reference' => true, - 'no_useless_else' => true, - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'not_operator_with_space' => false, - 'ordered_class_elements' => true, - 'php_unit_strict' => false, - 'phpdoc_separation' => false, - 'single_quote' => true, - 'standardize_not_equals' => true, - 'multiline_comment_opening_closing' => true, - ]) + ) ->setFinder( PhpCsFixer\Finder::create() - ->exclude('bin') ->exclude('public') ->exclude('runtime') ->exclude('vendor') ->in(__DIR__) + ->append([ + __FILE__, + ]) ) ->setUsingCache(false); diff --git a/composer.json b/composer.json index cbf190c..62dcda1 100644 --- a/composer.json +++ b/composer.json @@ -14,15 +14,15 @@ }], "require": { "php": ">=8.0", - "illuminate/support": "^9.0", - "illuminate/notifications": "^9.0", - "illuminate/contracts": "^9.0", + "illuminate/support": "^9.0|^10.0", + "illuminate/notifications": "^9.0|^10.0", + "illuminate/contracts": "^9.0|^10.0", "guzzlehttp/guzzle": "^6.4|^7.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.0", - "phpstan/phpstan": "^1.0", - "orchestra/testbench": "^7.0" + "huangdijia/php-coding-standard": "^1.2", + "orchestra/testbench": "^7.0|^8.0", + "phpstan/phpstan": "^1.0" }, "autoload": { "files": [ @@ -52,4 +52,4 @@ "config": { "sort-packages": true } -} \ No newline at end of file +} diff --git a/config/youdu.php b/config/youdu.php index 7a540df..2382e3c 100644 --- a/config/youdu.php +++ b/config/youdu.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/rector.php b/rector.php index b0c2e9c..b94d28f 100644 --- a/rector.php +++ b/rector.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/App.php b/src/App.php index 1924e5e..c04fc25 100644 --- a/src/App.php +++ b/src/App.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Channels/YouduChannel.php b/src/Channels/YouduChannel.php index 4de3238..d9cbb0b 100644 --- a/src/Channels/YouduChannel.php +++ b/src/Channels/YouduChannel.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 3094ee5..ddde80a 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Console/SendToDeptCommand.php b/src/Console/SendToDeptCommand.php index 8d873ae..af0359c 100644 --- a/src/Console/SendToDeptCommand.php +++ b/src/Console/SendToDeptCommand.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Console/SendToUserCommand.php b/src/Console/SendToUserCommand.php index e0cc024..aea59d2 100644 --- a/src/Console/SendToUserCommand.php +++ b/src/Console/SendToUserCommand.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Contracts/AppMessage.php b/src/Contracts/AppMessage.php index f315787..c90a4e1 100644 --- a/src/Contracts/AppMessage.php +++ b/src/Contracts/AppMessage.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Contracts/AppMessageItem.php b/src/Contracts/AppMessageItem.php index 4289607..6053fc1 100644 --- a/src/Contracts/AppMessageItem.php +++ b/src/Contracts/AppMessageItem.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Contracts/Channel.php b/src/Contracts/Channel.php index 118489c..b4896ce 100644 --- a/src/Contracts/Channel.php +++ b/src/Contracts/Channel.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Contracts/HttpClient.php b/src/Contracts/HttpClient.php index 7bbb998..c313ef7 100644 --- a/src/Contracts/HttpClient.php +++ b/src/Contracts/HttpClient.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Contracts/SessionMessage.php b/src/Contracts/SessionMessage.php index 530c21a..b9f3364 100644 --- a/src/Contracts/SessionMessage.php +++ b/src/Contracts/SessionMessage.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Crypt/PKCS7Encoder.php b/src/Crypt/PKCS7Encoder.php index 6df777b..b7643fa 100644 --- a/src/Crypt/PKCS7Encoder.php +++ b/src/Crypt/PKCS7Encoder.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Crypt/Prpcrypt.php b/src/Crypt/Prpcrypt.php index 8255bd6..08ae30d 100644 --- a/src/Crypt/Prpcrypt.php +++ b/src/Crypt/Prpcrypt.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Crypt/SHA1.php b/src/Crypt/SHA1.php index ff8bcfc..b2e77e2 100644 --- a/src/Crypt/SHA1.php +++ b/src/Crypt/SHA1.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md @@ -20,7 +20,6 @@ class SHA1 * @param string $token 票据 * @param string $timestamp 时间戳 * @param string $nonce 随机字符串 - * @param string $encrypt 密文消息 * @param mixed $encrypt_msg */ public function getSHA1($token, $timestamp, $nonce, $encrypt_msg) diff --git a/src/Dept.php b/src/Dept.php index 67da005..cf08bb6 100644 --- a/src/Dept.php +++ b/src/Dept.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Exceptions/AccessTokenDoesNotExistException.php b/src/Exceptions/AccessTokenDoesNotExistException.php index 2129292..ef44b05 100644 --- a/src/Exceptions/AccessTokenDoesNotExistException.php +++ b/src/Exceptions/AccessTokenDoesNotExistException.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Exceptions/ChannelException.php b/src/Exceptions/ChannelException.php index 58f6b37..50ce7b8 100644 --- a/src/Exceptions/ChannelException.php +++ b/src/Exceptions/ChannelException.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Exceptions/ErrorCode.php b/src/Exceptions/ErrorCode.php index dd9935f..cc171d9 100644 --- a/src/Exceptions/ErrorCode.php +++ b/src/Exceptions/ErrorCode.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Exceptions/Exception.php b/src/Exceptions/Exception.php index bd9a0c8..8d6b4b6 100644 --- a/src/Exceptions/Exception.php +++ b/src/Exceptions/Exception.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Exceptions/Http/RequestException.php b/src/Exceptions/Http/RequestException.php index 9132ee9..fac4041 100644 --- a/src/Exceptions/Http/RequestException.php +++ b/src/Exceptions/Http/RequestException.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Facades/HttpClient.php b/src/Facades/HttpClient.php index ca707f8..d5a8505 100644 --- a/src/Facades/HttpClient.php +++ b/src/Facades/HttpClient.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Facades/Youdu.php b/src/Facades/Youdu.php index eb0ff4c..1360a33 100644 --- a/src/Facades/Youdu.php +++ b/src/Facades/Youdu.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Group.php b/src/Group.php index ff70b88..1d03191 100644 --- a/src/Group.php +++ b/src/Group.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Http/Curl.php b/src/Http/Curl.php index 5cf2e54..c7518fc 100644 --- a/src/Http/Curl.php +++ b/src/Http/Curl.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Http/Guzzle.php b/src/Http/Guzzle.php index 54c08dd..46081a2 100644 --- a/src/Http/Guzzle.php +++ b/src/Http/Guzzle.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Listeners/ExceptionListener.php b/src/Listeners/ExceptionListener.php index 0e6a45d..382ad4f 100644 --- a/src/Listeners/ExceptionListener.php +++ b/src/Listeners/ExceptionListener.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Manager.php b/src/Manager.php index 9b9d466..b75f826 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Media.php b/src/Media.php index 919ca2f..bd400a2 100644 --- a/src/Media.php +++ b/src/Media.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Exlink.php b/src/Messages/App/Exlink.php index e11899a..f097cc7 100644 --- a/src/Messages/App/Exlink.php +++ b/src/Messages/App/Exlink.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/File.php b/src/Messages/App/File.php index f93535a..be7cd78 100644 --- a/src/Messages/App/File.php +++ b/src/Messages/App/File.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Image.php b/src/Messages/App/Image.php index eb63cd7..dad88c5 100644 --- a/src/Messages/App/Image.php +++ b/src/Messages/App/Image.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Items/Exlink.php b/src/Messages/App/Items/Exlink.php index d414b2e..ec661a3 100644 --- a/src/Messages/App/Items/Exlink.php +++ b/src/Messages/App/Items/Exlink.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Items/Item.php b/src/Messages/App/Items/Item.php index 8f53b47..5d1c9e9 100644 --- a/src/Messages/App/Items/Item.php +++ b/src/Messages/App/Items/Item.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Items/Mpnews.php b/src/Messages/App/Items/Mpnews.php index 3bd22a0..80b53f2 100644 --- a/src/Messages/App/Items/Mpnews.php +++ b/src/Messages/App/Items/Mpnews.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md @@ -18,11 +18,8 @@ public function __construct(array $items = []) } /** - * @param string $itle 标题,最长不超过64个字符,超出部分将自动截取 - * @param string $media_id 封面图片ID。通过上传素材文件接口获取 * @param string $content 正文,最长不超过600个字符,超出部分将自动截取 * @param string $digest 摘要,最长不超过120个字符,超出部分将自动截取 - * @param int $showFront 正文是否显示封面图片。1:显示,0:不显示 */ public function add(string $title = '', string $mediaId = '', string $content = '', string $digest = '', int $showFont = 1) { diff --git a/src/Messages/App/Items/SysMsg.php b/src/Messages/App/Items/SysMsg.php index 17979db..5911daa 100644 --- a/src/Messages/App/Items/SysMsg.php +++ b/src/Messages/App/Items/SysMsg.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Link.php b/src/Messages/App/Link.php index f4e0047..a7d5813 100644 --- a/src/Messages/App/Link.php +++ b/src/Messages/App/Link.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Mail.php b/src/Messages/App/Mail.php index 5793f48..bd4d448 100644 --- a/src/Messages/App/Mail.php +++ b/src/Messages/App/Mail.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md @@ -19,7 +19,6 @@ class Mail extends Message * @param string $subject 邮件主题。action为new时有效,可为空 * @param string $fromUser 发送者帐号,action为new时有效 * @param string $fromEmail 发送者邮件帐号,action为new时有效。fromUser不为空,fromEmail值无效 - * @param string $time 邮件发送时间。为空默认取服务器接收到消息的时间 * @param string $link 邮件链接。action为new时有效,点此链接即可打开邮件,为空时点击邮件消息默认执行企业邮箱单点登录 * @param string $unreadCount 未读邮件数。action为unread时有效 */ diff --git a/src/Messages/App/Message.php b/src/Messages/App/Message.php index 6c16b12..7586138 100644 --- a/src/Messages/App/Message.php +++ b/src/Messages/App/Message.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md @@ -50,9 +50,8 @@ public function toJson($options = JSON_UNESCAPED_UNICODE) /** * json 序列化. - * @return array */ - public function jsonSerialize() + public function jsonSerialize(): array { $data = $this->toArray(); diff --git a/src/Messages/App/Mpnews.php b/src/Messages/App/Mpnews.php index 3b5fec1..008ce19 100644 --- a/src/Messages/App/Mpnews.php +++ b/src/Messages/App/Mpnews.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/PopWindow.php b/src/Messages/App/PopWindow.php index 48f0679..4dd2bc0 100644 --- a/src/Messages/App/PopWindow.php +++ b/src/Messages/App/PopWindow.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md @@ -28,7 +28,6 @@ class PopWindow extends Message * @param int $duration 弹窗窗口停留时间。单位:秒,不设置或设置为0会取默认5秒, -1为永久 * @param int $position 弹窗位置。 不设置或设置为0默认屏幕中央, 1 左上, 2 右上, 3 右下, 4 左下 * @param string $noticeId 通知id,用于防止重复弹窗 - * @param int $pop_mode 打开方式。1 浏览器, 2 窗口, 其他采用应用默认配置 */ public function __construct(protected string $url = '', protected string $tip = '', protected string $title = '', protected int $width = 400, protected int $height = 300, protected int $duration = 5, protected int $position = 3, protected string $noticeId = '', protected int $popMode = 1) { diff --git a/src/Messages/App/Sms.php b/src/Messages/App/Sms.php index c6d1932..d98a290 100644 --- a/src/Messages/App/Sms.php +++ b/src/Messages/App/Sms.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/SysMsg.php b/src/Messages/App/SysMsg.php index 2fa76e7..08b8255 100644 --- a/src/Messages/App/SysMsg.php +++ b/src/Messages/App/SysMsg.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/App/Text.php b/src/Messages/App/Text.php index df915e7..83f88a7 100644 --- a/src/Messages/App/Text.php +++ b/src/Messages/App/Text.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/Session/File.php b/src/Messages/Session/File.php index 1e7401d..7b3e90d 100644 --- a/src/Messages/Session/File.php +++ b/src/Messages/Session/File.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/Session/Image.php b/src/Messages/Session/Image.php index ef32a1f..ff3b80c 100644 --- a/src/Messages/Session/Image.php +++ b/src/Messages/Session/Image.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/Session/Message.php b/src/Messages/Session/Message.php index 91a4caf..f14df20 100644 --- a/src/Messages/Session/Message.php +++ b/src/Messages/Session/Message.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md @@ -40,7 +40,7 @@ public function toJson($options = JSON_UNESCAPED_UNICODE) return json_encode($this->jsonSerialize(), $options); } - public function jsonSerialize() + public function jsonSerialize(): array { $data = $this->toArray(); diff --git a/src/Messages/Session/Text.php b/src/Messages/Session/Text.php index a0e8590..6383271 100644 --- a/src/Messages/Session/Text.php +++ b/src/Messages/Session/Text.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/Session/Video.php b/src/Messages/Session/Video.php index 8afbc21..fd19ac7 100644 --- a/src/Messages/Session/Video.php +++ b/src/Messages/Session/Video.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Messages/Session/Voice.php b/src/Messages/Session/Voice.php index ff24054..aaaab18 100644 --- a/src/Messages/Session/Voice.php +++ b/src/Messages/Session/Voice.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Notifications/Notification.php b/src/Notifications/Notification.php index 7834287..ffb8316 100644 --- a/src/Notifications/Notification.php +++ b/src/Notifications/Notification.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/Notifications/TextNotification.php b/src/Notifications/TextNotification.php index 54849a3..d07b1fd 100644 --- a/src/Notifications/TextNotification.php +++ b/src/Notifications/TextNotification.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md @@ -17,7 +17,7 @@ class TextNotification extends Notification /** * Create a new notification instance. * - * @param null|mixed $delay + * @param mixed|null $delay */ public function __construct(string $message, string $app = 'default', ?int $delay = null) { diff --git a/src/Session.php b/src/Session.php index 8076dd0..a20b9c4 100644 --- a/src/Session.php +++ b/src/Session.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/User.php b/src/User.php index 5af2981..1bf8f63 100644 --- a/src/User.php +++ b/src/User.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/YouduServiceProvider.php b/src/YouduServiceProvider.php index 6ae5cd6..6175c97 100644 --- a/src/YouduServiceProvider.php +++ b/src/YouduServiceProvider.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/src/helpers.php b/src/helpers.php index 3f34d32..3373aac 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/tests/AppTest.php b/tests/AppTest.php index fbedf71..d6a818f 100644 --- a/tests/AppTest.php +++ b/tests/AppTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/tests/BaseTest.php b/tests/BaseTest.php index 772c09d..3441385 100644 --- a/tests/BaseTest.php +++ b/tests/BaseTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/tests/DeptTest.php b/tests/DeptTest.php index 36c7bd8..e6e2da2 100644 --- a/tests/DeptTest.php +++ b/tests/DeptTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/tests/TestCase.php b/tests/TestCase.php index a963e8f..ae8b099 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md diff --git a/tests/UserTest.php b/tests/UserTest.php index 8f8272a..ea57175 100644 --- a/tests/UserTest.php +++ b/tests/UserTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); /** - * This file is part of laravel-youdu. + * This file is part of huangdijia/laravel-youdu. * * @link https://github.com/huangdijia/laravel-youdu * @document https://github.com/huangdijia/laravel-youdu/blob/3.x/README.md