for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Pagination;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Component\Translation\Translator;
class PaginationServiceProvider implements ServiceProviderInterface
{
public function boot(Application $app)
}
public function register(Application $app)
$app->flush();
$app['paginator.options'] = array(
'offset_page' => 2,
'items_per_page' => 10,
'hide_prev_next' => true
);
$app['paginator'] = $app->share(function($app) {
$app['paginator.options'] = array_replace(array(
), $app['paginator.options']);
return new \Pagination\Util\Paginator($app);
$app
array<string,array<strin...ing,integer|boolean>"}>
object<Silex\Application>
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:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
});
if ($app->offsetExists('twig')) {
$app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig) {
$twig->addExtension(new Twig\TwigExtension());
return $twig;
}));
$app['twig.path'] = array_merge_recursive($app['twig.path'], array(
__DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'views'
));
if ($app->offsetExists('translator')) {
$app['translator'] = $app->share($app->extend('translator', function(Translator $translator, Application $app){
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$translationDirectory = __DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'translations';
$translator->addResource('yaml', $translationDirectory . DIRECTORY_SEPARATOR . 'messages.bg.yml', 'bg');
$translator->addResource('yaml', $translationDirectory . DIRECTORY_SEPARATOR . 'messages.en.yml', 'en');
return $translator;
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: