Skip to content

Commit

Permalink
Apply fixes from StyleCI (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Norgul committed Jan 27, 2021
1 parent 4177646 commit ee6f604
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Config/OperatorsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function operatorCallbackMapping(): array
}

/**
* Extract operators from registered 'operator' classes
* Extract operators from registered 'operator' classes.
* @return array
*/
public function getOperators(): array
Expand Down
3 changes: 1 addition & 2 deletions src/Config/TypesConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ protected function getTypeNames(): array
/**
* @var AbstractType $type
*/
return array_map(fn($type) => $type::getTypeName(), $this->registered);
return array_map(fn ($type) => $type::getTypeName(), $this->registered);
}

}
10 changes: 4 additions & 6 deletions tests/Unit/Config/ModelConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function setUp(): void
public function model_has_config()
{
config(['asseco-json-query-builder.model_options' => [
get_class($this->model) => ['random_config' => '123']
get_class($this->model) => ['random_config' => '123'],
]]);

$modelConfig = new ModelConfig($this->model);
Expand All @@ -36,7 +36,7 @@ public function model_has_config()
public function has_returns_config_set()
{
config(['asseco-json-query-builder.model_options' => [
get_class($this->model) => ['returns' => '123']
get_class($this->model) => ['returns' => '123'],
]]);

$modelConfig = new ModelConfig($this->model);
Expand All @@ -59,8 +59,8 @@ public function has_order_by_config_set()
get_class($this->model) => [
'order_by' => [
'attribute' => 'asc',
]
]
],
],
]]);

$modelConfig = new ModelConfig($this->model);
Expand All @@ -75,6 +75,4 @@ public function has_default_order_by_config_set()

$this->assertEquals([], $modelConfig->getOrderBy());
}


}
2 changes: 1 addition & 1 deletion tests/Unit/Config/OperatorsConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function returns_registered_operators()
{
$operatorsConfig = new OperatorsConfig();

$expected = ['!<>', '<=', '>=', '<>', '!=', '=', '<', '>',];
$expected = ['!<>', '<=', '>=', '<>', '!=', '=', '<', '>'];

$this->assertEquals($expected, $operatorsConfig->getOperators());
}
Expand Down
2 changes: 0 additions & 2 deletions tests/Unit/Config/RequestParametersConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

namespace Asseco\JsonQueryBuilder\Tests\Unit\Config;

use Asseco\JsonQueryBuilder\Config\OperatorsConfig;
use Asseco\JsonQueryBuilder\Config\RequestParametersConfig;
use Asseco\JsonQueryBuilder\SearchCallbacks\Equals;
use Asseco\JsonQueryBuilder\Tests\TestCase;
use Exception;

Expand Down
1 change: 0 additions & 1 deletion tests/Unit/Config/TypesConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function it_returns_generic_type_if_non_existing_type_is_given()
$typesConfig->getTypeClassFromTypeName('test'));
}


/** @test */
public function it_throws_exception_if_neither_generic_type_nor_given_type_exist()
{
Expand Down

0 comments on commit ee6f604

Please sign in to comment.