@@ -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 | ; |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | //Request::setTrustedProxies(array('127.0.0.1')); |
| 10 | 10 | |
| 11 | -$app->get('/', function (Request $request) use ($app) { |
|
| 11 | +$app->get('/', function(Request $request) use ($app) { |
|
| 12 | 12 | if ($postId = $request->get('post_id', null)) { |
| 13 | 13 | return $app->redirect($app['url_generator']->generate('post', ['id' => $postId])); |
| 14 | 14 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | ; |
| 20 | 20 | |
| 21 | 21 | |
| 22 | -$app->get('/post/{id}', function (Request $request, $id) use ($app) { |
|
| 22 | +$app->get('/post/{id}', function(Request $request, $id) use ($app) { |
|
| 23 | 23 | $force = boolval($request->get('force', 0)); |
| 24 | 24 | |
| 25 | 25 | $post = $app['service.esa']->getPost($id, $force); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | ; |
| 46 | 46 | |
| 47 | 47 | |
| 48 | -$app->error(function (\Exception $e, Request $request, $code) use ($app) { |
|
| 48 | +$app->error(function(\Exception $e, Request $request, $code) use ($app) { |
|
| 49 | 49 | if ($app['debug']) { |
| 50 | 50 | return; |
| 51 | 51 | } |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | 'locale_fallbacks' => ['ja'], |
| 31 | 31 | ]); |
| 32 | 32 | |
| 33 | -$app['twig'] = $app->extend('twig', function ($twig, $app) { |
|
| 33 | +$app['twig'] = $app->extend('twig', function($twig, $app) { |
|
| 34 | 34 | // add custom globals, filters, tags, ... |
| 35 | 35 | |
| 36 | 36 | return $twig; |
| 37 | 37 | }); |
| 38 | 38 | |
| 39 | -$app->extend('translator', function ($translator, $app) { |
|
| 39 | +$app->extend('translator', function($translator, $app) { |
|
| 40 | 40 | /** @var \Symfony\Component\Translation\Translator $translator */ |
| 41 | 41 | $translator->addResource('xliff', __DIR__.'/../vendor/symfony/validator/Resources/translations/validators.ja.xlf', 'ja'); |
| 42 | 42 | |
@@ -45,22 +45,22 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | // original services |
| 47 | 47 | |
| 48 | -$app['service.doctrine_cache'] = $app->factory(function () use ($app) { |
|
| 48 | +$app['service.doctrine_cache'] = $app->factory(function() use ($app) { |
|
| 49 | 49 | return new FilesystemCache(__DIR__.'/../var/cache/esa'); |
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | -$app['service.esa'] = $app->factory(function () use ($app) { |
|
| 52 | +$app['service.esa'] = $app->factory(function() use ($app) { |
|
| 53 | 53 | $client = new Client($app['esa.access_token'], $app['esa.team_name']); |
| 54 | 54 | $cache = $app['service.doctrine_cache']; |
| 55 | 55 | |
| 56 | 56 | return new EsaProxy($client, $cache); |
| 57 | 57 | }); |
| 58 | 58 | |
| 59 | -$app['service.category_checker'] = $app->factory(function () use ($app) { |
|
| 59 | +$app['service.category_checker'] = $app->factory(function() use ($app) { |
|
| 60 | 60 | return new CategoryChecker($app['esa.public_categories'], $app['esa.private_categories']); |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | -$app['service.html_helper'] = $app->factory(function () use ($app) { |
|
| 63 | +$app['service.html_helper'] = $app->factory(function() use ($app) { |
|
| 64 | 64 | return new HtmlHelper($app['esa.html_replacements'], $app['esa.team_name'], $app['url_generator'], $app['service.esa']); |
| 65 | 65 | }); |
| 66 | 66 | |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | $ids = $matches[2]; |
| 98 | 98 | $hTags = $matches[0]; |
| 99 | 99 | |
| 100 | - $names = array_map(function ($v) { |
|
| 100 | + $names = array_map(function($v) { |
|
| 101 | 101 | preg_match('/<a\s+[^>]*[\'"]anchor[\'"][^>]*>(?:(?!<\/a>).)+<\/a>\s*(.+)<\/h\d>$/i', $v, $matches); |
| 102 | 102 | return filter_var($matches[1], FILTER_SANITIZE_STRING); // strip tags |
| 103 | 103 | }, $hTags); |
@@ -3,11 +3,11 @@ |
||
| 3 | 3 | require __DIR__.'/config.translations.ja.php'; |
| 4 | 4 | |
| 5 | 5 | $app['esa.public_categories'] = [ |
| 6 | - // empty to publish all |
|
| 6 | + // empty to publish all |
|
| 7 | 7 | ]; |
| 8 | 8 | |
| 9 | 9 | $app['esa.private_categories'] = [ |
| 10 | - // overwrite public_categories config |
|
| 10 | + // overwrite public_categories config |
|
| 11 | 11 | ]; |
| 12 | 12 | |
| 13 | 13 | $app['esa.html_replacements'] = [ |