mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
Fixed codestyle with cs-fixer
This commit is contained in:
@@ -214,6 +214,7 @@ class Aggregate implements FeedInterface
|
||||
if (0 > $page && $page <= $count / $pageSize) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -524,6 +524,7 @@ class Feed implements FeedInterface
|
||||
if (0 > $page && $page <= $count / $pageSize) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -1,106 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Proxies\__CG__\Entities;
|
||||
|
||||
/**
|
||||
* THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
|
||||
*/
|
||||
class LazaretCheck extends \Entities\LazaretCheck implements \Doctrine\ORM\Proxy\Proxy
|
||||
{
|
||||
private $_entityPersister;
|
||||
private $_identifier;
|
||||
public $__isInitialized__ = false;
|
||||
public function __construct($entityPersister, $identifier)
|
||||
{
|
||||
$this->_entityPersister = $entityPersister;
|
||||
$this->_identifier = $identifier;
|
||||
}
|
||||
/** @private */
|
||||
public function __load()
|
||||
{
|
||||
if (!$this->__isInitialized__ && $this->_entityPersister) {
|
||||
$this->__isInitialized__ = true;
|
||||
|
||||
if (method_exists($this, "__wakeup")) {
|
||||
// call this after __isInitialized__to avoid infinite recursion
|
||||
// but before loading to emulate what ClassMetadata::newInstance()
|
||||
// provides.
|
||||
$this->__wakeup();
|
||||
}
|
||||
|
||||
if ($this->_entityPersister->load($this->_identifier, $this) === null) {
|
||||
throw new \Doctrine\ORM\EntityNotFoundException();
|
||||
}
|
||||
unset($this->_entityPersister, $this->_identifier);
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
public function __isInitialized()
|
||||
{
|
||||
return $this->__isInitialized__;
|
||||
}
|
||||
|
||||
|
||||
public function getId()
|
||||
{
|
||||
if ($this->__isInitialized__ === false) {
|
||||
return (int) $this->_identifier["id"];
|
||||
}
|
||||
$this->__load();
|
||||
return parent::getId();
|
||||
}
|
||||
|
||||
public function setCheckClassname($checkClassname)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setCheckClassname($checkClassname);
|
||||
}
|
||||
|
||||
public function getCheckClassname()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getCheckClassname();
|
||||
}
|
||||
|
||||
public function setLazaretFile(\Entities\LazaretFile $lazaretFile = NULL)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setLazaretFile($lazaretFile);
|
||||
}
|
||||
|
||||
public function getLazaretFile()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getLazaretFile();
|
||||
}
|
||||
|
||||
public function getMessage()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getMessage();
|
||||
}
|
||||
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return array('__isInitialized__', 'id', 'checkClassname', 'lazaretFile');
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
if (!$this->__isInitialized__ && $this->_entityPersister) {
|
||||
$this->__isInitialized__ = true;
|
||||
$class = $this->_entityPersister->getClassMetadata();
|
||||
$original = $this->_entityPersister->load($this->_identifier);
|
||||
if ($original === null) {
|
||||
throw new \Doctrine\ORM\EntityNotFoundException();
|
||||
}
|
||||
foreach ($class->reflFields as $field => $reflProperty) {
|
||||
$reflProperty->setValue($this, $reflProperty->getValue($original));
|
||||
}
|
||||
unset($this->_entityPersister, $this->_identifier);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -1,196 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Proxies\__CG__\Entities;
|
||||
|
||||
/**
|
||||
* THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
|
||||
*/
|
||||
class ValidationParticipant extends \Entities\ValidationParticipant implements \Doctrine\ORM\Proxy\Proxy
|
||||
{
|
||||
private $_entityPersister;
|
||||
private $_identifier;
|
||||
public $__isInitialized__ = false;
|
||||
public function __construct($entityPersister, $identifier)
|
||||
{
|
||||
$this->_entityPersister = $entityPersister;
|
||||
$this->_identifier = $identifier;
|
||||
}
|
||||
/** @private */
|
||||
public function __load()
|
||||
{
|
||||
if (!$this->__isInitialized__ && $this->_entityPersister) {
|
||||
$this->__isInitialized__ = true;
|
||||
|
||||
if (method_exists($this, "__wakeup")) {
|
||||
// call this after __isInitialized__to avoid infinite recursion
|
||||
// but before loading to emulate what ClassMetadata::newInstance()
|
||||
// provides.
|
||||
$this->__wakeup();
|
||||
}
|
||||
|
||||
if ($this->_entityPersister->load($this->_identifier, $this) === null) {
|
||||
throw new \Doctrine\ORM\EntityNotFoundException();
|
||||
}
|
||||
unset($this->_entityPersister, $this->_identifier);
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
public function __isInitialized()
|
||||
{
|
||||
return $this->__isInitialized__;
|
||||
}
|
||||
|
||||
|
||||
public function getId()
|
||||
{
|
||||
if ($this->__isInitialized__ === false) {
|
||||
return (int) $this->_identifier["id"];
|
||||
}
|
||||
$this->__load();
|
||||
return parent::getId();
|
||||
}
|
||||
|
||||
public function setUsrId($usrId)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setUsrId($usrId);
|
||||
}
|
||||
|
||||
public function getUsrId()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getUsrId();
|
||||
}
|
||||
|
||||
public function setUser(\User_Adapter $user)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setUser($user);
|
||||
}
|
||||
|
||||
public function getUser(\Alchemy\Phrasea\Application $app)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getUser($app);
|
||||
}
|
||||
|
||||
public function setIsAware($isAware)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setIsAware($isAware);
|
||||
}
|
||||
|
||||
public function getIsAware()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getIsAware();
|
||||
}
|
||||
|
||||
public function setIsConfirmed($isConfirmed)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setIsConfirmed($isConfirmed);
|
||||
}
|
||||
|
||||
public function getIsConfirmed()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getIsConfirmed();
|
||||
}
|
||||
|
||||
public function setCanAgree($canAgree)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setCanAgree($canAgree);
|
||||
}
|
||||
|
||||
public function getCanAgree()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getCanAgree();
|
||||
}
|
||||
|
||||
public function setCanSeeOthers($canSeeOthers)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setCanSeeOthers($canSeeOthers);
|
||||
}
|
||||
|
||||
public function getCanSeeOthers()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getCanSeeOthers();
|
||||
}
|
||||
|
||||
public function setReminded($reminded)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setReminded($reminded);
|
||||
}
|
||||
|
||||
public function getReminded()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getReminded();
|
||||
}
|
||||
|
||||
public function addData(\Entities\ValidationData $datas)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::addData($datas);
|
||||
}
|
||||
|
||||
public function removeData(\Entities\ValidationData $datas)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::removeData($datas);
|
||||
}
|
||||
|
||||
public function getDatas()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getDatas();
|
||||
}
|
||||
|
||||
public function setSession(\Entities\ValidationSession $session = NULL)
|
||||
{
|
||||
$this->__load();
|
||||
return parent::setSession($session);
|
||||
}
|
||||
|
||||
public function getSession()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::getSession();
|
||||
}
|
||||
|
||||
public function isReleasable()
|
||||
{
|
||||
$this->__load();
|
||||
return parent::isReleasable();
|
||||
}
|
||||
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return array('__isInitialized__', 'id', 'usr_id', 'is_aware', 'is_confirmed', 'can_agree', 'can_see_others', 'reminded', 'datas', 'session');
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
if (!$this->__isInitialized__ && $this->_entityPersister) {
|
||||
$this->__isInitialized__ = true;
|
||||
$class = $this->_entityPersister->getClassMetadata();
|
||||
$original = $this->_entityPersister->load($this->_identifier);
|
||||
if ($original === null) {
|
||||
throw new \Doctrine\ORM\EntityNotFoundException();
|
||||
}
|
||||
foreach ($class->reflFields as $field => $reflProperty) {
|
||||
$reflProperty->setValue($this, $reflProperty->getValue($original));
|
||||
}
|
||||
unset($this->_entityPersister, $this->_identifier);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -4,6 +4,7 @@ namespace Repositories;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Entities\Feed;
|
||||
|
||||
/**
|
||||
* SessionRepository
|
||||
@@ -14,9 +15,9 @@ use Doctrine\ORM\EntityRepository;
|
||||
class SessionRepository extends EntityRepository
|
||||
{
|
||||
/**
|
||||
* Returns all the feeds a user can access.
|
||||
*
|
||||
* @param User_Adapter $user
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getAllForUser(\User_Adapter $user)
|
||||
@@ -35,11 +36,15 @@ class SessionRepository extends EntityRepository
|
||||
ORDER BY f.updated_on DESC';
|
||||
|
||||
$query = $this->_em->createQuery($dql);
|
||||
$feeds = $query->getResult();
|
||||
|
||||
return $feeds;
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the public feeds.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function findAllPublic()
|
||||
{
|
||||
$dql = 'SELECT f FROM Entities\Feed f
|
||||
@@ -47,11 +52,18 @@ class SessionRepository extends EntityRepository
|
||||
ORDER BY f.updated_on DESC';
|
||||
|
||||
$query = $this->_em->createQuery($dql);
|
||||
$feeds = $query->getResult();
|
||||
|
||||
return $feeds;
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the given feed if the user can access to it.
|
||||
*
|
||||
* @param Application $app
|
||||
* @param \User_Adapter $user
|
||||
* @param type $id
|
||||
* @return Feed
|
||||
*/
|
||||
public function loadWithUser(Application $app, \User_Adapter $user, $id)
|
||||
{
|
||||
$feed = $this->find($id);
|
||||
@@ -67,6 +79,12 @@ class SessionRepository extends EntityRepository
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the feeds from a given array containing their id.
|
||||
*
|
||||
* @param array $feed_id
|
||||
* @return Collection
|
||||
*/
|
||||
public function findByIdArray(array $feed_id)
|
||||
{
|
||||
$dql = 'SELECT f FROM Entities\Feed f
|
||||
@@ -74,8 +92,7 @@ class SessionRepository extends EntityRepository
|
||||
WHERE f.id IN (' . implode(",", $feed_id) . ')';
|
||||
|
||||
$query = $this->_em->createQuery($dql);
|
||||
$feeds = $query->getResult();
|
||||
|
||||
return $feeds;
|
||||
return $query->getResult();
|
||||
}
|
||||
}
|
||||
|
@@ -5,11 +5,9 @@ namespace Alchemy\Tests\Phrasea\Controller\Root;
|
||||
require_once __DIR__ . '/../../../../../classes/FeedValidator.inc';
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Feed\Aggregate;
|
||||
use Entities\Feed;
|
||||
use Entities\FeedEntry;
|
||||
use Entities\FeedItem;
|
||||
use Alchemy\Phrasea\Feed\FeedLink;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class RssFeedTest extends \PhraseanetWebTestCaseAbstract
|
||||
|
@@ -52,8 +52,7 @@ class AggregateLinkGeneratorTest extends \PhraseanetPHPUnitAbstract
|
||||
if ($format == "atom") {
|
||||
$this->assertSame("application/atom+xml", $link->getMimetype());
|
||||
$this->assertSame("AGGREGATE - Atom", $link->getTitle());
|
||||
}
|
||||
elseif ($format == "rss") {
|
||||
} elseif ($format == "rss") {
|
||||
$this->assertSame("application/rss+xml", $link->getMimetype());
|
||||
$this->assertSame("AGGREGATE - RSS", $link->getTitle());
|
||||
}
|
||||
|
@@ -44,8 +44,7 @@ class FeedLinkGeneratorTest extends \PhraseanetPHPUnitAbstract
|
||||
if ($format == "atom") {
|
||||
$this->assertSame("application/atom+xml", $link->getMimetype());
|
||||
$this->assertSame("Title - Atom", $link->getTitle());
|
||||
}
|
||||
elseif ($format == "rss") {
|
||||
} elseif ($format == "rss") {
|
||||
$this->assertSame("application/rss+xml", $link->getMimetype());
|
||||
$this->assertSame("Title - RSS", $link->getTitle());
|
||||
}
|
||||
@@ -133,8 +132,7 @@ class FeedLinkGeneratorTest extends \PhraseanetPHPUnitAbstract
|
||||
if ($format == "atom") {
|
||||
$this->assertSame("application/atom+xml", $link->getMimetype());
|
||||
$this->assertSame("Title - Atom", $link->getTitle());
|
||||
}
|
||||
elseif ($format == "rss") {
|
||||
} elseif ($format == "rss") {
|
||||
$this->assertSame("application/rss+xml", $link->getMimetype());
|
||||
$this->assertSame("Title - RSS", $link->getTitle());
|
||||
}
|
||||
|
Reference in New Issue
Block a user