Skip to content

Commit

Permalink
Fix deprecations, typo and composer dependencies (#289)
Browse files Browse the repository at this point in the history
* Remove laravel.log from git index and ignore it

* Increase composer process timeout to 600s for tests:local script

* Fix PHP 8.2 deprecation warning: DayOfMonthField class

* Add Symfony 7.0 support

* Fix composer dependecies, typo and deprecations warnings for Symfony
  • Loading branch information
lifinsky authored Jan 14, 2024
1 parent 571d9ad commit c0a4b42
Show file tree
Hide file tree
Showing 21 changed files with 60 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Monorepo/CrossModuleTests/Tests/SimpleSymfonyKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Monorepo\CrossModuleTests\Tests;

use Ecotone\Messaging\Config\Container\ContainerBuilder;
use Ecotone\SymfonyBundle\DepedencyInjection\SymfonyContainerAdapter;
use Ecotone\SymfonyBundle\DependencyInjection\SymfonyContainerAdapter;
use Ramsey\Uuid\Uuid;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"Ecotone\\Modelling\\": "packages/Ecotone/src/Modelling/",
"Ecotone\\OpenTelemetry\\": "packages/OpenTelemetry/src",
"Ecotone\\SymfonyBundle\\": "packages/Symfony/SymfonyBundle",
"Ecotone\\SymfonyBundle\\DepedencyInjection\\": "packages/Symfony/DepedencyInjection",
"Ecotone\\SymfonyBundle\\DependencyInjection\\": "packages/Symfony/DependencyInjection",
"Monorepo\\": "Monorepo"
}
},
Expand Down Expand Up @@ -130,10 +130,10 @@
"doctrine/annotations": "^1.13",
"doctrine/cache": "^1.0.0",
"doctrine/orm": "^2.0|^3.0",
"friends-of-behat/symfony-extension": "^2.1",
"friends-of-behat/symfony-extension": "<=2.4.2|^2.5",
"friendsofphp/php-cs-fixer": "^3.9",
"guzzlehttp/psr7": "^2.0",
"orchestra/testbench": "^7.6",
"orchestra/testbench": "^7.6|^8.0",
"php-coveralls/php-coveralls": "^2.5",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^9.5",
Expand Down
65 changes: 29 additions & 36 deletions packages/Dbal/src/Compatibility/QueryBuilderProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Ecotone\Dbal\Compatibility;

use Doctrine\DBAL\Query\Expression\ExpressionBuilder;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Result;
use InvalidArgumentException;
Expand All @@ -25,169 +26,161 @@ public function __construct(private QueryBuilder $queryBuilder)
}

// override all public methods from parent class with empty body
public function select($select = null)
public function select($select = null): self
{
$this->queryBuilder->{__FUNCTION__}(...func_get_args());

return $this;
}

public function from($from, $alias = null)
public function from($from, $alias = null): self
{
$this->queryBuilder->{__FUNCTION__}($from, $alias);

return $this;
}

public function addSelect($select = null)
public function addSelect($select = null): self
{
$this->queryBuilder->{__FUNCTION__}(...func_get_args());

return $this;
}

public function delete($delete = null, $alias = null)
public function delete($delete = null, $alias = null): self
{
$this->queryBuilder->{__FUNCTION__}($delete, $alias);

return $this;
}

public function update($update = null, $alias = null)
public function update($update = null, $alias = null): self
{
$this->queryBuilder->{__FUNCTION__}($update, $alias);

return $this;
}

public function set($key, $value)
public function set($key, $value): self
{
$this->queryBuilder->{__FUNCTION__}($key, $value);

return $this;
}

public function where($predicates)
public function where($predicates): self
{
$this->queryBuilder->{__FUNCTION__}($predicates);

return $this;
}

public function andWhere($where)
public function andWhere($where): self
{
$this->queryBuilder->{__FUNCTION__}($where);

return $this;
}

public function orWhere($where)
public function orWhere($where): self
{
$this->queryBuilder->{__FUNCTION__}($where);

return $this;
}

public function groupBy($groupBy)
public function groupBy($groupBy): self
{
$this->queryBuilder->{__FUNCTION__}($groupBy);

return $this;
}

public function addGroupBy($groupBy)
public function addGroupBy($groupBy): self
{
$this->queryBuilder->{__FUNCTION__}($groupBy);

return $this;
}

public function having($having)
public function having($having): self
{
$this->queryBuilder->{__FUNCTION__}($having);

return $this;
}

public function setFirstResult($firstResult)
public function setFirstResult($firstResult): self
{
$this->queryBuilder->{__FUNCTION__}($firstResult);

return $this;
}

public function setMaxResults($maxResults)
public function setMaxResults($maxResults): self
{
$this->queryBuilder->{__FUNCTION__}($maxResults);

return $this;
}

public function setParameter($key, $value, $type = null)
public function setParameter($key, $value, $type = null): self
{
$this->queryBuilder->{__FUNCTION__}($key, $value, $type);

return $this;
}

public function setParameters(array $params, array $types = [])
public function setParameters(array $params, array $types = []): self
{
$this->queryBuilder->{__FUNCTION__}($params, $types);

return $this;
}

public function __clone()
public function __clone(): void
{
$this->queryBuilder->{__FUNCTION__}();

return $this;
}

public function __toString()
public function __toString(): string
{
$this->queryBuilder->{__FUNCTION__}();

return $this;
return $this->queryBuilder->{__FUNCTION__}();
}

public function expr()
public function expr(): ExpressionBuilder
{
$this->queryBuilder->{__FUNCTION__}();

return $this;
return $this->queryBuilder->{__FUNCTION__}();
}

public function resetQueryParts($queryPartNames = null)
public function resetQueryParts($queryPartNames = null): self
{
$this->queryBuilder->{__FUNCTION__}($queryPartNames);

return $this;
}

public function getQueryPart($queryPartName)
public function getQueryPart($queryPartName): mixed
{
$this->queryBuilder->{__FUNCTION__}($queryPartName);

return $this;
return $this->queryBuilder->{__FUNCTION__}($queryPartName);
}

public function getSQL()
public function getSQL(): string
{
return $this->queryBuilder->{__FUNCTION__}();
}

public function getType()
public function getType(): int
{
return $this->queryBuilder->{__FUNCTION__}();
}

public function getState()
public function getState(): int
{
return $this->queryBuilder->{__FUNCTION__}();
}

public function execute()
public function execute(): Result|int|string
{
return $this->queryBuilder->{__FUNCTION__}();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/src/Lite/LazyInMemoryContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function __construct(private array $definitions, private ?ContainerInterf
$this->resolvedObjects[ContainerInterface::class] = $this;
}

public function get(string $id)
public function get(string $id): mixed
{
return $this->resolveReference(new Reference($id));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function __construct(private ConfiguredMessagingSystem $messagingSystem,
{
}

public function call(string $wrappedClass, string $method, array $params = [])
public function call(string $wrappedClass, string $method, array $params = []): mixed
{
/** @var Gateway $gateway */
$gateway = $this->messagingSystem->getNonProxyGatewayByName($this->gatewayProxyReference->gatewayReferenceForMethod($method));
Expand Down
2 changes: 1 addition & 1 deletion packages/Laravel/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"behat/behat": "^3.10",
"guzzlehttp/psr7": "^2.0",
"phpstan/phpstan": "^1.8",
"orchestra/testbench": "^7.6",
"orchestra/testbench": "^7.6|^8.0",
"wikimedia/composer-merge-plugin": "^2.0",
"symfony/expression-language": "^6.0|^7.0",
"nesbot/carbon": "^2.71",
Expand Down
2 changes: 1 addition & 1 deletion packages/LiteApplication/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"behat/behat": "^3.10",
"guzzlehttp/psr7": "^2.0",
"phpstan/phpstan": "^1.8",
"orchestra/testbench": "^7.6",
"orchestra/testbench": "^7.6|^8.0",
"wikimedia/composer-merge-plugin": "^2.0"
},
"extra": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace Ecotone\SymfonyBundle\DepedencyInjection\Compiler;
namespace Ecotone\SymfonyBundle\DependencyInjection\Compiler;

use Ecotone\Lite\InMemoryContainerImplementation;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class AliasExternalReferenceForTesting implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (! $container->hasParameter('ecotone.external_references')) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ecotone\SymfonyBundle\DepedencyInjection\Compiler;
namespace Ecotone\SymfonyBundle\DependencyInjection\Compiler;

use Ecotone\Messaging\Config\ConfiguredMessagingSystem;
use Ecotone\Messaging\Handler\Gateway\ProxyFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ecotone\SymfonyBundle\DepedencyInjection\Compiler;
namespace Ecotone\SymfonyBundle\DependencyInjection\Compiler;

use Ecotone\Messaging\ConfigurationVariableService;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ecotone\SymfonyBundle\DepedencyInjection;
namespace Ecotone\SymfonyBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ecotone\SymfonyBundle\DepedencyInjection;
namespace Ecotone\SymfonyBundle\DependencyInjection;

use Ecotone\Messaging\Config\Container\Compiler\RegisterInterfaceToCallReferences;
use Ecotone\Messaging\Config\MessagingSystemConfiguration;
Expand All @@ -9,16 +9,16 @@
use Ecotone\Messaging\Config\ServiceConfiguration;
use Ecotone\Messaging\Gateway\ConsoleCommandRunner;
use Ecotone\Messaging\Handler\Recoverability\RetryTemplateBuilder;
use Ecotone\SymfonyBundle\DepedencyInjection\Compiler\CacheWarmer;
use Ecotone\SymfonyBundle\DepedencyInjection\Compiler\SymfonyConfigurationVariableService;
use Ecotone\SymfonyBundle\DependencyInjection\Compiler\CacheWarmer;
use Ecotone\SymfonyBundle\DependencyInjection\Compiler\SymfonyConfigurationVariableService;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Reference;

class EcotoneExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ecotone\SymfonyBundle\DepedencyInjection;
namespace Ecotone\SymfonyBundle\DependencyInjection;

use Ecotone\Messaging\Config\ConsoleCommandParameter;
use Ecotone\Messaging\Config\ConsoleCommandResultSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Ecotone\SymfonyBundle\DepedencyInjection;
namespace Ecotone\SymfonyBundle\DependencyInjection;

use Ecotone\Messaging\Config\ConfiguredMessagingSystem;
use Ecotone\Messaging\Config\Container\AttributeDefinition;
Expand Down
6 changes: 3 additions & 3 deletions packages/Symfony/SymfonyBundle/EcotoneSymfonyBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Ecotone\SymfonyBundle;

use Ecotone\SymfonyBundle\DepedencyInjection\Compiler\AliasExternalReferenceForTesting;
use Ecotone\SymfonyBundle\DepedencyInjection\EcotoneExtension;
use Ecotone\SymfonyBundle\DependencyInjection\Compiler\AliasExternalReferenceForTesting;
use Ecotone\SymfonyBundle\DependencyInjection\EcotoneExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand All @@ -15,7 +15,7 @@
*/
class EcotoneSymfonyBundle extends Bundle
{
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new AliasExternalReferenceForTesting());
Expand Down
Loading

0 comments on commit c0a4b42

Please sign in to comment.