Exemple #1
0
 /**
  * @param string $method
  * @param string $text
  * @param string $expected
  * @dataProvider provideRTrimMultiLine
  */
 public function testRTrimMultiLine($method, $text, $expected)
 {
     $actual = StringExplode::trimMultiLines($text, $method, PHP_EOL);
     $this->assertEquals($expected, $actual);
 }
Exemple #2
0
 /**
  * @param string $text
  * @param string $prefix
  * @param string $inlineCommentStart
  * @param string $suffix
  * @return string
  */
 private function formatComment($text, $prefix = '//', $inlineCommentStart = '//', $suffix = '')
 {
     $text = preg_replace('/^(.*?)$/m', $inlineCommentStart . ' $1', $text);
     $text = StringExplode::trimMultiLines($text, 'rTrim', $this->eol);
     return "{$prefix}{$text}{$suffix}";
 }