diff options
author | emkael <emkael@tlen.pl> | 2025-02-13 22:54:49 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2025-02-13 22:54:49 +0100 |
commit | 48210e8f28a5afdee40d041352f37676564bf717 (patch) | |
tree | cc2016ba0680be81a5c08c8a31bcf52a69c14429 | |
parent | c009e1827871e9dad29697e390f7c441dc34c0ea (diff) |
Validating and parsing BridgeNET parameters only in the API version that introduced them
-rw-r--r-- | http/api-inc.php | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/http/api-inc.php b/http/api-inc.php index f4fa01d..ddc526f 100644 --- a/http/api-inc.php +++ b/http/api-inc.php @@ -281,9 +281,6 @@ class ApiPkl { $return['type']) ); } - if (isset($this->parameters['boards'])) { - $return['boards'] = intval($this->parameters['boards']); - } $return['contestants'] = intval($parameters['contestants']); $return['players'] = isset($parameters['players']) ? intval($parameters['players']) @@ -501,28 +498,12 @@ class ApiPkl { return $result; } - protected function _bridgenet_parameters() { - } - function calculate_bridgenet_points() { throw new ParametersException( 'BridgeNET points not supported in this API version' ); } - protected function _set_board_count() { - if (isset($this->parameters['boards'])) { - $this->check_values($this->parameters, array( - 'boards' => function($r) { - return is_integer_like($r); - } - )); - $this->parameters['over39_boards'] = strval( - intval($this->parameters['boards'] > 39) - ); - } - } - } class ApiPklV1 extends ApiPkl {} @@ -564,6 +545,19 @@ class ApiPklV3 extends ApiPklV2 { $parameters['type']) ); } + } + + protected function _set_board_count($parameters) { + if (isset($parameters['boards'])) { + $this->check_values($parameters, array( + 'boards' => function($r) { + return is_integer_like($r); + } + )); + $parameters['over39_boards'] = strval( + intval($parameters['boards'] > 39) + ); + } return $parameters; } |