Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop on template recursion #96

Open
LordSimal opened this issue Feb 24, 2024 · 0 comments
Open

Infinite loop on template recursion #96

LordSimal opened this issue Feb 24, 2024 · 0 comments

Comments

@LordSimal
Copy link

LordSimal commented Feb 24, 2024

Bladestan 0.5.0
PHP 8.3.2
PHPStan 1.10.59 with extension installer
Laravel 10.45.1
Livewire 3.4.6

It seems this plugin doesn't account for template recursion as I get a

     Child process error: PHPStan process crashed because it reached configured PHP memory limit: 2G  
     Increase your memory limit in php.ini or run PHPStan with --memory-limit CLI option.    

Whenever I do something like this inside my resources/views/livewire/category/partials/options.blade.php:

@foreach($children as $category)
    <option value="{{ $category->id }}" {{ $category->id === $editingCategoryParentId ? 'selected' : '' }} >
        @for ($i = $category->lvl; $i >= 1; $i--)-@endfor
        {{ $category->name }}
    </option>
    @if($category->children)
        @include('livewire.category.partials.options', ['children' => $category->children])
    @endif
@endforeach

as you can probably see this is a blade partial to render options for a tree structure which can have multiple levels like you can see here
image

When I disable the recursive template renderings I don't get the error and instead get correct balde template stan issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant