-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from vldmr-k/phpstan-fixing
Phpstan fixing
- Loading branch information
Showing
58 changed files
with
1,067 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ARG VERSION | ||
|
||
FROM php:${VERSION}-cli-alpine | ||
|
||
WORKDIR /app | ||
|
||
RUN apk --no-cache add pcre-dev ${PHPIZE_DEPS} \ | ||
&& pecl install xdebug \ | ||
&& apk del pcre-dev ${PHPIZE_DEPS} | ||
|
||
RUN docker-php-ext-install -j$(nproc) bcmath | ||
|
||
RUN curl -sS https://getcomposer.org/installer | \ | ||
php -- --2 --install-dir=/usr/local/bin --filename=composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
default_php_version:=7.4 | ||
default_server_port:=8080 | ||
php_version:=$(PHP_VERSION) | ||
server_port:=$(PORT) | ||
|
||
ifndef PHP_VERSION | ||
php_version:=$(default_php_version) | ||
endif | ||
|
||
ifndef PORT | ||
server_port:=$(default_server_port) | ||
endif | ||
|
||
base_dir:=$(shell basename $(CURDIR)) | ||
docker:=docker run --rm -v $(CURDIR):/app -w /app $(base_dir):$(php_version) | ||
|
||
build: | ||
docker build --build-arg VERSION=$(php_version) --tag $(base_dir):$(php_version) . | ||
|
||
exec: | ||
docker run --rm -ti -v $(CURDIR):/app:rw -w /app $(base_dir):$(php_version) sh | ||
|
||
serve: | ||
docker run -p$(server_port):8080 --rm -v $(CURDIR):/app -w /app $(base_dir):$(php_version) php -S 0.0.0.0:8080 | ||
|
||
install: | ||
$(docker) composer install | ||
|
||
install-no-dev: | ||
$(docker) composer install --no-dev | ||
|
||
static-analyze: | ||
$(docker) composer static | ||
|
||
unit: | ||
$(docker) -dzend_extension=xdebug.so -dxdebug.mode=coverage vendor/bin/phpspec run | ||
|
||
all: build install static-analyze unit | ||
|
||
.PHONY: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
### Examples | ||
Before run example, please set global variable `MONO_XTOKEN` | ||
|
||
|
||
###### Retrieve public key | ||
```php | ||
$token = '...'; | ||
$config = new \VldmrK\MonoAcquiring\Config($token); | ||
|
||
$api = new \VldmrK\MonoAcquiring\Api($config); | ||
|
||
$response = $api->call(new \VldmrK\MonoAcquiring\Query\PubkeyQuery()); | ||
|
||
print_r($response->toArray()); // ['key' => '....'] | ||
``` | ||
|
||
###### Merchant Details | ||
```php | ||
$token = '...'; | ||
$config = new \VldmrK\MonoAcquiring\Config($token); | ||
|
||
$api = new \VldmrK\MonoAcquiring\Api($config); | ||
|
||
$response = $api->call(new \VldmrK\MonoAcquiring\Query\DetailsQuery()); | ||
|
||
print_r($response); // [ 'merchantId' => 'test_A4EaPDryzz', 'merchantName' => 'Test Caption'] | ||
``` | ||
|
||
More example you can find here [example/](example/) | ||
|
||
### Run Test | ||
```shell script | ||
make build | ||
make test | ||
``` | ||
|
||
### Coverage | ||
|
||
After run tests, you can check coverage of code | ||
```shell script | ||
make serve | ||
``` | ||
|
||
After that, coverage report will be available by address http://0.0.0.0:8080/spec/_coverage/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.