Skip to content

Commit

Permalink
- Refs #21339411: Class names for type instances improved.
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelpichler committed Nov 23, 2011
1 parent 6689765 commit f5c9fc3
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 21 deletions.
Expand Up @@ -61,8 +61,7 @@
* @link http://www.pdepend.org/
* @since 0.9.5
*/
class PHP_Depend_Code_ASTClassOrInterfaceReference
extends PHP_Depend_Code_ASTTypeNode
class PHP_Depend_Code_ASTClassOrInterfaceReference extends PHP_Depend_Code_ASTType
{
/**
* The image type of this node.
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/PHP/Depend/Code/ASTPrimitiveType.php
Expand Up @@ -61,7 +61,7 @@
* @link http://www.pdepend.org/
* @since 0.9.6
*/
class PHP_Depend_Code_ASTPrimitiveType extends PHP_Depend_Code_ASTTypeNode
class PHP_Depend_Code_ASTPrimitiveType extends PHP_Depend_Code_ASTType
{
/**
* The image type of this node.
Expand Down
Expand Up @@ -60,7 +60,7 @@
* @link http://www.pdepend.org/
* @since 0.9.6
*/
class PHP_Depend_Code_ASTTypeNode extends PHP_Depend_Code_ASTNode
class PHP_Depend_Code_ASTType extends PHP_Depend_Code_ASTNode
{
/**
* The type of this class.
Expand Down Expand Up @@ -100,6 +100,6 @@ public function isPrimitive()
*/
public function accept(PHP_Depend_Code_ASTVisitorI $visitor, $data = null)
{
return $visitor->visitTypeNode($this, $data);
return $visitor->visitType($this, $data);
}
}
}
2 changes: 1 addition & 1 deletion src/main/php/PHP/Depend/Code/ASTTypeArray.php
Expand Up @@ -60,7 +60,7 @@
* @link http://www.pdepend.org/
* @since 0.9.6
*/
class PHP_Depend_Code_ASTTypeArray extends PHP_Depend_Code_ASTTypeNode
class PHP_Depend_Code_ASTTypeArray extends PHP_Depend_Code_ASTType
{
/**
* The type of this node.
Expand Down
4 changes: 2 additions & 2 deletions src/main/php/PHP/Depend/Code/Property.php
Expand Up @@ -211,7 +211,7 @@ public function isStatic()
public function isArray()
{
$typeNode = $this->_fieldDeclaration->getFirstChildOfType(
PHP_Depend_Code_ASTTypeNode::CLAZZ
PHP_Depend_Code_ASTType::CLAZZ
);
if ($typeNode === null) {
return false;
Expand All @@ -229,7 +229,7 @@ public function isArray()
public function isPrimitive()
{
$typeNode = $this->_fieldDeclaration->getFirstChildOfType(
PHP_Depend_Code_ASTTypeNode::CLAZZ
PHP_Depend_Code_ASTType::CLAZZ
);
if ($typeNode === null) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/PHP/Depend/Parser.php
Expand Up @@ -5923,7 +5923,7 @@ private function _parseVarAnnotation($comment)
* doc comment information. The returned value will be <b>null</b> when no
* type information exists.
*
* @return PHP_Depend_Code_ASTTypeNode
* @return PHP_Depend_Code_ASTType
* @since 0.9.6
*/
private function _parseFieldDeclarationType()
Expand Down
Expand Up @@ -49,7 +49,7 @@
require_once dirname(__FILE__) . '/ASTNodeTest.php';

/**
* Test case for the {@link PHP_Depend_Code_ASTTypeNode} class.
* Test case for the {@link PHP_Depend_Code_ASTType} class.
*
* @category PHP
* @package PHP_Depend
Expand All @@ -60,12 +60,12 @@
* @version Release: @package_version@
* @link http://www.pdepend.org/
*
* @covers PHP_Depend_Code_ASTTypeNode
* @covers PHP_Depend_Code_ASTType
* @group pdepend
* @group pdepend::ast
* @group unittest
*/
class PHP_Depend_Code_ASTTypeNodeTest extends PHP_Depend_Code_ASTNodeTest
class PHP_Depend_Code_ASTTypeTest extends PHP_Depend_Code_ASTNodeTest
{
/**
* testIsArrayReturnsFalseByDefault
Expand All @@ -74,7 +74,7 @@ class PHP_Depend_Code_ASTTypeNodeTest extends PHP_Depend_Code_ASTNodeTest
*/
public function testIsArrayReturnsFalseByDefault()
{
$type = new PHP_Depend_Code_ASTTypeNode();
$type = new PHP_Depend_Code_ASTType();
self::assertFalse($type->isArray());
}

Expand All @@ -85,7 +85,7 @@ public function testIsArrayReturnsFalseByDefault()
*/
public function testIsPrimitiveReturnsFalseByDefault()
{
$type = new PHP_Depend_Code_ASTTypeNode();
$type = new PHP_Depend_Code_ASTType();
self::assertFalse($type->isPrimitive());
}
}
4 changes: 2 additions & 2 deletions src/test/php/PHP/Depend/Code/AllTests.php
Expand Up @@ -119,7 +119,7 @@
require_once dirname(__FILE__) . '/ASTSwitchLabelTest.php';
require_once dirname(__FILE__) . '/ASTThrowStatementTest.php';
require_once dirname(__FILE__) . '/ASTTryStatementTest.php';
require_once dirname(__FILE__) . '/ASTTypeNodeTest.php';
require_once dirname(__FILE__) . '/ASTTypeTest.php';
require_once dirname(__FILE__) . '/ASTUnaryExpressionTest.php';
require_once dirname(__FILE__) . '/ASTUnsetStatementTest.php';
require_once dirname(__FILE__) . '/ASTVariableTest.php';
Expand Down Expand Up @@ -261,7 +261,7 @@ public static function suite()
$suite->addTestSuite('PHP_Depend_Code_ASTSwitchLabelTest');
$suite->addTestSuite('PHP_Depend_Code_ASTThrowStatementTest');
$suite->addTestSuite('PHP_Depend_Code_ASTTryStatementTest');
$suite->addTestSuite('PHP_Depend_Code_ASTTypeNodeTest');
$suite->addTestSuite('PHP_Depend_Code_ASTTypeTest');
$suite->addTestSuite('PHP_Depend_Code_ASTUnaryExpressionTest');
$suite->addTestSuite('PHP_Depend_Code_ASTUnsetStatementTest');
$suite->addTestSuite('PHP_Depend_Code_ASTVariableTest');
Expand Down
Expand Up @@ -87,7 +87,7 @@ public function testParserSetsExpectedPrimitivePropertyType($actual, $expected)
->getClasses()
->current()
->getFirstChildOfType(PHP_Depend_Code_ASTFieldDeclaration::CLAZZ)
->getFirstChildOfType(PHP_Depend_Code_ASTTypeNode::CLAZZ);
->getFirstChildOfType(PHP_Depend_Code_ASTType::CLAZZ);

$this->assertEquals($expected, $type->getImage());
}
Expand All @@ -105,7 +105,7 @@ public function testParserSetsExpectedArrayPropertyType()
->getClasses()
->current()
->getFirstChildOfType(PHP_Depend_Code_ASTFieldDeclaration::CLAZZ)
->getFirstChildOfType(PHP_Depend_Code_ASTTypeNode::CLAZZ);
->getFirstChildOfType(PHP_Depend_Code_ASTType::CLAZZ);

$this->assertTrue($type->isArray());
}
Expand All @@ -123,7 +123,7 @@ public function testParserSetsExpectedArrayWithParenthesisPropertyType()
->getClasses()
->current()
->getFirstChildOfType(PHP_Depend_Code_ASTFieldDeclaration::CLAZZ)
->getFirstChildOfType(PHP_Depend_Code_ASTTypeNode::CLAZZ);
->getFirstChildOfType(PHP_Depend_Code_ASTType::CLAZZ);

$this->assertTrue($type->isArray());
}
Expand All @@ -148,4 +148,4 @@ public static function dataProviderParserSetsExpectedPrimitivePropertyType()
array('true', 'boolean'),
);
}
}
}

0 comments on commit f5c9fc3

Please sign in to comment.