Skip to content

Commit

Permalink
Replace eval by require_once for ForwardCompatTypeExtensionTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
l-vo committed Mar 9, 2020
1 parent 7a55d73 commit 98d3456
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
19 changes: 1 addition & 18 deletions src/Form/TypeExtension/ForwardCompatTypeExtensionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,7 @@
use Symfony\Component\Form\FormTypeExtensionInterface;

if (method_exists(FormTypeExtensionInterface::class, 'getExtendedTypes')) {
eval('
namespace Exercise\HTMLPurifierBundle\Form\TypeExtension;
/**
* @internal
*/
trait ForwardCompatTypeExtensionTrait
{
private static function doGetExtendedTypes(): iterable
{
}
public static function getExtendedTypes(): iterable
{
return self::doGetExtendedTypes();
}
}
');
require_once __DIR__.'/forward_compat_trait.inc.php';
} else {
/**
* @internal
Expand Down
18 changes: 18 additions & 0 deletions src/Form/TypeExtension/forward_compat_trait.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Exercise\HTMLPurifierBundle\Form\TypeExtension;

/**
* @internal
*/
trait ForwardCompatTypeExtensionTrait
{
private static function doGetExtendedTypes(): iterable
{
}

public static function getExtendedTypes(): iterable
{
return self::doGetExtendedTypes();
}
}

0 comments on commit 98d3456

Please sign in to comment.