Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-tech committed Nov 5, 2023
1 parent 33fe782 commit f209d16
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

declare(strict_types=1);

namespace AndreyTech\Pdepend\Summary\Formatter;

use AndreyTech\Pdepend\Summary\Formatter\Parser\ClassMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\MethodMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\PackageMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\ProjectMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\ProjectMiMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\TraitMetrics;
namespace AndreyTech\Pdepend\Summary\Extractor;

use AndreyTech\Pdepend\Summary\Extractor\Parser\ClassMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\MethodMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\PackageMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\ProjectMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\ProjectMiMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\TraitMetrics;
use Exception;
use SimpleXMLElement;

Expand Down Expand Up @@ -55,7 +55,9 @@ private function parseProject(SimpleXMLElement $xml): ProjectMetrics

private function parsePackages(SimpleXMLElement $xml, ProjectMetrics $projectMetrics): void
{
/** @var SimpleXMLElement|null $packages */
$packages = $xml->package;

if (null === $packages) {
return;
}
Expand All @@ -71,7 +73,9 @@ private function parsePackages(SimpleXMLElement $xml, ProjectMetrics $projectMet

private function parseClasses(SimpleXMLElement $package, PackageMetrics $packageMetrics): void
{
/** @var SimpleXMLElement|null $classes */
$classes = $package->class;

if (null === $classes) {
return;
}
Expand All @@ -80,7 +84,9 @@ private function parseClasses(SimpleXMLElement $package, PackageMetrics $package
$classMetrics = $this->buildClassMetrics($class);
$packageMetrics->addClassMetrics($classMetrics);

/** @var SimpleXMLElement|null $methods */
$methods = $class->method;

if (null === $methods) {
continue;
}
Expand All @@ -93,7 +99,9 @@ private function parseClasses(SimpleXMLElement $package, PackageMetrics $package

private function parseTraits(SimpleXMLElement $package, PackageMetrics $packageMetrics): void
{
/** @var SimpleXMLElement|null $traits */
$traits = $package->trait;

if (null === $traits) {
return;
}
Expand All @@ -102,7 +110,9 @@ private function parseTraits(SimpleXMLElement $package, PackageMetrics $packageM
$traitMetrics = $this->buildTraitMetrics($trait);
$packageMetrics->addTraitMetrics($traitMetrics);

/** @var SimpleXMLElement|null $methods */
$methods = $trait->method;

if (null === $methods) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

namespace AndreyTech\Pdepend\Summary\Formatter\Parser;
namespace AndreyTech\Pdepend\Summary\Extractor\Parser;

final class ClassMetrics
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

namespace AndreyTech\Pdepend\Summary\Formatter\Parser;
namespace AndreyTech\Pdepend\Summary\Extractor\Parser;

final class MethodMetrics
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

namespace AndreyTech\Pdepend\Summary\Formatter\Parser;
namespace AndreyTech\Pdepend\Summary\Extractor\Parser;

final class PackageMetrics
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

namespace AndreyTech\Pdepend\Summary\Formatter\Parser;
namespace AndreyTech\Pdepend\Summary\Extractor\Parser;

final class ProjectMetrics
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

namespace AndreyTech\Pdepend\Summary\Formatter\Parser;
namespace AndreyTech\Pdepend\Summary\Extractor\Parser;

final class ProjectMiMetrics
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

declare(strict_types=1);

namespace AndreyTech\Pdepend\Summary\Formatter\Parser;
namespace AndreyTech\Pdepend\Summary\Extractor\Parser;

final class TraitMetrics
{
Expand Down
3 changes: 2 additions & 1 deletion src/AndreyTech/Pdepend/Summary/Formatter/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

namespace AndreyTech\Pdepend\Summary\Formatter;

use AndreyTech\Pdepend\Summary\Formatter\Parser\ProjectMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser;
use AndreyTech\Pdepend\Summary\Extractor\Parser\ProjectMetrics;
use Exception;
use RuntimeException;
use Symfony\Component\Console\Output\ConsoleOutput;
Expand Down
8 changes: 4 additions & 4 deletions src/AndreyTech/Pdepend/Summary/Formatter/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

namespace AndreyTech\Pdepend\Summary\Formatter;

use AndreyTech\Pdepend\Summary\Formatter\Parser\ClassMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\MethodMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\ProjectMetrics;
use AndreyTech\Pdepend\Summary\Formatter\Parser\TraitMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\ClassMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\MethodMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\ProjectMetrics;
use AndreyTech\Pdepend\Summary\Extractor\Parser\TraitMetrics;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableStyle;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down

0 comments on commit f209d16

Please sign in to comment.