Skip to content

Commit

Permalink
Cleanup laravel versions for ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
denpamusic committed Aug 23, 2020
1 parent ad085fc commit 57b3782
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 86 deletions.
63 changes: 14 additions & 49 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ php:
- 7.2
- 7.3
- nightly

env:
# Laravel 5.3.*
- ILLUMINATE_VERSION=5.3.* PHPUNIT_VERSION=~5.0
# Laravel 5.8.*
- ILLUMINATE_VERSION=5.8.*

before_script:
- echo "yes" | pecl -d preferred_state=beta install zmq
Expand All @@ -29,60 +29,25 @@ script:

matrix:
include:
# Laravel 5.4.*
- php: 7.1
env: ILLUMINATE_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- php: 7.2
env: ILLUMINATE_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- php: 7.3
env: ILLUMINATE_VERSION=5.4.* PHPUNIT_VERSION=~5.7
- php: nightly
env: ILLUMINATE_VERSION=5.4.* PHPUNIT_VERSION=~5.7
# Laravel 5.5.*
- php: 7.1
env: ILLUMINATE_VERSION=5.5.*
- php: 7.2
env: ILLUMINATE_VERSION=5.5.*
- php: 7.3
env: ILLUMINATE_VERSION=5.5.*
- php: nightly
env: ILLUMINATE_VERSION=5.5.*
# Laravel 5.6.*
- php: 7.1
env: ILLUMINATE_VERSION=5.6.*
- php: 7.2
env: ILLUMINATE_VERSION=5.6.*
- php: 7.3
env: ILLUMINATE_VERSION=5.6.*
- php: nightly
env: ILLUMINATE_VERSION=5.6.*
# Laravel 5.7.*
- php: 7.1
env: ILLUMINATE_VERSION=5.7.*
- php: 7.2
env: ILLUMINATE_VERSION=5.7.*
- php: 7.3
env: ILLUMINATE_VERSION=5.7.*
- php: nightly
env: ILLUMINATE_VERSION=5.7.*
# Laravel 5.8.*
- php: 7.1
env: ILLUMINATE_VERSION=5.8.*
# Laravel 6.x
- php: 7.2
env: ILLUMINATE_VERSION=5.8.*
env: ILLUMINATE_VERSION=6.x
- php: 7.3
env: ILLUMINATE_VERSION=5.8.*
env: ILLUMINATE_VERSION=6.x
- php: nightly
env: ILLUMINATE_VERSION=5.8.*
# Laravel 6.0.*
env: ILLUMINATE_VERSION=6.x
# Laravel 7.x
- php: 7.2
env: ILLUMINATE_VERSION=6.0.*
env: ILLUMINATE_VERSION=7.x
- php: 7.3
env: ILLUMINATE_VERSION=6.0.*
env: ILLUMINATE_VERSION=7.x
- php: 7.4
env: ILLUMINATE_VERSION=7.x
- php: nightly
env: ILLUMINATE_VERSION=6.0.*
env: ILLUMINATE_VERSION=7.x
allow_failures:
- php: 7.3
- php: 7.4
- php: nightly
fast_finish: true

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"react/zmq": "^0.4.0"
},
"require-dev": {
"orchestra/testbench": "~3.0"
"orchestra/testbench": "~3.0 | 4.x | 5.x"
},
"autoload": {
"psr-4" : {
Expand Down
8 changes: 4 additions & 4 deletions src/Broadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace Denpa\ZeroMQ;

use Denpa\ZeroMQ\Manager as ZeroMQ;
use Illuminate\Broadcasting\Broadcasters\Broadcaster as IlluminateBroadcaster;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Denpa\ZeroMQ\Manager as ZeroMQ;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Illuminate\Broadcasting\Broadcasters\Broadcaster as IlluminateBroadcaster;

class Broadcaster extends IlluminateBroadcaster
{
Expand Down Expand Up @@ -71,7 +71,7 @@ public function auth($request)
*
* @return string
*/
public function validAuthenticationResponse($request, $result) : string
public function validAuthenticationResponse($request, $result): string
{
if (is_bool($result)) {
return json_encode($result);
Expand All @@ -92,7 +92,7 @@ public function validAuthenticationResponse($request, $result) : string
*
* @return void
*/
public function broadcast(array $channels, $event, array $payload = []) : void
public function broadcast(array $channels, $event, array $payload = []): void
{
$connection = $this->zeromq->connection($this->connection);

Expand Down
22 changes: 11 additions & 11 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Denpa\ZeroMQ;

use ZMQ;
use React\ZMQ\Context;
use React\EventLoop\LoopInterface;
use React\ZMQ\Context;
use React\ZMQ\SocketWrapper as Socket;
use ZMQ;

class Connection
{
Expand Down Expand Up @@ -64,7 +64,7 @@ public function __call($method, array $parameters = [])
*
* @return self
*/
public function setContext(Context $context) : self
public function setContext(Context $context): self
{
$this->context = $context;

Expand All @@ -76,7 +76,7 @@ public function setContext(Context $context) : self
*
* @return \React\ZMQ\Context
*/
public function getContext() : Context
public function getContext(): Context
{
return $this->context;
}
Expand All @@ -89,7 +89,7 @@ public function getContext() : Context
*
* @return \React\EventLoop\LoopInterface
*/
public function publish(array $channels, $message) : LoopInterface
public function publish(array $channels, $message): LoopInterface
{
$socket = $this->context->getSocket(ZMQ::SOCKET_PUB);

Expand All @@ -111,7 +111,7 @@ public function publish(array $channels, $message) : LoopInterface
*
* @return \React\EventLoop\LoopInterface
*/
public function pull(callable $callback) : LoopInterface
public function pull(callable $callback): LoopInterface
{
$socket = $this->context->getSocket(ZMQ::SOCKET_PULL);
$socket->bind($this->getDsn());
Expand All @@ -133,7 +133,7 @@ public function pull(callable $callback) : LoopInterface
*
* @return \React\EventLoop\LoopInterface
*/
public function push($message) : LoopInterface
public function push($message): LoopInterface
{
$socket = $this->context->getSocket(ZMQ::SOCKET_PUSH);

Expand All @@ -153,7 +153,7 @@ public function push($message) : LoopInterface
*
* @return \React\EventLoop\LoopInterface
*/
public function subscribe(array $channels, callable $callback) : LoopInterface
public function subscribe(array $channels, callable $callback): LoopInterface
{
$socket = $this->context->getSocket(ZMQ::SOCKET_SUB);

Expand Down Expand Up @@ -182,7 +182,7 @@ public function subscribe(array $channels, callable $callback) : LoopInterface
*
* @return void
*/
protected function onSuccess(string $message, callable $callback, ?Socket $socket) : void
protected function onSuccess(string $message, callable $callback, ?Socket $socket): void
{
if ($callback($message) === false) {
if (! $socket->closed) {
Expand All @@ -198,7 +198,7 @@ protected function onSuccess(string $message, callable $callback, ?Socket $socke
*
* @return string
*/
protected function formatMessage($message) : string
protected function formatMessage($message): string
{
return is_array($message) || is_object($message) ?
json_encode($message) : $message;
Expand All @@ -209,7 +209,7 @@ protected function formatMessage($message) : string
*
* @return string
*/
protected function getDsn() : string
protected function getDsn(): string
{
$protocol = $this->config['protocol'] ?? 'tcp';

Expand Down
2 changes: 1 addition & 1 deletion src/Facades/ZeroMQ.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ZeroMQ extends Facade
*
* @return string
*/
protected static function getFacadeAccessor() : string
protected static function getFacadeAccessor(): string
{
return 'zeromq';
}
Expand Down
16 changes: 8 additions & 8 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace Denpa\ZeroMQ;

use React\ZMQ\Context;
use InvalidArgumentException;
use React\EventLoop\LoopInterface;
use React\EventLoop\Factory as EventLoop;
use React\EventLoop\LoopInterface;
use React\ZMQ\Context;

class Manager
{
Expand Down Expand Up @@ -71,7 +71,7 @@ public function __destruct()
*
* @return self
*/
public function setLoop(LoopInterface $loop) : self
public function setLoop(LoopInterface $loop): self
{
$this->loop = $loop;

Expand All @@ -85,7 +85,7 @@ public function setLoop(LoopInterface $loop) : self
*
* @return \Denpa\ZeroMQ\Connection
*/
public function connection(?string $name = null) : Connection
public function connection(?string $name = null): Connection
{
$name = $name ?: 'default';

Expand All @@ -103,7 +103,7 @@ public function connection(?string $name = null) : Connection
*
* @return \Denpa\ZeroMQ\Connection
*/
public function resolve(?string $name = null) : Connection
public function resolve(?string $name = null): Connection
{
$name = $name ?: 'default';

Expand All @@ -123,7 +123,7 @@ public function resolve(?string $name = null) : Connection
*
* @return \Denpa\ZeroMQ\Connection
*/
public function make(array $config) : Connection
public function make(array $config): Connection
{
return new Connection(new Context($this->loop), $this->loop, $config);
}
Expand All @@ -133,7 +133,7 @@ public function make(array $config) : Connection
*
* @return void
*/
public function run() : void
public function run(): void
{
$this->loop->run();
}
Expand All @@ -143,7 +143,7 @@ public function run() : void
*
* @return void
*/
public function stop() : void
public function stop(): void
{
$this->loop->stop();
$this->stopped = true;
Expand Down
12 changes: 6 additions & 6 deletions src/Providers/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Denpa\ZeroMQ\Providers;

use Denpa\ZeroMQ\Manager;
use Denpa\ZeroMQ\Broadcaster;
use Denpa\ZeroMQ\Manager;
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;

class ServiceProvider extends IlluminateServiceProvider
Expand All @@ -15,7 +15,7 @@ class ServiceProvider extends IlluminateServiceProvider
*
* @return void
*/
public function boot() : void
public function boot(): void
{
$path = realpath(__DIR__.'/../../config/config.php');

Expand All @@ -33,7 +33,7 @@ public function boot() : void
*
* @return void
*/
public function register() : void
public function register(): void
{
$this->registerAliases();

Expand All @@ -46,7 +46,7 @@ public function register() : void
*
* @return void
*/
protected function registerAliases() : void
protected function registerAliases(): void
{
$aliases = [
'zeromq' => 'Denpa\ZeroMQ\Manager',
Expand All @@ -65,7 +65,7 @@ protected function registerAliases() : void
*
* @return void
*/
public function registerManager() : void
public function registerManager(): void
{
$this->app->singleton('zeromq', function ($app) {
return new Manager(config('zeromq.connections'));
Expand All @@ -77,7 +77,7 @@ public function registerManager() : void
*
* @return void
*/
public function registerConnection() : void
public function registerConnection(): void
{
$this->app->bind('zeromq.connection', function ($app) {
return $app['zeromq']->connection();
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @return \Denpa\ZeroMQ\Manager
*/
function zeromq() : Manager
function zeromq(): Manager
{
return app('zeromq');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/BroadcasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function makeChannelName($name, ...$args)
*
* @return void
*/
public function setUp() : void
public function setUp(): void
{
parent::setUp();

Expand Down
4 changes: 2 additions & 2 deletions tests/ManagerTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use React\ZMQ\Context;
use Denpa\ZeroMQ\Manager;
use Denpa\ZeroMQ\Connection;
use Denpa\ZeroMQ\Manager;
use React\ZMQ\Context;

class ManagerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ProviderTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Denpa\ZeroMQ\Manager;
use Denpa\ZeroMQ\Connection;
use Denpa\ZeroMQ\Manager;

class ProviderTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Illuminate\Support\Str;
use Denpa\ZeroMQ\Providers\ServiceProvider;
use Illuminate\Support\Str;
use Orchestra\Testbench\TestCase as OrchestraTestCase;

abstract class TestCase extends OrchestraTestCase
Expand Down

0 comments on commit 57b3782

Please sign in to comment.