Skip to content

Commit

Permalink
Merge pull request #14 from algirdas-iterato/feature/upgrade-and-smal…
Browse files Browse the repository at this point in the history
…l-fixes

Updated code to PHP 8.1 standards and some fixes
  • Loading branch information
uro authored Sep 21, 2023
2 parents efeffd5 + 7104a1b commit 4299c78
Show file tree
Hide file tree
Showing 55 changed files with 3,783 additions and 1,546 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
vendor
cov.xml
.vscode
.vscode
.idea
.php-cs-fixer.cache
.phpunit.result.cache
.phpunit.cache
15 changes: 15 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

$finder = new PhpCsFixer\Finder();
$finder
->path('src')
->files()
->name('*.php')
->in(__DIR__);

$config = (new PhpCsFixer\Config())->setFinder($finder);

return $config;

4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM php:8.1-cli AS php-81-dev
RUN apt-get update && apt-get install -y git zip
COPY --from=composer:2.5 /usr/bin/composer /usr/local/bin/composer
RUN docker-php-ext-install bcmath
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build:
docker build --target php-81-dev -t php-81-dev .

ssh:
docker run --rm -it -v $(PWD):/app -w /app php-81-dev bash

composer_install:
docker run --rm -v $(PWD):/app -w /app php-81-dev composer install

phpunit:
docker run --rm -v $(PWD):/app -w /app php-81-dev vendor/bin/phpunit

phpstan:
docker run --rm -v $(PWD):/app -w /app php-81-dev vendor/bin/phpstan analyze

phpcsfixer:
docker run --rm -v $(PWD):/app -w /app php-81-dev vendor/bin/php-cs-fixer fix --dry-run --diff --verbose
12 changes: 7 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
"description": "Teltonika FMXXXX parser library",
"type": "library",
"require": {
"php": ">=7.0",
"mdurrant/php-binary-reader": "^1.0",
"mockery/mockery": "^1.2"
"php": ">=8.1",
"mdurrant/php-binary-reader": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": "^10.0",
"mockery/mockery": "^1.5",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.15"
},
"autoload":{
"psr-4": {
Expand All @@ -21,7 +23,7 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit tests --coverage-clover cov.xml --coverage-text"
"test": "vendor/bin/phpunit tests"
},
"license": "MIT",
"authors": [
Expand Down
Loading

0 comments on commit 4299c78

Please sign in to comment.