예제 #1
0
파일: HIndex.php 프로젝트: arkuuu/publin
 /**
  * Checks if the provided publications data is correct.
  *
  * @param array $data Contains the data of all publications.
  *
  * @throws IndexDataException If $data doesn't contain valid
  * publications with the required attributes 'publicationId'
  * and 'citationCount'.
  */
 private function checkPublicationsData(array $data)
 {
     IndexHelper::checkArrayKeysExist(array_keys($this->dataFormat), $data, 0, 0);
     IndexHelper::checkDataTypesAreCorrect($this->dataFormat, $data, 3, 0, 0);
     IndexHelper::checkDataTypesAreCorrect(array('int'), $data, 1, 1, 0, array(0 => array('publications')));
     IndexHelper::checkDataTypesAreCorrect(array('array'), $data, 2, 1, 0, array(0 => array('publications')));
     IndexHelper::checkArrayKeysExist(array_keys($this->dataFormat['publications']['int']), $data, 2, 0, array(0 => array('publications')));
     IndexHelper::checkDataTypesAreCorrect($this->dataFormat['publications']['int'], $data, 3, 2, 0, array(0 => array('publications')));
 }
예제 #2
0
파일: MfIndex.php 프로젝트: arkuuu/publin
 /**
  * Checks if the provided data of the colleagues of the
  * considered scientist is correct.
  *
  * @param array $data Contains the data of all colleagues.
  *
  * @throws IndexDataException If $data doesn't contain a valid
  * list of colleagues. This is e.g. the case if the colleague
  * array doesn't have timestamps as keys or if important
  * attributes to identify a colleague like the 'authorId'
  * are missing.
  */
 private function checkColleaguesData(array $data)
 {
     IndexHelper::checkDataTypesAreCorrect(array('int'), $data, 1, 2, 0, array(0 => array('author'), 1 => array('colleagues')));
     IndexHelper::checkDataTypesAreCorrect(array('array'), $data, 2, 2, 0, array(0 => array('author'), 1 => array('colleagues')));
     IndexHelper::checkDataTypesAreCorrect(array('int'), $data, 1, 3, 0, array(0 => array('author'), 1 => array('colleagues')));
     IndexHelper::checkDataTypesAreCorrect(array('array'), $data, 2, 3, 0, array(0 => array('author'), 1 => array('colleagues')));
     IndexHelper::checkArrayKeysExist(array_keys($this->dataFormat['author']['colleagues']['int']['int']), $data, 4, 0, array(0 => array('author'), 1 => array('colleagues')));
     IndexHelper::checkDataTypesAreCorrect($this->dataFormat['author']['colleagues']['int']['int'], $data, 3, 4, 0, array(0 => array('author'), 1 => array('colleagues')));
 }