[UW-2538] updates docs

This commit is contained in:
Michał Frankiewicz
2021-06-29 17:01:03 +02:00
parent 53d82841e0
commit b2d4552fb3

View File

@@ -12,6 +12,8 @@ use Meritoo\Common\Collection\Collection;
use Meritoo\LimeSurvey\ApiClient\Client\Client; use Meritoo\LimeSurvey\ApiClient\Client\Client;
use Meritoo\LimeSurvey\ApiClient\Exception\CannotProcessDataException; use Meritoo\LimeSurvey\ApiClient\Exception\CannotProcessDataException;
use Meritoo\LimeSurvey\ApiClient\Exception\MissingSurveySummaryException; use Meritoo\LimeSurvey\ApiClient\Exception\MissingSurveySummaryException;
use Meritoo\LimeSurvey\ApiClient\Exception\UnknownInstanceOfResultItem;
use Meritoo\LimeSurvey\ApiClient\Exception\UnknownMethodException;
use Meritoo\LimeSurvey\ApiClient\Result\Collection\Participants; use Meritoo\LimeSurvey\ApiClient\Result\Collection\Participants;
use Meritoo\LimeSurvey\ApiClient\Result\Collection\Surveys; use Meritoo\LimeSurvey\ApiClient\Result\Collection\Surveys;
use Meritoo\LimeSurvey\ApiClient\Result\Collection\SurveysSummaries; use Meritoo\LimeSurvey\ApiClient\Result\Collection\SurveysSummaries;
@@ -126,6 +128,8 @@ class SurveyService
* @return Surveys * @return Surveys
* *
* @throws CannotProcessDataException * @throws CannotProcessDataException
* @throws UnknownInstanceOfResultItem
* @throws UnknownMethodException
*/ */
public function getAllSurveys($onlyActive = false) public function getAllSurveys($onlyActive = false)
{ {
@@ -164,6 +168,9 @@ class SurveyService
* @param bool $shouldBeActive (optional) If is set to true, survey should be active. If it's not, it shouldn't * @param bool $shouldBeActive (optional) If is set to true, survey should be active. If it's not, it shouldn't
* be returned, even if exists. Otherwise - it doesn't matter (default behaviour). * be returned, even if exists. Otherwise - it doesn't matter (default behaviour).
* @return bool * @return bool
* @throws CannotProcessDataException
* @throws UnknownInstanceOfResultItem
* @throws UnknownMethodException
*/ */
public function isExistingSurvey($surveyId, $shouldBeActive = false) public function isExistingSurvey($surveyId, $shouldBeActive = false)
{ {
@@ -224,9 +231,13 @@ class SurveyService
* @param int $surveyId ID of survey * @param int $surveyId ID of survey
* @param bool $onlyCompleted (optional) If is set to true, participants who completed survey are returned only. * @param bool $onlyCompleted (optional) If is set to true, participants who completed survey are returned only.
* Otherwise - all (default behaviour). * Otherwise - all (default behaviour).
* @param array $criteria
* @return Collection * @return Collection
* *
* @throws CannotProcessDataException * @throws CannotProcessDataException
* @throws MissingSurveySummaryException
* @throws UnknownInstanceOfResultItem
* @throws UnknownMethodException
*/ */
public function getSurveyParticipants($surveyId, $onlyCompleted = false, array $criteria = []) public function getSurveyParticipants($surveyId, $onlyCompleted = false, array $criteria = [])
{ {
@@ -282,6 +293,9 @@ class SurveyService
* @param string $lastName Last ame of the participant to add * @param string $lastName Last ame of the participant to add
* @param string $email E-mail address of the participant to add * @param string $email E-mail address of the participant to add
* @return Participant * @return Participant
* @throws CannotProcessDataException
* @throws UnknownInstanceOfResultItem
* @throws UnknownMethodException
*/ */
public function addParticipant($surveyId, $firstName, $lastName, $email) public function addParticipant($surveyId, $firstName, $lastName, $email)
{ {
@@ -323,6 +337,10 @@ class SurveyService
* @param int $surveyId ID of survey * @param int $surveyId ID of survey
* @param string $email E-mail address of the participant * @param string $email E-mail address of the participant
* @return ParticipantShort|null * @return ParticipantShort|null
* @throws CannotProcessDataException
* @throws MissingSurveySummaryException
* @throws UnknownInstanceOfResultItem
* @throws UnknownMethodException
*/ */
public function getParticipant($surveyId, $email) public function getParticipant($surveyId, $email)
{ {
@@ -345,7 +363,10 @@ class SurveyService
* @param int $surveyId ID of survey * @param int $surveyId ID of survey
* @return int * @return int
* *
* @throws CannotProcessDataException
* @throws MissingSurveySummaryException * @throws MissingSurveySummaryException
* @throws UnknownInstanceOfResultItem
* @throws UnknownMethodException
*/ */
public function getSurveyTokenCount($surveyId) public function getSurveyTokenCount($surveyId)
{ {
@@ -376,6 +397,9 @@ class SurveyService
* *
* @param int $surveyId ID of survey * @param int $surveyId ID of survey
* @return SurveySummary|null * @return SurveySummary|null
* @throws CannotProcessDataException
* @throws UnknownInstanceOfResultItem
* @throws UnknownMethodException
*/ */
private function getSurveySummary($surveyId) private function getSurveySummary($surveyId)
{ {