phpcpd
is a Copy/Paste Detector (CPD) for PHP code.
- PHP version 8.1 or later
Download the latest version on our web-site download and put phar archive into your project.
Note: This tool is distributed as a PHP Archive (PHAR).
$ php phpcpd.phar --fuzzy src tests
7.0.1
Found 1 code clones with 19 duplicated lines in 1 files:
- /var/www/html/src/User/Transport/Controller/Api/v1/User/DetachUserGroupController.php:99-118 (19 lines)
/var/www/html/src/User/Transport/Controller/Api/v1/User/DetachUserGroupController.php:106-125
0.06% duplicated lines out of 30223 total lines of code.
Average code clone size is 19 lines, the largest code clone has 19 lines
Time: 00:00.197, Memory: 8.00 MB
- Docker version 18.06 or later
- Docker compose version 1.22 or later
- An editor or IDE
Note: OS recommendation - Linux Ubuntu based.
- PHP 8.3 fpm
- Composer 2
- Phive 0.15
- Phing 2.17
1.For installing Docker please follow steps mentioned on page install on Ubuntu linux or install on Mac/Windows.
2.For installing docker-compose as Linux Standalone binary
please follow steps on the page install compose if you are using Linux OS.
Note 1: Please run next cmd after above step 2 if you are using Linux OS: sudo usermod -aG docker $USER
Note 2: If you are using Docker Desktop for MacOS 12.2 or later - please enable virtiofs for performance (enabled by default since Docker Desktop v4.22).
1.Clone this repository from GitHub.
2.Edit and set XDEBUG_CONFIG=
inside .env
file (optional, by default XDEBUG_CONFIG=main
).
3.Configure /docker/dev/xdebug-main.ini
(Linux/Windows) or /docker/dev/xdebug-osx.ini
(MacOS) (optional).
4.Build, start and install the docker images from your terminal:
make build-dev
make start
make setup
After application will start (make start
) and in order to get shell access inside php container you can run following command:
make ssh
Note: Please use exit
command in order to return from container's shell to local shell.
In case you edited Dockerfile or other environment configuration you'll need to build container again using next commands:
make down
make build-dev
make start
Please use next make commands in order to start and stop environment:
make start
make stop
Please use next make commands in order to stop and remove environment containers, networks:
make down
make build-dev
make start
make stop
make down
make restart
make ssh
make ssh-root
make setup
make update-tools
make info
make help
make phar
make signed-phar
make phpunit
make logs
etc....
Notes: Please see more commands in Makefile
- For new feature development, fork
develop
branch into a new branch with one of the two patterns:feature/{ticketNo}
- Commit often, and write descriptive commit messages, so its easier to follow steps taken when reviewing.
- Push this branch to the repo and create pull request into
develop
to get feedback, with the formatfeature/{ticketNo}
- "Short descriptive title of Jira task". - Iterate as needed.
- Make sure that "All checks have passed" on CircleCI(or another one in case you are not using CircleCI) and status is green.
- When PR is approved, it will be squashed & merged, into
develop
and later merged intorelease/{No}
for deployment.
Note: You can find git flow detail example here.