Skip to content

Commit

Permalink
Update PHP deps (#3)
Browse files Browse the repository at this point in the history
* Update PHP deps
* Removed xDebug condition in Travis
* PHP 8.0
  • Loading branch information
SmetDenis authored Apr 28, 2021
1 parent 9a7e743 commit e06991e
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 39 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,15 @@
# @link https://github.com/JBZoo/Event
#

/.github export-ignore
/build export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.phan.php export-ignore
/.travis.yml export-ignore
/phpbench.json.dist export-ignore
/phpunit.xml.dist export-ignore

* text eol=lf
123 changes: 123 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#
# JBZoo Toolbox - Event
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Event
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Event
#

name: CI

on:
pull_request:
branches:
- "*"
push:
branches:
- 'master'
schedule:
- cron: '40 */8 * * *'

env:
COLUMNS: 120
TERM_PROGRAM: Hyper

jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer

- name: Build the Project
run: make update --no-print-directory

- name: 🧪 PHPUnit Tests
run: make test --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
path: build/


linters:
name: Linters
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Build the Project
run: make update --no-print-directory

- name: 👍 Code Quality
run: make codestyle --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Linters - ${{ matrix.php-version }}
path: build/


report:
name: Reports
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer

- name: Build the Project
run: make update --no-print-directory

- name: 📝 Build Reports
run: make report-all --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Reports - ${{ matrix.php-version }}
path: build/
2 changes: 1 addition & 1 deletion .phan/config.php → .phan.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

declare(strict_types=1);

$default = include __DIR__ . '/../vendor/jbzoo/codestyle/src/phan/default.php';
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';

$config = array_merge($default, [
'directory_list' => [
Expand Down
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,22 @@ language: php
os: linux
dist: xenial

git:
depth: false

php:
- 7.2
- 7.3
- 7.4
- 8.0
- nightly

jobs:
fast_finish: true
allow_failures:
- php: 8.0
- php: nightly

env:
matrix:
- JBZOO_COMPOSER_UPDATE_FLAGS="--prefer-lowest --prefer-stable"
- JBZOO_COMPOSER_UPDATE_FLAGS=""
- XDEBUG_OFF="yes"

before_script:
- composer self-update
- if [[ $XDEBUG_OFF = yes ]]; then phpenv config-rm xdebug.ini; fi;

script:
- make update --no-print-directory
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ endif
update: ##@Project Install/Update all 3rd party dependencies
$(call title,"Install/Update all 3rd party dependencies")
@echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
@composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)
@composer update --no-progress $(JBZOO_COMPOSER_UPDATE_FLAGS)


test-all: ##@Project Run all project tests at once
@make test
@make codestyle
@make test-performance-travis;
29 changes: 13 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name" : "jbzoo/event",
"type" : "library",
"description" : "Library for event-based development",
"license" : "MIT",
"keywords" : [
"name" : "jbzoo/event",
"type" : "library",
"description" : "Library for event-based development",
"license" : "MIT",
"keywords" : [
"JBZoo", "events", "event-manager", "eventmanager", "listener", "hook", "signal", "observer", "emit", "emitter"
],

"authors" : [
"authors" : [
{
"name" : "Denis Smetannikov",
"email" : "admin@jbzoo.com",
Expand All @@ -20,33 +20,30 @@
}
],

"require" : {
"require" : {
"php" : ">=7.2"
},

"require-dev" : {
"require-dev" : {
"jbzoo/utils" : "^4.3.3",
"jbzoo/toolbox-dev" : "^2.10.0"
"jbzoo/toolbox-dev" : "^2.13.1"
},

"autoload" : {
"autoload" : {
"psr-4" : {
"JBZoo\\Event\\" : "src"
}
},

"minimum-stability" : "dev",
"prefer-stable" : true,

"autoload-dev" : {
"autoload-dev" : {
"classmap" : ["tests"]
},

"config" : {
"config" : {
"optimize-autoloader" : true
},

"extra" : {
"extra" : {
"branch-alias" : {
"dev-master" : "3.x-dev"
}
Expand Down
2 changes: 1 addition & 1 deletion src/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Class EventManager
* @package JBZoo\Event
*/
class EventManager
final class EventManager
{
public const LOWEST = 0;
public const LOW = 50;
Expand Down
20 changes: 10 additions & 10 deletions tests/NamespacesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public function testSimpleParts()
is(1, $eManager->trigger('item.save.before'));
is(1, $eManager->trigger('item.save.after'));

is(0, $eManager->trigger('undefind'));
is(0, $eManager->trigger('undefined'));
is(0, $eManager->trigger('save.after'));
is(0, $eManager->trigger('item.save.undefind'));
is(0, $eManager->trigger('item.save.undefined'));
is(0, $eManager->trigger('item.saved'));
}

Expand All @@ -75,7 +75,7 @@ public function testAnyPart()

is(0, $eManager->trigger('item.save.before'));
is(0, $eManager->trigger('item.save.after'));
is(0, $eManager->trigger('item.save.after.realy.deep'));
is(0, $eManager->trigger('item.save.after.really.deep'));
}

public function testAnyPart2()
Expand All @@ -89,7 +89,7 @@ public function testAnyPart2()

is(0, $eManager->trigger('item.save'));
is(0, $eManager->trigger('item.save.before'));
is(0, $eManager->trigger('item.save.after.realy.deep'));
is(0, $eManager->trigger('item.save.after.really.deep'));
}

public function testAnyPart3()
Expand All @@ -102,7 +102,7 @@ public function testAnyPart3()

is(0, $eManager->trigger('item.save'));
is(0, $eManager->trigger('item.save.before'));
is(0, $eManager->trigger('item.save.after.realy.deep'));
is(0, $eManager->trigger('item.save.after.really.deep'));
}

public function testAnyPart4()
Expand All @@ -115,7 +115,7 @@ public function testAnyPart4()
is(1, $eManager->trigger('item.save.after'));

is(0, $eManager->trigger('item.save'));
is(0, $eManager->trigger('item.save.after.realy.deep'));
is(0, $eManager->trigger('item.save.after.really.deep'));
}

public function testAnyPart5()
Expand All @@ -130,8 +130,8 @@ public function testAnyPart5()

is(0, $eManager->trigger('item.save'));
is(0, $eManager->trigger('item.save.before'));
is(0, $eManager->trigger('item.save.after.realy.deep.name'));
is(0, $eManager->trigger('item.load.after.realy.deep.name'));
is(0, $eManager->trigger('item.save.after.really.deep.name'));
is(0, $eManager->trigger('item.load.after.really.deep.name'));
}

public function testComplex()
Expand Down Expand Up @@ -180,8 +180,8 @@ public function testComplex2()
is(0, $eManager->trigger('item.load'));
is(0, $eManager->trigger('item.load.before'));
is(0, $eManager->trigger('save.before'));
is(0, $eManager->trigger('item.save.before.realy.deep.name'));
is(0, $eManager->trigger('category.save.before.realy.deep.name'));
is(0, $eManager->trigger('item.save.before.really.deep.name'));
is(0, $eManager->trigger('category.save.before.really.deep.name'));

is(1, $eManager->trigger('item.save'));
is(1, $eManager->trigger('category'));
Expand Down

0 comments on commit e06991e

Please sign in to comment.