Skip to content

Commit

Permalink
Merge pull request #182 from netglue/deprecate-traits
Browse files Browse the repository at this point in the history
Deprecate 'Helper' traits
  • Loading branch information
gsteel authored Apr 4, 2023
2 parents 75c44df + 6e86bee commit 22fcc5b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
36 changes: 36 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.9.0@8b9ad1eb9e8b7d3101f949291da2b9f7767cd163">
<file src="src/Container/Command/ConsumeCommandFactory.php">
<DeprecatedTrait>
<code>FailureTransportRetrievalBehaviour</code>
</DeprecatedTrait>
<InvalidArgument>
<code><![CDATA[$this->getFailureTransport($container)]]></code>
</InvalidArgument>
Expand Down Expand Up @@ -51,6 +54,9 @@
</MixedAssignment>
</file>
<file src="src/Container/Command/FailedMessagesRetryCommandFactory.php">
<DeprecatedTrait>
<code>FailureTransportRetrievalBehaviour</code>
</DeprecatedTrait>
<MixedArgument>
<code>$logger</code>
<code>$logger</code>
Expand All @@ -67,6 +73,10 @@
</MixedAssignment>
</file>
<file src="src/Container/Command/FailureCommandAbstractFactory.php">
<DeprecatedTrait>
<code>FailureTransportRetrievalBehaviour</code>
<code>StaticFactoryContainerAssertion</code>
</DeprecatedTrait>
<DocblockTypeContradiction>
<code>in_array($commandName, self::CAN_CREATE, true)</code>
</DocblockTypeContradiction>
Expand Down Expand Up @@ -131,14 +141,27 @@
</MixedAssignment>
</file>
<file src="src/Container/MessageBusStaticFactory.php">
<DeprecatedTrait>
<code>MessageBusOptionsRetrievalBehaviour</code>
<code>StaticFactoryContainerAssertion</code>
</DeprecatedTrait>
<MixedAssignment>
<code>$middleware[]</code>
</MixedAssignment>
<PossiblyInvalidArgument>
<code>$middleware</code>
</PossiblyInvalidArgument>
</file>
<file src="src/Container/Middleware/BusNameStampMiddlewareStaticFactory.php">
<DeprecatedTrait>
<code>StaticFactoryContainerAssertion</code>
</DeprecatedTrait>
</file>
<file src="src/Container/Middleware/MessageHandlerMiddlewareStaticFactory.php">
<DeprecatedTrait>
<code>MessageBusOptionsRetrievalBehaviour</code>
<code>StaticFactoryContainerAssertion</code>
</DeprecatedTrait>
<InvalidStringClass>
<code><![CDATA[new $locatorClass($options->handlers(), $container)]]></code>
</InvalidStringClass>
Expand All @@ -151,6 +174,10 @@
</MixedAssignment>
</file>
<file src="src/Container/Middleware/MessageSenderMiddlewareStaticFactory.php">
<DeprecatedTrait>
<code>MessageBusOptionsRetrievalBehaviour</code>
<code>StaticFactoryContainerAssertion</code>
</DeprecatedTrait>
<MixedArgument>
<code><![CDATA[$container->get(
$options->logger(),
Expand All @@ -174,6 +201,9 @@
</MixedAssignment>
</file>
<file src="src/Container/TransportFactory.php">
<DeprecatedTrait>
<code>StaticFactoryContainerAssertion</code>
</DeprecatedTrait>
<MixedArgument>
<code><![CDATA[$options['options'] ?? []]]></code>
<code>$serializer</code>
Expand Down Expand Up @@ -259,6 +289,9 @@
</MixedAssignment>
</file>
<file src="tests/Container/MessageBusOptionsRetrievalBehaviourTest.php">
<DeprecatedTrait>
<code>MessageBusOptionsRetrievalBehaviour</code>
</DeprecatedTrait>
<MixedAssignment>
<code>$options</code>
</MixedAssignment>
Expand Down Expand Up @@ -311,6 +344,9 @@
</UndefinedInterfaceMethod>
</file>
<file src="tests/Container/StaticFactoryContainerAssertionTest.php">
<DeprecatedTrait>
<code>StaticFactoryContainerAssertion</code>
</DeprecatedTrait>
<MixedMethodCall>
<code>callStatic</code>
<code>callStatic</code>
Expand Down
4 changes: 4 additions & 0 deletions src/Container/FailureTransportRetrievalBehaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
use function is_string;
use function sprintf;

/**
* @internal
* @deprecated This trait will be removed in version 2.0.0
*/
trait FailureTransportRetrievalBehaviour
{
private function hasFailureTransport(ContainerInterface $container): bool
Expand Down
4 changes: 4 additions & 0 deletions src/Container/MessageBusOptionsRetrievalBehaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use Netglue\PsrContainer\Messenger\MessageBusOptions;
use Psr\Container\ContainerInterface;

/**
* @internal
* @deprecated This trait will be removed in version 2.0.0
*/
trait MessageBusOptionsRetrievalBehaviour
{
private function options(ContainerInterface $container, string $busIdentifier): MessageBusOptions
Expand Down
4 changes: 4 additions & 0 deletions src/Container/StaticFactoryContainerAssertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

use function sprintf;

/**
* @internal
* @deprecated This trait will be removed in version 2.0.0
*/
trait StaticFactoryContainerAssertion
{
/** @param mixed[] $arguments */
Expand Down

0 comments on commit 22fcc5b

Please sign in to comment.