Skip to content

Commit

Permalink
fix namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
guanhui07 committed Feb 13, 2023
1 parent dd69de1 commit e7c8a2a
Show file tree
Hide file tree
Showing 104 changed files with 747 additions and 407 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ php artisan test2
```php
<?php declare(strict_types=1);

namespace app\Controller;
namespace App\Controller;

use app\Middleware\AuthMiddleware;
use app\Middleware\TestMiddleware;
use app\Service\TestService;
use dcr\Annotation\Mapping\Middlewares;
use dcr\Annotation\Mapping\RequestMapping;
use App\Middleware\AuthMiddleware;
use App\Middleware\TestMiddleware;
use App\Service\TestService;
use Dcr\Annotation\Mapping\Middlewares;
use Dcr\Annotation\Mapping\RequestMapping;
use DI\Attribute\Inject;

class MIddlewareController extends Controller
Expand Down Expand Up @@ -89,12 +89,12 @@ $redis = Redis::connection();
```php
<?php
declare(strict_types = 1);
namespace app\Model;
namespace App\Model;
use Illuminate\Database\Eloquent\Model;

/**
* Class UserModel
* @package app\Model
* @package App\Model
* @see https://github.com/illuminate/database
*/
class UserModel extends Model
Expand Down Expand Up @@ -144,10 +144,10 @@ class UserModel extends Model
```php
<?php

namespace app\Middleware;
namespace App\Middleware;

use app\Exception\RuntimeException;
use app\Middleware\Contract\MiddlewareInterface;
use App\Exception\RuntimeException;
use App\Middleware\Contract\MiddlewareInterface;

class TestMiddleware implements MiddlewareInterface
{
Expand All @@ -168,7 +168,7 @@ class TestMiddleware implements MiddlewareInterface
<?php
declare(strict_types = 1);

namespace app\Console\Command;
namespace App\Console\Command;

use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
Expand Down Expand Up @@ -207,7 +207,7 @@ class Test extends \Inhere\Console\Command
```php
<?php
declare(strict_types = 1);
namespace app\Event;
namespace App\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
Expand All @@ -233,10 +233,10 @@ class TestEvent extends Event
```php
<?php
declare(strict_types = 1);
namespace app\Listener;
namespace App\Listener;

use app\Event\TestEvent;
use app\Utils\LogBase;
use App\Event\TestEvent;
use App\Utils\LogBase;
use Symfony\Contracts\EventDispatcher\Event;

class TestEventListener implements BaseListenerInterface
Expand Down Expand Up @@ -282,8 +282,8 @@ class TestEventListener implements BaseListenerInterface
### crontab 秒级定时任务 使用的workerman crontab
```php
<?php
namespace app\Crontab;
use app\Crontab\Contract\CrontabInterface;
namespace App\Crontab;
use App\Crontab\Contract\CrontabInterface;
/**
*
* 需要在 /config/crontab.php 配置
Expand Down
4 changes: 2 additions & 2 deletions app/Aspect/DebugAspect.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
declare(strict_types = 1);

namespace app\Aspect;
namespace App\Aspect;

use app\Service\UserService;
use App\Service\UserService;
use Hyperf\Di\Aop\ProceedingJoinPoint;
use Hyperf\Di\Exception\Exception;

Expand Down
4 changes: 2 additions & 2 deletions app/Console/BaseInterface.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types = 1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Console;
namespace App\Console;

interface BaseInterface
{
Expand Down
44 changes: 44 additions & 0 deletions app/Console/Command/ProcessCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
declare(strict_types = 1);
/**
* The file is part of Dcr/framework
*/

namespace App\Console\Command;

use App\Process\TestProcess;
use Dcr\Process\ProcessManager;
use Inhere\Console\Command;
use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
use Toolkit\PFlag\FlagsParser;

/**
* php artisan process
*/
class ProcessCommand extends Command
{
protected static string $name = 'process';

protected static string $desc = 'print system ENV information';

protected function configFlags(FlagsParser $fs): void
{
}

/**
* @param Input $input
* @param Output $output
*
* @throws \DI\DependencyException
* @throws \DI\NotFoundException
* 通过 pcntl_fork 实现 原生支持多进程
*/
protected function execute(Input $input, Output $output): void
{
// pcntl_fork mac、win下面只支持一个 ,linux下支持 多个
// https://www.workerman.net/q/8638 workerman 下也有此问题
$processNum = 3;
di()->get(ProcessManager::class)->run(TestProcess::class,$processNum);
}
}
6 changes: 3 additions & 3 deletions app/Console/Command/Test2Consumer.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
declare(strict_types = 1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Console\Command;
namespace App\Console\Command;

use app\Service\Consumer\BalancePayConsumer;
use App\Service\Consumer\BalancePayConsumer;
use Inhere\Console\Command;
use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Command/TestCommand.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
declare(strict_types = 1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Console\Command;
namespace App\Console\Command;

use Inhere\Console\Command;
use Inhere\Console\IO\Input;
Expand Down
11 changes: 6 additions & 5 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
declare(strict_types = 1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Console;
namespace App\Console;

/**
* 所有的命令类注册 类
* Class Kernel
* @package app\Console
* @package App\Console
*/
class Kernel
{
Expand All @@ -21,8 +21,9 @@ class Kernel
public static function getCommands(): array
{
return [
\app\Console\Command\TestCommand::class,
\app\Console\Command\Test2Consumer::class,
\App\Console\Command\TestCommand::class,
\App\Console\Command\Test2Consumer::class,
\App\Console\Command\ProcessCommand::class,
];
}
}
30 changes: 15 additions & 15 deletions app/Controller/Controller.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php declare(strict_types=1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Controller;

use app\Middleware\Contract\MiddlewareInterface;
use app\Middleware\Kernel;
use app\Model\UserModel;
use app\Traits\BaseRequest;
use app\Utils\Config;
use app\Utils\Enviroment;
use app\Utils\JwtToken;
use app\Utils\Log;
use app\Utils\Redis;
use dcr\Request as DcrRequest;
use dcr\Request\Request;
use dcr\Response\Response;
namespace App\Controller;

use App\Middleware\Contract\MiddlewareInterface;
use App\Middleware\Kernel;
use App\Model\UserModel;
use App\Traits\BaseRequest;
use App\Utils\Config;
use App\Utils\Enviroment;
use App\Utils\JwtToken;
use App\Utils\Log;
use App\Utils\Redis;
use Dcr\Request as DcrRequest;
use Dcr\Request\Request;
use Dcr\Response\Response;
use DI\Attribute\Inject;
use Middlewares\Utils\Dispatcher;
use Exception;
Expand Down
14 changes: 7 additions & 7 deletions app/Controller/IndexController.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php declare(strict_types=1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Controller;
namespace App\Controller;

use app\Middleware\AuthMiddleware;
use app\Middleware\TestMiddleware;
use app\Utils\Mq\MqProducer;
use dcr\Annotation\Mapping\Middlewares;
use dcr\Annotation\Mapping\RequestMapping;
use App\Middleware\AuthMiddleware;
use App\Middleware\TestMiddleware;
use App\Utils\Mq\MqProducer;
use Dcr\Annotation\Mapping\Middlewares;
use Dcr\Annotation\Mapping\RequestMapping;
use Exception;

class IndexController extends Controller
Expand Down
34 changes: 0 additions & 34 deletions app/Controller/MIddlewareController.php

This file was deleted.

8 changes: 4 additions & 4 deletions app/Controller/MqController.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php declare(strict_types=1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Controller;
namespace App\Controller;

use app\Utils\Mq\MqProducer;
use dcr\Annotation\Mapping\RequestMapping;
use App\Utils\Mq\MqProducer;
use Dcr\Annotation\Mapping\RequestMapping;
use Exception;

class MqController extends Controller
Expand Down
32 changes: 16 additions & 16 deletions app/Controller/TestController.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php declare(strict_types=1);
/**
* The file is part of dcr/framework
* The file is part of Dcr/framework
*
*
*/

namespace app\Controller;

use app\Event\TestEvent;
use app\Facade\TestFacade;
use app\Listener\TestEventListener;
use app\Middleware\TestMiddleware;
use app\Model\UserModel;
use app\Service\Entity\ExchGiftInfo;
use app\Service\Entity\TestEntity;
use app\Service\TestService;
use app\Service\UserService;
use app\Utils\JwtToken;
use app\Utils\LogBase;
namespace App\Controller;

use App\Event\TestEvent;
use App\Facade\TestFacade;
use App\Listener\TestEventListener;
use App\Middleware\TestMiddleware;
use App\Model\UserModel;
use App\Service\Entity\ExchGiftInfo;
use App\Service\Entity\TestEntity;
use App\Service\TestService;
use App\Service\UserService;
use App\Utils\JwtToken;
use App\Utils\LogBase;
use Carbon\Carbon;
use dcr\Annotation\Mapping\RequestMapping;
use dcr\EventInstance;
use Dcr\Annotation\Mapping\RequestMapping;
use Dcr\EventInstance;
use DI\Attribute\Inject;
use Exception;
use Gregwar\Captcha\CaptchaBuilder;
Expand Down
Loading

0 comments on commit e7c8a2a

Please sign in to comment.