Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php declare(strict_types=1); namespace PaginatorExtension; use App\User; use functio..

Decoded Output download

<?php

declare(strict_types=1);

namespace PaginatorExtension;

use App\User;

use function PHPStan\Testing\assertType;

function test(): void
{
    assertType('Illuminate\Pagination\LengthAwarePaginator<App\User>', User::paginate());
    assertType('array<App\User>', User::paginate()->all());
    assertType('array<App\User>', User::paginate()->items());
    assertType('App\User|null', User::paginate()[0]);

    assertType('Illuminate\Pagination\Paginator<App\User>', User::simplePaginate());
    assertType('array<App\User>', User::simplePaginate()->all());
    assertType('array<App\User>', User::simplePaginate()->items());
    assertType('App\User|null', User::simplePaginate()[0]);

    assertType('Illuminate\Pagination\CursorPaginator<App\User>', User::cursorPaginate());
    assertType('array<App\User>', User::cursorPaginate()->all());
    assertType('array<App\User>', User::cursorPaginate()->items());
    assertType('App\User|null', User::cursorPaginate()[0]);

    assertType('ArrayIterator<(int|string), App\User>', User::query()->paginate()->getIterator());

    // HasMany
    assertType('Illuminate\Pagination\LengthAwarePaginator<App\Account>', (new User())->accounts()->paginate());

    // BelongsToMany
    assertType('Illuminate\Pagination\LengthAwarePaginator<App\Post>', (new User())->posts()->paginate());
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace PaginatorExtension;

use App\User;

use function PHPStan\Testing\assertType;

function test(): void
{
    assertType('Illuminate\Pagination\LengthAwarePaginator<App\User>', User::paginate());
    assertType('array<App\User>', User::paginate()->all());
    assertType('array<App\User>', User::paginate()->items());
    assertType('App\User|null', User::paginate()[0]);

    assertType('Illuminate\Pagination\Paginator<App\User>', User::simplePaginate());
    assertType('array<App\User>', User::simplePaginate()->all());
    assertType('array<App\User>', User::simplePaginate()->items());
    assertType('App\User|null', User::simplePaginate()[0]);

    assertType('Illuminate\Pagination\CursorPaginator<App\User>', User::cursorPaginate());
    assertType('array<App\User>', User::cursorPaginate()->all());
    assertType('array<App\User>', User::cursorPaginate()->items());
    assertType('App\User|null', User::cursorPaginate()[0]);

    assertType('ArrayIterator<(int|string), App\User>', User::query()->paginate()->getIterator());

    // HasMany
    assertType('Illuminate\Pagination\LengthAwarePaginator<App\Account>', (new User())->accounts()->paginate());

    // BelongsToMany
    assertType('Illuminate\Pagination\LengthAwarePaginator<App\Post>', (new User())->posts()->paginate());
}

Function Calls

None

Variables

None

Stats

MD5 c43bd6acc0dc35c52e00630d6c4ae719
Eval Count 0
Decode Time 101 ms