Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# for php-coveralls
service_name: travis-ci
coverage_clover: build/logs/clover.xml
5 changes: 5 additions & 0 deletions .docheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This file is part of `%package%`.
(c) 2015-%year% Sascha-Oliver Prolic <saschaprolic@googlemail.com>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/docs export-ignore
/tests export-ignore
.coveralls.yml export-ignore
.docheader export-ignore
.gitignore export-ignore
.php_cs export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
19 changes: 4 additions & 15 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
<?php

$config = PhpCsFixer\Config::create();
$config->setRules([
'@PSR2' => true,
]);
$config = new Prooph\CS\Config\Prooph();
$config->getFinder()->in(__DIR__);

$finder = PhpCsFixer\Finder::create();
$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__;

/*
* You can set manually these paths:
*/
$finder->in([
'bin',
'src',
'tests'
]);

$config->setFinder($finder);
$config->setCacheFile($cacheDir . '/.php_cs.cache');

return $config;
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ language: php
sudo: false

php:
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

env:
matrix:
Expand All @@ -16,6 +13,8 @@ env:
cache:
directories:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer
- $HOME/.local

before_script:
- phpenv config-rm xdebug.ini
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2016 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
Copyright (c) 2015-2020 Sascha-Oliver Prolic <saschaprolic@googlemail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Humus AMQP Module
## About

The Humus AMQP Module incorporates messaging in your zf2 application via RabbitMQ using [HumusAmqp](https://github.com/prolic/HumusAmqp>),
a PHP 7 AMQP libray supporting multiple drivers and providing full-featured Consumer, Producer, and JSON-RPC Client / Server implementations.
a PHP 7.4 AMQP libray supporting multiple drivers and providing full-featured Consumer, Producer, and JSON-RPC Client / Server implementations.

The JSON-RPC part implements JSON-RPC 2.0 Specification.

Expand All @@ -25,7 +25,7 @@ Documentation can be found here: [humusamqp.readthedocs.io](https://humusamqp.re

## Installation

You can install prolic/humus-amqp-module via composer by adding "prolic/humus-amqp-module": "^1.0" as requirement to your composer.json.
You can install prolic/humus-amqp-module via composer by adding "prolic/humus-amqp-module": "^2.0" as requirement to your composer.json.

You can then enable the module in your config/application.config.php by adding 'HumusAmqpModule' to the 'modules' section.

Expand All @@ -41,4 +41,4 @@ To establish a consistent code quality, please provide unit tests for all your c

## License

Released under the [MIT](LICENSE.txt).
Released under the [MIT](LICENSE.txt).
29 changes: 19 additions & 10 deletions bin/humus-amqp-module.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<?php

/**
* This file is part of `prolic/humus-amqp-module`.
* (c) 2015-2020 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);
/**
* Copyright (c) 2016. Sascha-Oliver Prolic <saschaprolic@googlemail.com>
* Copyright (c) 2015-2020. Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Expand All @@ -20,13 +30,13 @@

use Zend\Mvc\Application;

ini_set('display_errors', true);
chdir(__DIR__);
\ini_set('display_errors', true);
\chdir(__DIR__);

$previousDir = '.';

while (!file_exists('config/application.config.php')) {
$dir = dirname(getcwd());
while (! \file_exists('config/application.config.php')) {
$dir = \dirname(\getcwd());

if ($previousDir === $dir) {
throw new RuntimeException(
Expand All @@ -36,15 +46,14 @@
}

$previousDir = $dir;
chdir($dir);
\chdir($dir);
}


if (is_readable('init_autoloader.php')) {
if (\is_readable('init_autoloader.php')) {
include_once 'init_autoloader.php';
} elseif (file_exists(__DIR__ . '/../vendor/autoload.php')) {
} elseif (\file_exists(__DIR__ . '/../vendor/autoload.php')) {
include_once __DIR__ . '/../vendor/autoload.php';
} elseif (file_exists(__DIR__ . '/../../../autoload.php')) {
} elseif (\file_exists(__DIR__ . '/../../../autoload.php')) {
include_once __DIR__ . '/../../../autoload.php';
} else {
throw new RuntimeException('Error: vendor/autoload.php could not be found. Did you run php composer.phar install?');
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
}
],
"require": {
"php": "^7.0",
"prolic/humus-amqp" : "^1.0",
"container-interop/container-interop": "^1.1",
"php": "^7.4",
"prolic/humus-amqp" : "^2.0",
"psr/container": "^1.0",
"sandrokeil/interop-config": "^1.0 || ^2.0",
"symfony/console": "^3.0|^4.0",
"zendframework/zend-modulemanager": "^2.7"
"symfony/console": "^4.3|^5.0",
"zendframework/zend-modulemanager": "^2.8.4",
"zendframework/zend-mvc": "^2.7.15"
},
"require-dev": {
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0",
"friendsofphp/php-cs-fixer": "^2.14",
"friendsofphp/php-cs-fixer": "^2.16.1",
"phpunit/phpunit": "^9.0",
"prooph/php-cs-fixer-config": "^0.3",
"php-coveralls/php-coveralls": "^2.1"
},
"autoload": {
Expand Down
26 changes: 8 additions & 18 deletions config/module.config.php
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
<?php

/**
* Copyright (c) 2016. Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This file is part of `prolic/humus-amqp-module`.
* (c) 2015-2020 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare (strict_types=1);
declare(strict_types=1);

namespace HumusAmqpModule;

use Humus\Amqp\Driver\Driver;
use Humus\Amqp\Container\DriverFactory;
use Humus\Amqp\Driver\Driver;

return [
'service_manager' => [
'factories' => [
'humus_amqp_cli' => Container\CliFactory::class,
Driver::class => DriverFactory::class,
]
],
],
];
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The documentation moved `here <http://humusamqp.readthedocs.io/>`_.
Overview
--------

PHP 7 AMQP libray supporting multiple drivers and providing full-featured Consumer, Producer, and JSON-RPC Client / Server implementations.
PHP 7.4 AMQP libray supporting multiple drivers and providing full-featured Consumer, Producer, and JSON-RPC Client / Server implementations.

The JSON-RPC part implements `JSON-RPC 2.0 Specification <http://www.jsonrpc.org/specification>`_.

Expand Down
1 change: 1 addition & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

@ECHO OFF

REM Command file for Sphinx documentation
Expand Down
28 changes: 21 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ This file is part of the prolic/HumusAmqpModule.
~ (c) 2015-2020 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
~
~ For the full copyright and license information, please view the LICENSE
~ file that was distributed with this source code.
-->

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.0/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
stopOnFailure="false"
processIsolation="false"
backupGlobals="false"
>
<testsuite name="HumusAmqpModule Test-Suite">
<directory>./tests</directory>
stopOnFailure="false"
failOnWarning="true"
failOnRisky="true"
>
<testsuite name="Prooph EventStoreClient Test Suite">
<directory suffix=".php">./tests</directory>
</testsuite>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
Expand Down
32 changes: 7 additions & 25 deletions src/Container/CliFactory.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,24 @@
<?php

/**
* Copyright (c) 2016. Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This file is part of `prolic/humus-amqp-module`.
* (c) 2015-2020 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace HumusAmqpModule\Container;

use Humus\Amqp\Console\ConsoleRunner;
use Interop\Container\ContainerInterface;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Application;

/**
* Class CliFactory
* @package HumusAmqpModule\Container
*/
final class CliFactory
{
/**
* @param ContainerInterface $container
* @return Application
*/
public function __invoke(ContainerInterface $container)
public function __invoke(ContainerInterface $container): Application
{
return ConsoleRunner::createApplication(ConsoleRunner::createHelperSet($container));
}
Expand Down
24 changes: 5 additions & 19 deletions src/Module.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php

/**
* Copyright (c) 2016. Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This file is part of `prolic/humus-amqp-module`.
* (c) 2015-2020 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);
Expand All @@ -24,10 +14,6 @@

use Zend\ModuleManager\Feature\ConfigProviderInterface;

/**
* Class Module
* @package HumusAmqpModule
*/
class Module implements ConfigProviderInterface
{
/**
Expand Down
Loading