@@ -117,7 +117,7 @@ |
||
117 | 117 | /** |
118 | 118 | * check exists |
119 | 119 | * |
120 | - * @return bool |
|
120 | + * @return boolean|null |
|
121 | 121 | */ |
122 | 122 | public function exists() |
123 | 123 | { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $disk = $disk ?: $this->distributor->allot($uploaded); |
207 | 207 | $user = $user ?: $this->auth->user(); |
208 | 208 | |
209 | - if (!$this->files->store(file_get_contents($uploaded->getPathname()), $path . '/' . $name, $disk)) { |
|
209 | + if (!$this->files->store(file_get_contents($uploaded->getPathname()), $path.'/'.$name, $disk)) { |
|
210 | 210 | throw new WritingFailException; |
211 | 211 | } |
212 | 212 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $disk = $disk ?: $this->distributor->allot($tempFile); |
246 | 246 | $user = $user ?: $this->auth->user(); |
247 | 247 | |
248 | - if (!$this->files->store($content, $path . '/' . $name, $disk)) { |
|
248 | + if (!$this->files->store($content, $path.'/'.$name, $disk)) { |
|
249 | 249 | throw new WritingFailException; |
250 | 250 | } |
251 | 251 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | header('Expires: 0'); |
295 | 295 | header('Cache-Control: must-revalidate'); |
296 | 296 | header('Pragma: public'); |
297 | - header('Content-Length: ' . $file->size); |
|
297 | + header('Content-Length: '.$file->size); |
|
298 | 298 | |
299 | 299 | file_put_contents('php://output', $file->getContent()); |
300 | 300 | } |
@@ -404,9 +404,9 @@ discard block |
||
404 | 404 | |
405 | 405 | $path = trim($path, '/'); |
406 | 406 | if (empty($path) !== true) { |
407 | - $path = $path . '/'; |
|
407 | + $path = $path.'/'; |
|
408 | 408 | } |
409 | - return $path . $dividePath; |
|
409 | + return $path.$dividePath; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | */ |
418 | 418 | private function makeFilename($clientname) |
419 | 419 | { |
420 | - return date('YmdHis') . hash('sha1', $clientname); |
|
420 | + return date('YmdHis').hash('sha1', $clientname); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | |
442 | 442 | $array = []; |
443 | 443 | foreach ($rows as $row) { |
444 | - $row = (array)$row; |
|
444 | + $row = (array) $row; |
|
445 | 445 | $array[$row['mime']] = $row['amount']; |
446 | 446 | } |
447 | 447 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | $array = []; |
471 | 471 | foreach ($rows as $row) { |
472 | - $row = (array)$row; |
|
472 | + $row = (array) $row; |
|
473 | 473 | $array[$row['mime']] = $row['cnt']; |
474 | 474 | } |
475 | 475 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | * @param UserInterface $user |
48 | 48 | * @param array $data |
49 | 49 | * |
50 | - * @return EmailInterface |
|
50 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
51 | 51 | */ |
52 | 52 | public function create(UserInterface $user, array $data) |
53 | 53 | { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param UserInterface $user |
47 | 47 | * @param array $data |
48 | 48 | * |
49 | - * @return AccountInterface |
|
49 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
50 | 50 | */ |
51 | 51 | public function create(UserInterface $user, array $data) |
52 | 52 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @param string $userId user id |
62 | 62 | * |
63 | - * @return array |
|
63 | + * @return \Illuminate\Database\Eloquent\Collection |
|
64 | 64 | */ |
65 | 65 | public function findByUserId($userId) |
66 | 66 | { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param UserInterface $user |
48 | 48 | * @param array $data |
49 | 49 | * |
50 | - * @return EmailInterface |
|
50 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
51 | 51 | */ |
52 | 52 | public function create(UserInterface $user, array $data) |
53 | 53 | { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @param $userId |
93 | 93 | * |
94 | - * @return EmailInterface[] |
|
94 | + * @return \Illuminate\Database\Eloquent\Collection |
|
95 | 95 | */ |
96 | 96 | public function findByUserId($userId) |
97 | 97 | { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @param array $data |
46 | 46 | * |
47 | - * @return UserInterface |
|
47 | + * @return \Xpressengine\Database\Eloquent\DynamicModel |
|
48 | 48 | */ |
49 | 49 | public function create(array $data) |
50 | 50 | { |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @param string $emailPrefix 조회할 이메일의 이름영역 |
104 | 104 | * @param string[]|null $with 함께 반환할 relation 정보 |
105 | 105 | * |
106 | - * @return UserInterface[] |
|
106 | + * @return \Illuminate\Database\Eloquent\Collection |
|
107 | 107 | */ |
108 | 108 | public function searchByEmailPrefix($emailPrefix, $with = null) |
109 | 109 | { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $user = $this->query()->whereHas( |
80 | 80 | 'emails', |
81 | - function ($q) use ($address) { |
|
81 | + function($q) use ($address) { |
|
82 | 82 | $q->where('address', $address); |
83 | 83 | } |
84 | 84 | )->first(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $users = $this->query()->whereHas( |
100 | 100 | 'emails', |
101 | - function ($q) use ($emailPrefix) { |
|
101 | + function($q) use ($emailPrefix) { |
|
102 | 102 | $q->where('address', 'like', $emailPrefix.'@%'); |
103 | 103 | } |
104 | 104 | )->get(); |
@@ -315,6 +315,9 @@ |
||
315 | 315 | ]; |
316 | 316 | } |
317 | 317 | |
318 | + /** |
|
319 | + * @param string $methodName |
|
320 | + */ |
|
318 | 321 | private function invokeMethod(&$object, $methodName, array $parameters = array()) |
319 | 322 | { |
320 | 323 | $reflection = new \ReflectionClass(get_class($object)); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ->shouldAllowMockingProtectedMethods(); |
70 | 70 | |
71 | 71 | $instance->shouldReceive('find')->once()->with('plugin.dummy', 'default')->andReturnNull(); |
72 | - $instance->shouldReceive('setAncestor')->once()->with(m::on(function ($permission) { |
|
72 | + $instance->shouldReceive('setAncestor')->once()->with(m::on(function($permission) { |
|
73 | 73 | return $permission instanceof Permission; |
74 | 74 | })); |
75 | 75 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $repo->shouldReceive('findByName')->once()->with('default', 'plugin.dummy')->andReturnNull(); |
97 | 97 | $repo->shouldReceive('fetchAncestor')->once()->andReturn([$mockParent]); |
98 | - $repo->shouldReceive('insert')->once()->with(m::on(function ($value) { |
|
98 | + $repo->shouldReceive('insert')->once()->with(m::on(function($value) { |
|
99 | 99 | return $value instanceof Permission; |
100 | 100 | }))->andReturn($mockPermission); |
101 | 101 |
@@ -57,11 +57,21 @@ |
||
57 | 57 | |
58 | 58 | class SamplePolicy extends Policy |
59 | 59 | { |
60 | + /** |
|
61 | + * @param m\MockInterface $user |
|
62 | + * @param string $name |
|
63 | + * @param string $siteKey |
|
64 | + */ |
|
60 | 65 | public function update($user, $name, $siteKey) |
61 | 66 | { |
62 | 67 | return $this->check($user, $this->get($name, $siteKey), 'update'); |
63 | 68 | } |
64 | 69 | |
70 | + /** |
|
71 | + * @param m\MockInterface $user |
|
72 | + * @param string $name |
|
73 | + * @param string $siteKey |
|
74 | + */ |
|
65 | 75 | public function read($user, $name, $siteKey) |
66 | 76 | { |
67 | 77 | return $this->check($user, $this->get($name, $siteKey), 'read'); |
@@ -315,6 +315,9 @@ |
||
315 | 315 | ]; |
316 | 316 | } |
317 | 317 | |
318 | + /** |
|
319 | + * @param string $methodName |
|
320 | + */ |
|
318 | 321 | private function invokeMethod(&$object, $methodName, array $parameters = array()) |
319 | 322 | { |
320 | 323 | $reflection = new \ReflectionClass(get_class($object)); |
@@ -15,7 +15,6 @@ |
||
15 | 15 | namespace Xpressengine\Tests\Menu; |
16 | 16 | |
17 | 17 | use PHPUnit_Framework_TestCase; |
18 | -use Mockery as m; |
|
19 | 18 | use Xpressengine\Menu\MenuType\DirectLink; |
20 | 19 | |
21 | 20 | /** |