diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/DataTransformer')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php index 23488d35..b712ad15 100644 --- a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php +++ b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php | |||
@@ -2,13 +2,11 @@ | |||
2 | 2 | ||
3 | namespace Wallabag\CoreBundle\Form\DataTransformer; | 3 | namespace Wallabag\CoreBundle\Form\DataTransformer; |
4 | 4 | ||
5 | use Doctrine\Common\Persistence\ObjectManager; | ||
6 | use Symfony\Component\Form\DataTransformerInterface; | 5 | use Symfony\Component\Form\DataTransformerInterface; |
7 | use Symfony\Component\Form\Exception\TransformationFailedException; | ||
8 | 6 | ||
9 | /** | 7 | /** |
10 | * Transforms a comma-separated list to a proper PHP array. | 8 | * Transforms a comma-separated list to a proper PHP array. |
11 | * Example: the string "foo, bar" will become the array ["foo", "bar"] | 9 | * Example: the string "foo, bar" will become the array ["foo", "bar"]. |
12 | */ | 10 | */ |
13 | class StringToListTransformer implements DataTransformerInterface | 11 | class StringToListTransformer implements DataTransformerInterface |
14 | { | 12 | { |
@@ -44,14 +42,14 @@ class StringToListTransformer implements DataTransformerInterface | |||
44 | /** | 42 | /** |
45 | * Transforms a string to a list. | 43 | * Transforms a string to a list. |
46 | * | 44 | * |
47 | * @param string $string | 45 | * @param string $string |
48 | * | 46 | * |
49 | * @return array|null | 47 | * @return array|null |
50 | */ | 48 | */ |
51 | public function reverseTransform($string) | 49 | public function reverseTransform($string) |
52 | { | 50 | { |
53 | if ($string === null) { | 51 | if ($string === null) { |
54 | return null; | 52 | return; |
55 | } | 53 | } |
56 | 54 | ||
57 | return array_values(array_filter(array_map('trim', explode($this->separator, $string)))); | 55 | return array_values(array_filter(array_map('trim', explode($this->separator, $string)))); |