Skip to content

Commit f94d981

Browse files
committed
Add lib
1 parent 6d31ee0 commit f94d981

19 files changed

+4252
-0
lines changed

.github/workflows/linter.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Linter"
2+
3+
on: [pull_request]
4+
jobs:
5+
lint:
6+
name: Linter
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Set up PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: "8.4"
17+
18+
- name: Install dependencies
19+
run: composer install --no-interaction --prefer-dist
20+
21+
- name: Run Linter
22+
run: composer lint
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Static Analysis"
2+
3+
on: [pull_request]
4+
jobs:
5+
phpstan:
6+
name: PHPStan
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
13+
- name: Set up PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: "8.4"
17+
18+
- name: Install dependencies
19+
run: composer install --no-interaction --prefer-dist
20+
21+
- name: Run PHPStan
22+
run: composer check

.github/workflows/tests.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Tests"
2+
3+
concurrency:
4+
group: tests-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on: [pull_request]
8+
9+
jobs:
10+
unit_test:
11+
name: Unit Tests
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: "8.4"
22+
23+
- name: Install dependencies
24+
run: composer install --no-interaction --prefer-dist
25+
26+
- name: Run Tests
27+
run: composer test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ composer.phar
44
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
55
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
66
# composer.lock
7+
.phpunit.result.cache

composer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "utopia-php/query",
3+
"description": "A simple library providing a query abstraction for filtering, ordering, and pagination",
4+
"type": "library",
5+
"keywords": ["php", "framework", "upf", "utopia", "query"],
6+
"license": "MIT",
7+
"minimum-stability": "stable",
8+
"autoload": {
9+
"psr-4": {
10+
"Utopia\\Query\\": "src/Query"
11+
}
12+
},
13+
"autoload-dev": {
14+
"psr-4": {
15+
"Tests\\Query\\": "tests/Query"
16+
}
17+
},
18+
"scripts": {
19+
"test": "vendor/bin/phpunit --configuration phpunit.xml",
20+
"lint": "php -d memory_limit=2G ./vendor/bin/pint --test",
21+
"format": "php -d memory_limit=2G ./vendor/bin/pint",
22+
"check": "./vendor/bin/phpstan analyse --level max src tests --memory-limit 2G"
23+
},
24+
"require": {
25+
"php": ">=8.4"
26+
},
27+
"require-dev": {
28+
"phpunit/phpunit": "^12.0",
29+
"laravel/pint": "*",
30+
"phpstan/phpstan": "*"
31+
}
32+
}

0 commit comments

Comments
 (0)