for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace mav3rick177\RapidPagination;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Support\ServiceProvider;
/**
* Class MacroServiceProvider
*/
class MacroServiceProvider extends ServiceProvider
{
* Register "rapid-pagination" macros.
public function register()
QueryBuilder::macro('rapid_pagination', function () {
/* @var \Illuminate\Database\Query\Builder $this */
return Paginator::create($this);
$this
this<mav3rick177\RapidPa...n\MacroServiceProvider>
object<Illuminate\Databa...Database\Query\Builder>
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);
});
EloquentBuilder::macro('rapid_pagination', function () {
/* @var \Illuminate\Database\Eloquent\Builder $this */
Relation::macro('rapid_pagination', function () {
/* @var \Illuminate\Database\Eloquent\Relations\Relation $this */
}
public function boot()
$this->loadViewsFrom(__DIR__.'/../resources/views', 'rapid-pagination');
$this->publishes([
__DIR__.'/../resources/views' => $this->app->resourcePath('views/vendor/rapid-pagination'),
], 'rapid-pagination');
if (\File::exists(__DIR__ . '\Helpers\helpers.php')) {
require __DIR__ . '\Helpers\helpers.php';
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: