Skip to content

Commit 972b2d4

Browse files
authored
Merge pull request #14 from ensi-platform/laravel-11
laravel-11
2 parents f7836fd + bf657f0 commit 972b2d4

File tree

9 files changed

+148
-10
lines changed

9 files changed

+148
-10
lines changed

.github/CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
Please read and understand the contribution guide before creating an issue or pull request.
6+
7+
## Etiquette
8+
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10+
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11+
extremely unfair for them to suffer abuse or anger for their hard work.
12+
13+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14+
world that developers are civilized and selfless people.
15+
16+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17+
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18+
19+
## Viability
20+
21+
When requesting or submitting new features, first consider whether it might be useful to others. Open
22+
source projects are used by many developers, who may have entirely different needs to your own. Think about
23+
whether or not your feature is likely to be used by other users of the project.
24+
25+
## Procedure
26+
27+
Before filing an issue:
28+
29+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30+
- Check to make sure your feature suggestion isn't already present within the project.
31+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32+
- Check the pull requests tab to ensure that the feature isn't already in progress.
33+
34+
Before submitting a pull request:
35+
36+
- Check the codebase to ensure that your feature doesn't already exist.
37+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38+
39+
## Requirements
40+
41+
If the project maintainer has any additional requirements, you will find them listed here.
42+
43+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
44+
45+
- **Use hooks!** - You can make use of .git hooks if you install them using `npm i`
46+
47+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
48+
49+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
50+
51+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
52+
53+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
54+
55+
**Happy coding**!

.github/SECURITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security Policy
2+
3+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.

.github/workflows/php-cs-fixer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
ref: ${{ github.head_ref }}
14+
15+
- name: Run PHP CS Fixer
16+
uses: docker://oskarstark/php-cs-fixer-ga
17+
with:
18+
args: --config=.php-cs-fixer.php --allow-risky=yes
19+
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: Fix styling

.github/workflows/run-tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: run-tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
php: [8.0, 8.1, 8.2, 8.3]
16+
laravel: [10.*, 11.*]
17+
include:
18+
- laravel: 10.*
19+
testbench: 8.*
20+
- laravel: 11.*
21+
testbench: 9.*
22+
exclude:
23+
- laravel: 10.*
24+
php: 8.0
25+
- laravel: 11.*
26+
php: 8.0
27+
- laravel: 11.*
28+
php: 8.1
29+
30+
name: P${{ matrix.php }} - L${{ matrix.laravel }}
31+
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v2
36+
37+
- name: Setup PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: ${{ matrix.php }}
41+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, rdkafka
42+
coverage: none
43+
44+
- name: Setup problem matchers
45+
run: |
46+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
47+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
48+
- name: Install dependencies
49+
run: |
50+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
51+
composer update --prefer-stable --prefer-dist --no-interaction
52+
- name: Execute tests
53+
run: composer test

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
"require": {
1919
"php": "^8.0",
2020
"ext-rdkafka": "*",
21-
"ensi/laravel-phprdkafka": "^0.3",
22-
"illuminate/contracts": "^8.37 || ^9.0 || ^10.0",
23-
"illuminate/pipeline": "^8.37 || ^9.0 || ^10.0",
24-
"illuminate/support": "^8.37 || ^9.0 || ^10.0"
21+
"ensi/laravel-phprdkafka": "^0.3.4",
22+
"illuminate/contracts": "^10.0 || ^11.0",
23+
"illuminate/pipeline": "^10.0 || ^11.0",
24+
"illuminate/support": "^10.0 || ^11.0"
2525
},
2626
"require-dev": {
2727
"brianium/paratest": "^6.2 || ^7.0",
2828
"friendsofphp/php-cs-fixer": "^3.2",
2929
"kwn/php-rdkafka-stubs": "^2.2",
30-
"nunomaduro/collision": "^5.3 || ^6.0 || ^7.0",
31-
"orchestra/testbench": "^6.15 || ^7.0 || ^8.0",
30+
"nunomaduro/collision": "^6.0 || ^7.0 || ^8.1",
31+
"orchestra/testbench": "^8.0 || ^9.0",
3232
"pestphp/pest": "^1.18 || ^2.0",
3333
"pestphp/pest-plugin-laravel": "^1.1 || ^2.0",
3434
"php-parallel-lint/php-var-dump-check": "^0.5.0",
35-
"phpunit/phpunit": "^9.3 || ^10.0",
35+
"phpunit/phpunit": "^10.0 || ^11.0",
3636
"spatie/laravel-ray": "^1.9"
3737
},
3838
"autoload": {

src/Commands/KafkaCheckOffsetsCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ protected function checkTopic(string $consumerName, string $topicName): bool
3232
$partitions = $consumer->getPartitions($topicName);
3333
if (!$partitions) {
3434
$this->getOutput()->writeln(" <fg=red>Topic {$topicName} doesn't exists!</>");
35+
3536
return false;
3637
}
3738
$success = true;

src/Commands/KafkaConsumeCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ public function getSubscribedSignals(): array
4040
return $this->getStopSignalsFromConfig();
4141
}
4242

43-
public function handleSignal(int $signal): void
43+
public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
4444
{
45-
if ($this->consumer && in_array($signal, $this->getStopSignalsFromConfig())) {
45+
if ($this->consumer) {
4646
$this->line("Stopping the consumer...");
4747
$this->consumer->forceStop();
4848
}
49+
50+
return $previousExitCode;
4951
}
5052

5153
/**

src/Commands/KafkaSetOffset.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function handle()
2727

2828
if (!in_array($offset, [self::EARLIEST, self::LATEST]) && !is_numeric($offset)) {
2929
$this->getOutput()->writeln("<fg=red>Error: Invalid offset</>");
30+
3031
return self::INVALID;
3132
}
3233

src/HighLevelConsumer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function setOffset(string $topicName, int $partitionId, int $offset): voi
186186
$topicName,
187187
$partitionId,
188188
$offset
189-
)
189+
),
190190
]);
191191
}
192192
}

0 commit comments

Comments
 (0)