src/Component/Json.php
/**
     * Iterates a countable, but returns each iteration value as a new Json class.
     *
     * @param ?string|int $index
     * @return \Generator
     */
Iterates a countable, but returns each iteration value as a new Json class.
@param ?string|int $index
@return \Generator
Iterates a countable but returns each iteration value as a new Json class . @param ?string|int $index @return \ Generator
public function iterateAsJson($index = null): \Generator
    {
        $objectVars = get_object_vars($this);
        return $this->do(function (array &$array) use ($objectVars) {
            foreach ($array as $key => &$value) {
                yield $key => new JsonChild($value, $objectVars);
            }
        }, $index, true);
    }
public function iterateAsJson ( $ index = null ) : \ Generator { $ objectVars = get_object_vars ( $ this ) ; return $ this -> do ( function ( array & $ array ) use ( $ objectVars ) { foreach ( $ array as $ key => & $ value ) { yield $ key => new JsonChild ( $ value , $ objectVars ) ; } } , $ index , true ) ; }
Iterates a countable, but returns each iteration value as a new Json class.
Iterates a countable but returns each iteration value as a new Json class .