code: public function setEncoder(callable $encoder): Yaml
      {
          if (!is_callable($encoder)) {
              throw new \InvalidArgumentException('The provided encoder must be callable.');
          }
  
          $this->encoder = $encoder;
  
          return $this;
      }
docs: Sets the encoder.
  
  @param callable $encoder
  
  @return Yaml