Skip to content

Commit

Permalink
Disallow nullable for questions
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kurowski committed Mar 11, 2021
1 parent f7bdb7c commit 24f618a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Request/EventAttendee.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(
string $phoneNumber,
string $emailAddress,
?string $note,
?array $questionAnswers,
array $questionAnswers,
) {
parent::__construct([
self::PARAM_QUERY => 'prihlaska',
Expand Down
10 changes: 5 additions & 5 deletions src/Response/Event/Registration/RegistrationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ final class RegistrationType

/**
* @param int $type
* @param array|null $questions
* @param array $questions
* @param string|null $email
* @param string|null $url
*/
private function __construct($type, array $questions = null, $email = null, $url = null)
private function __construct($type, array $questions, $email = null, $url = null)
{
if ( ! \in_array($type, [
self::TYPE_VIA_BRONTOWEB,
Expand All @@ -51,7 +51,7 @@ private function __construct($type, array $questions = null, $email = null, $url

$this->type = $type;

if ($type === self::TYPE_VIA_BRONTOWEB && $questions !== null && \count($questions) > 0) {
if ($type === self::TYPE_VIA_BRONTOWEB && \count($questions) > 0) {
$this->questions = \array_map(function ($question) {
return RegistrationQuestion::from($question);
}, $questions);
Expand All @@ -76,12 +76,12 @@ private function __construct($type, array $questions = null, $email = null, $url

/**
* @param int $type
* @param array|null $questions
* @param array $questions
* @param string|null $email
* @param string|null $url
* @return self
*/
public static function from($type, array $questions = null, $email = null, $url = null)
public static function from($type, array $questions, $email = null, $url = null)
{
return new self($type, $questions, $email, $url);
}
Expand Down

0 comments on commit 24f618a

Please sign in to comment.