Skip to content
Snippets Groups Projects
Commit 4aa297f1 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

fix phpmd unused

parent b0752585
Branches
Tags
2 merge requests!1132Hotline#29412 images des articles dans le resultat de recherche,!1031Phpmd on bibnumerique webservices
......@@ -37,8 +37,6 @@ class Class_WebService_BibNumerique_ArteVOD extends Class_WebService_BibNumeriqu
return;
}
$existing_ids = array();
$this->getLogger()->info('Réponse reçue');
$reader = $this->getFilmsReader()->parse($content);
if (1 == $page_number)
......
......@@ -66,19 +66,23 @@ class Class_WebService_Bibnumerique_ArteVOD_FilmReader {
$this->_film->addMatiere($data);
}
public function endDuration($data) {
$this->_film->addDuration($data);
}
public function endProduction_Year($data) {
$this->_film->setYear($data);
}
public function endTag($data) {
$this->_film->addTag($data);
}
public function startPerson($data) {
public function startPerson() {
if ($this->_xml_parser->inParents('authors')) {
$this->_current_author = new StdClass();
$this->_current_author->first_name = '';
......@@ -89,44 +93,34 @@ class Class_WebService_Bibnumerique_ArteVOD_FilmReader {
$this->_current_actor = new StdClass();
$this->_current_actor->first_name = '';
$this->_current_actor->last_name='';
}
}
public function endFirst_name($data) {
if ($this->_xml_parser->inParents('authors')) {
if ($this->_xml_parser->inParents('authors'))
$this->_current_author->first_name = $data;
}
if ($this->_xml_parser->inParents('actors') && $data) {
$this->_current_actor->first_name = $data;
}
if ($this->_xml_parser->inParents('actors') && $data)
$this->_current_actor->first_name = $data;
}
public function endLast_name($data) {
if ($this->_xml_parser->inParents('authors')) {
if ($this->_xml_parser->inParents('authors'))
$this->_current_author->last_name = $data;
}
if ($this->_xml_parser->inParents('actors') && $data) {
if ($this->_xml_parser->inParents('actors') && $data)
$this->_current_actor->last_name = $data;
}
}
public function endPerson($data) {
if ($this->_xml_parser->inParents('authors')) {
public function endPerson() {
if ($this->_xml_parser->inParents('authors'))
$this->_film->addAuthor($this->_current_author->first_name.' '.$this->_current_author->last_name);
}
if ($this->_xml_parser->inParents('actors')) {
$this->_film->addActor($this->_current_actor);
}
if ($this->_xml_parser->inParents('actors'))
$this->_film->addActor($this->_current_actor);
}
......
......@@ -37,8 +37,8 @@ class Class_WebService_BibNumerique_Numilog extends Class_WebService_BibNumeriqu
* @return array of harvested ids
*/
protected function _importRessources($ressources) {
$harvestedIds = array();
$this->_albums=[];
$harvestedIds = [];
$this->_albums = [];
foreach ($ressources as $ressource) {
$harvestedIds[] = $ressource->getId();
if ($ressource->isAlreadyHarvested())
......@@ -46,6 +46,7 @@ class Class_WebService_BibNumerique_Numilog extends Class_WebService_BibNumeriqu
$this->_albums[] = $ressource->import();
}
return $harvestedIds;
}
......@@ -58,8 +59,6 @@ class Class_WebService_BibNumerique_Numilog extends Class_WebService_BibNumeriqu
public function loadPage($page_number = 1) {
$url = Class_AdminVar::get('NUMILOG_OAI_URL');
$id_bib = Class_AdminVar::get('NUMILOG_OAI_IDBIB');
$reader = $this->getRessourcesNumeriquesReader()->parse();
if (1 == $page_number)
$this->getLogger()->info($reader->getTotalCount() .' ressources dans la base');
......@@ -68,14 +67,12 @@ class Class_WebService_BibNumerique_Numilog extends Class_WebService_BibNumeriqu
public function open_authenticated_url($url) {
$ticket=md5(Zend_Session::getId());
$queries=[];
$queries['ticket']=$ticket;
$ticket = md5(Zend_Session::getId());
$queries = [];
$queries['ticket'] = $ticket;
$http_client = self::getHttpClient();
return $http_client->open_url('http://'.$url.'?'.http_build_query($queries));
}
......@@ -84,11 +81,11 @@ class Class_WebService_BibNumerique_Numilog extends Class_WebService_BibNumeriqu
}
public function getBaseUrl() {
return self::BASE_URL;
}
public function getAlbums() {
return $this->_albums;
}
......@@ -103,5 +100,4 @@ class Class_WebService_BibNumerique_Numilog extends Class_WebService_BibNumeriqu
return 'Numilog';
}
}
?>
\ No newline at end of file
......@@ -27,12 +27,12 @@ class Class_WebService_BibNumerique_Numilog_LivresNumeriquesReader extends Class
protected $_resumptionToken;
protected $_ressourcesNumeriques;
protected $livres;
public function parse() {
$this->_total_count = $this->_page_number = 0;
$this->_page_size = 1;
$listsize = ($this->_resumptionToken) ? $this->_resumptionToken->getListSize() : '100';
$this->livres = $this
->setOAIHandler(Class_AdminVar::get('NUMILOG_OAI_URL'))
->setNumericResourceClass('Class_WebService_BibNumerique_Numilog_LivreNumerique')
......@@ -66,6 +66,4 @@ class Class_WebService_BibNumerique_Numilog_LivresNumeriquesReader extends Class
public function getRessourcesNumeriques() {
return $this->livres;
}
}
......@@ -40,13 +40,10 @@ class Class_WebService_BibNumerique_OneDTouch_Album extends Class_WebService_Bib
if (!$album = $this->findAlbumInDB())
$album = Class_Album::newInstance();
$categorie = $this->getOrCreateRessourceCategorie();
return $this->updateAlbum($album);
}
public function isAlreadyHarvested() {
return false;
}
......@@ -56,9 +53,9 @@ class Class_WebService_BibNumerique_OneDTouch_Album extends Class_WebService_Bib
return Class_WebService_BibNumerique_OneDTouch::CATEGORY_LABEL;
}
public function setOaiId($data) {
$this->_id = $data;
return $this->setId($data);
}
}
?>
......@@ -71,7 +71,7 @@ class Class_WebService_BibNumerique_Orphea_MetaDatasParser {
}
public function endKeywords($data) {
public function endKeywords() {
$this->_ressource->setGenres($this->_keywords);
}
......
......@@ -16,17 +16,17 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_BibNumerique_ToutApprendre_CatalogueParser {
protected $_formations=[];
protected $_current_formation;
protected $_current_lecon;
protected $_lecons = [];
public function parseXML($xml) {
$parser = new Class_WebService_FasterXMLParser();
$parser->setElementHandler($this);
......@@ -39,7 +39,7 @@ class Class_WebService_BibNumerique_ToutApprendre_CatalogueParser {
}
public function startCours($attributes) {
public function startCours() {
$this->_current_formation = new Class_WebService_BibNumerique_ToutApprendre_Formation();
$this->_formations[]= $this->_current_formation;
$this->_lecons=[];
......@@ -47,15 +47,17 @@ class Class_WebService_BibNumerique_ToutApprendre_CatalogueParser {
}
public function startLecon($attributes) {
public function startLecon() {
$this->_current_lecon = new Class_AlbumRessource();
$this->_lecons[]= $this->_current_lecon;
}
public function endLecons($attributes) {
$this->_current_formation->setRessources($this->_lecons);
public function endLecons() {
$this->_current_formation->setRessources($this->_lecons);
}
public function endTitre($data) {
$this->_current_formation->setTitle($data);
}
......@@ -65,11 +67,12 @@ class Class_WebService_BibNumerique_ToutApprendre_CatalogueParser {
$this->_current_formation->setId($data);
}
public function endPkLecon($data) {
$this->_current_lecon->setIdOrigine($data);
}
public function endTitreLecon($data) {
$this->_current_lecon->setTitre($data);
}
......@@ -78,26 +81,20 @@ class Class_WebService_BibNumerique_ToutApprendre_CatalogueParser {
public function endLink($data) {
$this->_current_formation->setExternalUri($data);
}
public function endDescription($data) {
$this->_current_formation->setDescription($data);
}
public function endEditeur($data){
$this->_current_formation->setEditeur($data);
}
public function endDureeCours($data) {
// $this->_current_formation->set($data);
}
public function endThumbnail($data) {
$this->_current_formation->addPoster($data);
}
}
?>
\ No newline at end of file
......@@ -16,11 +16,10 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_BibNumerique_Vodeclic_CatalogueParser {
protected $_formations=[];
protected $_current_formation;
......@@ -38,9 +37,9 @@ class Class_WebService_BibNumerique_Vodeclic_CatalogueParser {
}
public function startFormation($attributes) {
public function startFormation() {
$this->_current_formation = new Class_WebService_BibNumerique_Vodeclic_Formation();
$this->_formations[]= $this->_current_formation;
$this->_formations[] = $this->_current_formation;
}
......@@ -57,7 +56,7 @@ class Class_WebService_BibNumerique_Vodeclic_CatalogueParser {
public function endLink($data) {
$this->_current_formation->setExternalUri($data);
}
public function endDescription($data) {
$this->_current_formation->setDescription($data);
......@@ -65,15 +64,11 @@ class Class_WebService_BibNumerique_Vodeclic_CatalogueParser {
/** Initialisation du parametre id_Langue a fre */
public function endLanguage($data) {
$idLangue='fre';
if($data=='fr'){
$idLangue='fre';
}
$this->_current_formation->setIdLangue($idLangue);
public function endLanguage() {
$this->_current_formation->setIdLangue('fre');
}
public function endPublishdate($data){
$this->_current_formation->setDateMaj($data);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment