Skip to content

Instantly share code, notes, and snippets.

@janedbal
janedbal / GarbageCollectorRule.php
Last active October 16, 2024 13:31
Following rule MAY improve PHPStan run time. It makes sense only when you disable GC for PHPStan execution.
<?php declare(strict_types = 1);
namespace ShipMonk\Rules\PHPStan\Rule;
use PhpParser\Node;
use PHPStan\Analyser\Scope;
use PHPStan\Node\InClassNode;
use PHPStan\Rules\IdentifierRuleError;
use PHPStan\Rules\Rule;
use function gc_collect_cycles;