From 158f025715492bea1a546a6aef1a8cc4807c9811 Mon Sep 17 00:00:00 2001 From: Craig McMahon Date: Fri, 18 Aug 2023 13:11:16 +0100 Subject: [PATCH] Update composer.json to widen dependencies, remove composer.lock, add psalm, couple of minor fixes --- .gitignore | 1 + composer.json | 15 +- composer.lock | 929 -------------------------- psalm.xml | 17 + src/ChannelClient.php | 2 +- src/DisplayClient.php | 4 +- src/Requests/DeleteContract.php | 6 +- src/Requests/DeleteMedia.php | 6 +- src/Requests/DeleteRoom.php | 6 +- src/Requests/GetBankAccounts.php | 6 +- src/Requests/GetContracts.php | 6 +- src/Requests/GetFacilities.php | 6 +- src/Requests/GetPaymentStructures.php | 6 +- src/Requests/GetProperties.php | 6 +- src/Requests/GetRooms.php | 6 +- src/Requests/GetSummary.php | 6 +- src/Requests/GetTenancyTemplates.php | 6 +- src/Requests/PatchContract.php | 6 +- src/Requests/PatchProperty.php | 6 +- src/Requests/PatchRoom.php | 6 +- src/Requests/PutContract.php | 6 +- src/Requests/PutMedia.php | 6 +- src/Requests/PutProperty.php | 6 +- src/Requests/PutRoom.php | 6 +- src/Requests/SwaggerRequest.php | 7 +- src/SturentsClient.php | 15 +- src/UploadClient.php | 4 +- 27 files changed, 100 insertions(+), 1002 deletions(-) delete mode 100644 composer.lock create mode 100644 psalm.xml diff --git a/.gitignore b/.gitignore index c1ef258..f348ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ src/Test/ swagger/api.json swagger-json examples/_config.php +composer.lock \ No newline at end of file diff --git a/composer.json b/composer.json index ccc947c..b349a04 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "name": "sturents/api", + "type": "library", "license": "MIT", "authors": [ { @@ -8,14 +9,16 @@ } ], "require": { - "php": ">=7.1", - "guzzlehttp/guzzle": "~6.0", - "netresearch/jsonmapper": "^1.4", - "psr/http-message": "^1.0" + "php": ">=7.2", + "guzzlehttp/guzzle": "^6.0 || ^7.0", + "netresearch/jsonmapper": "^1.4 || ^2.0 || ^3.0 || ^4.0", + "psr/http-message": "^1.1 || ^2.0", + "ext-json": "*" }, "require-dev": { - "roave/security-advisories": "dev-master", - "sturents/swagger-php-model-generator": "^0.1" + "roave/security-advisories": "dev-latest", + "sturents/swagger-php-model-generator": "^0.1", + "vimeo/psalm": "^5.14" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock deleted file mode 100644 index daa7e07..0000000 --- a/composer.lock +++ /dev/null @@ -1,929 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "9e0de4c0bbe65a202a85985c0e1c823d", - "packages": [ - { - "name": "guzzlehttp/guzzle", - "version": "6.3.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.3-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2018-04-22T15:46:56+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" - }, - { - "name": "netresearch/jsonmapper", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "3868fe1128ce1169228acdb623359dca74db5ef3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/3868fe1128ce1169228acdb623359dca74db5ef3", - "reference": "3868fe1128ce1169228acdb623359dca74db5ef3", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4", - "squizlabs/php_codesniffer": "~1.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JsonMapper": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0" - ], - "authors": [ - { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" - } - ], - "description": "Map nested JSON structures onto PHP classes", - "time": "2017-11-28T21:30:01+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - } - ], - "packages-dev": [ - { - "name": "nette/php-generator", - "version": "v3.3.4", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "8fe7e699dca7db186f56d75800cb1ec32e39c856" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/8fe7e699dca7db186f56d75800cb1ec32e39c856", - "reference": "8fe7e699dca7db186f56d75800cb1ec32e39c856", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4.2 || ^3.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.4 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2020-02-09T14:39:09+00:00" - }, - { - "name": "nette/utils", - "version": "v3.1.1", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "2c17d16d8887579ae1c0898ff94a3668997fd3eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/2c17d16d8887579ae1c0898ff94a3668997fd3eb", - "reference": "2c17d16d8887579ae1c0898ff94a3668997fd3eb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "~2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", - "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "time": "2020-02-09T14:10:55+00:00" - }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "5f81a65d531dc88975b8fe32331cfb8a79c34fe3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/5f81a65d531dc88975b8fe32331cfb8a79c34fe3", - "reference": "5f81a65d531dc88975b8fe32331cfb8a79c34fe3", - "shasum": "" - }, - "conflict": { - "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.12", - "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", - "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bagisto/bagisto": "<0.1.5", - "bolt/bolt": "<3.6.10", - "brightlocal/phpwhois": "<=4.2.5", - "buddypress/buddypress": "<5.1.2", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "centreon/centreon": "<18.10.8|>=19,<19.4.5", - "cesnet/simplesamlphp-module-proxystatistics": "<3.1", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1-alpha.11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", - "contao/listing-bundle": ">=4,<4.4.8", - "datadog/dd-trace": ">=0.30,<0.30.2", - "david-garcia/phpwhois": "<=4.3.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dolibarr/dolibarr": "<=10.0.6", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", - "drupal/drupal": ">=7,<7.69|>=8,<8.7.11|>=8.8,<8.8.1", - "endroid/qr-code-bundle": "<3.4.2", - "enshrined/svg-sanitize": "<0.13.1", - "erusev/parsedown": "<1.7.2", - "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", - "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2", - "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", - "ezyang/htmlpurifier": "<4.1.1", - "firebase/php-jwt": "<2", - "fooman/tcpdf": "<6.2.22", - "fossar/tcpdf-parser": "<6.2.22", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "fuel/core": "<1.8.1", - "getgrav/grav": "<1.7-beta.8", - "gree/jose": "<=2.2", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", - "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", - "ivankristianto/phpwhois": "<=4.3", - "james-heinrich/getid3": "<1.9.9", - "joomla/session": "<1.3.1", - "jsmitty12/phpwhois": "<5.1", - "kazist/phpwhois": "<=4.2.6", - "kreait/firebase-php": ">=3.2,<3.8.1", - "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "league/commonmark": "<0.18.3", - "librenms/librenms": "<1.53", - "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", - "magento/magento1ce": "<1.9.4.3", - "magento/magento1ee": ">=1,<1.14.4.3", - "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "onelogin/php-saml": "<2.10.4", - "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", - "openid/php-openid": "<2.3", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "padraic/humbug_get_contents": "<1.1.2", - "pagarme/pagarme-php": ">=0,<3", - "paragonie/random_compat": "<2", - "paypal/merchant-sdk-php": "<3.12", - "pear/archive_tar": "<1.4.4", - "phpfastcache/phpfastcache": ">=5,<5.0.13", - "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", - "phpmyadmin/phpmyadmin": "<4.9.2", - "phpoffice/phpexcel": "<1.8.2", - "phpoffice/phpspreadsheet": "<1.8", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", - "phpwhois/phpwhois": "<=4.2.5", - "phpxmlrpc/extras": "<0.6.1", - "pimcore/pimcore": "<6.3", - "prestashop/autoupgrade": ">=4,<4.10.1", - "prestashop/gamification": "<2.3.2", - "prestashop/ps_facetedsearch": "<3.4.1", - "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", - "propel/propel": ">=2-alpha.1,<=2-alpha.7", - "propel/propel1": ">=1,<=1.7.1", - "pusher/pusher-php-server": "<2.2.1", - "robrichards/xmlseclibs": "<3.0.4", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", - "sensiolabs/connect": "<4.2.3", - "serluck/phpwhois": "<=4.2.6", - "shopware/shopware": "<5.3.7", - "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", - "silverstripe/assets": ">=1,<1.3.5|>=1.4,<1.4.4", - "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", - "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.4.5|>=4.5,<4.5.2", - "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2", - "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", - "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", - "silverstripe/subsites": ">=2,<2.1.1", - "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", - "silverstripe/userforms": "<3", - "simple-updates/phpwhois": "<=1", - "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.18.4", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "simplito/elliptic-php": "<1.0.6", - "slim/slim": "<2.6", - "smarty/smarty": "<3.1.33", - "socalnick/scn-social-auth": "<1.15.2", - "spoonity/tcpdf": "<6.2.22", - "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", - "stormpath/sdk": ">=0,<9.9.99", - "studio-42/elfinder": "<2.1.49", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/resource-bundle": "<1.3.13|>=1.4,<1.4.6|>=1.5,<1.5.1|>=1.6,<1.6.3", - "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", - "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", - "symbiote/silverstripe-versionedfiles": "<=2.0.3", - "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/mime": ">=4.3,<4.3.8", - "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/polyfill": ">=1,<1.10", - "symfony/polyfill-php55": ">=1,<1.10", - "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", - "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "tecnickcom/tcpdf": "<6.2.22", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1-beta.1,<2.1.3", - "theonedemon/phpwhois": "<=4.2.5", - "titon/framework": ">=0,<9.9.99", - "truckersmp/phpwhois": "<=4.3.1", - "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.12|>=10,<10.2.1", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.12|>=10,<10.2.1", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", - "ua-parser/uap-php": "<3.8", - "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", - "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", - "wallabag/tcpdf": "<6.2.22", - "willdurand/js-translation-bundle": "<2.1.1", - "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.15", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.15", - "yiisoft/yii2-elasticsearch": "<2.0.5", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "yiisoft/yii2-redis": "<2.0.8", - "yourls/yourls": "<1.7.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", - "zendframework/zend-diactoros": ">=1,<1.8.4", - "zendframework/zend-feed": ">=1,<2.10.3", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=1,<2.8.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": "<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - }, - { - "name": "Ilya Tribusean", - "email": "slash3b@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-03-02T07:11:48+00:00" - }, - { - "name": "sturents/swagger-php-model-generator", - "version": "0.1.4", - "source": { - "type": "git", - "url": "https://github.com/sturents/swagger-php-model-generator.git", - "reference": "6fbf75b0555b606b581221fbfc36f597a886b596" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sturents/swagger-php-model-generator/zipball/6fbf75b0555b606b581221fbfc36f597a886b596", - "reference": "6fbf75b0555b606b581221fbfc36f597a886b596", - "shasum": "" - }, - "require": { - "nette/php-generator": "^3.0", - "php": ">=7.0", - "psr/http-message": "^1.0", - "symfony/serializer": "^3.4", - "symfony/yaml": "^3.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "SwaggerGen\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "m1ke", - "email": "mike@m1ke.me" - } - ], - "time": "2020-03-03T13:07:15+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.14.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", - "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.14-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2020-01-13T11:15:53+00:00" - }, - { - "name": "symfony/serializer", - "version": "v3.4.38", - "source": { - "type": "git", - "url": "https://github.com/symfony/serializer.git", - "reference": "f8b99832d016e2d2c77c797c3df561adecd33dd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/f8b99832d016e2d2c77c797c3df561adecd33dd3", - "reference": "f8b99832d016e2d2c77c797c3df561adecd33dd3", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "phpdocumentor/type-resolver": "<0.2.1", - "symfony/dependency-injection": "<3.2", - "symfony/property-access": ">=3.0,<3.0.4|>=2.8,<2.8.4", - "symfony/property-info": "<3.1", - "symfony/yaml": "<3.4" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/cache": "~1.0", - "phpdocumentor/reflection-docblock": "^3.0|^4.0", - "symfony/cache": "~3.1|~4.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.2|~4.0", - "symfony/http-foundation": "~2.8|~3.0|~4.0", - "symfony/property-access": "~2.8|~3.0|~4.0", - "symfony/property-info": "^3.4.13|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", - "doctrine/cache": "For using the default cached annotation reader and metadata cache.", - "psr/cache-implementation": "For using the metadata cache.", - "symfony/config": "For using the XML mapping loader.", - "symfony/http-foundation": "For using a MIME type guesser within the DataUriNormalizer.", - "symfony/property-access": "For using the ObjectNormalizer.", - "symfony/property-info": "To deserialize relations.", - "symfony/yaml": "For using the default YAML mapping loader." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Serializer\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Serializer Component", - "homepage": "https://symfony.com", - "time": "2020-02-24T14:33:45+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.38", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "bc63e15160866e8730a1f738541b194c401f72bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/bc63e15160866e8730a1f738541b194c401f72bf", - "reference": "bc63e15160866e8730a1f738541b194c401f72bf", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2020-01-16T19:04:26+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "roave/security-advisories": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.1" - }, - "platform-dev": [] -} diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..1f2cff2 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/src/ChannelClient.php b/src/ChannelClient.php index 9b548e1..92d32f1 100644 --- a/src/ChannelClient.php +++ b/src/ChannelClient.php @@ -28,7 +28,7 @@ public function __construct(string $landlord_id, string $channel_id, string $dis */ protected function authQuery(SwaggerRequest $request): array{ $timestamp = time(); - $auth = $this->generateAuth($timestamp); + $auth = $this->generateAuth((string)$timestamp); return [ 'auth' => $auth, diff --git a/src/DisplayClient.php b/src/DisplayClient.php index 307814e..28bb113 100644 --- a/src/DisplayClient.php +++ b/src/DisplayClient.php @@ -14,7 +14,7 @@ class DisplayClient extends SturentsClient { * @param string $display_key */ public function __construct(int $landlord_id, string $display_key){ - parent::__construct($landlord_id); + parent::__construct((string)$landlord_id); $this->display_key = $display_key; } @@ -24,7 +24,7 @@ public function __construct(int $landlord_id, string $display_key){ */ protected function authQuery(SwaggerRequest $request) :array{ $timestamp = time(); - $auth = $this->generateAuth($timestamp); + $auth = $this->generateAuth((string)$timestamp); return [ 'auth' => $auth, diff --git a/src/Requests/DeleteContract.php b/src/Requests/DeleteContract.php index b9b43ed..e3f5f33 100644 --- a/src/Requests/DeleteContract.php +++ b/src/Requests/DeleteContract.php @@ -8,8 +8,8 @@ */ class DeleteContract extends SwaggerRequest { - const URI = '/api/contract'; - const METHOD = 'DELETE'; + public const URI = '/api/contract'; + public const METHOD = 'DELETE'; /** * The property ID provided by the initial creation @@ -41,7 +41,7 @@ public function __construct($property_id, $contract_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/DeleteMedia.php b/src/Requests/DeleteMedia.php index f169c77..12dab85 100644 --- a/src/Requests/DeleteMedia.php +++ b/src/Requests/DeleteMedia.php @@ -7,8 +7,8 @@ */ class DeleteMedia extends SwaggerRequest { - const URI = '/api/media'; - const METHOD = 'DELETE'; + public const URI = '/api/media'; + public const METHOD = 'DELETE'; /** * The property ID provided by the initial creation @@ -39,7 +39,7 @@ public function __construct($property_id, $media_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/DeleteRoom.php b/src/Requests/DeleteRoom.php index 55cfe91..b93a5de 100644 --- a/src/Requests/DeleteRoom.php +++ b/src/Requests/DeleteRoom.php @@ -7,8 +7,8 @@ */ class DeleteRoom extends SwaggerRequest { - const URI = '/api/room'; - const METHOD = 'DELETE'; + public const URI = '/api/room'; + public const METHOD = 'DELETE'; /** * The property ID provided by the initial creation @@ -40,7 +40,7 @@ public function __construct($property_id, $room_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetBankAccounts.php b/src/Requests/GetBankAccounts.php index 1447423..c2d3814 100644 --- a/src/Requests/GetBankAccounts.php +++ b/src/Requests/GetBankAccounts.php @@ -8,12 +8,12 @@ */ class GetBankAccounts extends SwaggerRequest { - const URI = '/api/bank-accounts'; - const METHOD = 'GET'; + public const URI = '/api/bank-accounts'; + public const METHOD = 'GET'; /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetContracts.php b/src/Requests/GetContracts.php index bfd4cf4..2df827f 100644 --- a/src/Requests/GetContracts.php +++ b/src/Requests/GetContracts.php @@ -8,8 +8,8 @@ */ class GetContracts extends SwaggerRequest { - const URI = '/api/contracts'; - const METHOD = 'GET'; + public const URI = '/api/contracts'; + public const METHOD = 'GET'; /** * The property ID provided by the initial creation @@ -31,7 +31,7 @@ public function __construct($property_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetFacilities.php b/src/Requests/GetFacilities.php index c6d65c9..2286a1a 100644 --- a/src/Requests/GetFacilities.php +++ b/src/Requests/GetFacilities.php @@ -8,12 +8,12 @@ */ class GetFacilities extends SwaggerRequest { - const URI = '/api/facilities'; - const METHOD = 'GET'; + public const URI = '/api/facilities'; + public const METHOD = 'GET'; /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetPaymentStructures.php b/src/Requests/GetPaymentStructures.php index adbb44d..2136602 100644 --- a/src/Requests/GetPaymentStructures.php +++ b/src/Requests/GetPaymentStructures.php @@ -9,12 +9,12 @@ */ class GetPaymentStructures extends SwaggerRequest { - const URI = '/api/payment-structures'; - const METHOD = 'GET'; + public const URI = '/api/payment-structures'; + public const METHOD = 'GET'; /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetProperties.php b/src/Requests/GetProperties.php index 733c887..5d38a53 100644 --- a/src/Requests/GetProperties.php +++ b/src/Requests/GetProperties.php @@ -7,8 +7,8 @@ */ class GetProperties extends SwaggerRequest { - const URI = '/api/properties'; - const METHOD = 'GET'; + public const URI = '/api/properties'; + public const METHOD = 'GET'; /** * When there are multiple pages of results, which one to return @@ -32,7 +32,7 @@ public function __construct($page = null) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetRooms.php b/src/Requests/GetRooms.php index d67e796..216f8b2 100644 --- a/src/Requests/GetRooms.php +++ b/src/Requests/GetRooms.php @@ -9,8 +9,8 @@ */ class GetRooms extends SwaggerRequest { - const URI = '/api/rooms'; - const METHOD = 'GET'; + public const URI = '/api/rooms'; + public const METHOD = 'GET'; /** * The property ID provided by the initial creation @@ -32,7 +32,7 @@ public function __construct($property_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetSummary.php b/src/Requests/GetSummary.php index 7f6fecf..a0be26a 100644 --- a/src/Requests/GetSummary.php +++ b/src/Requests/GetSummary.php @@ -7,12 +7,12 @@ */ class GetSummary extends SwaggerRequest { - const URI = '/api/summary'; - const METHOD = 'GET'; + public const URI = '/api/summary'; + public const METHOD = 'GET'; /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/GetTenancyTemplates.php b/src/Requests/GetTenancyTemplates.php index d954647..483e2b0 100644 --- a/src/Requests/GetTenancyTemplates.php +++ b/src/Requests/GetTenancyTemplates.php @@ -9,12 +9,12 @@ */ class GetTenancyTemplates extends SwaggerRequest { - const URI = '/api/tenancy-templates'; - const METHOD = 'GET'; + public const URI = '/api/tenancy-templates'; + public const METHOD = 'GET'; /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/PatchContract.php b/src/Requests/PatchContract.php index f61043a..6844dee 100644 --- a/src/Requests/PatchContract.php +++ b/src/Requests/PatchContract.php @@ -7,8 +7,8 @@ */ class PatchContract extends SwaggerRequest { - const URI = '/api/contract'; - const METHOD = 'PATCH'; + public const URI = '/api/contract'; + public const METHOD = 'PATCH'; /** * The property ID provided by the initial creation @@ -49,7 +49,7 @@ public function __construct($property_id, $contract_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/PatchProperty.php b/src/Requests/PatchProperty.php index 7262efb..2e41e7e 100644 --- a/src/Requests/PatchProperty.php +++ b/src/Requests/PatchProperty.php @@ -7,8 +7,8 @@ */ class PatchProperty extends SwaggerRequest { - const URI = '/api/property'; - const METHOD = 'PATCH'; + public const URI = '/api/property'; + public const METHOD = 'PATCH'; /** * The property ID provided by the initial creation @@ -39,7 +39,7 @@ public function __construct($property_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/PatchRoom.php b/src/Requests/PatchRoom.php index ea9ab1f..d2c78e8 100644 --- a/src/Requests/PatchRoom.php +++ b/src/Requests/PatchRoom.php @@ -7,8 +7,8 @@ */ class PatchRoom extends SwaggerRequest { - const URI = '/api/room'; - const METHOD = 'PATCH'; + public const URI = '/api/room'; + public const METHOD = 'PATCH'; /** * The property ID provided by the initial creation @@ -49,7 +49,7 @@ public function __construct($property_id, $room_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/PutContract.php b/src/Requests/PutContract.php index f2c52e7..835aa9a 100644 --- a/src/Requests/PutContract.php +++ b/src/Requests/PutContract.php @@ -7,8 +7,8 @@ */ class PutContract extends SwaggerRequest { - const URI = '/api/contract'; - const METHOD = 'PUT'; + public const URI = '/api/contract'; + public const METHOD = 'PUT'; /** * The property ID provided by the initial creation @@ -39,7 +39,7 @@ public function __construct($property_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/PutMedia.php b/src/Requests/PutMedia.php index 6a8cb66..870e3db 100644 --- a/src/Requests/PutMedia.php +++ b/src/Requests/PutMedia.php @@ -7,8 +7,8 @@ */ class PutMedia extends SwaggerRequest { - const URI = '/api/media'; - const METHOD = 'PUT'; + public const URI = '/api/media'; + public const METHOD = 'PUT'; /** * The property ID provided by the initial creation @@ -39,7 +39,7 @@ public function __construct($property_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/PutProperty.php b/src/Requests/PutProperty.php index 7ddc41c..12a6571 100644 --- a/src/Requests/PutProperty.php +++ b/src/Requests/PutProperty.php @@ -7,8 +7,8 @@ */ class PutProperty extends SwaggerRequest { - const URI = '/api/property'; - const METHOD = 'PUT'; + public const URI = '/api/property'; + public const METHOD = 'PUT'; /** * @param \SturentsLib\Api\Models\PropertyCreation $property @@ -21,7 +21,7 @@ public function setBody(\SturentsLib\Api\Models\PropertyCreation $property) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/PutRoom.php b/src/Requests/PutRoom.php index 53b6dc7..f794059 100644 --- a/src/Requests/PutRoom.php +++ b/src/Requests/PutRoom.php @@ -7,8 +7,8 @@ */ class PutRoom extends SwaggerRequest { - const URI = '/api/room'; - const METHOD = 'PUT'; + public const URI = '/api/room'; + public const METHOD = 'PUT'; /** * The property ID provided by the initial creation @@ -39,7 +39,7 @@ public function __construct($property_id) /** * @param SwaggerClient $client - * @return SwaggerModel + * @return SwaggerModel|SwaggerModel[] */ public function sendWith(SwaggerClient $client) { diff --git a/src/Requests/SwaggerRequest.php b/src/Requests/SwaggerRequest.php index bb9a8d9..5c1550b 100644 --- a/src/Requests/SwaggerRequest.php +++ b/src/Requests/SwaggerRequest.php @@ -18,7 +18,7 @@ class SwaggerRequest implements RequestInterface { protected $headers = []; /** - * @var UriInterface + * @var ?UriInterface */ private $uri; @@ -32,7 +32,7 @@ class SwaggerRequest implements RequestInterface { * @return string HTTP protocol version. */ public function getProtocolVersion(){ - return 1.1; + return '1.1'; } /** @@ -48,7 +48,7 @@ public function getProtocolVersion(){ * @param string $version HTTP protocol version * @return static */ - public function withProtocolVersion($version){ + public function withProtocolVersion(string $version){ return clone $this; } @@ -377,7 +377,6 @@ private function makeUri() :UriInterface{ $query[] = $this->{$param_name}; } if (!empty($query)){ - /** @noinspection PhpUnusedLocalVariableInspection */ $uri .= '/'.implode('/', $query); } diff --git a/src/SturentsClient.php b/src/SturentsClient.php index abec9e8..0cdd716 100644 --- a/src/SturentsClient.php +++ b/src/SturentsClient.php @@ -24,7 +24,7 @@ abstract class SturentsClient implements SwaggerClient { */ private $landlord_id; /** - * @var JsonMapper + * @var ?JsonMapper */ private $mapper; /** @@ -103,7 +103,13 @@ public function make(SwaggerRequest $request, array $response_models){ $response = $e->getResponse(); $response_model = $this->handleResponse($response, $response_models); - $response_model->asError(); + if (is_array($response_model)) { + foreach($response_model as $response_model_item) { + $response_model_item->asError(); + } + } else { + $response_model->asError(); + } return $response_model; } @@ -169,9 +175,10 @@ protected function handleResponse(ResponseInterface $response, array $response_m } /** + * @template T of SwaggerModel * @param $data - * @param string $response_class - * @return SwaggerModel + * @param class-string $response_class + * @return T * @throws JsonMapper_Exception */ private function map($data, string $response_class): SwaggerModel{ diff --git a/src/UploadClient.php b/src/UploadClient.php index 5d0b4e3..90912be 100644 --- a/src/UploadClient.php +++ b/src/UploadClient.php @@ -14,7 +14,7 @@ class UploadClient extends SturentsClient { * @param string $upload_key */ public function __construct(int $landlord_id, string $upload_key){ - parent::__construct($landlord_id); + parent::__construct((string)$landlord_id); $this->upload_key = $upload_key; } @@ -24,7 +24,7 @@ public function __construct(int $landlord_id, string $upload_key){ */ protected function authQuery(SwaggerRequest $request) :array{ $timestamp = time(); - $auth = $this->generateAuth((string) $request->getBody(), $timestamp); + $auth = $this->generateAuth((string) $request->getBody(), (string)$timestamp); return [ 'auth' => $auth,