Skip to content

Commit

Permalink
fix lib
Browse files Browse the repository at this point in the history
  • Loading branch information
lidanyang committed May 27, 2019
1 parent cc6ad6b commit 2058628
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
*.iml
out
gen
vendor/
composer.lock
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"esd/base-server":"~0.1",
"esd/esd-core":"~0.1",
"esd/annotations-scan-plugin": "~0.1",
"inhere/php-validate": "^2.6"
},
Expand Down
3 changes: 1 addition & 2 deletions src/Validate/Annotation/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use DI\DependencyException;
use Doctrine\Common\Annotations\Annotation;
use Doctrine\Common\Annotations\CachedReader;
use ESD\BaseServer\Server\Server;
use Inhere\Validate\Filter\Filtration;
use ReflectionClass;

Expand Down Expand Up @@ -194,7 +193,7 @@ public static function buildRole($reflectionClass)
}
$filterRole = [];
foreach ($reflectionClass->getProperties() as $property) {
$filters = Server::$instance->getContainer()->get(CachedReader::class)->getPropertyAnnotations($property);
$filters = DIget(CachedReader::class)->getPropertyAnnotations($property);
foreach ($filters as $filter) {
if ($filter instanceof Filter) {
$one = $filter->build($property->name);
Expand Down
4 changes: 2 additions & 2 deletions src/Validate/Annotation/Validated.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use DI\DependencyException;
use Doctrine\Common\Annotations\Annotation;
use Doctrine\Common\Annotations\CachedReader;
use ESD\BaseServer\Server\Server;
use ESD\Core\Server\Server;
use ESD\Plugins\Validate\ValidationException;
use Inhere\Validate\Validation;
use ReflectionClass;
Expand Down Expand Up @@ -398,7 +398,7 @@ public static function buildRole($reflectionClass, $roles = [])
}
$validRole = [];
foreach ($reflectionClass->getProperties() as $property) {
$validateds = Server::$instance->getContainer()->get(CachedReader::class)->getPropertyAnnotations($property);
$validateds = DIget(CachedReader::class)->getPropertyAnnotations($property);
foreach ($validateds as $validated) {
if ($validated instanceof Validated) {
foreach ($validated->build($property->name) as $one) {
Expand Down
10 changes: 4 additions & 6 deletions src/Validate/ValidatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
namespace ESD\Plugins\Validate;


use ESD\BaseServer\Server\Context;
use ESD\BaseServer\Server\PlugIn\AbstractPlugin;
use ESD\BaseServer\Server\PlugIn\PluginInterfaceManager;
use ESD\Core\Context\Context;
use ESD\Core\Plugin\AbstractPlugin;
use ESD\Core\Plugin\PluginInterfaceManager;
use ESD\Plugins\AnnotationsScan\AnnotationsScanPlugin;
use ESD\Plugins\Validate\Annotation\Validated;

Expand All @@ -32,7 +32,7 @@ public function __construct()
* @param PluginInterfaceManager $pluginInterfaceManager
* @return mixed|void
* @throws \DI\DependencyException
* @throws \ESD\BaseServer\Exception
* @throws \ESD\Core\Exception
* @throws \ReflectionException
*/
public function onAdded(PluginInterfaceManager $pluginInterfaceManager)
Expand All @@ -53,7 +53,6 @@ public function getName(): string
/**
* 初始化
* @param Context $context
* @return mixed
*/
public function beforeServerStart(Context $context)
{
Expand All @@ -63,7 +62,6 @@ public function beforeServerStart(Context $context)
/**
* 在进程启动前
* @param Context $context
* @return mixed
*/
public function beforeProcessStart(Context $context)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Validate/ValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace ESD\Plugins\Validate;


use ESD\BaseServer\Exception;
use ESD\Core\Exception;
use Throwable;

class ValidationException extends Exception
Expand Down

0 comments on commit 2058628

Please sign in to comment.