JsonUtils
JsonUtils copied to clipboard
Better PHP types + PHP types in annotations so IDE recognize type correctly
Instead of:
class BreadCrumbTrailItem
{
public $associatedFieldName; //object
public $searchParams; //String
public $text; //String
public $type; //String
public $value; //String
}
we get:
class BreadCrumbTrailItem
{
/**
* @var object
*/
public $associatedFieldName;
/**
* @var string
*/
public $searchParams;
/**
* @var string
*/
public $text;
/**
* @var string
*/
public $type;
/**
* @var string
*/
public $value;
}
which is how it should look like in PHP. File types are also fixed, but it's also not perfect, but far better then it was till now...
You can actually use this to save lines
/** @var object */
public $associatedFieldName;
instead of
/**
* @var object
*/
public $associatedFieldName;
@earlpeterg that's just a coding style and I prefer multiline phpdoc comments :)