minor #13197 [2.7][FrameworkBundle] Removed the use of TableHelper (saro0h)

This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][FrameworkBundle] Removed the use of TableHelper

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

The PR https://github.com/symfony/symfony/pull/13121 on 3.0 removed the ``TableHelper `` class. Now the tests don't pass when using ``components=high`` version of dependencis, because of the use of the deprecated TableHelper.

This one removes the use of ``TableHelper`` without the removal of the ``TableHelper`` class, and adapt the existing code to use the Table class instead.

Commits
-------

08a5b5a [FrameworkBundle] Removed the use of TableHelper
This commit is contained in:
Fabien Potencier 2015-01-06 09:57:00 +01:00
commit e7bdb5bce3
35 changed files with 40 additions and 35 deletions

View File

@ -59,7 +59,7 @@ class TextDescriptor extends Descriptor
}
$this->writeText($this->formatSection('router', 'Current routes')."\n", $options);
$this->renderTable($table, !(isset($options['raw_output']) && $options['raw_output']));
$table->render();
}
/**
@ -109,7 +109,7 @@ class TextDescriptor extends Descriptor
}
$this->writeText($this->formatSection('container', 'List of parameters')."\n", $options);
$this->renderTable($table, !(isset($options['raw_output']) && $options['raw_output']));
$table->render();
}
/**
@ -232,7 +232,7 @@ class TextDescriptor extends Descriptor
}
}
$this->renderTable($table);
$table->render();
}
/**
@ -302,6 +302,7 @@ class TextDescriptor extends Descriptor
$this->writeText($this->formatSection('event_dispatcher', $label)."\n", $options);
$registeredListeners = $eventDispatcher->getListeners($event);
if (null !== $event) {
$this->writeText("\n");
$table = new Table($this->getOutput());
@ -312,7 +313,7 @@ class TextDescriptor extends Descriptor
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($listener)));
}
$this->renderTable($table, true);
$table->render();
} else {
ksort($registeredListeners);
foreach ($registeredListeners as $eventListened => $eventListeners) {
@ -326,7 +327,7 @@ class TextDescriptor extends Descriptor
$table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener)));
}
$this->renderTable($table, true);
$table->render();
}
}
}

View File

@ -1,2 +1,2 @@
- Service: `service_1`
- Public: yes
- Public: yes

View File

@ -1,2 +1,2 @@
- Service: `service_2`
- Public: no
- Public: no

View File

@ -32,4 +32,4 @@ alias_2
Services
--------
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`

View File

@ -1,5 +1,5 @@
<info>[container]</info> <comment>Public</comment> services
Service ID Class name
Service ID  Class name 
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1

View File

@ -47,4 +47,4 @@ alias_2
Services
--------
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`

View File

@ -1,8 +1,7 @@
<info>[container]</info> <comment>Public</comment> and <comment>private</comment> services
Service ID Class name
Service ID  Class name 
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
definition_2 Full\Qualified\Class2
service_container Symfony\Component\DependencyInjection\ContainerBuilder

View File

@ -1,4 +1,4 @@
<info>[container]</info> <comment>Public</comment> and <comment>private</comment> services with tag <info>tag1</info>
Service ID attr1 attr2 attr3 Class name
Service ID  attr1 attr2 attr3 Class name 
definition_2 val1 val2 Full\Qualified\Class2
" val3

View File

@ -1,2 +1,3 @@
- Type: `function`
- Name: `array_key_exists`

View File

@ -1 +1 @@
array_key_exists()
array_key_exists()

View File

@ -1,3 +1,4 @@
- Type: `function`
- Name: `staticMethod`
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`

View File

@ -1 +1 @@
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()

View File

@ -1,3 +1,4 @@
- Type: `function`
- Name: `method`
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`

View File

@ -1 +1 @@
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::method()
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::method()

View File

@ -1,3 +1,4 @@
- Type: `function`
- Name: `staticMethod`
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`

View File

@ -1 +1 @@
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()

View File

@ -1,3 +1,4 @@
- Type: `function`
- Name: `staticMethod`
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass`

View File

@ -1 +1 @@
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass::parent::staticMethod()
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass::parent::staticMethod()

View File

@ -1,3 +1,3 @@
- Type: `object`
- Name: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`

View File

@ -1 +1 @@
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke()
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke()

View File

@ -1,4 +1,4 @@
- Class: `Full\Qualified\Class1`
- Scope: `container`
- Public: yes
- Synthetic: no
- Synthetic: no

View File

@ -8,4 +8,4 @@
- Attr2: val2
- Tag: `tag1`
- Attr3: val3
- Tag: `tag2`
- Tag: `tag2`

View File

@ -1,4 +1,4 @@
database_name
=============
symfony
symfony

View File

@ -4,4 +4,4 @@ Container parameters
- `array`: `[12,"Hello world!",true]`
- `boolean`: `true`
- `integer`: `12`
- `string`: `Hello world!`
- `string`: `Hello world!`

View File

@ -1,7 +1,6 @@
<info>[container]</info> List of parameters
Parameter Value
Parameter Value 
array [12,"Hello world!",true]
boolean true
integer 12
string Hello world!

View File

@ -6,4 +6,4 @@
- Defaults:
- `name`: Joseph
- Requirements:
- `name`: [a-z]+
- `name`: [a-z]+

View File

@ -9,4 +9,4 @@
opt1: val1
opt2: val2
<comment>Path-Regex</comment> #^/hello(?:/(?P<name>[a-z]+))?$#s
<comment>Host-Regex</comment> #^localhost$#s
<comment>Host-Regex</comment> #^localhost$#s

View File

@ -4,4 +4,4 @@
- Method: PUT|POST
- Class: Symfony\Component\Routing\Route
- Defaults: NONE
- Requirements: NONE
- Requirements: NONE

View File

@ -9,4 +9,4 @@
opt1: val1
opt2: val2
<comment>Path-Regex</comment> #^/name/add$#s
<comment>Host-Regex</comment> #^localhost$#s
<comment>Host-Regex</comment> #^localhost$#s

View File

@ -22,3 +22,4 @@ route_2
- Class: Symfony\Component\Routing\Route
- Defaults: NONE
- Requirements: NONE

View File

@ -1,5 +1,4 @@
<info>[router]</info> Current routes
Name Method Scheme Host Path
Name  Method  Scheme  Host  Path 
route_1 GET|HEAD http|https localhost /hello/{name}
route_2 PUT|POST http|https localhost /name/add

View File

@ -33,7 +33,7 @@
},
"require-dev": {
"symfony/browser-kit": "~2.4|~3.0.0",
"symfony/console": "~2.5|~3.0.0",
"symfony/console": "~2.6|~3.0.0",
"symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
"symfony/finder": "~2.0,>=2.0.5|~3.0.0",