postcondition; } /** * Set rule * * @param null|Rule $rule * * @return self */ public function setPostcondition(?Rule $rule = null) { $this->postcondition = $rule; return $this; } /** * @return RuleContextInterface */ public function getContextObjectPostcondition(): RuleContextInterface { return $this->contextObjectPostcondition; } /** * @param RuleContextInterface $contextObject * * @return self */ public function setContextObjectPostcondition(RuleContextInterface $contextObject) { $this->contextObjectPostcondition = $contextObject; return $this; } /** * @return string */ public function __toString() { $rule = $this->getPostcondition(); if ($rule instanceof Rule) { $name = $rule->getName(); if (isset($name)){ return $name; } } return "New postcondition"; } }