From 38355e98b8eb22c5b741ed5bb63d29c026d3988b Mon Sep 17 00:00:00 2001 From: Daniel Bannert Date: Sun, 16 Sep 2018 09:54:41 +0200 Subject: [PATCH] removed static to function added narrowspark/coding-standard --- .changelog | 13 +++++++++++++ .gitattributes | 12 +++++++----- composer.json | 8 +++----- phpstan.neon | 4 ++++ src/PrettyArray.php | 12 ++++++------ tests/PrettyArrayTest.php | 2 +- 6 files changed, 34 insertions(+), 17 deletions(-) create mode 100755 .changelog diff --git a/.changelog b/.changelog new file mode 100755 index 0000000..087698d --- /dev/null +++ b/.changelog @@ -0,0 +1,13 @@ + $value) { if (! \is_int($key)) { - if (self::isClass($key)) { + if ($this->isClass($key)) { $key = $this->resolverCallbacks['class']($key); } else { $key = \sprintf("'%s'", $key); @@ -73,7 +73,7 @@ public function print(array $data, int $indentLevel = 1): string '%s%s%s,', $indent, \sprintf('%s => ', $key), - self::createValue($value, $indentLevel) + $this->createValue($value, $indentLevel) ); } @@ -98,7 +98,7 @@ private function createValue($value, int $indentLevel): string return $this->print($value, $indentLevel + 1); } - if (self::isClass($value)) { + if ($this->isClass($value)) { return $this->resolverCallbacks['class']($value); } @@ -116,7 +116,7 @@ private function createValue($value, int $indentLevel): string * * @return bool */ - private static function isClass($key): bool + private function isClass($key): bool { if (! \is_string($key)) { return false; diff --git a/tests/PrettyArrayTest.php b/tests/PrettyArrayTest.php index 2c9bee3..0d41cdb 100644 --- a/tests/PrettyArrayTest.php +++ b/tests/PrettyArrayTest.php @@ -83,6 +83,6 @@ public function testConvertsValueToValidPhp($array, $expected, int $indentLevel } } - $this->assertEquals($expected, $prettyArray->print($array, $indentLevel)); + static::assertEquals($expected, $prettyArray->print($array, $indentLevel)); } }