HasObjectProperties::check()
Not yet in a tagged release
Description
HasObjectProperties::check() - does an object have non-static properties?
// remember to import first
use GanbaroDigital\MissingBits\ClassesAndObjects\HasObjectProperties;
// our method signature
bool HasObjectProperties(object $target, $propTypes = ReflectionProperty::IS_PUBLIC);
Parameters
HasObjectProperties::check() takes two parameters:
$target(object) - the object to examine$propTypes(int) - optional scope filter
Return Values
HasObjectProperties::check() returns a boolean:
trueif$targetis an object with 1 or more properties that match$propTypesfalseotherwise
Throws
HasObjectProperties::check() throws an InvalidArgumentException if:
$targetis not an object
Constraints
HasObjectProperties::check() only works on objects. Use HasClassProperties::check() to check for static properties.