Permalink
Browse files

PHP 7.1, coding style

  • Loading branch information...
mabar authored and f3l1x committed Aug 10, 2018
1 parent 5861e4f commit c73737297c9848fb9ab198c48f1719ce829e7501
@@ -61,7 +61,8 @@ use Symfony\Component\EventDispatcher\Event;
final class OrderLoggerSubscriber implements EventSubscriber
{
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
'order.created' => 'log',
@@ -70,7 +71,7 @@ final class OrderLoggerSubscriber implements EventSubscriber
];
}
public function log(Event $event)
public function log(Event $event): void
{
// Do some magic here...
}
@@ -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
@@ -6,6 +6,8 @@
/composer.lock
# Tests
/temp/
/tests/*.log
/tests/tmp
/tests/coverage.html
/coverage.xml
@@ -1,67 +1,65 @@
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.1
- 7.2
before_install:
# turn off XDebug
- phpenv config-rm xdebug.ini || return 0
# turn off XDebug
- phpenv config-rm xdebug.ini || return 0
install:
# Composer
- travis_retry composer install --no-progress --prefer-dist
# Composer
- travis_retry composer install --no-progress --prefer-dist
script:
# Nette/Tester
- composer run-script tester
# Nette/Tester
- composer run-script tester
jobs:
include:
- env: title="Lowest Dependencies 5.6"
php: 5.6
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tester
- 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
- 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
- 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
- stage: Quality Assurance
php: 7.1
script:
- composer run-script qa
- stage: Quality Assurance
php: 7.2
script:
- composer run-script qa
- stage: Test Coverage
php: 7.1
script:
- composer run-script coverage
after_script:
- wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- php coveralls.phar --verbose --config tests/.coveralls.yml
- 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
- stage: Phpstan
php: 7.1
script:
- composer run-script phpstan-install
- composer run-script phpstan
- stage: Phpstan
php: 7.2
script:
- composer run-script phpstan-install
- composer run-script phpstan
allow_failures:
- stage: Test Coverage
- stage: Phpstan
- stage: Test Coverage
after_failure:
# Print *.actual content
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
# Print *.actual content
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/.composer/cache
@@ -26,7 +26,8 @@ composer require contributte/event-dispatcher
| State | Version | Branch | PHP |
|-------------|---------|----------|----------|
| development | `^0.5` | `master` | `>= 5.6` |
| development | `^0.6` | `master` | `>= 7.1` |
| stable | `^0.5` | `master` | `>= 7.1` |
| stable | `^0.4` | `master` | `>= 5.6` |
## Overview
@@ -49,6 +50,13 @@ composer require contributte/event-dispatcher
</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>
@@ -1,24 +1,36 @@
{
"name": "contributte/event-dispatcher",
"description": "Best event dispatcher / event manager / event emitter for Nette Framework",
"keywords": ["nette", "symfony", "event", "dispatcher", "emitter"],
"keywords": [
"nette",
"symfony",
"event",
"dispatcher",
"emitter"
],
"type": "library",
"license": ["MIT"],
"license": [
"MIT"
],
"homepage": "https://github.com/contributte/event-dispatcher",
"authors": [
{
"name": "Milan Felix Sulc",
"name": "Milan Felix Šulc",
"homepage": "https://f3l1x.io"
}
],
"require": {
"php": ">= 5.6",
"symfony/event-dispatcher": "^3.2.0 || ^4.0.0"
"php": ">= 7.1",
"symfony/event-dispatcher": "^4.0.0"
},
"require-dev": {
"ninjify/qa": "^0.4.0",
"ninjify/qa": "^0.8.0",
"ninjify/nunjuck": "^0.2.0",
"nette/di": "^2.4.9"
"nette/di": "^2.4.13"
},
"conflict": {
"nette/di": "<2.4.13",
"nette/utils": "<2.5.2"
},
"suggest": {
"nette/di": "to use EventDispatcherExtension[CompilerExtension]"
@@ -33,6 +45,8 @@
"Tests\\Fixtures\\": "tests/fixtures"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"qa": [
"linter src tests",
@@ -46,16 +60,18 @@
],
"phpstan-install": [
"mkdir -p temp/phpstan",
"composer require -d temp/phpstan phpstan/phpstan:0.8.5",
"composer require -d temp/phpstan phpstan/phpstan-nette:0.8.3"
"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 1 -c phpstan.neon src"
"temp/phpstan/vendor/bin/phpstan analyse -l max -c phpstan.neon src"
]
},
"extra": {
"branch-alias": {
"dev-develop": "0.5.x-dev"
"dev-develop": "0.6.x-dev"
}
}
}
@@ -1,5 +1,10 @@
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
parameters:
ignoreErrors:
# Probably cannot occur
- '#^Parameter \#1 \$function of function call_user_func expects callable, array\(array\|Nette\\DI\\ServiceDefinition\|string\|null#'
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<ruleset name="Contributte">
<!-- 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\EventDispatcher,
tests/fixtures=>Tests\Fixtures
"/>
</properties>
</rule>
<!-- Exclude folders -->
<exclude-pattern>/tests/tmp</exclude-pattern>
</ruleset>
Oops, something went wrong.

0 comments on commit c737372

Please sign in to comment.