Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ COPY docker/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

RUN apt-get update -q \
&& apt-get install gnupg -y --no-install-recommends \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg \
&& curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
&& apt-get update -q \
Expand All @@ -37,7 +34,6 @@ RUN apt-get update -q \
debsig-verify \
dirmngr \
gpg-agent \
msodbcsql17 \
libonig-dev \
libxml2-dev \
awscli \
Expand Down Expand Up @@ -87,12 +83,6 @@ ARG SQLSRV_VERSION=5.10.1
ARG SNOWFLAKE_ODBC_VERSION=2.25.12
ARG SNOWFLAKE_GPG_KEY=630D9F3CAB551AF3

#Synapse ODBC
RUN set -ex; \
pecl install sqlsrv-$SQLSRV_VERSION pdo_sqlsrv-$SQLSRV_VERSION; \
docker-php-ext-enable sqlsrv pdo_sqlsrv; \
docker-php-source delete

## Snowflake
COPY ./docker/snowflake/generic.pol /etc/debsig/policies/$SNOWFLAKE_GPG_KEY/generic.pol
COPY ./docker/snowflake/simba.snowflake.ini /usr/lib/snowflake/odbc/lib/simba.snowflake.ini
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
"keboola/coding-standard": "^15",
"keboola/phpunit-retry-annotations": "^0.3.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.1",
"phpstan/extension-installer": "^1",
"phpstan/phpdoc-parser": "^1.6",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1",
"phpstan/phpstan-symfony": "^1.1",
"phpstan/phpstan": "^2",
"phpstan/phpstan-phpunit": "^2",
"phpstan/phpstan-symfony": "^2",
"phpunit/phpunit": "^9",
"react/async": "^4||^3",
"squizlabs/php_codesniffer": "^3",
Expand Down
5 changes: 2 additions & 3 deletions packages/php-datatypes/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
"require-dev": {
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan": "^2",
"php-parallel-lint/php-parallel-lint": "^1.3",
"keboola/coding-standard": "^15",
"phpstan/phpdoc-parser": "^1.6"
"keboola/coding-standard": "^15"
},
"autoload": {
"psr-4": {
Expand Down
19 changes: 19 additions & 0 deletions packages/php-datatypes/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
parameters:
ignoreErrors:
-
message: '#^Parameter \#1 \$lengthOptions of method Keboola\\Datatype\\Definition\\MySQL\:\:getLengthFromArray\(\) expects array\{character_maximum\?\: int\|string\|null, numeric_precision\?\: int\|string\|null, numeric_scale\?\: int\|string\|null\}, array given\.$#'
identifier: argument.type
count: 1
path: src/Definition/MySQL.php

-
message: '#^Parameter \#1 \$lengthOptions of method Keboola\\Datatype\\Definition\\Redshift\:\:getLengthFromArray\(\) expects array\{character_maximum\?\: int\|string\|null, numeric_precision\?\: int\|string\|null, numeric_scale\?\: int\|string\|null\}, array given\.$#'
identifier: argument.type
count: 1
path: src/Definition/Redshift.php

-
message: '#^Parameter \#1 \$lengthOptions of method Keboola\\Datatype\\Definition\\Snowflake\:\:getLengthFromArray\(\) expects array\{character_maximum\?\: int\|string\|null, numeric_precision\?\: int\|string\|null, numeric_scale\?\: int\|string\|null\}, array given\.$#'
identifier: argument.type
count: 1
path: src/Definition/Snowflake.php
5 changes: 4 additions & 1 deletion packages/php-datatypes/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
parameters:
checkMissingIterableValueType: false
ignoreErrors:
- '#^Parameter \#. \$options of class Keboola\\Datatype\\.* constructor expects array\{length\?\: string\|null, nullable\?\: bool, default\?\: string\|null.*}, .*array.* given\.$#'
- '#^Parameter \#. \$options of class Keboola\\Datatype\\.* constructor expects array\{length\?\: array\|string\|null, nullable\?\: bool, default\?\: string\|null.*}, .*array.* given\.$#'
- identifier: missingType.iterableValue
treatPhpDocTypesAsCertain: false
includes:
- phpstan-baseline.neon
2 changes: 1 addition & 1 deletion packages/php-datatypes/src/Definition/GenericStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(string $type, array $options = [])
public function getSQLDefinition(): string
{
$sql = $this->getType();
if ($this->getLength() && $this->getLength() !== '') {
if (!$this->isEmpty($this->getLength())) {
$sql .= '(' . $this->getLength() . ')';
}
$sql .= ($this->isNullable()) ? ' NULL' : ' NOT NULL';
Expand Down
4 changes: 2 additions & 2 deletions packages/php-datatypes/src/Definition/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(string $type, array $options = [])
public function getSQLDefinition(): string
{
$definition = $this->getType();
if ($this->getLength() && $this->getLength() !== '') {
if (!$this->isEmpty($this->getLength())) {
$definition .= '(' . $this->getLength() . ')';
}
if (!$this->isNullable()) {
Expand Down Expand Up @@ -123,7 +123,7 @@ private function getLengthFromArray(array $lengthOptions): ?string
*/
private function validateType(string $type): void
{
if (!in_array(strtoupper($type), $this::TYPES)) {
if (!in_array(strtoupper($type), self::TYPES, true)) {
throw new InvalidTypeException("'{$type}' is not a valid type");
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/php-datatypes/src/Definition/Redshift.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public function getCompression(): ?string
public function getSQLDefinition(): string
{
$definition = $this->getType();
if ($this->getLength() && $this->getLength() !== '') {
if (!$this->isEmpty($this->getLength())) {
$definition .= '(' . $this->getLength() . ')';
}
if (!$this->isNullable()) {
$definition .= ' NOT NULL';
}
if ($this->getCompression() && $this->getCompression() !== '') {
if (!$this->isEmpty($this->getCompression())) {
$definition .= ' ENCODE ' . $this->getCompression();
}
return $definition;
Expand Down Expand Up @@ -133,7 +133,7 @@ private function getLengthFromArray(array $lengthOptions): ?string
*/
private function validateType(string $type): void
{
if (!in_array(strtoupper($type), $this::TYPES)) {
if (!in_array(strtoupper($type), self::TYPES, true)) {
throw new InvalidTypeException("'{$type}' is not a valid type");
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/php-datatypes/src/Definition/Snowflake.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function isTypeWithComplexLength(): bool
*/
private function validateType(string $type): void
{
if (!in_array(strtoupper($type), $this::TYPES)) {
if (!in_array(strtoupper($type), self::TYPES, true)) {
throw new InvalidTypeException("'{$type}' is not a valid type");
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/php-db-import-export/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"flow-php/types": "^0.21.0",
"keboola/coding-standard": "^15",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1",
"phpstan/extension-installer": "^1",
"phpstan/phpstan": "^2",
"phpstan/phpstan-phpunit": "^2",
"phpunit/phpunit": "^9",
"react/async": "^4||^3",
"symfony/finder": "^5.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
declare(strict_types=1);

$includes = [];
if (PHP_VERSION_ID < 80000) {
$includes[] = __DIR__ . '/phpstan-baseline_v7.neon';
}
if (PHP_VERSION_ID >= 80000) {
$includes[] = __DIR__ . '/phpstan-baseline.neon';
}
$includes[] = __DIR__ . '/phpstan-baseline.neon';

$config = [];
$config['includes'] = $includes;
Expand Down
Loading
Loading