Skip to content

Commit

Permalink
remove deprecated features
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jul 14, 2019
1 parent 8da4de3 commit baa094b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
6 changes: 1 addition & 5 deletions MessageCatalogue.php
Expand Up @@ -30,12 +30,8 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
* @param string $locale The locale
* @param array $messages An array of messages classified by domain
*/
public function __construct(?string $locale, array $messages = [])
public function __construct(string $locale, array $messages = [])
{
if (null === $locale) {
@trigger_error(sprintf('Passing "null" to the first argument of the "%s" method has been deprecated since Symfony 4.4 and will throw an error in 5.0.', __METHOD__), E_USER_DEPRECATED);
}

$this->locale = $locale;
$this->messages = $messages;
}
Expand Down
11 changes: 0 additions & 11 deletions Tests/MessageCatalogueTest.php
Expand Up @@ -23,17 +23,6 @@ public function testGetLocale()
$this->assertEquals('en', $catalogue->getLocale());
}

/**
* @group legacy
* @expectedDeprecation Passing "null" to the first argument of the "Symfony\Component\Translation\MessageCatalogue::__construct" method has been deprecated since Symfony 4.4 and will throw an error in 5.0.
*/
public function testGetNullLocale()
{
$catalogue = new MessageCatalogue(null);

$this->assertNull($catalogue->getLocale());
}

public function testGetDomains()
{
$catalogue = new MessageCatalogue('en', ['domain1' => [], 'domain2' => [], 'domain2+intl-icu' => [], 'domain3+intl-icu' => []]);
Expand Down
4 changes: 0 additions & 4 deletions Translator.php
Expand Up @@ -130,10 +130,6 @@ public function addResource(string $format, $resource, string $locale, string $d
$domain = 'messages';
}

if (null === $locale) {
@trigger_error(sprintf('Passing "null" to the third argument of the "%s" method has been deprecated since Symfony 4.4 and will throw an error in 5.0.', __METHOD__), E_USER_DEPRECATED);
}

$this->assertValidLocale($locale);

$this->resources[$locale][] = [$format, $resource, $domain];
Expand Down

0 comments on commit baa094b

Please sign in to comment.