1111
1212namespace DTL \Bundle \PhpcrMigrations \Command ;
1313
14- use Symfony \Bundle \FrameworkBundle \Command \ContainerAwareCommand ;
15- use Symfony \Component \Console \Helper \TableHelper ;
14+ use PHPCR \Migrations \VersionFinder ;
15+ use PHPCR \Migrations \VersionStorage ;
16+ use Symfony \Component \Console \Command \Command ;
17+ use Symfony \Component \Console \Helper \Table ;
1618use Symfony \Component \Console \Input \InputInterface ;
1719use Symfony \Component \Console \Output \OutputInterface ;
1820
19- class StatusCommand extends ContainerAwareCommand
21+ class StatusCommand extends Command
2022{
2123 private $ versionStorage ;
2224 private $ finder ;
2325
26+ public function __construct (
27+ VersionStorage $ versionStorage ,
28+ VersionFinder $ finder
29+ ) {
30+ parent ::__construct ();
31+ $ this ->versionStorage = $ versionStorage ;
32+ $ this ->finder = $ finder ;
33+ }
2434
2535 public function configure ()
2636 {
@@ -40,14 +50,11 @@ public function configure()
4050
4151 public function execute (InputInterface $ input , OutputInterface $ output )
4252 {
43- $ this ->versionStorage = $ this ->getContainer ()->get ('phpcr_migrations.version_storage ' );
44- $ this ->finder = $ this ->getContainer ()->get ('phpcr_migrations.version_finder ' );
45-
4653 $ versionCollection = $ this ->finder ->getCollection ();
4754 $ executedVersions = (array ) $ this ->versionStorage ->getPersistedVersions ();
4855 $ currentVersion = $ this ->versionStorage ->getCurrentVersion ();
4956
50- $ table = new TableHelper ( );
57+ $ table = new Table ( $ output );
5158 $ table ->setHeaders (array (
5259 '' , 'Version ' , 'Date ' , 'Migrated ' , 'Path ' ,
5360 ));
@@ -63,7 +70,7 @@ public function execute(InputInterface $input, OutputInterface $output)
6370 ));
6471 }
6572
66- $ table ->render ($ output );
73+ $ table ->render ();
6774
6875 if ($ currentVersion ) {
6976 $ output ->writeln (sprintf ('<info>Current:</info> %s (%s) ' , $ currentVersion , $ this ->getDate ($ currentVersion )));
0 commit comments