public function apply($transformer, $pullquote, $node)
 {
     $cite = Cite::create();
     $pullquote->withAttribution($cite);
     $transformer->transform($cite, $node);
     return $pullquote;
 }
 public function apply($transformer, $caption, $node)
 {
     $cite = Cite::create();
     $caption->withCredit($cite);
     if ($this->getProperty(Caption::POSITION_BELOW, $node)) {
         $cite->withPosition(Caption::POSITION_BELOW);
     }
     if ($this->getProperty(Caption::POSITION_CENTER, $node)) {
         $cite->withPosition(Caption::POSITION_CENTER);
     }
     if ($this->getProperty(Caption::POSITION_ABOVE, $node)) {
         $cite->withPosition(Caption::POSITION_ABOVE);
     }
     if ($this->getProperty(Caption::ALIGN_LEFT, $node)) {
         $cite->withTextAlignment(Caption::ALIGN_LEFT);
     }
     if ($this->getProperty(Caption::ALIGN_CENTER, $node)) {
         $cite->withTextAlignment(Caption::ALIGN_CENTER);
     }
     if ($this->getProperty(Caption::ALIGN_RIGHT, $node)) {
         $cite->withTextAlignment(Caption::ALIGN_RIGHT);
     }
     $transformer->transform($cite, $node);
     return $caption;
 }
 /**
  * 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;
 }