diff --git a/.travis.yml b/.travis.yml index dbf043b..f509687 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: php php: - - '5.6' - - '7.0' - '7.1' + - '7.2' + script: - composer validate - composer update diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c20406..0cd35ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,53 @@ this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -**6** version series are last series to support both PHP **5.6** and **PHP 7**. - -## 6.4.1 / 2017-04-08 +## 7.2.0 / 2018-04-14 + +- PHP requirement has been updated from `^7.0` to `^7.1` +- `sami/sami` package updated from `~3.2||~4.0` to `~4.0` +- `symfony/var-dumper` package updated from `~2.8||^3.2` to `^3.2||~4.0` +- `sebastian/phpcpd` updated from `~3.0` to `~4.0` +- `phpunit/phpunit` updated from `~6.0||~7.0` to `~7.0` +- `nelmio/alice` updated from `~3.0` to `^3.2` +- `behat/mink-extension` updated to `~2.3` +- `phpstan/phpstan` update from `~0.8` to `~0.9` +- `leaphub/phpcs-symfony2-standard` replaced with + `escapestudios/symfony2-coding-standard` +- `leanphp/phpspec-code-coverage` update to `^4.2` + +## 7.1.1 / 2018-03-18 + +- `leanphp/phpspec-code-coverage` update from `~4.0` to `4.0.*` as we do not + support `4.1` yet. + +## 7.1.0 / 2017-10-18 + +- Updated `PHP_CodeSniffer` from `~2.8` to `3.0` +- Updated `phpcpd` from `~2.0` to `~3.0` +- Updated `phploc` from `~3.0` to `~4.0` +- Updated `phpunit` from `~5.0` to `~6.0` +- Updated `alice` from `~2.3` to `~3.0` +- Updated `faker` from `~1.6` to `~1.7` +- Updated `mockery` from `~0.9` to `~1.0` +- Updated `phpspec` from `~3.2` to `~4.0` +- Updated `phpspec-typehintedmethods` from `~2.0` to `~3.0` (`phpspec 4`) +- Updated `phpspec-code-coverage` from `~3.1` to `~4.0` (`phpspec 4`) +- Added `behat-code-coverage` `~3.2` +- Updated `behat` to `~3.4` +- Updated `bin/composer` to `1.3.0` + +## 7.0.0 / 2017-04-08 + +- Change `rmiller\behatspec` to `leanphp\behat-phpspec` (temporary tagged + fork). +- Added ApiGen `4.2.0-RC1` +- Added phpstan `~0.6` +- Update PHP from `~5.6||~7.0` to `^7.0` +- Update BehatSpec from `0.3.*` to `dev-master` +- Update `leanphp\phpspec-code-coverage` from `~3.0` to `~3.1` +- Update `symfony` from `~2.8||^3.1` to `~2.8||^3.2`. + +## 6.4.0 / 2017-04-08 - Add `sami/sami:~3.2||~4.0` (ApiGen replacement) diff --git a/README.md b/README.md index ab50e88..4538fcb 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,17 @@ common-dev [![Travis](https://img.shields.io/travis/leanphp/common-dev.svg?style=flat-square)](https://travis-ci.org/leanphp/common-dev) [![Pre Release](https://img.shields.io/packagist/vpre/leanphp/common-dev.svg?style=flat-square)](https://packagist.org/packages/leanphp/common-dev) -[leanPHP/common-dev][0] is a set of modern **PHP 7** (**5.6+**) development tools and +[leanphp/common-dev][0] is a set of modern **PHP 7+** development tools and libraries, which help you write PHP packages and libraries that comply with [PHP-FIG][1] standards and adhere to best PHP practices defined in [PHP - The Right Way][2] guidelines. -These tools help you write **well-tested** functional & **OOP** code ([TDD][3], -[BDD][4], [SOLID][5]). - -**Distribute** your code via [Packagist][6] by using [composer][7]! +**Note!** These tools help you write **well-tested** functional & **OOP** code +([TDD][3], [BDD][4], [SOLID][5]). This meta-package should serve more as an +example set of development tools that one can use. This package helps when you +want to hack something quick, however for serious projects you are advised to +compile a custom list of development dependencies in `composer.json` of your +project, instead of depending on this package directly. See [Packages](#Packages) for a list of packages that this meta-package provides. [Usage](#Usage) section covers information regarding various tools @@ -39,15 +41,15 @@ This is a list of PHP Libraries that this package installs: - [symfony/var-dumper](#var-dumper) **v3** - Advanced Variable Dumper by Symfony project (`dump()` instead of `var_dump()`). -- [Mockery](#Mockery) **v0.9** - a simple yet flexible PHP mock object framework for +- [Mockery](#Mockery) **v1.0** - a simple yet flexible PHP mock object framework for use in unit testing. - [Prophecy](#Prophecy) - highly opinionated mocking framework for PHP. - [Alice](#Alice) - Expressive Fixtures generator based on [Faker](#Faker). - [Faker](#Faker) - PHP Library to generate fake data for you. - [vfsStream](#vfsStream) - Virtual file system to mock the real file system in unit tests. -- [PHPUnit](#PHPUnit) **v5** - The PHP Unit Testing framework. -- [PHPSpec](#PHPSpec) **v3** - SpecBDD / BDD Testing framework for PHP with extensions: +- [PHPUnit](#PHPUnit) **v6** - The PHP Unit Testing framework. +- [PHPSpec](#PHPSpec) **v4** - SpecBDD / BDD Testing framework for PHP with extensions: - [phpspec-code-coverage][805] - Code Coverage for [PHPSpec][800]. - [phpspec-typehintedmethods][810] - Generate Typehinted methods - [behat](#Behat) **v3** - ScenarioBDD / BDD Testing framework for PHP, with @@ -63,9 +65,10 @@ This is a list of PHP Libraries that this package installs: This is a list of PHP Development Tools that this package installs: - [Sami](#Sami) - An API Documentation generator. +- [PHPStan](#PHPStan) - PHP Static Analysis tool. - [PHPMD](#PHPMD) **v2** - PHP Mess Detector. Optimize your code, reduce complexity, cleanup unused parameters, methods, variables & more. -- [PHP_CodeSniffer](#PHP CodeSniffer) **v2** - PHP Code Sniffer ensures that +- [PHP_CodeSniffer](#PHP CodeSniffer) **v3** - PHP Code Sniffer ensures that your code remains clean and consistent. It is a set of scripts to detect and automatically correct violations of a defined coding standard. - [phpcs-symfony2-standard][140] - Symfony2 Coding Standard configuration for @@ -273,6 +276,10 @@ Copy it to the root of your project: $ cp vendor/leanphp/common-dev/config/behat.yml behat.yml +Initialize the project: + + $ bin/behat --init + The configuration file will enable all the Behat extensions that come installed with this package and will also integrate it with [PHPSpec](#PHPSpec). @@ -306,6 +313,7 @@ a look at [Symfony API](http://api.symfony.com/) to see a working example of what Sami does. You can start with example [sami.php](config/sami.php) configuration file. + Copy it to the root of your project: $ cp vendor/leanphp/common-dev/config/sami.php .sami.php @@ -319,6 +327,20 @@ Generate the API: The API Documentation will be generated in `build/docs/` directory, which is configured in `.sami.php`. +#### PHPStan + +**Note!** PHPSten is temporarily not provided by the package as it conflicts +with ApiGen. Additionally we believe we need to review the usability of some of +the other tools if we also bring PHPStan. + +[PHPStan][115] is a PHP Static Analysis Tool. It focuses on finding errors in +your code without actually running it. It catches whole classes of bugs even +before you write tests for the code. + +`PHPStan` is run via console: + + $ bin/phpstan analyse src tests + #### PHPMD [PHPMD][120] (PHP Mess Detector) is a code optimizer, which scans your code for @@ -437,6 +459,7 @@ Licensed under [MIT License](LICENSE). [100]: https://github.com/FriendsOfPHP/Sami [110]: https://github.com/symfony/var-dumper +[115]: https://github.com/phpstan/phpstan [120]: https://phpmd.org [121]: https://phpmd.org/rules/index.html [130]: https://pear.php.net/package/PHP_CodeSniffer diff --git a/bin/composer b/bin/composer index 89920d3..508f9cf 100755 Binary files a/bin/composer and b/bin/composer differ diff --git a/composer.json b/composer.json index 71dbe76..9e6ce9c 100644 --- a/composer.json +++ b/composer.json @@ -18,33 +18,40 @@ "docs": "https://github.com/leanphp/common-dev#common-dev" }, "require": { - "php": "~5.6||~7.0", - "sami/sami": "~3.2||~4.0", - "symfony/var-dumper": "~2.8||^3.1", + "php": "^7.1", + "sami/sami": "~4.0", + "symfony/var-dumper": "^3.2||~4.0", "phpmd/phpmd": "~2.6", - "squizlabs/php_codesniffer": "~2.8", - "leaphub/phpcs-symfony2-standard": "~2.0", - "sebastian/phpcpd": "~2.0", - "phploc/phploc": "~3.0", - "phpunit/phpunit": "~5.7", + "squizlabs/php_codesniffer": "~3.0", + "escapestudios/symfony2-coding-standard": "^3.1", + "sebastian/phpcpd": "~4.0", + "phploc/phploc": "~4.0", + "phpunit/phpunit": "~7.0", "mikey179/vfsstream": "~1.6", - "nelmio/alice": "~2.3", - "fzaninotto/faker": "~1.6", - "phpspec/phpspec": "~3.2", + "nelmio/alice": "^3.2", + "fzaninotto/faker": "~1.7", + "phpspec/phpspec": "~4.0", "phpspec/prophecy": "~1.7", - "mockery/mockery": "0.9.*", - "ciaranmcnulty/phpspec-typehintedmethods": "~2.0", - "leanphp/phpspec-code-coverage": "~3.0", - "behat/behat": "~3.3", + "mockery/mockery": "~1.0", + "ciaranmcnulty/phpspec-typehintedmethods": "~3.0", + "leanphp/phpspec-code-coverage": "^4.2", + "leanphp/behat-code-coverage": "^3.3", + "behat/behat": "~3.4", "behat/mink": "~1.7", - "behat/mink-extension": "~2.2", + "behat/mink-extension": "~2.3", "behat/mink-goutte-driver": "~1.2", "behat/mink-browserkit-driver": "~1.3", - "rmiller/behat-spec": "0.3.*" + "leanphp/behat-phpspec": "0.7.*", + "phpstan/phpstan": "~0.9" }, "bin": ["bin/composer"], "minimum-stability": "stable", "config": { "bin-dir": "bin" + }, + "extra": { + "branch-alias": { + "dev-develop": "7.2.x-dev" + } } } diff --git a/config/behat.yml b/config/behat.yml index 679b119..5879f8b 100644 --- a/config/behat.yml +++ b/config/behat.yml @@ -1,22 +1,18 @@ # behat.yml # example behat config - leanphp/common-dev default: - - # configure paths - paths: - features: features - bootstrap: %behat.paths.features%/bootstrap - - # configure formatters + autoload: + '': %paths.base%/features/bootstrap formatters: pretty: true - extensions: - # rmiller/behat-spec extension - RMiller\ErrorExtension\ErrorExtension: ~ - RMiller\BehatSpec\BehatExtension: - path: 'bin/phpspec' - # behat/mink-extension (via behat/mink-goutter-driver) - Behat\MinkExtension: - sessions: - default: - goutte: ~ + + extensions: + # rmiller/behat-spec extension + RMiller\BehatSpec\Extension\BehatSpecExtension\BehatExtension: + path: 'bin/phpspec' + # behat/mink-extension (via behat/mink-goutter-driver) + Behat\MinkExtension: + sessions: + default: + goutte: ~ + diff --git a/config/phpcs.xml b/config/phpcs.xml index 0251c51..983f286 100644 --- a/config/phpcs.xml +++ b/config/phpcs.xml @@ -1,7 +1,7 @@ - - leanphp/common-dev Coding Standard + + LeanPHP Coding Standard src diff --git a/config/phpspec.yml b/config/phpspec.yml index 33010ad..f110642 100644 --- a/config/phpspec.yml +++ b/config/phpspec.yml @@ -7,15 +7,16 @@ suites: psr4_prefix: LeanPHP\Common extensions: - LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension: ~ Cjm\PhpSpec\Extension\TypeHintedMethodsExtension: ~ - RMiller\BehatSpec\PhpSpecExtension: ~ - RMiller\ExemplifyExtension\ExemplifyExtension: ~ - -code_coverage: - format: - - html - - clover - output: - html: build/phpspec-coverage - clover: build/phpspec-coverage.xml + LeanPHP\PhpSpec\CodeCoverage\CodeCoverageExtension: + format: + - html + - clover + output: + html: build/phpspec-coverage + clover: build/phpspec-coverage.xml + RMiller\BehatSpec\Extension\BehatSpecExtension\PhpSpecExtension: ~ + RMiller\BehatSpec\Extension\PhpSpecRunExtension\PhpSpecRunExtension: + path: bin/phpspec + commands: [describe, exemplify] + config: phpspec.yml