From bcca269ac0dcf4e3a900e5ee274eba79cf3dbd42 Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Thu, 29 Feb 2024 13:56:19 +0100 Subject: [PATCH 01/11] checked with phpstan (locally) --- .travis.yml | 2 ++ phpstan.neon | 5 +++++ src/AbstractVersion.php | 5 +++-- src/FileVersion.php | 9 +++++---- src/GitVersion.php | 4 ++-- src/Version.php | 11 ++++++----- tests/FileVersionTest.php | 16 ++++++++++++---- tests/GitVersionTest.php | 14 ++++++++++---- tests/TempDirTrait.php | 4 ++++ tests/VersionTest.php | 19 +++++++++++++------ 10 files changed, 62 insertions(+), 27 deletions(-) create mode 100644 phpstan.neon diff --git a/.travis.yml b/.travis.yml index 996ddd0..815a08a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ php: - 7.0 - 7.1 - 7.2 +- 7.4 +- 8.1 env: global: - CC_TEST_REPORTER_ID=5ae2c3f73f4475bd0ada0a042a8f581dfeb12745ee9fbb3d1e590f15dbb0ec5c diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..1517ec8 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 9 + paths: + - src/ + - tests/ diff --git a/src/AbstractVersion.php b/src/AbstractVersion.php index 691dd12..eae0bc1 100644 --- a/src/AbstractVersion.php +++ b/src/AbstractVersion.php @@ -20,6 +20,7 @@ abstract class AbstractVersion implements IVersion * which is a value of any type other than a resource. * @since 5.4.0 */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return [ @@ -39,13 +40,13 @@ public function exists(): bool /** * Get the branch string. - * @return string + * @return string|null */ abstract public function getBranch(); /** * Get the latest commit ID. - * @return string + * @return string|null */ abstract public function getCommit(); } diff --git a/src/FileVersion.php b/src/FileVersion.php index 472742c..54f8d7e 100644 --- a/src/FileVersion.php +++ b/src/FileVersion.php @@ -24,7 +24,7 @@ class FileVersion extends AbstractVersion private $fileExists; /** - * @var string Cache fileContents() function reply. + * @var array Cache fileContents() function reply. */ private $fileContents; @@ -52,7 +52,7 @@ private function fileExists(): bool /** * Get the contents of the JSON encoded file. - * @return array + * @return array */ private function fileContents(): array { @@ -63,6 +63,7 @@ private function fileContents(): array if ($this->fileExists()) { $jsonStr = file_get_contents($this->file); if ($jsonStr !== false) { + /** @var array $json */ $json = json_decode($jsonStr, true); if ($json !== null) { if (array_key_exists('branch', $json)) { @@ -80,7 +81,7 @@ private function fileContents(): array /** * Get the branch string. - * @return string + * @return string|null */ public function getBranch() { @@ -92,7 +93,7 @@ public function getBranch() /** * Get the latest commit ID. - * @return string + * @return string|null */ public function getCommit() { diff --git a/src/GitVersion.php b/src/GitVersion.php index 9d5dda8..87c5ade 100644 --- a/src/GitVersion.php +++ b/src/GitVersion.php @@ -29,7 +29,7 @@ class GitVersion extends AbstractVersion private $isRepo; /** - * @var string The current branch name in the git repository. + * @var string|null The current branch name in the git repository. */ private $branch; @@ -62,7 +62,7 @@ private function isRepo(): bool /** * Get the branch string. - * @return string + * @return string|null */ public function getBranch() { diff --git a/src/Version.php b/src/Version.php index e44a7d2..a482f4e 100644 --- a/src/Version.php +++ b/src/Version.php @@ -14,12 +14,12 @@ class Version extends AbstractVersion { /** - * @var array of IVersion objects. + * @var array of IVersion objects. */ private $versions; /** - * @var array Branch and commit. + * @var array Branch and commit. */ private $version; @@ -34,6 +34,7 @@ public function __construct() /** * Register a new way to determine the version. * @param \kbATeam\Version\IVersion $version + * @return void */ public function register(IVersion $version) { @@ -42,7 +43,7 @@ public function register(IVersion $version) /** * Determine the current version. - * @return array + * @return array */ private function determineVersion(): array { @@ -65,7 +66,7 @@ private function determineVersion(): array /** * Get the branch string. - * @return string + * @return string|null */ public function getBranch() { @@ -77,7 +78,7 @@ public function getBranch() /** * Get the latest commit ID. - * @return string + * @return string|null */ public function getCommit() { diff --git a/tests/FileVersionTest.php b/tests/FileVersionTest.php index 995a8d9..53d43fc 100644 --- a/tests/FileVersionTest.php +++ b/tests/FileVersionTest.php @@ -16,6 +16,9 @@ */ class FileVersionTest extends \PHPUnit_Framework_TestCase { + /** + * @var string + */ private $tempDir; use TempDirTrait; @@ -23,11 +26,12 @@ class FileVersionTest extends \PHPUnit_Framework_TestCase /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. + * @return void */ protected function setUp() { parent::setUp(); - $this->tempDir = static::tempdir(); + $this->tempDir = self::tempdir(); file_put_contents($this->tempDir.'/commit.json', json_encode([ 'branch' => 'master', 'commit' => '9c9e437' @@ -37,17 +41,19 @@ protected function setUp() /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. + * @return void */ protected function tearDown() { parent::tearDown(); - static::rmDir($this->tempDir); + self::rmDir($this->tempDir); } /** * Test retrieving branch and commit from a JSON encoded file. * @throws \PHPUnit_Framework_AssertionFailedError * @throws \PHPUnit_Framework_Exception + * @return void */ public function testFileVersionRetrieval() { @@ -56,8 +62,8 @@ public function testFileVersionRetrieval() static::assertTrue($fileVersion->exists()); static::assertSame('master', $fileVersion->getBranch()); static::assertSame('9c9e437', $fileVersion->getCommit()); - $actual = json_encode($fileVersion); - $expected = json_encode([ + $actual = (string)json_encode($fileVersion); + $expected = (string)json_encode([ 'branch' => 'master', 'commit' => '9c9e437' ]); @@ -66,6 +72,7 @@ public function testFileVersionRetrieval() /** * Test retrieving commit from a JSON encoded file. + * @return void */ public function testGettingCommit() { @@ -75,6 +82,7 @@ public function testGettingCommit() /** * Test retrieving branch from a JSON encoded file. + * @return void */ public function testGettingBranch() { diff --git a/tests/GitVersionTest.php b/tests/GitVersionTest.php index 94a9071..659c3bf 100644 --- a/tests/GitVersionTest.php +++ b/tests/GitVersionTest.php @@ -16,6 +16,9 @@ */ class GitVersionTest extends \PHPUnit_Framework_TestCase { + /** + * @var string + */ private $tempDir; use TempDirTrait; @@ -23,11 +26,12 @@ class GitVersionTest extends \PHPUnit_Framework_TestCase /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. + * @return void */ protected function setUp() { parent::setUp(); - $this->tempDir = static::tempdir(); + $this->tempDir = self::tempdir(); mkdir($this->tempDir.'/.git/refs/heads/', 0777, true); file_put_contents($this->tempDir.'/.git/HEAD', 'ref: refs/heads/master'); file_put_contents($this->tempDir.'/.git/refs/heads/master', '9c9e4373dbd136a4f405a828a9ecf445f207e49c'); @@ -36,17 +40,19 @@ protected function setUp() /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. + * @return void */ protected function tearDown() { parent::tearDown(); - static::rmDir($this->tempDir); + self::rmDir($this->tempDir); } /** * Test retrieving version information from git. * @throws \PHPUnit_Framework_AssertionFailedError * @throws \PHPUnit_Framework_Exception + * @return void */ public function testGitVersionRetrieval() { @@ -55,8 +61,8 @@ public function testGitVersionRetrieval() static::assertTrue($gitVersion->exists()); static::assertSame('master', $gitVersion->getBranch()); static::assertSame('9c9e437', $gitVersion->getCommit()); - $actual = json_encode($gitVersion); - $expected = json_encode([ + $actual = (string)json_encode($gitVersion); + $expected = (string)json_encode([ 'branch' => 'master', 'commit' => '9c9e437' ]); diff --git a/tests/TempDirTrait.php b/tests/TempDirTrait.php index 09cf535..bb64bf8 100644 --- a/tests/TempDirTrait.php +++ b/tests/TempDirTrait.php @@ -23,6 +23,9 @@ private static function tempdir() ob_start(); $result = system('mktemp -d', $exitCode); ob_end_clean(); + if (!is_string($result)) { + throw new \RuntimeException('Could not create temporary directory!'); + } if ($exitCode !== 0) { throw new \RuntimeException('Could not create temporary directory!'); } @@ -33,6 +36,7 @@ private static function tempdir() * Remove a directory and all its contents. * @param string $dir * @throws \RuntimeException + * @return void */ private static function rmDir($dir) { diff --git a/tests/VersionTest.php b/tests/VersionTest.php index 40652ed..052c09e 100644 --- a/tests/VersionTest.php +++ b/tests/VersionTest.php @@ -18,6 +18,9 @@ */ class VersionTest extends \PHPUnit_Framework_TestCase { + /** + * @var string + */ private $tempDir; use TempDirTrait; @@ -25,11 +28,12 @@ class VersionTest extends \PHPUnit_Framework_TestCase /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. + * @return void */ protected function setUp() { parent::setUp(); - $this->tempDir = static::tempdir(); + $this->tempDir = self::tempdir(); file_put_contents($this->tempDir.'/commit.json', json_encode([ 'branch' => 'retsam', 'commit' => '765e9c9' @@ -42,11 +46,12 @@ protected function setUp() /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. + * @return void */ protected function tearDown() { parent::tearDown(); - static::rmDir($this->tempDir); + self::rmDir($this->tempDir); } /** @@ -54,6 +59,7 @@ protected function tearDown() * git repository. * @throws \PHPUnit_Framework_AssertionFailedError * @throws \PHPUnit_Framework_Exception + * @return void */ public function testRetrievingFileVersion() { @@ -64,8 +70,8 @@ public function testRetrievingFileVersion() static::assertTrue($version->exists()); static::assertSame('retsam', $version->getBranch()); static::assertSame('765e9c9', $version->getCommit()); - $actual = json_encode($version); - $expected = json_encode([ + $actual = (string)json_encode($version); + $expected = (string)json_encode([ 'branch' => 'retsam', 'commit' => '765e9c9' ]); @@ -78,6 +84,7 @@ public function testRetrievingFileVersion() * encoded file. * @throws \PHPUnit_Framework_AssertionFailedError * @throws \PHPUnit_Framework_Exception + * @return void */ public function testRetrievingGitVersion() { @@ -88,8 +95,8 @@ public function testRetrievingGitVersion() static::assertSame('9c9e437', $version->getCommit()); static::assertTrue($version->exists()); static::assertSame('master', $version->getBranch()); - $actual = json_encode($version); - $expected = json_encode([ + $actual = (string)json_encode($version); + $expected = (string)json_encode([ 'branch' => 'master', 'commit' => '9c9e437' ]); From 5495e5ec794636ecbb8671dac518632e4ec638a8 Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Thu, 29 Feb 2024 14:47:54 +0100 Subject: [PATCH 02/11] try github workflow --- .github/workflows/main.yml | 66 ++++++ composer.json | 2 +- composer.lock | 428 ++++++++++++++++++++++++++++--------- 3 files changed, 399 insertions(+), 97 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f7480b4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,66 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events + push: + pull_request: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # Composer config validation + composer: + name: Composer config validation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Validate composer.json + run: composer validate --strict + + # PHP syntax validation + php: + name: PHP syntax validation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check PHP syntax of config/phinx.php + run: php -l Lib/ + + phpunit: + name: PHPUnit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: php-actions/composer@v6 # or alternative dependency management + - uses: php-actions/phpunit@v3 + with: + version: 4.8 + php_version: 7.4 + configuration: phpunit.xml + bootstrap: vendor/autoload.php + coverage_clover: clover.xml + + # phpstan for several php versions + phpstan: + runs-on: ubuntu-latest + strategy: + matrix: + php_version: [7.2, 7.4, 8.0, 8.1, 8.2] + steps: + - uses: actions/checkout@v3 + - uses: php-actions/composer@v6 + with: + php_version: ${{ matrix.php_version }} + #php_extensions: redis intl + + - name: PHPStan Static Analysis + uses: php-actions/phpstan@v3 + with: + php_version: ${{ matrix.php_version }} + configuration: phpstan.neon + path: Lib/ diff --git a/composer.json b/composer.json index 4e7a7d9..6953f64 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "minimum-stability": "stable", "require": { - "php": "^7.0", + "php": ">7.0, <8.4", "ext-json": "*" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 2eae477..ce151eb 100644 --- a/composer.lock +++ b/composer.lock @@ -4,39 +4,84 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2bf91e3bd1862b68ff07a1eacf617370", + "content-hash": "9bd887ef2369155395998447b366ec24", "packages": [], "packages-dev": [ + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1 || ^8.0" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -50,48 +95,61 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -113,45 +171,46 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.4", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpdocumentor/type-resolver": "0.4.*", - "phpunit/phpunit": "^6.4" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -162,37 +221,53 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-12-28T18:55:12+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.5.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae" + "reference": "153ae662783729388a584b4361f2545e4d841e3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", + "reference": "153ae662783729388a584b4361f2545e4d841e3c", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0" + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.13" }, "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { @@ -210,20 +285,25 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-12-30T13:23:38+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + }, + "time": "2024-02-23T11:10:43+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.10.2", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { @@ -273,7 +353,58 @@ "spy", "stub" ], - "time": "2020-01-20T15:57:02+00:00" + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, + "time": "2020-03-05T15:02:03+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.26.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "231e3186624c03d7e7c890ec662b81e6b0405227" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/231e3186624c03d7e7c890ec662b81e6b0405227", + "reference": "231e3186624c03d7e7c890ec662b81e6b0405227", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.26.0" + }, + "time": "2024-02-23T16:05:55+00:00" }, { "name": "phpunit/php-code-coverage", @@ -335,6 +466,11 @@ "testing", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2" + }, "time": "2015-10-06T15:47:00+00:00" }, { @@ -382,6 +518,11 @@ "filesystem", "iterator" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + }, "time": "2017-11-27T13:52:08+00:00" }, { @@ -423,6 +564,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -472,6 +617,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2017-02-26T11:10:40+00:00" }, { @@ -521,6 +670,11 @@ "keywords": [ "tokenizer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4" + }, + "abandoned": true, "time": "2017-12-04T08:55:13+00:00" }, { @@ -593,6 +747,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36" + }, "time": "2017-06-21T08:07:12+00:00" }, { @@ -649,6 +807,12 @@ "mock", "xunit" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3" + }, + "abandoned": true, "time": "2015-10-02T06:51:40+00:00" }, { @@ -713,6 +877,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" + }, "time": "2017-01-29T09:50:25+00:00" }, { @@ -765,6 +933,10 @@ "keywords": [ "diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/1.4" + }, "time": "2017-05-22T07:24:03+00:00" }, { @@ -815,6 +987,10 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/1.3" + }, "time": "2016-08-18T05:49:44+00:00" }, { @@ -882,6 +1058,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, "time": "2016-06-17T09:04:28+00:00" }, { @@ -933,6 +1113,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" + }, "time": "2015-10-12T03:26:01+00:00" }, { @@ -986,6 +1170,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + }, "time": "2016-10-03T07:41:43+00:00" }, { @@ -1021,41 +1209,49 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/1.0.6" + }, "time": "2015-06-21T13:59:46+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.29.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", + "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" }, "suggest": { "ext-ctype": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.13-dev" + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1079,20 +1275,37 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-01-29T20:11:03+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.37", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "aa46bc2233097d5212332c907f9911533acfbf80" + "reference": "88289caa3c166321883f67fe5130188ebbb47094" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/aa46bc2233097d5212332c907f9911533acfbf80", - "reference": "aa46bc2233097d5212332c907f9911533acfbf80", + "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", + "reference": "88289caa3c166321883f67fe5130188ebbb47094", "shasum": "" }, "require": { @@ -1109,11 +1322,6 @@ "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\\": "" @@ -1138,33 +1346,56 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2020-01-13T08:00:59+00:00" + "support": { + "source": "https://github.com/symfony/yaml/tree/v3.4.47" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T10:57:07+00:00" }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.11.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "url": "https://github.com/webmozarts/assert.git", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", + "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" + "ext-ctype": "*", + "php": "^7.2 || ^8.0" }, "conflict": { - "vimeo/psalm": "<3.6.0" + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -1186,7 +1417,11 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+00:00" + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, + "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], @@ -1195,8 +1430,9 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.0", + "php": ">7.0, <8.4", "ext-json": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.6.0" } From 7c54f6cd2cf0babf1412bbef2d42139ceff996b1 Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Thu, 29 Feb 2024 14:52:31 +0100 Subject: [PATCH 03/11] get github workflow running --- .github/workflows/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7480b4..8407424 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,14 +29,16 @@ jobs: steps: - uses: actions/checkout@v3 - name: Check PHP syntax of config/phinx.php - run: php -l Lib/ + run: php -l src/ tests/ phpunit: name: PHPUnit tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: php-actions/composer@v6 # or alternative dependency management + - uses: php-actions/composer@v6 + with: + php_version: 7.4 - uses: php-actions/phpunit@v3 with: version: 4.8 @@ -55,7 +57,7 @@ jobs: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: - php_version: ${{ matrix.php_version }} + php_version: 7.4 #php_extensions: redis intl - name: PHPStan Static Analysis From fb6432b3688395223eb877decfe041411e3a5e5e Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Thu, 29 Feb 2024 14:54:28 +0100 Subject: [PATCH 04/11] fix github workflow --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8407424..ac9444a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,4 +65,3 @@ jobs: with: php_version: ${{ matrix.php_version }} configuration: phpstan.neon - path: Lib/ From d5398905f751c00be5913da305ed4159b7c97306 Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Mon, 11 Mar 2024 14:29:28 +0100 Subject: [PATCH 05/11] proper testing of all versions --- .github/workflows/main.yml | 2 +- composer.lock | 382 ++++++------------------------------- 2 files changed, 55 insertions(+), 329 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac9444a..2aa4523 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: - php_version: 7.4 + php_version: ${{ matrix.php_version }} #php_extensions: redis intl - name: PHPStan Static Analysis diff --git a/composer.lock b/composer.lock index ce151eb..ff23627 100644 --- a/composer.lock +++ b/composer.lock @@ -7,53 +7,6 @@ "content-hash": "9bd887ef2369155395998447b366ec24", "packages": [], "packages-dev": [ - { - "name": "doctrine/deprecations", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" - }, - "time": "2024-01-30T19:34:25+00:00" - }, { "name": "doctrine/instantiator", "version": "1.5.0", @@ -124,155 +77,41 @@ ], "time": "2022-12-30T00:15:36+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", "shasum": "" }, "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "php": ">=5.3.3" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.8.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "phpunit/phpunit": "~4.0" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", - "shasum": "" - }, - "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.3 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" - }, - "require-dev": { - "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "psr-0": { + "phpDocumentor": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -282,50 +121,46 @@ "authors": [ { "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "email": "mike.vanriel@naenius.com" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/2.x" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2016-01-25T08:17:30+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.10.3", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpspec/phpspec": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" + "psr-0": { + "Prophecy\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -355,56 +190,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" - }, - "time": "2020-03-05T15:02:03+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.26.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "231e3186624c03d7e7c890ec662b81e6b0405227" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/231e3186624c03d7e7c890ec662b81e6b0405227", - "reference": "231e3186624c03d7e7c890ec662b81e6b0405227", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } + "source": "https://github.com/phpspec/prophecy/tree/master" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.26.0" - }, - "time": "2024-02-23T16:05:55+00:00" + "time": "2015-08-13T10:07:40+00:00" }, { "name": "phpunit/php-code-coverage", @@ -572,30 +360,25 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "~4|~5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -618,10 +401,11 @@ "timer" ], "support": { + "irc": "irc://irc.freenode.net/phpunit", "issues": "https://github.com/sebastianbergmann/php-timer/issues", "source": "https://github.com/sebastianbergmann/php-timer/tree/master" }, - "time": "2017-02-26T11:10:40+00:00" + "time": "2016-05-12T18:03:57+00:00" }, { "name": "phpunit/php-token-stream", @@ -885,23 +669,23 @@ }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { @@ -935,29 +719,29 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" + "source": "https://github.com/sebastianbergmann/diff/tree/master" }, - "time": "2017-05-22T07:24:03+00:00" + "time": "2015-12-08T07:14:41+00:00" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { @@ -989,9 +773,9 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/1.3" + "source": "https://github.com/sebastianbergmann/environment/tree/1.3.7" }, - "time": "2016-08-18T05:49:44+00:00" + "time": "2016-05-17T03:18:57+00:00" }, { "name": "sebastian/exporter", @@ -1364,64 +1148,6 @@ } ], "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], From 0ad0f30cccec01504d555f5d28b21b099ae233ad Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Mon, 11 Mar 2024 14:40:21 +0100 Subject: [PATCH 06/11] phpunit on all versions --- .github/workflows/main.yml | 10 +- .gitignore | 1 + composer.lock | 1164 ------------------------------------ 3 files changed, 7 insertions(+), 1168 deletions(-) delete mode 100644 composer.lock diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2aa4523..9f9ca07 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,21 +28,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Check PHP syntax of config/phinx.php + - name: Check PHP syntax of package run: php -l src/ tests/ phpunit: name: PHPUnit tests runs-on: ubuntu-latest + strategy: + matrix: + php_version: [ 7.2, 7.4, 8.0, 8.1, 8.2 ] steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: - php_version: 7.4 + php_version: ${{ matrix.php_version }} - uses: php-actions/phpunit@v3 with: - version: 4.8 - php_version: 7.4 + php_version: ${{ matrix.php_version }} configuration: phpunit.xml bootstrap: vendor/autoload.php coverage_clover: clover.xml diff --git a/.gitignore b/.gitignore index 57872d0..4fbb073 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /vendor/ +/composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index ff23627..0000000 --- a/composer.lock +++ /dev/null @@ -1,1164 +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": "9bd887ef2369155395998447b366ec24", - "packages": [], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:15:36+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/2.x" - }, - "time": "2016-01-25T08:17:30+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/master" - }, - "time": "2015-08-13T10:07:40+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "2.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", - "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2" - }, - "time": "2015-10-06T15:47:00+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" - }, - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4|~5" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" - }, - "time": "2016-05-12T18:03:57+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.12", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4" - }, - "abandoned": true, - "time": "2017-12-04T08:55:13+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "4.8.36", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.8.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36" - }, - "time": "2017-06-21T08:07:12+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3" - }, - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" - }, - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/master" - }, - "time": "2015-12-08T07:14:41+00:00" - }, - { - "name": "sebastian/environment", - "version": "1.3.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/1.3.7" - }, - "time": "2016-05-17T03:18:57+00:00" - }, - { - "name": "sebastian/exporter", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" - }, - "time": "2016-06-17T09:04:28+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" - }, - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" - }, - "time": "2016-10-03T07:41:43+00:00" - }, - { - "name": "sebastian/version", - "version": "1.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "shasum": "" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/1.0.6" - }, - "time": "2015-06-21T13:59:46+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "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" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", - "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", - "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", - "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">7.0, <8.4", - "ext-json": "*" - }, - "platform-dev": [], - "plugin-api-version": "2.6.0" -} From 49c55d5c0900de8de44af8616d7d2b414c09689e Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Mon, 11 Mar 2024 14:55:46 +0100 Subject: [PATCH 07/11] use phpunit installed by composer --- .github/workflows/main.yml | 11 +++-------- composer.json | 2 +- phpunit.xml | 37 ++++++++++++++++++------------------- tests/FileVersionTest.php | 7 ++++--- tests/GitVersionTest.php | 7 ++++--- tests/VersionTest.php | 7 ++++--- 6 files changed, 34 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f9ca07..ecd2334 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,20 +41,15 @@ jobs: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: - php_version: ${{ matrix.php_version }} - - uses: php-actions/phpunit@v3 - with: - php_version: ${{ matrix.php_version }} - configuration: phpunit.xml - bootstrap: vendor/autoload.php - coverage_clover: clover.xml + php_version: ${{ matrix.php_version } + - run: vendor/bin/phpunit # phpstan for several php versions phpstan: runs-on: ubuntu-latest strategy: matrix: - php_version: [7.2, 7.4, 8.0, 8.1, 8.2] + php_version: [ 7.2, 7.4, 8.0, 8.1, 8.2 ] steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 diff --git a/composer.json b/composer.json index 6953f64..b4f6e9c 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "ext-json": "*" }, "require-dev": { - "phpunit/phpunit": "^4.8" + "phpunit/phpunit": "^9.5" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 0318fac..84820b6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,22 +1,21 @@ - - - - tests/ - - - - - src/ - - + + + src/ + + + + + tests/ + + diff --git a/tests/FileVersionTest.php b/tests/FileVersionTest.php index 53d43fc..3313217 100644 --- a/tests/FileVersionTest.php +++ b/tests/FileVersionTest.php @@ -4,6 +4,7 @@ use kbATeam\Version\FileVersion; use kbATeam\Version\IVersion; +use PHPUnit\Framework\TestCase; /** * Class Tests\kbATeam\Version\FileVersionTest @@ -14,7 +15,7 @@ * @author Gregor J. * @license MIT */ -class FileVersionTest extends \PHPUnit_Framework_TestCase +class FileVersionTest extends TestCase { /** * @var string @@ -28,7 +29,7 @@ class FileVersionTest extends \PHPUnit_Framework_TestCase * This method is called before a test is executed. * @return void */ - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->tempDir = self::tempdir(); @@ -43,7 +44,7 @@ protected function setUp() * This method is called after a test is executed. * @return void */ - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); self::rmDir($this->tempDir); diff --git a/tests/GitVersionTest.php b/tests/GitVersionTest.php index 659c3bf..216c2ba 100644 --- a/tests/GitVersionTest.php +++ b/tests/GitVersionTest.php @@ -4,6 +4,7 @@ use kbATeam\Version\GitVersion; use kbATeam\Version\IVersion; +use PHPUnit\Framework\TestCase; /** * Class Tests\kbATeam\Version\GitVersionTest @@ -14,7 +15,7 @@ * @author Gregor J. * @license MIT */ -class GitVersionTest extends \PHPUnit_Framework_TestCase +class GitVersionTest extends TestCase { /** * @var string @@ -28,7 +29,7 @@ class GitVersionTest extends \PHPUnit_Framework_TestCase * This method is called before a test is executed. * @return void */ - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->tempDir = self::tempdir(); @@ -42,7 +43,7 @@ protected function setUp() * This method is called after a test is executed. * @return void */ - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); self::rmDir($this->tempDir); diff --git a/tests/VersionTest.php b/tests/VersionTest.php index 052c09e..f2ce2e2 100644 --- a/tests/VersionTest.php +++ b/tests/VersionTest.php @@ -6,6 +6,7 @@ use kbATeam\Version\GitVersion; use kbATeam\Version\IVersion; use kbATeam\Version\Version; +use PHPUnit\Framework\TestCase; /** * Class Tests\kbATeam\Version\VersionTest @@ -16,7 +17,7 @@ * @author Gregor J. * @license MIT */ -class VersionTest extends \PHPUnit_Framework_TestCase +class VersionTest extends TestCase { /** * @var string @@ -30,7 +31,7 @@ class VersionTest extends \PHPUnit_Framework_TestCase * This method is called before a test is executed. * @return void */ - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->tempDir = self::tempdir(); @@ -48,7 +49,7 @@ protected function setUp() * This method is called after a test is executed. * @return void */ - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); self::rmDir($this->tempDir); From 7bf55bde636207eff08cf96a994855af27a91a84 Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Mon, 11 Mar 2024 14:58:14 +0100 Subject: [PATCH 08/11] fix syntax --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ecd2334..4badc4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 with: - php_version: ${{ matrix.php_version } + php_version: ${{ matrix.php_version }} - run: vendor/bin/phpunit # phpstan for several php versions From db13acc08d5c030bdfe042f85972eeacb27cb0d9 Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Mon, 11 Mar 2024 15:00:18 +0100 Subject: [PATCH 09/11] limit php versiond from 7.4 ... 8.2 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4badc4d..bcd56d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php_version: [ 7.2, 7.4, 8.0, 8.1, 8.2 ] + php_version: [ 7.4, 8.0, 8.1, 8.2 ] steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php_version: [ 7.2, 7.4, 8.0, 8.1, 8.2 ] + php_version: [ 7.4, 8.0, 8.1, 8.2 ] steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 From 6c163462d4e23f4362595dd16d26caa343851fb6 Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Mon, 11 Mar 2024 15:09:09 +0100 Subject: [PATCH 10/11] lift unit test to phpunit:^9.5 --- tests/FileVersionTest.php | 20 +++++++++----------- tests/GitVersionTest.php | 14 ++++++-------- tests/VersionTest.php | 28 ++++++++++++---------------- 3 files changed, 27 insertions(+), 35 deletions(-) diff --git a/tests/FileVersionTest.php b/tests/FileVersionTest.php index 3313217..cb562ea 100644 --- a/tests/FileVersionTest.php +++ b/tests/FileVersionTest.php @@ -32,7 +32,7 @@ class FileVersionTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->tempDir = self::tempdir(); + $this->tempDir = $this->tempdir(); file_put_contents($this->tempDir.'/commit.json', json_encode([ 'branch' => 'master', 'commit' => '9c9e437' @@ -47,28 +47,26 @@ protected function setUp(): void protected function tearDown(): void { parent::tearDown(); - self::rmDir($this->tempDir); + $this->rmDir($this->tempDir); } /** * Test retrieving branch and commit from a JSON encoded file. - * @throws \PHPUnit_Framework_AssertionFailedError - * @throws \PHPUnit_Framework_Exception * @return void */ public function testFileVersionRetrieval() { $fileVersion = new FileVersion($this->tempDir.'/commit.json'); - static::assertInstanceOf(IVersion::class, $fileVersion); - static::assertTrue($fileVersion->exists()); - static::assertSame('master', $fileVersion->getBranch()); - static::assertSame('9c9e437', $fileVersion->getCommit()); + $this->assertInstanceOf(IVersion::class, $fileVersion); + $this->assertTrue($fileVersion->exists()); + $this->assertSame('master', $fileVersion->getBranch()); + $this->assertSame('9c9e437', $fileVersion->getCommit()); $actual = (string)json_encode($fileVersion); $expected = (string)json_encode([ 'branch' => 'master', 'commit' => '9c9e437' ]); - static::assertJsonStringEqualsJsonString($expected, $actual); + $this->assertJsonStringEqualsJsonString($expected, $actual); } /** @@ -78,7 +76,7 @@ public function testFileVersionRetrieval() public function testGettingCommit() { $fileVersion = new FileVersion($this->tempDir.'/commit.json'); - static::assertSame('9c9e437', $fileVersion->getCommit()); + $this->assertSame('9c9e437', $fileVersion->getCommit()); } /** @@ -88,6 +86,6 @@ public function testGettingCommit() public function testGettingBranch() { $fileVersion = new FileVersion($this->tempDir.'/commit.json'); - static::assertSame('master', $fileVersion->getBranch()); + $this->assertSame('master', $fileVersion->getBranch()); } } diff --git a/tests/GitVersionTest.php b/tests/GitVersionTest.php index 216c2ba..4b6a1dd 100644 --- a/tests/GitVersionTest.php +++ b/tests/GitVersionTest.php @@ -32,7 +32,7 @@ class GitVersionTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->tempDir = self::tempdir(); + $this->tempDir = $this->tempdir(); mkdir($this->tempDir.'/.git/refs/heads/', 0777, true); file_put_contents($this->tempDir.'/.git/HEAD', 'ref: refs/heads/master'); file_put_contents($this->tempDir.'/.git/refs/heads/master', '9c9e4373dbd136a4f405a828a9ecf445f207e49c'); @@ -46,22 +46,20 @@ protected function setUp(): void protected function tearDown(): void { parent::tearDown(); - self::rmDir($this->tempDir); + $this->rmDir($this->tempDir); } /** * Test retrieving version information from git. - * @throws \PHPUnit_Framework_AssertionFailedError - * @throws \PHPUnit_Framework_Exception * @return void */ public function testGitVersionRetrieval() { $gitVersion = new GitVersion($this->tempDir); - static::assertInstanceOf(IVersion::class, $gitVersion); - static::assertTrue($gitVersion->exists()); - static::assertSame('master', $gitVersion->getBranch()); - static::assertSame('9c9e437', $gitVersion->getCommit()); + $this->assertInstanceOf(IVersion::class, $gitVersion); + $this->assertTrue($gitVersion->exists()); + $this->assertSame('master', $gitVersion->getBranch()); + $this->assertSame('9c9e437', $gitVersion->getCommit()); $actual = (string)json_encode($gitVersion); $expected = (string)json_encode([ 'branch' => 'master', diff --git a/tests/VersionTest.php b/tests/VersionTest.php index f2ce2e2..1d96f4f 100644 --- a/tests/VersionTest.php +++ b/tests/VersionTest.php @@ -34,7 +34,7 @@ class VersionTest extends TestCase protected function setUp(): void { parent::setUp(); - $this->tempDir = self::tempdir(); + $this->tempDir = $this->tempdir(); file_put_contents($this->tempDir.'/commit.json', json_encode([ 'branch' => 'retsam', 'commit' => '765e9c9' @@ -52,55 +52,51 @@ protected function setUp(): void protected function tearDown(): void { parent::tearDown(); - self::rmDir($this->tempDir); + $this->rmDir($this->tempDir); } /** * Test retrieving the version from the JSON encoded file rather that from the * git repository. - * @throws \PHPUnit_Framework_AssertionFailedError - * @throws \PHPUnit_Framework_Exception * @return void */ public function testRetrievingFileVersion() { $version = new Version(); - static::assertInstanceOf(IVersion::class, $version); + $this->assertInstanceOf(IVersion::class, $version); $version->register(new FileVersion($this->tempDir.'/commit.json')); //$version->register(new GitVersion($this->tempDir)); - static::assertTrue($version->exists()); - static::assertSame('retsam', $version->getBranch()); - static::assertSame('765e9c9', $version->getCommit()); + $this->assertTrue($version->exists()); + $this->assertSame('retsam', $version->getBranch()); + $this->assertSame('765e9c9', $version->getCommit()); $actual = (string)json_encode($version); $expected = (string)json_encode([ 'branch' => 'retsam', 'commit' => '765e9c9' ]); - static::assertJsonStringEqualsJsonString($expected, $actual); + $this->assertJsonStringEqualsJsonString($expected, $actual); } /** * Test retrieving the version from the git repository rather that from the JSON * encoded file. - * @throws \PHPUnit_Framework_AssertionFailedError - * @throws \PHPUnit_Framework_Exception * @return void */ public function testRetrievingGitVersion() { $version = new Version(); - static::assertInstanceOf(IVersion::class, $version); + $this->assertInstanceOf(IVersion::class, $version); $version->register(new GitVersion($this->tempDir)); $version->register(new FileVersion($this->tempDir.'/commit.json')); - static::assertSame('9c9e437', $version->getCommit()); - static::assertTrue($version->exists()); - static::assertSame('master', $version->getBranch()); + $this->assertSame('9c9e437', $version->getCommit()); + $this->assertTrue($version->exists()); + $this->assertSame('master', $version->getBranch()); $actual = (string)json_encode($version); $expected = (string)json_encode([ 'branch' => 'master', 'commit' => '9c9e437' ]); - static::assertJsonStringEqualsJsonString($expected, $actual); + $this->assertJsonStringEqualsJsonString($expected, $actual); } } From 8290d9fe9572e39da84a28dea5aac62e1eef31fe Mon Sep 17 00:00:00 2001 From: Martin Mitterhauser Date: Mon, 11 Mar 2024 15:15:13 +0100 Subject: [PATCH 11/11] test php 8.3 as well --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bcd56d0..aa00f85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php_version: [ 7.4, 8.0, 8.1, 8.2 ] + php_version: [ 7.4, 8.0, 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6 @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php_version: [ 7.4, 8.0, 8.1, 8.2 ] + php_version: [ 7.4, 8.0, 8.1, 8.2, 8.3 ] steps: - uses: actions/checkout@v3 - uses: php-actions/composer@v6