diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php index 85f696b05f..c079aabb02 100644 --- a/lib/Alchemy/Phrasea/Application/Api.php +++ b/lib/Alchemy/Phrasea/Application/Api.php @@ -745,14 +745,6 @@ return call_user_func(function($environment = 'prod') { return $response; }); - /** - * Temporary fix for https://github.com/fabpot/Silex/issues/438 - */ - $app['dispatcher']->addListener(KernelEvents::RESPONSE, function(FilterResponseEvent $event) { - if ($event->getResponse() instanceof \API_V1_Response) { - $event->getResponse()->setStatusCode($event->getResponse()->getOriginalStatusCode()); - } - }); return $app; }, $environment ? : null diff --git a/lib/Alchemy/Phrasea/Border/Manager.php b/lib/Alchemy/Phrasea/Border/Manager.php index 3ae02b201e..37825fa041 100644 --- a/lib/Alchemy/Phrasea/Border/Manager.php +++ b/lib/Alchemy/Phrasea/Border/Manager.php @@ -502,7 +502,7 @@ class Manager * @param File $file The file * @return \Doctrine\ORM\EntityManager */ - protected function addMediaAttributes(File &$file) + protected function addMediaAttributes(File $file) { if (method_exists($file->getMedia(), 'getWidth')) { diff --git a/lib/classes/API/OAuth2/Token.class.php b/lib/classes/API/OAuth2/Token.class.php index 6dc3e0856b..58c15dabb7 100644 --- a/lib/classes/API/OAuth2/Token.class.php +++ b/lib/classes/API/OAuth2/Token.class.php @@ -65,7 +65,7 @@ class API_OAuth2_Token * @param API_OAuth2_Account $account * @return API_OAuth2_Token */ - public function __construct(appbox &$appbox, API_OAuth2_Account &$account) + public function __construct(appbox $appbox, API_OAuth2_Account $account) { $this->appbox = $appbox; $this->account = $account; @@ -300,7 +300,7 @@ class API_OAuth2_Token * @param string $scope * @return API_OAuth2_Token */ - public static function create(appbox &$appbox, API_OAuth2_Account &$account, $scope = null) + public static function create(appbox $appbox, API_OAuth2_Account $account, $scope = null) { $sql = 'INSERT INTO api_oauth_tokens (oauth_token, session_id, api_account_id, expires, scope) diff --git a/lib/classes/API/V1/Interface.class.php b/lib/classes/API/V1/Interface.class.php index 93bdc55cbf..4f2380b337 100644 --- a/lib/classes/API/V1/Interface.class.php +++ b/lib/classes/API/V1/Interface.class.php @@ -245,7 +245,7 @@ interface API_V1_Interface * Parameters : * */ - public function search_publications(Request $request, User_Adapter &$user); + public function search_publications(Request $request, User_Adapter $user); /** * Route : /publications/PUBLICATION_ID/remove/FORMAT/ @@ -267,11 +267,11 @@ interface API_V1_Interface * PUBLICATION_ID : required INT * */ - public function get_publication(Request $request, $publication_id, User_Adapter &$user); + public function get_publication(Request $request, $publication_id, User_Adapter $user); - public function get_publications(Request $request, User_Adapter &$user); + public function get_publications(Request $request, User_Adapter $user); - public function get_feed_entry(Request $request, $entry, User_Adapter &$user); + public function get_feed_entry(Request $request, $entry, User_Adapter $user); /** * Route : /users/search/FORMAT/ * diff --git a/lib/classes/API/V1/adapter.class.php b/lib/classes/API/V1/adapter.class.php index dad0549929..cde7726fa3 100644 --- a/lib/classes/API/V1/adapter.class.php +++ b/lib/classes/API/V1/adapter.class.php @@ -676,7 +676,7 @@ class API_V1_adapter extends API_V1_Abstract $reasons = $output = null; - $callback = function($element, $visa, $code) use(&$reasons, &$output) { + $callback = function($element, $visa, $code) use (&$reasons, &$output) { if ( ! $visa->isValid()) { $reasons = array(); @@ -1420,7 +1420,7 @@ class API_V1_adapter extends API_V1_Abstract * @param User_Adapter $user * @return API_V1_result */ - public function search_publications(Request $request, User_Adapter &$user) + public function search_publications(Request $request, User_Adapter $user) { $result = new API_V1_result($request, $this); @@ -1455,7 +1455,7 @@ class API_V1_adapter extends API_V1_Abstract * @param User_Adapter $user * @return API_V1_result */ - public function get_publication(Request $request, $publication_id, User_Adapter &$user) + public function get_publication(Request $request, $publication_id, User_Adapter $user) { $result = new API_V1_result($request, $this); @@ -1478,7 +1478,7 @@ class API_V1_adapter extends API_V1_Abstract return $result; } - public function get_publications(Request $request, User_Adapter &$user) + public function get_publications(Request $request, User_Adapter $user) { $result = new API_V1_result($request, $this); @@ -1501,7 +1501,7 @@ class API_V1_adapter extends API_V1_Abstract return $result; } - public function get_feed_entry(Request $request, $entry_id, User_Adapter &$user) + public function get_feed_entry(Request $request, $entry_id, User_Adapter $user) { $result = new API_V1_result($request, $this); @@ -1644,7 +1644,7 @@ class API_V1_adapter extends API_V1_Abstract * @param media_subdef $media * @return array */ - protected function list_embedable_media(media_subdef &$media, registryInterface &$registry) + protected function list_embedable_media(media_subdef $media, registryInterface $registry) { if ( ! $media->is_physically_present()) { return null; @@ -1675,7 +1675,7 @@ class API_V1_adapter extends API_V1_Abstract * @param registryInterface $registry * @return type */ - protected function list_permalink(media_Permalink_Adapter &$permalink, registryInterface &$registry) + protected function list_permalink(media_Permalink_Adapter $permalink, registryInterface $registry) { return array( 'created_on' => $permalink->get_created_on()->format(DATE_ATOM), diff --git a/lib/classes/Bridge/Account.class.php b/lib/classes/Bridge/Account.class.php index 3a22f6c700..33321e57f2 100644 --- a/lib/classes/Bridge/Account.class.php +++ b/lib/classes/Bridge/Account.class.php @@ -80,7 +80,7 @@ class Bridge_Account * @param int $id * @return Bridge_Account */ - public function __construct(Application $app, Bridge_Api &$api, $id) + public function __construct(Application $app, Bridge_Api $api, $id) { $this->id = (int) $id; $this->app = $app; @@ -292,7 +292,7 @@ class Bridge_Account * @param int $quantity * @return Bridge_Account */ - public static function get_accounts_by_api(Application $app, Bridge_Api &$api, $quantity = 50) + public static function get_accounts_by_api(Application $app, Bridge_Api $api, $quantity = 50) { $sql = 'SELECT id FROM bridge_accounts WHERE api_id = :api_id LIMIT 0,' . (int) $quantity; @@ -317,7 +317,7 @@ class Bridge_Account * @param user_adapter $user * @return Bridge_Account */ - public static function get_accounts_by_user(Application $app, user_adapter &$user) + public static function get_accounts_by_user(Application $app, user_adapter $user) { $sql = 'SELECT id, api_id FROM bridge_accounts WHERE usr_id = :usr_id'; @@ -353,7 +353,7 @@ class Bridge_Account * @param string $name * @return Bridge_Account */ - public static function create(Application $app, Bridge_Api &$api, User_Adapter &$user, $dist_id, $name) + public static function create(Application $app, Bridge_Api $api, User_Adapter $user, $dist_id, $name) { $sql = 'INSERT INTO bridge_accounts (id, api_id, dist_id, usr_id, name, created_on, updated_on) diff --git a/lib/classes/Bridge/AccountSettings.class.php b/lib/classes/Bridge/AccountSettings.class.php index e60902804f..49fe3c10ee 100644 --- a/lib/classes/Bridge/AccountSettings.class.php +++ b/lib/classes/Bridge/AccountSettings.class.php @@ -35,7 +35,7 @@ class Bridge_AccountSettings * @param Bridge_Account $account * @return Bridge_AccountSettings */ - public function __construct(appbox &$appbox, Bridge_Account &$account) + public function __construct(appbox $appbox, Bridge_Account $account) { $this->appbox = $appbox; $this->account = $account; diff --git a/lib/classes/Bridge/Api.class.php b/lib/classes/Bridge/Api.class.php index 45c41276af..63df23077c 100644 --- a/lib/classes/Bridge/Api.class.php +++ b/lib/classes/Bridge/Api.class.php @@ -172,7 +172,7 @@ class Bridge_Api */ public function list_elements($type, $offset_start = 0, $quantity = 10) { - $action = function(Bridge_Api &$obj) use ($type, $offset_start, $quantity ) { + $action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) { return $obj->get_connector()->list_elements($type, $offset_start, $quantity); }; @@ -188,7 +188,7 @@ class Bridge_Api */ public function list_containers($type, $offset_start = 0, $quantity = 10) { - $action = function(Bridge_Api &$obj) use ($type, $offset_start, $quantity ) { + $action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) { return $obj->get_connector()->list_containers($type, $offset_start, $quantity); }; @@ -204,7 +204,7 @@ class Bridge_Api */ public function update_element($object, $object_id, Array $datas) { - $action = function(Bridge_Api &$obj) use ($object, $object_id, $datas) { + $action = function(Bridge_Api $obj) use ($object, $object_id, $datas) { return $obj->get_connector()->update_element($object, $object_id, $datas); }; @@ -219,7 +219,7 @@ class Bridge_Api */ public function create_container($container_type, Request $request) { - $action = function(Bridge_Api &$obj) use ($container_type, $request) { + $action = function(Bridge_Api $obj) use ($container_type, $request) { return $obj->get_connector()->create_container($container_type, $request); }; @@ -236,7 +236,7 @@ class Bridge_Api */ public function add_element_to_container($element_type, $element_id, $destination, $container_id) { - $action = function(Bridge_Api &$obj) use ($element_type, $element_id, $destination, $container_id) { + $action = function(Bridge_Api $obj) use ($element_type, $element_id, $destination, $container_id) { return $obj->get_connector()->add_element_to_container($element_type, $element_id, $destination, $container_id); }; @@ -251,7 +251,7 @@ class Bridge_Api */ public function delete_object($object, $object_id) { - $action = function(Bridge_Api &$obj) use ($object, $object_id) { + $action = function(Bridge_Api $obj) use ($object, $object_id) { return $obj->get_connector()->delete_object($object, $object_id); }; @@ -264,7 +264,7 @@ class Bridge_Api */ public function acceptable_records() { - $action = function(Bridge_Api &$obj) { + $action = function(Bridge_Api $obj) { return $obj->get_connector()->acceptable_records(); }; @@ -279,7 +279,7 @@ class Bridge_Api */ public function get_element_from_id($element_id, $type) { - $action = function(Bridge_Api &$obj) use ($element_id, $type) { + $action = function(Bridge_Api $obj) use ($element_id, $type) { return $obj->get_connector()->get_element_from_id($element_id, $type); }; @@ -294,7 +294,7 @@ class Bridge_Api */ public function get_container_from_id($element_id, $type) { - $action = function(Bridge_Api &$obj) use ($element_id, $type) { + $action = function(Bridge_Api $obj) use ($element_id, $type) { return $obj->get_connector()->get_container_from_id($element_id, $type); }; @@ -307,7 +307,7 @@ class Bridge_Api */ public function get_category_list() { - $action = function(Bridge_Api &$obj) { + $action = function(Bridge_Api $obj) { return $obj->get_connector()->get_category_list(); }; @@ -321,7 +321,7 @@ class Bridge_Api */ public function get_element_status(Bridge_Element $element) { - $action = function(Bridge_Api &$obj) use ($element) { + $action = function(Bridge_Api $obj) use ($element) { return $obj->get_connector()->get_element_status($element); }; @@ -335,7 +335,7 @@ class Bridge_Api */ public function map_connector_to_element_status($status) { - $action = function(Bridge_Api &$obj) use ($status) { + $action = function(Bridge_Api $obj) use ($status) { return $obj->get_connector()->map_connector_to_element_status($status); }; @@ -349,7 +349,7 @@ class Bridge_Api */ public function get_error_message_from_status($connector_status) { - $action = function(Bridge_Api &$obj) use ($connector_status) { + $action = function(Bridge_Api $obj) use ($connector_status) { return $obj->get_connector()->get_error_message_from_status($connector_status); }; @@ -362,9 +362,9 @@ class Bridge_Api * @param array $options specific option, regarding the connector * @return string The distant_id of the created element */ - public function upload(record_adapter &$record, array $options = array()) + public function upload(record_adapter $record, array $options = array()) { - $action = function(Bridge_Api &$obj) use ($record, $options) { + $action = function(Bridge_Api $obj) use ($record, $options) { return $obj->get_connector()->upload($record, $options); }; diff --git a/lib/classes/Bridge/Api/Abstract.class.php b/lib/classes/Bridge/Api/Abstract.class.php index 47c9e1cefd..c5efa91ee5 100644 --- a/lib/classes/Bridge/Api/Abstract.class.php +++ b/lib/classes/Bridge/Api/Abstract.class.php @@ -50,7 +50,7 @@ abstract class Bridge_Api_Abstract * @param Bridge_AccountSettings $settings * @return Bridge_Api_Abstract */ - public function set_auth_settings(Bridge_AccountSettings &$settings) + public function set_auth_settings(Bridge_AccountSettings $settings) { $this->_auth->set_settings($settings); $this->set_transport_authentication_params(); @@ -154,7 +154,7 @@ abstract class Bridge_Api_Abstract * @param Exception $e * @return Void */ - public function handle_exception(Exception &$e) + public function handle_exception(Exception $e) { return; } diff --git a/lib/classes/Bridge/Api/Dailymotion.class.php b/lib/classes/Bridge/Api/Dailymotion.class.php index 650b60a578..dbf3958f2e 100644 --- a/lib/classes/Bridge/Api/Dailymotion.class.php +++ b/lib/classes/Bridge/Api/Dailymotion.class.php @@ -462,7 +462,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I */ public function acceptable_records() { - return function (record_adapter &$record) { + return function (record_adapter $record) { return $record->get_type() === 'video'; }; } @@ -545,7 +545,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I * @param Exception $e * @return Void */ - public function handle_exception(Exception &$e) + public function handle_exception(Exception $e) { if ($e instanceof DailymotionAuthException) { $e = new Bridge_Exception_ActionAuthNeedReconnect($e->getMessage()); @@ -562,7 +562,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I * @param array $options * @return string */ - public function upload(record_adapter &$record, array $options = array()) + public function upload(record_adapter $record, array $options = array()) { switch ($record->get_type()) { case self::ELEMENT_TYPE_VIDEO : diff --git a/lib/classes/Bridge/Api/Flickr.class.php b/lib/classes/Bridge/Api/Flickr.class.php index ece4c3e6b4..0b08ab3de1 100644 --- a/lib/classes/Bridge/Api/Flickr.class.php +++ b/lib/classes/Bridge/Api/Flickr.class.php @@ -511,7 +511,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf * @param array $options * @return string The new distant Id */ - public function upload(record_adapter &$record, Array $options = array()) + public function upload(record_adapter $record, Array $options = array()) { $uploader = new Phlickr_Uploader($this->_api); @@ -534,7 +534,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf */ public function acceptable_records() { - return function (record_adapter &$record) { + return function (record_adapter $record) { return in_array($record->get_type(), array('image')); }; } diff --git a/lib/classes/Bridge/Api/Interface.class.php b/lib/classes/Bridge/Api/Interface.class.php index 66ff784333..34ceb0d629 100644 --- a/lib/classes/Bridge/Api/Interface.class.php +++ b/lib/classes/Bridge/Api/Interface.class.php @@ -62,7 +62,7 @@ interface Bridge_Api_Interface * * @return Bridge_Api_Interface */ - public function set_auth_settings(Bridge_AccountSettings &$settings); + public function set_auth_settings(Bridge_AccountSettings $settings); /** * @@ -150,7 +150,7 @@ interface Bridge_Api_Interface public function get_error_message_from_status($connector_status); - public function upload(record_adapter &$record, array $options = array()); + public function upload(record_adapter $record, array $options = array()); public function is_valid_object_id($object_id); diff --git a/lib/classes/Bridge/Api/Youtube.class.php b/lib/classes/Bridge/Api/Youtube.class.php index 1de7016e78..ad09e3ec98 100644 --- a/lib/classes/Bridge/Api/Youtube.class.php +++ b/lib/classes/Bridge/Api/Youtube.class.php @@ -428,7 +428,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter */ public function acceptable_records() { - return function (record_adapter &$record) { + return function (record_adapter $record) { return $record->get_type() === 'video'; }; } @@ -525,7 +525,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter * @param Exception $e * @return Void */ - public function handle_exception(Exception &$e) + public function handle_exception(Exception $e) { if ($e instanceof Zend_Gdata_App_HttpException) { $response = $e->getResponse(); @@ -655,7 +655,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter * @param array $options * @return string The new distant Id */ - public function upload(record_adapter &$record, array $options = array()) + public function upload(record_adapter $record, array $options = array()) { switch ($record->get_type()) { case 'video': diff --git a/lib/classes/Bridge/Element.class.php b/lib/classes/Bridge/Element.class.php index fcf1833acf..24e7434318 100644 --- a/lib/classes/Bridge/Element.class.php +++ b/lib/classes/Bridge/Element.class.php @@ -116,7 +116,7 @@ class Bridge_Element * @param int $id * @return Bridge_Element */ - public function __construct(Application $app, Bridge_Account &$account, $id) + public function __construct(Application $app, Bridge_Account $account, $id) { $this->app = $app; $this->account = $account; @@ -484,7 +484,7 @@ class Bridge_Element * @param array $datas * @return Bridge_Element */ - public static function create(Application $app, Bridge_Account &$account, record_adapter &$record, $title, $status, $type, Array $datas = array()) + public static function create(Application $app, Bridge_Account $account, record_adapter $record, $title, $status, $type, Array $datas = array()) { $sql = 'INSERT INTO bridge_elements (id, account_id, sbas_id, record_id, dist_id, title, `type` diff --git a/lib/classes/Feed/Adapter.class.php b/lib/classes/Feed/Adapter.class.php index a6e86fe081..4a61b43b63 100644 --- a/lib/classes/Feed/Adapter.class.php +++ b/lib/classes/Feed/Adapter.class.php @@ -472,7 +472,7 @@ class Feed_Adapter extends Feed_Abstract implements Feed_Interface, cache_cachea * @param int $id * @return Feed_Adapter */ - public static function load_with_user(Application $app, User_Adapter &$user, $id) + public static function load_with_user(Application $app, User_Adapter $user, $id) { $feed = new self($app, $id); $coll = $feed->get_collection(); diff --git a/lib/classes/Feed/Aggregate.class.php b/lib/classes/Feed/Aggregate.class.php index 5ceecb5a14..67ffbfdd4d 100644 --- a/lib/classes/Feed/Aggregate.class.php +++ b/lib/classes/Feed/Aggregate.class.php @@ -220,7 +220,7 @@ class Feed_Aggregate extends Feed_Abstract implements Feed_Interface * @param User_Adapter $user * @return Feed_Aggregate */ - public static function load_with_user(Application $app, User_Adapter &$user) + public static function load_with_user(Application $app, User_Adapter $user) { $feeds = Feed_Collection::load_all($app, $user); diff --git a/lib/classes/Feed/Collection.class.php b/lib/classes/Feed/Collection.class.php index 6f131d0073..2b0e554613 100644 --- a/lib/classes/Feed/Collection.class.php +++ b/lib/classes/Feed/Collection.class.php @@ -116,9 +116,9 @@ class Feed_Collection implements Feed_CollectionInterface, cache_cacheableInterf return new self($app, $feeds); } - protected static function retrieve_public_feed_ids(appbox &$appbox) + protected static function retrieve_public_feed_ids(appbox $appbox) { - $key = self::get_cache_key(self::CACHE_PUBLIC); + $key = 'feedcollection_' . self::CACHE_PUBLIC; try { return $appbox->get_data_from_cache($key); diff --git a/lib/classes/Feed/Entry/Adapter.class.php b/lib/classes/Feed/Entry/Adapter.class.php index 404bf91994..c8ad644671 100644 --- a/lib/classes/Feed/Entry/Adapter.class.php +++ b/lib/classes/Feed/Entry/Adapter.class.php @@ -100,7 +100,7 @@ class Feed_Entry_Adapter implements Feed_Entry_Interface, cache_cacheableInterfa * @param int $id * @return Feed_Entry_Adapter */ - public function __construct(Application $app, Feed_Adapter &$feed, $id) + public function __construct(Application $app, Feed_Adapter $feed, $id) { $this->app = $app; $this->feed = $feed; diff --git a/lib/classes/Feed/Entry/Interface.class.php b/lib/classes/Feed/Entry/Interface.class.php index 20686e54f7..d25e270eef 100644 --- a/lib/classes/Feed/Entry/Interface.class.php +++ b/lib/classes/Feed/Entry/Interface.class.php @@ -20,7 +20,7 @@ use Alchemy\Phrasea\Application; interface Feed_Entry_Interface { - public function __construct(Application $app, Feed_Adapter &$feed, $id); + public function __construct(Application $app, Feed_Adapter $feed, $id); public function get_feed(); diff --git a/lib/classes/Feed/Entry/Item.class.php b/lib/classes/Feed/Entry/Item.class.php index 9437d67729..1433a0f380 100644 --- a/lib/classes/Feed/Entry/Item.class.php +++ b/lib/classes/Feed/Entry/Item.class.php @@ -54,7 +54,7 @@ class Feed_Entry_Item implements Feed_Entry_ItemInterface, cache_cacheableInterf * @param int $id * @return Feed_Entry_Item */ - public function __construct(appbox &$appbox, Feed_Entry_Adapter &$entry, $id) + public function __construct(appbox $appbox, Feed_Entry_Adapter $entry, $id) { $this->appbox = $appbox; $this->id = (int) $id; @@ -173,7 +173,7 @@ class Feed_Entry_Item implements Feed_Entry_ItemInterface, cache_cacheableInterf * @param record_adapter $record * @return Feed_Entry_Item */ - public static function create(appbox &$appbox, Feed_Entry_Adapter &$entry, record_adapter &$record) + public static function create(appbox $appbox, Feed_Entry_Adapter $entry, record_adapter $record) { $sql = 'SELECT (MAX(ord)+1) as sorter FROM feed_entry_elements WHERE entry_id = :entry_id'; diff --git a/lib/classes/Feed/Entry/ItemInterface.class.php b/lib/classes/Feed/Entry/ItemInterface.class.php index 2b544a8eda..2fdfe697f9 100644 --- a/lib/classes/Feed/Entry/ItemInterface.class.php +++ b/lib/classes/Feed/Entry/ItemInterface.class.php @@ -18,7 +18,7 @@ interface Feed_Entry_ItemInterface { - public function __construct(appbox &$appbox, Feed_Entry_Adapter &$entry, $id); + public function __construct(appbox $appbox, Feed_Entry_Adapter $entry, $id); public function get_id(); @@ -28,5 +28,5 @@ interface Feed_Entry_ItemInterface public function delete(); - public static function create(appbox &$appbox, Feed_Entry_Adapter &$entry, record_adapter &$record); + public static function create(appbox $appbox, Feed_Entry_Adapter $entry, record_adapter $record); } diff --git a/lib/classes/Feed/Publisher/Adapter.class.php b/lib/classes/Feed/Publisher/Adapter.class.php index f1915b9f27..d54454fe10 100644 --- a/lib/classes/Feed/Publisher/Adapter.class.php +++ b/lib/classes/Feed/Publisher/Adapter.class.php @@ -183,7 +183,7 @@ class Feed_Publisher_Adapter implements Feed_Publisher_Interface, cache_cacheabl * @param boolean $owner * @return Feed_Publisher_Adapter */ - public static function create(Application $app, User_Adapter &$user, Feed_Adapter &$feed, $owner) + public static function create(Application $app, User_Adapter $user, Feed_Adapter $feed, $owner) { $sql = 'INSERT INTO feed_publishers (id, usr_id, feed_id, owner, created_on, added_by) VALUES (null, :usr_id, :feed_id, :owner, NOW(), :added_by)'; @@ -208,7 +208,7 @@ class Feed_Publisher_Adapter implements Feed_Publisher_Interface, cache_cacheabl * @param User_Adapter $user * @return Feed_Publisher_Adapter */ - public static function getPublisher(appbox &$appbox, Feed_Adapter &$feed, User_Adapter &$user) + public static function getPublisher(appbox $appbox, Feed_Adapter $feed, User_Adapter $user) { foreach ($feed->get_publishers() as $publisher) { if ($publisher->get_user()->get_id() === $user->get_id()) { diff --git a/lib/classes/Feed/Publisher/Interface.class.php b/lib/classes/Feed/Publisher/Interface.class.php index 1d8e23bf02..bae7c5451f 100644 --- a/lib/classes/Feed/Publisher/Interface.class.php +++ b/lib/classes/Feed/Publisher/Interface.class.php @@ -34,7 +34,7 @@ interface Feed_Publisher_Interface public function delete(); - public static function create(Application $app, User_Adapter &$user, Feed_Adapter &$feed, $owner); + public static function create(Application $app, User_Adapter $user, Feed_Adapter $feed, $owner); - public static function getPublisher(appbox &$appbox, Feed_Adapter &$feed, User_Adapter &$user); + public static function getPublisher(appbox $appbox, Feed_Adapter $feed, User_Adapter $user); } diff --git a/lib/classes/Feed/XML/Abstract.class.php b/lib/classes/Feed/XML/Abstract.class.php index 4d6c8ff72d..244e1c97e0 100644 --- a/lib/classes/Feed/XML/Abstract.class.php +++ b/lib/classes/Feed/XML/Abstract.class.php @@ -200,7 +200,7 @@ abstract class Feed_XML_Abstract * @param string $tagcontent * @return DOMElement */ - protected function addTag(DOMDocument &$document, DOMNode &$node, $tagname, $tagcontent = null) + protected function addTag(DOMDocument $document, DOMNode $node, $tagname, $tagcontent = null) { $tag = $document->createElement($tagname); diff --git a/lib/classes/Session/Logger.class.php b/lib/classes/Session/Logger.class.php index 96bea4b0b6..b487283c40 100644 --- a/lib/classes/Session/Logger.class.php +++ b/lib/classes/Session/Logger.class.php @@ -50,7 +50,7 @@ class Session_Logger * @param int $log_id * @return Session_Logger */ - public function __construct(Application $app, databox &$databox, $log_id) + public function __construct(Application $app, databox $databox, $log_id) { $this->app = $app; $this->databox = $databox; @@ -97,7 +97,7 @@ class Session_Logger * @param Browser $browser * @return Session_Logger */ - public static function create(Application $app, databox &$databox, Browser &$browser) + public static function create(Application $app, databox $databox, Browser $browser) { $colls = array(); $registry = $app['phraseanet.registry']; diff --git a/lib/classes/appbox.class.php b/lib/classes/appbox.class.php index 5dac5828f3..baec1bc6e0 100644 --- a/lib/classes/appbox.class.php +++ b/lib/classes/appbox.class.php @@ -60,7 +60,7 @@ class appbox extends base * * @return appbox */ - public static function get_instance(Application $app, registryInterface &$registry = null) + public static function get_instance(Application $app, registryInterface $registry = null) { if (!self::$_instance instanceof self) { self::$_instance = new static($app, $registry); @@ -331,7 +331,7 @@ class appbox extends base return self::BASE_TYPE; } - public function forceUpgrade(Setup_Upgrade &$upgrader, Application $app) + public function forceUpgrade(Setup_Upgrade $upgrader, Application $app) { $from_version = $this->get_version(); @@ -441,7 +441,7 @@ class appbox extends base return $advices; } - protected function post_upgrade(Setup_Upgrade &$upgrader, Application $app) + protected function post_upgrade(Setup_Upgrade $upgrader, Application $app) { $upgrader->add_steps(1 + count($this->get_databoxes())); $this->apply_patches($this->get_version(), $app['phraseanet.version']->getNumber(), true, $upgrader, $app); @@ -465,7 +465,7 @@ class appbox extends base * @param type $write_file * @return type */ - public static function create(Application $app, registryInterface &$registry, connection_interface $conn, $dbname, Version $version, $write_file = false) + public static function create(Application $app, registryInterface $registry, connection_interface $conn, $dbname, Version $version, $write_file = false) { $credentials = $conn->get_credentials(); diff --git a/lib/classes/appbox/register.class.php b/lib/classes/appbox/register.class.php index 246efa8c0a..328ea9c1bb 100644 --- a/lib/classes/appbox/register.class.php +++ b/lib/classes/appbox/register.class.php @@ -32,7 +32,7 @@ class appbox_register * @param appbox $appbox * @return appbox_register */ - public function __construct(appbox &$appbox) + public function __construct(appbox $appbox) { $this->appbox = $appbox; diff --git a/lib/classes/base.class.php b/lib/classes/base.class.php index ba6d04b208..56ec18bb8d 100644 --- a/lib/classes/base.class.php +++ b/lib/classes/base.class.php @@ -258,7 +258,7 @@ abstract class base implements cache_cacheableInterface } } - protected function upgradeDb($apply_patches, Setup_Upgrade &$upgrader, Application $app) + protected function upgradeDb($apply_patches, Setup_Upgrade $upgrader, Application $app) { $recommends = array(); @@ -771,7 +771,7 @@ abstract class base implements cache_cacheableInterface return $return; } - protected function apply_patches($from, $to, $post_process, Setup_Upgrade &$upgrader, Application $app) + protected function apply_patches($from, $to, $post_process, Setup_Upgrade $upgrader, Application $app) { if (version_compare($from, $to, '=')) { return true; diff --git a/lib/classes/caption/Field/Value.class.php b/lib/classes/caption/Field/Value.class.php index 03e4d71f5e..896cd1bd09 100644 --- a/lib/classes/caption/Field/Value.class.php +++ b/lib/classes/caption/Field/Value.class.php @@ -362,7 +362,7 @@ class caption_Field_Value implements cache_cacheableInterface return $this; } - public static function create(Application $app, databox_field &$databox_field, record_Interface $record, $value, Vocabulary\ControlProvider\ControlProviderInterface $vocabulary = null, $vocabularyId = null) + public static function create(Application $app, databox_field $databox_field, record_Interface $record, $value, Vocabulary\ControlProvider\ControlProviderInterface $vocabulary = null, $vocabularyId = null) { $connbas = $databox_field->get_connection(); diff --git a/lib/classes/caption/field.class.php b/lib/classes/caption/field.class.php index 5140a1d845..7506e0d8a1 100644 --- a/lib/classes/caption/field.class.php +++ b/lib/classes/caption/field.class.php @@ -47,7 +47,7 @@ class caption_field implements cache_cacheableInterface * @param int $id * @return caption_field */ - public function __construct(Application $app, databox_field &$databox_field, record_Interface $record) + public function __construct(Application $app, databox_field $databox_field, record_Interface $record) { $this->app = $app; $this->record = $record; diff --git a/lib/classes/caption/interface.class.php b/lib/classes/caption/interface.class.php index 361e1795a3..33401315a4 100644 --- a/lib/classes/caption/interface.class.php +++ b/lib/classes/caption/interface.class.php @@ -20,7 +20,7 @@ use Alchemy\Phrasea\Application; interface caption_interface { - public function __construct(Application $app, record_Interface &$record, databox &$databox); + public function __construct(Application $app, record_Interface $record, databox $databox); public function get_highlight_fields($highlight = '', Array $grep_fields = null, searchEngine_adapter $searchEngine = null); } diff --git a/lib/classes/caption/record.class.php b/lib/classes/caption/record.class.php index f43017632e..afa45b9b23 100644 --- a/lib/classes/caption/record.class.php +++ b/lib/classes/caption/record.class.php @@ -49,7 +49,7 @@ class caption_record implements caption_interface, cache_cacheableInterface * @param databox $databox * @return caption_record */ - public function __construct(Application $app, record_Interface &$record, databox &$databox) + public function __construct(Application $app, record_Interface $record, databox $databox) { $this->app = $app; $this->sbas_id = $record->get_sbas_id(); diff --git a/lib/classes/collection.class.php b/lib/classes/collection.class.php index 14c1c53a75..703855e515 100644 --- a/lib/classes/collection.class.php +++ b/lib/classes/collection.class.php @@ -40,7 +40,7 @@ class collection implements cache_cacheableInterface const PIC_STAMP = 'stamp'; const PIC_PRESENTATION = 'presentation'; - protected function __construct(Application $app, $coll_id, databox &$databox) + protected function __construct(Application $app, $coll_id, databox $databox) { $this->app = $app; $this->databox = $databox; @@ -115,7 +115,7 @@ class collection implements cache_cacheableInterface return $this; } - public function enable(appbox &$appbox) + public function enable(appbox $appbox) { $sql = 'UPDATE bas SET active = "1" WHERE base_id = :base_id'; $stmt = $appbox->get_connection()->prepare($sql); @@ -131,7 +131,7 @@ class collection implements cache_cacheableInterface return $this; } - public function disable(appbox &$appbox) + public function disable(appbox $appbox) { $sql = 'UPDATE bas SET active=0 WHERE base_id = :base_id'; $stmt = $appbox->get_connection()->prepare($sql); @@ -534,11 +534,13 @@ class collection implements cache_cacheableInterface phrasea::reset_baseDatas($appbox); + $collection = self::get_from_coll_id($app, $databox, $new_id); + if (null !== $user) { - self::set_admin($new_bas, $user); + $collection->set_admin($new_bas, $user); } - return self::get_from_coll_id($app, $databox, $new_id); + return $collection; } public function set_admin($base_id, user_adapter $user) diff --git a/lib/classes/databox.class.php b/lib/classes/databox.class.php index a78ac7967f..1ec9bc9219 100644 --- a/lib/classes/databox.class.php +++ b/lib/classes/databox.class.php @@ -375,7 +375,7 @@ class databox extends base return; } - public static function create(Application $app, connection_pdo &$connection, \SplFileInfo $data_template, registryInterface $registry) + public static function create(Application $app, connection_pdo $connection, \SplFileInfo $data_template, registryInterface $registry) { if ( ! file_exists($data_template->getRealPath())) { throw new \InvalidArgumentException($data_template->getRealPath() . " does not exist"); @@ -607,7 +607,7 @@ class databox extends base return; } - private function addZeros($n, $length = 5) + private static function addZeros($n, $length = 5) { while (strlen($n) < $length) { $n = '0' . $n; diff --git a/lib/classes/databox/field.class.php b/lib/classes/databox/field.class.php index 491b4dda5e..8ccc9ac236 100644 --- a/lib/classes/databox/field.class.php +++ b/lib/classes/databox/field.class.php @@ -159,7 +159,7 @@ class databox_field implements cache_cacheableInterface * @param $id * @return databox_field */ - protected function __construct(Application $app, databox &$databox, $id) + protected function __construct(Application $app, databox $databox, $id) { $this->app = $app; $this->set_databox($databox); @@ -248,7 +248,7 @@ class databox_field implements cache_cacheableInterface * @param int $id * @return \databox_field */ - public static function get_instance(Application $app, databox &$databox, $id) + public static function get_instance(Application $app, databox $databox, $id) { $cache_key = 'field_' . $id; $instance_id = $databox->get_sbas_id() . '_' . $id; @@ -268,7 +268,7 @@ class databox_field implements cache_cacheableInterface * * @param databox $databox */ - public function set_databox(databox &$databox) + public function set_databox(databox $databox) { $this->databox = $databox; } diff --git a/lib/classes/databox/subdefsStructure.class.php b/lib/classes/databox/subdefsStructure.class.php index 8b9a13d137..fa616caf22 100644 --- a/lib/classes/databox/subdefsStructure.class.php +++ b/lib/classes/databox/subdefsStructure.class.php @@ -46,7 +46,7 @@ class databox_subdefsStructure implements IteratorAggregate, Countable * @param databox $databox * @return Array */ - public function __construct(databox &$databox) + public function __construct(databox $databox) { $this->databox = $databox; diff --git a/lib/classes/eventsmanager/eventAbstract.class.php b/lib/classes/eventsmanager/eventAbstract.class.php index 2cb771db8e..3967503b5f 100644 --- a/lib/classes/eventsmanager/eventAbstract.class.php +++ b/lib/classes/eventsmanager/eventAbstract.class.php @@ -19,7 +19,7 @@ abstract class eventsmanager_eventAbstract */ protected $broker; - public function __construct(Application $app, eventsmanager_broker &$broker) + public function __construct(Application $app, eventsmanager_broker $broker) { $this->app = $app; $this->broker = $broker; diff --git a/lib/classes/eventsmanager/notify/autoregister.class.php b/lib/classes/eventsmanager/notify/autoregister.class.php index f47ec705be..0133eb54f1 100644 --- a/lib/classes/eventsmanager/notify/autoregister.class.php +++ b/lib/classes/eventsmanager/notify/autoregister.class.php @@ -260,7 +260,9 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract public function is_available() { $bool = false; - if ( ! $this->app->isAuthenticated() || ! login::register_enabled($this->app)) { + $login = new \login(); + + if ( ! $this->app->isAuthenticated() || ! $login->register_enabled($this->app)) { return false; } diff --git a/lib/classes/eventsmanager/notify/orderdeliver.class.php b/lib/classes/eventsmanager/notify/orderdeliver.class.php index a4d9ed1a1e..3f11ed7f67 100644 --- a/lib/classes/eventsmanager/notify/orderdeliver.class.php +++ b/lib/classes/eventsmanager/notify/orderdeliver.class.php @@ -29,7 +29,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract * * @return notify_orderdeliver */ - public function __construct(Application $app, eventsmanager_broker &$broker) + public function __construct(Application $app, eventsmanager_broker $broker) { $this->group = _('Commande'); parent::__construct($app, $broker); diff --git a/lib/classes/eventsmanager/notify/ordernotdelivered.class.php b/lib/classes/eventsmanager/notify/ordernotdelivered.class.php index 0cc3496344..45e9aa22d4 100644 --- a/lib/classes/eventsmanager/notify/ordernotdelivered.class.php +++ b/lib/classes/eventsmanager/notify/ordernotdelivered.class.php @@ -24,7 +24,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac */ public $events = array('__ORDER_NOT_DELIVERED__'); - public function __construct(Application $app, eventsmanager_broker &$broker) + public function __construct(Application $app, eventsmanager_broker $broker) { $this->group = _('Commande'); parent::__construct($app, $broker); diff --git a/lib/classes/eventsmanager/notify/register.class.php b/lib/classes/eventsmanager/notify/register.class.php index 2ea78328c3..7b23759fda 100644 --- a/lib/classes/eventsmanager/notify/register.class.php +++ b/lib/classes/eventsmanager/notify/register.class.php @@ -264,8 +264,9 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract public function is_available() { $bool = false; + $login = new \login(); - if ( !$this->app->isAuthenticated() || ! login::register_enabled($this->app)) { + if ( !$this->app->isAuthenticated() || ! $login->register_enabled($this->app)) { return false; } diff --git a/lib/classes/eventsmanager/notify/validate.class.php b/lib/classes/eventsmanager/notify/validate.class.php index 1547f8b8bb..51c44f1455 100644 --- a/lib/classes/eventsmanager/notify/validate.class.php +++ b/lib/classes/eventsmanager/notify/validate.class.php @@ -29,7 +29,7 @@ class eventsmanager_notify_validate extends eventsmanager_notifyAbstract * * @return notify_validate */ - public function __construct(Application $app, eventsmanager_broker &$broker) + public function __construct(Application $app, eventsmanager_broker $broker) { $this->group = _('Validation'); parent::__construct($app, $broker); diff --git a/lib/classes/eventsmanager/notify/validationdone.class.php b/lib/classes/eventsmanager/notify/validationdone.class.php index e3d314f64a..93795b3a59 100644 --- a/lib/classes/eventsmanager/notify/validationdone.class.php +++ b/lib/classes/eventsmanager/notify/validationdone.class.php @@ -29,7 +29,7 @@ class eventsmanager_notify_validationdone extends eventsmanager_notifyAbstract * * @return notify_validationdone */ - public function __construct(Application $app, eventsmanager_broker &$broker) + public function __construct(Application $app, eventsmanager_broker $broker) { $this->group = _('Validation'); parent::__construct($app, $broker); diff --git a/lib/classes/eventsmanager/notify/validationreminder.class.php b/lib/classes/eventsmanager/notify/validationreminder.class.php index 5f2f1601eb..13b5768003 100644 --- a/lib/classes/eventsmanager/notify/validationreminder.class.php +++ b/lib/classes/eventsmanager/notify/validationreminder.class.php @@ -29,7 +29,7 @@ class eventsmanager_notify_validationreminder extends eventsmanager_notifyAbstra * * @return notify_validationreminder */ - public function __construct(Application $app, eventsmanager_broker &$broker) + public function __construct(Application $app, eventsmanager_broker $broker) { $this->group = _('Validation'); parent::__construct($app, $broker); diff --git a/lib/classes/media/Permalink/Adapter.class.php b/lib/classes/media/Permalink/Adapter.class.php index ef54c7a9cb..ca8e2b0c05 100644 --- a/lib/classes/media/Permalink/Adapter.class.php +++ b/lib/classes/media/Permalink/Adapter.class.php @@ -74,7 +74,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea * @param media_subdef $media_subdef * @return media_Permalink_Adapter */ - protected function __construct(Application $app, databox &$databox, media_subdef &$media_subdef) + protected function __construct(Application $app, databox $databox, media_subdef $media_subdef) { $this->app = $app; $this->databox = $databox; @@ -305,7 +305,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea * @param media_subdef $media_subdef * @return media_Permalink_Adapter */ - public static function getPermalink(Application $app, databox &$databox, media_subdef &$media_subdef) + public static function getPermalink(Application $app, databox $databox, media_subdef $media_subdef) { try { return new self($app, $databox, $media_subdef); @@ -322,7 +322,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea * @param media_subdef $media_subdef * @return media_Permalink_Adapter */ - public static function create(Application $app, databox &$databox, media_subdef &$media_subdef) + public static function create(Application $app, databox $databox, media_subdef $media_subdef) { $sql = 'INSERT INTO permalinks (id, subdef_id, token, activated, created_on, last_modified, label) @@ -353,7 +353,7 @@ class media_Permalink_Adapter implements media_Permalink_Interface, cache_cachea * @param string $name * @return record_adapter */ - public static function challenge_token(Application $app, databox &$databox, $token, $record_id, $name) + public static function challenge_token(Application $app, databox $databox, $token, $record_id, $name) { $sql = 'SELECT p.id FROM permalinks p, subdef s diff --git a/lib/classes/media/Permalink/Interface.class.php b/lib/classes/media/Permalink/Interface.class.php index 1c618b6828..c77a6c107b 100644 --- a/lib/classes/media/Permalink/Interface.class.php +++ b/lib/classes/media/Permalink/Interface.class.php @@ -40,7 +40,7 @@ interface media_Permalink_Interface public function set_label($label); - public static function getPermalink(Application $app, databox &$databox, media_subdef &$media_subdef); + public static function getPermalink(Application $app, databox $databox, media_subdef $media_subdef); - public static function create(Application $app, databox &$databox, media_subdef &$media_subdef); + public static function create(Application $app, databox $databox, media_subdef $media_subdef); } diff --git a/lib/classes/media/subdef.class.php b/lib/classes/media/subdef.class.php index 93b378ac58..b098def342 100644 --- a/lib/classes/media/subdef.class.php +++ b/lib/classes/media/subdef.class.php @@ -146,7 +146,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface * @param type $substitute * @return media_subdef */ - public function __construct(Application $app, record_adapter &$record, $name, $substitute = false) + public function __construct(Application $app, record_adapter $record, $name, $substitute = false) { $this->app = $app; $this->name = $name; diff --git a/lib/classes/module/console/systemConfigCheck.class.php b/lib/classes/module/console/systemConfigCheck.class.php index 3aeea34689..c067e936cd 100644 --- a/lib/classes/module/console/systemConfigCheck.class.php +++ b/lib/classes/module/console/systemConfigCheck.class.php @@ -85,7 +85,7 @@ class module_console_systemConfigCheck extends Command return (int) ! $ok; } - protected function processConstraints(Setup_ConstraintsIterator $constraints, OutputInterface &$output) + protected function processConstraints(Setup_ConstraintsIterator $constraints, OutputInterface $output) { $hasError = false; foreach ($constraints as $constraint) { @@ -97,7 +97,7 @@ class module_console_systemConfigCheck extends Command return ! $hasError; } - protected function processConstraint(Setup_Constraint $constraint, OutputInterface &$output) + protected function processConstraint(Setup_Constraint $constraint, OutputInterface $output) { $ok = true; if ($constraint->is_ok()) { diff --git a/lib/classes/module/console/tasklist.class.php b/lib/classes/module/console/tasklist.class.php index e9941d9f03..8063f60451 100644 --- a/lib/classes/module/console/tasklist.class.php +++ b/lib/classes/module/console/tasklist.class.php @@ -64,7 +64,7 @@ class module_console_tasklist extends Command } } - protected function printTask(task_abstract $task, OutputInterface &$output) + protected function printTask(task_abstract $task, OutputInterface $output) { $message = $task->getID() . "\t" . ($task->getState() ) . "\t" . $task->getTitle(); $output->writeln($message); diff --git a/lib/classes/patch/303.class.php b/lib/classes/patch/303.class.php index 7aaaf56b88..9615fe43b4 100644 --- a/lib/classes/patch/303.class.php +++ b/lib/classes/patch/303.class.php @@ -54,7 +54,7 @@ class patch_303 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $this->update_users_log_datas($appbox); $this->update_users_search_datas($appbox); @@ -66,7 +66,7 @@ class patch_303 implements patchInterface * * @return patch_303 */ - public function update_users_log_datas(appbox &$appbox) + public function update_users_log_datas(appbox $appbox) { $col = array('fonction', 'societe', 'activite', 'pays'); @@ -112,7 +112,7 @@ class patch_303 implements patchInterface * * @return patch_303 */ - public function update_users_search_datas(appbox &$appbox) + public function update_users_search_datas(appbox $appbox) { foreach ($appbox->get_databoxes() as $databox) { $date_debut = '0000-00-00 00:00:00'; diff --git a/lib/classes/patch/304.class.php b/lib/classes/patch/304.class.php index cdcc371887..4624eab6e3 100644 --- a/lib/classes/patch/304.class.php +++ b/lib/classes/patch/304.class.php @@ -54,7 +54,7 @@ class patch_304 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $sql = 'SELECT id FROM pref WHERE prop = "indexes"'; $stmt = $databox->get_connection()->prepare($sql); diff --git a/lib/classes/patch/305.class.php b/lib/classes/patch/305.class.php index 3e67aadf30..c112d01c80 100644 --- a/lib/classes/patch/305.class.php +++ b/lib/classes/patch/305.class.php @@ -54,7 +54,7 @@ class patch_305 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $sql = 'REPLACE INTO usr_settings (SELECT usr_id, "start_page_query" as prop, last_query as value diff --git a/lib/classes/patch/306.class.php b/lib/classes/patch/306.class.php index 56a9cc8bb9..e9b7a28568 100644 --- a/lib/classes/patch/306.class.php +++ b/lib/classes/patch/306.class.php @@ -54,7 +54,7 @@ class patch_306 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $dom = $databox->get_dom_structure(); $xpath = $databox->get_xpath_structure(); diff --git a/lib/classes/patch/310.class.php b/lib/classes/patch/310.class.php index af1adb622d..fad84c0bf2 100644 --- a/lib/classes/patch/310.class.php +++ b/lib/classes/patch/310.class.php @@ -54,7 +54,7 @@ class patch_310 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $dom_structure = $databox->get_dom_structure(); $sx_structure = $databox->get_sxml_structure(); diff --git a/lib/classes/patch/3103.class.php b/lib/classes/patch/3103.class.php index ec509fa936..ee531da752 100644 --- a/lib/classes/patch/3103.class.php +++ b/lib/classes/patch/3103.class.php @@ -54,7 +54,7 @@ class patch_3103 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $conn = $appbox->get_connection(); diff --git a/lib/classes/patch/311.class.php b/lib/classes/patch/311.class.php index d28882a974..d595bc246f 100644 --- a/lib/classes/patch/311.class.php +++ b/lib/classes/patch/311.class.php @@ -54,7 +54,7 @@ class patch_311 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $sql = 'UPDATE record SET jeton = ' . (JETON_WRITE_META_DOC | JETON_WRITE_META_SUBDEF); diff --git a/lib/classes/patch/320.class.php b/lib/classes/patch/320.class.php index b45e5d59f4..80f6afb787 100644 --- a/lib/classes/patch/320.class.php +++ b/lib/classes/patch/320.class.php @@ -54,7 +54,7 @@ class patch_320 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $sql = 'UPDATE record SET parent_record_id = "1" WHERE parent_record_id != "0"'; diff --git a/lib/classes/patch/320a.class.php b/lib/classes/patch/320a.class.php index 29466aa05a..54f61c3a45 100644 --- a/lib/classes/patch/320a.class.php +++ b/lib/classes/patch/320a.class.php @@ -53,7 +53,7 @@ class patch_320a implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $sql = 'SELECT * FROM usr WHERE nonce IS NULL'; diff --git a/lib/classes/patch/320aa.class.php b/lib/classes/patch/320aa.class.php index c022601392..d574672fd3 100644 --- a/lib/classes/patch/320aa.class.php +++ b/lib/classes/patch/320aa.class.php @@ -53,7 +53,7 @@ class patch_320aa implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { if (is_file(__DIR__ . '/../../../config/_GV.php')) { require __DIR__ . '/../../../config/_GV.php'; diff --git a/lib/classes/patch/320ab.class.php b/lib/classes/patch/320ab.class.php index 31d53f3c7f..c2c0a53cee 100644 --- a/lib/classes/patch/320ab.class.php +++ b/lib/classes/patch/320ab.class.php @@ -53,7 +53,7 @@ class patch_320ab implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $sql = 'REPLACE INTO records_rights (SELECT null as id, usr_id, b.sbas_id, record_id, "1" as document diff --git a/lib/classes/patch/320b.class.php b/lib/classes/patch/320b.class.php index 6dae7e0670..f5345ba3a6 100644 --- a/lib/classes/patch/320b.class.php +++ b/lib/classes/patch/320b.class.php @@ -53,7 +53,7 @@ class patch_320b implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $sql = 'UPDATE basusr SET nowatermark=1 WHERE needwatermark=0'; $stmt = $appbox->get_connection()->prepare($sql); diff --git a/lib/classes/patch/320c.class.php b/lib/classes/patch/320c.class.php index 36f79b5056..c7368fd1f1 100644 --- a/lib/classes/patch/320c.class.php +++ b/lib/classes/patch/320c.class.php @@ -53,7 +53,7 @@ class patch_320c implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $sql = 'TRUNCATE metadatas'; $stmt = $databox->get_connection()->prepare($sql); diff --git a/lib/classes/patch/320d.class.php b/lib/classes/patch/320d.class.php index b6779e2d7b..579294c026 100644 --- a/lib/classes/patch/320d.class.php +++ b/lib/classes/patch/320d.class.php @@ -53,7 +53,7 @@ class patch_320d implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $sql = 'SELECT base_id, usr_id FROM order_masters'; diff --git a/lib/classes/patch/320e.class.php b/lib/classes/patch/320e.class.php index d94c42f13b..b5845fb86e 100644 --- a/lib/classes/patch/320e.class.php +++ b/lib/classes/patch/320e.class.php @@ -53,7 +53,7 @@ class patch_320e implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $sql = 'UPDATE record r, subdef s SET r.mime = s.mime diff --git a/lib/classes/patch/320f.class.php b/lib/classes/patch/320f.class.php index 4055cf1c15..886f08927c 100644 --- a/lib/classes/patch/320f.class.php +++ b/lib/classes/patch/320f.class.php @@ -53,7 +53,7 @@ class patch_320f implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $feeds = array(); @@ -136,7 +136,7 @@ class patch_320f implements patchInterface } protected static $feeds = array(); - protected function get_feed(appbox &$appbox, User_Adapter &$user, $pub_restrict, $homelink) + protected function get_feed(appbox $appbox, User_Adapter $user, $pub_restrict, $homelink) { $user_key = 'user_' . $user->get_id(); if ($homelink == '1') diff --git a/lib/classes/patch/320h.class.php b/lib/classes/patch/320h.class.php index 435ec574bd..7b4ba72d7b 100644 --- a/lib/classes/patch/320h.class.php +++ b/lib/classes/patch/320h.class.php @@ -53,7 +53,7 @@ class patch_320h implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $sql = 'DELETE FROM basusr WHERE actif = "0"'; diff --git a/lib/classes/patch/360.class.php b/lib/classes/patch/360.class.php index 7c0a59abcb..5a7dd86bed 100644 --- a/lib/classes/patch/360.class.php +++ b/lib/classes/patch/360.class.php @@ -53,7 +53,7 @@ class patch_360 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $tables = array('StoryWZ', 'ValidationDatas', 'ValidationParticipants', 'ValidationSessions', 'BasketElements', 'Baskets'); diff --git a/lib/classes/patch/3602.class.php b/lib/classes/patch/3602.class.php index 8b5c0a545d..422614d435 100644 --- a/lib/classes/patch/3602.class.php +++ b/lib/classes/patch/3602.class.php @@ -53,7 +53,7 @@ class patch_3602 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { try { $sql = 'ALTER TABLE `metadatas` DROP INDEX `unique`'; diff --git a/lib/classes/patch/3603.class.php b/lib/classes/patch/3603.class.php index b06d04ff9a..3a2a98215f 100644 --- a/lib/classes/patch/3603.class.php +++ b/lib/classes/patch/3603.class.php @@ -53,7 +53,7 @@ class patch_3603 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $sql = 'UPDATE usr SET usr_mail = NULL diff --git a/lib/classes/patch/3604.class.php b/lib/classes/patch/3604.class.php index 72b0d3d7c9..1602e20d6a 100644 --- a/lib/classes/patch/3604.class.php +++ b/lib/classes/patch/3604.class.php @@ -53,7 +53,7 @@ class patch_3604 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { /** * Fail if upgrade has previously failed, no problem diff --git a/lib/classes/patch/361.class.php b/lib/classes/patch/361.class.php index 36ffe3b9d6..e4906d5b22 100644 --- a/lib/classes/patch/361.class.php +++ b/lib/classes/patch/361.class.php @@ -54,7 +54,7 @@ class patch_361 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $conn = $appbox->get_connection(); diff --git a/lib/classes/patch/370.class.php b/lib/classes/patch/370.class.php index 1d314b1b57..1cef3172b3 100644 --- a/lib/classes/patch/370.class.php +++ b/lib/classes/patch/370.class.php @@ -53,7 +53,7 @@ class patch_370 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $conn = $databox->get_connection(); diff --git a/lib/classes/patch/370a3.class.php b/lib/classes/patch/370a3.class.php index 645782030e..5ed4b7a226 100644 --- a/lib/classes/patch/370a3.class.php +++ b/lib/classes/patch/370a3.class.php @@ -54,7 +54,7 @@ class patch_370a3 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { try { \API_OAuth2_Application::load_from_client_id($app, \API_OAuth2_Application_Navigator::CLIENT_ID); diff --git a/lib/classes/patch/370a4.class.php b/lib/classes/patch/370a4.class.php index c784c8886f..684e951c11 100644 --- a/lib/classes/patch/370a4.class.php +++ b/lib/classes/patch/370a4.class.php @@ -53,7 +53,7 @@ class patch_370a4 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $sql = 'SELECT id, src FROM metadatas_structure'; diff --git a/lib/classes/patch/370a5.class.php b/lib/classes/patch/370a5.class.php index b477448a75..50fddd5294 100644 --- a/lib/classes/patch/370a5.class.php +++ b/lib/classes/patch/370a5.class.php @@ -53,7 +53,7 @@ class patch_370a5 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $sql = 'SELECT id, src FROM metadatas_structure'; diff --git a/lib/classes/patch/370a6.class.php b/lib/classes/patch/370a6.class.php index 670cce09cc..5a72f61a43 100644 --- a/lib/classes/patch/370a6.class.php +++ b/lib/classes/patch/370a6.class.php @@ -53,7 +53,7 @@ class patch_370a6 implements patchInterface return $this->concern; } - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { $structure = $databox->get_structure(); diff --git a/lib/classes/patch/370a7.class.php b/lib/classes/patch/370a7.class.php index 2622408ad0..65276e1e91 100644 --- a/lib/classes/patch/370a7.class.php +++ b/lib/classes/patch/370a7.class.php @@ -55,7 +55,7 @@ class patch_370a7 implements patchInterface return $this->concern; } - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $conn = $appbox->get_connection(); diff --git a/lib/classes/patch/370a8.class.php b/lib/classes/patch/370a8.class.php index 6467d05616..64c4dbfa59 100644 --- a/lib/classes/patch/370a8.class.php +++ b/lib/classes/patch/370a8.class.php @@ -60,7 +60,7 @@ class patch_370a8 implements patchInterface * @param base $appbox * @return boolean */ - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $task_manager = new task_manager($app); diff --git a/lib/classes/patch/370a9.class.php b/lib/classes/patch/370a9.class.php index ed0a52cad5..7fca929e3b 100644 --- a/lib/classes/patch/370a9.class.php +++ b/lib/classes/patch/370a9.class.php @@ -58,7 +58,7 @@ class patch_370a9 implements patchInterface * Add new border manager service to services.yml & config.yml configuration files * @param base $appbox */ - public function apply(base &$appbox, Application $app) + public function apply(base $appbox, Application $app) { $services = $app['phraseanet.configuration']->getServices(); diff --git a/lib/classes/patch/371.class.php b/lib/classes/patch/371.class.php index f3d319b43e..108737653e 100644 --- a/lib/classes/patch/371.class.php +++ b/lib/classes/patch/371.class.php @@ -57,7 +57,7 @@ class patch_371 implements patchInterface /** * @param base $databox */ - public function apply(base &$databox, Application $app) + public function apply(base $databox, Application $app) { foreach($databox->get_meta_structure() as $databox_field) { $databox_field->save(); diff --git a/lib/classes/patchInterface.class.php b/lib/classes/patchInterface.class.php index ee044191ee..0cf3b4db9e 100644 --- a/lib/classes/patchInterface.class.php +++ b/lib/classes/patchInterface.class.php @@ -11,5 +11,5 @@ interface patchInterface public function require_all_upgrades(); - public function apply(base &$base, Application $app); + public function apply(base $base, Application $app); } diff --git a/lib/classes/record/Interface.class.php b/lib/classes/record/Interface.class.php index b58b2eab14..37606efb66 100644 --- a/lib/classes/record/Interface.class.php +++ b/lib/classes/record/Interface.class.php @@ -57,7 +57,7 @@ interface record_Interface public function get_duration(); - public function move_to_collection(collection &$collection, appbox &$appbox); + public function move_to_collection(collection $collection, appbox $appbox); public function get_rollover_thumbnail(); diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php index 1d20216476..8ae2c8ba48 100644 --- a/lib/classes/record/adapter.class.php +++ b/lib/classes/record/adapter.class.php @@ -489,7 +489,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface * @param appbox $appbox * @return record_adapter */ - public function move_to_collection(collection &$collection, appbox &$appbox) + public function move_to_collection(collection $collection, appbox $appbox) { $sql = "UPDATE record SET coll_id = :coll_id WHERE record_id =:record_id"; diff --git a/lib/classes/set/abstract.class.php b/lib/classes/set/abstract.class.php index 0b1b3ee9e7..ea787ac07b 100644 --- a/lib/classes/set/abstract.class.php +++ b/lib/classes/set/abstract.class.php @@ -148,7 +148,7 @@ abstract class set_abstract implements IteratorAggregate * @param record_Interface $record * @return set */ - public function add_element(record_Interface &$record) + public function add_element(record_Interface $record) { $this->elements[$record->get_serialize_key()] = $record; @@ -160,7 +160,7 @@ abstract class set_abstract implements IteratorAggregate * @param record_Interface $record * @return set */ - public function remove_element(record_Interface &$record) + public function remove_element(record_Interface $record) { $key = $record->get_serialize_key(); if (isset($this->elements[$key])) diff --git a/lib/classes/task/abstract.class.php b/lib/classes/task/abstract.class.php index 4fcc61f03a..0e38c5c1ca 100755 --- a/lib/classes/task/abstract.class.php +++ b/lib/classes/task/abstract.class.php @@ -836,7 +836,7 @@ abstract class task_abstract $params = array( ':active' => 1 - , ':name' => $class_name::getName() + , ':name' => '' , ':class' => $class_name , ':settings' => $settings ); @@ -846,7 +846,10 @@ abstract class task_abstract $tid = $dependencyContainer['phraseanet.appbox']->get_connection()->lastInsertId(); - return new $class_name($tid, $dependencyContainer, $dependencyContainer['monolog']); + $task = new $class_name($tid, $dependencyContainer, $dependencyContainer['monolog']); + $task->setTitle($task->getName()); + + return $task; } public function getUsage() diff --git a/lib/classes/task/period/apibridge.class.php b/lib/classes/task/period/apibridge.class.php index 140f45cf95..171910d013 100755 --- a/lib/classes/task/period/apibridge.class.php +++ b/lib/classes/task/period/apibridge.class.php @@ -138,7 +138,7 @@ class task_period_apibridge extends task_appboxAbstract * @param Bridge_Element $element * @return task_period_apibridge */ - protected function update_element(Bridge_Element &$element) + protected function update_element(Bridge_Element $element) { $account = $element->get_account(); $connector_status = $account->get_api()->get_element_status($element); diff --git a/tests/Feed/Publisher/Feed_Publisher_AdapterTest.php b/tests/Feed/Publisher/Feed_Publisher_AdapterTest.php index 889b069763..9081170362 100644 --- a/tests/Feed/Publisher/Feed_Publisher_AdapterTest.php +++ b/tests/Feed/Publisher/Feed_Publisher_AdapterTest.php @@ -25,7 +25,8 @@ class Feed_Publisher_AdapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $auth = new Session_Authentication_None(self::$DI['user']); self::$DI['app']->openAccount($auth); self::$feed = Feed_Adapter::create(self::$DI['app'], self::$DI['user'], self::$title, self::$subtitle); - self::$object = array_pop(self::$feed->get_publishers()); + $publishers = self::$feed->get_publishers(); + self::$object = array_pop($publishers); } public static function tearDownAfterClass() diff --git a/tests/api/oauthv2/API_OAuth2_AuthCodeTest.php b/tests/api/oauthv2/API_OAuth2_AuthCodeTest.php index 3246ba2a0f..e6b7f1d9c7 100644 --- a/tests/api/oauthv2/API_OAuth2_AuthCodeTest.php +++ b/tests/api/oauthv2/API_OAuth2_AuthCodeTest.php @@ -13,6 +13,7 @@ class API_OAuth2_AuthCodeTest extends PhraseanetPHPUnitAbstract protected $code; protected $account; + protected $application; public function setUp() { diff --git a/tests/caption/caption_recordTest.php b/tests/caption/caption_recordTest.php index a416a60dc6..efa6a2af48 100644 --- a/tests/caption/caption_recordTest.php +++ b/tests/caption/caption_recordTest.php @@ -49,7 +49,8 @@ class caption_recordTest extends PhraseanetPHPUnitAbstract } } else { $tagname = $field->get_name(); - $value = array_pop($field->get_values()); + $data = $field->get_values(); + $value = array_pop($data); $this->assertEquals($value->getValue(), (string) $sxe->description->$tagname); } } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_ContributorTest.php b/tests/databox/Field/DCES/databox_Field_DCES_ContributorTest.php index cbc100136a..6991a99b9c 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_ContributorTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_ContributorTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_ContributorTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_CoverageTest.php b/tests/databox/Field/DCES/databox_Field_DCES_CoverageTest.php index ae21799f54..d156b5689d 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_CoverageTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_CoverageTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_CoverageTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_CreatorTest.php b/tests/databox/Field/DCES/databox_Field_DCES_CreatorTest.php index 682e4be596..b56ef6a123 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_CreatorTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_CreatorTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_CreatorTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_DateTest.php b/tests/databox/Field/DCES/databox_Field_DCES_DateTest.php index bf291c8ed4..644bf5d485 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_DateTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_DateTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_DateTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_DescriptionTest.php b/tests/databox/Field/DCES/databox_Field_DCES_DescriptionTest.php index 90b7d6e836..77cfdc6864 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_DescriptionTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_DescriptionTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_DescriptionTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_FormatTest.php b/tests/databox/Field/DCES/databox_Field_DCES_FormatTest.php index 13ff9afa48..e5cd82953e 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_FormatTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_FormatTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_FormatTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_IdentifierTest.php b/tests/databox/Field/DCES/databox_Field_DCES_IdentifierTest.php index 9836fb5eb5..47f86f28b7 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_IdentifierTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_IdentifierTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_IdentifierTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_LanguageTest.php b/tests/databox/Field/DCES/databox_Field_DCES_LanguageTest.php index 51f5e1b122..5a4d9f657b 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_LanguageTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_LanguageTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_LanguageTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_PublisherTest.php b/tests/databox/Field/DCES/databox_Field_DCES_PublisherTest.php index 165c8554b4..17ef29b914 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_PublisherTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_PublisherTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_PublisherTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_RelationTest.php b/tests/databox/Field/DCES/databox_Field_DCES_RelationTest.php index 4a3d645f69..6ff5f78698 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_RelationTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_RelationTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_RelationTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_RightsTest.php b/tests/databox/Field/DCES/databox_Field_DCES_RightsTest.php index 681dbec3cb..7ca5628006 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_RightsTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_RightsTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_RightsTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_SourceTest.php b/tests/databox/Field/DCES/databox_Field_DCES_SourceTest.php index b34e127337..37aeffc0c7 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_SourceTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_SourceTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_SourceTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_SubjectTest.php b/tests/databox/Field/DCES/databox_Field_DCES_SubjectTest.php index 03abb9c97d..d5bf3385cc 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_SubjectTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_SubjectTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_SubjectTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_TitleTest.php b/tests/databox/Field/DCES/databox_Field_DCES_TitleTest.php index 0f6b8d2c5d..f79b33ebaf 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_TitleTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_TitleTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_TitleTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/Field/DCES/databox_Field_DCES_TypeTest.php b/tests/databox/Field/DCES/databox_Field_DCES_TypeTest.php index 9335ae5042..da31979a83 100644 --- a/tests/databox/Field/DCES/databox_Field_DCES_TypeTest.php +++ b/tests/databox/Field/DCES/databox_Field_DCES_TypeTest.php @@ -17,7 +17,8 @@ class databox_Field_DCES_TypeTest extends PhraseanetPHPUnitAbstract public function testGet_label() { - $name = str_replace('Test', '', array_pop(explode('_', __CLASS__))); + $data = explode('_', __CLASS__); + $name = str_replace('Test', '', array_pop($data)); $this->assertEquals($name, $this->object->get_label()); } diff --git a/tests/databox/databox_fieldTest.php b/tests/databox/databox_fieldTest.php index 03848796e2..c407fc798b 100644 --- a/tests/databox/databox_fieldTest.php +++ b/tests/databox/databox_fieldTest.php @@ -352,7 +352,8 @@ class databox_fieldTest extends PhraseanetPHPUnitAbstract $this->object_mono->set_name('Bonobo yoyo')->save(); - $value = array_pop(self::$DI['record_1']->get_caption()->get_field('Bonoboyoyo')->get_values()); + $data = self::$DI['record_1']->get_caption()->get_field('Bonoboyoyo')->get_values(); + $value = array_pop($data); $this->assertEquals($value->getValue(), $AddedValue); } diff --git a/tests/module/console/module_console_systemTemplateGeneratorTest.php b/tests/module/console/module_console_systemTemplateGeneratorTest.php index b765dc55c6..c3868e9b02 100644 --- a/tests/module/console/module_console_systemTemplateGeneratorTest.php +++ b/tests/module/console/module_console_systemTemplateGeneratorTest.php @@ -17,7 +17,8 @@ class module_console_systemTemplateGeneratorTest extends PHPUnit_Framework_TestC $commandTester = new CommandTester($command); $commandTester->execute(array('command' => $command->getName())); - $last_line = array_pop(explode("\n", trim($commandTester->getDisplay()))); + $data = explode("\n", trim($commandTester->getDisplay())); + $last_line = array_pop($data); $this->assertTrue(strpos($last_line, 'templates failed') === false, 'Some templates failed'); $this->assertTrue(strpos($last_line, 'templates generated') !== true, 'Some templates have been generated'); diff --git a/tests/record/adapterTest.php b/tests/record/adapterTest.php index a2387d07f5..67bf77f4ce 100644 --- a/tests/record/adapterTest.php +++ b/tests/record/adapterTest.php @@ -333,7 +333,8 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract $meta_id = null; if ($field) { - $meta_id = array_pop($field->get_values())->getId(); + $values = $field->get_values(); + $meta_id = array_pop($values)->getId(); } $metadatas[] = array(