| Conditions | 3 |
| Paths | 4 |
| Total Lines | 40 |
| Code Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 3.6376 |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | 5 | public function register(Application $app) |
|
| 18 | { |
||
| 19 | |||
| 20 | 5 | $app->flush(); |
|
| 21 | |||
| 22 | 5 | $app['paginator.options'] = array( |
|
| 23 | 5 | 'offset_page' => 2, |
|
| 24 | 5 | 'items_per_page' => 10, |
|
| 25 | 'hide_prev_next' => true |
||
| 26 | 5 | ); |
|
| 27 | |||
| 28 | $app['paginator'] = $app->share(function($app) { |
||
| 29 | 3 | $app['paginator.options'] = array_replace(array( |
|
| 30 | 3 | 'offset_page' => 2, |
|
| 31 | 3 | 'items_per_page' => 10, |
|
| 32 | 'hide_prev_next' => true |
||
| 33 | 3 | ), $app['paginator.options']); |
|
| 34 | 3 | return new \Pagination\Util\Paginator($app); |
|
|
|
|||
| 35 | 5 | }); |
|
| 36 | |||
| 37 | 5 | if ($app->offsetExists('twig')) { |
|
| 38 | $app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig) { |
||
| 39 | $twig->addExtension(new Twig\TwigExtension()); |
||
| 40 | return $twig; |
||
| 41 | })); |
||
| 42 | |||
| 43 | 3 | $app['twig.path'] = array_merge_recursive($app['twig.path'], array( |
|
| 44 | 3 | __DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'views' |
|
| 45 | )); |
||
| 46 | } |
||
| 47 | |||
| 48 | 5 | if ($app->offsetExists('translator')) { |
|
| 49 | $app['translator'] = $app->share($app->extend('translator', function(Translator $translator, Application $app){ |
||
| 50 | $translationDirectory = __DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'translations'; |
||
| 51 | $translator->addResource('yaml', $translationDirectory . DIRECTORY_SEPARATOR . 'messages.bg.yml', 'bg'); |
||
| 52 | $translator->addResource('yaml', $translationDirectory . DIRECTORY_SEPARATOR . 'messages.en.yml', 'en'); |
||
| 53 | return $translator; |
||
| 54 | })); |
||
| 55 | } |
||
| 56 | 5 | } |
|
| 57 | |||
| 59 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: