Ejemplo n.º 1
0
 /**
  * This method will return the declared default value for this parameter.
  * Please note that this method will return <b>null</b> when no default
  * value was declared, therefore you should combine calls to this method and
  * {@link PHP_Depend_Code_Parameter::isDefaultValueAvailable()} to detect a
  * NULL-value.
  *
  * @return mixed
  * @since 0.9.5
  */
 public function getDefaultValue()
 {
     $value = $this->_variableDeclarator->getValue();
     if ($value === null) {
         return null;
     }
     return $value->getValue();
 }
Ejemplo n.º 2
0
 /**
  * testMagicSleepReturnsExpectedSetOfPropertyNames
  *
  * @return void
  * @group pdepend
  * @group pdepend::ast
  * @group unittest
  */
 public function testMagicSleepReturnsExpectedSetOfPropertyNames()
 {
     $declarator = new PHP_Depend_Code_ASTVariableDeclarator();
     self::assertEquals(array('value', 'image', 'comment', 'startLine', 'startColumn', 'endLine', 'endColumn', 'nodes'), $declarator->__sleep());
 }
Ejemplo n.º 3
0
 /**
  * Returns the source tokens used for this property declaration.
  *
  * @return array(PHP_Depend_Token)
  * @since 0.9.6
  * @deprecated Since version 0.9.12, use setDeclaringClass() instead.
  */
 public function getTokens()
 {
     fwrite(STDERR, 'Since 0.9.12 ' . __METHOD__ . '() is deprecated.' . PHP_EOL);
     return $this->_variableDeclarator->getTokens();
 }
Ejemplo n.º 4
0
 /**
  * testVariableDeclaratorHasExpectedEndColumn
  *
  * @param PHP_Depend_Code_ASTVariableDeclarator $declarator
  *
  * @return void
  * @depends testVariableDeclarator
  */
 public function testVariableDeclaratorHasExpectedEndColumn($declarator)
 {
     $this->assertEquals(17, $declarator->getEndColumn());
 }