diff --git a/.codeclimate.yml b/.codeclimate.yml index caa9009..25d8ed0 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,21 +1,21 @@ version: "2" checks: argument-count: - enabled: true + enabled: false complex-logic: - enabled: true + enabled: false file-lines: enabled: false method-complexity: - enabled: true + enabled: false method-count: - enabled: true + enabled: false method-lines: - enabled: true + enabled: false nested-control-flow: enabled: true return-statements: - enabled: true + enabled: false similar-code: enabled: false identical-code: diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bf8e63d..86e5b24 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,7 +19,7 @@ jobs: validate: name: "Validate Project" - uses: "mimmi20/ci/.github/workflows/validate.yml@8.1" + uses: "mimmi20/ci/.github/workflows/validate.yml@8.3" with: extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter" ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0" @@ -37,7 +37,7 @@ jobs: needs: "validate" - uses: "mimmi20/ci/.github/workflows/install.yml@8.1" + uses: "mimmi20/ci/.github/workflows/install.yml@8.3" with: extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter" ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0" @@ -50,7 +50,7 @@ jobs: needs: "install" - uses: "mimmi20/ci/.github/workflows/analytics.yml@8.1" + uses: "mimmi20/ci/.github/workflows/analytics.yml@8.3" with: extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter" ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0" @@ -59,7 +59,7 @@ jobs: skip-phpcs: false skip-phpstan: false skip-rector: false - skip-phpmd: false + skip-phpmd: true skip-eslint: true skip-stylelint: true skip-prettier: true @@ -70,7 +70,7 @@ jobs: needs: "analytics" - uses: "mimmi20/ci/.github/workflows/test.yml@8.1" + uses: "mimmi20/ci/.github/workflows/test.yml@8.3" with: extensions: "ctype, dom, fileinfo, intl, simplexml, tokenizer, xml, xmlwriter" ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0" diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 13a82d2..54eb08f 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -11,10 +11,12 @@ declare(strict_types = 1); -$header = <<<'EOF' +$year = date('Y'); + +$header = << + Copyright (c) 2022-{$year}, Thomas Mueller For the full copyright and license information, please view the LICENSE file that was distributed with this source code. diff --git a/codecov.yml b/codecov.yml index 65d180e..9c924a4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,12 +2,16 @@ codecov: require_ci_to_pass: false notify: wait_for_ci: false + +coverage: status: project: - default: + default: # default is the status check's name, not default settings target: 100% threshold: 1% + if_ci_failed: success #success, failure, error, ignore informational: true + only_pulls: false patch: default: informational: true diff --git a/composer.json b/composer.json index 84f484d..3f9eb34 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "source": "https://github.com/mimmi20/contact" }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" + "php": "~8.3.0 || ~8.4.0 || ~8.5.0" }, "require-dev": { "ext-ctype": "*", @@ -30,16 +30,16 @@ "ext-xml": "*", "ext-xmlwriter": "*", "infection/infection": "^0.29.8", - "mimmi20/coding-standard": "^5.2.45", + "mimmi20/coding-standard": "^6.0.1", "nikic/php-parser": "^5.3.1", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan": "^1.12.9", "phpstan/phpstan-deprecation-rules": "^1.2.1", "phpstan/phpstan-phpunit": "^1.4.0", - "phpunit/phpunit": "^10.5.26", + "phpunit/phpunit": "^11.4.4", "rector/rector": "^1.2.10", "rector/type-perfect": "^1.0.0", - "symfony/process": "^6.4.15", + "symfony/process": "^7.2.0", "symplify/phpstan-rules": "^13.0.1", "tomasvotruba/cognitive-complexity": "^0.2.3", "tomasvotruba/type-coverage": "^1.0.0", diff --git a/phpmd.ruleset.xml b/phpmd.ruleset.xml deleted file mode 100644 index 15d9ade..0000000 --- a/phpmd.ruleset.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - The coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/phpstan.neon b/phpstan.neon index 4451c93..c153400 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,8 @@ parameters: level: max + phpVersion: 80300 # PHP 8.3 + parallel: maximumNumberOfProcesses: 1 processTimeout: 200.0 @@ -99,9 +101,10 @@ parameters: function: 1 type_coverage: - return: 100 - param: 100 - property: 100 + return_type: 100 + param_type: 100 + property_type: 100 + constant_type: 100 # also, how many files has declare strict types declare: 100 diff --git a/phpunit.xml b/phpunit.xml index 90810cf..f88f828 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -9,12 +9,14 @@ beStrictAboutCoverageMetadata="false" beStrictAboutOutputDuringTests="true" beStrictAboutTestsThatDoNotTestAnything="true" + displayDetailsOnPhpunitDeprecations="true" displayDetailsOnTestsThatTriggerWarnings="true" displayDetailsOnTestsThatTriggerNotices="true" displayDetailsOnTestsThatTriggerErrors="true" displayDetailsOnTestsThatTriggerDeprecations="true" displayDetailsOnSkippedTests="true" displayDetailsOnIncompleteTests="true" + failOnPhpunitDeprecation="true" failOnEmptyTestSuite="true" failOnIncomplete="true" failOnRisky="true" @@ -51,7 +53,7 @@ - + diff --git a/rector.php b/rector.php index c3aaf36..2925814 100644 --- a/rector.php +++ b/rector.php @@ -29,7 +29,7 @@ $rectorConfig->sets([ SetList::DEAD_CODE, - LevelSetList::UP_TO_PHP_81, + LevelSetList::UP_TO_PHP_83, PHPUnitSetList::PHPUNIT_100, ]); diff --git a/src/Contact.php b/src/Contact.php index ba420bd..af4bd11 100644 --- a/src/Contact.php +++ b/src/Contact.php @@ -14,6 +14,7 @@ namespace Mimmi20\Contact; use DateTimeInterface; +use Override; final class Contact implements ContactInterface { @@ -31,144 +32,168 @@ final class Contact implements ContactInterface private string | null $profession = null; /** @throws void */ + #[Override] public function getContactId(): int | null { return $this->contactId; } /** @throws void */ + #[Override] public function setContactId(int | null $value): void { $this->contactId = $value; } /** @throws void */ + #[Override] public function getSalutation(): string | null { return $this->salutation; } /** @throws void */ + #[Override] public function setSalutation(string | null $value): void { $this->salutation = $value; } /** @throws void */ + #[Override] public function getFirstname(): string | null { return $this->firstname; } /** @throws void */ + #[Override] public function setFirstname(string | null $value): void { $this->firstname = $value; } /** @throws void */ + #[Override] public function getFamilyname(): string | null { return $this->familyname; } /** @throws void */ + #[Override] public function setFamilyname(string | null $value): void { $this->familyname = $value; } /** @throws void */ + #[Override] public function getStreet(): string | null { return $this->street; } /** @throws void */ + #[Override] public function setStreet(string | null $value): void { $this->street = $value; } /** @throws void */ + #[Override] public function getHousenumber(): string | null { return $this->housenumber; } /** @throws void */ + #[Override] public function setHousenumber(string | null $value): void { $this->housenumber = $value; } /** @throws void */ + #[Override] public function getPostalcode(): string | null { return $this->postalcode; } /** @throws void */ + #[Override] public function setPostalcode(string | null $value): void { $this->postalcode = $value; } /** @throws void */ + #[Override] public function getCity(): string | null { return $this->city; } /** @throws void */ + #[Override] public function setCity(string | null $value): void { $this->city = $value; } /** @throws void */ + #[Override] public function getBirthdate(): DateTimeInterface | null { return $this->birthdate; } /** @throws void */ + #[Override] public function setBirthdate(DateTimeInterface | null $value): void { $this->birthdate = $value; } /** @throws void */ + #[Override] public function getPhonenumber(): string | null { return $this->phonenumber; } /** @throws void */ + #[Override] public function setPhonenumber(string | null $value): void { $this->phonenumber = $value; } /** @throws void */ + #[Override] public function getEmail(): string | null { return $this->email; } /** @throws void */ + #[Override] public function setEmail(string | null $value): void { $this->email = $value; } /** @throws void */ + #[Override] public function getProfession(): string | null { return $this->profession; } /** @throws void */ + #[Override] public function setProfession(string | null $value): void { $this->profession = $value; @@ -180,6 +205,7 @@ public function setProfession(string | null $value): void * * @throws void */ + #[Override] public function toArray(): array { $birthdate = $this->getBirthdate(); diff --git a/tests/ContactTest.php b/tests/ContactTest.php index f97f3f6..f16b651 100644 --- a/tests/ContactTest.php +++ b/tests/ContactTest.php @@ -15,6 +15,7 @@ use DateTimeImmutable; use Exception; +use Override; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; @@ -23,6 +24,7 @@ final class ContactTest extends TestCase private Contact $object; /** @throws void */ + #[Override] protected function setUp(): void { $this->object = new Contact();