X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FForm%2FDataTransformer%2FStringToListTransformer.php;h=cb4bee83069562aa3caca4bced262dab32408dcf;hb=e408d7e895e784271a55c3a200666034db0af80a;hp=23488d3538fc6d09339e315b20b9dfc80adc2a13;hpb=a7f1921f7db312b5def3839393357f443dcbb52c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php index 23488d35..cb4bee83 100644 --- a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php +++ b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php @@ -2,13 +2,11 @@ namespace Wallabag\CoreBundle\Form\DataTransformer; -use Doctrine\Common\Persistence\ObjectManager; use Symfony\Component\Form\DataTransformerInterface; -use Symfony\Component\Form\Exception\TransformationFailedException; /** * Transforms a comma-separated list to a proper PHP array. - * Example: the string "foo, bar" will become the array ["foo", "bar"] + * Example: the string "foo, bar" will become the array ["foo", "bar"]. */ class StringToListTransformer implements DataTransformerInterface { @@ -18,7 +16,7 @@ class StringToListTransformer implements DataTransformerInterface private $separator; /** - * @param string $separator The separator used in the list. + * @param string $separator The separator used in the list */ public function __construct($separator = ',') { @@ -44,14 +42,14 @@ class StringToListTransformer implements DataTransformerInterface /** * Transforms a string to a list. * - * @param string $string + * @param string $string * * @return array|null */ public function reverseTransform($string) { if ($string === null) { - return null; + return; } return array_values(array_filter(array_map('trim', explode($this->separator, $string))));