Skip to content

Commit

Permalink
phpstan to level 8
Browse files Browse the repository at this point in the history
  • Loading branch information
TonisOrmisson committed Feb 21, 2024
1 parent 75d462f commit cb8608d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
includes:
- phpstan-baseline.neon
parameters:
level: 6
level: 8
paths:
- src
bootstrapFiles:
Expand Down
13 changes: 9 additions & 4 deletions src/QueryBuilderForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ class QueryBuilderForm extends Widget
public function init() : void
{
if (is_array($this->builder)) {
$this->builder = Yii::createObject(array_merge([
'class' => QueryBuilder::className()
], $this->builder)
);
/** @var QueryBuilder $builder */
$builder = Yii::createObject(array_merge([
'class' => QueryBuilder::class
], $this->builder));
$this->builder = $builder;
}

if (!$this->builder instanceof QueryBuilder) {
Expand All @@ -125,7 +126,11 @@ public function run()
{
echo Html::endForm();

/** @var string $id */
$id = $this->options['id'];
if(!$this->builder instanceof QueryBuilder) {
throw new InvalidConfigException("Builder needs to be builder object");
}
$builderId = $this->builder->getId();
$view = $this->getView();

Expand Down
6 changes: 3 additions & 3 deletions src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ public function init() : void
/**
* Encodes filter rule into SQL condition
* @param string $field field name
* @param string|array<mixed> $type operator type
* @param string|array<string, mixed> $params query parameters
* @param string $type operator type
* @param array<string, mixed> $params query parameters
* @return string encoded rule
*/
protected function encodeRule($field, $type, $params)
protected function encodeRule(string $field, string $type, array $params)
{
$pattern = $this->_operators[$type];
$keys = array_keys($params);
Expand Down

0 comments on commit cb8608d

Please sign in to comment.