Skip to content

ASTVisitor::visitClass() should accept ASTEnum class or an relevant interface. #623

@lisfox1

Description

@lisfox1
  • PHP Depend version: 2.11.0/master
  • PHP Version: 8.1.9
  • Installation type: composer
  • Operating System / Distribution & Version: macOS Monterey Version 12.1

Current Behavior

When calling PDepend\Source\AST\ASTEnum::accept it returns a TypeError.
TypeError : PDepend\Source\ASTVisitor\AbstractASTVisitor::visitClass(): Argument #1 ($class) must be of type PDepend\Source\AST\ASTClass, PDepend\Source\AST\ASTEnum given

Expected Behavior

N/A

Steps To Reproduce:

$class = new \PDepend\Source\AST\ASTEnum('test', new \PDepend\Source\AST\ASTScalarType('string'));
$class->accept(new \PDepend\Metrics\Analyzer\CodeRankAnalyzer\PropertyStrategy());

Checks before submitting

  • Be sure that there isn't already an issue about this. See: Issues list
  • Be sure that there isn't already a pull request about this. See: Pull requests
  • I have added every step to reproduce the bug.
  • If possible I added relevant code examples.
  • This issue is about 1 bug and nothing more.
  • The issue has a descriptive title. For example: "Default value is not available in AST when it's an array".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions