Skip to content

Commit

Permalink
Github actions changes. try
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-nuwber committed Apr 23, 2024
1 parent 576db8c commit 2c8a535
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 34 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/static-code-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# .github/workflows/static-code-analysis.yml
name: Static code analysis

on: [push]

jobs:
static-code-analysis:
types:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: PhpCS
uses: docker://jakzal/phpqa:php8.2-alpine
with:
args: phpcs --no-interaction --ansi --standard=psr12 --extensions=php --error-severity=1 --warning-severity=8 src
- name: PhpMd
uses: docker://jakzal/phpqa:php8.2-alpine
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
args: phpmd src
- name: parallel-lint
uses: docker://jakzal/phpqa:php8.2-alpine
php-version: 8.2
tools: composer:v2
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v3
with:
args: parallel-lint src
timeout_minutes: 5
max_attempts: 5
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress

- name: Execute type checking
run: vendor/bin/phpstan --configuration="phpstan.neon.dist"
13 changes: 0 additions & 13 deletions .phpqa.yml

This file was deleted.

5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"illuminate/support": "9.0 - 11.0",
"illuminate/events": "9.0 - 11.0",
"illuminate/console": "9.0 - 11.0",
"illuminate/container": "9.0 - 11.0"
"illuminate/container": "9.0 - 11.0",
"phpstan/phpstan": "^1.10"
},
"replace": {
"rabbitevents/foundation": "self.version",
Expand All @@ -26,7 +27,7 @@
},
"require-dev": {
"mockery/mockery": "^1.6.0",
"phpunit/phpunit": "^11.0",
"phpunit/phpunit": "^10.5|^11.0",
"vlucas/phpdotenv": "^v5.4.1"
},
"autoload": {
Expand Down
6 changes: 6 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
paths:
- src
level: 0
ignoreErrors:
- "#Unsafe usage of new static#"
3 changes: 0 additions & 3 deletions src/RabbitEvents/Foundation/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

namespace RabbitEvents\Foundation;

use Illuminate\Container\Container;
use Illuminate\Contracts\Container\BindingResolutionException;
use Interop\Amqp\AmqpMessage;
use JsonSerializable;
use RabbitEvents\Foundation\Amqp\MessageFactory;
use RabbitEvents\Foundation\Contracts\Transport;
use RabbitEvents\Foundation\Support\Payload;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function registerPublishing()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/config/rabbitevents.php' => config_path('rabbitevents.php'),
__DIR__ . '/config/rabbitevents.php' => $this->app->configPath('rabbitevents.php'),
], 'rabbitevents-config');
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/RabbitEvents/Listener/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Events\Dispatcher as BaseDispatcher;
use function PHPUnit\Framework\throwException;

class Dispatcher extends BaseDispatcher
{
Expand Down Expand Up @@ -192,6 +193,8 @@ protected function createMiddlewareCallable($mixed): callable
if (is_string($mixed)) {
return $this->createClassCallable($mixed);
}

throw new \RuntimeException('Invalid middleware definition');
}

protected function handlerShouldBeQueued($class): bool
Expand Down
3 changes: 1 addition & 2 deletions src/RabbitEvents/Listener/Message/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,9 @@ public function process(Message $message, ListenerOptions $options): void
*
* @param Handler $handler
* @param ListenerOptions $options
* @return mixed
* @throws Throwable
*/
public function runHandler(Handler $handler, ListenerOptions $options): mixed
public function runHandler(Handler $handler, ListenerOptions $options)
{
try {
$this->raiseBeforeEvent($handler);
Expand Down

0 comments on commit 2c8a535

Please sign in to comment.