コード例 #1
0
ファイル: EntityRelation.php プロジェクト: pscheit/psc-cms
 /**
  * Fügt einem DocBlock die passenden Annotations für die Source Seite der Relation hinzu
  */
 public function addAnnotationsForSource(DocBlock $docBlock)
 {
     extract(Annotation::getClosureHelpers());
     $docBlock->addAnnotation($this->getRelation());
     if ($this->type === self::MANY_TO_MANY && $this->sourceSide !== self::INVERSE) {
         // bei unidirectional brauchen wir natürlich auch einen JoinTable
         $docBlock->addAnnotation($this->getJoinTable());
     }
     if ($this->type === self::MANY_TO_ONE || $this->type === self::ONE_TO_ONE) {
         $docBlock->addAnnotation($this->getJoinColumn());
     }
     if (($this->type === self::MANY_TO_MANY || $this->type === self::ONE_TO_MANY) && isset($this->orderBy)) {
         $docBlock->addAnnotation($this->orderBy);
     }
     foreach ($this->otherAnnotations as $annotation) {
         $docBlock->addAnnotation($annotation);
     }
 }
コード例 #2
0
ファイル: DocBlockTest.php プロジェクト: pscheit/psc-cms
    public function testSummaryParsing()
    {
        $body = '/**
 * Summary
 * 
 * the description is here
 */
';
        $block = new DocBlock($body);
        $block->parseSummary();
        $this->assertEquals('Summary', $block->getSummary());
        $this->assertEquals('the description is here', $block->getDescription());
        $this->assertEquals($body, $block->toString());
    }