2019-03-01 14:57:10 +01:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Plugin\Hook;
|
|
|
|
|
|
|
|
use Psalm\CodeLocation;
|
|
|
|
use Psalm\Context;
|
|
|
|
use Psalm\StatementsSource;
|
|
|
|
|
2021-06-07 16:46:56 +02:00
|
|
|
/** @deprecated going to be removed in Psalm 5 */
|
2019-03-01 14:57:10 +01:00
|
|
|
interface PropertyExistenceProviderInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return array<string>
|
|
|
|
*/
|
|
|
|
public static function getClassLikeNames() : array;
|
|
|
|
|
|
|
|
/**
|
2020-08-11 13:29:45 +02:00
|
|
|
* Use this hook for informing whether or not a property exists on a given object. If you know the property does
|
2020-08-11 20:36:59 +02:00
|
|
|
* not exist, return false. If you aren't sure if it exists or not, return null and the default analysis will
|
|
|
|
* continue to determine if the property actually exists.
|
2020-08-11 13:29:45 +02:00
|
|
|
*
|
2019-03-01 14:57:10 +01:00
|
|
|
*/
|
|
|
|
public static function doesPropertyExist(
|
|
|
|
string $fq_classlike_name,
|
|
|
|
string $property_name,
|
|
|
|
bool $read_mode,
|
2020-09-07 01:36:47 +02:00
|
|
|
?StatementsSource $source = null,
|
|
|
|
?Context $context = null,
|
|
|
|
?CodeLocation $code_location = null
|
2020-09-12 17:24:05 +02:00
|
|
|
): ?bool;
|
2019-03-01 14:57:10 +01:00
|
|
|
}
|