From dab95e728062a5a775a7dc4121f20973464287f2 Mon Sep 17 00:00:00 2001 From: Tim van Veenendaal Date: Thu, 25 Nov 2021 18:57:35 +0100 Subject: [PATCH] Cleanup the models --- README.md | 2 +- composer.json | 2 +- lib/Model/GameIsStarted.php | 116 +++++++++---------- lib/Model/GameRules.php | 206 +++++++++++++++------------------- lib/Model/GameState.php | 206 +++++++++++++++------------------- lib/Model/MessageResponse.php | 106 ++++++++--------- lib/Model/MyTurn.php | 134 ++++++++++------------ lib/Model/Player.php | 134 ++++++++++------------ lib/Model/PlayerCode.php | 126 +++++++++------------ lib/Model/PlayerGuess.php | 107 ++++++++---------- lib/Model/Round.php | 170 ++++++++++++---------------- lib/Model/Turn.php | 152 +++++++++++-------------- 12 files changed, 633 insertions(+), 828 deletions(-) diff --git a/README.md b/README.md index fb2eb68..161f9fe 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Note: It is modified to remove some unused/wrong object deserializations ## Requirements -PHP 5.5 and later +PHP 7.0 and later ## Installation & Usage ### Composer diff --git a/composer.json b/composer.json index be0f1e1..c84bfef 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.5", + "php": ">=7.0", "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", diff --git a/lib/Model/GameIsStarted.php b/lib/Model/GameIsStarted.php index 72511db..9db5dbb 100644 --- a/lib/Model/GameIsStarted.php +++ b/lib/Model/GameIsStarted.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,42 +39,42 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class GameIsStarted implements ModelInterface, ArrayAccess -{ +class GameIsStarted implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'GameIsStarted'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'started' => 'bool', -'game_state' => '\Swagger\Client\Model\GameState' ]; + 'started' => 'bool', + 'game_state' => GameState::class, + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ - 'started' => null, -'game_state' => null ]; + 'started' => null, + 'game_state' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -83,8 +83,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -95,8 +94,9 @@ class GameIsStarted implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'started' => 'started', -'game_state' => 'gameState' ]; + 'started' => 'started', + 'game_state' => 'gameState', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -104,8 +104,9 @@ class GameIsStarted implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'started' => 'setStarted', -'game_state' => 'setGameState' ]; + 'started' => 'setStarted', + 'game_state' => 'setGameState', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -113,8 +114,9 @@ class GameIsStarted implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'started' => 'getStarted', -'game_state' => 'getGameState' ]; + 'started' => 'getStarted', + 'game_state' => 'getGameState', + ]; /** * Array of attributes where the key is the local name, @@ -122,8 +124,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -132,8 +133,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -142,8 +142,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -152,13 +151,10 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -172,10 +168,9 @@ class GameIsStarted implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['started'] = isset($data['started']) ? $data['started'] : null; - $this->container['game_state'] = isset($data['game_state']) ? $data['game_state'] : null; + public function __construct(array $data = null) { + $this->container['started'] = $data['started'] ?? null; + $this->container['game_state'] = $data['game_state'] ?? null; } /** @@ -183,8 +178,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -196,19 +190,16 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets started * * @return bool */ - public function getStarted() - { + public function getStarted() { return $this->container['started']; } @@ -219,8 +210,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return $this */ - public function setStarted($started) - { + public function setStarted($started) { $this->container['started'] = $started; return $this; @@ -231,8 +221,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\GameState */ - public function getGameState() - { + public function getGameState() { return $this->container['game_state']; } @@ -243,12 +232,12 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return $this */ - public function setGameState($game_state) - { + public function setGameState($game_state) { $this->container['game_state'] = $game_state; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -256,8 +245,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -268,8 +256,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -281,8 +268,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -297,8 +283,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -307,8 +292,7 @@ class GameIsStarted implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/GameRules.php b/lib/Model/GameRules.php index 696f6a1..4caa762 100644 --- a/lib/Model/GameRules.php +++ b/lib/Model/GameRules.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,52 +39,52 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class GameRules implements ModelInterface, ArrayAccess -{ +class GameRules implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'GameRules'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'start_dice_per_player' => 'int', -'higher_count_lower_value' => 'bool', -'joker_counts_double' => 'bool', -'has_joker' => 'bool', -'has_palifico' => 'bool', -'has_calza' => 'bool', -'joker_die_value' => 'int' ]; + 'start_dice_per_player' => 'int', + 'higher_count_lower_value' => 'bool', + 'joker_counts_double' => 'bool', + 'has_joker' => 'bool', + 'has_palifico' => 'bool', + 'has_calza' => 'bool', + 'joker_die_value' => 'int', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ - 'start_dice_per_player' => null, -'higher_count_lower_value' => null, -'joker_counts_double' => null, -'has_joker' => null, -'has_palifico' => null, -'has_calza' => null, -'joker_die_value' => null ]; + 'start_dice_per_player' => null, + 'higher_count_lower_value' => null, + 'joker_counts_double' => null, + 'has_joker' => null, + 'has_palifico' => null, + 'has_calza' => null, + 'joker_die_value' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -93,8 +93,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -105,13 +104,14 @@ class GameRules implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'start_dice_per_player' => 'startDicePerPlayer', -'higher_count_lower_value' => 'higherCountLowerValue', -'joker_counts_double' => 'jokerCountsDouble', -'has_joker' => 'hasJoker', -'has_palifico' => 'hasPalifico', -'has_calza' => 'hasCalza', -'joker_die_value' => 'jokerDieValue' ]; + 'start_dice_per_player' => 'startDicePerPlayer', + 'higher_count_lower_value' => 'higherCountLowerValue', + 'joker_counts_double' => 'jokerCountsDouble', + 'has_joker' => 'hasJoker', + 'has_palifico' => 'hasPalifico', + 'has_calza' => 'hasCalza', + 'joker_die_value' => 'jokerDieValue', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -119,13 +119,14 @@ class GameRules implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'start_dice_per_player' => 'setStartDicePerPlayer', -'higher_count_lower_value' => 'setHigherCountLowerValue', -'joker_counts_double' => 'setJokerCountsDouble', -'has_joker' => 'setHasJoker', -'has_palifico' => 'setHasPalifico', -'has_calza' => 'setHasCalza', -'joker_die_value' => 'setJokerDieValue' ]; + 'start_dice_per_player' => 'setStartDicePerPlayer', + 'higher_count_lower_value' => 'setHigherCountLowerValue', + 'joker_counts_double' => 'setJokerCountsDouble', + 'has_joker' => 'setHasJoker', + 'has_palifico' => 'setHasPalifico', + 'has_calza' => 'setHasCalza', + 'joker_die_value' => 'setJokerDieValue', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -133,13 +134,14 @@ class GameRules implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'start_dice_per_player' => 'getStartDicePerPlayer', -'higher_count_lower_value' => 'getHigherCountLowerValue', -'joker_counts_double' => 'getJokerCountsDouble', -'has_joker' => 'getHasJoker', -'has_palifico' => 'getHasPalifico', -'has_calza' => 'getHasCalza', -'joker_die_value' => 'getJokerDieValue' ]; + 'start_dice_per_player' => 'getStartDicePerPlayer', + 'higher_count_lower_value' => 'getHigherCountLowerValue', + 'joker_counts_double' => 'getJokerCountsDouble', + 'has_joker' => 'getHasJoker', + 'has_palifico' => 'getHasPalifico', + 'has_calza' => 'getHasCalza', + 'joker_die_value' => 'getJokerDieValue', + ]; /** * Array of attributes where the key is the local name, @@ -147,8 +149,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -157,8 +158,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -167,8 +167,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -177,13 +176,10 @@ class GameRules implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -197,15 +193,14 @@ class GameRules implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['start_dice_per_player'] = isset($data['start_dice_per_player']) ? $data['start_dice_per_player'] : null; - $this->container['higher_count_lower_value'] = isset($data['higher_count_lower_value']) ? $data['higher_count_lower_value'] : null; - $this->container['joker_counts_double'] = isset($data['joker_counts_double']) ? $data['joker_counts_double'] : null; - $this->container['has_joker'] = isset($data['has_joker']) ? $data['has_joker'] : null; - $this->container['has_palifico'] = isset($data['has_palifico']) ? $data['has_palifico'] : null; - $this->container['has_calza'] = isset($data['has_calza']) ? $data['has_calza'] : null; - $this->container['joker_die_value'] = isset($data['joker_die_value']) ? $data['joker_die_value'] : null; + public function __construct(array $data = null) { + $this->container['start_dice_per_player'] = $data['start_dice_per_player'] ?? null; + $this->container['higher_count_lower_value'] = $data['higher_count_lower_value'] ?? null; + $this->container['joker_counts_double'] = $data['joker_counts_double'] ?? null; + $this->container['has_joker'] = $data['has_joker'] ?? null; + $this->container['has_palifico'] = $data['has_palifico'] ?? null; + $this->container['has_calza'] = $data['has_calza'] ?? null; + $this->container['joker_die_value'] = $data['joker_die_value'] ?? null; } /** @@ -213,8 +208,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -226,19 +220,16 @@ class GameRules implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets start_dice_per_player * * @return int */ - public function getStartDicePerPlayer() - { + public function getStartDicePerPlayer() { return $this->container['start_dice_per_player']; } @@ -249,8 +240,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return $this */ - public function setStartDicePerPlayer($start_dice_per_player) - { + public function setStartDicePerPlayer($start_dice_per_player) { $this->container['start_dice_per_player'] = $start_dice_per_player; return $this; @@ -261,8 +251,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return bool */ - public function getHigherCountLowerValue() - { + public function getHigherCountLowerValue() { return $this->container['higher_count_lower_value']; } @@ -273,8 +262,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return $this */ - public function setHigherCountLowerValue($higher_count_lower_value) - { + public function setHigherCountLowerValue($higher_count_lower_value) { $this->container['higher_count_lower_value'] = $higher_count_lower_value; return $this; @@ -285,8 +273,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return bool */ - public function getJokerCountsDouble() - { + public function getJokerCountsDouble() { return $this->container['joker_counts_double']; } @@ -297,8 +284,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return $this */ - public function setJokerCountsDouble($joker_counts_double) - { + public function setJokerCountsDouble($joker_counts_double) { $this->container['joker_counts_double'] = $joker_counts_double; return $this; @@ -309,8 +295,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return bool */ - public function getHasJoker() - { + public function getHasJoker() { return $this->container['has_joker']; } @@ -321,8 +306,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return $this */ - public function setHasJoker($has_joker) - { + public function setHasJoker($has_joker) { $this->container['has_joker'] = $has_joker; return $this; @@ -333,8 +317,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return bool */ - public function getHasPalifico() - { + public function getHasPalifico() { return $this->container['has_palifico']; } @@ -345,8 +328,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return $this */ - public function setHasPalifico($has_palifico) - { + public function setHasPalifico($has_palifico) { $this->container['has_palifico'] = $has_palifico; return $this; @@ -357,8 +339,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return bool */ - public function getHasCalza() - { + public function getHasCalza() { return $this->container['has_calza']; } @@ -369,8 +350,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return $this */ - public function setHasCalza($has_calza) - { + public function setHasCalza($has_calza) { $this->container['has_calza'] = $has_calza; return $this; @@ -381,8 +361,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return int */ - public function getJokerDieValue() - { + public function getJokerDieValue() { return $this->container['joker_die_value']; } @@ -393,12 +372,12 @@ class GameRules implements ModelInterface, ArrayAccess * * @return $this */ - public function setJokerDieValue($joker_die_value) - { + public function setJokerDieValue($joker_die_value) { $this->container['joker_die_value'] = $joker_die_value; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -406,8 +385,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -418,8 +396,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -431,8 +408,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -447,8 +423,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -457,8 +432,7 @@ class GameRules implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/GameState.php b/lib/Model/GameState.php index 5b0242d..845da07 100644 --- a/lib/Model/GameState.php +++ b/lib/Model/GameState.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,52 +39,52 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class GameState implements ModelInterface, ArrayAccess -{ +class GameState implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'GameState'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'state' => 'string', -'code' => 'string', -'rounds' => '\Swagger\Client\Model\Round[]', -'players' => '\Swagger\Client\Model\Player[]', -'current_player' => '\Swagger\Client\Model\Player', -'owning_player' => '\Swagger\Client\Model\Player', -'rules' => '\Swagger\Client\Model\GameRules' ]; + 'state' => 'string', + 'code' => 'string', + 'rounds' => Round::class . '[]', + 'players' => Player::class . '[]', + 'current_player' => Player::class, + 'owning_player' => Player::class, + 'rules' => GameRules::class, + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ - 'state' => null, -'code' => null, -'rounds' => null, -'players' => null, -'current_player' => null, -'owning_player' => null, -'rules' => null ]; + 'state' => null, + 'code' => null, + 'rounds' => null, + 'players' => null, + 'current_player' => null, + 'owning_player' => null, + 'rules' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -93,8 +93,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -105,13 +104,14 @@ class GameState implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'state' => 'state', -'code' => 'code', -'rounds' => 'rounds', -'players' => 'players', -'current_player' => 'currentPlayer', -'owning_player' => 'owningPlayer', -'rules' => 'rules' ]; + 'state' => 'state', + 'code' => 'code', + 'rounds' => 'rounds', + 'players' => 'players', + 'current_player' => 'currentPlayer', + 'owning_player' => 'owningPlayer', + 'rules' => 'rules', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -119,13 +119,14 @@ class GameState implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'state' => 'setState', -'code' => 'setCode', -'rounds' => 'setRounds', -'players' => 'setPlayers', -'current_player' => 'setCurrentPlayer', -'owning_player' => 'setOwningPlayer', -'rules' => 'setRules' ]; + 'state' => 'setState', + 'code' => 'setCode', + 'rounds' => 'setRounds', + 'players' => 'setPlayers', + 'current_player' => 'setCurrentPlayer', + 'owning_player' => 'setOwningPlayer', + 'rules' => 'setRules', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -133,13 +134,14 @@ class GameState implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'state' => 'getState', -'code' => 'getCode', -'rounds' => 'getRounds', -'players' => 'getPlayers', -'current_player' => 'getCurrentPlayer', -'owning_player' => 'getOwningPlayer', -'rules' => 'getRules' ]; + 'state' => 'getState', + 'code' => 'getCode', + 'rounds' => 'getRounds', + 'players' => 'getPlayers', + 'current_player' => 'getCurrentPlayer', + 'owning_player' => 'getOwningPlayer', + 'rules' => 'getRules', + ]; /** * Array of attributes where the key is the local name, @@ -147,8 +149,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -157,8 +158,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -167,8 +167,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -177,13 +176,10 @@ class GameState implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -197,15 +193,14 @@ class GameState implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['rounds'] = isset($data['rounds']) ? $data['rounds'] : null; - $this->container['players'] = isset($data['players']) ? $data['players'] : null; - $this->container['current_player'] = isset($data['current_player']) ? $data['current_player'] : null; - $this->container['owning_player'] = isset($data['owning_player']) ? $data['owning_player'] : null; - $this->container['rules'] = isset($data['rules']) ? $data['rules'] : null; + public function __construct(array $data = null) { + $this->container['state'] = $data['state'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['rounds'] = $data['rounds'] ?? null; + $this->container['players'] = $data['players'] ?? null; + $this->container['current_player'] = $data['current_player'] ?? null; + $this->container['owning_player'] = $data['owning_player'] ?? null; + $this->container['rules'] = $data['rules'] ?? null; } /** @@ -213,8 +208,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -226,19 +220,16 @@ class GameState implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets state * * @return string */ - public function getState() - { + public function getState() { return $this->container['state']; } @@ -249,8 +240,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return $this */ - public function setState($state) - { + public function setState($state) { $this->container['state'] = $state; return $this; @@ -261,8 +251,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return string */ - public function getCode() - { + public function getCode() { return $this->container['code']; } @@ -273,8 +262,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return $this */ - public function setCode($code) - { + public function setCode($code) { $this->container['code'] = $code; return $this; @@ -285,8 +273,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\Round[] */ - public function getRounds() - { + public function getRounds() { return $this->container['rounds']; } @@ -297,8 +284,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return $this */ - public function setRounds($rounds) - { + public function setRounds($rounds) { $this->container['rounds'] = $rounds; return $this; @@ -309,8 +295,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\Player[] */ - public function getPlayers() - { + public function getPlayers() { return $this->container['players']; } @@ -321,8 +306,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return $this */ - public function setPlayers($players) - { + public function setPlayers($players) { $this->container['players'] = $players; return $this; @@ -333,8 +317,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\Player */ - public function getCurrentPlayer() - { + public function getCurrentPlayer() { return $this->container['current_player']; } @@ -345,8 +328,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return $this */ - public function setCurrentPlayer($current_player) - { + public function setCurrentPlayer($current_player) { $this->container['current_player'] = $current_player; return $this; @@ -357,8 +339,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\Player */ - public function getOwningPlayer() - { + public function getOwningPlayer() { return $this->container['owning_player']; } @@ -369,8 +350,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return $this */ - public function setOwningPlayer($owning_player) - { + public function setOwningPlayer($owning_player) { $this->container['owning_player'] = $owning_player; return $this; @@ -381,8 +361,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\GameRules */ - public function getRules() - { + public function getRules() { return $this->container['rules']; } @@ -393,12 +372,12 @@ class GameState implements ModelInterface, ArrayAccess * * @return $this */ - public function setRules($rules) - { + public function setRules($rules) { $this->container['rules'] = $rules; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -406,8 +385,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -418,8 +396,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -431,8 +408,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -447,8 +423,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -457,8 +432,7 @@ class GameState implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/MessageResponse.php b/lib/Model/MessageResponse.php index 6034ca7..9f72085 100644 --- a/lib/Model/MessageResponse.php +++ b/lib/Model/MessageResponse.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,42 +39,42 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class MessageResponse implements ModelInterface, ArrayAccess -{ +class MessageResponse implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'MessageResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ 'message' => 'string', -'errors' => 'string[]' ]; + 'errors' => 'string[]', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ 'message' => null, -'errors' => null ]; + 'errors' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -83,8 +83,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -96,7 +95,8 @@ class MessageResponse implements ModelInterface, ArrayAccess */ protected static $attributeMap = [ 'message' => 'message', -'errors' => 'errors' ]; + 'errors' => 'errors', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,7 +105,8 @@ class MessageResponse implements ModelInterface, ArrayAccess */ protected static $setters = [ 'message' => 'setMessage', -'errors' => 'setErrors' ]; + 'errors' => 'setErrors', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,7 +115,8 @@ class MessageResponse implements ModelInterface, ArrayAccess */ protected static $getters = [ 'message' => 'getMessage', -'errors' => 'getErrors' ]; + 'errors' => 'getErrors', + ]; /** * Array of attributes where the key is the local name, @@ -122,8 +124,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -132,8 +133,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -142,8 +142,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -152,13 +151,10 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -172,10 +168,9 @@ class MessageResponse implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['message'] = isset($data['message']) ? $data['message'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + public function __construct(array $data = null) { + $this->container['message'] = $data['message'] ?? null; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -183,8 +178,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -196,19 +190,16 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets message * * @return string */ - public function getMessage() - { + public function getMessage() { return $this->container['message']; } @@ -219,8 +210,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return $this */ - public function setMessage($message) - { + public function setMessage($message) { $this->container['message'] = $message; return $this; @@ -231,8 +221,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return string[] */ - public function getErrors() - { + public function getErrors() { return $this->container['errors']; } @@ -243,12 +232,12 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return $this */ - public function setErrors($errors) - { + public function setErrors($errors) { $this->container['errors'] = $errors; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -256,8 +245,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -268,8 +256,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -281,8 +268,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -297,8 +283,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -307,8 +292,7 @@ class MessageResponse implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/MyTurn.php b/lib/Model/MyTurn.php index 7f9211c..9eb3057 100644 --- a/lib/Model/MyTurn.php +++ b/lib/Model/MyTurn.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,44 +39,44 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class MyTurn implements ModelInterface, ArrayAccess -{ +class MyTurn implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'MyTurn'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'turn' => 'bool', -'game_state' => '\Swagger\Client\Model\GameState', -'errors' => 'string[]' ]; + 'turn' => 'bool', + 'game_state' => GameState::class, + 'errors' => 'string[]', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ - 'turn' => null, -'game_state' => null, -'errors' => null ]; + 'turn' => null, + 'game_state' => null, + 'errors' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -85,8 +85,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -97,9 +96,10 @@ class MyTurn implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'turn' => 'turn', -'game_state' => 'gameState', -'errors' => 'errors' ]; + 'turn' => 'turn', + 'game_state' => 'gameState', + 'errors' => 'errors', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -107,9 +107,10 @@ class MyTurn implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'turn' => 'setTurn', -'game_state' => 'setGameState', -'errors' => 'setErrors' ]; + 'turn' => 'setTurn', + 'game_state' => 'setGameState', + 'errors' => 'setErrors', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -117,9 +118,10 @@ class MyTurn implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'turn' => 'getTurn', -'game_state' => 'getGameState', -'errors' => 'getErrors' ]; + 'turn' => 'getTurn', + 'game_state' => 'getGameState', + 'errors' => 'getErrors', + ]; /** * Array of attributes where the key is the local name, @@ -127,8 +129,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -137,8 +138,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -147,8 +147,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -157,13 +156,10 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -177,11 +173,10 @@ class MyTurn implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['turn'] = isset($data['turn']) ? $data['turn'] : null; - $this->container['game_state'] = isset($data['game_state']) ? $data['game_state'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + public function __construct(array $data = null) { + $this->container['turn'] = $data['turn'] ?? null; + $this->container['game_state'] = $data['game_state'] ?? null; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -189,8 +184,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -202,19 +196,16 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets turn * * @return bool */ - public function getTurn() - { + public function getTurn() { return $this->container['turn']; } @@ -225,8 +216,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return $this */ - public function setTurn($turn) - { + public function setTurn($turn) { $this->container['turn'] = $turn; return $this; @@ -237,8 +227,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\GameState */ - public function getGameState() - { + public function getGameState() { return $this->container['game_state']; } @@ -249,8 +238,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return $this */ - public function setGameState($game_state) - { + public function setGameState($game_state) { $this->container['game_state'] = $game_state; return $this; @@ -261,8 +249,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return string[] */ - public function getErrors() - { + public function getErrors() { return $this->container['errors']; } @@ -273,12 +260,12 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return $this */ - public function setErrors($errors) - { + public function setErrors($errors) { $this->container['errors'] = $errors; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -286,8 +273,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -298,8 +284,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -311,8 +296,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -327,8 +311,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -337,8 +320,7 @@ class MyTurn implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/Player.php b/lib/Model/Player.php index deb02e6..f029366 100644 --- a/lib/Model/Player.php +++ b/lib/Model/Player.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,44 +39,44 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class Player implements ModelInterface, ArrayAccess -{ +class Player implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'Player'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'id' => 'string', -'hash' => 'string', -'name' => 'string' ]; + 'id' => 'string', + 'hash' => 'string', + 'name' => 'string', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ - 'id' => null, -'hash' => null, -'name' => null ]; + 'id' => null, + 'hash' => null, + 'name' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -85,8 +85,7 @@ class Player implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -97,9 +96,10 @@ class Player implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'id' => 'id', -'hash' => 'hash', -'name' => 'name' ]; + 'id' => 'id', + 'hash' => 'hash', + 'name' => 'name', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -107,9 +107,10 @@ class Player implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'id' => 'setId', -'hash' => 'setHash', -'name' => 'setName' ]; + 'id' => 'setId', + 'hash' => 'setHash', + 'name' => 'setName', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -117,9 +118,10 @@ class Player implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'id' => 'getId', -'hash' => 'getHash', -'name' => 'getName' ]; + 'id' => 'getId', + 'hash' => 'getHash', + 'name' => 'getName', + ]; /** * Array of attributes where the key is the local name, @@ -127,8 +129,7 @@ class Player implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -137,8 +138,7 @@ class Player implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -147,8 +147,7 @@ class Player implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -157,13 +156,10 @@ class Player implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -177,11 +173,10 @@ class Player implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['hash'] = isset($data['hash']) ? $data['hash'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; + public function __construct(array $data = null) { + $this->container['id'] = $data['id'] ?? null; + $this->container['hash'] = $data['hash'] ?? null; + $this->container['name'] = $data['name'] ?? null; } /** @@ -189,8 +184,7 @@ class Player implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -202,19 +196,16 @@ class Player implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets id * * @return string */ - public function getId() - { + public function getId() { return $this->container['id']; } @@ -225,8 +216,7 @@ class Player implements ModelInterface, ArrayAccess * * @return $this */ - public function setId($id) - { + public function setId($id) { $this->container['id'] = $id; return $this; @@ -237,8 +227,7 @@ class Player implements ModelInterface, ArrayAccess * * @return string */ - public function getHash() - { + public function getHash() { return $this->container['hash']; } @@ -249,8 +238,7 @@ class Player implements ModelInterface, ArrayAccess * * @return $this */ - public function setHash($hash) - { + public function setHash($hash) { $this->container['hash'] = $hash; return $this; @@ -261,8 +249,7 @@ class Player implements ModelInterface, ArrayAccess * * @return string */ - public function getName() - { + public function getName() { return $this->container['name']; } @@ -273,12 +260,12 @@ class Player implements ModelInterface, ArrayAccess * * @return $this */ - public function setName($name) - { + public function setName($name) { $this->container['name'] = $name; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -286,8 +273,7 @@ class Player implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -298,8 +284,7 @@ class Player implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -311,8 +296,7 @@ class Player implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -327,8 +311,7 @@ class Player implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -337,8 +320,7 @@ class Player implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/PlayerCode.php b/lib/Model/PlayerCode.php index 900add8..68968d5 100644 --- a/lib/Model/PlayerCode.php +++ b/lib/Model/PlayerCode.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,44 +39,44 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class PlayerCode implements ModelInterface, ArrayAccess -{ +class PlayerCode implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'PlayerCode'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'player' => '\Swagger\Client\Model\Player', -'code' => 'string', -'errors' => 'string[]' ]; + 'player' => Player::class, + 'code' => 'string', + 'errors' => 'string[]', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ 'player' => null, -'code' => null, -'errors' => null ]; + 'code' => null, + 'errors' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -85,8 +85,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -98,8 +97,9 @@ class PlayerCode implements ModelInterface, ArrayAccess */ protected static $attributeMap = [ 'player' => 'player', -'code' => 'code', -'errors' => 'errors' ]; + 'code' => 'code', + 'errors' => 'errors', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -108,8 +108,9 @@ class PlayerCode implements ModelInterface, ArrayAccess */ protected static $setters = [ 'player' => 'setPlayer', -'code' => 'setCode', -'errors' => 'setErrors' ]; + 'code' => 'setCode', + 'errors' => 'setErrors', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -118,8 +119,9 @@ class PlayerCode implements ModelInterface, ArrayAccess */ protected static $getters = [ 'player' => 'getPlayer', -'code' => 'getCode', -'errors' => 'getErrors' ]; + 'code' => 'getCode', + 'errors' => 'getErrors', + ]; /** * Array of attributes where the key is the local name, @@ -127,8 +129,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -137,8 +138,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -147,8 +147,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -157,13 +156,10 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -177,11 +173,10 @@ class PlayerCode implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['player'] = isset($data['player']) ? $data['player'] : null; - $this->container['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['errors'] = isset($data['errors']) ? $data['errors'] : null; + public function __construct(array $data = null) { + $this->container['player'] = $data['player'] ?? null; + $this->container['code'] = $data['code'] ?? null; + $this->container['errors'] = $data['errors'] ?? null; } /** @@ -189,8 +184,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -202,19 +196,16 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets player * * @return \Swagger\Client\Model\Player */ - public function getPlayer() - { + public function getPlayer() { return $this->container['player']; } @@ -225,8 +216,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return $this */ - public function setPlayer($player) - { + public function setPlayer($player) { $this->container['player'] = $player; return $this; @@ -237,8 +227,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return string */ - public function getCode() - { + public function getCode() { return $this->container['code']; } @@ -249,8 +238,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return $this */ - public function setCode($code) - { + public function setCode($code) { $this->container['code'] = $code; return $this; @@ -261,8 +249,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return string[] */ - public function getErrors() - { + public function getErrors() { return $this->container['errors']; } @@ -273,12 +260,12 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return $this */ - public function setErrors($errors) - { + public function setErrors($errors) { $this->container['errors'] = $errors; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -286,8 +273,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -298,8 +284,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -311,8 +296,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -327,8 +311,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -337,8 +320,7 @@ class PlayerCode implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/PlayerGuess.php b/lib/Model/PlayerGuess.php index d289fe1..e343a14 100644 --- a/lib/Model/PlayerGuess.php +++ b/lib/Model/PlayerGuess.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,42 +39,42 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class PlayerGuess implements ModelInterface, ArrayAccess -{ +class PlayerGuess implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'PlayerGuess'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ 'dice_count' => 'int', -'die_value' => 'int' ]; + 'die_value' => 'int', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ 'dice_count' => null, -'die_value' => null ]; + 'die_value' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -83,8 +83,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -96,7 +95,8 @@ class PlayerGuess implements ModelInterface, ArrayAccess */ protected static $attributeMap = [ 'dice_count' => 'diceCount', -'die_value' => 'dieValue' ]; + 'die_value' => 'dieValue', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,7 +105,8 @@ class PlayerGuess implements ModelInterface, ArrayAccess */ protected static $setters = [ 'dice_count' => 'setDiceCount', -'die_value' => 'setDieValue' ]; + 'die_value' => 'setDieValue', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,7 +115,8 @@ class PlayerGuess implements ModelInterface, ArrayAccess */ protected static $getters = [ 'dice_count' => 'getDiceCount', -'die_value' => 'getDieValue' ]; + 'die_value' => 'getDieValue', + ]; /** * Array of attributes where the key is the local name, @@ -122,8 +124,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -132,8 +133,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -142,8 +142,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -152,13 +151,10 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -172,10 +168,9 @@ class PlayerGuess implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['dice_count'] = isset($data['dice_count']) ? $data['dice_count'] : null; - $this->container['die_value'] = isset($data['die_value']) ? $data['die_value'] : null; + public function __construct(array $data = null) { + $this->container['dice_count'] = $data['dice_count'] ?? null; + $this->container['die_value'] = $data['die_value'] ?? null; } /** @@ -183,8 +178,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; if ($this->container['dice_count'] === null) { @@ -193,6 +187,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess if ($this->container['die_value'] === null) { $invalidProperties[] = "'die_value' can't be null"; } + return $invalidProperties; } @@ -202,19 +197,16 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets dice_count * * @return int */ - public function getDiceCount() - { + public function getDiceCount() { return $this->container['dice_count']; } @@ -225,8 +217,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return $this */ - public function setDiceCount($dice_count) - { + public function setDiceCount($dice_count) { $this->container['dice_count'] = $dice_count; return $this; @@ -237,8 +228,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return int */ - public function getDieValue() - { + public function getDieValue() { return $this->container['die_value']; } @@ -249,12 +239,12 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return $this */ - public function setDieValue($die_value) - { + public function setDieValue($die_value) { $this->container['die_value'] = $die_value; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -262,8 +252,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -274,8 +263,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -287,8 +275,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -303,8 +290,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -313,8 +299,7 @@ class PlayerGuess implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/Round.php b/lib/Model/Round.php index fec2151..ab9f69d 100644 --- a/lib/Model/Round.php +++ b/lib/Model/Round.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,48 +39,48 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class Round implements ModelInterface, ArrayAccess -{ +class Round implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'Round'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'number' => 'int', -'turns' => '\Swagger\Client\Model\Turn[]', -'loser' => '\Swagger\Client\Model\Player', -'my_rolls' => 'int[]', -'rolls' => 'int[][]' ]; + 'number' => 'int', + 'turns' => Turn::class . '[]', + 'loser' => Player::class, + 'my_rolls' => 'int[]', + 'rolls' => 'int[][]', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ - 'number' => null, -'turns' => null, -'loser' => null, -'my_rolls' => null, -'rolls' => null ]; + 'number' => null, + 'turns' => null, + 'loser' => null, + 'my_rolls' => null, + 'rolls' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -89,8 +89,7 @@ class Round implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -101,11 +100,12 @@ class Round implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'number' => 'number', -'turns' => 'turns', -'loser' => 'loser', -'my_rolls' => 'myRolls', -'rolls' => 'rolls' ]; + 'number' => 'number', + 'turns' => 'turns', + 'loser' => 'loser', + 'my_rolls' => 'myRolls', + 'rolls' => 'rolls', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -113,11 +113,12 @@ class Round implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'number' => 'setNumber', -'turns' => 'setTurns', -'loser' => 'setLoser', -'my_rolls' => 'setMyRolls', -'rolls' => 'setRolls' ]; + 'number' => 'setNumber', + 'turns' => 'setTurns', + 'loser' => 'setLoser', + 'my_rolls' => 'setMyRolls', + 'rolls' => 'setRolls', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -125,11 +126,12 @@ class Round implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'number' => 'getNumber', -'turns' => 'getTurns', -'loser' => 'getLoser', -'my_rolls' => 'getMyRolls', -'rolls' => 'getRolls' ]; + 'number' => 'getNumber', + 'turns' => 'getTurns', + 'loser' => 'getLoser', + 'my_rolls' => 'getMyRolls', + 'rolls' => 'getRolls', + ]; /** * Array of attributes where the key is the local name, @@ -137,8 +139,7 @@ class Round implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -147,8 +148,7 @@ class Round implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -157,8 +157,7 @@ class Round implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -167,13 +166,10 @@ class Round implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -187,13 +183,12 @@ class Round implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['number'] = isset($data['number']) ? $data['number'] : null; - $this->container['turns'] = isset($data['turns']) ? $data['turns'] : null; - $this->container['loser'] = isset($data['loser']) ? $data['loser'] : null; - $this->container['my_rolls'] = isset($data['my_rolls']) ? $data['my_rolls'] : null; - $this->container['rolls'] = isset($data['rolls']) ? $data['rolls'] : null; + public function __construct(array $data = null) { + $this->container['number'] = $data['number'] ?? null; + $this->container['turns'] = $data['turns'] ?? null; + $this->container['loser'] = $data['loser'] ?? null; + $this->container['my_rolls'] = $data['my_rolls'] ?? null; + $this->container['rolls'] = $data['rolls'] ?? null; } /** @@ -201,8 +196,7 @@ class Round implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -214,19 +208,16 @@ class Round implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets number * * @return int */ - public function getNumber() - { + public function getNumber() { return $this->container['number']; } @@ -237,8 +228,7 @@ class Round implements ModelInterface, ArrayAccess * * @return $this */ - public function setNumber($number) - { + public function setNumber($number) { $this->container['number'] = $number; return $this; @@ -249,8 +239,7 @@ class Round implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\Turn[] */ - public function getTurns() - { + public function getTurns() { return $this->container['turns']; } @@ -261,8 +250,7 @@ class Round implements ModelInterface, ArrayAccess * * @return $this */ - public function setTurns($turns) - { + public function setTurns($turns) { $this->container['turns'] = $turns; return $this; @@ -273,8 +261,7 @@ class Round implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\Player */ - public function getLoser() - { + public function getLoser() { return $this->container['loser']; } @@ -285,8 +272,7 @@ class Round implements ModelInterface, ArrayAccess * * @return $this */ - public function setLoser($loser) - { + public function setLoser($loser) { $this->container['loser'] = $loser; return $this; @@ -297,8 +283,7 @@ class Round implements ModelInterface, ArrayAccess * * @return int[][] */ - public function getMyRolls() - { + public function getMyRolls() { return $this->container['my_rolls']; } @@ -309,8 +294,7 @@ class Round implements ModelInterface, ArrayAccess * * @return $this */ - public function setMyRolls($my_rolls) - { + public function setMyRolls($my_rolls) { $this->container['my_rolls'] = $my_rolls; return $this; @@ -321,8 +305,7 @@ class Round implements ModelInterface, ArrayAccess * * @return int[] */ - public function getRolls() - { + public function getRolls() { return $this->container['rolls']; } @@ -333,12 +316,12 @@ class Round implements ModelInterface, ArrayAccess * * @return $this */ - public function setRolls($rolls) - { + public function setRolls($rolls) { $this->container['rolls'] = $rolls; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -346,8 +329,7 @@ class Round implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -358,8 +340,7 @@ class Round implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -371,8 +352,7 @@ class Round implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -387,8 +367,7 @@ class Round implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -397,8 +376,7 @@ class Round implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this), diff --git a/lib/Model/Turn.php b/lib/Model/Turn.php index fc10c0c..7c5499d 100644 --- a/lib/Model/Turn.php +++ b/lib/Model/Turn.php @@ -16,7 +16,7 @@ * Play perudo with your friends through the api! * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 3.0.30 */ @@ -39,46 +39,46 @@ use \Swagger\Client\ObjectSerializer; * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ -class Turn implements ModelInterface, ArrayAccess -{ +class Turn implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $swaggerModelName = 'Turn'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerTypes = [ - 'number' => 'int', -'player' => '\Swagger\Client\Model\Player', -'dice_count' => 'int', -'die_value' => 'int' ]; + 'number' => 'int', + 'player' => Player::class, + 'dice_count' => 'int', + 'die_value' => 'int', + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $swaggerFormats = [ - 'number' => null, -'player' => null, -'dice_count' => null, -'die_value' => null ]; + 'number' => null, + 'player' => null, + 'dice_count' => null, + 'die_value' => null, + ]; /** * Array of property to type mappings. Used for (de)serialization * * @return array */ - public static function swaggerTypes() - { + public static function swaggerTypes() { return self::$swaggerTypes; } @@ -87,8 +87,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return array */ - public static function swaggerFormats() - { + public static function swaggerFormats() { return self::$swaggerFormats; } @@ -99,10 +98,11 @@ class Turn implements ModelInterface, ArrayAccess * @var string[] */ protected static $attributeMap = [ - 'number' => 'number', -'player' => 'player', -'dice_count' => 'diceCount', -'die_value' => 'dieValue' ]; + 'number' => 'number', + 'player' => 'player', + 'dice_count' => 'diceCount', + 'die_value' => 'dieValue', + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -110,10 +110,11 @@ class Turn implements ModelInterface, ArrayAccess * @var string[] */ protected static $setters = [ - 'number' => 'setNumber', -'player' => 'setPlayer', -'dice_count' => 'setDiceCount', -'die_value' => 'setDieValue' ]; + 'number' => 'setNumber', + 'player' => 'setPlayer', + 'dice_count' => 'setDiceCount', + 'die_value' => 'setDieValue', + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -121,10 +122,11 @@ class Turn implements ModelInterface, ArrayAccess * @var string[] */ protected static $getters = [ - 'number' => 'getNumber', -'player' => 'getPlayer', -'dice_count' => 'getDiceCount', -'die_value' => 'getDieValue' ]; + 'number' => 'getNumber', + 'player' => 'getPlayer', + 'dice_count' => 'getDiceCount', + 'die_value' => 'getDieValue', + ]; /** * Array of attributes where the key is the local name, @@ -132,8 +134,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return array */ - public static function attributeMap() - { + public static function attributeMap() { return self::$attributeMap; } @@ -142,8 +143,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return array */ - public static function setters() - { + public static function setters() { return self::$setters; } @@ -152,8 +152,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return array */ - public static function getters() - { + public static function getters() { return self::$getters; } @@ -162,13 +161,10 @@ class Turn implements ModelInterface, ArrayAccess * * @return string */ - public function getModelName() - { + public function getModelName() { return self::$swaggerModelName; } - - /** * Associative array for storing property values * @@ -182,12 +178,11 @@ class Turn implements ModelInterface, ArrayAccess * @param mixed[] $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) - { - $this->container['number'] = isset($data['number']) ? $data['number'] : null; - $this->container['player'] = isset($data['player']) ? $data['player'] : null; - $this->container['dice_count'] = isset($data['dice_count']) ? $data['dice_count'] : null; - $this->container['die_value'] = isset($data['die_value']) ? $data['die_value'] : null; + public function __construct(array $data = null) { + $this->container['number'] = $data['number'] ?? null; + $this->container['player'] = $data['player'] ?? null; + $this->container['dice_count'] = $data['dice_count'] ?? null; + $this->container['die_value'] = $data['die_value'] ?? null; } /** @@ -195,8 +190,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return array invalid properties with reasons */ - public function listInvalidProperties() - { + public function listInvalidProperties() { $invalidProperties = []; return $invalidProperties; @@ -208,19 +202,16 @@ class Turn implements ModelInterface, ArrayAccess * * @return bool True if all properties are valid */ - public function valid() - { + public function valid() { return count($this->listInvalidProperties()) === 0; } - /** * Gets number * * @return int */ - public function getNumber() - { + public function getNumber() { return $this->container['number']; } @@ -231,8 +222,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return $this */ - public function setNumber($number) - { + public function setNumber($number) { $this->container['number'] = $number; return $this; @@ -243,8 +233,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return \Swagger\Client\Model\Player */ - public function getPlayer() - { + public function getPlayer() { return $this->container['player']; } @@ -255,8 +244,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return $this */ - public function setPlayer($player) - { + public function setPlayer($player) { $this->container['player'] = $player; return $this; @@ -267,8 +255,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return int */ - public function getDiceCount() - { + public function getDiceCount() { return $this->container['dice_count']; } @@ -279,8 +266,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return $this */ - public function setDiceCount($dice_count) - { + public function setDiceCount($dice_count) { $this->container['dice_count'] = $dice_count; return $this; @@ -291,8 +277,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return int */ - public function getDieValue() - { + public function getDieValue() { return $this->container['die_value']; } @@ -303,12 +288,12 @@ class Turn implements ModelInterface, ArrayAccess * * @return $this */ - public function setDieValue($die_value) - { + public function setDieValue($die_value) { $this->container['die_value'] = $die_value; return $this; } + /** * Returns true if offset exists. False otherwise. * @@ -316,8 +301,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return boolean */ - public function offsetExists($offset) - { + public function offsetExists($offset) { return isset($this->container[$offset]); } @@ -328,8 +312,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return mixed */ - public function offsetGet($offset) - { + public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } @@ -341,8 +324,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return void */ - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { if (is_null($offset)) { $this->container[] = $value; } else { @@ -357,8 +339,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return void */ - public function offsetUnset($offset) - { + public function offsetUnset($offset) { unset($this->container[$offset]); } @@ -367,8 +348,7 @@ class Turn implements ModelInterface, ArrayAccess * * @return string */ - public function __toString() - { + public function __toString() { if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode( ObjectSerializer::sanitizeForSerialization($this),