Skip to content

Commit c83c7cb

Browse files
committed
Move ServerType class to Server\Type
1 parent cd4bd1e commit c83c7cb

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

src/Controllers/Server/Create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function invoke(?array $args): bool
3333
$this->model->_responseCode = HttpCode::HTTP_OK;
3434
$this->model->form = Router::query();
3535
$this->model->server = new \BNETDocs\Libraries\Server(null);
36-
$this->model->server_types = \BNETDocs\Libraries\ServerType::getAllServerTypes();
36+
$this->model->server_types = \BNETDocs\Libraries\Server\Type::getAllServerTypes();
3737
if (Router::requestMethod() == Router::METHOD_POST) $this->handlePost();
3838
return true;
3939
}

src/Controllers/Server/Edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function invoke(?array $args): bool
5050
}
5151

5252
$this->model->_responseCode = HttpCode::HTTP_OK;
53-
$this->model->server_types = \BNETDocs\Libraries\ServerType::getAllServerTypes();
53+
$this->model->server_types = \BNETDocs\Libraries\Server\Type::getAllServerTypes();
5454
if (Router::requestMethod() == Router::METHOD_POST) $this->handlePost();
5555
return true;
5656
}

src/Controllers/Servers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function invoke(?array $args): bool
113113

114114
$this->model->server_types = [];
115115
foreach ($server_types as $id)
116-
$this->model->server_types[] = new \BNETDocs\Libraries\ServerType($id);
116+
$this->model->server_types[] = new \BNETDocs\Libraries\Server\Type($id);
117117

118118
$this->model->_responseCode = \BNETDocs\Libraries\Core\HttpCode::HTTP_OK;
119119
return true;

src/Libraries/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use \BNETDocs\Libraries\Core\DateTimeImmutable;
66
use \BNETDocs\Libraries\Db\MariaDb;
7-
use \BNETDocs\Libraries\ServerType;
7+
use \BNETDocs\Libraries\Server\Type as ServerType;
88
use \BNETDocs\Libraries\User;
99
use \CarlBennett\MVC\Libraries\Common;
1010
use \DateTimeInterface;

src/Libraries/ServerType.php renamed to src/Libraries/Server/Type.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace BNETDocs\Libraries;
3+
namespace BNETDocs\Libraries\Server;
44

55
use \BNETDocs\Libraries\Db\MariaDb;
66
use \OutOfBoundsException;
77
use \StdClass;
88

9-
class ServerType implements \BNETDocs\Interfaces\DatabaseObject, \JsonSerializable
9+
class Type implements \BNETDocs\Interfaces\DatabaseObject, \JsonSerializable
1010
{
1111
public const MAX_ID = 0xFFFFFFFFFFFFFFFF; // bigint(20) unsigned
1212
public const MAX_LABEL = 0xFF; // varchar(255)

src/Templates/Servers.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php /* vim: set colorcolumn= expandtab shiftwidth=2 softtabstop=2 tabstop=4 smarttab: */
22
namespace BNETDocs\Templates;
3-
use \BNETDocs\Libraries\ServerType;
43
use \BNETDocs\Libraries\User;
54
use \CarlBennett\MVC\Libraries\Common;
65
use \CarlBennett\MVC\Libraries\Pair;
@@ -36,7 +35,7 @@ require('./header.inc.phtml'); ?>
3635
<thead><tr><th scope="col">Status</th><th scope="col">Label</th><th scope="col">Address</th><th scope="col"></th></tr></thead><tbody>
3736
<? foreach ($servers_by_type as $type_id => $servers)
3837
{
39-
$server_type = new ServerType($type_id);
38+
$server_type = new \BNETDocs\Libraries\Server\Type($type_id);
4039
$server_type_label = filter_var($server_type->getLabel(), FILTER_SANITIZE_FULL_SPECIAL_CHARS);
4140
printf('<tr><th scope="row" colspan="4">%s</th></tr>', $server_type_label);
4241
foreach ($servers as $server)

0 commit comments

Comments
 (0)