Skip to content

Commit 551cd5f

Browse files
authored
Merge pull request #7 from ppavlovic/master
Small bugfixes found in 2.1.0
2 parents 8cecc8e + fc8a562 commit 551cd5f

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@
3030
"rector/rector": "^0.14.6"
3131
},
3232
"require": {
33-
"php" : ">=7.3",
34-
"g4/constants" : "*",
35-
"zendframework/zend-paginator": "2.*"
33+
"php": ">=7.3",
34+
"ext-json": "*",
35+
"g4/constants": "*",
36+
"zendframework/zend-paginator": "2.*"
3637
}
3738
}

src/Formatter/FormatterAbstract.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function reference(\G4\CleanCore\Formatter\FormatterAbstract $formatter,
5050
}
5151

5252
/**
53-
* @param mixed $response
53+
* @param mixed $resource
5454
* @return FormatterAbstract
5555
*/
5656
public function setResource($resource)
@@ -80,4 +80,4 @@ private function getResourcePart(string $part)
8080
? $this->resource[$part]
8181
: null;
8282
}
83-
}
83+
}

src/Validator/Param/Type/ArrayType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
class ArrayType extends TypeAbstract
66
{
7-
public function cast(): self
7+
public function cast()
88
{
9-
if ($this->_isNotEmptyString()) {
9+
if ($this->isNotEmptyString()) {
1010

1111
$this->value = explode($this->getArrayValueSeparator(), $this->value);
1212
}
@@ -32,10 +32,10 @@ public function validValue(): self
3232
return $this;
3333
}
3434

35-
protected function _isNotEmptyString(): bool
35+
protected function isNotEmptyString(): bool
3636
{
3737
return !$this->isValueNull()
3838
&& is_string($this->value)
3939
&& !$this->isValueEmptyString();
4040
}
41-
}
41+
}

src/Validator/Param/Type/Json.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
class Json extends ArrayType
66
{
7-
public function cast(): self
7+
public function cast()
88
{
9-
if($this->_isNotEmptyString()) {
9+
if($this->isNotEmptyString()) {
1010
$this->value = json_decode($this->value, true);
1111
}
1212

13-
if($this->_isNotEmptyString() && json_last_error() !== JSON_ERROR_NONE) {
13+
if($this->isNotEmptyString() && json_last_error() !== JSON_ERROR_NONE) {
1414
throw new \G4\CleanCore\Exception\Validation($this->name, $this->value, $this->meta);
1515
}
1616

@@ -20,4 +20,4 @@ public function cast(): self
2020

2121
return $this;
2222
}
23-
}
23+
}

0 commit comments

Comments
 (0)