@@ -15,7 +15,7 @@ |
||
15 | 15 | // new InputOption('some-option', null, InputOption::VALUE_NONE, 'Some help'), |
16 | 16 | )) |
17 | 17 | ->setDescription('My command description') |
18 | - ->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
18 | + ->setCode(function(InputInterface $input, OutputInterface $output) use ($app) { |
|
19 | 19 | // do something |
20 | 20 | }) |
21 | 21 | ; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | //Request::setTrustedProxies(array('127.0.0.1')); |
13 | 13 | |
14 | -$app->get('/', function (Request $request) use ($app) { |
|
14 | +$app->get('/', function(Request $request) use ($app) { |
|
15 | 15 | |
16 | 16 | if ($postId = $request->get('post_id', null)) { |
17 | 17 | return $app->redirect($app['url_generator']->generate('post', ['id' => $postId])); |
@@ -23,11 +23,11 @@ discard block |
||
23 | 23 | ; |
24 | 24 | |
25 | 25 | |
26 | -$app->get('/post/{id}', function (Request $request, $id) use ($app) { |
|
26 | +$app->get('/post/{id}', function(Request $request, $id) use ($app) { |
|
27 | 27 | |
28 | - $esa = $app['service.esa.proxy']; /** @var Proxy $esa */ |
|
29 | - $restrictor = $app['service.access_restrictor']; /** @var AccessRestrictor $restrictor */ |
|
30 | - $htmlHandler = $app['service.esa.html_handler']; /** @var HtmlHandler $htmlHandler */ |
|
28 | + $esa = $app['service.esa.proxy']; /** @var Proxy $esa */ |
|
29 | + $restrictor = $app['service.access_restrictor']; /** @var AccessRestrictor $restrictor */ |
|
30 | + $htmlHandler = $app['service.esa.html_handler']; /** @var HtmlHandler $htmlHandler */ |
|
31 | 31 | |
32 | 32 | $force = boolval($request->get('force', 0)); |
33 | 33 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ; |
62 | 62 | |
63 | 63 | |
64 | -$app->error(function (\Exception $e, Request $request, $code) use ($app) { |
|
64 | +$app->error(function(\Exception $e, Request $request, $code) use ($app) { |
|
65 | 65 | |
66 | 66 | if ($app['debug']) { |
67 | 67 | return; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function getATagReducer($pattern) |
132 | 132 | { |
133 | - $reducer = function (Crawler $node) use ($pattern) { |
|
133 | + $reducer = function(Crawler $node) use ($pattern) { |
|
134 | 134 | preg_match($pattern, $node->attr('href'), $matches); |
135 | 135 | |
136 | 136 | return boolval($matches); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | { |
153 | 153 | $that = $this; |
154 | 154 | |
155 | - $walker = function (Crawler $node) use ($pattern, $backReferenceNumberForPostId, $routeName, $routeVariableName, $that) { |
|
155 | + $walker = function(Crawler $node) use ($pattern, $backReferenceNumberForPostId, $routeName, $routeVariableName, $that) { |
|
156 | 156 | preg_match($pattern, $node->attr('href'), $matches); |
157 | 157 | $href = $matches[0]; |
158 | 158 | $postId = $matches[$backReferenceNumberForPostId]; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function getATagWalkerForMentionLinks($pattern) |
179 | 179 | { |
180 | - $walker = function (Crawler $node) use ($pattern) { |
|
180 | + $walker = function(Crawler $node) use ($pattern) { |
|
181 | 181 | preg_match($pattern, $node->attr('href'), $matches); |
182 | 182 | $href = $matches[0]; |
183 | 183 | |
@@ -251,11 +251,11 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function getWalkerForToc() |
253 | 253 | { |
254 | - $walker = function (Crawler $node) { |
|
254 | + $walker = function(Crawler $node) { |
|
255 | 255 | return [ |
256 | 256 | 'id' => $node->attr('id'), |
257 | 257 | // 'text' => $node->text(), |
258 | - 'text' => preg_replace('/^\s*>\s*/', '', $node->text()), // workaround... |
|
258 | + 'text' => preg_replace('/^\s*>\s*/', '', $node->text()), // workaround... |
|
259 | 259 | ]; |
260 | 260 | }; |
261 | 261 |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | 'locale_fallbacks' => ['ja'], |
33 | 33 | ]); |
34 | 34 | |
35 | -$app['twig'] = $app->extend('twig', function ($twig, $app) { |
|
35 | +$app['twig'] = $app->extend('twig', function($twig, $app) { |
|
36 | 36 | // add custom globals, filters, tags, ... |
37 | 37 | |
38 | 38 | return $twig; |
39 | 39 | }); |
40 | 40 | |
41 | -$app->extend('translator', function ($translator, $app) { |
|
41 | +$app->extend('translator', function($translator, $app) { |
|
42 | 42 | /** @var \Symfony\Component\Translation\Translator $translator */ |
43 | 43 | $translator->addResource('xliff', __DIR__.'/../vendor/symfony/validator/Resources/translations/validators.ja.xlf', 'ja'); |
44 | 44 | |
@@ -47,24 +47,24 @@ discard block |
||
47 | 47 | |
48 | 48 | // original services |
49 | 49 | |
50 | -$app['service.esa.proxy'] = $app->factory(function () use ($app) { |
|
50 | +$app['service.esa.proxy'] = $app->factory(function() use ($app) { |
|
51 | 51 | $client = new Client($app['esa.access_token'], $app['esa.team_name']); |
52 | 52 | $cache = new FilesystemCache(__DIR__.'/../var/cache/esa'); |
53 | 53 | |
54 | 54 | return new Proxy($client, $cache); |
55 | 55 | }); |
56 | 56 | |
57 | -$app['service.esa.html_handler'] = $app->factory(function () use ($app) { |
|
57 | +$app['service.esa.html_handler'] = $app->factory(function() use ($app) { |
|
58 | 58 | $crawler = new Crawler(); |
59 | 59 | |
60 | 60 | return new HtmlHandler($crawler, $app['url_generator'], $app['service.esa.emoji_manager'], $app['esa.team_name']); |
61 | 61 | }); |
62 | 62 | |
63 | -$app['service.esa.emoji_manager'] = $app->factory(function () use ($app) { |
|
63 | +$app['service.esa.emoji_manager'] = $app->factory(function() use ($app) { |
|
64 | 64 | return new EmojiManager($app['service.esa.proxy']); |
65 | 65 | }); |
66 | 66 | |
67 | -$app['service.access_restrictor'] = $app->factory(function () use ($app) { |
|
67 | +$app['service.access_restrictor'] = $app->factory(function() use ($app) { |
|
68 | 68 | return new AccessRestrictor($app['esa.public']['categories'], $app['esa.public']['tags'], $app['esa.private']['categories'], $app['esa.private']['tags']); |
69 | 69 | }); |
70 | 70 |