Skip to content

Commit cfa168a

Browse files
authored
initial-release (#2)
* save work * add jc as author * add chat url * up to 7.4 * save work * save work * small fixes (#3) * small fixes * fix return type * update docker comments * add issue template
1 parent a7d5296 commit cfa168a

File tree

92 files changed

+7020
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+7020
-1
lines changed

.circleci/config.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
version: 2.1
2+
3+
orbs:
4+
ci-caching: jobcloud/[email protected]
5+
ci-php: jobcloud/[email protected]
6+
7+
workflows:
8+
test-php-simple-kafka-lib:
9+
jobs:
10+
- ci-caching/build-docker-images:
11+
dockerComposeFile: "./docker/docker-compose.yml"
12+
- ci-php/install-dependencies:
13+
dockerComposeFile: "./docker/docker-compose.yml"
14+
dependencyCheckSumFile: "./composer.json"
15+
requires:
16+
- ci-caching/build-docker-images
17+
- coverage:
18+
requires:
19+
- ci-php/install-dependencies
20+
- ci-php/code-style:
21+
dockerComposeFile: "./docker/docker-compose.yml"
22+
dependencyCheckSumFile: "./composer.json"
23+
requires:
24+
- ci-php/install-dependencies
25+
- ci-php/static-analysis:
26+
dockerComposeFile: "./docker/docker-compose.yml"
27+
dependencyCheckSumFile: "./composer.json"
28+
requires:
29+
- ci-php/install-dependencies
30+
- ci-php/infection-testing:
31+
dockerComposeFile: "./docker/docker-compose.yml"
32+
dependencyCheckSumFile: "./composer.json"
33+
requires:
34+
- ci-php/install-dependencies
35+
36+
jobs:
37+
coverage:
38+
machine: true
39+
steps:
40+
- ci-php/coverage-command:
41+
dockerComposeFile: "./docker/docker-compose.yml"
42+
dependencyCheckSumFile: "./composer.json"
43+
- run:
44+
name: Download cc-test-reporter
45+
command: |
46+
mkdir -p tmp/
47+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
48+
chmod +x ./tmp/cc-test-reporter
49+
- run:
50+
name: Upload coverage results to Code Climate
51+
command: |
52+
./tmp/cc-test-reporter after-build -p /var/www/html --coverage-input-type clover --exit-code $?

.github/FUNDING.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: [nick-zh]

.github/ISSUE_TEMPLATE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!--
2+
Please always include the following in an issue:
3+
-->
4+
5+
* PHP version:
6+
* simple-kafka-client version:
7+
* php-simple-kafka-lib version:

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/build/
2+
/vendor/
3+
/.idea
4+
/composer.symlink
5+
composer.lock
6+
.phpunit.result.cache
7+
clover.xml

LICENSE

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019 JobCloud AG
4+
Copyright (c) 2021, Nick Chiu
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
10+
1. Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
2. Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
3. Neither the name of the copyright holder nor the names of its
18+
contributors may be used to endorse or promote products derived from
19+
this software without specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+

Makefile

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.PHONY: clean code-style coverage help test static-analysis install-dependencies install-dependencies-lowest update-dependencies pcov-enable pcov-disable infection-testing
2+
.DEFAULT_GOAL := test
3+
4+
PHPUNIT = ./vendor/bin/phpunit -c ./phpunit.xml
5+
PHPSTAN = ./vendor/bin/phpstan
6+
PHPCS = ./vendor/bin/phpcs --extensions=php
7+
CONSOLE = ./bin/console
8+
INFECTION = ./vendor/bin/infection
9+
10+
clean:
11+
rm -rf ./build ./vendor
12+
13+
code-style: pcov-disable
14+
mkdir -p build/logs/phpcs
15+
${PHPCS} --report-full --report-gitblame --standard=PSR12 ./src --exclude=Generic.Commenting.Todo --report-junit=build/logs/phpcs/junit.xml
16+
17+
coverage: pcov-enable
18+
${PHPUNIT} && ./vendor/bin/coverage-check clover.xml 100
19+
20+
test: pcov-disable
21+
${PHPUNIT}
22+
23+
static-analysis: pcov-disable
24+
mkdir -p build/logs/phpstan
25+
${PHPSTAN} analyse --no-progress --memory-limit=64
26+
27+
update-dependencies:
28+
composer update
29+
30+
install-dependencies:
31+
composer install
32+
33+
install-dependencies-lowest:
34+
composer install --prefer-lowest
35+
36+
infection-testing:
37+
make coverage
38+
cp -f build/logs/phpunit/junit.xml build/logs/phpunit/coverage/junit.xml
39+
sudo php-ext-disable pcov
40+
${INFECTION} --coverage=build/logs/phpunit/coverage --min-msi=93 --threads=`nproc`
41+
sudo php-ext-enable pcov
42+
43+
pcov-enable:
44+
sudo php-ext-enable pcov
45+
46+
pcov-disable:
47+
sudo php-ext-disable pcov
48+
49+
help:
50+
# Usage:
51+
# make <target> [OPTION=value]
52+
#
53+
# Targets:
54+
# clean Cleans the coverage and the vendor directory
55+
# code-style Check codestyle using phpcs
56+
# coverage Generate code coverage (html, clover)
57+
# help You're looking at it!
58+
# test (default) Run all the tests with phpunit
59+
# static-analysis Run static analysis using phpstan
60+
# infection-testing Run infection/mutation testing
61+
# install-dependencies Run composer install
62+
# install-dependencies-lowest Run composer install with --prefer-lowest
63+
# update-dependencies Run composer update
64+
# pcov-enable Enable pcov
65+
# pcov-disable Disable pcov

0 commit comments

Comments
 (0)