linepogl
linepogl

Reputation: 9335

PHPStan type for json-like structure

Json-like structures are quite common in php applications that deal some sort of json api. The precise type of such a structure is recursive:

/**
 * @return null|scalar|array< null|scalar|array< null|scalar|array< ... >>>
 */
public function normalize(): null|scalar|array
{
  ...
}

Is there any way to represent this recursive type so that phpstan understands it?

Upvotes: 0

Views: 50

Answers (0)

Related Questions