php cs
This commit is contained in:
parent
c5d0db8b71
commit
347fa6beb0
@ -2,13 +2,11 @@
|
|||||||
|
|
||||||
namespace Wallabag\CoreBundle\Form\DataTransformer;
|
namespace Wallabag\CoreBundle\Form\DataTransformer;
|
||||||
|
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
|
||||||
use Symfony\Component\Form\DataTransformerInterface;
|
use Symfony\Component\Form\DataTransformerInterface;
|
||||||
use Symfony\Component\Form\Exception\TransformationFailedException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transforms a comma-separated list to a proper PHP array.
|
* 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
|
class StringToListTransformer implements DataTransformerInterface
|
||||||
{
|
{
|
||||||
@ -51,7 +49,7 @@ class StringToListTransformer implements DataTransformerInterface
|
|||||||
public function reverseTransform($string)
|
public function reverseTransform($string)
|
||||||
{
|
{
|
||||||
if ($string === null) {
|
if ($string === null) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_values(array_filter(array_map('trim', explode($this->separator, $string))));
|
return array_values(array_filter(array_map('trim', explode($this->separator, $string))));
|
||||||
|
@ -5,7 +5,6 @@ namespace Wallabag\CoreBundle\Form\Type;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer;
|
use Wallabag\CoreBundle\Form\DataTransformer\StringToListTransformer;
|
||||||
|
|
||||||
class TaggingRuleType extends AbstractType
|
class TaggingRuleType extends AbstractType
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
namespace Wallabag\CoreBundle\Helper;
|
namespace Wallabag\CoreBundle\Helper;
|
||||||
|
|
||||||
use RulerZ\RulerZ;
|
use RulerZ\RulerZ;
|
||||||
|
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||||
|
@ -150,7 +150,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
|||||||
|
|
||||||
$this->assertGreaterThan(1, $csv);
|
$this->assertGreaterThan(1, $csv);
|
||||||
// +1 for title line
|
// +1 for title line
|
||||||
$this->assertEquals(count($contentInDB)+1, count($csv));
|
$this->assertEquals(count($contentInDB) + 1, count($csv));
|
||||||
$this->assertEquals('Title;URL;Content;Tags;"MIME Type";Language', $csv[0]);
|
$this->assertEquals('Title;URL;Content;Tags;"MIME Type";Language', $csv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +19,10 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function transformProvider()
|
public function transformProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array( null, '' ),
|
array(null, ''),
|
||||||
array( array(), '' ),
|
array(array(), ''),
|
||||||
array( array('single value'), 'single value' ),
|
array(array('single value'), 'single value'),
|
||||||
array( array('first value', 'second value'), 'first value,second value' ),
|
array(array('first value', 'second value'), 'first value,second value'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,12 +39,12 @@ class StringToListTransformerTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function reverseTransformProvider()
|
public function reverseTransformProvider()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array( null, null ),
|
array(null, null),
|
||||||
array( '', array() ),
|
array('', array()),
|
||||||
array( 'single value', array('single value') ),
|
array('single value', array('single value')),
|
||||||
array( 'first value,second value', array('first value', 'second value') ),
|
array('first value,second value', array('first value', 'second value')),
|
||||||
array( 'first value, second value', array('first value', 'second value') ),
|
array('first value, second value', array('first value', 'second value')),
|
||||||
array( 'first value, , second value', array('first value', 'second value') ),
|
array('first value, , second value', array('first value', 'second value')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
namespace Wallabag\CoreBundle\Tests\Helper;
|
namespace Wallabag\CoreBundle\Tests\Helper;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
|
||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
|
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user