Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Merge 7f7e496 into 506cef7
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Jul 26, 2018
2 parents 506cef7 + 7f7e496 commit 37f0f63
Show file tree
Hide file tree
Showing 13 changed files with 149 additions and 114 deletions.
14 changes: 6 additions & 8 deletions .docs/README.md
Expand Up @@ -7,7 +7,7 @@

## Usage

First of all, register `PhpDocExtension`.
Register `PhpDocExtension`.

```yaml
extensions:
Expand All @@ -16,15 +16,13 @@ extensions:

## Configuration

As you can see, that configuration is by default.

```yaml
phpdoc:
ignore:
# ignored annotations
ignore:
- persistent
- serializationVersion

cache: auto
```

You can add more ignored annotations or change cache adapter.
# override default cache (default is apcu if available, php file otherwise)
cache: Doctrine\Common\Cache\ApcuCache()
```
20 changes: 7 additions & 13 deletions .editorconfig
@@ -1,26 +1,20 @@
# EditorConfig is awesome: http://EditorConfig.org

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

# JS / PHP
[*.{js,php,phpt}]
charset = utf-8
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4
indent_size = tab
tab_width = 4

# NEON
[*.neon]
charset = utf-8
indent_style = tab
[*.md]
indent_style = space
indent_size = 4

# Composer, NPM, Travis, BitbucketPipelines
[{composer.json,package.json,.travis.yml,bitbucket-pipelines.yml}]
[{composer.json,package.json,.travis.yml}]
indent_style = space
indent_size = 2
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -6,6 +6,8 @@
/composer.lock

# Tests
/temp/
/tests/*.log
/tests/tmp
/tests/coverage.html
/coverage.xml
83 changes: 42 additions & 41 deletions .travis.yml
@@ -1,57 +1,58 @@
language: php

php:
- 5.6
- 7.0
- 7.1
- hhvm
- 7.2

matrix:
fast_finish: true
before_install:
# turn off XDebug
- phpenv config-rm xdebug.ini || return 0

allow_failures:
- php: hhvm
install:
# Composer
- travis_retry composer install --no-progress --prefer-dist

include:
- php: 5.6
env: COMPOSER_FLAG=--prefer-lowest
- php: 5.6
env: COMPOSER_FLAG=--prefer-stable
- php: 7.0
env: COMPOSER_FLAG=--prefer-lowest
- php: 7.0
env: COMPOSER_FLAG=--prefer-stable
- php: 7.1
env: COMPOSER_FLAG=--prefer-lowest
- php: 7.1
env: COMPOSER_FLAG=--prefer-stable
script:
# Nette/Tester
- composer run-script tester

before_script:
# Composer
- travis_retry composer install --no-interaction
# Coverage
- if [[ "$TRAVIS_PHP_VERSION" == "7.1" && "$COMPOSER_FLAG" == "" ]]; then COVERAGE=1; fi
jobs:
include:
- env: title="Lowest Dependencies 7.1"
php: 7.1
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tester

# Create database
- mysql -e 'CREATE DATABASE mydb;'

# Import data
- mysql -u root mydb < tests/fixtures/database.sql
- env: title="Lowest Dependencies 7.2"
php: 7.2
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tester

script:
# Quality Assurance
- travis_retry composer qa
- stage: Quality Assurance
php: 7.2
script:
- composer run-script qa

# Nette\Tester
- composer run-script tester
- stage: Test Coverage
php: 7.2
script:
- composer run-script coverage
after_script:
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar
- php php-coveralls.phar --verbose --config tests/.coveralls.yml

# Nette\Tester + CodeCoverage
- if [ "$COVERAGE" != "" ]; then composer tester-coverage; fi
- stage: Phpstan
php: 7.2
script:
- composer run-script phpstan-install
- composer run-script phpstan

after_script:
# Coverage (Coveralls)
- if [ "$COVERAGE" != "" ]; then wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar; fi
- if [ "$COVERAGE" != "" ]; then php coveralls.phar --verbose --config tests/.coveralls.yml; fi
allow_failures:
- stage: Test Coverage

after_failure:
# Print *.actual content
Expand Down
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -26,11 +26,13 @@ composer require contributte/phpdoc

| State | Version | Branch | PHP |
|-------------|---------|----------|----------|
| dev | `^0.3` | `master` | `>= 7.1` |
| stable | `^0.2` | `master` | `>= 7.1` |
| stable | `^0.1` | `master` | `>= 5.6` |

## Overview

- [Extension - how to use](https://github.com/contributte/phpdoc/blob/master/.docs/README.md#usage)
- [Extension - how to use](/.docs/README.md#usage)

## Maintainers

Expand All @@ -44,6 +46,13 @@ composer require contributte/phpdoc
</br>
<a href="https://github.com/f3l1x">Milan Felix Šulc</a>
</td>
<td align="center">
<a href="https://github.com/mabar">
<img width="150" height="150" src="https://avatars0.githubusercontent.com/u/20974277?s=400&v=4">
</a>
</br>
<a href="https://github.com/mabar">Marek Bartoš</a>
</td>
</tr>
<tbody>
</table>
Expand Down
54 changes: 41 additions & 13 deletions composer.json
@@ -1,30 +1,43 @@
{
"name": "contributte/phpdoc",
"description": "Doctrine Annotations for Nette Framework",
"keywords": ["nette", "annotataions", "reflection", "phpdoc"],
"keywords": [
"nette",
"annotataions",
"reflection",
"phpdoc"
],
"type": "library",
"license": "MIT",
"license": [
"MIT"
],
"homepage": "https://github.com/contributte/phpdoc",
"authors": [
{
"name": "Milan Felix Sulc",
"name": "Milan Felix Šulc",
"homepage": "https://f3l1x.io"
}
],
"require": {
"php": ">= 5.6",
"nette/reflection": "^2.3.2",
"doctrine/annotations": "^1.4.0",
"doctrine/cache": "^1.6.2"
"php": ">= 7.1",
"nette/reflection": "~2.4.2",
"doctrine/annotations": "^1.6.0",
"doctrine/cache": "^1.7.1"
},
"require-dev": {
"ninjify/qa": "^0.4.0",
"ninjify/nunjuck": "^0.1.4",
"nette/di": "^2.4.9"
"ninjify/qa": "^0.8.0",
"ninjify/nunjuck": "^0.2.0",
"nette/di": "~2.4.13"
},
"suggest": {
"nette/di": "to register Nette extensions [PhpDocExtension]"
},
"conflict": {
"nette/di": "<2.4.13",
"nette/utils": "<2.5.2"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Contributte\\PhpDoc\\": "src"
Expand All @@ -41,10 +54,25 @@
"codesniffer src tests"
],
"tester": [
"tester -s -p php --colors 1 -c tests/php-unix.ini tests/cases"
"tester -s -p php --colors 1 -C tests/cases"
],
"coverage": [
"tester -s -p php --colors 1 -C -d extension=xdebug.so --coverage ./coverage.xml --coverage-src ./src tests/cases"
],
"tester-coverage": [
"tester -s -p php --colors 1 -c tests/php-unix.ini -d extension=xdebug.so --coverage ./coverage.xml --coverage-src ./src tests/cases"
"phpstan-install": [
"mkdir -p temp/phpstan",
"composer require -d temp/phpstan phpstan/phpstan:0.10.2",
"composer require -d temp/phpstan phpstan/phpstan-nette:0.10.1",
"composer require -d temp/phpstan phpstan/phpstan-strict-rules:0.10.1",
"composer require -d temp/phpstan phpstan/phpstan-deprecation-rules:0.10.2"
],
"phpstan": [
"temp/phpstan/vendor/bin/phpstan analyse -l max -c phpstan.neon src"
]
},
"extra": {
"branch-alias": {
"dev-master": "0.3.x-dev"
}
}
}
5 changes: 5 additions & 0 deletions phpstan.neon
@@ -0,0 +1,5 @@
includes:
- temp/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon
- temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon
- temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon
- temp/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon
27 changes: 16 additions & 11 deletions ruleset.xml
@@ -1,13 +1,18 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Contributte">
<!-- Extending rulesets -->
<rule ref="vendor/ninjify/coding-standard/ruleset.xml"/>

<!-- Contributte -->
<rule ref="Squiz.Classes.ClassFileName">
<exclude name="Squiz.Classes.ClassFileName.NoMatch"/>
</rule>

<!-- Exclude folders -->
<exclude-pattern>/tests/tmp</exclude-pattern>
<!-- Contributte Coding Standard -->
<rule ref="./vendor/ninjify/coding-standard/contributte.xml"/>

<!-- Specific rules -->
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array" value="
src=>Contributte\PhpDoc,
tests/fixtures=>Tests\Fixtures
"/>
</properties>
</rule>

<!-- Exclude folders -->
<exclude-pattern>/tests/tmp</exclude-pattern>
</ruleset>

0 comments on commit 37f0f63

Please sign in to comment.