Skip to content

Commit

Permalink
deprecates integration with PHP Copy/Paste Detector (PHPCPD) library.
Browse files Browse the repository at this point in the history
  • Loading branch information
stopfstedt authored and stronk7 committed Feb 4, 2024
1 parent 0aef673 commit 9cd446f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 6 deletions.
12 changes: 10 additions & 2 deletions docs/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ title: Moodle Plugin CI Commands
* [`mustache`](#mustache)
* [`parallel`](#parallel)
* [`phpcbf`](#phpcbf)
* [`phpcpd`](#phpcpd)
* [`phpcpd` (DEPRECATED)](#phpcpd)
* [`phpcs`](#phpcs)
* [`phpdoc`](#phpdoc)
* [`phplint`](#phplint)
Expand Down Expand Up @@ -1485,7 +1485,15 @@ Do not ask any interactive question
`phpcpd`
--------

Run PHP Copy/Paste Detector on a plugin
Run PHP Copy/Paste Detector on a plugin.

### Deprecation Notice

[PHP Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd) has been abandoned by its maintainers.

The integration with it will be removed without replacement from future versions of this plugin.

_Usage of the `phpcpd` command is discouraged._

### Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/GHAFileExplained.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ jobs:
if: ${{ !cancelled() }} # prevents CI run stopping if step failed.
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
- name: PHP Copy/Paste Detector # DEPRECATED
continue-on-error: true # This step will show errors but will not fail
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpcpd
Expand Down
2 changes: 1 addition & 1 deletion docs/Help.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ inclide in the CI scenario. For detailed information, see [CLI commands and opti

This step lints your PHP files to check for syntax errors.

**moodle-plugin-ci phpcpd**
**moodle-plugin-ci phpcpd (DEPRECATED)**

This step runs the PHP Copy/Paste Detector on your plugin. This helps to find
code duplication.
Expand Down
1 change: 1 addition & 0 deletions docs/TravisFileExplained.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ script:
- moodle-plugin-ci phplint
# This step runs the PHP Copy/Paste Detector on your plugin.
# This helps to find code duplication.
# (DEPRECATED)
- moodle-plugin-ci phpcpd
# This step runs the PHP Mess Detector on your plugin. This helps to find
# potential problems with your code which can result in
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This project supports the following testing frameworks and code analysis tools:
* [Mustache Linting](https://docs.moodle.org/dev/Templates)
* [Grunt tasks](https://docs.moodle.org/dev/Grunt)
* [PHP Linting](https://github.com/JakubOnderka/PHP-Parallel-Lint)
* [PHP Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd)
* [PHP Copy/Paste Detector (DEPRECATED)](https://github.com/sebastianbergmann/phpcpd)
* [PHP Mess Detector](http://phpmd.org)

## Requirements
Expand Down
4 changes: 3 additions & 1 deletion src/Command/CopyPasteDetectorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

/**
* Run PHP Copy/Paste Detector on a plugin.
*
* @deprecated
*/
class CopyPasteDetectorCommand extends AbstractPluginCommand
{
Expand All @@ -31,7 +33,7 @@ protected function configure(): void
parent::configure();

$this->setName('phpcpd')
->setDescription('Run PHP Copy/Paste Detector on a plugin');
->setDescription('Run PHP Copy/Paste Detector on a plugin (DEPRECATED)');
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down

0 comments on commit 9cd446f

Please sign in to comment.