Example #1
0
 /**
  * Set class file description.
  *
  * @param array $description Collection of class file description lines
  *
  * @return ClassGenerator
  */
 public function defDescription(array $description) : ClassGenerator
 {
     $commentsGenerator = new CommentsGenerator($this);
     foreach ($description as $line) {
         $commentsGenerator->defLine($line);
     }
     $this->fileDescription = $commentsGenerator->code();
     return $this;
 }
    public function testMethodWithArgumentsComment()
    {
        $generated = $this->generator->defLine('Test comment')->defMethod('testMethod', 'testType', ['testArgument' => 'TestType'])->code();
        $expected = <<<'PHP'
/**
 * Test comment
 * @method testType testMethod(TestType $testArgument)
 */
PHP;
        static::assertEquals($expected, $generated);
    }