Skip to content

Commit f8068a5

Browse files
authored
Merge pull request #7 from wowworks-team/RT-5629
https://wowworks.atlassian.net/browse/RT-5629
2 parents 4d7274a + 001d573 commit f8068a5

21 files changed

+1294
-598
lines changed

.github/workflows/ci-checks.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI-CHECKS
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
run-phpcs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
- name: Install dependencies
15+
uses: php-actions/composer@v6
16+
- name: Run PHPCodesniffer
17+
run: ./vendor/bin/phpcs -p -s --standard=phpcs.xml src tests
18+
run-php-stan:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
- name: Install dependencies
24+
uses: php-actions/composer@v6
25+
- name: Run PHPStan
26+
run: vendor/bin/phpstan analyse -c phpstan.neon.dist
27+
run-php-unit-tests:
28+
needs: [ run-phpcs, run-php-stan ]
29+
if: always()
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v3
34+
- name: Install dependencies
35+
uses: php-actions/composer@v6
36+
- name: Execute tests
37+
run: vendor/bin/phpunit -c phpunit.xml --colors=always --verbose --testdox
38+
run-assemble-php-unit-coverage:
39+
needs: [ run-php-unit-tests ]
40+
if: always()
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v3
45+
- name: Setup PHP
46+
uses: shivammathur/setup-php@v2
47+
with:
48+
php-version: '7.4.0'
49+
coverage: xdebug
50+
- name: Install dependencies
51+
uses: php-actions/composer@v6
52+
- name: Execute tests
53+
run: vendor/bin/phpunit -c phpunit.xml --coverage-text --colors=always --verbose --testdox
54+
env:
55+
XDEBUG_MODE: coverage
56+
- name: Generate test coverage badge
57+
uses: timkrase/phpunit-coverage-badge@v1.2.0
58+
with:
59+
report: ./clover.xml
60+
coverage_badge_path: 'badge.svg'
61+
push_badge: true
62+
repo_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99

1010
#php-cs-fixer
1111
.php_cs.cache
12+
13+
.phpunit.result.cache

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM php:7.4-fpm
2+
RUN apt-get update && apt-get install -y \
3+
zlib1g-dev \
4+
libzip-dev \
5+
unzip \
6+
mc
7+
RUN docker-php-ext-install zip
8+
RUN pecl install xdebug-3.1.5
9+
RUN docker-php-ext-enable xdebug
10+
RUN mkdir -p /home/app
11+
WORKDIR /home/app
12+
COPY . /home/app
13+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Geocoder DaData adapter
55

66
Geocoder DaData adapter. Integration with Dadata suggestions API.
77

8+
![Code Coverage Badge](./badge.svg)
89
[![Latest Stable Version](https://poser.pugx.org/wowworks/geocoder-php-dadata-provider/v/stable)](https://packagist.org/packages/wowworks/geocoder-php-dadata-provider)
910
[![Total Downloads](https://poser.pugx.org/wowworks/geocoder-php-dadata-provider/downloads)](https://packagist.org/packages/wowworks/geocoder-php-dadata-provider)
1011
[![Latest Unstable Version](https://poser.pugx.org/wowworks/geocoder-php-dadata-provider/v/unstable)](https://packagist.org/packages/wowworks/geocoder-php-dadata-provider)

badge.svg

Lines changed: 16 additions & 0 deletions
Loading

clover.xml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<coverage generated="1770121618">
3+
<project timestamp="1770121618">
4+
<package name="Wowworks\Dadata">
5+
<file name="/home/runner/work/geocoder-php-dadata-provider/geocoder-php-dadata-provider/src/DaData.php">
6+
<class name="Wowworks\Dadata\DaData" namespace="Wowworks\Dadata" fullPackage="Dadata" package="Dadata">
7+
<metrics complexity="14" methods="6" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="38" coveredstatements="11" elements="44" coveredelements="15"/>
8+
</class>
9+
<line num="31" type="method" name="__construct" visibility="public" complexity="1" crap="1" count="3"/>
10+
<line num="33" type="stmt" count="3"/>
11+
<line num="34" type="stmt" count="3"/>
12+
<line num="39" type="method" name="geocodeQuery" visibility="public" complexity="1" crap="1" count="1"/>
13+
<line num="41" type="stmt" count="1"/>
14+
<line num="43" type="stmt" count="1"/>
15+
<line num="49" type="method" name="reverseQuery" visibility="public" complexity="1" crap="1" count="1"/>
16+
<line num="51" type="stmt" count="1"/>
17+
<line num="57" type="method" name="getName" visibility="public" complexity="1" crap="1" count="1"/>
18+
<line num="59" type="stmt" count="1"/>
19+
<line num="69" type="method" name="executeQuery" visibility="private" complexity="6" crap="24.97" count="1"/>
20+
<line num="71" type="stmt" count="1"/>
21+
<line num="72" type="stmt" count="1"/>
22+
<line num="73" type="stmt" count="1"/>
23+
<line num="172" type="stmt" count="1"/>
24+
<line num="173" type="stmt" count="1"/>
25+
<line num="176" type="stmt" count="0"/>
26+
<line num="177" type="stmt" count="0"/>
27+
<line num="178" type="stmt" count="0"/>
28+
<line num="180" type="stmt" count="0"/>
29+
<line num="182" type="stmt" count="0"/>
30+
<line num="184" type="stmt" count="0"/>
31+
<line num="185" type="stmt" count="0"/>
32+
<line num="186" type="stmt" count="0"/>
33+
<line num="187" type="stmt" count="0"/>
34+
<line num="188" type="stmt" count="0"/>
35+
<line num="189" type="stmt" count="0"/>
36+
<line num="191" type="stmt" count="0"/>
37+
<line num="192" type="stmt" count="0"/>
38+
<line num="194" type="stmt" count="0"/>
39+
<line num="195" type="stmt" count="0"/>
40+
<line num="197" type="stmt" count="0"/>
41+
<line num="198" type="stmt" count="0"/>
42+
<line num="201" type="stmt" count="0"/>
43+
<line num="202" type="stmt" count="0"/>
44+
<line num="203" type="stmt" count="0"/>
45+
<line num="206" type="stmt" count="0"/>
46+
<line num="209" type="method" name="generateStreetNumber" visibility="private" complexity="4" crap="20" count="0"/>
47+
<line num="211" type="stmt" count="0"/>
48+
<line num="213" type="stmt" count="0"/>
49+
<line num="214" type="stmt" count="0"/>
50+
<line num="217" type="stmt" count="0"/>
51+
<line num="218" type="stmt" count="0"/>
52+
<line num="221" type="stmt" count="0"/>
53+
<metrics loc="223" ncloc="108" classes="1" methods="6" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="38" coveredstatements="11" elements="44" coveredelements="15"/>
54+
</file>
55+
</package>
56+
<package name="Wowworks\Dadata\Exception">
57+
<file name="/home/runner/work/geocoder-php-dadata-provider/geocoder-php-dadata-provider/src/Exception/NotImplementedException.php">
58+
<class name="Wowworks\Dadata\Exception\NotImplementedException" namespace="Wowworks\Dadata\Exception">
59+
<metrics complexity="1" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="2" elements="3" coveredelements="3"/>
60+
</class>
61+
<line num="7" type="method" name="__construct" visibility="public" complexity="1" crap="1" count="1"/>
62+
<line num="9" type="stmt" count="1"/>
63+
<line num="10" type="stmt" count="1"/>
64+
<metrics loc="11" ncloc="11" classes="1" methods="1" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="2" elements="3" coveredelements="3"/>
65+
</file>
66+
</package>
67+
<package name="Wowworks\Dadata\Model">
68+
<file name="/home/runner/work/geocoder-php-dadata-provider/geocoder-php-dadata-provider/src/Model/DaDataAddress.php">
69+
<class name="Wowworks\Dadata\Model\DaDataAddress" namespace="Wowworks\Dadata\Model" fullPackage="common" package="common">
70+
<metrics complexity="2" methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="4" coveredstatements="0" elements="6" coveredelements="0"/>
71+
</class>
72+
<line num="40" type="method" name="getPrecision" visibility="public" complexity="1" crap="2" count="0"/>
73+
<line num="42" type="stmt" count="0"/>
74+
<line num="50" type="method" name="withPrecision" visibility="public" complexity="1" crap="2" count="0"/>
75+
<line num="52" type="stmt" count="0"/>
76+
<line num="53" type="stmt" count="0"/>
77+
<line num="55" type="stmt" count="0"/>
78+
<metrics loc="57" ncloc="36" classes="1" methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="4" coveredstatements="0" elements="6" coveredelements="0"/>
79+
</file>
80+
</package>
81+
<metrics files="3" loc="291" ncloc="155" classes="3" methods="9" coveredmethods="5" conditionals="0" coveredconditionals="0" statements="44" coveredstatements="13" elements="53" coveredelements="18"/>
82+
</project>
83+
</coverage>

composer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@
1313
"require": {
1414
"php": ">=5.6.0",
1515
"willdurand/geocoder": "^4.2",
16-
"glendemon/dadata-suggestions": "^1.0"
16+
"wowworks/dadata-suggestions": "^1.0"
1717
},
1818
"require-dev": {
1919
"ext-curl": "*",
20-
"phpunit/phpunit": "*"
20+
"phpunit/phpunit": "^8.5",
21+
"squizlabs/php_codesniffer": "3.6.2",
22+
"phpstan/phpstan": "^1.10"
2123
},
2224
"autoload": {
2325
"psr-4": {
2426
"Wowworks\\Dadata\\" : "src/"
2527
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Wowworks\\Dadata\\tests\\": "tests/"
32+
}
2633
}
2734
}

0 commit comments

Comments
 (0)