How to add bitbucket-pipelines.yml?

Create bitbucket-pipelines.yml file in the root folder with this code, and commit to your Bitbucket repository. Please note that the parameters given here are only for reference. You can (in fact you should) change them according to your environment.

image: php:7.2.0

pipelines:
  default:
    - step:
        caches:
          - composer
        script:
          - apt-get update -qq && apt-get install -yqq unzip git
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer install --prefer-dist --no-scripts
          - mkdir ./test-reports
          - vendor/bin/phpcs --report=junit --report-file=./test-reports/phpcs.xml
          - vendor/bin/phpunit