cs fixes, bug fixes, code coverage

This commit is contained in:
Dennis Eichhorn 2021-11-16 00:05:43 +01:00
parent 672273e43d
commit 9b1cf99422
6 changed files with 12 additions and 8 deletions

View File

@ -248,7 +248,7 @@ class Client
*/
private function orderContactElements(ContactElement $a, ContactElement $b) : int
{
return $a->getOrder() <=> $b->getOrder();
return $a->order <=> $b->order;
}
/**

View File

@ -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,
];
}

View File

@ -33,6 +33,7 @@ final class NullClientAttribute extends ClientAttribute
*/
public function __construct(int $id = 0)
{
parent::__construct();
$this->id = $id;
}
}

View File

@ -13,6 +13,7 @@
*/
declare(strict_types=1);
use Modules\Media\Models\NullMedia;
use phpOMS\Uri\UriFactory;
/** @var \phpOMS\Views\View $this */

View File

@ -86,11 +86,11 @@ echo $this->getData('nav')->render();
<div class="portlet-body">
<table class="layout wf-100">
<tr><td><label for="iName1"><?= $this->getHtml('Phone'); ?></label>
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::PHONE)->getContent()); ?>">
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::PHONE)->content); ?>">
<tr><td><label for="iName1"><?= $this->getHtml('Email'); ?></label>
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::EMAIL)->getContent()); ?>">
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::EMAIL)->content); ?>">
<tr><td><label for="iName1"><?= $this->getHtml('Website'); ?></label>
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::WEBSITE)->getContent()); ?>">
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($client->getMainContactElement(ContactType::WEBSITE)->content); ?>">
</table>
</div>
</section>
@ -147,7 +147,7 @@ echo $this->getData('nav')->render();
<section class="portlet highlight-4">
<div class="portlet-body">
<textarea class="undecorated"><?= $this->printHtml($client->getInfo()); ?></textarea>
<textarea class="undecorated"><?= $this->printHtml($client->info); ?></textarea>
</div>
</section>
</div>

View File

@ -53,6 +53,7 @@ final class ClientAttributeTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'id',
'client',
'type',
'value',
],