-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #527 from qossmic/debug-commands
adds debug commands for layer and class-likes
- Loading branch information
Showing
27 changed files
with
640 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="php-cs-fixer" version="^2.16.3" installed="2.18.2" location="./tools/php-cs-fixer" copy="true"/> | ||
<phar name="phpunit" version="^8.5.13" installed="8.5.14" location="./tools/phpunit.phar" copy="true"/> | ||
<phar name="phpstan" version="^0.12.29" installed="0.12.79" location="./tools/phpstan" copy="true"/> | ||
<phar name="psalm" version="^4.3.0" installed="4.5.1" location="./tools/psalm" copy="true"/> | ||
<phar name="php-cs-fixer" version="^2.16.3" installed="2.18.5" location="./tools/php-cs-fixer" copy="true"/> | ||
<phar name="phpunit" version="^8.5.13" installed="8.5.15" location="./tools/phpunit.phar" copy="true"/> | ||
<phar name="phpstan" version="^0.12.29" installed="0.12.83" location="./tools/phpstan" copy="true"/> | ||
<phar name="psalm" version="^4.3.0" installed="4.7.0" location="./tools/psalm" copy="true"/> | ||
<phar name="box-project/box" version="^3.12.2" installed="3.12.2" location="./tools/box" copy="true"/> | ||
<phar name="infection" version="^0.20.1" installed="0.21.0" location="./tools/infection" copy="true"/> | ||
</phive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Qossmic\Deptrac; | ||
|
||
use Qossmic\Deptrac\AstRunner\AstMap\ClassLikeName; | ||
use Qossmic\Deptrac\AstRunner\AstRunner; | ||
use Qossmic\Deptrac\Configuration\Configuration; | ||
|
||
class ClassLikeAnalyser | ||
{ | ||
private $astRunner; | ||
private $fileResolver; | ||
private $classLikeLayerResolverFactory; | ||
|
||
public function __construct( | ||
AstRunner $astRunner, | ||
FileResolver $fileResolver, | ||
ClassLikeLayerResolverFactory $classLikeLayerResolverFactory | ||
) { | ||
$this->astRunner = $astRunner; | ||
$this->fileResolver = $fileResolver; | ||
$this->classLikeLayerResolverFactory = $classLikeLayerResolverFactory; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function analyse(Configuration $configuration, ClassLikeName $classLikeName): array | ||
{ | ||
$astMap = $this->astRunner->createAstMapByFiles($this->fileResolver->resolve($configuration)); | ||
|
||
return $this->classLikeLayerResolverFactory | ||
->create($configuration, $astMap) | ||
->getLayersByClassLikeName($classLikeName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Qossmic\Deptrac; | ||
|
||
use Qossmic\Deptrac\AstRunner\AstMap; | ||
use Qossmic\Deptrac\Collector\Registry; | ||
use Qossmic\Deptrac\Configuration\Configuration; | ||
use Qossmic\Deptrac\Configuration\ParameterResolver; | ||
|
||
class ClassLikeLayerResolverFactory | ||
{ | ||
private $registry; | ||
private $parameterResolver; | ||
|
||
public function __construct(Registry $registry, ParameterResolver $parameterResolver) | ||
{ | ||
$this->registry = $registry; | ||
$this->parameterResolver = $parameterResolver; | ||
} | ||
|
||
public function create(Configuration $configuration, AstMap $astMap): ClassLikeLayerResolverInterface | ||
{ | ||
return new MemoizedClassLikeLayerResolver( | ||
new ClassLikeLayerResolver( | ||
$configuration, | ||
$astMap, | ||
$this->registry, | ||
$this->parameterResolver | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.