Skip to content

Commit 74536d6

Browse files
authored
Add .github/workflows with fixes (#52)
add .github/workflows with fixes
1 parent 3eb4fb7 commit 74536d6

File tree

7 files changed

+109
-44
lines changed

7 files changed

+109
-44
lines changed

.flintci.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/phpstan.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Static analysis
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
phpstan:
16+
name: PHPStan
17+
runs-on: Ubuntu-20.04
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: '8.1'
27+
extensions: pdo
28+
ini-values: "memory_limit=-1"
29+
coverage: none
30+
tools: phpstan
31+
32+
- name: Install dependencies
33+
run: |
34+
composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer false
35+
composer install --prefer-dist
36+
37+
- name: phpstan
38+
run: phpstan analyse -l 5 src

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
16+
tests:
17+
name: Tests
18+
runs-on: Ubuntu-20.04
19+
20+
strategy:
21+
matrix:
22+
php-versions: ['7.1', '7.4', '8.0', '8.1']
23+
fail-fast: false
24+
25+
services:
26+
clickhouse:
27+
image: yandex/clickhouse-server
28+
ports:
29+
- 8123:8123
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
35+
- name: Setup PHP
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: ${{ matrix.php-versions }}
39+
extensions: pdo
40+
ini-values: "memory_limit=-1"
41+
tools: composer
42+
coverage: xdebug
43+
44+
- name: Install dependencies
45+
run: composer install --prefer-dist
46+
47+
- name: Run tests
48+
run: ./vendor/bin/phpunit --configuration ./phpunit.xml.dist --coverage-text

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,10 @@
4444
"psr-4": {
4545
"FOD\\DBALClickHouse\\Tests\\": "tests/"
4646
}
47+
},
48+
"config": {
49+
"allow-plugins": {
50+
"dealerdirect/phpcodesniffer-composer-installer": true
51+
}
4752
}
4853
}

src/ClickHouseStatement.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,27 +241,31 @@ public function fetchColumn($columnIndex = 0)
241241
/**
242242
* {@inheritDoc}
243243
*/
244-
public function bindValue($param, $value, $type = null)
244+
public function bindValue($param, $value, $type = null): bool
245245
{
246246
$this->values[$param] = $value;
247247
$this->types[$param] = $type;
248+
249+
return true;
248250
}
249251

250252
/**
251253
* {@inheritDoc}
252254
*/
253-
public function bindParam($column, &$variable, $type = null, $length = null)
255+
public function bindParam($column, &$variable, $type = null, $length = null): bool
254256
{
255257
$this->values[$column] = &$variable;
256258
$this->types[$column] = $type;
259+
260+
return true;
257261
}
258262

259-
public function errorCode() : void
263+
public function errorCode() : int
260264
{
261265
throw new ClickHouseException('You need to implement ClickHouseStatement::' . __METHOD__ . '()');
262266
}
263267

264-
public function errorInfo() : void
268+
public function errorInfo() : array
265269
{
266270
throw new ClickHouseException('You need to implement ClickHouseStatement::' . __METHOD__ . '()');
267271
}

src/Connection.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public function executeUpdate($query, array $params = [], array $types = []) : i
4040
/**
4141
* @throws ClickHouseException
4242
*/
43-
public function delete($tableExpression, array $identifier, array $types = []) : void
43+
public function delete($tableExpression, array $identifier, array $types = []) : int
4444
{
4545
throw ClickHouseException::notSupported(__METHOD__);
4646
}
4747

4848
/**
4949
* @throws ClickHouseException
5050
*/
51-
public function update($tableExpression, array $data, array $identifier, array $types = []) : void
51+
public function update($tableExpression, array $data, array $identifier, array $types = []) : int
5252
{
5353
throw ClickHouseException::notSupported(__METHOD__);
5454
}
@@ -60,23 +60,23 @@ public function update($tableExpression, array $data, array $identifier, array $
6060
/**
6161
* @throws ClickHouseException
6262
*/
63-
public function setTransactionIsolation($level) : void
63+
public function setTransactionIsolation($level) : int
6464
{
6565
throw ClickHouseException::notSupported(__METHOD__);
6666
}
6767

6868
/**
6969
* @throws ClickHouseException
7070
*/
71-
public function getTransactionIsolation() : void
71+
public function getTransactionIsolation() : int
7272
{
7373
throw ClickHouseException::notSupported(__METHOD__);
7474
}
7575

7676
/**
7777
* @throws ClickHouseException
7878
*/
79-
public function getTransactionNestingLevel() : void
79+
public function getTransactionNestingLevel() : int
8080
{
8181
throw ClickHouseException::notSupported(__METHOD__);
8282
}
@@ -100,31 +100,31 @@ public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoint
100100
/**
101101
* @throws ClickHouseException
102102
*/
103-
public function getNestTransactionsWithSavepoints() : void
103+
public function getNestTransactionsWithSavepoints() : bool
104104
{
105105
throw ClickHouseException::notSupported(__METHOD__);
106106
}
107107

108108
/**
109109
* @throws ClickHouseException
110110
*/
111-
public function beginTransaction() : void
111+
public function beginTransaction() : bool
112112
{
113113
throw ClickHouseException::notSupported(__METHOD__);
114114
}
115115

116116
/**
117117
* @throws ClickHouseException
118118
*/
119-
public function commit() : void
119+
public function commit() : bool
120120
{
121121
throw ClickHouseException::notSupported(__METHOD__);
122122
}
123123

124124
/**
125125
* @throws ClickHouseException
126126
*/
127-
public function rollBack() : void
127+
public function rollBack() : bool
128128
{
129129
throw ClickHouseException::notSupported(__METHOD__);
130130
}
@@ -164,7 +164,7 @@ public function setRollbackOnly() : void
164164
/**
165165
* @throws ClickHouseException
166166
*/
167-
public function isRollbackOnly() : void
167+
public function isRollbackOnly() : bool
168168
{
169169
throw ClickHouseException::notSupported(__METHOD__);
170170
}

0 commit comments

Comments
 (0)