Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gos/web-socket-bundle",
"name": "oroinc/web-socket-bundle",
"type": "symfony-bundle",
"description": "Symfony Web Socket Bundle",
"description": "A fork of Symfony Web Socket Bundle that enables PHP 8.4 and Symfony 7 support",
"keywords": ["Web Socket Bundle", "Websocket", "WAMP", "IO", "Ratchet"],
"homepage": "https://github.com/GeniusesOfSymfony/WebSocketBundle",
"license": "MIT",
Expand All @@ -16,25 +16,24 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"cboden/ratchet": "^0.4.4",
"gos/pubsub-router-bundle": "^2.2",
"gos/websocket-client": "^1.1",
"php": "^8.4",
"cboden/ratchet": "^0.4",
"oroinc/pubsub-router-bundle": "~2.9",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"react/event-loop": "^1.2",
"react/socket": "^1.9",
"symfony/config": "^4.4 || ^5.4 || ^6.0",
"symfony/console": "^4.4 || ^5.4 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.4 || ^6.0",
"symfony/config": "^6.0 || ^7.0",
"symfony/console": "^6.0 || ^7.0",
"symfony/dependency-injection": "^6.0 || ^7.0",
"symfony/deprecation-contracts": "^2.1 || ^3.0",
"symfony/event-dispatcher": "^4.4 || ^5.4 || ^6.0",
"symfony/http-foundation": "^4.4 || ^5.4 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.4 || ^6.0",
"symfony/event-dispatcher": "^6.0 || ^7.0",
"symfony/http-foundation": "^6.0 || ^7.0",
"symfony/http-kernel": "^6.0 || ^7.0",
"symfony/polyfill-php80": "^1.15",
"symfony/security-core": "^4.4 || ^5.4 || ^6.0",
"symfony/serializer": "^4.4 || ^5.4 || ^6.0",
"symfony/string": "^5.4 || ^6.0",
"symfony/yaml": "^4.4 || ^5.4 || ^6.0"
"symfony/security-core": "^6.0 || ^7.0",
"symfony/serializer": "^6.0 || ^7.0",
"symfony/string": "^6.0 || ^7.0",
"symfony/yaml": "^6.0 || ^7.0"
},
"require-dev": {
"doctrine/cache": "^1.11 || ^2.0",
Expand All @@ -45,12 +44,12 @@
"phpstan/phpstan-phpunit": "1.1.1",
"phpstan/phpstan-symfony": "1.2.13",
"phpunit/phpunit": "^9.5",
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"symfony/options-resolver": "^4.4 || ^5.4 || ^6.0",
"symfony/phpunit-bridge": "^5.4 || ^6.0",
"symfony/stopwatch": "^4.4 || ^5.4 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.4 || ^6.0",
"symfony/web-profiler-bundle": "^4.4 || ^5.4 || ^6.0"
"symfony/cache": "^6.0 || ^7.0",
"symfony/options-resolver": "^6.0 || ^7.0",
"symfony/phpunit-bridge": "^6.0 || ^7.0",
"symfony/stopwatch": "^6.0 || ^7.0",
"symfony/twig-bundle": "^6.0 || ^7.0",
"symfony/web-profiler-bundle": "^6.0 || ^7.0"
},
"conflict": {
"doctrine/cache": "<1.11",
Expand All @@ -65,7 +64,10 @@
"twig/twig": "<1.36 || >=2.0,<2.6"
},
"autoload": {
"psr-4": { "Gos\\Bundle\\WebSocketBundle\\": "src/" }
"psr-4": {
"Gos\\Bundle\\WebSocketBundle\\": "src/",
"Gos\\Component\\WebSocketClient\\": "src/Component/WebSocketClient/"
}
},
"autoload-dev": {
"psr-4": { "Gos\\Bundle\\WebSocketBundle\\Tests\\": "tests/" }
Expand Down
8 changes: 1 addition & 7 deletions src/Authentication/ConnectionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ public function findTokenForConnection(ConnectionInterface $connection): TokenIn
*/
public function getUser(ConnectionInterface $connection)
{
$user = $this->findTokenForConnection($connection)->getUser();

if (null !== $user && !($user instanceof UserInterface)) {
trigger_deprecation('gos/web-socket-bundle', '3.14', 'Retrieving a user that is not an instance of %s is deprecated in %s().', UserInterface::class, __METHOD__);
}

return $user;
return $this->findTokenForConnection($connection)->getUser();
}
}
4 changes: 1 addition & 3 deletions src/Client/Auth/WebsocketAuthenticationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
use Symfony\Component\Security\Core\Authentication\Token\NullToken;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', WebsocketAuthenticationProvider::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
final class WebsocketAuthenticationProvider implements WebsocketAuthenticationProviderInterface, LoggerAwareInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Auth/WebsocketAuthenticationProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
use Ratchet\ConnectionInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" interface is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', WebsocketAuthenticationProviderInterface::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
interface WebsocketAuthenticationProviderInterface
{
Expand Down
8 changes: 1 addition & 7 deletions src/Client/ClientConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
use ReturnTypeWillChange;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', ClientConnection::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
final class ClientConnection implements \ArrayAccess
{
Expand Down Expand Up @@ -37,8 +35,6 @@ public function getConnection(): ConnectionInterface
*/
public function offsetExists($offset): bool
{
trigger_deprecation('gos/web-socket-bundle', '3.0', 'Accessing properties from %s as an array is deprecated and will be removed in 4.0, use the getters to access the properties.', self::class);

return \in_array($offset, ['client', 'connection'], true);
}

Expand All @@ -50,8 +46,6 @@ public function offsetExists($offset): bool
#[ReturnTypeWillChange]
public function offsetGet($offset)
{
trigger_deprecation('gos/web-socket-bundle', '3.0', 'Accessing properties from %s as an array is deprecated and will be removed in 4.0, use the getters to access the properties.', self::class);

switch ($offset) {
case 'client':
return $this->client;
Expand Down
4 changes: 1 addition & 3 deletions src/Client/ClientManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\User\UserInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', ClientManipulator::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
final class ClientManipulator implements ClientManipulatorInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/ClientManipulatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\User\UserInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" interface is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', ClientManipulatorInterface::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
interface ClientManipulatorInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/ClientStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
use Ratchet\ConnectionInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', ClientStorage::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
final class ClientStorage implements ClientStorageInterface, LoggerAwareInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/ClientStorageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
use Ratchet\ConnectionInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" interface is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', ClientStorageInterface::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*
* @method void removeAllClients()
*/
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Driver/DoctrineCacheDriverDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
use Doctrine\Common\Cache\ClearableCache;
use Symfony\Component\Cache\DoctrineProvider;

trigger_deprecation('gos/web-socket-bundle', '3.4', 'The "%s" class is deprecated and will be removed in 4.0, use the "%s" class with a "%s" instance instead.', DoctrineCacheDriverDecorator::class, SymfonyCacheDriverDecorator::class, DoctrineProvider::class);

/**
* @author Johann Saunier <johann_27@hotmail.fr>
*
* @deprecated to be removed in 4.0, use the `Gos\Bundle\WebSocketBundle\Client\Driver\SymfonyCacheDriverDecorator` with a `Symfony\Component\Cache\DoctrineProvider` instance instead
* deprecated to be removed in 4.0, use the `Gos\Bundle\WebSocketBundle\Client\Driver\SymfonyCacheDriverDecorator` with a `Symfony\Component\Cache\DoctrineProvider` instance instead
*/
final class DoctrineCacheDriverDecorator implements DriverInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Driver/DriverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Gos\Bundle\WebSocketBundle\Client\Driver;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', DriverException::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
class DriverException extends \Exception
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Driver/DriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Gos\Bundle\WebSocketBundle\Client\Driver;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" interface is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', DriverInterface::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*
* @method void clear()
*/
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Driver/InMemoryDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Gos\Bundle\WebSocketBundle\Client\Driver;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', InMemoryDriver::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
final class InMemoryDriver implements DriverInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Driver/SymfonyCacheDriverDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

use Symfony\Component\Cache\Adapter\AdapterInterface;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', SymfonyCacheDriverDecorator::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
final class SymfonyCacheDriverDecorator implements DriverInterface
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Exception/ClientNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Gos\Bundle\WebSocketBundle\Client\Exception;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', ClientNotFoundException::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
class ClientNotFoundException extends StorageException
{
Expand Down
4 changes: 1 addition & 3 deletions src/Client/Exception/StorageException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

namespace Gos\Bundle\WebSocketBundle\Client\Exception;

trigger_deprecation('gos/web-socket-bundle', '3.11', 'The "%s" class is deprecated and will be removed in 4.0, use the new websocket authentication API instead.', StorageException::class);

/**
* @deprecated to be removed in 4.0, use the new websocket authentication API instead
* deprecated to be removed in 4.0, use the new websocket authentication API instead
*/
class StorageException extends \Exception
{
Expand Down
4 changes: 0 additions & 4 deletions src/Command/WebsocketServerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ public function __construct(ServerLauncherInterface $entryPoint, string $host, i
{
parent::__construct();

if (null === $serverRegistry) {
trigger_deprecation('gos/web-socket-bundle', '3.12', 'Not passing the "%s" to the "%s" constructor is deprecated and will be required as of 4.0.', ServerRegistry::class, self::class);
}

$this->serverLauncher = $entryPoint;
$this->port = $port;
$this->host = $host;
Expand Down
24 changes: 24 additions & 0 deletions src/Component/WebSocketClient/Exception/BadResponseException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Gos\Component\WebSocketClient\Exception;

/**
* Copy of Gos\Component\WebSocketClient\Exception\BadResponseException
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Johann Saunier <johann_27@hotmail.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
class BadResponseException extends WebSocketException
{
}
24 changes: 24 additions & 0 deletions src/Component/WebSocketClient/Exception/WebSocketException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Gos\Component\WebSocketClient\Exception;

/**
* Copy of Gos\Component\WebSocketClient\Exception\WebSocketException
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Johann Saunier <johann_27@hotmail.fr>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
class WebSocketException extends \Exception
{
}
Loading