@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var $type |
| 16 | 16 | */ |
| 17 | - public $type='event'; |
|
| 17 | + public $type = 'event'; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var bool |
@@ -31,22 +31,22 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * @var $commandRule |
| 33 | 33 | */ |
| 34 | - protected $commandRule=[]; |
|
| 34 | + protected $commandRule = []; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @method create |
| 38 | 38 | * @return mixed |
| 39 | 39 | */ |
| 40 | - public function generate(){
|
|
| 40 | + public function generate() {
|
|
| 41 | 41 | |
| 42 | - $this->argument['source']=StaticPathList::$events; |
|
| 43 | - $this->argument['sourcelisten']=StaticPathList::$listeners; |
|
| 42 | + $this->argument['source'] = StaticPathList::$events; |
|
| 43 | + $this->argument['sourcelisten'] = StaticPathList::$listeners; |
|
| 44 | 44 | |
| 45 | - $this->argument['eventNamespace']=app()->namespace()->optionalEvents().''; |
|
| 46 | - $this->argument['listenNamespace']=app()->namespace()->optionalListeners().''; |
|
| 47 | - $this->argument['subscriberNamespace']=app()->namespace()->optionalSubscribers().''; |
|
| 45 | + $this->argument['eventNamespace'] = app()->namespace()->optionalEvents().''; |
|
| 46 | + $this->argument['listenNamespace'] = app()->namespace()->optionalListeners().''; |
|
| 47 | + $this->argument['subscriberNamespace'] = app()->namespace()->optionalSubscribers().''; |
|
| 48 | 48 | |
| 49 | - $eventDispatchers=app()->resolve(ClosureDispatcher::class,['bind'=>app()['eventDispatcher']])->call(function(){
|
|
| 49 | + $eventDispatchers = app()->resolve(ClosureDispatcher::class, ['bind'=>app()['eventDispatcher']])->call(function() {
|
|
| 50 | 50 | return [ |
| 51 | 51 | 'listen' => $this->listen, |
| 52 | 52 | 'subscriber' => $this->subscribe |
@@ -54,40 +54,40 @@ discard block |
||
| 54 | 54 | }); |
| 55 | 55 | |
| 56 | 56 | |
| 57 | - $this->directory['eventsDir']=path()->optionalEvents(); |
|
| 58 | - $this->directory['eventsListenDir']=path()->optionalListeners(); |
|
| 59 | - $this->directory['eventsListenSubscriberDir']=path()->optionalSubscribers(); |
|
| 57 | + $this->directory['eventsDir'] = path()->optionalEvents(); |
|
| 58 | + $this->directory['eventsListenDir'] = path()->optionalListeners(); |
|
| 59 | + $this->directory['eventsListenSubscriberDir'] = path()->optionalSubscribers(); |
|
| 60 | 60 | |
| 61 | 61 | //set project directory |
| 62 | 62 | $this->file->makeDirectory($this); |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - foreach ($eventDispatchers['listen'] as $event=>$listens){
|
|
| 66 | + foreach ($eventDispatchers['listen'] as $event=>$listens) {
|
|
| 67 | 67 | |
| 68 | 68 | |
| 69 | - $this->argument['eventMain']=ucfirst($event); |
|
| 69 | + $this->argument['eventMain'] = ucfirst($event); |
|
| 70 | 70 | |
| 71 | - $this->argument['eventKeyNamespace']=app()->namespace()->optionalEvents().'\\'.$this->argument['eventMain']; |
|
| 71 | + $this->argument['eventKeyNamespace'] = app()->namespace()->optionalEvents().'\\'.$this->argument['eventMain']; |
|
| 72 | 72 | |
| 73 | - $mainFile=$this->directory['eventsDir'].'/'.ucfirst($event).'.php'; |
|
| 73 | + $mainFile = $this->directory['eventsDir'].'/'.ucfirst($event).'.php'; |
|
| 74 | 74 | |
| 75 | - if(!file_exists($mainFile)){
|
|
| 76 | - $this->touch['event/main']=$mainFile; |
|
| 75 | + if (!file_exists($mainFile)) {
|
|
| 76 | + $this->touch['event/main'] = $mainFile; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | //set project touch |
| 80 | 80 | $this->file->touch($this); |
| 81 | 81 | |
| 82 | 82 | |
| 83 | - foreach ($listens as $listen){
|
|
| 83 | + foreach ($listens as $listen) {
|
|
| 84 | 84 | |
| 85 | - $listenFile=$this->directory['eventsListenDir'].'/'.ucfirst($listen).'.php'; |
|
| 85 | + $listenFile = $this->directory['eventsListenDir'].'/'.ucfirst($listen).'.php'; |
|
| 86 | 86 | |
| 87 | - $this->argument['eventListen']=ucfirst($listen); |
|
| 87 | + $this->argument['eventListen'] = ucfirst($listen); |
|
| 88 | 88 | |
| 89 | - if(!file_exists($listenFile)){
|
|
| 90 | - $this->touch['event/listen']=$listenFile; |
|
| 89 | + if (!file_exists($listenFile)) {
|
|
| 90 | + $this->touch['event/listen'] = $listenFile; |
|
| 91 | 91 | |
| 92 | 92 | //set project touch |
| 93 | 93 | $this->file->touch($this); |
@@ -99,16 +99,16 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - foreach ($eventDispatchers['subscriber'] as $subscriber){
|
|
| 102 | + foreach ($eventDispatchers['subscriber'] as $subscriber) {
|
|
| 103 | 103 | |
| 104 | - $eventSubscriberName=''.ucfirst($subscriber); |
|
| 104 | + $eventSubscriberName = ''.ucfirst($subscriber); |
|
| 105 | 105 | |
| 106 | - $subscriberFile=$this->directory['eventsListenSubscriberDir'].'/'.$eventSubscriberName.'.php'; |
|
| 106 | + $subscriberFile = $this->directory['eventsListenSubscriberDir'].'/'.$eventSubscriberName.'.php'; |
|
| 107 | 107 | |
| 108 | - $this->argument['eventSubscriber']=$eventSubscriberName; |
|
| 108 | + $this->argument['eventSubscriber'] = $eventSubscriberName; |
|
| 109 | 109 | |
| 110 | - if(!file_exists($subscriberFile)){
|
|
| 111 | - $this->touch['event/subscriber']=$subscriberFile; |
|
| 110 | + if (!file_exists($subscriberFile)) {
|
|
| 111 | + $this->touch['event/subscriber'] = $subscriberFile; |
|
| 112 | 112 | |
| 113 | 113 | //set project touch |
| 114 | 114 | $this->file->touch($this); |