| Conditions | 1 |
| Paths | 1 |
| Total Lines | 41 |
| Code Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 22 |
| CRAP Score | 1.0098 |
| Changes | 5 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | 5 | public function register(Container $app) |
|
| 14 | { |
||
| 15 | |||
| 16 | 5 | $app['paginator.options'] = array( |
|
| 17 | 5 | 'offset_page' => 2, |
|
| 18 | 5 | 'page_param' => 'page', |
|
| 19 | 5 | 'items_per_page' => 10, |
|
| 20 | 'hide_prev_next' => true |
||
| 21 | 5 | ); |
|
| 22 | |||
| 23 | $app['paginator'] = $app->factory(function($app) { |
||
| 24 | |||
| 25 | 3 | $app['paginator.options'] = array_replace(array( |
|
| 26 | 3 | 'offset_page' => 2, |
|
| 27 | 3 | 'page_param' => 'page', |
|
| 28 | 3 | 'items_per_page' => 10, |
|
| 29 | 'hide_prev_next' => true |
||
| 30 | 3 | ), $app['paginator.options']); |
|
| 31 | |||
| 32 | 3 | return new \Pagination\Util\Paginator($app); |
|
|
|
|||
| 33 | 5 | }); |
|
| 34 | |||
| 35 | 5 | $app->register(new \Silex\Provider\TwigServiceProvider()); |
|
| 36 | 5 | $app->register(new \Silex\Provider\TranslationServiceProvider()); |
|
| 37 | |||
| 38 | $app['twig'] = $app->extend('twig', function(\Twig_Environment $twig) { |
||
| 39 | $twig->addExtension(new Twig\TwigExtension()); |
||
| 40 | return $twig; |
||
| 41 | 5 | }); |
|
| 42 | |||
| 43 | 5 | $app['twig.path'] = array_merge_recursive($app['twig.path'], array( |
|
| 44 | 5 | __DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'views' |
|
| 45 | 5 | )); |
|
| 46 | |||
| 47 | 5 | $app['translator'] = $app->extend('translator', function(Translator $translator, Application $app) { |
|
| 48 | $translationDirectory = __DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'translations'; |
||
| 49 | $translator->addResource('yaml', $translationDirectory . DIRECTORY_SEPARATOR . 'messages.bg.yml', 'bg'); |
||
| 50 | $translator->addResource('yaml', $translationDirectory . DIRECTORY_SEPARATOR . 'messages.en.yml', 'en'); |
||
| 51 | return $translator; |
||
| 52 | 5 | }); |
|
| 53 | 5 | } |
|
| 54 | |||
| 56 |
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: