diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..87f9962 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,12 @@ +| Q | A +| ------------------| --------------- +| JsonClass version | x.y.z +| PHP version | x.y.z + + + diff --git a/.github/lock.yml b/.github/lock.yml new file mode 100644 index 0000000..d3604ae --- /dev/null +++ b/.github/lock.yml @@ -0,0 +1,38 @@ +# Configuration for lock-threads - https://github.com/dessant/lock-threads + +# Number of days of inactivity before a closed issue or pull request is locked +daysUntilLock: 365 + +# Skip issues and pull requests created before a given timestamp. Timestamp must +# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable +skipCreatedBefore: false + +# Issues and pull requests with these labels will not be locked. Set to `[]` to disable +exemptLabels: [] + +# Label to add before locking, such as `outdated`. Set to `false` to disable +lockLabel: false + +# Comment to post before locking. Set to `false` to disable +lockComment: > + This thread has been automatically locked since there has not been + any recent activity after it was closed. Please open a new issue for + related bugs. + +# Assign `resolved` as the reason for locking. Set to `false` to disable +setLockReason: true + +# Limit to only `issues` or `pulls` +# only: issues + +# Optionally, specify configuration settings just for `issues` or `pulls` +# issues: +# exemptLabels: +# - help-wanted +# lockLabel: outdated + +# pulls: +# daysUntilLock: 30 + +# Repository to extend settings from +# _extends: repo diff --git a/.github/reaction.yml b/.github/reaction.yml new file mode 100644 index 0000000..f21810b --- /dev/null +++ b/.github/reaction.yml @@ -0,0 +1,25 @@ +# Configuration for reaction-comments - https://github.com/dessant/reaction-comments + +# Issues and pull requests with these labels accept reaction comments. +# Set to `[]` to disable +exemptLabels: [] + +# Replace matching comments with this message, `{comment-author}` is an +# optional placeholder. Set to `false` to disable +reactionComment: > + :wave: @{comment-author}, did you mean to use + a [reaction](https://git.io/vhzhC) instead? + +# Limit to only `issues` or `pulls` +# only: issues + +# Optionally, specify configuration settings just for `issues` or `pulls` +# issues: +# exemptLabels: +# - party-parrot + +# pulls: +# reactionComment: false + +# Repository to extend settings from +# _extends: repo diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..b3efadf --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,13 @@ +name-template: v$NEXT_PATCH_VERSION +categories: + - title: Features + label: feature + - title: Bug Fixes + label: bug + - title: Maintenance + label: maintenance +tag-template: - $TITLE @$AUTHOR (#$NUMBER) +template: | + ## Changes + + $CHANGES diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..dc90e5a --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/tests_checker.yml b/.github/tests_checker.yml new file mode 100644 index 0000000..3f8db6f --- /dev/null +++ b/.github/tests_checker.yml @@ -0,0 +1,3 @@ +comment: 'Could you please add tests to make sure this change works as expected?', +fileExtensions: ['.php'] +testDir: 'tests' diff --git a/composer.json b/composer.json index d1be1ac..198bece 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.13", "localheinz/composer-normalize": "^1.0.0", - "localheinz/phpstan-rules": "^0.4", + "localheinz/phpstan-rules": "^0.4 || ^0.5", "pepakriz/phpstan-exception-rules": "^0.3 || ^0.4", "phpstan/phpstan": "^0.10", "phpstan/phpstan-deprecation-rules": "^0.10", diff --git a/tests/JsonTest.php b/tests/JsonTest.php index 32eb225..954ac04 100644 --- a/tests/JsonTest.php +++ b/tests/JsonTest.php @@ -63,7 +63,7 @@ public function testDecode(): void */ public function testEncodeFail(): void { - $f = fopen(__FILE__, 'rb'); + $f = fopen(__FILE__, 'r'); $this->expectException(EncodeErrorException::class); $this->expectExceptionMessage('Type is not supported');