Permalink
Browse files

Minor cleanup code

  • Loading branch information...
1 parent 7f6f48b commit 5ebe80426fb6362ef045cec5d56e5e3a73ff710f @yceruto yceruto committed with Dec 27, 2016
@@ -95,7 +95,6 @@ public function getBackendConfig()
*/
public function dump($variable)
{
- $dumpedData = '';
if (class_exists('Symfony\Component\VarDumper\Dumper\HtmlDumper')) {
$cloner = new VarCloner();
$dumper = new HtmlDumper();
@@ -11,6 +11,7 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\DependencyInjection;
+use JavierEguiluz\Bundle\EasyAdminBundle\Form\Util\LegacyFormHelper;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -86,8 +87,7 @@ private function ensureBackwardCompatibility(ContainerBuilder $container)
}
// BC for legacy form component
- $useLegacyFormComponent = false === class_exists('Symfony\\Component\\Form\\Util\\StringUtil');
- if (!$useLegacyFormComponent) {
+ if (!LegacyFormHelper::useLegacyFormComponent()) {
$container
->getDefinition('easyadmin.form.type')
->clearTag('form.type')
@@ -11,6 +11,7 @@
namespace JavierEguiluz\Bundle\EasyAdminBundle\Form\Extension;
+use JavierEguiluz\Bundle\EasyAdminBundle\Form\Util\LegacyFormHelper;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
@@ -83,16 +84,6 @@ public function setRequest(Request $request = null)
*/
public function getExtendedType()
{
- return $this->useLegacyFormComponent() ? 'form' : 'Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType';
- }
-
- /**
- * Returns true if the legacy Form component is being used by the application.
- *
- * @return bool
- */
- private function useLegacyFormComponent()
- {
- return false === class_exists('Symfony\\Component\\Form\\Util\\StringUtil');
+ return LegacyFormHelper::useLegacyFormComponent() ? 'form' : 'Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType';
}
}

0 comments on commit 5ebe804

Please sign in to comment.