Skip to content

Commit

Permalink
Release 1.100.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dgafka authored and github-actions[bot] committed Aug 19, 2023
1 parent 3ffc2c0 commit cc4a489
Show file tree
Hide file tree
Showing 36 changed files with 81 additions and 68 deletions.
4 changes: 2 additions & 2 deletions packages/Amqp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"require": {
"ext-amqp": "*",
"ecotone/enqueue": "~1.99.0",
"ecotone/enqueue": "~1.100.0",
"enqueue/amqp-ext": "^0.10.18",
"enqueue/dsn": "^0.10.4",
"enqueue/enqueue": "^0.10.0"
Expand All @@ -63,7 +63,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.99.0-dev"
"dev-main": "1.100.0-dev"
},
"ecotone": {
"repository": "amqp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function transactional(MethodInvocation $methodInvocation, ?AmqpTransacti
$extChannel = $connectionFactory->createContext()->getExtChannel();
try {
$extChannel->rollbackTransaction();
} catch (\Throwable) {
} catch (Throwable) {
}
$extChannel->close(); // Has to be closed in amqp_lib, as if channel is trarnsactional does not allow for sending outside of transaction
}
Expand Down
5 changes: 3 additions & 2 deletions packages/Amqp/tests/Integration/AmqpMessageChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Test\Ecotone\Amqp\Integration;

use AMQPConnectionException;
use AMQPQueueException;
use Ecotone\Amqp\AmqpBackedMessageChannelBuilder;
use Ecotone\Lite\EcotoneLite;
Expand Down Expand Up @@ -75,7 +76,7 @@ public function test_sending_and_receiving_message_from_amqp_using_consumer()

try {
$this->getRabbitConnectionFactory()->createContext()->purgeQueue(new AmqpQueue($queueName));
} catch (\AMQPQueueException) {
} catch (AMQPQueueException) {
}

$ecotoneLite->getCommandBus()->sendWithRouting('order.register', 'milk');
Expand Down Expand Up @@ -147,7 +148,7 @@ public function test_failing_to_consume_due_to_connection_failure()
->withExecutionTimeLimitInMilliseconds(100)
->withStopOnError(false)
);
} catch (\AMQPConnectionException) {
} catch (AMQPConnectionException) {
$wasFinallyRethrown = true;
}

Expand Down
5 changes: 3 additions & 2 deletions packages/Amqp/tests/Integration/FailureTransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Ecotone\Messaging\Config\ServiceConfiguration;
use Enqueue\AmqpExt\AmqpConnectionFactory;
use Test\Ecotone\Amqp\AmqpMessagingTest;
use Throwable;

/**
* @internal
Expand All @@ -25,12 +26,12 @@ public function test_order_is_never_placed_when_transaction_is_failed(): void

try {
$ecotone->sendCommandWithRoutingKey('order.register', 'milk');
} catch (\Throwable) {
} catch (Throwable) {
}

try {
$ecotone->sendCommandWithRoutingKey('order.register', 'milk');
} catch (\Throwable) {
} catch (Throwable) {
}

self::assertNull(
Expand Down
4 changes: 2 additions & 2 deletions packages/Dbal/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"require": {
"ecotone/enqueue": "~1.99.0",
"ecotone/enqueue": "~1.100.0",
"enqueue/dbal": "^0.10.17",
"doctrine/dbal": "^2.12.0|^3.0"
},
Expand All @@ -54,7 +54,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.99.0-dev"
"dev-main": "1.100.0-dev"
},
"ecotone": {
"repository": "dbal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Ecotone\Messaging\Handler\Processor\MethodInvoker\MethodInvocation;
use Ecotone\Messaging\Handler\ReferenceSearchService;
use Enqueue\Dbal\DbalContext;
use Exception;
use PDOException;
use Psr\Log\LoggerInterface;
use Throwable;
Expand Down Expand Up @@ -87,7 +88,7 @@ public function transactional(MethodInvocation $methodInvocation, ?AsynchronousR
/** Doctrine hold the state, so it needs to be cleaned */
try {
$connection->rollBack();
} catch (\Exception) {
} catch (Exception) {
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/Dbal/src/DocumentStore/DbalDocumentStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private function createDataBaseTable(): void
$table->addColumn('document_id', Types::STRING);
$table->addColumn('document_type', Types::TEXT);
$table->addColumn('document', Types::JSON);
$table->addColumn('updated_at', Types::FLOAT, ['length'=>53]);
$table->addColumn('updated_at', Types::FLOAT, ['length' => 53]);

$table->setPrimaryKey(['collection', 'document_id']);

Expand Down
3 changes: 2 additions & 1 deletion packages/Dbal/tests/Integration/AsynchronousChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Ecotone\Messaging\Config\ModulePackageList;
use Ecotone\Messaging\Config\ServiceConfiguration;
use Enqueue\Dbal\DbalConnectionFactory;
use Exception;
use Test\Ecotone\Dbal\DbalMessagingTestCase;
use Test\Ecotone\Dbal\Fixture\AsynchronousChannelWithInterceptor\AddMetadataInterceptor;

Expand Down Expand Up @@ -70,7 +71,7 @@ public function test_handling_rollback_transaction_that_was_caused_by_non_ddl_st

try {
$ecotone->sendCommandWithRoutingKey('order.prepareWithFailure');
} catch (\Exception) {
} catch (Exception) {
}

self::assertCount(1, $ecotone
Expand Down
3 changes: 2 additions & 1 deletion packages/Dbal/tests/Integration/CollectorModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Ecotone\Modelling\AggregateNotFoundException;
use Enqueue\Dbal\DbalConnectionFactory;
use Ramsey\Uuid\Uuid;
use RuntimeException;
use Test\Ecotone\Dbal\DbalMessagingTestCase;
use Test\Ecotone\Dbal\Fixture\ORM\AsynchronousEventHandler\NotificationService;
use Test\Ecotone\Dbal\Fixture\ORM\Person\Person;
Expand Down Expand Up @@ -66,7 +67,7 @@ public function test_failure_during_sending_should_rollback_transaction()
$exception = false;
try {
$ecotoneLite->sendCommand(new RegisterPerson(100, 'Johny'));
} catch (\RuntimeException) {
} catch (RuntimeException) {
$exception = true;
}
$this->assertTrue($exception);
Expand Down
9 changes: 5 additions & 4 deletions packages/Dbal/tests/Integration/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Enqueue\Dbal\DbalConnectionFactory;
use Test\Ecotone\Dbal\DbalMessagingTestCase;
use Test\Ecotone\Dbal\Fixture\Transaction\OrderService;
use Throwable;

/**
* @internal
Expand All @@ -24,14 +25,14 @@ public function test_ordering_with_transaction_a_product_with_failure_so_the_ord

try {
$ecotone->sendCommandWithRoutingKey('order.prepare');
} catch (\Throwable) {
} catch (Throwable) {
}

self::assertCount(0, $ecotone->sendQueryWithRouting('order.getRegistered'));

try {
$ecotone->sendCommandWithRoutingKey('order.register', 'milk');
} catch (\Throwable) {
} catch (Throwable) {
}

self::assertCount(0, $ecotone->sendQueryWithRouting('order.getRegistered'));
Expand All @@ -43,14 +44,14 @@ public function test_handling_rollback_transaction_that_was_caused_by_non_ddl_st

try {
$ecotone->sendCommandWithRoutingKey('order.prepareWithFailure');
} catch (\Throwable) {
} catch (Throwable) {
}

self::assertCount(0, $ecotone->sendQueryWithRouting('order.getRegistered'));

try {
$ecotone->sendCommandWithRoutingKey('order.register', 'milk');
} catch (\Throwable) {
} catch (Throwable) {
}

self::assertCount(0, $ecotone->sendQueryWithRouting('order.getRegistered'));
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.99.0-dev"
"dev-main": "1.100.0-dev"
},
"ecotone": {
"repository": "ecotone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Attribute;

#[Attribute(Attribute::TARGET_METHOD|Attribute::TARGET_CLASS)]
#[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_CLASS)]
class IgnoreDocblockTypeHint
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private function initialize($namedMessageChannels): void
Assert::allInstanceOfType($namedMessageChannels, NamedMessageChannel::class);

/** @var NamedMessageChannel[] $namedMessageChannels */
$namedMessageChannels= array_merge($namedMessageChannels, [NamedMessageChannel::create(NullableMessageChannel::CHANNEL_NAME, NullableMessageChannel::create())]);
$namedMessageChannels = array_merge($namedMessageChannels, [NamedMessageChannel::create(NullableMessageChannel::CHANNEL_NAME, NullableMessageChannel::create())]);

foreach ($namedMessageChannels as $namedMessageChannel) {
$this->resolvableChannels[$namedMessageChannel->getName()] = $namedMessageChannel->getMessageChannel();
Expand Down
3 changes: 2 additions & 1 deletion packages/Ecotone/src/Messaging/Handler/InterfaceToCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Ecotone\Messaging\MessagingException;
use Ecotone\Messaging\Support\InvalidArgumentException;
use ReflectionClass;
use ReflectionException;

/**
* Class InterfaceToCall
Expand Down Expand Up @@ -440,7 +441,7 @@ private function initialize(string $interfaceName, string $methodName, Annotatio
try {
$reflectionClass = new ReflectionClass($interfaceName);
$reflectionMethod = $reflectionClass->getMethod($methodName);
} catch (\ReflectionException) {
} catch (ReflectionException) {
throw InvalidArgumentException::create("Interface {$interfaceName} has no method named {$methodName}");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use function json_decode;

use JsonException;

final class InMemoryDocumentStore implements DocumentStore
{
/**
Expand Down Expand Up @@ -33,7 +35,7 @@ public function addDocument(string $collectionName, string $documentId, object|a
if (is_string($document)) {
try {
json_decode($document, flags: JSON_THROW_ON_ERROR);
} catch (\JsonException) {
} catch (JsonException) {
throw DocumentException::create(sprintf('Trying to store document in %s collection with incorrect JSON: %s', $documentId, $collectionName));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @deprecated Ecotone 2.0 will drop this attribute. Use #[Identifier] instead
*/
#[Attribute(Attribute::TARGET_PROPERTY|Attribute::TARGET_PARAMETER)]
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class AggregateIdentifier extends Header
{
public function __construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Attribute;

#[Attribute(Attribute::TARGET_PROPERTY|Attribute::TARGET_PARAMETER)]
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class AggregateVersion
{
private bool $autoIncrease;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Attribute;
use Ecotone\Messaging\Attribute\InputOutputEndpointAnnotation;

#[Attribute(Attribute::TARGET_METHOD|Attribute::IS_REPEATABLE)]
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class CommandHandler extends InputOutputEndpointAnnotation
{
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/src/Modelling/Attribute/EventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Attribute;
use Ecotone\Messaging\Attribute\IdentifiedAnnotation;

#[Attribute(Attribute::TARGET_METHOD|Attribute::IS_REPEATABLE)]
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class EventHandler extends IdentifiedAnnotation
{
public string $listenTo;
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/src/Modelling/Attribute/Identifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Attribute;

#[Attribute(Attribute::TARGET_PROPERTY|Attribute::TARGET_PARAMETER)]
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class Identifier extends AggregateIdentifier
{
}
2 changes: 1 addition & 1 deletion packages/Ecotone/src/Modelling/Attribute/QueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Attribute;
use Ecotone\Messaging\Attribute\InputOutputEndpointAnnotation;

#[Attribute(Attribute::TARGET_METHOD|Attribute::IS_REPEATABLE)]
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class QueryHandler extends InputOutputEndpointAnnotation
{
public function __construct(string $routingKey = '', string $endpointId = '', string $outputChannelName = '', array $requiredInterceptorNames = [])
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/src/Modelling/Attribute/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Attribute;

#[Attribute(Attribute::TARGET_CLASS|Attribute::TARGET_METHOD)]
#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
class Repository
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @deprecated Ecotone 2.0 will drop this attribute. Use #[Identifier] instead
*/
#[Attribute(Attribute::TARGET_PROPERTY|Attribute::TARGET_PARAMETER)]
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER)]
class SagaIdentifier extends AggregateIdentifier
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
use Ecotone\Messaging\MessageHeaders;
use PHPUnit\Framework\TestCase;

use RuntimeException;

use function str_contains;

use Test\Ecotone\Modelling\Fixture\Collector\BetNotificator;

use Test\Ecotone\Modelling\Fixture\Collector\BetService;
use Test\Ecotone\Modelling\Fixture\Collector\BetStatistics;
use Test\Ecotone\Modelling\Fixture\Order\OrderService;
Expand Down Expand Up @@ -66,7 +67,7 @@ public function test_collected_message_is_delayed_so_messages_are_not_sent_on_ha

try {
$ecotoneLite->sendCommandWithRoutingKey('makeBet', true);
} catch (\RuntimeException) {
} catch (RuntimeException) {
}

$this->assertNull($ecotoneLite->getMessageChannel('bets')->receive(), 'No message should not be sent due to exception');
Expand All @@ -90,7 +91,7 @@ public function test_collected_message_is_delayed_so_messages_are_not_sent_on_ha

try {
$ecotoneLite->sendCommandWithRoutingKey('makeBet', true);
} catch (\RuntimeException) {
} catch (RuntimeException) {
}

$this->assertNull($ecotoneLite->getMessageChannel('bets')->receive(), 'No message should not be sent due to exception');
Expand Down Expand Up @@ -136,7 +137,7 @@ public function test_not_collected_message_will_be_sent_to_channel_before_except

try {
$ecotoneLite->sendCommandWithRoutingKey('makeBet', true);
} catch (\RuntimeException) {
} catch (RuntimeException) {
}

$this->assertNotNull($ecotoneLite->getMessageChannel('bets')->receive(), 'Message was not collected');
Expand All @@ -160,7 +161,7 @@ public function test_not_collected_message_will_be_sent_to_channel_before_except

try {
$ecotoneLite->sendCommandWithRoutingKey('makeBet', true);
} catch (\RuntimeException) {
} catch (RuntimeException) {
}

$this->assertNotNull($ecotoneLite->getMessageChannel('bets')->receive(), 'Message was not collected');
Expand Down Expand Up @@ -207,7 +208,7 @@ public function test_when_command_bus_inside_command_bus_it_will_not_release_mes

try {
$ecotoneLite->sendCommandWithRoutingKey('makeBlindBet', true);
} catch (\RuntimeException) {
} catch (RuntimeException) {
}

$this->assertNull($ecotoneLite->getMessageChannel('bets')->receive(), 'Message was collected');
Expand Down
Loading

0 comments on commit cc4a489

Please sign in to comment.