Skip to content

Commit 54a9d88

Browse files
authored
Adapting to next version of common by using the Message interface (#26)
* Adapting to next version of common by using the Message interface * update composer.json
1 parent 47ad3ce commit 54a9d88

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"require": {
1212
"php": "^5.5 || ^7.0",
13-
"php-translation/common": "^0.2.1",
13+
"php-translation/common": "^0.3",
1414
"symfony/translation": "^2.7 || ^3.0 || ^4.0",
1515
"nyholm/nsa": "^1.1"
1616
},

src/FileStorage.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Translation\Reader\TranslationReaderInterface;
1717
use Symfony\Component\Translation\Writer\TranslationWriterInterface;
1818
use Translation\Common\Model\Message;
19+
use Translation\Common\Model\MessageInterface;
1920
use Translation\Common\Storage;
2021
use Translation\Common\TransferableStorage;
2122

@@ -98,7 +99,7 @@ public function get($locale, $domain, $key)
9899
/**
99100
* {@inheritdoc}
100101
*/
101-
public function create(Message $m)
102+
public function create(MessageInterface $m)
102103
{
103104
$catalogue = $this->getCatalogue($m->getLocale());
104105
if (!$catalogue->defines($m->getKey(), $m->getDomain())) {
@@ -110,7 +111,7 @@ public function create(Message $m)
110111
/**
111112
* {@inheritdoc}
112113
*/
113-
public function update(Message $m)
114+
public function update(MessageInterface $m)
114115
{
115116
$catalogue = $this->getCatalogue($m->getLocale());
116117
$catalogue->set($m->getKey(), $m->getTranslation(), $m->getDomain());

0 commit comments

Comments
 (0)