@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * Returns all route items |
76 | 76 | * |
77 | - * @return InstanceRoute[] |
|
77 | + * @return \Illuminate\Database\Eloquent\Collection |
|
78 | 78 | */ |
79 | 79 | public function all() |
80 | 80 | { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * Retrieve routes by site key |
113 | 113 | * |
114 | 114 | * @param string $siteKey site key |
115 | - * @return InstanceRoute[] |
|
115 | + * @return \Illuminate\Database\Eloquent\Collection |
|
116 | 116 | */ |
117 | 117 | public function fetchBySiteKey($siteKey) |
118 | 118 | { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * Retrieve routes by module name |
126 | 126 | * |
127 | 127 | * @param string $module module name |
128 | - * @return InstanceRoute[] |
|
128 | + * @return \Illuminate\Database\Eloquent\Collection |
|
129 | 129 | */ |
130 | 130 | public function fetchByModule($module) |
131 | 131 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * runComposer |
70 | 70 | * |
71 | - * @param $path |
|
71 | + * @param string $path |
|
72 | 72 | * @param $command |
73 | 73 | * |
74 | 74 | * @return int |
@@ -82,6 +82,10 @@ discard block |
||
82 | 82 | $output = $this->output; |
83 | 83 | |
84 | 84 | return $process->run( |
85 | + |
|
86 | + /** |
|
87 | + * @param string $type |
|
88 | + */ |
|
85 | 89 | function ($type, $line) use ($output) { |
86 | 90 | $output->write($line); |
87 | 91 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $this->info(PHP_EOL."Running 'composer $command'.".PHP_EOL); |
53 | 53 | |
54 | - if($this->runComposer(base_path(), $command) !== 0) { |
|
54 | + if ($this->runComposer(base_path(), $command) !== 0) { |
|
55 | 55 | throw new \Exception('Plugin Installation was faild.'); |
56 | 56 | } |
57 | 57 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $activate = $this->option('activate'); |
61 | 61 | |
62 | - if($activate) { |
|
62 | + if ($activate) { |
|
63 | 63 | $this->activatePlugin($name); |
64 | 64 | $this->info("Plugin '$name' is activated.".PHP_EOL); |
65 | 65 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $output = $this->output; |
83 | 83 | |
84 | 84 | return $process->run( |
85 | - function ($type, $line) use ($output) { |
|
85 | + function($type, $line) use ($output) { |
|
86 | 86 | $output->write($line); |
87 | 87 | } |
88 | 88 | ); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * fill |
122 | 122 | * |
123 | 123 | * @param array $attributes attributes |
124 | - * @return void |
|
124 | + * @return DynamicModel |
|
125 | 125 | */ |
126 | 126 | public function fill(array $attributes) |
127 | 127 | { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * Xpressengine\Database\Eloquent\Builder 울 사용하도록 변경 |
248 | 248 | * |
249 | 249 | * @param DynamicQuery $query dynamic query builder |
250 | - * @return \Xpressengine\Database\Eloquent\Builder|static |
|
250 | + * @return Builder |
|
251 | 251 | */ |
252 | 252 | public function newEloquentBuilder($query) |
253 | 253 | { |
@@ -102,7 +102,6 @@ |
||
102 | 102 | /** |
103 | 103 | * getRepository |
104 | 104 | * |
105 | - * @param null $model |
|
106 | 105 | * |
107 | 106 | * @return Mockery\MockInterface |
108 | 107 | */ |
@@ -102,7 +102,6 @@ |
||
102 | 102 | /** |
103 | 103 | * getRepository |
104 | 104 | * |
105 | - * @param null $model |
|
106 | 105 | * |
107 | 106 | * @return Mockery\MockInterface |
108 | 107 | */ |
@@ -102,7 +102,6 @@ |
||
102 | 102 | /** |
103 | 103 | * getRepository |
104 | 104 | * |
105 | - * @param null $model |
|
106 | 105 | * |
107 | 106 | * @return Mockery\MockInterface |
108 | 107 | */ |
@@ -102,7 +102,6 @@ |
||
102 | 102 | /** |
103 | 103 | * getRepository |
104 | 104 | * |
105 | - * @param null $model |
|
106 | 105 | * |
107 | 106 | * @return Mockery\MockInterface |
108 | 107 | */ |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | /** |
74 | 74 | * getRepository |
75 | 75 | * |
76 | - * @param null $model |
|
77 | 76 | * |
77 | + * @param Mockery\Mock $users |
|
78 | 78 | * @return VirtualGroupRepository |
79 | 79 | */ |
80 | 80 | protected function makeRepository($users = null, $vGroups = null, $getter = null) |
@@ -114,7 +114,6 @@ discard block |
||
114 | 114 | /** |
115 | 115 | * getRepository |
116 | 116 | * |
117 | - * @param null $model |
|
118 | 117 | * |
119 | 118 | * @return Mockery\MockInterface |
120 | 119 | */ |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | protected function makeRepository($users = null, $vGroups = null, $getter = null) |
81 | 81 | { |
82 | 82 | |
83 | - $vGroups = $vGroups?:[ |
|
83 | + $vGroups = $vGroups ?: [ |
|
84 | 84 | 'facebook' => [ |
85 | 85 | 'title' => 'fb_group' |
86 | 86 | ], |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | 'title' => 'github_group' |
92 | 92 | ], |
93 | 93 | ]; |
94 | - $getter = $getter?:function ($user) { |
|
94 | + $getter = $getter ?: function($user) { |
|
95 | 95 | $providers = []; |
96 | 96 | if ($user->getAccountByProvider('facebook')) { |
97 | 97 | $providers[] = 'facebook'; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | return $providers; |
106 | 106 | }; |
107 | 107 | |
108 | - $users = $users?:$this->makeUsers(); |
|
108 | + $users = $users ?: $this->makeUsers(); |
|
109 | 109 | |
110 | 110 | return new VirtualGroupRepository($users, $vGroups, $getter); |
111 | 111 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $hasher = $this->getHasher(); |
35 | 35 | $hasher->shouldReceive('make')->once()->with('secret')->andReturn('encrypted'); |
36 | 36 | /** @var Mockery\MockInterface $handler */ |
37 | - $handler = $this->getHandlerMock(null,null,null,null,null,null,$hasher); |
|
37 | + $handler = $this->getHandlerMock(null, null, null, null, null, null, $hasher); |
|
38 | 38 | $handler->shouldReceive('validateForCreate')->withAnyArgs()->andReturn(true); |
39 | 39 | |
40 | 40 | $data = [ |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $hasher = $this->getHasher(); |
60 | 60 | $hasher->shouldReceive('make')->once()->with('secret')->andReturn('encrypted'); |
61 | 61 | /** @var Mockery\MockInterface $handler */ |
62 | - $handler = $this->getHandlerMock(null,null,null,null,null,null,$hasher); |
|
62 | + $handler = $this->getHandlerMock(null, null, null, null, null, null, $hasher); |
|
63 | 63 | $handler->shouldReceive('validateForCreate')->withAnyArgs()->andReturn(true); |
64 | 64 | |
65 | 65 | $data = [ |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $hasher = $this->getHasher(); |
98 | 98 | $hasher->shouldReceive('make')->once()->with('secret')->andReturn('encrypted'); |
99 | 99 | /** @var Mockery\MockInterface $handler */ |
100 | - $handler = $this->getHandlerMock(null,null,null,null,null,null,$hasher); |
|
100 | + $handler = $this->getHandlerMock(null, null, null, null, null, null, $hasher); |
|
101 | 101 | $handler->shouldReceive('validateForCreate')->withAnyArgs()->andReturn(true); |
102 | 102 | |
103 | 103 | $data = [ |
@@ -135,23 +135,23 @@ discard block |
||
135 | 135 | $hasher = $this->getHasher(); |
136 | 136 | $hasher->shouldReceive('make')->once()->with('secret')->andReturn('encrypted'); |
137 | 137 | /** @var Mockery\MockInterface $handler */ |
138 | - $handler = $this->getHandlerMock(null,null,null,null,null,null,$hasher); |
|
138 | + $handler = $this->getHandlerMock(null, null, null, null, null, null, $hasher); |
|
139 | 139 | $handler->shouldReceive('validateForCreate')->withAnyArgs()->andReturn(true); |
140 | 140 | |
141 | 141 | $data = [ |
142 | 142 | 'displayName' => 'foo', |
143 | 143 | 'password' => 'secret', |
144 | - 'groupId' => ['bar','baz'] |
|
144 | + 'groupId' => ['bar', 'baz'] |
|
145 | 145 | ]; |
146 | 146 | |
147 | 147 | /** @var Mockery\MockInterface $users */ |
148 | 148 | $users = $handler->users(); |
149 | 149 | $user = $this->makeUser(); |
150 | - $user->shouldReceive('joinGroups')->with(['bar','baz'])->andReturnSelf(); |
|
150 | + $user->shouldReceive('joinGroups')->with(['bar', 'baz'])->andReturnSelf(); |
|
151 | 151 | |
152 | 152 | /** @var Mockery\MockInterface $groups */ |
153 | 153 | $groups = $handler->groups(); |
154 | - $groups->shouldReceive('whereIn')->once()->with('id', ['bar','baz'])->andReturnSelf(); |
|
154 | + $groups->shouldReceive('whereIn')->once()->with('id', ['bar', 'baz'])->andReturnSelf(); |
|
155 | 155 | $groups->shouldReceive('get')->once()->andReturn([]); |
156 | 156 | |
157 | 157 | $users->shouldReceive('create') |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $hasher = $this->getHasher(); |
169 | 169 | $hasher->shouldReceive('make')->once()->with('secret')->andReturn('encrypted'); |
170 | 170 | /** @var Mockery\MockInterface $handler */ |
171 | - $handler = $this->getHandlerMock(null,null,null,null,null,null,$hasher); |
|
171 | + $handler = $this->getHandlerMock(null, null, null, null, null, null, $hasher); |
|
172 | 172 | $handler->shouldReceive('validateForCreate')->withAnyArgs()->andReturn(true); |
173 | 173 | |
174 | 174 | $data = [ |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | |
425 | 425 | /** @var Mockery\MockInterface $accounts */ |
426 | 426 | $accounts = $handler->accounts(); |
427 | - $accounts->shouldReceive('where')->once()->with(['accountId'=>'foo','provider'=>'foo'])->andReturnSelf(); |
|
427 | + $accounts->shouldReceive('where')->once()->with(['accountId'=>'foo', 'provider'=>'foo'])->andReturnSelf(); |
|
428 | 428 | $accounts->shouldReceive('first')->once()->andReturn(true); |
429 | 429 | |
430 | 430 |
@@ -574,6 +574,10 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
577 | + * @param Mockery\MockInterface $users |
|
578 | + * @param Mockery\MockInterface $groups |
|
579 | + * @param Mockery\MockInterface $hasher |
|
580 | + * @param Mockery\MockInterface $validator |
|
577 | 581 | * @return \Xpressengine\User\UserHandler |
578 | 582 | */ |
579 | 583 | private function getHandler( |
@@ -640,7 +644,8 @@ discard block |
||
640 | 644 | } |
641 | 645 | |
642 | 646 | /** |
643 | - * @return \Xpressengine\User\UserHandler |
|
647 | + * @param Mockery\MockInterface $hasher |
|
648 | + * @return Mockery\Mock |
|
644 | 649 | */ |
645 | 650 | private function getHandlerMock( |
646 | 651 | $users = null, |