This attribute is the equivalent of the @impure
annotation for class methods and functions.
The attribute accepts no arguments.
<?php
use PhpStaticAnalysis\Attributes\Impure;
class ImpureExample
{
public static int $i = 0;
#[Impure] // this function is impure
public static function addCumulative(int $left) : int
{
self::$i += $left;
return self::$i;
}
...
}