Skip to content

Commit

Permalink
fix(cs): fixed code style for 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Apr 17, 2024
1 parent 6716a6c commit d8ae694
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"kcs/serializer": "^2.0 || ^3.0 || ^4.0",
"mongodb/mongodb": "^1.4",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^10.0",
"ramsey/uuid": "^4.7",
"phpunit/phpunit": "^9.0 || ^10.0",
"ramsey/uuid": "^4.0",
"ramsey/uuid-doctrine": "^2.0",
"refugis/doctrine-extra": "^2.2 || ^3.0",
"roave/security-advisories": "dev-master",
Expand Down
4 changes: 1 addition & 3 deletions lib/Transport/Dbal/DbalTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ class DbalTransport implements TransportInterface, ListableReceiverInterface, Me
/** @var array<string, mixed> $options */
private array $options;

/**
* @param array<string, mixed> $options
*/
/** @param array<string, mixed> $options */
public function __construct(Connection $connection, ?SerializerInterface $serializer = null, array $options = [])
{
$this->connection = $connection;
Expand Down
14 changes: 8 additions & 6 deletions lib/Transport/Dbal/DbalTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
use function array_merge;
use function assert;
use function explode;
use function get_class;
use function gettype;
use function in_array;
use function is_array;
use function is_file;
use function is_object;
use function is_string;
Expand All @@ -28,9 +30,9 @@
use function Safe\parse_url;
use function Safe\preg_replace;
use function sprintf;
use function substr;
use function strpos;
use function strrev;
use function substr;
use function substr_count;

use const PATHINFO_EXTENSION;
Expand All @@ -56,9 +58,7 @@ class DbalTransportFactory implements TransportFactoryInterface
/** @var ManagerRegistryV2|ManagerRegistryV3|null */
private $managerRegistry;

/**
* @param ManagerRegistryV2|ManagerRegistryV3|null $managerRegistry
*/
/** @param ManagerRegistryV2|ManagerRegistryV3|null $managerRegistry */
public function __construct($managerRegistry = null)
{
if ($managerRegistry !== null && ! $managerRegistry instanceof ManagerRegistryV2 && ! $managerRegistry instanceof ManagerRegistryV3) {
Expand Down Expand Up @@ -101,10 +101,12 @@ public function createTransport(string $dsn, array $options, SerializerInterface
$path = substr($path, 1);
}

if ($params['scheme'] === 'sqlite' ||
if (
$params['scheme'] === 'sqlite' ||
$params['scheme'] === 'sqlite3' ||
$params['scheme'] === 'pdo-sqlite' ||
$params['scheme'] === 'pdo-sqlite3') {
$params['scheme'] === 'pdo-sqlite3'
) {
// SQLite has a little different handling. First we should determine the filename.
$databaseName = $path;
$tableName = 'messenger';
Expand Down
4 changes: 1 addition & 3 deletions lib/Transport/Mongo/MongoTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ class MongoTransport implements TransportInterface, ListableReceiverInterface, M
private MongoReceiver $receiver;
private MongoSender $sender;

/**
* @param array<string, mixed> $options
*/
/** @param array<string, mixed> $options */
public function __construct(Client $client, ?SerializerInterface $serializer = null, array $options = [])
{
$this->collection = $client->{$options['database_name']}->{$options['collection_name']};
Expand Down
2 changes: 2 additions & 0 deletions lib/Transport/Mongo/MongoTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
use Symfony\Component\Messenger\Transport\TransportInterface;

use function array_merge;
use function assert;
use function explode;
use function is_array;
use function parse_str;
use function Safe\parse_url;
use function Safe\substr;
Expand Down
5 changes: 5 additions & 0 deletions tests/Adapter/Serializer/MessengerSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kcs\MessengerExtra\Tests\Adapter\Serializer;

use Composer\InstalledVersions;
use Kcs\MessengerExtra\Adapter\Serializer\MessengerSerializer;
use Kcs\MessengerExtra\Tests\Fixtures\DummyMessage;
use Kcs\Serializer\DeserializationContext;
Expand Down Expand Up @@ -32,6 +33,10 @@ protected function setUp(): void
self::markTestSkipped('Kcs serializer is not installed.');
}

if (version_compare(InstalledVersions::getVersion('kcs/serializer'), '4.3.0', '<')) {
self::markTestSkipped('Kcs serializer adapter cannot be tested against the current version.');
}

$this->serializer = SerializerBuilder::create()->build();
$this->messengerSerializer = new MessengerSerializer($this->serializer);
}
Expand Down

0 comments on commit d8ae694

Please sign in to comment.