PHPDaemon\Structures\ObjectStorage::each PHP Method

each() public method

Call given method of all objects in storage
public each ( string $method, $args ) : integer
$method string Method name
$args Arguments
return integer Number of called objects
    public function each($method, ...$args)
    {
        if ($this->count() === 0) {
            return 0;
        }
        $n = 0;
        foreach ($this as $obj) {
            $obj->{$method}(...$args);
            ++$n;
        }
        return $n;
    }