ALPHA 3.0.2a

This commit is contained in:
TheGamecraft
2018-09-10 08:51:18 -04:00
parent 7fe13ae0a7
commit 0e0ef86b71
1404 changed files with 10604 additions and 33714 deletions

View File

@@ -11,9 +11,9 @@
namespace Symfony\Component\Translation\Dumper;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Exception\InvalidArgumentException;
use Symfony\Component\Translation\Exception\RuntimeException;
use Symfony\Component\Translation\MessageCatalogue;
/**
* FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s).
@@ -51,7 +51,7 @@ abstract class FileDumper implements DumperInterface
*/
public function setBackup($backup)
{
@trigger_error(sprintf('The %s() method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED);
if (false !== $backup) {
throw new \LogicException('The backup feature is no longer supported.');
@@ -71,7 +71,7 @@ abstract class FileDumper implements DumperInterface
foreach ($messages->getDomains() as $domain) {
$fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale());
if (!file_exists($fullpath)) {
$directory = dirname($fullpath);
$directory = \dirname($fullpath);
if (!file_exists($directory) && !@mkdir($directory, 0777, true)) {
throw new RuntimeException(sprintf('Unable to create directory "%s".', $directory));
}

View File

@@ -33,7 +33,7 @@ class IcuResFileDumper extends FileDumper
$data = $indexes = $resources = '';
foreach ($messages->all($domain) as $source => $target) {
$indexes .= pack('v', strlen($data) + 28);
$indexes .= pack('v', \strlen($data) + 28);
$data .= $source."\0";
}
@@ -44,7 +44,7 @@ class IcuResFileDumper extends FileDumper
foreach ($messages->all($domain) as $source => $target) {
$resources .= pack('V', $this->getPosition($data));
$data .= pack('V', strlen($target))
$data .= pack('V', \strlen($target))
.mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8')
.$this->writePadding($data)
;
@@ -52,7 +52,7 @@ class IcuResFileDumper extends FileDumper
$resOffset = $this->getPosition($data);
$data .= pack('v', count($messages->all($domain)))
$data .= pack('v', \count($messages->all($domain)))
.$indexes
.$this->writePadding($data)
.$resources
@@ -66,7 +66,7 @@ class IcuResFileDumper extends FileDumper
$keyTop, // Index keys top
$bundleTop, // Index resources top
$bundleTop, // Index bundle top
count($messages->all($domain)), // Index max table length
\count($messages->all($domain)), // Index max table length
0 // Index attributes
);
@@ -84,7 +84,7 @@ class IcuResFileDumper extends FileDumper
private function writePadding($data)
{
$padding = strlen($data) % 4;
$padding = \strlen($data) % 4;
if ($padding) {
return str_repeat("\xAA", 4 - $padding);
@@ -93,7 +93,7 @@ class IcuResFileDumper extends FileDumper
private function getPosition($data)
{
return (strlen($data) + 28) / 4;
return (\strlen($data) + 28) / 4;
}
/**

View File

@@ -11,8 +11,8 @@
namespace Symfony\Component\Translation\Dumper;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Loader\MoFileLoader;
use Symfony\Component\Translation\MessageCatalogue;
/**
* MoFileDumper generates a gettext formatted string representation of a message catalogue.
@@ -47,7 +47,7 @@ class MoFileDumper extends FileDumper
'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size),
);
$sourcesSize = strlen($sources);
$sourcesSize = \strlen($sources);
$sourcesStart = $header['offsetHashes'] + 1;
foreach ($offsets as $offset) {

View File

@@ -11,8 +11,8 @@
namespace Symfony\Component\Translation\Dumper;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Exception\InvalidArgumentException;
use Symfony\Component\Translation\MessageCatalogue;
/**
* XliffFileDumper generates xliff files from a message catalogue.
@@ -147,7 +147,7 @@ class XliffFileDumper extends FileDumper
$translation = $dom->createElement('unit');
$translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._'));
$name = $source;
if (strlen($source) > 80) {
if (\strlen($source) > 80) {
$name = substr(md5($source), -7);
}
$translation->setAttribute('name', $name);
@@ -200,6 +200,6 @@ class XliffFileDumper extends FileDumper
*/
private function hasMetadataArrayInfo($key, $metadata = null)
{
return null !== $metadata && array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || is_array($metadata[$key]));
return null !== $metadata && array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || \is_array($metadata[$key]));
}
}

View File

@@ -11,10 +11,10 @@
namespace Symfony\Component\Translation\Dumper;
use Symfony\Component\Translation\Exception\LogicException;
use Symfony\Component\Translation\MessageCatalogue;
use Symfony\Component\Translation\Util\ArrayConverter;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Translation\Exception\LogicException;
/**
* YamlFileDumper generates yaml files from a message catalogue.