-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
4,112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
* text=auto | ||
|
||
/spec export-ignore | ||
/tests export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.php_cs | ||
/.travis.yml export-ignore | ||
/phpstan.neon export-ignore | ||
/phpunit.xml.dist export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/vendor | ||
/.php_cs.cache | ||
/phpunit.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'binary_operator_spaces' => ['align_double_arrow' => false, 'align_equals' => false], | ||
'blank_line_after_opening_tag' => true, | ||
'blank_line_before_return' => true, | ||
'cast_spaces' => true, | ||
'concat_space' => ['spacing' => 'none'], | ||
'declare_strict_types' => true, | ||
'method_separation' => true, | ||
'no_blank_lines_after_class_opening' => true, | ||
'no_spaces_around_offset' => ['positions' => ['inside', 'outside']], | ||
'no_unneeded_control_parentheses' => true, | ||
'no_unused_imports' => true, | ||
'phpdoc_align' => true, | ||
'phpdoc_no_access' => true, | ||
'phpdoc_separation' => true, | ||
'pre_increment' => true, | ||
'single_quote' => true, | ||
'trim_array_spaces' => true, | ||
'single_blank_line_before_namespace' => true | ||
]) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/src') | ||
->in(__DIR__ . '/tests') | ||
->in(__DIR__ . '/spec') | ||
) | ||
->setRiskyAllowed(true) | ||
->setUsingCache(false) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: php | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
include: | ||
- os: linux | ||
php: '7.1' | ||
|
||
- os: linux | ||
php: '7.2' | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
install: | ||
- composer install --prefer-dist --no-interaction --ignore-platform-reqs | ||
|
||
script: | ||
- composer check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## Types of changes | ||
* **Added** for new features. | ||
* **Changed** for changes in existing functionality. | ||
* **Deprecated** for soon-to-be removed features. | ||
* **Removed** for now removed features. | ||
* **Fixed** for any bug fixes. | ||
* **Security** in case of vulnerabilities. | ||
|
||
|
||
## Unreleased | ||
### Added | ||
* first initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# PhpSpec extension for PHPStan | ||
|
||
[](https://php.net/) | ||
[](https://packagist.org/packages/proget-hq/phpstan-phpspec) | ||
[](https://travis-ci.org/proget-hq/phpstan-phpspec) | ||
[](https://packagist.org/packages/proget-hq/phpstan-phpspec) | ||
[](https://packagist.org/packages/proget-hq/phpstan-phpspec) | ||
|
||
## What does it do? | ||
|
||
* Provides correct return type for `Collaborator` in spec methods | ||
* `will*` methods | ||
* Provides correct methods for `ObjectBehavior`: | ||
* `should*` methods | ||
* `beConstructedWith`, `beConstructedThrough`, `beAnInstanceOf` | ||
|
||
## Compatibility | ||
|
||
| PHPStan version | PhpSpec extension version | | ||
| --------------- | ---------------------- | | ||
| 0.10.6 | 0.1.x | | ||
|
||
|
||
## Installation | ||
|
||
```sh | ||
composer require --dev proget-hq/phpstan-phpspec | ||
``` | ||
|
||
## Configuration | ||
|
||
Put this into your `phpstan.neon` config: | ||
|
||
```neon | ||
includes: | ||
- vendor/proget-hq/phpstan-phpspec/extension.neon | ||
parameters: | ||
phpspecSourceFiles: | ||
- 'src/' | ||
``` | ||
|
||
## Limitations | ||
|
||
TBD. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "proget-hq/phpstan-phpspec", | ||
"description": "PhpSpec extension for PHPStan", | ||
"type": "library", | ||
"require": { | ||
"php": "^7.1", | ||
"phpstan/phpstan": "^0.10.6", | ||
"nikic/php-parser": "^4.1", | ||
"phpspec/phpspec": "^5.1", | ||
"symfony/finder": "^4.2" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^7.0", | ||
"phpstan/phpstan-phpunit": "^0.10", | ||
"friendsofphp/php-cs-fixer": "^2.13", | ||
"symfony/var-dumper": "^4.2" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Proget\\PHPStan\\PhpSpec\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Proget\\Tests\\PHPStan\\PhpSpec\\": "tests/", | ||
"spec\\Proget\\": "spec/Proget/" | ||
} | ||
}, | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Arkadiusz Kondas", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"scripts": { | ||
"check-cs": "php-cs-fixer fix --dry-run --diff", | ||
"fix-cs": "php-cs-fixer fix", | ||
"tests": "phpspec run", | ||
"stan": "phpstan analyse -l max -c ./phpstan.neon ./src ./tests ./spec", | ||
"check": [ | ||
"@check-cs", | ||
"@stan", | ||
"@tests" | ||
] | ||
} | ||
} |
Oops, something went wrong.