Skip to content

Commit

Permalink
[BC break] Added implements \Stringable to Translation Value Obje…
Browse files Browse the repository at this point in the history
…ct (#344)

For more details see #344

Breaking changes:

Any class extending `\Ibexa\Contracts\Core\Repository\Values\Translation` will need to implement `\Stringable`.
  • Loading branch information
alongosz authored and barw4 committed Oct 17, 2024
1 parent 29e6434 commit e570cf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8480,11 +8480,6 @@ parameters:
count: 1
path: src/lib/Base/Exceptions/UnauthorizedException.php

-
message: "#^Cannot cast Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Translation to string\\.$#"
count: 1
path: src/lib/Base/Exceptions/UserPasswordValidationException.php

-
message: "#^Method Ibexa\\\\Core\\\\Base\\\\Exceptions\\\\UserPasswordValidationException\\:\\:__construct\\(\\) has parameter \\$errors with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -42900,11 +42895,6 @@ parameters:
count: 1
path: tests/lib/FieldType/FloatValueValidatorTest.php

-
message: "#^Cannot cast Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Translation to string\\.$#"
count: 1
path: tests/lib/FieldType/Generic/GenericTest.php

-
message: "#^Class Symfony\\\\Component\\\\Validator\\\\ConstraintViolation constructor invoked with 1 parameter, 6\\-10 required\\.$#"
count: 1
Expand Down
9 changes: 6 additions & 3 deletions src/contracts/Repository/Values/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@

namespace Ibexa\Contracts\Core\Repository\Values;

use Stringable;

/**
* Base class fro translation messages.
* Abstract for UI translation messages, use its extensions: Translation\Message, Translation\Plural.
*
* Use its extensions: Translation\Singular, Translation\Plural.
* @see \Ibexa\Contracts\Core\Repository\Values\Translation\Message
* @see \Ibexa\Contracts\Core\Repository\Values\Translation\Plural
*/
abstract class Translation extends ValueObject
abstract class Translation extends ValueObject implements Stringable
{
}

Expand Down

0 comments on commit e570cf8

Please sign in to comment.