Skip to content

Commit

Permalink
PHP 8.1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent4vx committed Feb 25, 2022
1 parent 0f9a2eb commit c22582c
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0']
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
name: PHP ${{ matrix.php-versions }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -22,7 +22,7 @@
},
"minimum-stability": "dev",
"require": {
"php": "~7.1 || ~8.0.0",
"php": "~7.1 || ~8.0.0 || ~8.1.0",
"ext-json": "*",
"b2pweb/bdf-prime": "~1.0|~2.0",
"b2pweb/bdf-collections": "~1.1.2"
Expand Down
2 changes: 1 addition & 1 deletion src/AnalyzerCompilerAdapter.php
Expand Up @@ -101,7 +101,7 @@ public function quoteIdentifier(CompilableClause $query, $column): string
*
* @return mixed
*/
public function getBindings(CompilableClause $query)
public function getBindings(CompilableClause $query): array
{
return $this->compiler->getBindings($query);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/BulkInsertQuery/InsertValuesAnalyzerTest.php
Expand Up @@ -118,12 +118,12 @@ class EntityWithTypes extends Model

class EntityWithTypesMapper extends Mapper
{
public function schema()
public function schema(): array
{
return ['connection' => 'test', 'table' => 'with_types'];
}

public function buildFields($builder)
public function buildFields($builder): void
{
$builder
->boolean('bool')
Expand Down
6 changes: 3 additions & 3 deletions tests/KeyValueQuery/UpdateValuesAnalyzerTest.php
Expand Up @@ -105,12 +105,12 @@ class EntityWithTypes extends Model

class EntityWithTypesMapper extends Mapper
{
public function schema()
public function schema(): array
{
return [];
return ['table' => 'EntityWithTypes'];
}

public function buildFields($builder)
public function buildFields($builder): void
{
$builder
->boolean('bool')
Expand Down
2 changes: 1 addition & 1 deletion tests/Query/SqlQueryAnalyzerTest.php
Expand Up @@ -250,7 +250,7 @@ class TestEntityWithIgnore extends TestEntity
*/
class TestEntityWithIgnoreMapper extends TestEntityMapper
{
public function schema()
public function schema(): array
{
return ['table' => 'with_ignore'] + parent::schema();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Query/WriteAttributesAnalyzerTest.php
Expand Up @@ -105,12 +105,12 @@ class EntityWithTypes extends Model

class EntityWithTypesMapper extends Mapper
{
public function schema()
public function schema(): array
{
return [];
}

public function buildFields($builder)
public function buildFields($builder): void
{
$builder
->boolean('bool')
Expand Down
4 changes: 2 additions & 2 deletions tests/_files/RelationEntityMapper.php
Expand Up @@ -13,15 +13,15 @@ class RelationEntityMapper extends Mapper
/**
* @return array|void|null
*/
public function schema()
public function schema(): array
{
return [
'connection' => 'test',
'table' => 'relation_entity',
];
}

public function buildFields($builder)
public function buildFields($builder): void
{
$builder
->string('key')->primary()
Expand Down
2 changes: 1 addition & 1 deletion tests/_files/TestEntity.php
Expand Up @@ -41,7 +41,7 @@ public function __construct(array $data = [])
$this->import($data);
}

public function initialize()
public function initialize(): void
{
$this->embeddedRelation = new RelationEntity();
}
Expand Down
8 changes: 4 additions & 4 deletions tests/_files/TestEntityMapper.php
Expand Up @@ -8,15 +8,15 @@

class TestEntityMapper extends Mapper
{
public function schema()
public function schema(): array
{
return [
'connection' => 'test',
'table' => 'test_entity',
];
}

public function buildFields($builder)
public function buildFields($builder): void
{
$builder
->bigint('id')->autoincrement()
Expand All @@ -28,12 +28,12 @@ public function buildFields($builder)
;
}

public function buildIndexes(IndexBuilder $builder)
public function buildIndexes(IndexBuilder $builder): void
{
$builder->add()->on('key');
}

public function buildRelations($builder)
public function buildRelations($builder): void
{
$builder
->on('relationEntity')
Expand Down
4 changes: 2 additions & 2 deletions tests/_files/TestEntityOtherConnectionMapper.php
Expand Up @@ -6,15 +6,15 @@

class TestEntityOtherConnectionMapper extends Mapper
{
public function schema()
public function schema(): array
{
return [
'connection' => 'other',
'table' => 'test_entity',
];
}

public function buildFields($builder)
public function buildFields($builder): void
{
$builder
->bigint('id')->autoincrement()
Expand Down

0 comments on commit c22582c

Please sign in to comment.