public function getFromProphetSubject($property)
{
// transform camel-cased properties to constant lookups
if (null !== $this->subject && $property === strtoupper($property)) {
$class = get_class($this->subject);
if ($this->subject instanceof LazyObject) {
$class = $this->subject->getClassname();
}
if (defined($class . '::' . $property)) {
return constant($class . '::' . $property);
}
}
if (null === $this->getWrappedSubject()) {
throw new BehaviorException(sprintf('Getting property <value>%s</value> from a non-object.', $property));
}
if ($this->isSubjectPropertyAccessible($property)) {
$returnValue = $this->getWrappedSubject()->{$property};
return new static($returnValue, $this->matchers, $this->unwrapper);
}
throw new PropertyNotFoundException($this->getWrappedSubject(), $property);
}