add cs fixer and PHPStan and activate it (build 436)

This commit is contained in:
crazywhalecc
2022-03-15 18:05:33 +08:00
parent d01bd69aa5
commit 1706afbcd0
163 changed files with 4572 additions and 3588 deletions

View File

@@ -1,21 +1,20 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Target;
/**
* @Annotation
* @Target("METHOD")
* Class OnCloseEvent
* @package ZM\Annotation\Swoole
*/
class OnCloseEvent extends OnSwooleEventBase
{
/**
* @var string
*/
public $connect_type = "default";
}
public $connect_type = 'default';
}

View File

@@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Target;
/**
* @Annotation
* @Target("METHOD")
* @since 2.7.0
*/
class OnManagerStartEvent extends OnSwooleEventBase
{
}

View File

@@ -1,21 +1,20 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Target;
/**
* @Annotation
* @Target("METHOD")
* Class OnMessageEvent
* @package ZM\Annotation\Swoole
*/
class OnMessageEvent extends OnSwooleEventBase
{
/**
* @var string
*/
public $connect_type = "default";
}
public $connect_type = 'default';
}

View File

@@ -1,21 +1,20 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Target;
/**
* @Annotation
* @Target("METHOD")
* Class OnOpenEvent
* @package ZM\Annotation\Swoole
*/
class OnOpenEvent extends OnSwooleEventBase
{
/**
* @var string
*/
public $connect_type = "default";
}
public $connect_type = 'default';
}

View File

@@ -1,16 +1,15 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Required;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
/**
* Class OnPipeMessageEvent
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("METHOD")
*/
@@ -21,4 +20,4 @@ class OnPipeMessageEvent extends AnnotationBase
* @Required()
*/
public $action;
}
}

View File

@@ -1,17 +1,16 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Target;
/**
* @Annotation
* @Target("METHOD")
* Class OnRequestEvent
* @package ZM\Annotation\Swoole
*/
class OnRequestEvent extends OnSwooleEventBase
{
}
}

View File

@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
@@ -8,11 +9,9 @@ use ZM\Annotation\AnnotationBase;
/**
* Class OnSave
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("METHOD")
*/
class OnSave extends AnnotationBase
{
}

View File

@@ -1,15 +1,14 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
/**
* Class ZMSetup
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("METHOD")
*/

View File

@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
@@ -8,7 +9,6 @@ use ZM\Annotation\AnnotationBase;
/**
* Class OnWorkerStart
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("METHOD")
*/

View File

@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
@@ -10,7 +11,6 @@ use Doctrine\Common\Annotations\Annotation\Target;
* Class OnSwooleEvent
* @Annotation
* @Target("METHOD")
* @package ZM\Annotation\Swoole
*/
class OnSwooleEvent extends OnSwooleEventBase
{
@@ -20,17 +20,13 @@ class OnSwooleEvent extends OnSwooleEventBase
*/
public $type;
/**
* @return string
*/
public function getType(): string {
public function getType(): string
{
return $this->type;
}
/**
* @param string $type
*/
public function setType(string $type) {
public function setType(string $type)
{
$this->type = $type;
}
}

View File

@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use ZM\Annotation\AnnotationBase;
use ZM\Annotation\Interfaces\Level;
use ZM\Annotation\Interfaces\Rule;
@@ -13,37 +13,33 @@ abstract class OnSwooleEventBase extends AnnotationBase implements Level, Rule
/**
* @var string
*/
public $rule = "";
public $rule = '';
/**
* @var int
*/
public $level = 20;
/**
* @return string
*/
public function getRule(): string {
return $this->rule !== "" ? $this->rule : true;
public function getRule()
{
return $this->rule !== '' ? $this->rule : true;
}
/**
* @param string $rule
*/
public function setRule(string $rule) {
public function setRule(string $rule)
{
$this->rule = $rule;
}
/**
* @return int
*/
public function getLevel(): int {
public function getLevel(): int
{
return $this->level;
}
/**
* @param int $level
*/
public function setLevel($level) {
public function setLevel($level)
{
$this->level = $level;
}
}
}

View File

@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
@@ -10,7 +11,6 @@ use ZM\Annotation\Interfaces\Rule;
/**
* Class OnTask
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("METHOD")
*/
@@ -25,12 +25,13 @@ class OnTask extends AnnotationBase implements Rule
/**
* @var string
*/
public $rule = "";
public $rule = '';
/**
* @return mixed
*/
public function getRule(): string {
public function getRule(): string
{
return $this->rule;
}
}
}

View File

@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
@@ -7,10 +8,9 @@ use Doctrine\Common\Annotations\Annotation\Target;
/**
* Class OnTaskEvent
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("METHOD")
*/
class OnTaskEvent extends OnSwooleEventBase
{
}
}

View File

@@ -1,16 +1,15 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Required;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
/**
* Class OnTick
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("METHOD")
* @since 1.2

View File

@@ -1,16 +1,15 @@
<?php
declare(strict_types=1);
namespace ZM\Annotation\Swoole;
use Doctrine\Common\Annotations\Annotation\Required;
use Doctrine\Common\Annotations\Annotation\Target;
use ZM\Annotation\AnnotationBase;
/**
* Class SwooleHandler
* @package ZM\Annotation\Swoole
* @Annotation
* @Target("ALL")
*/