isObject() public static method

Determines that the provided value is an object.
public static isObject ( mixed $value, null $message = null, null $propertyPath = null ) : boolean
$value mixed
$message null
$propertyPath null
return boolean
示例#1
0
 /**
  * @param AggregateType $aggregateType
  * @param string $aggregateId
  * @param object $aggregateRoot
  * @param int $lastVersion
  * @param DateTimeImmutable $createdAt
  */
 public function __construct(AggregateType $aggregateType, $aggregateId, $aggregateRoot, $lastVersion, DateTimeImmutable $createdAt)
 {
     Assertion::minLength($aggregateId, 1);
     Assertion::isObject($aggregateRoot);
     Assertion::min($lastVersion, 1);
     $this->aggregateType = $aggregateType;
     $this->aggregateId = $aggregateId;
     $this->aggregateRoot = $aggregateRoot;
     $this->lastVersion = $lastVersion;
     $this->createdAt = $createdAt;
 }
示例#2
0
 public function testIsObjectExpectingException()
 {
     $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_OBJECT);
     Assertion::isObject('notAnObject');
 }
示例#3
0
 /**
  * @{inheritdoc}
  */
 public function withMessage($message)
 {
     Assertion::isObject($message);
     return new self($this->messageType, $message, $this->serializedMessage);
 }