@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * XE에서 새로운 request가 생성될 때에는 이 ReqeustFactory는 사용되어 항상 Xpressengine\Http\Request를 생성하도록 한다 |
17 | 17 | */ |
18 | 18 | Request::setFactory( |
19 | - function ( |
|
19 | + function( |
|
20 | 20 | $query, |
21 | 21 | $request, |
22 | 22 | $attributes, |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $app->bind( |
85 | 85 | 'path.public', |
86 | - function () { |
|
86 | + function() { |
|
87 | 87 | return base_path(); |
88 | 88 | } |
89 | 89 | ); |
@@ -33,11 +33,11 @@ |
||
33 | 33 | Thumbnailer::setManager($manager); |
34 | 34 | $instance = new Thumbnailer(); |
35 | 35 | |
36 | - $imageContent = file_get_contents(__DIR__ . '/sample.png'); |
|
36 | + $imageContent = file_get_contents(__DIR__.'/sample.png'); |
|
37 | 37 | $mockCommand = m::mock('Xpressengine\Media\Commands\CommandInterface'); |
38 | 38 | |
39 | 39 | $mockCommand->shouldReceive('getName')->andReturn('letter'); |
40 | - $mockCommand->shouldReceive('setOriginDimension')->once()->with(m::on(function ($object) { |
|
40 | + $mockCommand->shouldReceive('setOriginDimension')->once()->with(m::on(function($object) { |
|
41 | 41 | return $object instanceof Dimension; |
42 | 42 | })); |
43 | 43 | $mockCommand->shouldReceive('getMethod')->andReturn('resize'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $advisorStore = $proxy->getAdvisorCollection(); |
47 | 47 | |
48 | 48 | $advisor1 = new Advisor( |
49 | - 'ad1', 'Xpressengine\Tests\Interception\Document@insertDocument', function ($target, $title, $content) { |
|
49 | + 'ad1', 'Xpressengine\Tests\Interception\Document@insertDocument', function($target, $title, $content) { |
|
50 | 50 | return 'ad1('.$target($title, $content).')'; |
51 | 51 | } |
52 | 52 | ); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $advisor2 = new Advisor( |
56 | 56 | 'ad2', |
57 | 57 | ['Xpressengine\Tests\Interception\Document@insertDocument', 'Xpressengine\Tests\Interception\Document@checkInput'], |
58 | - function ($target, $title, $content) { |
|
58 | + function($target, $title, $content) { |
|
59 | 59 | if ($target->invokedMethod == 'insertDocument') { |
60 | 60 | return 'ad2('.$target($title, $content).')'; |
61 | 61 | } |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | return [$title, $content]; |
67 | 67 | } |
68 | 68 | ); |
69 | - $advisorStore->put($advisor2, ['before'=>['ad1','ad3']]); |
|
69 | + $advisorStore->put($advisor2, ['before'=>['ad1', 'ad3']]); |
|
70 | 70 | |
71 | 71 | $advisor3 = new Advisor( |
72 | 72 | 'ad3', |
73 | 73 | 'Xpressengine\Tests\Interception\Document@checkInput', |
74 | - function ($target, $title, $content) { |
|
74 | + function($target, $title, $content) { |
|
75 | 75 | return ['modified '.$title.' by ad2', 'modified '.$content.' by ad2']; |
76 | 76 | }, |
77 | 77 | 'ad1' |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | new Advisor( |
94 | 94 | 'ad1', |
95 | 95 | 'Xpressengine\Tests\Interception\Document@add', |
96 | - function ($target, $obj) { |
|
96 | + function($target, $obj) { |
|
97 | 97 | $obj->title = 'modified '.$obj->title; |
98 | 98 | return $target($obj); |
99 | 99 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $advisor1 = new Advisor( |
116 | 116 | 'ad1', 'Xpressengine\Tests\Interception\Document@magicMethod', |
117 | - function ($target, $title, $content) { |
|
117 | + function($target, $title, $content) { |
|
118 | 118 | return 'ad1('.$target($title, $content).')'; |
119 | 119 | } |
120 | 120 | ); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | $advisor2 = new Advisor( |
124 | 124 | 'ad2', 'Xpressengine\Tests\Interception\Document@magicMethod', |
125 | - function ($target, $title, $content) { |
|
125 | + function($target, $title, $content) { |
|
126 | 126 | return 'ad2('.$target($title, $content).')'; |
127 | 127 | } |
128 | 128 | ); |
@@ -21,14 +21,14 @@ discard block |
||
21 | 21 | $interceptor->addAdvisor( |
22 | 22 | 'Xpressengine\Tests\Interception\Document@insertDocument', |
23 | 23 | 'ad1', |
24 | - function ($target, $title, $content) { |
|
24 | + function($target, $title, $content) { |
|
25 | 25 | return 'ad1('.$target($title, $content).')'; |
26 | 26 | } |
27 | 27 | ); |
28 | 28 | $interceptor->addAdvisor( |
29 | 29 | ['Xpressengine\Tests\Interception\Document@insertDocument', 'Xpressengine\Tests\Interception\Document@checkInput'], |
30 | 30 | ['ad2' => ['ad1', 'ad3']], |
31 | - function ($target, $title, $content) { |
|
31 | + function($target, $title, $content) { |
|
32 | 32 | if ($target->invokedMethod == 'insertDocument') { |
33 | 33 | return 'ad2('.$target($title, $content).')'; |
34 | 34 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $interceptor->addAdvisor( |
60 | 60 | ['Xpressengine\Tests\Interception\Document@insertDocument', 'Xpressengine\Tests\Interception\Document@checkInput'], |
61 | 61 | ['ad2' => ['ad3']], |
62 | - function ($target, $title, $content) { |
|
62 | + function($target, $title, $content) { |
|
63 | 63 | if ($target->invokedMethod == 'insertDocument') { |
64 | 64 | return 'ad2('.$target($title, $content).')'; |
65 | 65 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $interceptor->addAdvisor( |
75 | 75 | 'Xpressengine\Tests\Interception\Document@insertDocument', |
76 | 76 | ['ad1' => ['after' => 'ad2']], |
77 | - function ($target, $title, $content) { |
|
77 | + function($target, $title, $content) { |
|
78 | 78 | return 'ad1('.$target($title, $content).')'; |
79 | 79 | } |
80 | 80 | ); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | public function testCreate() |
16 | 16 | { |
17 | 17 | $advisor = new Advisor( |
18 | - 'ad1', 'TargetClass@originMethod', function ($target, $args) { |
|
18 | + 'ad1', 'TargetClass@originMethod', function($target, $args) { |
|
19 | 19 | return $target($args); |
20 | 20 | } |
21 | 21 | ); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | |
31 | 31 | $advisor = new Advisor( |
32 | - 'ad1', 'TargetClass@originMethod', function ($target, $args) { |
|
32 | + 'ad1', 'TargetClass@originMethod', function($target, $args) { |
|
33 | 33 | return $target($args); |
34 | 34 | } |
35 | 35 | ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->assertEquals( |
87 | 87 | 'foo', |
88 | 88 | $advice( |
89 | - function ($arg) { |
|
89 | + function($arg) { |
|
90 | 90 | return $arg; |
91 | 91 | }, |
92 | 92 | 'foo' |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | public function testSetAdvice(Advisor $advisor) |
102 | 102 | { |
103 | 103 | $advisor->setAdvice( |
104 | - function ($target, $args) { |
|
104 | + function($target, $args) { |
|
105 | 105 | return $target($args).'bar'; |
106 | 106 | } |
107 | 107 | ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->assertEquals( |
112 | 112 | 'foobar', |
113 | 113 | $advice( |
114 | - function ($arg) { |
|
114 | + function($arg) { |
|
115 | 115 | return $arg; |
116 | 116 | }, |
117 | 117 | 'foo' |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $handler = $this->getHandler(null, 'origin', $advisorList); |
37 | 37 | |
38 | 38 | $args = ['1', '2']; |
39 | - $originMethod = function ($a, $b) { |
|
39 | + $originMethod = function($a, $b) { |
|
40 | 40 | return $a.$b; |
41 | 41 | }; |
42 | 42 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $handler = $this->getHandler(null, 'origin', $advisorList); |
74 | 74 | |
75 | 75 | $args = ['1', '2']; |
76 | - $originMethod = function ($a, $b) { |
|
76 | + $originMethod = function($a, $b) { |
|
77 | 77 | return $a.$b; |
78 | 78 | }; |
79 | 79 |
@@ -32,13 +32,13 @@ |
||
32 | 32 | { |
33 | 33 | $m = \Mockery::mock('\Xpressengine\Interception\Proxy\ProxyConfig'); |
34 | 34 | $m->shouldReceive('getTargetName')->andReturnUsing( |
35 | - function () use ($string) { |
|
35 | + function() use ($string) { |
|
36 | 36 | return trim($string, '\\'); |
37 | 37 | } |
38 | 38 | ); |
39 | 39 | $m->shouldReceive('getProxyName')->andReturnUsing( |
40 | - function () use ($string) { |
|
41 | - return 'Proxy_' . str_replace('\\', '_', trim($string, '\\')); |
|
40 | + function() use ($string) { |
|
41 | + return 'Proxy_'.str_replace('\\', '_', trim($string, '\\')); |
|
42 | 42 | } |
43 | 43 | ); |
44 | 44 | return $m; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $conn->shouldReceive('table')->andReturn($query); |
19 | 19 | $query->shouldReceive('where')->once()->with('siteKey', 'default')->andReturn($query); |
20 | 20 | $query->shouldReceive('where')->once()->with('name', 'board.notice')->andReturn($query); |
21 | - $query->shouldReceive('first')->once()->withNoArgs()->andReturn((object)[ |
|
21 | + $query->shouldReceive('first')->once()->withNoArgs()->andReturn((object) [ |
|
22 | 22 | 'id' => 1, |
23 | 23 | 'name' => 'board.notice', |
24 | 24 | 'grants' => '{"access":{"type":"power","value":"guest"},"create":{"type":"power","value":"member"},"read":{"type":"power","value":"guest"},"update":{"type":"group","value":["group_id_1","group_id_2"]},"delete":{"type":"group","value":["group_id_1","group_id_2"]}}', |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $keys = ''; |
36 | 36 | $comma = ''; |
37 | 37 | foreach ($registered as $key => $value) { |
38 | - $keys .= $comma . $key; |
|
38 | + $keys .= $comma.$key; |
|
39 | 39 | $comma = ','; |
40 | 40 | } |
41 | 41 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ]); |
55 | 55 | |
56 | 56 | $conn->shouldReceive('table')->andReturn($query); |
57 | - $query->shouldReceive('insertGetId')->once()->with(m::on(function ($array) { |
|
57 | + $query->shouldReceive('insertGetId')->once()->with(m::on(function($array) { |
|
58 | 58 | return $array['name'] === 'board.notice' |
59 | 59 | && $array['grants'] === '{"access":{"type":"power","value":"guest"},"create":{"type":"power","value":"member"}}'; |
60 | 60 | }))->andReturn(1); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $conn->shouldReceive('table')->andReturn($query); |
87 | 87 | $query->shouldReceive('where')->once()->with('id', 1)->andReturn($query); |
88 | 88 | |
89 | - $query->shouldReceive('update')->once()->with(m::on(function ($array) { |
|
89 | + $query->shouldReceive('update')->once()->with(m::on(function($array) { |
|
90 | 90 | return $array['grants'] === '{"access":{"type":"power","value":"guest"},"create":{"type":"power","value":"member"}}'; |
91 | 91 | }))->andReturnNull(); |
92 | 92 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $query->shouldReceive('where')->once()->with('siteKey', 'default')->andReturn($query); |
127 | 127 | $query->shouldReceive('whereRaw')->once()->with("'board.notice.b1' like concat(`name`, '.', '%')")->andReturn($query); |
128 | 128 | $query->shouldReceive('where')->once()->with('name', '<>', 'board.notice.b1')->andReturn($query); |
129 | - $query->shouldReceive('get')->once()->withNoArgs()->andReturn((object)[ |
|
129 | + $query->shouldReceive('get')->once()->withNoArgs()->andReturn((object) [ |
|
130 | 130 | [ |
131 | 131 | 'id' => 1, |
132 | 132 | 'type' => 'instance', |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | $conn->shouldReceive('table')->andReturn($query); |
166 | 166 | $query->shouldReceive('where')->twice()->with('siteKey', 'default')->andReturnSelf(); |
167 | - $query->shouldReceive('where')->twice()->with(m::on(function ($closure) use ($query) { |
|
167 | + $query->shouldReceive('where')->twice()->with(m::on(function($closure) use ($query) { |
|
168 | 168 | $query->shouldReceive('where')->once()->with('name', 'prev.from')->andReturnSelf(); |
169 | 169 | $query->shouldReceive('orWhere')->once()->with('name', 'like', 'prev.from.%')->andReturnSelf(); |
170 | 170 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | $conn->shouldReceive('table')->andReturn($query); |
198 | 198 | $query->shouldReceive('where')->once()->with('siteKey', 'default')->andReturnSelf(); |
199 | - $query->shouldReceive('where')->once()->with(m::on(function ($closure) use ($query) { |
|
199 | + $query->shouldReceive('where')->once()->with(m::on(function($closure) use ($query) { |
|
200 | 200 | $query->shouldReceive('where')->once()->with('name', 'prev.from')->andReturnSelf(); |
201 | 201 | $query->shouldReceive('orWhere')->once()->with('name', 'like', 'prev.from.%')->andReturnSelf(); |
202 | 202 |
@@ -239,11 +239,11 @@ |
||
239 | 239 | |
240 | 240 | private function getHandler($dir = null, $plugins = null, $factory = null, $register = null, $app = null) |
241 | 241 | { |
242 | - if($dir === null) $dir = __DIR__.'/plugins'; |
|
243 | - if($plugins === null) $plugins = $this->makeCollection(); |
|
244 | - if($factory === null) $factory = $this->makeViewFactory(); |
|
245 | - if($register === null) $register = $this->makeRegister(); |
|
246 | - if($app === null) $app = $this->makeApp(); |
|
242 | + if ($dir === null) $dir = __DIR__.'/plugins'; |
|
243 | + if ($plugins === null) $plugins = $this->makeCollection(); |
|
244 | + if ($factory === null) $factory = $this->makeViewFactory(); |
|
245 | + if ($register === null) $register = $this->makeRegister(); |
|
246 | + if ($app === null) $app = $this->makeApp(); |
|
247 | 247 | return new PluginHandler($dir, $plugins, $factory, $register, $app); |
248 | 248 | } |
249 | 249 | } |