Skip to content

Commit

Permalink
Do not analyse method calls via dynamic property fetch
Browse files Browse the repository at this point in the history
closes #56
  • Loading branch information
mihaeu committed Oct 20, 2019
1 parent efc18b9 commit 9f439fa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [0.6.2] - 2019-10-20
### Fixed
- Do not analyse method calls via dynamic property fetch [#50](https://github.com/mihaeu/dephpend/issues/56)

## [0.6.1] - 2019-07-14
### Added
- Added filename to parser exception message
Expand Down Expand Up @@ -76,7 +80,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- first tagged release
- uml, text, dsm and metrics command

[Unreleased]: https://github.com/mihaeu/dephpend/compare/0.6.1...HEAD
[Unreleased]: https://github.com/mihaeu/dephpend/compare/0.6.2...HEAD
[0.6.2]: https://github.com/mihaeu/dephpend/compare/0.6.1...0.6.2
[0.6.1]: https://github.com/mihaeu/dephpend/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/mihaeu/dephpend/compare/0.5.1...0.6.0
[0.5.1]: https://github.com/mihaeu/dephpend/compare/0.5.0...0.5.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $ php -n dephpend.phar
__| | ___| |__) | |__| | |__) |__ _ __ __| |
/ _` |/ _ \ ___/| __ | ___/ _ \ '_ \ / _` |
| (_| | __/ | | | | | | | __/ | | | (_| |
\__,_|\___|_| |_| |_|_| \___|_| |_|\__,_| version 0.6.1
\__,_|\___|_| |_| |_|_| \___|_| |_|\__,_| version 0.6.2
Usage:
command [options] [arguments]
Expand Down
2 changes: 1 addition & 1 deletion bin/dephpend
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $name = <<<EOT
EOT;

$dependencyContainer = new DependencyContainer($internals);
$application = new Application($name, '0.6.1', $dependencyContainer->dispatcher());
$application = new Application($name, '0.6.2', $dependencyContainer->dispatcher());
$application->add($dependencyContainer->umlCommand());
$application->add($dependencyContainer->dotCommand());
$application->add($dependencyContainer->dsmCommand());
Expand Down
7 changes: 4 additions & 3 deletions src/Analyser/DependencyInspectionVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
use Mihaeu\PhpDependencies\Dependencies\DependencyMap;
use Mihaeu\PhpDependencies\Dependencies\DependencySet;
use PhpParser\Node;
use PhpParser\Node\Expr\ClassConstFetch as FetchClassConstantNode;
use PhpParser\Node\Expr\Instanceof_ as InstanceofNode;
use PhpParser\Node\Expr\New_ as NewNode;
use PhpParser\Node\Expr\ClassConstFetch as FetchClassConstantNode;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\StaticCall as StaticCallNode;
use PhpParser\Node\Name as NameNode;
use PhpParser\Node\Name;
use PhpParser\Node\Name as NameNode;
use PhpParser\Node\Stmt\Catch_ as CatchNode;
use PhpParser\Node\Stmt\Class_ as ClassNode;
use PhpParser\Node\Stmt\ClassLike as ClassLikeNode;
Expand Down Expand Up @@ -85,7 +85,8 @@ public function enterNode(Node $node)
} elseif ($node instanceof InstanceofNode) {
$this->addInstanceofDependency($node);
} elseif ($node instanceof FetchClassConstantNode
&& !$node->class instanceof Node\Expr\Variable) {
&& !$node->class instanceof Node\Expr\Variable
&& !$node->class instanceof Node\Expr\PropertyFetch) {
$this->addName($node->class);
} elseif ($node instanceof CatchNode) {
foreach ($node->types as $name) {
Expand Down

0 comments on commit 9f439fa

Please sign in to comment.