Skip to content

Commit

Permalink
Merge pull request #188 from tienvx/optimize-imports-and-clean-up-code
Browse files Browse the repository at this point in the history
Optimize imports and clean up code
  • Loading branch information
tienvx committed Mar 19, 2019
2 parents 0ebdb19 + 4038fa5 commit 9fce0ce
Show file tree
Hide file tree
Showing 25 changed files with 16 additions and 107 deletions.
2 changes: 1 addition & 1 deletion src/Command/CreateBugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Tienvx\Bundle\MbtBundle\Command;

use Exception;
use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/GeneratePathCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Workflow\Registry;
use Tienvx\Bundle\MbtBundle\Graph\Path;
use Tienvx\Bundle\MbtBundle\Generator\GeneratorManager;
use Tienvx\Bundle\MbtBundle\Graph\Path;
use Tienvx\Bundle\MbtBundle\Subject\SubjectManager;

class GeneratePathCommand extends AbstractCommand
Expand Down
2 changes: 1 addition & 1 deletion src/Command/GraphDumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Workflow\Workflow;
use Tienvx\Bundle\MbtBundle\Graph\Dumper\PlantUmlDumper;
use Tienvx\Bundle\MbtBundle\Graph\Dumper\GraphvizDumper;
use Tienvx\Bundle\MbtBundle\Graph\Dumper\PlantUmlDumper;
use Tienvx\Bundle\MbtBundle\Helper\VertexHelper;
use Tienvx\Bundle\MbtBundle\Service\GraphBuilder;

Expand Down
3 changes: 1 addition & 2 deletions src/Command/ReduceBugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Tienvx\Bundle\MbtBundle\Command;

use Exception;
use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Messenger\MessageBusInterface;
use Tienvx\Bundle\MbtBundle\Entity\Bug;
use Tienvx\Bundle\MbtBundle\Message\UpdateBugStatusMessage;
use Tienvx\Bundle\MbtBundle\PathReducer\PathReducerManager;

class ReduceBugCommand extends AbstractCommand
Expand Down
1 change: 0 additions & 1 deletion src/Command/ReducePathCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Tienvx\Bundle\MbtBundle\Message\ReducePathMessage;
use Tienvx\Bundle\MbtBundle\PathReducer\PathReducerManager;

class ReducePathCommand extends AbstractCommand
Expand Down
3 changes: 1 addition & 2 deletions src/Command/RemoveScreenshotsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace Tienvx\Bundle\MbtBundle\Command;

use Exception;
use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Tienvx\Bundle\MbtBundle\Entity\Bug;
use Tienvx\Bundle\MbtBundle\Subject\SubjectManager;

class RemoveScreenshotsCommand extends Command
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ReportBugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Tienvx\Bundle\MbtBundle\Command;

use Exception;
use Doctrine\ORM\EntityManagerInterface;
use Exception;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Compiler/GeneratorPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Tienvx\Bundle\MbtBundle\DependencyInjection\Compiler;

use Exception;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;

class GeneratorPass implements CompilerPassInterface
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Compiler/PathReducerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Tienvx\Bundle\MbtBundle\DependencyInjection\Compiler;

use Exception;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;

class PathReducerPass implements CompilerPassInterface
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyInjection/Compiler/SecurityTokenPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace Tienvx\Bundle\MbtBundle\DependencyInjection\Compiler;

use Exception;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Tienvx\Bundle\MbtBundle\Command\CaptureScreenshotsCommand;
use Tienvx\Bundle\MbtBundle\Command\ExecuteTaskCommand;
use Tienvx\Bundle\MbtBundle\Command\GeneratePathCommand;
use Tienvx\Bundle\MbtBundle\Command\ReducePathCommand;
use Tienvx\Bundle\MbtBundle\Command\ReduceBugCommand;
use Tienvx\Bundle\MbtBundle\Command\ReducePathCommand;

class SecurityTokenPass implements CompilerPassInterface
{
Expand Down
3 changes: 1 addition & 2 deletions src/DependencyInjection/Compiler/SubjectPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
namespace Tienvx\Bundle\MbtBundle\DependencyInjection\Compiler;

use Exception;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Tienvx\Bundle\MbtBundle\Subject\SubjectInterface;

class SubjectPass implements CompilerPassInterface
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/TienvxMbtExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Tienvx\Bundle\MbtBundle\Command\ExecuteTaskCommand;
use Tienvx\Bundle\MbtBundle\Generator\GeneratorInterface;
use Tienvx\Bundle\MbtBundle\Generator\RandomGenerator;
use Tienvx\Bundle\MbtBundle\Generator\ProbabilityGenerator;
use Tienvx\Bundle\MbtBundle\Generator\RandomGenerator;
use Tienvx\Bundle\MbtBundle\PathReducer\PathReducerInterface;
use Tienvx\Bundle\MbtBundle\Subject\SubjectInterface;

Expand Down
30 changes: 0 additions & 30 deletions src/Event/ReducerFinishEvent.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/EventListener/EntitySubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Symfony\Component\Messenger\MessageBusInterface;
use Tienvx\Bundle\MbtBundle\Entity\Bug;
use Tienvx\Bundle\MbtBundle\Entity\Task;
use Tienvx\Bundle\MbtBundle\Message\ReduceBugMessage;
use Tienvx\Bundle\MbtBundle\Message\ExecuteTaskMessage;
use Tienvx\Bundle\MbtBundle\Message\ReduceBugMessage;
use Tienvx\Bundle\MbtBundle\Message\RemoveScreenshotsMessage;

class EntitySubscriber implements EventSubscriber
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/WorkflowSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Tienvx\Bundle\MbtBundle\EventListener;

use Exception;
use Doctrine\Common\Annotations\Reader;
use Exception;
use ReflectionMethod;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Workflow\Event\Event;
Expand Down
2 changes: 0 additions & 2 deletions src/Generator/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Tienvx\Bundle\MbtBundle\Generator;

use Generator;
use Symfony\Component\Workflow\Exception\TransitionException;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\Workflow;
use Tienvx\Bundle\MbtBundle\Subject\AbstractSubject;

Expand Down
1 change: 0 additions & 1 deletion src/Maker/MakeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tienvx\Bundle\MbtBundle\Maker;

use Doctrine\Common\Annotations\Annotation;
use Symfony\Bundle\MakerBundle\ConsoleStyle;
use Symfony\Bundle\MakerBundle\DependencyBuilder;
use Symfony\Bundle\MakerBundle\Generator;
Expand Down
1 change: 0 additions & 1 deletion src/Maker/MakePathReducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Tienvx\Bundle\MbtBundle\Maker;

use Doctrine\Common\Annotations\Annotation;
use Symfony\Bundle\MakerBundle\ConsoleStyle;
use Symfony\Bundle\MakerBundle\DependencyBuilder;
use Symfony\Bundle\MakerBundle\Generator;
Expand Down
2 changes: 1 addition & 1 deletion src/Service/GraphBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Fhaculty\Graph\Graph;
use Fhaculty\Graph\Vertex;
use Graphp\Algorithms\ConnectedComponents;
use Psr\SimpleCache\CacheInterface;
use Psr\SimpleCache\CacheException;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Workflow\StateMachine;
use Symfony\Component\Workflow\Transition;
use Symfony\Component\Workflow\Workflow;
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Constraints/PathValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function validate($value, Constraint $constraint)
GraphPath::unserialize($value);
} catch (Exception $exception) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ string }}', $value)
->setParameter('{{ string }}', json_encode($value))
->addViolation();
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Validator/Constraints/ReducerValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Tienvx\Bundle\MbtBundle\Generator\GeneratorManager;
use Tienvx\Bundle\MbtBundle\PathReducer\PathReducerManager;

/**
Expand Down
13 changes: 0 additions & 13 deletions src/Validator/Constraints/Unique.php

This file was deleted.

37 changes: 0 additions & 37 deletions src/Validator/Constraints/UniqueValidator.php

This file was deleted.

1 change: 0 additions & 1 deletion tests/Message/BugMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Tienvx\Bundle\MbtBundle\Tests\Message;

use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Console\Tester\CommandTester;
use Tienvx\Bundle\MbtBundle\Entity\Bug;
use Tienvx\Bundle\MbtBundle\Entity\Task;
use Tienvx\Bundle\MbtBundle\Graph\Path;
Expand Down
1 change: 0 additions & 1 deletion tests/app/src/Command/CommandRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\NullOutput;
use Tienvx\Bundle\MbtBundle\Command\CommandRunner as BaseCommandRunner;

Expand Down

0 comments on commit 9fce0ce

Please sign in to comment.