Skip to content

Commit

Permalink
Release 1.210.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dgafka authored and github-actions[bot] committed Jan 13, 2024
1 parent a64097e commit 571d9ad
Show file tree
Hide file tree
Showing 19 changed files with 59 additions and 58 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.209.1",
"ecotone/enqueue": "~1.210.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.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "amqp"
Expand Down
6 changes: 3 additions & 3 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.209.1",
"ecotone/enqueue": "~1.210.0",
"enqueue/dbal": "^0.10.17",
"doctrine/dbal": "^2.12.0|^3.0"
},
Expand All @@ -43,7 +43,7 @@
"doctrine/cache": "^1.0.0",
"doctrine/annotations": "^1.13",
"wikimedia/composer-merge-plugin": "^2.0",
"ecotone/jms-converter": "~1.209.1",
"ecotone/jms-converter": "~1.210.0",
"symfony/expression-language": "^6.0|^7.0"
},
"scripts": {
Expand All @@ -56,7 +56,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "dbal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Ecotone\Dbal\DbaBusinessMethod;

use DateTimeInterface;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\ParameterType;
use Ecotone\Dbal\Attribute\DbalParameter;
Expand Down Expand Up @@ -194,10 +195,10 @@ private function getParameterValueWithDefaultConversion(mixed $parameterValue):
{
$type = TypeDescriptor::createFromVariable($parameterValue);
if ($type->isClassOrInterface() && $this->conversionService->canConvert(
$type,
MediaType::createApplicationXPHP(),
UnionTypeDescriptor::createWith([TypeDescriptor::createStringType(), TypeDescriptor::createIntegerType()]),
MediaType::createApplicationXPHP()
$type,
MediaType::createApplicationXPHP(),
UnionTypeDescriptor::createWith([TypeDescriptor::createStringType(), TypeDescriptor::createIntegerType()]),
MediaType::createApplicationXPHP()
)) {
return $this->conversionService->convert(
$parameterValue,
Expand All @@ -208,7 +209,7 @@ private function getParameterValueWithDefaultConversion(mixed $parameterValue):
);
}

if ($parameterValue instanceof \DateTimeInterface) {
if ($parameterValue instanceof DateTimeInterface) {
return $parameterValue->format('Y-m-d H:i:s.u');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

namespace Test\Ecotone\Dbal\Fixture\DbalBusinessInterface;

use DateTimeImmutable;
use Ecotone\Dbal\Attribute\DbalQuery;
use Ecotone\Dbal\Attribute\DbalWrite;
use Ecotone\Dbal\DbaBusinessMethod\FetchMode;

interface ActivityService
{
#[DbalWrite('INSERT INTO activities VALUES (:personId, :activity, :time)')]
public function add(string $personId, string $activity, \DateTimeImmutable $time): void;
public function add(string $personId, string $activity, DateTimeImmutable $time): void;

/**
* @return string[]
Expand All @@ -20,7 +21,7 @@ public function add(string $personId, string $activity, \DateTimeImmutable $time
'SELECT person_id FROM activities WHERE type = :activity AND occurred_at >= :atOrAfter',
fetchMode: FetchMode::FIRST_COLUMN
)]
public function findAfterOrAt(string $activity, \DateTimeImmutable $atOrAfter): array;
public function findAfterOrAt(string $activity, DateTimeImmutable $atOrAfter): array;

/**
* @return string[]
Expand All @@ -29,8 +30,8 @@ public function findAfterOrAt(string $activity, \DateTimeImmutable $atOrAfter):
'SELECT person_id FROM activities WHERE type = :activity AND occurred_at < :atOrAfter',
fetchMode: FetchMode::FIRST_COLUMN
)]
public function findBefore(string $activity, \DateTimeImmutable $atOrAfter): array;
public function findBefore(string $activity, DateTimeImmutable $atOrAfter): array;

#[DbalWrite('INSERT INTO activities VALUES (:personId, :activity, :time)')]
public function store(PersonId $personId, string $activity, \DateTimeImmutable $time): void;
}
public function store(PersonId $personId, string $activity, DateTimeImmutable $time): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

namespace Test\Ecotone\Dbal\Fixture\DbalBusinessInterface;

use DateTimeInterface;
use Ecotone\Messaging\Attribute\Converter;

final class DateTimeToDayStringConverter
{
#[Converter]
public function to(\DateTimeInterface $dateTime): string
public function to(DateTimeInterface $dateTime): string
{
return $dateTime->format('Y-m-d');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ final class PersonId
{
public function __construct(private string $id)
{

}

public function __toString(): string
{
return $this->id;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Ecotone\Messaging\Config\ModulePackageList;
use Ecotone\Messaging\Config\ServiceConfiguration;
use Enqueue\Dbal\DbalConnectionFactory;

use function json_decode;

use Test\Ecotone\Dbal\DbalMessagingTestCase;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\DateTimeToDayStringConverter;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\PersonNameDTO;
Expand Down Expand Up @@ -136,8 +139,8 @@ public function test_fetching_to_specific_format()

$personQueryGateway = $ecotoneLite->getGateway(PersonQueryApi::class);
$this->assertEquals(
\json_decode('{"person_id":1,"name":"John"}', true),
\json_decode($personQueryGateway->getNameDTOInJson(1), true)
json_decode('{"person_id":1,"name":"John"}', true),
json_decode($personQueryGateway->getNameDTOInJson(1), true)
);
}

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

namespace Integration\DbalBusinessMethod;

use Ecotone\Dbal\Configuration\DbalConfiguration;
use DateTimeImmutable;
use Ecotone\Dbal\DbalConnection;
use Ecotone\Lite\EcotoneLite;
use Ecotone\Lite\Test\FlowTestSupport;
Expand All @@ -14,12 +14,7 @@
use Test\Ecotone\Dbal\DbalMessagingTestCase;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\ActivityService;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\DateTimeToDayStringConverter;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\ParameterDbalTypeConversion;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\PersonId;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\PersonNameDTOConverter;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\PersonRoleConverter;
use Test\Ecotone\Dbal\Fixture\DbalBusinessInterface\PersonService;
use Test\Ecotone\Dbal\Fixture\ORM\Person\Person;

/**
* @internal
Expand All @@ -31,39 +26,39 @@ public function test_using_date_time_parameter_default_conversion()
$ecotoneLite = $this->bootstrapEcotone();
/** @var ActivityService $activityGateway */
$activityGateway = $ecotoneLite->getGateway(ActivityService::class);
$activityGateway->add('1', 'registered_at', new \DateTimeImmutable('2020-01-01 10:00:00'));
$activityGateway->add('1', 'registered_at', new DateTimeImmutable('2020-01-01 10:00:00'));

$this->assertEquals(
[],
$activityGateway->findAfterOrAt('registered_at', new \DateTimeImmutable('2020-01-01 10:00:01'))
$activityGateway->findAfterOrAt('registered_at', new DateTimeImmutable('2020-01-01 10:00:01'))
);

$this->assertEquals(
['1'],
$activityGateway->findAfterOrAt('registered_at', new \DateTimeImmutable('2020-01-01 10:00:00'))
$activityGateway->findAfterOrAt('registered_at', new DateTimeImmutable('2020-01-01 10:00:00'))
);
}

public function test_using_defined_converter_over_default_one()
{
$ecotoneLite = $this->bootstrapEcotone([
DateTimeToDayStringConverter::class => new DateTimeToDayStringConverter()
DateTimeToDayStringConverter::class => new DateTimeToDayStringConverter(),
]);
/** @var ActivityService $activityGateway */
$activityGateway = $ecotoneLite->getGateway(ActivityService::class);
/** This will be converted to 2020-01-02 00:00:00 */
$activityGateway->add('1', 'registered_at', new \DateTimeImmutable('2020-01-02 01:00:00'));
$activityGateway->add('1', 'registered_at', new DateTimeImmutable('2020-01-02 01:00:00'));

$this->assertEquals(
[],
/** This will be converted to 2020-01-02 00:00:00 */
$activityGateway->findBefore('registered_at', new \DateTimeImmutable('2020-01-02 23:59:59'))
$activityGateway->findBefore('registered_at', new DateTimeImmutable('2020-01-02 23:59:59'))
);

$this->assertEquals(
['1'],
/** This will be converted to 2020-01-03 00:00:00 */
$activityGateway->findBefore('registered_at', new \DateTimeImmutable('2020-01-03 00:00:00'))
$activityGateway->findBefore('registered_at', new DateTimeImmutable('2020-01-03 00:00:00'))
);
}

Expand All @@ -72,16 +67,16 @@ public function test_using_to_string_method_for_object_conversion_if_available()
$ecotoneLite = $this->bootstrapEcotone();
/** @var ActivityService $activityGateway */
$activityGateway = $ecotoneLite->getGateway(ActivityService::class);
$activityGateway->store(new PersonId('1'), 'registered_at', new \DateTimeImmutable('2020-01-01 10:00:00'));
$activityGateway->store(new PersonId('1'), 'registered_at', new DateTimeImmutable('2020-01-01 10:00:00'));

$this->assertEquals(
[],
$activityGateway->findAfterOrAt('registered_at', new \DateTimeImmutable('2020-01-01 10:00:01'))
$activityGateway->findAfterOrAt('registered_at', new DateTimeImmutable('2020-01-01 10:00:01'))
);

$this->assertEquals(
['1'],
$activityGateway->findAfterOrAt('registered_at', new \DateTimeImmutable('2020-01-01 10:00:00'))
$activityGateway->findAfterOrAt('registered_at', new DateTimeImmutable('2020-01-01 10:00:00'))
);
}

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.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "ecotone"
Expand Down
4 changes: 2 additions & 2 deletions packages/Enqueue/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"require": {
"ecotone/ecotone": "~1.209.1",
"ecotone/ecotone": "~1.210.0",
"queue-interop/queue-interop": "^0.8",
"enqueue/dsn": "^0.10.4"
},
Expand All @@ -53,7 +53,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "enqueue"
Expand Down
4 changes: 2 additions & 2 deletions packages/JmsConverter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
},
"require": {
"ecotone/ecotone": "~1.209.1",
"ecotone/ecotone": "~1.210.0",
"jms/serializer": "^3.17",
"symfony/cache": "^5.4|^6.1|^7.0"
},
Expand All @@ -57,7 +57,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "jms-converter"
Expand Down
4 changes: 2 additions & 2 deletions packages/Laravel/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"require": {
"ecotone/ecotone": "~1.209.1",
"ecotone/ecotone": "~1.210.0",
"laravel/framework": "^9.5.2|^10.0"
},
"require-dev": {
Expand All @@ -54,7 +54,7 @@
]
},
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "laravel"
Expand Down
6 changes: 3 additions & 3 deletions packages/LiteApplication/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
}
},
"require": {
"ecotone/ecotone": "~1.209.1",
"ecotone/jms-converter": "~1.209.1",
"ecotone/ecotone": "~1.210.0",
"ecotone/jms-converter": "~1.210.0",
"php-di/php-di": "^7.0.1"
},
"require-dev": {
Expand All @@ -47,7 +47,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "lite-application"
Expand Down
4 changes: 2 additions & 2 deletions packages/OpenTelemetry/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
},
"require": {
"ecotone/ecotone": "~1.209.1",
"ecotone/ecotone": "~1.210.0",
"open-telemetry/sdk": "^1.0.0|^1.0.0beta17"
},
"require-dev": {
Expand Down Expand Up @@ -61,7 +61,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "open-telemetry"
Expand Down
4 changes: 2 additions & 2 deletions packages/PdoEventSourcing/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"require": {
"ecotone/dbal": "~1.209.1",
"ecotone/dbal": "~1.210.0",
"prooph/pdo-event-store": "^1.15.1"
},
"require-dev": {
Expand All @@ -49,7 +49,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "pdo-event-sourcing"
Expand Down
4 changes: 2 additions & 2 deletions packages/Redis/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
},
"require": {
"ecotone/enqueue": "~1.209.1",
"ecotone/enqueue": "~1.210.0",
"enqueue/redis": "^0.10.9"
},
"require-dev": {
Expand All @@ -57,7 +57,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.209.1-dev"
"dev-main": "1.210.0-dev"
},
"ecotone": {
"repository": "redis"
Expand Down
Loading

0 comments on commit 571d9ad

Please sign in to comment.