/** * @return string */ public function generate() { $useStatement = parent::generate(); return <<<TRAIT \t{$useStatement} TRAIT; }
/** * @covers ::generate */ public function testUseStatementGenerator() { $useStatement = $this->useStatement->generate(); $this->assertEquals(trim($useStatement), trim('use TheClass;'), 'Use statement generated.'); }
/** * @return string $useSpace */ protected function generateUseStatements() { $useStatements = PHP_EOL; foreach ($this->baseClass->getUseStatements() as $use) { $useStatements .= $use->generate() . PHP_EOL; } foreach ($this->baseClass->getImplements() as $interface) { $useStatement = new UseStatement($interface); $useStatements .= $useStatement->generate() . PHP_EOL; } return $useStatements; }