Skip to content

Commit 1db2067

Browse files
committed
Updated fapi-cz/http-client version to 1.0, min php version 8.1
1 parent 010fb23 commit 1db2067

69 files changed

Lines changed: 555 additions & 645 deletions

File tree

Some content is hidden

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

.docker-fapi-client/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
help: ## list available targets (this page)
2+
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%-45s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
3+
4+
dc-up: ## run all containers in background
5+
docker-compose up -d --build
6+
7+
dc-up-front: ## run all containers in foreground
8+
docker-compose up --build
9+
10+
dc-down: ## stop all containers
11+
docker-compose down
12+
13+
dc-rebuild: ## rebuild containers
14+
make dc-down
15+
make dc-up
16+
17+
d-ls: ## show all running containers
18+
docker container ls
19+
20+
d-cleanup: ## clear docker storage from all stopped containers
21+
docker system prune -a
22+
docker volume prune
23+
24+
d-unfuck: ## stop, delete all and return to factory state
25+
make dc-down
26+
make d-cleanup
27+
make dc-up
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3.6'
2+
3+
services:
4+
app:
5+
build:
6+
context: fapi-client
7+
container_name: fapi-client
8+
user: "1000:1000"
9+
volumes:
10+
- ../:/fapi-client
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM php:8.1-fpm-alpine
2+
3+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
4+
5+
WORKDIR /fapi-client

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
strategy:
2323
matrix:
24-
php-version: [ '7.4' ]
24+
php-version: [ '8.1', '8.2' ]
2525
operating-system: [ 'ubuntu-latest' ]
2626
fail-fast: false
2727

@@ -80,7 +80,7 @@ jobs:
8080

8181
strategy:
8282
matrix:
83-
php-version: [ '7.4' ]
83+
php-version: [ '8.1', '8.2' ]
8484
operating-system: [ 'ubuntu-latest' ]
8585
fail-fast: false
8686

@@ -136,7 +136,7 @@ jobs:
136136

137137
strategy:
138138
matrix:
139-
php-version: [ '7.1', '7.2', '7.3', '7.4', '8.0' ]
139+
php-version: [ '8.1', '8.2' ]
140140
operating-system: [ 'ubuntu-latest' ]
141141
composer-args: [ '' ]
142142

@@ -194,7 +194,7 @@ jobs:
194194

195195
strategy:
196196
matrix:
197-
php-version: [ '7.4' ]
197+
php-version: [ '8.1', '8.2' ]
198198
operating-system: [ 'ubuntu-latest' ]
199199
fail-fast: false
200200

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# print help -
2+
help: ## List available targets (this page)
3+
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%-45s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
4+
5+
cs: ## Check code style
6+
docker exec fapi-client /bin/sh -c 'bin/cs'
7+
8+
cbf: ## Fix code style
9+
docker exec fapi-client /bin/sh -c 'bin/cbf'
10+
11+
stan: ## Fix code style
12+
docker exec fapi-client /bin/sh -c 'bin/stan'
13+
14+
test: ## Run tests
15+
docker exec fapi-client /bin/sh -c 'bin/tests'

bin/tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ declare(strict_types = 1);
88
)
99
. ' -C '
1010
. ' '
11-
. '../tests',
11+
. __DIR__ . '/../tests',
1212
$return
1313
);
1414

composer.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=7.1",
14-
"fapi-cz/http-client": "^0.1"
13+
"php": "^8.1",
14+
"fapi-cz/http-client": "^1.0"
1515
},
1616
"require-dev": {
17-
"nette/tester": ">=2.3",
18-
"nette/di": "^3.0",
19-
"nette/utils": "^3.1",
20-
"guzzlehttp/guzzle": "^6.3 | ^7.0",
21-
"tracy/tracy": ">=2.7",
22-
"phpstan/phpstan-nette": "^0.12.17",
23-
"phpstan/phpstan": "^0.12.85",
24-
"orisai/coding-standard": "^1.1",
25-
"phpstan/phpstan-strict-rules": "^0.12.9"
17+
"nette/tester": "^2.5",
18+
"nette/di": "^3.1",
19+
"nette/utils": "^4.0",
20+
"guzzlehttp/guzzle": "6.3 | ^7.0",
21+
"tracy/tracy": "^2.10",
22+
"phpstan/phpstan-nette": "^1.2",
23+
"phpstan/phpstan": "^1.10",
24+
"orisai/coding-standard": "^3.10",
25+
"phpstan/phpstan-strict-rules": "^1.5"
2626
},
2727
"suggest": {
2828
"nette/di": "to use class FapiClientExtension"
@@ -31,5 +31,10 @@
3131
"psr-0": {
3232
"Fapi\\FapiClient\\": "src/"
3333
}
34+
},
35+
"config": {
36+
"allow-plugins": {
37+
"dealerdirect/phpcodesniffer-composer-installer": true
38+
}
3439
}
3540
}

readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
[![build](https://github.com/fapi-cz/fapi-client/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/fapi-cz/fapi-client/actions/workflows/main.yml)
32
[![codecov](https://codecov.io/gh/fapi-cz/fapi-client/branch/master/graph/badge.svg)](https://codecov.io/gh/fapi-cz/fapi-client)
43
[![Maintainability](https://api.codeclimate.com/v1/badges/f364fbba86383aaab443/maintainability)](https://codeclimate.com/github/fapi-cz/php-client/maintainability)

src/Fapi/FapiClient/DI/FapiClientExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class FapiClientExtension extends CompilerExtension
1515
{
1616

1717
/** @var array<mixed> */
18-
public $defaults = [
18+
public array $defaults = [
1919
'username' => '',
2020
'password' => '',
2121
'apiUrl' => 'https://api.fapi.cz/',

src/Fapi/FapiClient/EndPoints/ClientChanges.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,12 @@
77
final class ClientChanges
88
{
99

10-
/** @var FapiRestClient */
11-
private $client;
10+
private string $path;
1211

13-
/** @var string */
14-
private $path;
12+
private string $resources;
1513

16-
/** @var string */
17-
private $resources;
18-
19-
public function __construct(FapiRestClient $client)
14+
public function __construct(private FapiRestClient $client)
2015
{
21-
$this->client = $client;
2216
$this->path = '/client-changes';
2317
$this->resources = 'client_changes';
2418
}
@@ -32,7 +26,7 @@ public function findAll(int $clientId, array $parameters = []): array
3226
return $this->client->getResources(
3327
$this->path . '/search',
3428
$this->resources,
35-
['client' => $clientId] + $parameters
29+
['client' => $clientId] + $parameters,
3630
);
3731
}
3832

0 commit comments

Comments
 (0)