-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1060 from phpmd/3.x-update
Reset 3.x to current master state
- Loading branch information
Showing
486 changed files
with
18,002 additions
and
3,254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tidelift: "packagist/phpmd/phpmd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
name: "Bug" | ||
about: 'Report a problem with PHPMD' | ||
--- | ||
|
||
- PHPMD version: #.#.# | ||
- PHP Version: #.#.# | ||
- Installation type: (phar file/ composer) | ||
- Operating System / Distribution & Version: (Windows 10 / CentOS 7.6 / ...) | ||
|
||
### Current Behavior | ||
Explain the result that you get. | ||
|
||
### Expected Behavior | ||
Explain the result that you expected. | ||
|
||
### Steps To Reproduce: | ||
Explain **all** the steps you did to create this bug so we can reproduce it. | ||
|
||
## Checks before submitting | ||
* [ ] Be sure that there isn't already an issue about this. See: [Issues list](https://github.com/phpmd/phpmd/issues) | ||
* [ ] Be sure that there isn't already a pull request about this. See: [Pull requests](https://github.com/phpmd/phpmd/pulls) | ||
* [ ] I have added every step to reproduce the bug. | ||
* [ ] If possible I added relevant code examples. | ||
* [ ] This issue is about 1 bug and nothing more. | ||
* [ ] The issue has a descriptive title. For example: "JSON rendering failed on Windows for filenames with space". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: "Feature Proposal" | ||
about: 'Propose a new feature' | ||
|
||
--- | ||
|
||
## Description | ||
Describe the proposal, explain what it does and why. | ||
Try to describe the benefits but also the consequences of the proposal. | ||
|
||
## Checks before submitting | ||
* [ ] Be sure that there isn't already an issue about this. See: [Issues list](https://github.com/phpmd/phpmd/issues) | ||
* [ ] Be sure that there isn't already a pull request about this. See: [Pull requests](https://github.com/phpmd/phpmd/pulls) | ||
* [ ] Tell if you have the option to provide the code for this proposal. | ||
* [ ] This issue is about 1 feature proposal and nothing more. | ||
* [ ] The issue has a descriptive title. For example: "Add JSON render option". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
name: "Question" | ||
about: 'This repository is for bugs and feature proposals only. If you have any question please visit or community on Gitter to ask the questions: https://gitter.im/phpmd/community' | ||
--- | ||
|
||
This repository is only for bugs and feature proposals. | ||
|
||
If you have any question or need support please visit our Gitter channel: https://gitter.im/phpmd/community | ||
|
||
Thank you! |
16 changes: 16 additions & 0 deletions
16
.github/ISSUE_TEMPLATE/4_Documentation_and_Website_Issue.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: "Documentation & Website Issue" | ||
about: 'Do you see something incorrect or do you miss some information in the documentation or the website. Tell us.' | ||
--- | ||
|
||
## Description | ||
Describe what you miss or is incorrect on the [website](https://phpmd.org/) or in the documentation. Be as explicit as possible. | ||
If possible add a URL to the incorrect web page/documentation. | ||
|
||
|
||
## Checks before submitting | ||
* [ ] Be sure that there isn't already an issue about this. See: [Issues list](https://github.com/phpmd/phpmd/issues) | ||
* [ ] Be sure that there isn't already a pull request about this. See: [Pull requests](https://github.com/phpmd/phpmd/pulls) | ||
* [ ] Tell if you have the possibility to create a Pull Request to solve this issue. | ||
* [ ] If possible add a URL to the incorrect website page or documentation file. | ||
* [ ] This issue is about 1 documentation or website issue and nothing more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: Gitter | ||
url: https://gitter.im/phpmd/community | ||
about: Chat with us on Gitter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Type: (bugfix / feature / refactoring / documentation update) | ||
Issue: Resolves #.. the corresponding issue for this PR (if exist) | ||
Breaking change: yes/no (if yes explain why) | ||
|
||
<!-- | ||
Explain what the PR does and also why. If you have parts you are not sure about, please explain. | ||
Please check this points before submitting your PR. | ||
- Add test to cover the changes you made on the code. | ||
- If you have a change on the documentation, please link to the page that you change. | ||
- If you add a new feature please update the documentation in the same PR. | ||
- If you really need to add a breaking change, explain why it is needed. Understand that this result in a lower change to get the PR accepted. | ||
- Any PR need 2 approvals before it get merged, sometimes this can take some time. Please be patient. | ||
## Adding a New Rule | ||
- Add the new rule to the matching rule set XML, e.g. ``src/main/resources/rulesets/naming.xml`` | ||
- Add documentation for the new rule, e.g. ``src/site/rst/rules/naming.rst`` | ||
- Implement the new rule, e.g. ``src/main/php/PHPMD/Rule/Naming/LongVariable.php`` | ||
- Cover cases for the new rule in the rule test, e.g. ``src/test/php/PHPMD/Rule/Naming/LongVariableTest.php`` | ||
-- Cover the case when the new rule *should* apply | ||
-- Cover the case when the new rule *should not* apply | ||
-- Cover edge cases of the new rule | ||
## Adding a New Rule Property | ||
- Add the new property to rule set XML, e.g. ``src/main/resources/rulesets/naming.xml`` | ||
- Add documentation for the new property, e.g. ``src/site/rst/rules/naming.rst`` | ||
- Implement new property in rule, e.g. ``src/main/php/PHPMD/Rule/Naming/LongVariable.php`` | ||
- Cover cases for the new property in rule test, e.g. ``src/test/php/PHPMD/Rule/Naming/LongVariableTest.php`` | ||
-- Cover the case when the new property is not set and the rule *should not* apply | ||
-- Cover the case when the new property is not set and the rule *should* apply | ||
-- Cover case when the new property is set and the rule *should not* apply | ||
-- Cover case when the new property is set and the rule *should* apply | ||
-- Cover edge cases of the new property, if any | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## Security contact information | ||
|
||
To report a security vulnerability, please use the | ||
[Tidelift security contact](https://tidelift.com/security). | ||
Tidelift will coordinate the fix and disclosure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Build website | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
php-tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
env: | ||
COMPOSER_NO_INTERACTION: 1 | ||
|
||
strategy: | ||
matrix: | ||
php: [7.4] | ||
dependency-version: [prefer-stable] | ||
|
||
name: Build website | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
tools: composer:v2 | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }} | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Copy files | ||
run: cp src/site/rst/* src/site/resources/web/ -r | ||
|
||
- name: Build website | ||
run: composer build-website | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CNAME: phpmd.org | ||
|
||
- name: Archive generated website | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Website | ||
path: dist/website/* | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist/website/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Codestyle | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
paths: | ||
- '**.php' | ||
- 'composer.json' | ||
- 'phpcs.xml.dist' | ||
- '.github/workflows/codestyle.yml' | ||
pull_request: | ||
branches: | ||
- "*" | ||
paths: | ||
- '**.php' | ||
- 'composer.json' | ||
- 'phpcs.xml.dist' | ||
- '.github/workflows/codestyle.yml' | ||
|
||
jobs: | ||
php-tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
env: | ||
COMPOSER_NO_INTERACTION: 1 | ||
|
||
strategy: | ||
matrix: | ||
php: [7.4] | ||
dependency-version: [prefer-stable] | ||
|
||
name: Codestyle check | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: none | ||
tools: composer:v2 | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }} | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Run PHPCS for the codestyle | ||
run: vendor/bin/phpcs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
php-tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
env: | ||
COMPOSER_NO_INTERACTION: 1 | ||
|
||
strategy: | ||
matrix: | ||
php: [8.3] | ||
dependency-version: [prefer-stable] | ||
|
||
name: PHP ${{ matrix.php }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
coverage: xdebug | ||
|
||
- name: Cache library packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-coverage-${{ matrix.php }}-${{ hashFiles('composer.json') }} | ||
restore-keys: ${{ runner.os }}-coverage-${{ matrix.php }}- | ||
|
||
- name: Cache test packages | ||
id: composer-test-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: src/test/vendor | ||
key: ${{ runner.os }}-coverage-test-${{ matrix.php }}-${{ hashFiles('src/test/composer.json') }} | ||
restore-keys: ${{ runner.os }}-coverage-test-${{ matrix.php }}- | ||
|
||
- name: Upgrade PHPUnit | ||
run: | | ||
composer require symfony/config:^6.4 --no-update --no-interaction --dev | ||
cd src/test && composer require phpunit/phpunit:^5.7.27 --no-update --no-interaction --dev | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer update --no-progress --prefer-stable --prefer-dist --no-progress --ignore-platform-req=php+ | ||
|
||
- name: Install test dependencies | ||
if: steps.composer-test-cache.outputs.cache-hit != 'true' | ||
run: cd src/test && composer update --no-progress --prefer-dist --prefer-stable --ignore-platform-req=php+ | ||
|
||
- name: Fix PHP compatibility | ||
run: php src/test/php/fix-php-compatibility.php | ||
|
||
- name: Execute Unit Tests | ||
run: src/test/vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml | ||
|
||
- name: Archive code coverage results | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml |
Oops, something went wrong.