Skip to content

Commit fcb23b4

Browse files
committed
init 2gis scraper wrapper
0 parents  commit fcb23b4

28 files changed

Lines changed: 1989 additions & 0 deletions

.github/workflows/tests.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: ['8.3', '8.4']
17+
18+
name: PHP ${{ matrix.php }}
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: mbstring, json, curl
29+
coverage: none
30+
31+
- name: Install dependencies
32+
run: composer install --prefer-dist --no-interaction --no-progress
33+
34+
- name: Run tests
35+
run: composer test
36+
37+
code-style:
38+
runs-on: ubuntu-latest
39+
name: Code Style
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v4
44+
45+
- name: Setup PHP
46+
uses: shivammathur/setup-php@v2
47+
with:
48+
php-version: '8.3'
49+
extensions: mbstring
50+
coverage: none
51+
52+
- name: Install dependencies
53+
run: composer install --prefer-dist --no-interaction --no-progress
54+
55+
- name: Check code style
56+
run: composer cs -- -v
57+
58+
static-analysis:
59+
runs-on: ubuntu-latest
60+
name: Static Analysis
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Setup PHP
67+
uses: shivammathur/setup-php@v2
68+
with:
69+
php-version: '8.3'
70+
extensions: mbstring
71+
coverage: none
72+
73+
- name: Install dependencies
74+
run: composer install --prefer-dist --no-interaction --no-progress
75+
76+
- name: Run PHPStan
77+
run: composer analyse

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/vendor/
2+
.phpstan.cache/
3+
composer.lock
4+
.phpunit.result.cache

composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "scraper-apis/2gis-parser",
3+
"description": "PHP client library for scraping 2GIS data (places, reviews, property, jobs) using Apify actors",
4+
"type": "library",
5+
"license": "MIT",
6+
"require": {
7+
"php": "^8.3",
8+
"guzzlehttp/guzzle": "^7.0"
9+
},
10+
"require-dev": {
11+
"pestphp/pest": "^4.0",
12+
"laravel/pint": "^1.0",
13+
"phpstan/phpstan": "^1.0"
14+
},
15+
"autoload": {
16+
"psr-4": {
17+
"TwoGisParser\\": "src/"
18+
}
19+
},
20+
"autoload-dev": {
21+
"psr-4": {
22+
"TwoGisParser\\Tests\\": "tests/"
23+
}
24+
},
25+
"scripts": {
26+
"test": "pest",
27+
"cs": "pint --test",
28+
"cs:fix": "pint",
29+
"analyse": "phpstan analyse"
30+
},
31+
"config": {
32+
"sort-packages": true,
33+
"allow-plugins": {
34+
"pestphp/pest-plugin": true
35+
}
36+
}
37+
}

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 8
3+
paths:
4+
- src
5+
tmpDir: .phpstan.cache

phpunit.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true">
6+
<testsuites>
7+
<testsuite name="Tests">
8+
<directory>tests</directory>
9+
</testsuite>
10+
</testsuites>
11+
<source>
12+
<include>
13+
<directory>src</directory>
14+
</include>
15+
</source>
16+
</phpunit>

pint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"preset": "laravel"
3+
}

0 commit comments

Comments
 (0)