PDepend\Source\AST\ASTCompilationUnit::setId PHP Method

setId() public method

Sets the unique identifier for this file instance.
Since: 0.9.12
public setId ( string $id ) : void
$id string Identifier for this file.
return void
    public function setId($id)
    {
        $this->id = $id;
    }

Usage Example

 /**
  * testBuilderCreatesCaseInSensitiveMethodIdentifiers
  *
  * @return void
  */
 public function testBuilderCreatesCaseInSensitiveMethodIdentifiers()
 {
     $compilationUnit = new ASTCompilationUnit(__FILE__);
     $compilationUnit->setId(__FUNCTION__);
     $class = new ASTClass(__FUNCTION__);
     $class->setCompilationUnit($compilationUnit);
     $method0 = new ASTMethod(__FUNCTION__);
     $method0->setParent($class);
     $method1 = new ASTMethod(strtolower(__FUNCTION__));
     $method1->setParent($class);
     $builder0 = new IdBuilder();
     $builder1 = new IdBuilder();
     $this->assertEquals($builder0->forMethod($method0), $builder1->forMethod($method1));
 }
All Usage Examples Of PDepend\Source\AST\ASTCompilationUnit::setId