We shouldn't forget to run `php-cs-fixer` time to time
This commit is contained in:
Jeremy Benoist 2015-08-20 07:53:55 +02:00
parent 34437f408c
commit 8ce32af612
22 changed files with 73 additions and 74 deletions

View file

@ -2,7 +2,6 @@
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Wallabag\ApiBundle\WallabagApiBundle;
class AppKernel extends Kernel
{

View file

@ -138,7 +138,7 @@ class EntryController extends Controller
array(
'form' => $form->createView(),
'entries' => $entries,
'currentPage' => $page
'currentPage' => $page,
)
);
}
@ -180,7 +180,7 @@ class EntryController extends Controller
array(
'form' => $form->createView(),
'entries' => $entries,
'currentPage' => $page
'currentPage' => $page,
)
);
}
@ -222,7 +222,7 @@ class EntryController extends Controller
array(
'form' => $form->createView(),
'entries' => $entries,
'currentPage' => $page
'currentPage' => $page,
)
);
}

View file

@ -17,6 +17,7 @@ class StaticController extends Controller
array()
);
}
/**
* @Route("/about", name="about")
*/

View file

@ -23,9 +23,8 @@ class TagController extends Controller
return $this->render(
'WallabagCoreBundle:Tag:tags.html.twig',
array(
'tags' => $tags
'tags' => $tags,
)
);
}
}

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\Config;
class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
@ -36,7 +36,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
}
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function getOrder()
{

View file

@ -11,7 +11,7 @@ use Wallabag\CoreBundle\Entity\Tag;
class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
@ -91,7 +91,7 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
}
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function getOrder()
{

View file

@ -10,7 +10,7 @@ use Wallabag\CoreBundle\Entity\User;
class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
@ -38,7 +38,7 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
}
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function getOrder()
{

View file

@ -176,7 +176,7 @@ class User implements AdvancedUserInterface, \Serializable
}
/**
* @inheritDoc
* {@inheritdoc}
*/
public function getSalt()
{
@ -184,7 +184,7 @@ class User implements AdvancedUserInterface, \Serializable
}
/**
* @inheritDoc
* {@inheritdoc}
*/
public function getRoles()
{
@ -323,7 +323,7 @@ class User implements AdvancedUserInterface, \Serializable
return $this->tags;
}
/**
* @inheritDoc
* {@inheritdoc}
*/
public function eraseCredentials()
{

View file

@ -5,7 +5,6 @@ namespace Wallabag\CoreBundle\Filter;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands;
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
class EntryFilterType extends AbstractType
@ -17,26 +16,29 @@ class EntryFilterType extends AbstractType
->add('createdAt', 'filter_date_range', array(
'left_date_options' => array(
'attr' => array(
'placeholder' => 'dd/mm/yyyy'),
'placeholder' => 'dd/mm/yyyy',
),
'format' => 'dd/MM/yyyy',
'widget' => 'single_text'
'widget' => 'single_text',
),
'right_date_options' => array(
'attr' => array(
'placeholder' => 'dd/mm/yyyy'),
'placeholder' => 'dd/mm/yyyy',
),
'format' => 'dd/MM/yyyy',
'widget' => 'single_text'
)))
'widget' => 'single_text',
),
))
->add('domainName', 'filter_text', array(
'apply_filter' => function (QueryInterface $filterQuery, $field, $values)
{
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
$value = $values['value'];
if (strlen($value) <= 3 || empty($value)) {
return null;
return;
}
$expression = $filterQuery->getExpr()->like($field, $filterQuery->getExpr()->literal('%'.$value.'%'));
return $filterQuery->createCondition($expression);
}
},
));
}
@ -49,7 +51,7 @@ class EntryFilterType extends AbstractType
{
$resolver->setDefaults(array(
'csrf_protection' => false,
'validation_groups' => array('filtering')
'validation_groups' => array('filtering'),
));
}
}

View file

@ -52,7 +52,7 @@ class WallabagPasswordEncoder extends BasePasswordEncoder
$digest = hash($this->algorithm, $salted, true);
// "stretch" hash
for ($i = 1; $i < $this->iterations; $i++) {
for ($i = 1; $i < $this->iterations; ++$i) {
$digest = hash($this->algorithm, $digest.$salted, true);
}

View file

@ -252,7 +252,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$data = array(
'entry_filter[readingTime][right_number]' => 11,
'entry_filter[readingTime][left_number]' => 11
'entry_filter[readingTime][left_number]' => 11,
);
$crawler = $client->submit($form, $data);
@ -271,7 +271,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$data = array(
'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);
@ -280,13 +280,12 @@ class EntryControllerTest extends WallabagCoreTestCase
$data = array(
'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);
$this->assertCount(0, $crawler->filter('div[class=entry]'));
}
public function testPaginationWithFilter()
@ -318,7 +317,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$crawler = $client->request('GET', '/unread/list');
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
'entry_filter[domainName]' => 'monde'
'entry_filter[domainName]' => 'monde',
);
$crawler = $client->submit($form, $data);
@ -326,7 +325,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('button[id=submit-filter]')->form();
$data = array(
'entry_filter[domainName]' => 'wallabag'
'entry_filter[domainName]' => 'wallabag',
);
$crawler = $client->submit($form, $data);

View file

@ -3,7 +3,6 @@
namespace Wallabag\CoreBundle\Tests\Controller;
use Wallabag\CoreBundle\Tests\WallabagCoreTestCase;
use Doctrine\ORM\AbstractQuery;
class TagControllerTest extends WallabagCoreTestCase
{