Fixed codestyle

This commit is contained in:
Andrey
2013-08-13 17:28:32 +02:00
parent f8c4041733
commit cedd924e31
12 changed files with 74 additions and 22 deletions

View File

@@ -37,7 +37,6 @@ class Publications implements ControllerProviderInterface
}); });
$controllers->get('/list/', function(PhraseaApplication $app) { $controllers->get('/list/', function(PhraseaApplication $app) {
$feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser( $feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser(
$app['authentication']->getUser() $app['authentication']->getUser()
); );
@@ -47,7 +46,6 @@ class Publications implements ControllerProviderInterface
})->bind('admin_feeds_list'); })->bind('admin_feeds_list');
$controllers->post('/create/', function(PhraseaApplication $app, Request $request) { $controllers->post('/create/', function(PhraseaApplication $app, Request $request) {
if ('' === $title = trim($request->request->get('title', ''))) { if ('' === $title = trim($request->request->get('title', ''))) {
$app->abort(400, "Bad request"); $app->abort(400, "Bad request");
} }

View File

@@ -215,13 +215,11 @@ class Feed implements ControllerProviderInterface
$feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser($app['authentication']->getUser()); $feeds = $app['EM']->getRepository('Entities\Feed')->getAllForUser($app['authentication']->getUser());
$datas = $app['twig']->render('prod/feeds/feeds.html.twig' $datas = $app['twig']->render('prod/feeds/feeds.html.twig', array(
, array( 'feeds' => $feeds,
'feeds' => $feeds 'feed' => new Aggregate($app['EM'], $feeds),
, 'feed' => new Aggregate($app['EM'], $feeds) 'page' => $page
, 'page' => $page ));
)
);
return new Response($datas); return new Response($datas);
})->bind('prod_feeds'); })->bind('prod_feeds');
@@ -247,7 +245,11 @@ class Feed implements ControllerProviderInterface
$aggregate = new Aggregate($app['EM'], $feeds); $aggregate = new Aggregate($app['EM'], $feeds);
$link = $app['feed.aggregate-link-generator']->generate($aggregate, $app['authentication']->getUser(), AggregateLinkGenerator::FORMAT_RSS, null, $renew); $link = $app['feed.aggregate-link-generator']->generate($aggregate,
$app['authentication']->getUser(),
AggregateLinkGenerator::FORMAT_RSS,
null, $renew
);
$output = array( $output = array(
'texte' => '<p>' . _('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.') 'texte' => '<p>' . _('publication::Voici votre fil RSS personnel. Il vous permettra d\'etre tenu au courrant des publications.')

View File

@@ -204,14 +204,14 @@ class Aggregate implements FeedInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function hasPage($page, $pageSize) public function hasPage($pageNumber, $nbEntriesByPage)
{ {
if (0 >= $pageSize) { if (0 >= $nbEntriesByPage) {
throw new LogicException; throw new LogicException;
} }
$count = $this->getCountTotalEntries(); $count = $this->getCountTotalEntries();
if (0 > $page && $page <= $count / $pageSize) { if (0 > $pageNumber && $pageNumber <= $count / $nbEntriesByPage) {
return true; return true;
} }

View File

@@ -68,10 +68,10 @@ interface FeedInterface
/** /**
* Returns a boolean indicating whether the feed has a given page. * Returns a boolean indicating whether the feed has a given page.
* *
* @param integer $page * @param integer $pageNumber
* @param integer $pageSize * @param integer $nbEntriesByPage
* *
* @return \DateTime * @return \DateTime
*/ */
public function hasPage($page, $pageSize); public function hasPage($pageNumber, $nbEntriesByPage);
} }

View File

@@ -531,14 +531,13 @@ class Feed implements FeedInterface
* *
* @return boolean * @return boolean
*/ */
public function hasPage($page, $pageSize) public function hasPage($pageNumber, $nbEntriesByPage)
{ {
if (0 >= $pageSize) { if (0 >= $nbEntriesByPage) {
throw new LogicException; throw new LogicException;
} }
$count = $this->getCountTotalEntries(); $count = $this->getCountTotalEntries();
if (0 > $page && $page <= $count / $pageSize) { if (0 > $pageNumber && $pageNumber <= $count / $nbEntriesByPage) {
return true; return true;
} }

View File

@@ -1,5 +1,14 @@
<?php <?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Repositories; namespace Repositories;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;

View File

@@ -1,5 +1,14 @@
<?php <?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Repositories; namespace Repositories;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;

View File

@@ -1,5 +1,14 @@
<?php <?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Repositories; namespace Repositories;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;

View File

@@ -1,5 +1,14 @@
<?php <?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Repositories; namespace Repositories;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;

View File

@@ -1,5 +1,14 @@
<?php <?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Repositories; namespace Repositories;
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;

View File

@@ -1,5 +1,14 @@
<?php <?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Repositories; namespace Repositories;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;

View File

@@ -121,7 +121,6 @@ class eventsmanager_notify_feed extends eventsmanager_notifyAbstract
} }
$this->broker->notify($user_to_notif->get_id(), __CLASS__, $datas, $mailed); $this->broker->notify($user_to_notif->get_id(), __CLASS__, $datas, $mailed);
} }
$start += $perLoop; $start += $perLoop;
} while (count($results) > 0); } while (count($results) > 0);