コード例 #1
0
 /**
  * @param $line
  * @return string[]
  */
 public function getLines($line)
 {
     $width = $this->widthProvider->getWidth();
     $lines = str_split($line, $width);
     if ($this->padWith) {
         $n = count($lines);
         $lines[$n - 1] = str_pad($lines[$n - 1], $width, $this->padWith);
     }
     return $lines;
 }
コード例 #2
0
 /**
  * @param $line
  * @return string[]
  */
 public function getLines($line)
 {
     $width = $this->widthProvider->getWidth();
     if (strlen($line) > $width) {
         return array(substr($line, 0, $width - strlen($this->ellipsis)) . $this->ellipsis);
     }
     if ($this->padWith) {
         return array(str_pad($line, $width, $this->padWith));
     }
     return array($line);
 }