Skip to content

Commit 45a6c4a

Browse files
authored
Merge pull request #50 from keboola/zajca-gh-actions
GH actions
2 parents a49845d + 4db2e29 commit 45a6c4a

17 files changed

Lines changed: 58 additions & 57 deletions

.github/workflows/tests.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
tests:
11+
runs-on: ${{ matrix.operating-system }}
12+
strategy:
13+
matrix:
14+
operating-system: ['ubuntu-latest']
15+
php-versions: ['7.4','8.0','8.1']
16+
phpunit-versions: ['latest']
17+
steps:
18+
-
19+
name: Checkout
20+
uses: actions/checkout@v3
21+
-
22+
name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-versions }}
26+
-
27+
name: Tests
28+
run: |
29+
composer install
30+
composer ci

.travis.yml

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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.0
1+
FROM php:7.4-cli
22
MAINTAINER Ondrej Hlavacek <ondrej.hlavacek@keboola.com>
33

44
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction"

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
}
1010
],
1111
"require": {
12-
"php": ">=5.6"
12+
"php": ">=7.4"
1313
},
1414
"require-dev": {
15-
"phpunit/phpunit": "^5.0",
16-
"squizlabs/php_codesniffer": "^2.6",
17-
"codeclimate/php-test-reporter": "~0.4",
18-
"phpstan/phpstan": "~0.9",
19-
"php-parallel-lint/php-parallel-lint": "^1.1"
15+
"phpunit/phpunit": "^9",
16+
"squizlabs/php_codesniffer": "^3",
17+
"phpstan/phpstan": "^1",
18+
"php-parallel-lint/php-parallel-lint": "^1"
2019
},
2120
"autoload": {
2221
"psr-4": {

generate-composer56.php

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

src/Definition/Common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ abstract public function getBasetype();
101101
abstract public function toArray();
102102

103103
/**
104-
* @param string|null $length
104+
* @param string|int|null $length
105105
* @return bool
106106
*/
107107
protected function isEmpty($length)
@@ -177,7 +177,7 @@ protected function validateNumericLength($length, $firstMax, $secondMax, $firstM
177177
}
178178

179179
/**
180-
* @param mixed $length
180+
* @param string|int|null $length
181181
* @param int $max
182182
* @param int $min
183183
* @return bool

src/Definition/GenericStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct($type, array $options = [])
5050
public function getSQLDefinition()
5151
{
5252
$sql = $this->getType();
53-
if ($this->getLength() && $this->getLength() != "") {
53+
if ($this->getLength() && $this->getLength() !== '') {
5454
$sql .= "(" . $this->getLength() . ")";
5555
}
5656
$sql .= ($this->isNullable()) ? " NULL" : " NOT NULL";

src/Definition/MySQL.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($type, $options = [])
4949
public function getSQLDefinition()
5050
{
5151
$definition = $this->getType();
52-
if ($this->getLength() && $this->getLength() != "") {
52+
if ($this->getLength() && $this->getLength() !== '') {
5353
$definition .= "(" . $this->getLength() . ")";
5454
}
5555
if (!$this->isNullable()) {

src/Definition/Redshift.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function getCompression()
6161
public function getSQLDefinition()
6262
{
6363
$definition = $this->getType();
64-
if ($this->getLength() && $this->getLength() != "") {
64+
if ($this->getLength() && $this->getLength() !== '') {
6565
$definition .= "(" . $this->getLength() . ")";
6666
}
6767
if (!$this->isNullable()) {

tests/CommonDatatypeTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
namespace Keboola\DataypeTest;
33

44
use Keboola\Datatype\Definition\Common;
5+
use PHPUnit\Framework\TestCase;
56

6-
class CommonDatatypeTest extends \PHPUnit_Framework_TestCase
7+
class CommonDatatypeTest extends TestCase
78
{
89
public function testConstructor()
910
{

0 commit comments

Comments
 (0)