mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 01:38:41 +00:00
Type and cs fixes
This commit is contained in:
parent
55182c4138
commit
2a8ece6fcc
|
|
@ -1904,13 +1904,15 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
public static function populateManyToManyArray(array $result, array &$obj, int $depth = 3) : void
|
||||
{
|
||||
foreach ($result as $member => $values) {
|
||||
if (!empty($values)) {
|
||||
/** @var string $mapper */
|
||||
$mapper = static::$hasMany[$member]['mapper'];
|
||||
|
||||
$objects = $mapper::getArray($values, RelationType::ALL, $depth);
|
||||
$obj[$member] = $objects;
|
||||
if (empty($values)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var string $mapper */
|
||||
$mapper = static::$hasMany[$member]['mapper'];
|
||||
|
||||
$objects = $mapper::getArray($values, RelationType::ALL, $depth);
|
||||
$obj[$member] = $objects;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\Socket\Server;
|
||||
|
||||
use phpOMS\Account\Account;
|
||||
use Modules\Admin\Models\NullAccount;
|
||||
use phpOMS\Application\ApplicationAbstract;
|
||||
use phpOMS\Message\Socket\PacketManager;
|
||||
use phpOMS\Socket\Client\ClientConnection;
|
||||
|
|
@ -270,8 +270,8 @@ class Server extends SocketAbstract
|
|||
public function connectClient($socket) : void
|
||||
{
|
||||
$this->app->logger->debug('Connecting client...');
|
||||
$this->app->accountManager->add(new Account(1));
|
||||
$this->clientManager->add($client = new ClientConnection(new Account(1), $socket));
|
||||
$this->app->accountManager->add(new NullAccount(1));
|
||||
$this->clientManager->add($client = new ClientConnection(new NullAccount(1), $socket));
|
||||
$this->conn[$client->getId()] = $socket;
|
||||
$this->app->logger->debug('Connected client.');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\tests\Account;
|
||||
|
||||
use phpOMS\Account\Account;
|
||||
use phpOMS\Account\AccountManager;
|
||||
use phpOMS\Account\NullAccount;
|
||||
|
||||
require_once __DIR__ . '/../Autoloader.php';
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ class AccountManagerTest extends \PHPUnit\Framework\TestCase
|
|||
{
|
||||
$this->manager = new AccountManager($GLOBALS['httpSession']);
|
||||
|
||||
$this->account = new Account(3);
|
||||
$this->account = new NullAccount(3);
|
||||
$this->account->generatePassword('abcd');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class BaseModelMapper extends DataMapperAbstract
|
|||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string}>
|
||||
* @var array<string, array{mapper:string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $hasMany = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user