<?php declare(strict_types=1);

namespace Gos\Bundle\WebSocketBundle\Client;

use Ratchet\ConnectionInterface;
use Ratchet\Wamp\Topic;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

interface ClientManipulatorInterface
{
    /**
     * @return ClientConnection[]
     */
    public function findAllByUsername(Topic $topic, string $username): array;

    /**
     * @return ClientConnection[]
     */
    public function findByRoles(Topic $topic, array $roles): array;

    /**
     * @return ClientConnection[]
     */
    public function getAll(Topic $topic, bool $anonymous = false): array;

    public function getClient(ConnectionInterface $connection): TokenInterface;

    /**
     * @return string|object
     */
    public function getUser(ConnectionInterface $connection);
}

<?php declare(strict_types=1);

namespace Gos\Bundle\WebSocketBundle\Client;

use Ratchet\ConnectionInterface;
use Ratchet\Wamp\Topic;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\User\UserInterface;

interface ClientManipulatorInterface
{
    /**
     * @return ClientConnection[]
     */
    public function findAllByUsername(Topic $topic, string $username): array;

    /**
     * @return ClientConnection[]
     */
    public function findByRoles(Topic $topic, array $roles): array;

    /**
     * @return ClientConnection[]
     */
    public function getAll(Topic $topic, bool $anonymous = false): array;

    public function getClient(ConnectionInterface $connection): TokenInterface;

    /**
     * @return string|\Stringable|UserInterface
     */
    public function getUser(ConnectionInterface $connection);
}

Update the client manipulator interface's user return to match up with the security token types
Update the client manipulator interface's user return to match up with the security token types