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:
commit
e7bdb5bce3
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
- Service: `service_1`
|
||||
- Public: yes
|
||||
- Public: yes
|
|
@ -1,2 +1,2 @@
|
|||
- Service: `service_2`
|
||||
- Public: no
|
||||
- Public: no
|
|
@ -32,4 +32,4 @@ alias_2
|
|||
Services
|
||||
--------
|
||||
|
||||
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
|
||||
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
|
|
@ -1,5 +1,5 @@
|
|||
<info>[container]</info> <comment>Public</comment> services
|
||||
Service ID Class name
|
||||
[32mService ID [39m [32mClass name [39m
|
||||
alias_1 alias for "service_1"
|
||||
alias_2 alias for "service_2"
|
||||
definition_1 Full\Qualified\Class1
|
||||
|
|
|
@ -47,4 +47,4 @@ alias_2
|
|||
Services
|
||||
--------
|
||||
|
||||
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
|
||||
- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
|
|
@ -1,8 +1,7 @@
|
|||
<info>[container]</info> <comment>Public</comment> and <comment>private</comment> services
|
||||
Service ID Class name
|
||||
[32mService ID [39m [32mClass name [39m
|
||||
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
|
||||
|
||||
|
|
|
@ -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
|
||||
[32mService ID [39m [32mattr1[39m [32mattr2[39m [32mattr3[39m [32mClass name [39m
|
||||
definition_2 val1 val2 Full\Qualified\Class2
|
||||
" val3
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
|
||||
- Type: `function`
|
||||
- Name: `array_key_exists`
|
||||
|
|
|
@ -1 +1 @@
|
|||
array_key_exists()
|
||||
array_key_exists()
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
- Type: `function`
|
||||
- Name: `staticMethod`
|
||||
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
|
||||
|
|
|
@ -1 +1 @@
|
|||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
|
||||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
- Type: `function`
|
||||
- Name: `method`
|
||||
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
|
||||
|
|
|
@ -1 +1 @@
|
|||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::method()
|
||||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::method()
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
- Type: `function`
|
||||
- Name: `staticMethod`
|
||||
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
|
||||
|
|
|
@ -1 +1 @@
|
|||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
|
||||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::staticMethod()
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
- Type: `function`
|
||||
- Name: `staticMethod`
|
||||
- Class: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass`
|
||||
|
|
|
@ -1 +1 @@
|
|||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass::parent::staticMethod()
|
||||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\ExtendedCallableClass::parent::staticMethod()
|
|
@ -1 +1,2 @@
|
|||
|
||||
- Type: `closure`
|
||||
|
|
|
@ -1 +1 @@
|
|||
\Closure()
|
||||
\Closure()
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
- Type: `object`
|
||||
- Name: `Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass`
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke()
|
||||
Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\CallableClass::__invoke()
|
|
@ -1,4 +1,4 @@
|
|||
- Class: `Full\Qualified\Class1`
|
||||
- Scope: `container`
|
||||
- Public: yes
|
||||
- Synthetic: no
|
||||
- Synthetic: no
|
|
@ -8,4 +8,4 @@
|
|||
- Attr2: val2
|
||||
- Tag: `tag1`
|
||||
- Attr3: val3
|
||||
- Tag: `tag2`
|
||||
- Tag: `tag2`
|
|
@ -1,4 +1,4 @@
|
|||
database_name
|
||||
=============
|
||||
|
||||
symfony
|
||||
symfony
|
|
@ -1 +1 @@
|
|||
symfony
|
||||
symfony
|
|
@ -4,4 +4,4 @@ Container parameters
|
|||
- `array`: `[12,"Hello world!",true]`
|
||||
- `boolean`: `true`
|
||||
- `integer`: `12`
|
||||
- `string`: `Hello world!`
|
||||
- `string`: `Hello world!`
|
|
@ -1,7 +1,6 @@
|
|||
<info>[container]</info> List of parameters
|
||||
Parameter Value
|
||||
[32mParameter[39m [32mValue [39m
|
||||
array [12,"Hello world!",true]
|
||||
boolean true
|
||||
integer 12
|
||||
string Hello world!
|
||||
|
|
@ -6,4 +6,4 @@
|
|||
- Defaults:
|
||||
- `name`: Joseph
|
||||
- Requirements:
|
||||
- `name`: [a-z]+
|
||||
- `name`: [a-z]+
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -4,4 +4,4 @@
|
|||
- Method: PUT|POST
|
||||
- Class: Symfony\Component\Routing\Route
|
||||
- Defaults: NONE
|
||||
- Requirements: NONE
|
||||
- Requirements: NONE
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,3 +22,4 @@ route_2
|
|||
- Class: Symfony\Component\Routing\Route
|
||||
- Defaults: NONE
|
||||
- Requirements: NONE
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<info>[router]</info> Current routes
|
||||
Name Method Scheme Host Path
|
||||
[32mName [39m [32mMethod [39m [32mScheme [39m [32mHost [39m [32mPath [39m
|
||||
route_1 GET|HEAD http|https localhost /hello/{name}
|
||||
route_2 PUT|POST http|https localhost /name/add
|
||||
|
|
@ -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",
|
||||
|
|
Reference in New Issue