From 677773d3b0f27687ddd9e07b2abbf0864994d1a6 Mon Sep 17 00:00:00 2001 From: Olivier Laviale Date: Fri, 15 Nov 2024 23:45:27 +0100 Subject: [PATCH] Update boilerplate --- .github/workflows/static-analysis.yml | 6 +++--- .github/workflows/test.yml | 5 +---- .scrutinizer.yml | 13 ------------ MIGRATION.md => CHANGELOG.md | 0 LICENSE | 2 +- README.md | 30 +++++++-------------------- composer.json | 4 ++-- lib/Prototype.php | 9 +++++--- phpstan.neon | 5 +---- phpunit.xml | 1 - tests/PrototypedCases/SampleD.php | 2 -- 11 files changed, 21 insertions(+), 56 deletions(-) delete mode 100644 .scrutinizer.yml rename MIGRATION.md => CHANGELOG.md (100%) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 3b5da94..37f6f81 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -7,10 +7,10 @@ on: jobs: phpstan: name: phpstan - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 with: @@ -18,7 +18,7 @@ jobs: ini-values: memory_limit=-1 tools: composer:v2 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.composer/cache diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1054ea8..a8ab07f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,9 +10,6 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dependencies: - - lowest - - highest php-version: - "8.1" - "8.2" @@ -37,7 +34,7 @@ jobs: restore-keys: "php-${{ matrix.php-version }}" - name: Install dependencies - run: composer install --no-interaction --no-progress + run: composer update --no-interaction --no-progress - name: Run PHPUnit run: make test-coveralls diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 8870564..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,13 +0,0 @@ -build: - nodes: - analysis: - tests: - override: - - php-scrutinizer-run - image: default-bionic - environment: - php: - version: "8.1" -filter: - excluded_paths: - - 'tests/*' diff --git a/MIGRATION.md b/CHANGELOG.md similarity index 100% rename from MIGRATION.md rename to CHANGELOG.md diff --git a/LICENSE b/LICENSE index 2c54ca3..2c5ce8c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ The icanboogie/prototype package is free software. It is released under the terms of the following BSD License. -Copyright (c) 2007-2023 by Olivier Laviale +Copyright (c) 2007 by Olivier Laviale All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/README.md b/README.md index fe723fc..98d0153 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Prototype [![Release](https://img.shields.io/packagist/v/ICanBoogie/Prototype.svg)](https://packagist.org/packages/icanboogie/prototype) -[![Code Quality](https://img.shields.io/scrutinizer/g/ICanBoogie/Prototype.svg)](https://scrutinizer-ci.com/g/ICanBoogie/Prototype) -[![Code Coverage](https://img.shields.io/coveralls/ICanBoogie/Prototype.svg)](https://coveralls.io/r/ICanBoogie/Prototype) +[![Code Coverage](https://coveralls.io/repos/github/ICanBoogie/Prototype/badge.svg?branch=6.0)](https://coveralls.io/r/ICanBoogie/Prototype?branch=6.0) [![Downloads](https://img.shields.io/packagist/dt/icanboogie/prototype.svg)](https://packagist.org/packages/icanboogie/prototype) The **icanboogie/prototype** package allows methods of classes using the [PrototypeTrait][] to be @@ -12,15 +11,7 @@ getters and setters. #### Installation -```bash -composer require icanboogie/prototype -``` - - - -#### Installation - -```bash +```shell composer require icanboogie/prototype ``` @@ -374,29 +365,22 @@ The following exceptions are defined: The project is continuously tested by [GitHub actions](https://github.com/ICanBoogie/Prototype/actions). -[![Tests](https://github.com/ICanBoogie/Prototype/workflows/test/badge.svg)](https://github.com/ICanBoogie/Prototype/actions?query=workflow%3Atest) -[![Static Analysis](https://github.com/ICanBoogie/Prototype/workflows/static-analysis/badge.svg)](https://github.com/ICanBoogie/Prototype/actions?query=workflow%3Astatic-analysis) -[![Code Style](https://github.com/ICanBoogie/Prototype/workflows/code-style/badge.svg)](https://github.com/ICanBoogie/Prototype/actions?query=workflow%3Acode-style) +[![Tests](https://github.com/ICanBoogie/Prototype/actions/workflows/test.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/Prototype/actions/workflows/test.yml) +[![Static Analysis](https://github.com/ICanBoogie/Prototype/actions/workflows/static-analysis.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/Prototype/actions/workflows/static-analysis.yml) +[![Code Style](https://github.com/ICanBoogie/Prototype/actions/workflows/code-style.yml/badge.svg?branch=6.0)](https://github.com/ICanBoogie/Prototype/actions/workflows/code-style.yml) -## Code of Conduct -This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in -this project and its community, you are expected to uphold this code. ## Code of Conduct This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in -this project and its community, you are expected to uphold this code. +this project and its community, you're expected to uphold this code. ## Contributing -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - -## License - -**icanboogie/prototype** is released under the [BSD-3-Clause](LICENSE). +See [CONTRIBUTING](CONTRIBUTING.md) for details. diff --git a/composer.json b/composer.json index 111bc7f..b66e8a4 100644 --- a/composer.json +++ b/composer.json @@ -33,8 +33,8 @@ "icanboogie/accessor": "^6.0" }, "require-dev": { - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^10.0" + "phpstan/phpstan": "^1.12", + "phpunit/phpunit": "^10.5" }, "autoload": { "psr-4": { diff --git a/lib/Prototype.php b/lib/Prototype.php index 597eb92..30a7318 100644 --- a/lib/Prototype.php +++ b/lib/Prototype.php @@ -230,7 +230,8 @@ private function revoke_consolidated_methods(): void * * @param callable $value */ - #[ReturnTypeWillChange]public function offsetSet(mixed $offset, mixed $value): void + #[ReturnTypeWillChange] + public function offsetSet(mixed $offset, mixed $value): void { self::$prototypes[$this->class]->methods[$offset] = $value; @@ -242,7 +243,8 @@ private function revoke_consolidated_methods(): void * * @param string $offset The name of the method. */ - #[ReturnTypeWillChange]public function offsetUnset(mixed $offset): void + #[ReturnTypeWillChange] + public function offsetUnset(mixed $offset): void { unset(self::$prototypes[$this->class]->methods[$offset]); @@ -254,7 +256,8 @@ private function revoke_consolidated_methods(): void * * @param string $offset The name of the method. */ - #[ReturnTypeWillChange]public function offsetExists(mixed $offset): bool + #[ReturnTypeWillChange] + public function offsetExists(mixed $offset): bool { $methods = $this->consolidated_methods ??= $this->consolidate_methods(); diff --git a/phpstan.neon b/phpstan.neon index 471eef8..af1dfc6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,7 +3,4 @@ parameters: paths: - lib excludePaths: - - tests/sandbox/* - ignoreErrors: - - '#get_.*is unused#' - - '#Method ICanBoogie\\Prototyped::__call#' + - tests/sandbox/* diff --git a/phpunit.xml b/phpunit.xml index cc0a854..885d725 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,7 +8,6 @@ displayDetailsOnTestsThatTriggerDeprecations="true" executionOrder="depends,defects" > - tests diff --git a/tests/PrototypedCases/SampleD.php b/tests/PrototypedCases/SampleD.php index 158d72b..ffeee5a 100644 --- a/tests/PrototypedCases/SampleD.php +++ b/tests/PrototypedCases/SampleD.php @@ -11,10 +11,8 @@ namespace Test\ICanBoogie\PrototypedCases; -use AllowDynamicProperties; use ICanBoogie\Prototyped; -#[AllowDynamicProperties] class SampleD extends Prototyped { public $a;