mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 01:21:03 +00:00
CS
We shouldn't forget to run `php-cs-fixer` time to time
This commit is contained in:
parent
34437f408c
commit
8ce32af612
22 changed files with 73 additions and 74 deletions
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use Symfony\Component\HttpKernel\Kernel;
|
use Symfony\Component\HttpKernel\Kernel;
|
||||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||||
use Wallabag\ApiBundle\WallabagApiBundle;
|
|
||||||
|
|
||||||
class AppKernel extends Kernel
|
class AppKernel extends Kernel
|
||||||
{
|
{
|
||||||
|
|
|
@ -138,7 +138,7 @@ class EntryController extends Controller
|
||||||
array(
|
array(
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'entries' => $entries,
|
'entries' => $entries,
|
||||||
'currentPage' => $page
|
'currentPage' => $page,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ class EntryController extends Controller
|
||||||
array(
|
array(
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'entries' => $entries,
|
'entries' => $entries,
|
||||||
'currentPage' => $page
|
'currentPage' => $page,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ class EntryController extends Controller
|
||||||
array(
|
array(
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'entries' => $entries,
|
'entries' => $entries,
|
||||||
'currentPage' => $page
|
'currentPage' => $page,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ class StaticController extends Controller
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/about", name="about")
|
* @Route("/about", name="about")
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -23,9 +23,8 @@ class TagController extends Controller
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'WallabagCoreBundle:Tag:tags.html.twig',
|
'WallabagCoreBundle:Tag:tags.html.twig',
|
||||||
array(
|
array(
|
||||||
'tags' => $tags
|
'tags' => $tags,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\Config;
|
||||||
class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Entity\Tag;
|
||||||
class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
|
class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\User;
|
||||||
class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
|
class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function load(ObjectManager $manager)
|
public function load(ObjectManager $manager)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
{
|
{
|
||||||
|
|
|
@ -176,7 +176,7 @@ class User implements AdvancedUserInterface, \Serializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getSalt()
|
public function getSalt()
|
||||||
{
|
{
|
||||||
|
@ -184,7 +184,7 @@ class User implements AdvancedUserInterface, \Serializable
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function getRoles()
|
public function getRoles()
|
||||||
{
|
{
|
||||||
|
@ -323,7 +323,7 @@ class User implements AdvancedUserInterface, \Serializable
|
||||||
return $this->tags;
|
return $this->tags;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function eraseCredentials()
|
public function eraseCredentials()
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,6 @@ namespace Wallabag\CoreBundle\Filter;
|
||||||
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 Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
|
|
||||||
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||||
|
|
||||||
class EntryFilterType extends AbstractType
|
class EntryFilterType extends AbstractType
|
||||||
|
@ -17,26 +16,29 @@ class EntryFilterType extends AbstractType
|
||||||
->add('createdAt', 'filter_date_range', array(
|
->add('createdAt', 'filter_date_range', array(
|
||||||
'left_date_options' => array(
|
'left_date_options' => array(
|
||||||
'attr' => array(
|
'attr' => array(
|
||||||
'placeholder' => 'dd/mm/yyyy'),
|
'placeholder' => 'dd/mm/yyyy',
|
||||||
|
),
|
||||||
'format' => 'dd/MM/yyyy',
|
'format' => 'dd/MM/yyyy',
|
||||||
'widget' => 'single_text'
|
'widget' => 'single_text',
|
||||||
),
|
),
|
||||||
'right_date_options' => array(
|
'right_date_options' => array(
|
||||||
'attr' => array(
|
'attr' => array(
|
||||||
'placeholder' => 'dd/mm/yyyy'),
|
'placeholder' => 'dd/mm/yyyy',
|
||||||
|
),
|
||||||
'format' => 'dd/MM/yyyy',
|
'format' => 'dd/MM/yyyy',
|
||||||
'widget' => 'single_text'
|
'widget' => 'single_text',
|
||||||
)))
|
),
|
||||||
|
))
|
||||||
->add('domainName', 'filter_text', array(
|
->add('domainName', 'filter_text', array(
|
||||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values)
|
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||||
{
|
|
||||||
$value = $values['value'];
|
$value = $values['value'];
|
||||||
if (strlen($value) <= 3 || empty($value)) {
|
if (strlen($value) <= 3 || empty($value)) {
|
||||||
return null;
|
return;
|
||||||
}
|
}
|
||||||
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
|
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
|
||||||
|
|
||||||
return $filterQuery->createCondition($expression);
|
return $filterQuery->createCondition($expression);
|
||||||
}
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +51,7 @@ class EntryFilterType extends AbstractType
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(array(
|
||||||
'csrf_protection' => false,
|
'csrf_protection' => false,
|
||||||
'validation_groups' => array('filtering')
|
'validation_groups' => array('filtering'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ class WallabagPasswordEncoder extends BasePasswordEncoder
|
||||||
$digest = hash($this->algorithm, $salted, true);
|
$digest = hash($this->algorithm, $salted, true);
|
||||||
|
|
||||||
// "stretch" hash
|
// "stretch" hash
|
||||||
for ($i = 1; $i < $this->iterations; $i++) {
|
for ($i = 1; $i < $this->iterations; ++$i) {
|
||||||
$digest = hash($this->algorithm, $digest.$salted, true);
|
$digest = hash($this->algorithm, $digest.$salted, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -252,7 +252,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'entry_filter[readingTime][right_number]' => 11,
|
'entry_filter[readingTime][right_number]' => 11,
|
||||||
'entry_filter[readingTime][left_number]' => 11
|
'entry_filter[readingTime][left_number]' => 11,
|
||||||
);
|
);
|
||||||
|
|
||||||
$crawler = $client->submit($form, $data);
|
$crawler = $client->submit($form, $data);
|
||||||
|
@ -271,7 +271,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'entry_filter[createdAt][left_date]' => date('d/m/Y'),
|
'entry_filter[createdAt][left_date]' => date('d/m/Y'),
|
||||||
'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime("+1 day"))
|
'entry_filter[createdAt][right_date]' => date('d/m/Y', strtotime('+1 day')),
|
||||||
);
|
);
|
||||||
|
|
||||||
$crawler = $client->submit($form, $data);
|
$crawler = $client->submit($form, $data);
|
||||||
|
@ -280,13 +280,12 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'entry_filter[createdAt][left_date]' => '01/01/1970',
|
'entry_filter[createdAt][left_date]' => '01/01/1970',
|
||||||
'entry_filter[createdAt][right_date]' => '01/01/1970'
|
'entry_filter[createdAt][right_date]' => '01/01/1970',
|
||||||
);
|
);
|
||||||
|
|
||||||
$crawler = $client->submit($form, $data);
|
$crawler = $client->submit($form, $data);
|
||||||
|
|
||||||
$this->assertCount(0, $crawler->filter('div[class=entry]'));
|
$this->assertCount(0, $crawler->filter('div[class=entry]'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPaginationWithFilter()
|
public function testPaginationWithFilter()
|
||||||
|
@ -318,7 +317,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$crawler = $client->request('GET', '/unread/list');
|
$crawler = $client->request('GET', '/unread/list');
|
||||||
$form = $crawler->filter('button[id=submit-filter]')->form();
|
$form = $crawler->filter('button[id=submit-filter]')->form();
|
||||||
$data = array(
|
$data = array(
|
||||||
'entry_filter[domainName]' => 'monde'
|
'entry_filter[domainName]' => 'monde',
|
||||||
);
|
);
|
||||||
|
|
||||||
$crawler = $client->submit($form, $data);
|
$crawler = $client->submit($form, $data);
|
||||||
|
@ -326,7 +325,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$form = $crawler->filter('button[id=submit-filter]')->form();
|
$form = $crawler->filter('button[id=submit-filter]')->form();
|
||||||
$data = array(
|
$data = array(
|
||||||
'entry_filter[domainName]' => 'wallabag'
|
'entry_filter[domainName]' => 'wallabag',
|
||||||
);
|
);
|
||||||
|
|
||||||
$crawler = $client->submit($form, $data);
|
$crawler = $client->submit($form, $data);
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
namespace Wallabag\CoreBundle\Tests\Controller;
|
namespace Wallabag\CoreBundle\Tests\Controller;
|
||||||
|
|
||||||
use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
|
use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
|
||||||
use Doctrine\ORM\AbstractQuery;
|
|
||||||
|
|
||||||
class TagControllerTest extends WallabagCoreTestCase
|
class TagControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue