Skip to content

Commit

Permalink
[wip] fix phpstan and cs-fixer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xico42 committed Nov 2, 2021
1 parent ec7314c commit 4bb766e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/Objects/Exceptions/UnsupportedPhpVersionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@

class UnsupportedPhpVersionException extends RuntimeException
{

}
5 changes: 4 additions & 1 deletion src/Objects/Schema/Generation/Annotations/AvroItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
*/
final class AvroItems implements TypeOnlyAttribute
{
/**
* @var mixed
*/
public $value;

public function value(): array
{
$value = is_array($this->value) ? $this->value : [$this->value];
$value = \is_array($this->value) ? $this->value : [$this->value];

return array_map(function ($value) {
if ($value instanceof AvroType) {
Expand Down
5 changes: 4 additions & 1 deletion src/Objects/Schema/Generation/Annotations/AvroValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
*/
final class AvroValues implements TypeOnlyAttribute
{
/**
* @var mixed
*/
public $value;

public function value(): array
{
$value = is_array($this->value) ? $this->value : [$this->value];
$value = \is_array($this->value) ? $this->value : [$this->value];

return array_map(function ($value) {
if ($value instanceof AvroType) {
Expand Down
28 changes: 14 additions & 14 deletions test/Objects/Schema/Generation/SchemaGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ protected function setUp(): void
);
}

abstract protected function makeSchemaAttributeReader(): SchemaAttributeReader;

abstract protected function getEmptyRecordClass(): string;

abstract protected function getPrimitiveTypesClass(): string;

abstract protected function getRecordWithComplexTypesClass(): string;

abstract protected function getRecordWithRecordTypeClass(): string;

abstract protected function getArraysWithComplexTypeClass(): string;

abstract protected function getMapsWithComplexTypeClass(): string;

/**
* @test
*/
Expand Down Expand Up @@ -235,4 +221,18 @@ public function it_should_generate_a_record_schema_with_maps_containing_complex_

$this->assertEquals($expected, $schema);
}

abstract protected function makeSchemaAttributeReader(): SchemaAttributeReader;

abstract protected function getEmptyRecordClass(): string;

abstract protected function getPrimitiveTypesClass(): string;

abstract protected function getRecordWithComplexTypesClass(): string;

abstract protected function getRecordWithRecordTypeClass(): string;

abstract protected function getArraysWithComplexTypeClass(): string;

abstract protected function getMapsWithComplexTypeClass(): string;
}

0 comments on commit 4bb766e

Please sign in to comment.