diff --git a/UPGRADE-2.5.md b/UPGRADE-2.5.md index 14323cc88307a..a9431f85facc3 100644 --- a/UPGRADE-2.5.md +++ b/UPGRADE-2.5.md @@ -1,6 +1,13 @@ UPGRADE FROM 2.4 to 2.5 ======================= +FrameworkBundle +--------------- + +* The `Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor::renderTable()` + method expects the table to be an instance of `Symfony\Component\Console\Helper\Table` + instead of `Symfony\Component\Console\Helper\TableHelper`. + Routing ------- diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php index 7aaea0b9c3df6..35087e476d40f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php @@ -12,7 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor; use Symfony\Component\Console\Descriptor\DescriptorInterface; -use Symfony\Component\Console\Helper\TableHelper; +use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -71,6 +71,16 @@ public function describe(OutputInterface $output, $object, array $options = arra } } + /** + * Returns the output. + * + * @return OutputInterface The output + */ + protected function getOutput() + { + return $this->output; + } + /** * Writes content to output. * @@ -85,17 +95,18 @@ protected function write($content, $decorated = false) /** * Writes content to output. * - * @param TableHelper $table - * @param bool $decorated + * @param Table $table + * @param bool $decorated */ - protected function renderTable(TableHelper $table, $decorated = false) + protected function renderTable(Table $table, $decorated = false) { if (!$decorated) { - $table->setCellRowFormat('%s'); - $table->setCellHeaderFormat('%s'); + $table->getStyle()->setCellRowFormat('%s'); + $table->getStyle()->setCellRowContentFormat('%s'); + $table->getStyle()->setCellHeaderFormat('%s'); } - $table->render($this->output); + $table->render(); } /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index 67cb356bc39ba..3daa77f0ae22e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -11,7 +11,7 @@ namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor; -use Symfony\Component\Console\Helper\TableHelper; +use Symfony\Component\Console\Helper\Table; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; @@ -31,8 +31,8 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio { $showControllers = isset($options['show_controllers']) && $options['show_controllers']; $headers = array('Name', 'Method', 'Scheme', 'Host', 'Path'); - $table = new TableHelper(); - $table->setLayout(TableHelper::LAYOUT_COMPACT); + $table = new Table($this->getOutput()); + $table->setStyle('compact'); $table->setHeaders($showControllers ? array_merge($headers, array('Controller')) : $headers); foreach ($routes->all() as $name => $route) { @@ -99,8 +99,8 @@ protected function describeRoute(Route $route, array $options = array()) */ protected function describeContainerParameters(ParameterBag $parameters, array $options = array()) { - $table = new TableHelper(); - $table->setLayout(TableHelper::LAYOUT_COMPACT); + $table = new Table($this->getOutput()); + $table->setStyle('compact'); $table->setHeaders(array('Parameter', 'Value')); foreach ($this->sortParameters($parameters) as $parameter => $value) { @@ -200,8 +200,8 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o $tagsCount = count($maxTags); $tagsNames = array_keys($maxTags); - $table = new TableHelper(); - $table->setLayout(TableHelper::LAYOUT_COMPACT); + $table = new Table($this->getOutput()); + $table->setStyle('compact'); $table->setHeaders(array_merge(array('Service ID'), $tagsNames, array('Scope', 'Class name'))); foreach ($this->sortServiceIds($serviceIds) as $serviceId) { diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index e6a3b644a86b8..ce8eccf59e0b0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -33,7 +33,7 @@ }, "require-dev": { "symfony/browser-kit": "~2.4", - "symfony/console": "~2.4,>=2.4.8", + "symfony/console": "~2.5,>=2.5.2", "symfony/css-selector": "~2.0,>=2.0.5", "symfony/dom-crawler": "~2.0,>=2.0.5", "symfony/finder": "~2.0,>=2.0.5",