Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-kulhanek committed Jan 23, 2024
1 parent e9efbee commit 64b81be
Show file tree
Hide file tree
Showing 119 changed files with 5,425 additions and 5,505 deletions.
26 changes: 0 additions & 26 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
github: [tomas-kulhanek, vojmani]
custom: [ "https://www.paypal.me/helppc" ]
41 changes: 26 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,33 @@ env:
composer-install-args: "--no-progress --no-interaction --prefer-dist --no-scripts"

jobs:
rector:
name: "Quality assurance"
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.3' ]
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none

- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-version }}
args: "${{ env.composer-install-args }}"
- run: composer check:rector

qa:
name: "Quality assurance"
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ '8.1', '8.2', '8.3' ]
php-version: ['8.3']
fail-fast: false

steps:
Expand All @@ -30,7 +51,7 @@ jobs:
with:
php_version: ${{ matrix.php-version }}
args: "${{ env.composer-install-args }}"
- run: vendor/bin/ecs check src tests
- run: composer check:cs

static-analysis:
name: "Static analysis"
Expand All @@ -53,11 +74,7 @@ jobs:
args: "${{ env.composer-install-args }}"

- name: PHPStan Static Analysis
uses: php-actions/phpstan@v3
with:
configuration: phpstan.neon
memory_limit: 256M
php_version: ${{ matrix.php-version }}
run: composer check:phpstan

tests:
name: "Tests"
Expand Down Expand Up @@ -109,15 +126,9 @@ jobs:
PFO_LOGIN_USER: op://mafzpsiebs3jzo6sijs5rtfeg4/6g5plyqgiqxexvefr4nvtos4xu/username
PFO_PASSWORD_USER: op://mafzpsiebs3jzo6sijs5rtfeg4/6g5plyqgiqxexvefr4nvtos4xu/password
- name: PHPUnit
uses: php-actions/phpunit@v3
run: composer test:phpunit
env:
XDEBUG_MODE: coverage
CERT_PRIV: '${{ secrets.CERT_PRIV }}'
CERT_PUB: '${{ secrets.CERT_PUB }}'
CERT_PASSPHRASE: '${{ secrets.CERT_PASSPHRASE }}'
with:
bootstrap: vendor/autoload.php
configuration: phpunit.xml
php_version: ${{ matrix.php-version }}
php_extensions: "${{ env.extensions }}"
version: "10.2"
CERT_PASSPHRASE: '${{ secrets.CERT_PASSPHRASE }}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ vendor
tests/_data/test.p12
tests/_reports
.data
compose.yaml
39 changes: 9 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,13 @@
FROM composer:2 AS composer

FROM ghcr.io/tomas-kulhanek/docker-application:main AS builder
WORKDIR /var/www
RUN apt-get -y --no-install-recommends update && \
apt-get -y --no-install-recommends install git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /var/cache/apt/lists
FROM php:latest

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY ./composer.* ./
RUN composer install --no-dev --no-progress --no-interaction --no-scripts
RUN apt-get update \
&& apt-get install -y libzip-dev zlib1g-dev zlib1g-dev zip git libfcgi-bin jq librabbitmq-dev libpng-dev libonig-dev unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/list/* \
&& docker-php-ext-install pdo_mysql bcmath gd mysqli \
&& docker-php-ext-configure bcmath --enable-bcmath \
&& docker-php-ext-configure zip


FROM ghcr.io/tomas-kulhanek/docker-application:main AS development
WORKDIR /var/www
RUN apt-get -y --no-install-recommends update && \
apt-get -y --no-install-recommends upgrade && \
apt-get -y --no-install-recommends install git vim curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /var/cache/apt/lists

COPY --from=composer /usr/bin/composer /usr/bin/composer


FROM ghcr.io/tomas-kulhanek/docker-application:main
WORKDIR /var/www
RUN apt-get -y --no-install-recommends update && \
apt-get -y --no-install-recommends upgrade && \
apt-get -y --no-install-recommends install curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /var/cache/apt/lists
COPY --from=builder /var/www .
COPY . ./
COPY --from=composer /usr/bin/composer /usr/bin/composer
57 changes: 0 additions & 57 deletions LICENSE

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Tomas Kulhanek

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 the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 34 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"name": "tomas-kulhanek/czech-data-box",
"homepage": "https://tomaskulhanek.cz",
"description": "PHP library for connection to Integrated system of data box (ISDS) in Czech republic",
"license": "MIT",
"authors": [
{
"name": "Tomáš Kulhánek",
"email": "[email protected]",
"homepage": "https://github.com/tomas-kulhanek"
}
],
"keywords": [
"isds",
"datovky",
Expand All @@ -13,20 +20,6 @@
"issues": "https://github.com/tomas-kulhanek/czech-data-box/issues",
"source": "https://github.com/tomas-kulhanek/czech-data-box"
},
"license": [
"BSD-3-Clause",
"GPL-2.0",
"GPL-3.0"
],
"authors": [
{
"name": "Tomas Kulhanek",
"homepage": "https://tomaskulhanek.cz"
},
{
"name": "Vojtech Krupka"
}
],
"require": {
"php": ">=8.1",
"ext-curl": "*",
Expand Down Expand Up @@ -56,12 +49,34 @@
"guzzlehttp/guzzle": "^7.3",
"nyholm/psr7": "^1.4",
"php-http/httplug": "^2.2",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.2",
"rector/rector": "^0.17.7",
"symfony/http-client": "5.4.*|6.*",
"symplify/easy-coding-standard": "^12.0"
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"rector/rector": "^0.19.2",
"squizlabs/php_codesniffer": "^3.7"
},
"scripts": {
"check": [
"@phpstan",
"@phpcs",
"@phpunit"
],
"test:phpunit": "php -d xdebug.mode=off vendor/phpunit/phpunit/phpunit",
"check:phpstan": "php -d memory_limit=512M vendor/bin/phpstan analyse -c phpstan.neon",
"check:rector": "php vendor/bin/rector process src tests public --dry-run",
"check:cs": "phpcs --extensions=php --standard=PSR12 -n src tests",
"fix:cs": "phpcbf --extensions=php --standard=PSR12 -n src tests",
"fix:rector": "php vendor/bin/rector process src tests public",
"fix:all": [
"@fix:rector",
"@fix:cs"
],
"check:all": [
"@check:phpstan",
"@check:rector",
"@check:cs"
]
},
"archive": {
"exclude": [
"/tests"
Expand Down
15 changes: 0 additions & 15 deletions docker-compose.yml

This file was deleted.

20 changes: 0 additions & 20 deletions ecs.php

This file was deleted.

7 changes: 2 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
parameters:
level: 8
level: 7
paths:
- src
fileExtensions:
- php

- src/
11 changes: 5 additions & 6 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" failOnRisky="true" failOnWarning="true" cacheDirectory=".phpunit.cache" requireCoverageMetadata="false" beStrictAboutCoverageMetadata="false">
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" beStrictAboutTestsThatDoNotTestAnything="false" beStrictAboutOutputDuringTests="true" failOnRisky="true" executionOrder="random" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="default">
<directory>tests</directory>
<testsuite name="all">
<directory>./tests</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<include>
<directory suffix=".php">src</directory>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
Loading

0 comments on commit 64b81be

Please sign in to comment.