From 39e6cf2e49270eb11644329da86c657c395869a1 Mon Sep 17 00:00:00 2001 From: roadiz-ci Date: Fri, 19 Apr 2024 09:51:35 +0000 Subject: [PATCH] Merge branch hotfix/v2.2.15 --- .github/workflows/run-test.yml | 2 +- .travis.yml | 16 ---------------- LICENSE | 21 --------------------- LICENSE.md | 9 +++++++++ composer.json | 9 +++++---- src/RandomGenerator.php | 4 ++-- 6 files changed, 17 insertions(+), 44 deletions(-) delete mode 100644 .travis.yml delete mode 100644 LICENSE create mode 100644 LICENSE.md diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 0b3245e..d872a3a 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['8.0', '8.1'] + php-version: ['8.1', '8.2', '8.3'] steps: - uses: shivammathur/setup-php@v2 with: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0bef681..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php -sudo: required -php: - - 7.4 - - 8.0 - - 8.1 - - nightly -install: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --dev --no-interaction -script: - - vendor/bin/phpcs --report=full --report-file=./report.txt --extensions=php --warning-severity=0 --standard=PSR2 -p ./src - - vendor/bin/phpstan analyse -c phpstan.neon -jobs: - allow_failures: - - php: nightly diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 9549c14..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Roadiz - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..d4d8a00 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright © 2023 Ambroise Maupate + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/composer.json b/composer.json index c556272..82dc55a 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,9 @@ } ], "require": { - "php": ">=8.0", - "psr/log": ">=1.1" + "php": ">=8.1", + "psr/log": ">=1.1", + "ext-openssl": "*" }, "require-dev": { "phpstan/phpstan": "^1.5.3", @@ -26,8 +27,8 @@ }, "extra": { "branch-alias": { - "dev-main": "2.1.x-dev", - "dev-develop": "2.2.x-dev" + "dev-main": "2.2.x-dev", + "dev-develop": "2.3.x-dev" } } } diff --git a/src/RandomGenerator.php b/src/RandomGenerator.php index 758ff16..0efe77e 100644 --- a/src/RandomGenerator.php +++ b/src/RandomGenerator.php @@ -34,11 +34,11 @@ public function __construct(LoggerInterface $logger = null) * @param int $nbBytes * @return string */ - protected function getRandomNumber(int $nbBytes = 32): string + public function getRandomNumber(int $nbBytes = 32): string { // try OpenSSL if ($this->useOpenSsl) { - $bytes = openssl_random_pseudo_bytes($nbBytes, $strong); + $bytes = \openssl_random_pseudo_bytes($nbBytes, $strong); if (false !== $bytes && true === $strong) { return $bytes;