private function fixLine(Line $line) { $content = $line->getContent(); preg_match_all('/ \\$[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*/', $content, $matches); if (isset($matches[0][0])) { $line->setContent(str_replace($matches[0][0], '', $content)); } }
/** * @dataProvider provideTypesCases */ public function testTypes($expected, $new, $input, $output) { $line = new Line($input); $tag = new Annotation(array($line)); $this->assertSame($expected, $tag->getTypes()); $tag->setTypes($new); $this->assertSame($new, $tag->getTypes()); $this->assertSame($output, $line->getContent()); }
public function testSetContent() { $line = new Line(" * @param \$foo Hi!\n"); $this->assertSame(" * @param \$foo Hi!\n", $line->getContent()); $line->addBlank(); $this->assertSame(" * @param \$foo Hi!\n *\n", $line->getContent()); $line->setContent(" * test\n"); $this->assertSame(" * test\n", $line->getContent()); $line->remove(); $this->assertSame('', $line->getContent()); }