Skip to content

vukanac/ci-base-php

Repository files navigation

Project: CI Base PHP with TravisCI

Build Status Coverage Status - codecov Coverage Status - coveralls Analysis - CodeFactor

Description

CI with PHP and TravisCI

Code is hosted on GitHub and tests are run on TravisCI on every push to master branch.

The code coverage reports are uploaded to codecov.io.

This is base set of tools that help writing PHP code.

They are not obligatory but they are great help!

Test and Development

Infection

Install:

composer global require infection/infection

or

brew install infection

Run:

infection

PHP CS/CBF/CPD tools

They will help you to write code with consistent style (quotation, indentation, unused variable, ...).

  • phpcs
  • phpcbf
  • phpcpd

PHPstan

The PHP Static Analysis tool.

$ vendor/bin/phpstan analyse src tests

Added strict rules with:

PHP psalm

composer require --dev vimeo/psalm
./vendor/bin/psalm --init
./vendor/bin/psalm

Ceveralls (with php)

composer require --dev php-coveralls/php-coveralls
pecl install xdebug
./vendor/bin/phpunit

The best use

Install plugins to Sublime Text 3:

  • SublimeLinter
  • SublimeLinter-phpcs
  • SublimeLinter-phpcs-formatter

Optional:

  • DocBlockr
  • FileManager
  • GitGutter
  • Pretty JSON
  • SublimeLinter-annotations

Install

git clone https://github.com/vukanac/ci-base-php.git phpstarter
cd phpstarter
composer install

Start dev

composer test

or

composer ci

Watching for changes: ./vendor/bin/phpunit-watcher --watch

Test

composer test
./vendor/bin/phpunit

License

MIT

FOSSA Status

Vladimir Vukanac