Skip to content

Commit d237b6b

Browse files
committed
style: run cs fix for all php files
1 parent 71d41b1 commit d237b6b

File tree

135 files changed

+885
-368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+885
-368
lines changed

.php-cs-fixer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
];
3838

3939
$finder = PhpCsFixer\Finder::create()
40-
// ->exclude('test')
4140
->exclude('docs')
4241
->exclude('vendor')
42+
->exclude('resource')
4343
->in(__DIR__);
4444

45-
return PhpCsFixer\Config::create()
45+
return (new PhpCsFixer\Config)
4646
->setRiskyAllowed(true)
4747
->setRules($rules)
4848
->setFinder($finder)

examples/Command/CorCommand.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2018-01-26
6-
* Time: 17:47
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
78
*/
89

910
namespace Inhere\Console\Examples\Command;
@@ -38,7 +39,7 @@ public static function aliases(): array
3839
* @param Input $input
3940
* @param Output $output
4041
*/
41-
protected function execute(Input $input, Output $output)
42+
protected function execute(Input $input, Output $output): void
4243
{
4344
$output->aList([
4445
'support coroutine?' => Helper::isSupportCoroutine() ? 'Y' : 'N',

examples/Command/DemoCommand.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2017-02-27
6-
* Time: 18:58
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
78
*/
89

910
namespace Inhere\Console\Examples\Command;

examples/Command/TestCommand.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2017-02-27
6-
* Time: 18:58
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
78
*/
89

910
namespace Inhere\Console\Examples\Command;
@@ -25,7 +26,7 @@ class TestCommand extends Command
2526
protected function commands(): array
2627
{
2728
return [
28-
'sub' => static function($in, $out) {
29+
'sub' => static function ($in, $out): void {
2930
$out->println('hello, this is an sub command of test.');
3031
},
3132
];
@@ -46,7 +47,7 @@ protected function commands(): array
4647
* @param Input $input
4748
* @param Output $output
4849
*/
49-
public function execute(Input $input, Output $output)
50+
public function execute(Input $input, Output $output): void
5051
{
5152
$output->write('hello, this in ' . __METHOD__);
5253
}

examples/Controller/HomeController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
2+
/**
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
8+
*/
29

310
namespace Inhere\Console\Examples\Controller;
411

@@ -119,7 +126,7 @@ protected function defArgConfigure(): void
119126
$fs->addOptByRule('opt1', "bool;description for the option 'opt1'");
120127

121128
$fs->addArgByRule('name', "string;description for the argument 'name';true");
122-
}
129+
}
123130

124131
// desc set at $this->commandMetas.
125132
public function defArgCommand(FlagsParser $fs): void

examples/Controller/InteractController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2018-12-31
6-
* Time: 14:27
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
78
*/
89

910
namespace Inhere\Console\Examples\Controller;

examples/Controller/ProcessController.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2017-12-22
6-
* Time: 11:44
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
78
*/
89

910
namespace Inhere\Console\Examples\Controller;
@@ -82,7 +83,7 @@ public function runScriptCommand(): void
8283
*/
8384
public function childProcessCommand(): void
8485
{
85-
$ret = ProcessUtil::create(function ($pid) {
86+
$ret = ProcessUtil::create(function ($pid): void {
8687
echo "print in process $pid";
8788

8889
sleep(5);
@@ -99,7 +100,7 @@ public function childProcessCommand(): void
99100
*/
100101
public function daemonRunCommand(): void
101102
{
102-
$ret = ProcessUtil::daemonRun(function ($pid) {
103+
$ret = ProcessUtil::daemonRun(function ($pid): void {
103104
$this->output->info("will running background by new process: $pid");
104105
});
105106

examples/Controller/ShowController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2018-12-31
6-
* Time: 14:27
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
78
*/
89

910
namespace Inhere\Console\Examples\Controller;

examples/commands.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2016/12/7
6-
* Time: 12:46
7-
* @var Inhere\Console\Application $app
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
88
*/
99

1010
use Inhere\Console\BuiltIn\PharController;
@@ -20,7 +20,7 @@
2020
use Inhere\Console\IO\Output;
2121

2222
$app->command(DemoCommand::class);
23-
$app->command('exam', function (Input $in, Output $out) {
23+
$app->command('exam', function (Input $in, Output $out): void {
2424
$cmd = $in->getCommand();
2525

2626
$out->info('hello, this is a test command: ' . $cmd);

examples/demo/cli-spinner.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Created by PhpStorm.
4-
* User: inhere
5-
* Date: 2017-12-21
6-
* Time: 10:02
7-
* @link https://github.com/dealnews/Console
3+
* The file is part of inhere/console
4+
*
5+
* @author https://github.com/inhere
6+
* @homepage https://github.com/inhere/php-console
7+
* @license https://github.com/inhere/php-console/blob/master/LICENSE
88
*/
99

1010
class Status
1111
{
12-
public static function clearLine()
12+
public static function clearLine(): void
1313
{
1414
echo "\033[2K"; // delete the current line
1515
echo "\r"; // return the cursor to the beginning of the line
@@ -20,7 +20,7 @@ public static function clearLine()
2020
*
2121
* .*.
2222
*/
23-
public static function spinner()
23+
public static function spinner(): void
2424
{
2525
static $spinner = 0;
2626
static $mtime = null;
@@ -45,7 +45,7 @@ public static function spinner()
4545
* Uses `stty` to hide input/output completely.
4646
* @param boolean $hidden Will hide/show the next data. Defaults to true.
4747
*/
48-
public static function hide($hidden = true)
48+
public static function hide($hidden = true): void
4949
{
5050
system('stty ' . ($hidden? '-echo' : 'echo'));
5151
}

0 commit comments

Comments
 (0)