Skip to content

Commit acb5142

Browse files
committed
Initial version
1 parent 960a12d commit acb5142

178 files changed

Lines changed: 12775 additions & 0 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.

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
indent_style = tab
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{md,neon,yml}]
10+
indent_size = 2
11+
indent_style = space
12+
13+
[phpstan-baseline.neon]
14+
indent_style = tab

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.editorconfig export-ignore
2+
.gitattributes export-ignore
3+
.gitignore export-ignore
4+
.github export-ignore
5+
docker-compose.yml export-ignore
6+
phpcs.xml.dist export-ignore
7+
phpstan-baseline.neon export-ignore
8+
phpstan.dist.neon export-ignore
9+
phpunit.xml.dist export-ignore
10+
tests/ export-ignore
11+
12+
*.php* diff=php linguist-language=PHP

.github/workflows/checks.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: checks
2+
3+
on:
4+
- push
5+
6+
env:
7+
COMPOSER_NO_INTERACTION: "1"
8+
9+
jobs:
10+
format:
11+
name: Code style
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: '8.4'
21+
coverage: none
22+
23+
- run: composer install --ansi --no-progress --prefer-dist
24+
25+
- name: Run PHP_Codesniffer
26+
run: vendor/bin/phpcs
27+
28+
static_analysis:
29+
name: Static analysis
30+
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: '8.4'
39+
coverage: none
40+
41+
- run: composer install --ansi --no-progress --prefer-dist
42+
43+
- name: Run parallel-lint
44+
run: composer run lint
45+
46+
- name: Run PHPStan
47+
run: composer run phpstan
48+
49+
tests:
50+
name: PHP ${{ matrix.php }} tests on ${{ matrix.os }} with ${{ matrix.deps }} deps
51+
52+
needs:
53+
- static_analysis
54+
55+
strategy:
56+
matrix:
57+
deps:
58+
- stable
59+
- lowest
60+
os:
61+
- macos-latest
62+
- ubuntu-latest
63+
- windows-latest
64+
php:
65+
- '8.1'
66+
- '8.2'
67+
- '8.3'
68+
- '8.4'
69+
70+
exclude:
71+
- deps: lowest
72+
os: macos-latest
73+
74+
- deps: lowest
75+
os: windows-latest
76+
77+
fail-fast: false
78+
79+
runs-on: ${{ matrix.os }}
80+
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- uses: shivammathur/setup-php@v2
85+
with:
86+
php-version: ${{ matrix.php }}
87+
coverage: none
88+
extensions: pdo, pdo_mysql, pdo_sqlite
89+
90+
- run: composer install --ansi --no-progress --prefer-dist
91+
92+
- run: composer update --ansi --no-progress --prefer-lowest
93+
if: matrix.deps == 'lowest'
94+
95+
- name: Run tests
96+
run: composer run test-without-db
97+
98+
- if: failure()
99+
uses: actions/upload-artifact@v4
100+
with:
101+
path: tests/output
102+
103+
db_tests:
104+
name: PHP tests with database
105+
106+
needs:
107+
- tests
108+
109+
strategy:
110+
fail-fast: false
111+
112+
runs-on: ubuntu-latest
113+
114+
services:
115+
docker:
116+
image: docker:24.0.7
117+
options: --privileged
118+
119+
steps:
120+
- uses: actions/checkout@v4
121+
122+
- run: docker compose up --wait
123+
124+
- uses: shivammathur/setup-php@v2
125+
with:
126+
php-version: '8.4'
127+
coverage: none
128+
extensions: pdo, pdo_mysql, pdo_sqlite
129+
130+
- run: composer install --ansi --no-progress --prefer-dist
131+
132+
- name: Run tests
133+
run: composer run test-with-db
134+
135+
- if: failure()
136+
uses: actions/upload-artifact@v4
137+
with:
138+
path: tests/output

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
.phpunit.cache
3+
.phpunit.result.cache
4+
phpstan.neon
5+
tests-temp
6+
vendor

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2025, Vojtěch Dobeš
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

composer.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"authors": [
3+
{
4+
"name": "Vojtěch Dobeš",
5+
"homepage": "https://vojtechdobes.com"
6+
}
7+
],
8+
"autoload": {
9+
"psr-4": {
10+
"Vojtechdobes\\PHPStan\\Dibi\\": "src/"
11+
}
12+
},
13+
"autoload-dev": {
14+
"classmap": [
15+
"tests/objects"
16+
],
17+
"psr-4": {
18+
"Vojtechdobes\\Tests\\": "tests/cases/"
19+
}
20+
},
21+
"config": {
22+
"allow-plugins": {
23+
"dealerdirect/phpcodesniffer-composer-installer": false
24+
},
25+
"sort-packages": true
26+
},
27+
"keywords": [
28+
"ci",
29+
"dibi",
30+
"phpstan",
31+
"phpstan-rules",
32+
"sql",
33+
"static-analysis",
34+
"static-code-analysis"
35+
],
36+
"license": [
37+
"BSD-3-Clause"
38+
],
39+
"name": "vojtech-dobes/phpstan-dibi-steroids",
40+
"require": {
41+
"php": "~8.1",
42+
"greenlion/php-sql-parser": "^4.7",
43+
"nette/php-generator": "^4.0"
44+
},
45+
"require-dev": {
46+
"dibi/dibi": "^5.0",
47+
"nette/di": "^3.2",
48+
"php-parallel-lint/php-parallel-lint": "^1.4.0",
49+
"phpstan/phpstan": "^2.1.17",
50+
"phpstan/phpstan-phpunit": "^2.0",
51+
"phpstan/phpstan-strict-rules": "^2.0.4",
52+
"phpunit/phpunit": "^10.5",
53+
"spaze/phpstan-disallowed-calls": "^4.5.0",
54+
"tracy/tracy": "^2.10.9",
55+
"vojtech-dobes/php-codestyle": "~0.2.0"
56+
},
57+
"scripts": {
58+
"lint": "parallel-lint src tests",
59+
"phpstan": "phpstan analyse --memory-limit 512M",
60+
"test": "composer dump-autoload && phpunit --testsuite without-db,with-db",
61+
"test-with-db": "composer dump-autoload && phpunit --testsuite with-db",
62+
"test-without-db": "composer dump-autoload && phpunit --testsuite without-db"
63+
}
64+
}

0 commit comments

Comments
 (0)