-
Hey again,
Getting phpstan errors when using RankMath\Metadata types in my plugin.
The issue is because both
protected $object, andpublic function __construct( $object ), are looking forRankMath\WP_Post|RankMath\WP_User|...To refer to the actual
WP_objects, they need to be slashed:e.g.
`php
/**
* Holds the object.
*
* @var \WP_Post|\WP_Term|\WP_User
*/
protected $object = null;
`and
`php
/**
* Constructor.
*
* @param \WP_Post|\WP_Term|\WP_User $object Current object.
*/
public function __construct( $object ) {
$this->object = $object;
}Best,
David
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The ticket ‘Wrong @params for RankMath\Metadata constructor’ is closed to new replies.