From 9b1cf99422253579b69d2f28ae501ed405a8040a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 16 Nov 2021 00:05:43 +0100 Subject: [PATCH] cs fixes, bug fixes, code coverage --- Models/Client.php | 2 +- Models/ClientAttribute.php | 7 ++++--- Models/NullClientAttribute.php | 1 + Theme/Backend/client-list.tpl.php | 1 + Theme/Backend/client-profile.tpl.php | 8 ++++---- tests/Models/ClientAttributeTest.php | 1 + 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Models/Client.php b/Models/Client.php index 346a218..4890e48 100755 --- a/Models/Client.php +++ b/Models/Client.php @@ -248,7 +248,7 @@ class Client */ private function orderContactElements(ContactElement $a, ContactElement $b) : int { - return $a->getOrder() <=> $b->getOrder(); + return $a->order <=> $b->order; } /** diff --git a/Models/ClientAttribute.php b/Models/ClientAttribute.php index 921fae8..6b12821 100755 --- a/Models/ClientAttribute.php +++ b/Models/ClientAttribute.php @@ -87,9 +87,10 @@ class ClientAttribute implements \JsonSerializable, ArrayableInterface public function toArray() : array { return [ - 'id' => $this->id, - 'type' => $this->type, - 'value' => $this->value, + 'id' => $this->id, + 'client' => $this->client, + 'type' => $this->type, + 'value' => $this->value, ]; } diff --git a/Models/NullClientAttribute.php b/Models/NullClientAttribute.php index d450f36..9ab399e 100755 --- a/Models/NullClientAttribute.php +++ b/Models/NullClientAttribute.php @@ -33,6 +33,7 @@ final class NullClientAttribute extends ClientAttribute */ public function __construct(int $id = 0) { + parent::__construct(); $this->id = $id; } } diff --git a/Theme/Backend/client-list.tpl.php b/Theme/Backend/client-list.tpl.php index a64550e..6947624 100755 --- a/Theme/Backend/client-list.tpl.php +++ b/Theme/Backend/client-list.tpl.php @@ -13,6 +13,7 @@ */ declare(strict_types=1); +use Modules\Media\Models\NullMedia; use phpOMS\Uri\UriFactory; /** @var \phpOMS\Views\View $this */ diff --git a/Theme/Backend/client-profile.tpl.php b/Theme/Backend/client-profile.tpl.php index a82ee10..f4dd3fe 100755 --- a/Theme/Backend/client-profile.tpl.php +++ b/Theme/Backend/client-profile.tpl.php @@ -86,11 +86,11 @@ echo $this->getData('nav')->render();
-
+
-
+
-
+
@@ -147,7 +147,7 @@ echo $this->getData('nav')->render();
- +
diff --git a/tests/Models/ClientAttributeTest.php b/tests/Models/ClientAttributeTest.php index 692deda..79e8cec 100644 --- a/tests/Models/ClientAttributeTest.php +++ b/tests/Models/ClientAttributeTest.php @@ -53,6 +53,7 @@ final class ClientAttributeTest extends \PHPUnit\Framework\TestCase self::assertEquals( [ 'id', + 'client', 'type', 'value', ],