Skip to content
Permalink
 
 
Cannot retrieve contributors at this time
<?php
declare(strict_types=1);
namespace Tests\Docs;
/**
* 濡備綍鎴愪负 QueryPHP 寮鍙戣.
*
* @api(
* zh-CN:title="濡備綍鎴愪负 QueryPHP 寮鍙戣",
* path="developer/README",
* zh-CN:description="
* QueryPHP 闈炲父娆㈣繋鍚勪綅缁欐垜浠叡鍚岀殑鍏呮弧鎯宠薄涓斾护浜烘儕鍙圭殑瀹屾垚搴︾殑寮婧愪綔鍝佹坊鐮栧姞鐡︼紝瀹炵幇涓 PHP 绀惧尯鎻愪緵涓涓ソ妗嗘灦鐨勭編濂芥効鏅
*
* * 鏂囨。寮鍙.鍩轰簬鍗曞厓娴嬭瘯瀹炵幇鐨勮嚜鍔ㄥ寲鏂囨。 [褰撳墠鏂囨。寮鍙慮(https://github.com/hunzhiwange/framework/projects/2)
* * 璁″垝鍔熻兘.寮鍙 [褰撳墠璁″垝鍔熻兘](https://github.com/hunzhiwange/framework/projects/6)
* * 鎶鏈哄姟.娓呭伩 [褰撳墠鎶鏈哄姟](https://github.com/hunzhiwange/framework/projects/7)
* * 鍗曞厓娴嬭瘯.灏藉彲鑳藉噺灏 Bug [褰撳墠鍗曞厓娴嬭瘯](https://github.com/hunzhiwange/framework/projects/4)
*
* 鎴愪负寮鍙戣呴渶瑕佸姞鍏ユ垜浠殑缁勭粐锛屽鏈夌浉鍏虫剰鎰胯鍙戦侀偖浠惰嚦 `灏忕墰鍝 <635750556@qq.com>`锛屾垜浠細鑱旂郴浣犵殑銆
*
* 鎴愪负寮鍙戣呭苟娌℃湁浠涔堜换鍔¤礋鎷咃紝涓鍒囦富瑕佷互浣犵殑鎰忔効锛屽叴瓒f墠鏄渶閲嶈鐨勩
*
* 鏈瘒鎸囧崡灏嗗甫浣犳惌寤虹殑 QueryPHP 寮鍙戞鏋剁殑寮鍙戠幆澧冿紝浣垮緱浣犲彲浠ュ弬涓 QueryPHP 搴曞眰浠g爜銆佸崟鍏冩祴璇曞拰鏂囨。绛夊紑鍙戝伐浣溿
*
* 杩欓噷浠ョ瑪鑰呯殑 Mac 涓轰緥瀛愯鏄庯紝鍏跺疄 Windows 涓嬮潰杩樻洿绠鍗曚簺銆
* ",
* )
*/
class BecomeAQueryphpDeveloperDoc
{
/**
* @api(
* zh-CN:title="鍏嬮殕 `queryphp` 浠撳簱",
* zh-CN:description="
* QueryPHP 妗嗘灦鐨勫紑鍙戞潵鑷簬浠庡厠闅嗕富浠撳簱寮濮嬶紝鐢变簬鍥藉唴璁块棶 Github 缃戦熺殑闂锛屽彧闇瑕佺瓑寰呬竴灏忔鏃堕棿銆
*
* **涓嬭浇浠g爜**
*
* ```
* $cd /data/codes/test
* $git clone git@github.com:hunzhiwange/queryphp.git
* ```
*
* **Composer 瀹夎**
*
* ```
* composer install
* ```
*
* > 濡傛灉浣犵數鑴戞病鏈夊畨瑁 `composer`锛岄偅涔堝凡缁忎负浣犱笅杞戒竴涓増鏈
*
* ```
* sudo chmod 777 ./build/composer
* ./build/composer install
* ```
*
* 瀹夎杩囩▼
*
* ```
* Cloning into 'queryphp'...
* remote: Enumerating objects: 54, done.
* remote: Counting objects: 100% (54/54), done.
* remote: Compressing objects: 100% (39/39), done.
* remote: Total 17821 (delta 19), reused 36 (delta 14), pack-reused 17767
* Receiving objects: 100% (17821/17821), 45.12 MiB | 693.00 KiB/s, done.
* Resolving deltas: 100% (8700/8700), done.
* ```
*
* **娴嬭瘯鏄惁瀹夎鎴愬姛**
*
* 濡傛灉鍙互璁块棶锛岄偅涔堟伃鍠滀綘绗竴闃舵鍗冲畨瑁呭畬姣曘
* ",
* zh-CN:note="",
* lang="shell",
* )
*/
public function doc1(): void
{
<<<'EOT'
php leevel server <Visite http://127.0.0.1:9527/>
EOT;
}
/**
* @api(
* zh-CN:title="鎼缓鍚庡彴 API 绔",
* zh-CN:description="
* 棣栧厛鎴戜滑闇瑕佸垱寤轰竴涓暟鎹簱鏉ヨ繍琛屾垜浠殑鍚庡彴锛岃鎴戜滑瀵 QueryPHP 鏈変竴涓洿瑙傜殑鎰熷彈锛屽悓鏃舵柟渚垮悗鏈熷紑鍙戣皟璇曠瓑銆
*
* **棣栧厛鍒涘缓涓涓暟鎹簱**
*
* 鍙互鐢 Navicat For Mysql 鍒涘缓涓涓暟鎹簱 `queryphp_development_db`.
*
* ```
* CREATE DATABASE IF NOT EXISTS queryphp_development_db DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
* ```
*
* **淇敼 .env**
*
* ```
* ...
* // Database
* DATABASE_DRIVER = mysql
* DATABASE_HOST = 127.0.0.1
* DATABASE_PORT = 3306
* DATABASE_NAME = queryphp_development_db
* DATABASE_USER = root
* DATABASE_PASSWORD =
* ...
*
* 淇敼涓
*
* ...
* // Database
* DATABASE_DRIVER = mysql
* DATABASE_HOST = 127.0.0.1
* DATABASE_PORT = 3306
* DATABASE_NAME = queryphp_development_db
* DATABASE_USER = root
* DATABASE_PASSWORD = 123456
* ...
* ```
*
* **鎵ц鏁版嵁搴撹縼绉诲懡浠**
*
* ```
* php leevel migrate:migrate
* ```
*
* 瀹夎杩囩▼
*
* ```
* using config file ./phinx.php
* using config parser php
* using migration paths
* - /data/codes/test/queryphp/database/migrations
* using seed paths
* - /data/codes/test/queryphp/database/seeds
* warning no environment specified, defaulting to: development
* using adapter mysql
* using database queryphp_development_db
*
* == 20181109060739 App: migrating
* == 20181109060739 App: migrated 0.0155s
*
* == 20181112023649 Role: migrating
* == 20181112023649 Role: migrated 0.0160s
*
* == 20181112024140 User: migrating
* == 20181112024140 User: migrated 0.0166s
*
* == 20181112024211 Permission: migrating
* == 20181112024211 Permission: migrated 0.0225s
*
* == 20181112024241 UserRole: migrating
* == 20181112024241 UserRole: migrated 0.0155s
*
* == 20181112024302 RolePermission: migrating
* == 20181112024302 RolePermission: migrated 0.0206s
*
* == 20181112024416 Resource: migrating
* == 20181112024416 Resource: migrated 0.0328s
*
* == 20181112024450 PermissionResource: migrating
* == 20181112024450 PermissionResource: migrated 0.0305s
*
* == 20181203130724 Option: migrating
* == 20181203130724 Option: migrated 0.0170s
*
* == 20181203144731 Test: migrating
* == 20181203144731 Test: migrated 0.0133s
*
* All Done. Took 0.2273s
* ```
*
* **娴嬭瘯鏁版嵁搴撴槸鍚︽甯**
*
* ```
* php leevel server <http://127.0.0.1:9527/api/entity>
* ```
*
* 缁撴灉
*
* ",
* zh-CN:note="",
* lang="html",
* )
*/
public function doc2(): void
{
<<<'EOT'
{
count: 4,
:trace: {
...
}
}
EOT;
}
/**
* @api(
* zh-CN:title="鎼缓鍓嶇",
* zh-CN:description="
* 鍚庡彴 API 鎼缓濂戒簡锛屾垜浠紑濮嬫惌寤哄墠绔簡锛屽墠绔熀浜 `Vue-cli 3` 鍜 `IView`锛岄鍏堥渶瑕佸畨瑁 `node` 鎵嶈兘澶熻窇璧锋潵銆
*
* 瀵逛簬寮鍙 QueryPHP 鏉ヨ锛屼綘涓嶉渶瑕佷細 `Vue` 鎴栬 `JavaScript`锛屾墍浠ヨ鏀惧績涓嶈鏈夊績閲岃礋鎷呫
*
* **瀹夎鍓嶇**
*
* 绗竴姝ュ畨瑁呭墠绔,缁嗚妭淇℃伅鍙互鍦 frontend/README.md 鏌ョ湅.
*
* ```
* cd frontend
* npm install -g cnpm --registry=https://registry.npm.taobao.org // Just once
* cnpm install
* ```
*
* 瀹夎杩囩▼
*
* ```
* 鉁 All packages installed (1264 packages installed from npm registry, used 14s(network 13s), speed 221.08kB/s, json 1086(2.23MB), tarball 501.92kB)
* ```
*
* **杩愯鍓嶇**
*
* 鎺ョ潃璁块棶杩欎釜鐧婚檰鍦板潃.
*
* ```
* npm run serve # npm run dev <http://127.0.0.1:9528/#/login>
* ```
*
* 杈撳叆鐧婚檰鐢ㄦ埛鍚嶅拰瀵嗙爜,杩欎釜鏃跺 QueryPHP 涓嶅啀鏄竴涓啺鍐风殑浠g爜锛岃屾槸鏈変竴涓共鍑鐨勫甫鏈夊熀纭鏉冮檺绯荤粺鐨勫悗鍙般
*
* ",
* zh-CN:note="",
* lang="html",
* )
*/
public function doc3(): void
{
<<<'EOT'
user: admin
password: 123456
EOT;
}
/**
* @api(
* zh-CN:title="杩愯娴嬭瘯鐢ㄤ緥",
* zh-CN:description="
* QueryPHP 鎺ㄥ磭閫氳繃缂栧啓娴嬭瘯鐢ㄤ緥鏉ヨ浠g爜鍙樺緱鍙淮鎶わ紝鎵浠ヨ繖閲岄渶瑕佹湰鍦板紑鍙戣窇閫氭祴璇曠敤渚嬨
*
* **棣栧厛鍒涘缓涓涓暟鎹簱**
*
* 鍙互鐢 Navicat For Mysql 鍒涘缓涓涓暟鎹簱 `queryphp_development_test`.
*
* ```
* CREATE DATABASE IF NOT EXISTS queryphp_development_test DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
* ```
*
* **淇敼 .env**
*
* ```
* ...
* // Database
* DATABASE_DRIVER = mysql
* DATABASE_HOST = 127.0.0.1
* DATABASE_PORT = 3306
* DATABASE_NAME = test
* DATABASE_USER = root
* DATABASE_PASSWORD =
* ...
*
* 淇敼涓
*
* ...
* // Database
* DATABASE_DRIVER = mysql
* DATABASE_HOST = 127.0.0.1
* DATABASE_PORT = 3306
* DATABASE_NAME = queryphp_development_test
* DATABASE_USER = root
* DATABASE_PASSWORD = 123456
* ...
* ```
*
* **鎵ц鏁版嵁搴撹縼绉诲懡浠**
*
* ```
* php leevel migrate:migrate -e testing
* ```
*
* 瀹夎杩囩▼
*
* ```
* using config file ./phinx.php
* using config parser php
* using migration paths
* - /data/codes/test/queryphp/database/migrations
* using seed paths
* - /data/codes/test/queryphp/database/seeds
* using environment testing
* using adapter mysql
* using database queryphp_development_test
*
* == 20181109060739 App: migrating
* == 20181109060739 App: migrated 0.0155s
*
* == 20181112023649 Role: migrating
* == 20181112023649 Role: migrated 0.0160s
*
* == 20181112024140 User: migrating
* == 20181112024140 User: migrated 0.0166s
*
* == 20181112024211 Permission: migrating
* == 20181112024211 Permission: migrated 0.0225s
*
* == 20181112024241 UserRole: migrating
* == 20181112024241 UserRole: migrated 0.0155s
*
* == 20181112024302 RolePermission: migrating
* == 20181112024302 RolePermission: migrated 0.0206s
*
* == 20181112024416 Resource: migrating
* == 20181112024416 Resource: migrated 0.0328s
*
* == 20181112024450 PermissionResource: migrating
* == 20181112024450 PermissionResource: migrated 0.0305s
*
* == 20181203130724 Option: migrating
* == 20181203130724 Option: migrated 0.0170s
*
* == 20181203144731 Test: migrating
* == 20181203144731 Test: migrated 0.0133s
*
* All Done. Took 0.2273s
* ```
*
* **杩愯娴嬭瘯鐢ㄤ緥**
*
* ```
* php ./build/phpunit
* ```
*
* 缁撴灉
*
* > 娉ㄦ剰闅忕潃绯荤粺婕旇繘锛屾祴璇曠敤渚嬩細澧炲姞锛岃緭鍑虹粨鏋滃氨鏈夋墍涓嶅悓銆
*
* ",
* zh-CN:note="",
* lang="html",
* )
*/
public function doc4(): void
{
<<<'EOT'
PHPUnit Pretty Result Printer 0.26.2 by Codedungeon and contributors.
PHPUnit 8.1.3 by Sebastian Bergmann and contributors.
==> Tests\Admin\Service\Resource\IndexTest 鉁 鉁
==> Tests\Example\ExampleTest 鉁
==> Tests\Example\PHPUnitTest 鉁
==> Common\Domain\Service\Search\IndexTest 鉁 鉁 鉁 鉁 鉁 鉁
==> Common\Infra\Helper\ArrayToFormTest 鉁 鉁 鉁 鉁 鉁 鉁
==> Common\Infra\Support\WorkflowServiceTest 鉁 鉁 鉁 鉁 鉁
==> Common\Infra\Support\WorkflowTest 鉁 鉁 鉁 鉁 鉁
Time: 391 ms, Memory: 18.00 MB
OK (26 tests, 43 assertions)
EOT;
}
/**
* @api(
* zh-CN:title="缁熶竴鍥㈤槦浠g爜椋庢牸",
* zh-CN:description="
* 椋庢牸缁熶竴瀵逛繚璇佹垜浠郴缁熶竴鑷存ч潪甯搁噸瑕侊紝鎴戜滑鍋氬埌寮绠卞嵆鐢紝鏀寔 `PHP` 鍜 `JavaScript`銆
*
* **浣跨敤 Git 閽╁瓙**
*
* ```
* cp ./build/pre-commit.sh ./.git/hooks/pre-commit
* chmod 777 ./.git/hooks/pre-commit
* ```
*
* **娴嬭瘯鑷姩鍖栨牸寮**
*
* `common/Test.php`
*
* ``` php
* <?php
*
* declare(strict_types=1);
*
* namespace Common;
*
* class Test{
* public function demo($a=1, $b=4){
* echo 1;
* }
* }
* ```
*
* `frontend/src/hello.js`
*
* ```
* function hello(a,b) {
* var c
* if(a>b) {
* c=a
* } else {
* c=b
* }
* console.log(c)
* }
* ```
*
* **Git 鎻愪氦娴嬭瘯鏍煎紡鍖**
*
* ```
* git add .
* git commit -m '娴嬭瘯鏍煎紡鍖'
* ```
*
* 杩愯杩囩▼
* ",
* zh-CN:note="",
* lang="shell",
* )
*/
public function doc5(): void
{
<<<'EOT'
Checking PHP Lint...
No syntax errors detected in common/Test.php
Running Code Sniffer...
Loaded config default from ".php_cs.dist".
Paths from configuration file have been overridden by paths provided as command arguments.
1) common/Test.php Fixed all files in 0.009 seconds, 12.000 MB memory used
The file has been automatically formatted.
[13:04:00] Working directory changed to /data/codes/test/queryphp/frontend
[13:04:00] Using gulpfile /data/codes/test/queryphp/frontend/gulpfile.js
[13:04:00] Starting 'iview'...
[13:04:00] Finished 'iview' after 413 渭s
frontend/src/hello.js 53ms
[master 681d7e29] 娴嬭瘯鏍煎紡鍖
3 files changed, 32 insertions(+)
mode change 100644 => 100755 build/composer
create mode 100644 common/Test.php
create mode 100644 frontend/src/hello.js
EOT;
}
/**
* @api(
* zh-CN:title="鏍煎紡鍖栧悗鐨 PHP",
* zh-CN:description="浠g爜骞插噣婕備寒浜嗕笉灏戯紝涓嶆槸鍚椼",
* level="###",
* )
*/
public function doc5_1(): void
{
<<<'EOT'
<?php
declare(strict_types=1);
/*
* This file is part of the your app package.
*
* The PHP Application For Code Poem For You.
* (c) 2018-2099 http://yourdomian.com All rights reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Common;
class Test
{
public function demo($a = 1, $b = 4)
{
echo 1;
}
}
EOT;
}
/**
* @api(
* zh-CN:title="鏍煎紡鍖栧悗鐨 JavaScript",
* zh-CN:description="浠g爜骞插噣婕備寒浜嗕笉灏戯紝涓嶆槸鍚椼",
* level="###",
* lang="javascript",
* )
*/
public function doc5_2(): void
{
<<<'EOT'
function hello(a, b) {
var c
if (a > b) {
c = a
} else {
c = b
}
console.log(c)
}
EOT;
}
/**
* @api(
* zh-CN:title="鍥炴粴娴嬭瘯鎻愪氦",
* zh-CN:description="杩欎簺娴嬭瘯浠g爜涓嶉渶瑕佹彁浜ゅ埌 Git 搴擄紝浣犲彲浠ュ洖婊氭帀鍒氭墠娴嬭瘯鐨勮繖浜涗唬鐮併",
* level="###",
* lang="shell",
* )
*/
public function doc5_3(): void
{
<<<'EOT'
git log
git reset --hard 931f283b0b8847e4a3f2ad86efb3c07cd7974c3b // 鎴栬 git revert xxx
HEAD is now at 931f283b Merge branch 'dev'
EOT;
}
/**
* @api(
* zh-CN:title="鍏嬮殕 `framework` 浠撳簱灏嗘鏋舵浛鎹负寮鍙戠増鏈",
* zh-CN:description="
* 搴旂敤灞傛鏋跺叏閮ㄦ惌寤哄畬姣曪紝鎺ヤ笅鏉ユ垜浠皢妗嗘灦灞備唬鐮佹浛鎹负寮鍙戦樁娈电殑浠g爜鏉ヨ繘琛屾棩甯告鏋惰凯浠c
*
* **鍒犻櫎妗嗘灦灞**
*
* ```
* rm -rf ./vendor/hunzhiwange/framework
* ```
*
* **鍏嬮殕妗嗘灦灞傚紑鍙戝簱**
*
* ```
* $cd /data/codes/test
* $git clone git@github.com:hunzhiwange/framework.git ./vendor/hunzhiwange/framework
* cd ./vendor/hunzhiwange/framework
* ```
*
* **Composer 瀹夎**
*
* ```
* composer install
* ```
*
* > 濡傛灉浣犵數鑴戞病鏈夊畨瑁 `composer`锛岄偅涔堝凡缁忎负浣犱笅杞戒竴涓増鏈
*
* ```
* sudo chmod 777 ./build/composer
* ./build/composer install
* ```
*
* 瀹夎杩囩▼
*
* ```
* Cloning into './vendor/hunzhiwange/framework'...
* remote: Enumerating objects: 382, done.
* remote: Counting objects: 100% (382/382), done.
* remote: Compressing objects: 100% (218/218), done.
* remote: Total 39304 (delta 196), reused 262 (delta 125), pack-reused 38922
* Receiving objects: 100% (39304/39304), 14.49 MiB | 12.00 KiB/s, done.
* Resolving deltas: 100% (27594/27594), done.
* ```
*
* **娴嬭瘯鏄惁瀹夎鎴愬姛**
*
* 浠庢柊璁块棶棣栭〉锛屽鏋滃彲浠ヨ闂紝閭d箞鎭枩浣犵涓闃舵鍗冲畨瑁呭畬姣曘
* ",
* zh-CN:note="",
* lang="shell",
* )
*/
public function doc6(): void
{
<<<'EOT'
php leevel server <Visite http://127.0.0.1:9527/>
EOT;
}
/**
* @api(
* zh-CN:title="杩愯妗嗘灦鏍稿績娴嬭瘯鐢ㄤ緥",
* zh-CN:description="
* QueryPHP 搴曞眰妗嗘灦鎷ユ湁 3000 澶氫緥娴嬭瘯鐢ㄤ緥锛岃繖浜涙祴璇曠敤渚嬮渶瑕佽缁存姢锛屾墍浠ヨ繖閲岄渶瑕佹湰鍦板紑鍙戣窇閫氭祴璇曠敤渚嬨
*
* **棣栧厛鍒涘缓涓涓暟鎹簱**
*
* 鍙互鐢 Navicat For Mysql 鍒涘缓涓涓暟鎹簱 `test`.
*
* ```
* CREATE DATABASE IF NOT EXISTS test DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
* ```
*
* **澶嶅埗涓浠介厤缃枃浠跺苟淇敼**
*
* ```
* cp ./tests/config.php ./tests/config.local.php
* ```
*
* 淇敼涓
*
* ```php
* <?php
*
* $GLOBALS['LEEVEL_ENV']['DATABASE']['MYSQL'] = [
* 'HOST' => '127.0.0.1',
* 'PORT' => 3306,
* 'NAME' => 'test',
* 'USER' => 'root',
* 'PASSWORD' => '123456',
* ];
*
* $GLOBALS['LEEVEL_ENV']['CACHE']['REDIS'] = [
* 'HOST' => '127.0.0.1',
* 'PORT' => 6380,
* 'PASSWORD' => '123456',
* ];
*
* $GLOBALS['LEEVEL_ENV']['SESSION']['REDIS'] = [
* 'HOST' => '127.0.0.1',
* 'PORT' => 6380,
* 'PASSWORD' => '123456',
* ];
* ```
*
* **鎵ц鏁版嵁搴撹縼绉诲懡浠**
*
* ```
* php vendor/bin/phinx migrate
* ```
*
* 瀹夎杩囩▼
*
* ```
* Phinx by CakePHP - https://phinx.org. 0.9.2
*
* using config file ./phinx.php
* using config parser php
* using migration paths
* - /data/codes/test/queryphp/vendor/hunzhiwange/framework/tests/assert/database/migrations
* using seed paths
* - /data/codes/test/queryphp/vendor/hunzhiwange/framework/tests/assert/database/seeds
* warning no environment specified, defaulting to: development
* using adapter mysql
* using database test
*
* == 20181010111946 User: migrating
* == 20181010111946 User: migrated 0.0076s
*
* == 20181011111926 Post: migrating
* == 20181011111926 Post: migrated 0.0101s
*
* == 20181011111937 Comment: migrating
* == 20181011111937 Comment: migrated 0.0106s
*
* == 20181011151247 PostContent: migrating
* == 20181011151247 PostContent: migrated 0.0087s
*
* == 20181011160957 Role: migrating
* == 20181011160957 Role: migrated 0.0078s
*
* == 20181011161035 UserRole: migrating
* == 20181011161035 UserRole: migrated 0.0100s
*
* == 20181031094608 CompositeId: migrating
* == 20181031094608 CompositeId: migrated 0.0094s
*
* == 20181107044153 GuestBook: migrating
* == 20181107044153 GuestBook: migrated 0.0086s
*
* == 20190424055915 TestUnique: migrating
* == 20190424055915 TestUnique: migrated 0.0133s
*
* All Done. Took 0.1179s
* ```
*
* **杩愯娴嬭瘯鐢ㄤ緥**
*
* ```
* php ./build/phpunit
* ```
*
* 缁撴灉
*
* > 娉ㄦ剰闅忕潃绯荤粺婕旇繘锛屾祴璇曠敤渚嬩細澧炲姞锛岃緭鍑虹粨鏋滃氨鏈夋墍涓嶅悓銆
*
* ",
* zh-CN:note="",
* lang="html",
* )
*/
public function doc7(): void
{
<<<'EOT'
PHPUnit 8.1.3 by Sebastian Bergmann and contributors.
==> Tests\Auth\HashTest 鉁 鉁
==> Tests\Auth\ManagerTest 鉁 鉁 鉁
==> Tests\Auth\Middleware\AuthTest 鉁 鉁
==> Tests\Auth\Provider\RegisterTest 鉁
==> Tests\Auth\SessionTest 鉁 鉁
...
==> Tests\View\Compiler\CompilerWhileTest 鉁 鉁
==> Tests\View\HtmlTest 鉁 鉁 鉁 鉁 鉁 鉁 鉁 鉁 鉁
==> Tests\View\ManagerTest 鉁
==> Tests\View\PhpuiTest 鉁 鉁 鉁 鉁 鉁 鉁 鉁 鉁
==> Tests\View\Provider\RegisterTest 鉁
Time: 19.51 seconds, Memory: 93.19 MB
Tests: 2978, Assertions: 10031, Failures: 0, Skipped: 6.
EOT;
}
/**
* @api(
* zh-CN:title="缁熶竴妗嗘灦鏍稿績鍥㈤槦浠g爜椋庢牸",
* zh-CN:description="
* 椋庢牸缁熶竴瀵逛繚璇佹垜浠郴缁熶竴鑷存ч潪甯搁噸瑕侊紝鎴戜滑鍋氬埌寮绠卞嵆鐢紝鏍稿績搴撳彧鍖呭惈 PHP 鏂囦欢銆
*
* **浣跨敤 Git 閽╁瓙**
*
* ```
* cp ./build/pre-commit.sh ./.git/hooks/pre-commit
* chmod 777 ./.git/hooks/pre-commit
* ```
*
* **娴嬭瘯鑷姩鍖栨牸寮**
*
* `tests/Name.php`
*
* ``` php
* <?php
*
* declare(strict_types=1);
*
* namespace Test;
*
* class Name{
* public function demo($a=1, $b=4){
* echo 1;
* }
* }
* ```
*
* **Git 鎻愪氦娴嬭瘯鏍煎紡鍖**
*
* ```
* git add .
* git commit -m '娴嬭瘯鏍煎紡鍖'
* ```
*
* 杩愯杩囩▼
* ",
* zh-CN:note="",
* lang="shell",
* )
*/
public function doc8(): void
{
<<<'EOT'
Checking PHP Lint...
No syntax errors detected in tests/Name.php
Running Code Sniffer...
Loaded config default from ".php_cs.dist".
Paths from configuration file have been overridden by paths provided as command arguments.
1) tests/Name.php Fixed all files in 0.009 seconds, 12.000 MB memory used
The file has been automatically formatted.
[master 20f2f845] 娴嬭瘯鏍煎紡鍖
2 files changed, 29 insertions(+)
mode change 100644 => 100755 build/composer
create mode 100644 tests/Name.php
EOT;
}
/**
* @api(
* zh-CN:title="鏍煎紡鍖栧悗鐨 PHP",
* zh-CN:description="
* 浠g爜骞插噣婕備寒浜嗕笉灏戯紝涓嶆槸鍚椼
*
* 娴嬭瘯浠g爜鍥炴粴璇疯涓婇潰鐨勬柟娉曪紝璋㈣阿銆
* ",
* level="###",
* )
*/
public function doc8_1(): void
{
<<<'EOT'
<?php
declare(strict_types=1);
namespace Test;
class Name
{
public function demo($a = 1, $b = 4)
{
echo 1;
}
}
EOT;
}
/**
* @api(
* zh-CN:title="鍏嬮殕 `queryphp.com` 浠撳簱瀹炵幇鑷姩鍖栨枃妗f惌寤",
* zh-CN:description="
* QueryPHP 搴曞眰鐨勬枃妗e熀浜庡崟鍏冩祴璇曞姞澶囨敞鐨勬柟寮忔潵瀹炵幇鐨勶紝閫氳繃鍛藉悕宸ュ叿鍏ㄩ儴閲囩敤鑷姩鍖栫敓鎴 Markdown锛岃繖澶у箙搴︾畝鍖栦簡鏂囨。鐨勭紪鍐欏伐浣滐紝鍚屾椂淇濊瘉浜嗘枃妗e疄鏃舵с
*
* **瀹樻柟鏂囨。閲囩敤 VuePress 璇诲彇 Markdown 鏉ュ疄鐜扮殑**
*
* ```
* $cd /data/codes/test
* $git clone git@github.com:hunzhiwange/queryphp.com.git
* ```
*
* **淇敼鏂囨。宸ュ叿鐢熸垚 Markdown 鐨勮矾寰**
*
* ```
* $cd /data/codes/test/queryphp
* $vim .env
*
* # 淇敼璺緞
* FRAMEWORK_DOC_OUTPUTDIR = "/data/codes/test/queryphp.com/docs/docs/"
* ```
*
* **鐢熸垚鏂囨。**
*
* ```
* $cd /data/codes/test/queryphp
* $php leevel make:docwithin tests
* ```
*
* 杩愯杩囩▼
*
* ```
* Class Tests\Encryption\EncryptionTest was generate succeed.
* Class Tests\Encryption\HelperTest was generate succeed.
* Class Tests\Database\ManagerTest was generate succeed.
* Class Tests\Database\Ddd\UnitOfWorkTest was generate succeed.
* Class Tests\Database\Ddd\Create\CreateTest was generate succeed.
* Class Tests\Database\Query\AggregateTest was generate succeed.
* Class Tests\Validate\AssertTest was generate succeed.
* Class Tests\Di\ContainerTest was generate succeed.
* Class Tests\Docs\BecomeAQueryphpDeveloperDoc was generate succeed.
* Class Tests\Support\FnTest was generate succeed.
* Class Tests\Support\StrTest was generate succeed.
* Class Tests\Support\ArrTest was generate succeed.
* Class Tests\View\SummaryDoc was generate succeed.
* Class Tests\View\Compiler\CompilerAssignTest was generate succeed.
* Class Tests\View\Compiler\CompilerPhpTest was generate succeed.
* Class Tests\View\Compiler\CompilerBreakTest was generate succeed.
* Class Tests\View\Compiler\CompilerIncludeTest was generate succeed.
* Class Tests\View\Compiler\CompilerTagselfTest was generate succeed.
* Class Tests\View\Compiler\CompilerWhileTest was generate succeed.
* Class Tests\View\Compiler\CompilerCssTest was generate succeed.
* Class Tests\View\Compiler\CompilerForTest was generate succeed.
* Class Tests\View\Compiler\CompilerVarTest was generate succeed.
* Class Tests\View\Compiler\CompilerListTest was generate succeed.
* Class Tests\Debug\DebugTest was generate succeed.
* A total of 24 files generate succeed.
* ```
*
* **淇敼鏂囨。鑿滃崟**
*
* ```
* $vim docs/.vuepress/config.js
* ```
*
* **杩愯鏈湴鏂囨。缃戠珯**
*
* 璁块棶鍦板潃 `localhost:8088` 鍗冲彲銆
*
* ```
* $npm install -g yarn
* $yarn add -D vuepress # or npm install -D vuepress
* $yarn run dev # or npx vuepress dev docs
* ```
* ",
* )
*/
public function doc9(): void
{
}
/**
* @api(
* zh-CN:title="缁撳熬",
* zh-CN:description="鍒拌繖閲屼负姝紝鎴戜滑鏈湴寮鍙戠幆澧冨凡缁忓叏閮ㄦ惌寤哄畬姣曪紝鍙互鎰夊揩鍦板紑鍙戜簡銆",
* zh-CN:note="鍊煎緱娉ㄦ剰鐨勬槸锛屾垜浠氬父鍦 `dev` 鍒嗘敮寮鍙戯紝寮鍙戝畬姣曞悗 `merge` 鍒 `master` 鍒嗘敮瀹屾垚寮鍙戙",
* )
*/
public function doc10(): void
{
}
}