Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0f66a54

Browse filesBrowse files
committed
[FrameworkBundle] Removed the use of TableHelper
1 parent 9ca3e8b commit 0f66a54
Copy full SHA for 0f66a54

39 files changed

+84
-73
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ abstract class Descriptor implements DescriptorInterface
3030
/**
3131
* @var OutputInterface
3232
*/
33-
private $output;
33+
protected $output;
3434

3535
/**
3636
* {@inheritdoc}

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+12-16Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;
1313

14-
use Symfony\Component\Console\Helper\TableHelper;
14+
use Symfony\Component\Console\Helper\Table;
1515
use Symfony\Component\DependencyInjection\Alias;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\DependencyInjection\Definition;
@@ -32,8 +32,8 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
3232
{
3333
$showControllers = isset($options['show_controllers']) && $options['show_controllers'];
3434
$headers = array('Name', 'Method', 'Scheme', 'Host', 'Path');
35-
$table = new TableHelper();
36-
$table->setLayout(TableHelper::LAYOUT_COMPACT);
35+
36+
$table = new Table($this->output);
3737
$table->setHeaders($showControllers ? array_merge($headers, array('Controller')) : $headers);
3838

3939
foreach ($routes->all() as $name => $route) {
@@ -59,7 +59,7 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
5959
}
6060

6161
$this->writeText($this->formatSection('router', 'Current routes')."\n", $options);
62-
$this->renderTable($table, !(isset($options['raw_output']) && $options['raw_output']));
62+
$table->render();
6363
}
6464

6565
/**
@@ -100,16 +100,15 @@ protected function describeRoute(Route $route, array $options = array())
100100
*/
101101
protected function describeContainerParameters(ParameterBag $parameters, array $options = array())
102102
{
103-
$table = new TableHelper();
104-
$table->setLayout(TableHelper::LAYOUT_COMPACT);
103+
$table = new Table($this->output);
105104
$table->setHeaders(array('Parameter', 'Value'));
106105

107106
foreach ($this->sortParameters($parameters) as $parameter => $value) {
108107
$table->addRow(array($parameter, $this->formatParameter($value)));
109108
}
110109

111110
$this->writeText($this->formatSection('container', 'List of parameters')."\n", $options);
112-
$this->renderTable($table, !(isset($options['raw_output']) && $options['raw_output']));
111+
$table->render();
113112
}
114113

115114
/**
@@ -201,8 +200,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
201200
$tagsCount = count($maxTags);
202201
$tagsNames = array_keys($maxTags);
203202

204-
$table = new TableHelper();
205-
$table->setLayout(TableHelper::LAYOUT_COMPACT);
203+
$table = new Table($this->output);
206204
$table->setHeaders(array_merge(array('Service ID'), $tagsNames, array('Class name')));
207205

208206
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
@@ -232,7 +230,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
232230
}
233231
}
234232

235-
$this->renderTable($table);
233+
$table->render();
236234
}
237235

238236
/**
@@ -302,31 +300,29 @@ protected function describeEventDispatcherListeners(EventDispatcherInterface $ev
302300
$this->writeText($this->formatSection('event_dispatcher', $label)."\n", $options);
303301

304302
$registeredListeners = $eventDispatcher->getListeners($event);
303+
$table = new Table($this->output);
304+
305305
if (null !== $event) {
306306
$this->writeText("\n");
307-
$table = new TableHelper();
308307
$table->setHeaders(array('Order', 'Callable'));
309308

310309
foreach ($registeredListeners as $order => $listener) {
311310
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($listener)));
312311
}
313-
314-
$this->renderTable($table);
315312
} else {
316313
ksort($registeredListeners);
317314
foreach ($registeredListeners as $eventListened => $eventListeners) {
318315
$this->writeText(sprintf("\n<info>[Event]</info> %s\n", $eventListened), $options);
319316

320-
$table = new TableHelper();
321317
$table->setHeaders(array('Order', 'Callable'));
322318

323319
foreach ($eventListeners as $order => $eventListener) {
324320
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener)));
325321
}
326-
327-
$this->renderTable($table);
328322
}
329323
}
324+
325+
$table->render();
330326
}
331327

332328
/**

‎src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private function assertDescription($expectedDescription, $describedObject, array
137137
if ('json' === $this->getFormat()) {
138138
$this->assertEquals(json_decode($expectedDescription), json_decode($output->fetch()));
139139
} else {
140-
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
140+
$this->assertEquals($expectedDescription, $output->fetch());
141141
}
142142
}
143143

+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
- Service: `service_1`
2-
- Public: yes
2+
- Public: yes
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
- Service: `service_2`
2-
- Public: no
2+
- Public: no

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ alias_2
3232
Services
3333
--------
3434
35-
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
35+
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<info>[container]</info> <comment>Public</comment> services
2-
Service ID Class name
3-
alias_1 alias for "service_1"
4-
alias_2 alias for "service_2"
5-
definition_1 Full\Qualified\Class1
6-
service_container Symfony\Component\DependencyInjection\ContainerBuilder
2+
+-------------------+--------------------------------------------------------+
3+
| Service ID | Class name |
4+
+-------------------+--------------------------------------------------------+
5+
| alias_1 | alias for "service_1" |
6+
| alias_2 | alias for "service_2" |
7+
| definition_1 | Full\Qualified\Class1 |
8+
| service_container | Symfony\Component\DependencyInjection\ContainerBuilder |
9+
+-------------------+--------------------------------------------------------+

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ alias_2
4747
Services
4848
--------
4949

50-
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
50+
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<info>[container]</info> <comment>Public</comment> and <comment>private</comment> services
2-
Service ID Class name
3-
alias_1 alias for "service_1"
4-
alias_2 alias for "service_2"
5-
definition_1 Full\Qualified\Class1
6-
definition_2 Full\Qualified\Class2
7-
service_container Symfony\Component\DependencyInjection\ContainerBuilder
8-
2+
+-------------------+--------------------------------------------------------+
3+
| Service ID | Class name |
4+
+-------------------+--------------------------------------------------------+
5+
| alias_1 | alias for "service_1" |
6+
| alias_2 | alias for "service_2" |
7+
| definition_1 | Full\Qualified\Class1 |
8+
| definition_2 | Full\Qualified\Class2 |
9+
| service_container | Symfony\Component\DependencyInjection\ContainerBuilder |
10+
+-------------------+--------------------------------------------------------+
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<info>[container]</info> <comment>Public</comment> and <comment>private</comment> services with tag <info>tag1</info>
2-
Service ID attr1 attr2 attr3 Class name
3-
definition_2 val1 val2 Full\Qualified\Class2
4-
" val3
2+
+--------------+-------+-------+-------+-----------------------+
3+
| Service ID | attr1 | attr2 | attr3 | Class name |
4+
+--------------+-------+-------+-------+-----------------------+
5+
| definition_2 | val1 | val2 | | Full\Qualified\Class2 |
6+
| " | | | val3 | |
7+
+--------------+-------+-------+-------+-----------------------+
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
12
- Type: `function`
23
- Name: `array_key_exists`
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
array_key_exists()
1+
array_key_exists()

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/callable_2.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/callable_2.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
- Type: `function`
23
- Name: `staticMethod`
34
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
1+
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
- Type: `function`
23
- Name: `method`
34
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::method()
1+
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::method()

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/callable_4.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/callable_4.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
- Type: `function`
23
- Name: `staticMethod`
34
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
1+
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/callable_5.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/callable_5.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
- Type: `function`
23
- Name: `staticMethod`
34
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass`
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass::parent::staticMethod()
1+
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass::parent::staticMethod()
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
12
- Type: `closure`
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
\Closure()
1+
\Closure()
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
12
- Type: `object`
23
- Name: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
3-
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke()
1+
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke()
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- Class: `Full\Qualified\Class1`
22
- Scope: `container`
33
- Public: yes
4-
- Synthetic: no
4+
- Synthetic: no

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
- Attr2: val2
99
- Tag: `tag1`
1010
- Attr3: val3
11-
- Tag: `tag2`
11+
- Tag: `tag2`

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.txt

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/event_dispatcher_1_event1.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<info>[event_dispatcher]</info> Registered listeners for event <info>event1</info>
22

33
+-------+-------------------+
4-
| Order | Callable |
4+
| Order | Callable |
55
+-------+-------------------+
66
| #1 | global_function() |
77
| #2 | \Closure() |
+3-7Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<info>[event_dispatcher]</info> Registered listeners by event
22

33
<info>[Event]</info> event1
4-
+-------+-------------------+
5-
| Order | Callable |
6-
+-------+-------------------+
7-
| #1 | global_function() |
8-
| #2 | \Closure() |
9-
+-------+-------------------+
104

115
<info>[Event]</info> event2
126
+-------+-----------------------------------------------------------------------------------+
13-
| Order | Callable |
7+
| Order | Callable |
148
+-------+-----------------------------------------------------------------------------------+
9+
| #1 | global_function() |
10+
| #2 | \Closure() |
1511
| #1 | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke() |
1612
+-------+-----------------------------------------------------------------------------------+
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
database_name
22
=============
33

4-
symfony
4+
symfony
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
symfony
1+
symfony

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/parameters_1.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/parameters_1.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Container parameters
44
- `array`: `[12,"Hello world!",true]`
55
- `boolean`: `true`
66
- `integer`: `12`
7-
- `string`: `Hello world!`
7+
- `string`: `Hello world!`
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<info>[container]</info> List of parameters
2-
Parameter Value
3-
array [12,"Hello world!",true]
4-
boolean true
5-
integer 12
6-
string Hello world!
7-
2+
+-----------+--------------------------+
3+
| Parameter | Value |
4+
+-----------+--------------------------+
5+
| array | [12,"Hello world!",true] |
6+
| boolean | true |
7+
| integer | 12 |
8+
| string | Hello world! |
9+
+-----------+--------------------------+

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
- Defaults:
77
- `name`: Joseph
88
- Requirements:
9-
- `name`: [a-z]+
9+
- `name`: [a-z]+

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
opt1: val1
1010
opt2: val2
1111
<comment>Path-Regex</comment> #^/hello(?:/(?P<name>[a-z]+))?$#s
12-
<comment>Host-Regex</comment> #^localhost$#s
12+
<comment>Host-Regex</comment> #^localhost$#s

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
- Method: PUT|POST
55
- Class: Symfony\Component\Routing\Route
66
- Defaults: NONE
7-
- Requirements: NONE
7+
- Requirements: NONE

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
opt1: val1
1010
opt2: val2
1111
<comment>Path-Regex</comment> #^/name/add$#s
12-
<comment>Host-Regex</comment> #^localhost$#s
12+
<comment>Host-Regex</comment> #^localhost$#s

‎src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ route_2
2222
- Class: Symfony\Component\Routing\Route
2323
- Defaults: NONE
2424
- Requirements: NONE
25+
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<info>[router]</info> Current routes
2-
Name Method Scheme Host Path
3-
route_1 GET|HEAD http|https localhost /hello/{name}
4-
route_2 PUT|POST http|https localhost /name/add
5-
2+
+---------+----------+------------+-----------+---------------+
3+
| Name | Method | Scheme | Host | Path |
4+
+---------+----------+------------+-----------+---------------+
5+
| route_1 | GET|HEAD | http|https | localhost | /hello/{name} |
6+
| route_2 | PUT|POST | http|https | localhost | /name/add |
7+
+---------+----------+------------+-----------+---------------+

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"require-dev": {
3535
"symfony/browser-kit": "~2.4|~3.0.0",
36-
"symfony/console": "~2.4,>=2.4.8|~3.0.0",
36+
"symfony/console": "~2.6|~3.0.0",
3737
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
3838
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
3939
"symfony/finder": "~2.0,>=2.0.5|~3.0.0",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.