Skip to content

Commit a83826f

Browse files
author
Moath Alhajri
committed
wip
1 parent 59fe2f1 commit a83826f

File tree

5 files changed

+13
-64
lines changed

5 files changed

+13
-64
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: ["8.0", 8.1, 8.2]
12+
php: ["8.0", 8.1, 8.2, 8.3, 8.4]
1313
stability: [prefer-lowest, prefer-stable]
1414

1515
name: Tests php@${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.stability }}

CONTRIBUTING.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ Clone your fork, then install the dev dependencies:
2525
composer install
2626
```
2727

28-
## Refactor
29-
30-
Refactor your code:
31-
32-
```bash
33-
composer refactor
34-
```
35-
3628
## Lint
3729

3830
Lint your code:
@@ -82,4 +74,4 @@ If you want to check things work against a specific version of PHP, you may incl
8274
docker compose build --build-arg PHP=8.2
8375
```
8476

85-
The default PHP version will always be the lowest version of PHP supported by jql-builder.
77+
The default PHP version will always be the lowest version of PHP supported by jql-builder.

composer.json

-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"phpstan/extension-installer": "^1.2",
2929
"phpstan/phpstan": "^1.8.6",
3030
"phpstan/phpstan-strict-rules": "^1.4",
31-
"rector/rector": "^0.15.0",
3231
"symfony/var-dumper": "^6.0.0"
3332
},
3433
"autoload": {
@@ -60,14 +59,11 @@
6059
},
6160
"scripts": {
6261
"lint": "pint --preset laravel -v --ansi",
63-
"refactor": "rector --debug --ansi",
6462
"test:lint": "pint --preset laravel --test -v --ansi",
65-
"test:refactor": "rector --dry-run --ansi",
6663
"test:types": "phpstan analyse --ansi",
6764
"test:unit": "pest --colors=always --min=100 --order-by=random --coverage",
6865
"test": [
6966
"@test:lint",
70-
"@test:refactor",
7167
"@test:types",
7268
"@test:unit"
7369
]

rector.php

-39
This file was deleted.

tests/Jql.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
use JqlBuilder\Jql;
44

55
it('can generate query', function () {
6-
$builder = new Jql();
6+
$builder = new Jql;
77

88
$query = $builder->where('project', '=', 'MY PROJECT')->getQuery();
99

1010
$expected = 'project = "MY PROJECT"';
1111

1212
expect($query)->toBe($expected);
1313

14-
$builder = new Jql();
14+
$builder = new Jql;
1515

1616
$query = $builder
1717
->where('project', '=', 'MY PROJECT')
@@ -28,7 +28,7 @@
2828

2929
expect($query)->toBe($expected);
3030

31-
$builder = new Jql();
31+
$builder = new Jql;
3232

3333
$query = (string) $builder
3434
->where('project', 'MY PROJECT')
@@ -48,7 +48,7 @@
4848
});
4949

5050
it('can generate raw query', function () {
51-
$query = (string) (new Jql())->rawQuery('project = "MY PROJECT"');
51+
$query = (string) (new Jql)->rawQuery('project = "MY PROJECT"');
5252

5353
$expected = 'project = "MY PROJECT"';
5454

@@ -57,7 +57,7 @@
5757

5858
it('can generate query with grouped conditions', function () {
5959
$actualQueries = [
60-
(new Jql())->where('creator', '=', '1646667083862@mailinator.com')
60+
(new Jql)->where('creator', '=', '1646667083862@mailinator.com')
6161
->where(function (Jql $builder) {
6262
$builder->where('project', '=', 'A')
6363
->where('status', '=', '"Closed"');
@@ -66,7 +66,7 @@
6666
$builder->where('project', '=', '"B"')
6767
->where('status', '!=', 'Closed');
6868
})->getQuery(),
69-
(new Jql())->where(function (Jql $builder) {
69+
(new Jql)->where(function (Jql $builder) {
7070
$builder->where('project', '=', 'A')
7171
->where('status', '=', 'Closed');
7272
})->orWhere(function (Jql $builder) {
@@ -84,15 +84,15 @@
8484
});
8585

8686
it('will quote custom field that contains spaces', function () {
87-
$query = (new Jql())->where('project name', '=', 'MY PROJECT')->getQuery();
87+
$query = (new Jql)->where('project name', '=', 'MY PROJECT')->getQuery();
8888

8989
$expected = '"project name" = "MY PROJECT"';
9090

9191
expect($query)->toBe($expected);
9292
});
9393

9494
it('can add macro', function () {
95-
$builder = new Jql();
95+
$builder = new Jql;
9696

9797
$builder::macro('whereCustom', function (mixed $value) {
9898
/** @var Jql $this */
@@ -108,15 +108,15 @@
108108
});
109109

110110
it('will throw exception when invalid boolean passed', function () {
111-
(new Jql())->where('project', '=', 'MY PROJECT', '=');
111+
(new Jql)->where('project', '=', 'MY PROJECT', '=');
112112
})->throws(InvalidArgumentException::class, 'Illegal boolean [=] value. only [and, or] is acceptable');
113113

114114
it('will throw exception when invalid operator passed', function () {
115-
(new Jql())->where('project', '=', ['MY PROJECT']);
115+
(new Jql)->where('project', '=', ['MY PROJECT']);
116116
})->throws(InvalidArgumentException::class, 'Illegal operator [=] value. only [in, not in, was in, was not in] is acceptable when $value type is array');
117117

118118
it('can reset the current query', function () {
119-
$query = new Jql();
119+
$query = new Jql;
120120

121121
$query->where('project', 'name');
122122

0 commit comments

Comments
 (0)