/** * Sets the attribution string * * @param string|Cite $attribution The attribution text * * @return $this */ public function withAttribution($attribution) { Type::enforce($attribution, [Type::STRING, Cite::getClassName()]); if (Type::is($attribution, Type::STRING)) { $this->attribution = Cite::create()->appendText($attribution); } else { $this->attribution = $attribution; } return $this; }
/** * The caption credit. optional. * * @param string $credit the caption credit text that will be shown * * @return $this */ public function withCredit($credit) { Type::enforce($credit, [Type::STRING, Cite::getClassName()]); if (Type::is($credit, Type::STRING)) { $credit = Cite::create()->appendText($credit); } $this->credit = $credit; return $this; }