[Translation][file dump] remove deprecated format method.
This commit is contained in:
parent
111bdc5294
commit
6ee96fb3f2
@ -728,6 +728,33 @@ UPGRADE FROM 2.x to 3.0
|
||||
}
|
||||
```
|
||||
|
||||
* The method `FileDumper::format()` was removed. You should use
|
||||
`FileDumper::formatCatalogue()` instead.
|
||||
|
||||
Before:
|
||||
|
||||
```php
|
||||
class CustomDumper extends FileDumper
|
||||
{
|
||||
protected function format(MessageCatalogue $messages, $domain)
|
||||
{
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```php
|
||||
class CustomDumper extends FileDumper
|
||||
{
|
||||
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
||||
{
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Twig Bridge
|
||||
|
||||
* The `twig:lint` command has been deprecated since Symfony 2.7 and will be
|
||||
|
@ -4,6 +4,7 @@ CHANGELOG
|
||||
3.0.0
|
||||
-----
|
||||
|
||||
* removed `FileDumper::format()` method.
|
||||
* Changed the visibility of the locale property in `Translator` from protected to private.
|
||||
|
||||
2.8.0
|
||||
|
@ -23,16 +23,6 @@ class CsvFileDumper extends FileDumper
|
||||
private $delimiter = ';';
|
||||
private $enclosure = '"';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format(MessageCatalogue $messages, $domain = 'messages')
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -89,35 +89,13 @@ abstract class FileDumper implements DumperInterface
|
||||
/**
|
||||
* Transforms a domain of a message catalogue to its string representation.
|
||||
*
|
||||
* Override this function in child class if $options is used for message formatting.
|
||||
*
|
||||
* @param MessageCatalogue $messages
|
||||
* @param string $domain
|
||||
* @param array $options
|
||||
*
|
||||
* @return string representation
|
||||
*/
|
||||
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method will replace the format method in 3.0. You should overwrite it instead of overwriting format instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->format($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a domain of a message catalogue to its string representation.
|
||||
*
|
||||
* @param MessageCatalogue $messages
|
||||
* @param string $domain
|
||||
*
|
||||
* @return string representation
|
||||
*
|
||||
* @deprecated since version 2.8, to be removed in 3.0. Overwrite formatCatalogue() instead.
|
||||
*/
|
||||
protected function format(MessageCatalogue $messages, $domain)
|
||||
{
|
||||
throw new \LogicException('The "FileDumper::format" method needs to be overwritten, you should implement either "format" or "formatCatalogue".');
|
||||
}
|
||||
abstract public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array());
|
||||
|
||||
/**
|
||||
* Gets the file extension of the dumper.
|
||||
|
@ -25,16 +25,6 @@ class IcuResFileDumper extends FileDumper
|
||||
*/
|
||||
protected $relativePathTemplate = '%domain%/%locale%.%extension%';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format(MessageCatalogue $messages, $domain = 'messages')
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -20,16 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
|
||||
*/
|
||||
class IniFileDumper extends FileDumper
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format(MessageCatalogue $messages, $domain = 'messages')
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -20,16 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
|
||||
*/
|
||||
class JsonFileDumper extends FileDumper
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format(MessageCatalogue $messages, $domain = 'messages')
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -21,16 +21,6 @@ use Symfony\Component\Translation\Loader\MoFileLoader;
|
||||
*/
|
||||
class MoFileDumper extends FileDumper
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format(MessageCatalogue $messages, $domain = 'messages')
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -20,16 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
|
||||
*/
|
||||
class PhpFileDumper extends FileDumper
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function format(MessageCatalogue $messages, $domain)
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -20,16 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
|
||||
*/
|
||||
class PoFileDumper extends FileDumper
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format(MessageCatalogue $messages, $domain = 'messages')
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -20,16 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
|
||||
*/
|
||||
class QtFileDumper extends FileDumper
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function format(MessageCatalogue $messages, $domain)
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -46,16 +46,6 @@ class XliffFileDumper extends FileDumper
|
||||
throw new \InvalidArgumentException(sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function format(MessageCatalogue $messages, $domain)
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -44,16 +44,6 @@ class YamlFileDumper extends FileDumper
|
||||
return Yaml::dump($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function format(MessageCatalogue $messages, $domain)
|
||||
{
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use the formatCatalogue() method instead.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->formatCatalogue($messages, $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user