Skip to content

Commit a364541

Browse files
author
Github Actions
committed
CS fix
1 parent b65439b commit a364541

6 files changed

Lines changed: 31 additions & 20 deletions

File tree

phpcs.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
<?xml version="1.0"?>
22
<ruleset name="Project">
33
<rule ref="vendor/keboola/coding-standard/src/ruleset.xml"/>
4+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
5+
<properties>
6+
<property name="enableUnionTypeHint" type="bool" value="false" />
7+
<property name="enableIntersectionTypeHint" type="bool" value="false" />
8+
<property name="enableStandaloneNullTrueFalseTypeHints" type="bool" value="false" />
9+
</properties>
10+
</rule>
11+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
12+
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint.MissingTraversableReturnTypeHintSpecification"/>
13+
<properties>
14+
<property name="enableStaticTypeHint" type="bool" value="false" />
15+
<property name="enableMixedTypeHint" type="bool" value="false" />
16+
<property name="enableUnionTypeHint" type="bool" value="false" />
17+
<property name="enableIntersectionTypeHint" type="bool" value="false" />
18+
<property name="enableNeverTypeHint" type="bool" value="false" />
19+
<property name="enableStandaloneNullTrueFalseTypeHints" type="bool" value="false" />
20+
</properties>
21+
</rule>
22+
423
</ruleset>

tests/Functional/Synapse/Auth/SynapseGrantQueryBuilderTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Keboola\TableBackendUtils\Auth\Grant\Synapse\Permission;
1111
use Keboola\TableBackendUtils\Auth\Grant\Synapse\RevokeOptions;
1212
use Keboola\TableBackendUtils\Auth\SynapseGrantQueryBuilder;
13+
use Keboola\TableBackendUtils\Escaping\SynapseQuote;
1314

1415
class SynapseGrantQueryBuilderTest extends BaseAuthTestCase
1516
{
@@ -80,20 +81,20 @@ protected function setUp(): void
8081

8182
$this->connection->executeStatement(sprintf(
8283
'CREATE ROLE %s',
83-
$this->platform->quoteSingleIdentifier($this->currentLogin . '_ROLE')
84+
SynapseQuote::quoteSingleIdentifier($this->currentLogin . '_ROLE')
8485
));
8586

8687
assert($this->currentLogin !== null);
8788
$this->connection->executeStatement(sprintf(
8889
'CREATE SCHEMA %s AUTHORIZATION %s',
89-
$this->platform->quoteSingleIdentifier(self::TEST_SCHEMA),
90-
$this->platform->quoteSingleIdentifier($this->currentLogin)
90+
SynapseQuote::quoteSingleIdentifier(self::TEST_SCHEMA),
91+
SynapseQuote::quoteSingleIdentifier($this->currentLogin)
9192
));
9293

9394
$this->connection->executeStatement(sprintf(
9495
'CREATE TABLE %s.%s ([col1] nvarchar(4000) NOT NULL DEFAULT \'\')',
95-
$this->platform->quoteSingleIdentifier(self::TEST_SCHEMA),
96-
$this->platform->quoteSingleIdentifier(self::TEST_TABLE)
96+
SynapseQuote::quoteSingleIdentifier(self::TEST_SCHEMA),
97+
SynapseQuote::quoteSingleIdentifier(self::TEST_TABLE)
9798
));
9899
}
99100

tests/Functional/Synapse/Database/SynapseDatabaseReflectionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Tests\Keboola\TableBackendUtils\Functional\Synapse\Database;
66

77
use Keboola\TableBackendUtils\Database\SynapseDatabaseReflection;
8+
use Keboola\TableBackendUtils\Escaping\SynapseQuote;
89
use Tests\Keboola\TableBackendUtils\Functional\Synapse\Auth\BaseAuthTestCase;
910

1011
class SynapseDatabaseReflectionTest extends BaseAuthTestCase
@@ -24,7 +25,7 @@ public function testGetRolesNames(): void
2425

2526
$this->connection->executeStatement(sprintf(
2627
'CREATE ROLE %s',
27-
$this->platform->quoteSingleIdentifier($this->currentLogin . '_ROLE')
28+
SynapseQuote::quoteSingleIdentifier($this->currentLogin . '_ROLE')
2829
));
2930
$ref = new SynapseDatabaseReflection($this->connection);
3031
$names = $ref->getRolesNames(self::LOGIN_PREFIX . '%');

tests/Functional/Synapse/SynapseBaseCase.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
use Doctrine\DBAL\Connection;
88
use Doctrine\DBAL\DriverManager;
9-
use Doctrine\DBAL\Platforms\AbstractPlatform;
10-
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
119
use Keboola\TableBackendUtils\Connection\Synapse\SynapseDriver;
1210
use Keboola\TableBackendUtils\Schema\SynapseSchemaQueryBuilder;
1311
use Keboola\TableBackendUtils\Schema\SynapseSchemaReflection;
@@ -20,9 +18,6 @@ class SynapseBaseCase extends TestCase
2018

2119
protected Connection $connection;
2220

23-
/** @var SQLServer2012Platform|AbstractPlatform */
24-
protected $platform;
25-
2621
protected SynapseSchemaQueryBuilder $schemaQb;
2722

2823
protected SynapseTableQueryBuilder $tableQb;
@@ -64,7 +59,6 @@ protected function setUp(): void
6459
{
6560
parent::setUp();
6661
$this->connection = $this->getSynapseConnection();
67-
$this->platform = $this->connection->getDatabasePlatform();
6862
$this->schemaQb = new SynapseSchemaQueryBuilder();
6963
$this->tableQb = new SynapseTableQueryBuilder();
7064
}

tests/Functional/Teradata/TeradataBaseCase.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@ class TeradataBaseCase extends TestCase
2323

2424
protected Connection $connection;
2525

26-
/** @var TeradataPlatform|AbstractPlatform */
27-
protected $platform;
28-
2926
protected function setUp(): void
3027
{
3128
parent::setUp();
3229
$this->connection = $this->getTeradataConnection();
33-
$this->platform = $this->connection->getDatabasePlatform();
3430
}
3531

3632
protected function initTable(

tests/Unit/Column/ColumnCollectionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public function testGetIterator(): void
2727

2828
/**
2929
* @dataProvider tooMuchColumnsProviderWithLimits
30-
* @param SynapseColumn|TeradataColumn $definitionClass
30+
* @param class-string<SynapseColumn|TeradataColumn> $definitionClass
3131
*/
32-
public function testTooMuchColumns($definitionClass, int $limit): void
32+
public function testTooMuchColumns(string $definitionClass, int $limit): void
3333
{
3434
$cols = [];
3535
for ($i = 0; $i < $limit + 2; $i++) {
@@ -43,9 +43,9 @@ public function testTooMuchColumns($definitionClass, int $limit): void
4343

4444
/**
4545
* @dataProvider tooMuchColumnsProviderWithNoLimits
46-
* @param SnowflakeColumn|ExasolColumn $definitionClass
46+
* @param class-string<SnowflakeColumn|ExasolColumn> $definitionClass
4747
*/
48-
public function testNoColumnsLimit($definitionClass, int $limit): void
48+
public function testNoColumnsLimit(string $definitionClass, int $limit): void
4949
{
5050
$cols = [];
5151
for ($i = 0; $i < $limit + 2; $i++) {

0 commit comments

Comments
 (0)