Skip to content

Commit 44383e4

Browse files
committed
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
1 parent 968379d commit 44383e4

22 files changed

+46
-46
lines changed

Catalogue/AbstractOperation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getDomains()
8989
*/
9090
public function getMessages($domain)
9191
{
92-
if (!in_array($domain, $this->getDomains())) {
92+
if (!\in_array($domain, $this->getDomains())) {
9393
throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain));
9494
}
9595

@@ -105,7 +105,7 @@ public function getMessages($domain)
105105
*/
106106
public function getNewMessages($domain)
107107
{
108-
if (!in_array($domain, $this->getDomains())) {
108+
if (!\in_array($domain, $this->getDomains())) {
109109
throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain));
110110
}
111111

@@ -121,7 +121,7 @@ public function getNewMessages($domain)
121121
*/
122122
public function getObsoleteMessages($domain)
123123
{
124-
if (!in_array($domain, $this->getDomains())) {
124+
if (!\in_array($domain, $this->getDomains())) {
125125
throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain));
126126
}
127127

DataCollector/TranslationDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private function sanitizeString($string, $length = 80)
135135
if (mb_strlen($string, $encoding) > $length) {
136136
return mb_substr($string, 0, $length - 3, $encoding).'...';
137137
}
138-
} elseif (strlen($string) > $length) {
138+
} elseif (\strlen($string) > $length) {
139139
return substr($string, 0, $length - 3).'...';
140140
}
141141

DataCollectorTranslator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
3333
public function __construct(TranslatorInterface $translator)
3434
{
3535
if (!$translator instanceof TranslatorBagInterface) {
36-
throw new \InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
36+
throw new \InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', \get_class($translator)));
3737
}
3838

3939
$this->translator = $translator;
@@ -104,7 +104,7 @@ public function getFallbackLocales()
104104
*/
105105
public function __call($method, $args)
106106
{
107-
return call_user_func_array(array($this->translator, $method), $args);
107+
return \call_user_func_array(array($this->translator, $method), $args);
108108
}
109109

110110
/**

Dumper/FileDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function dump(MessageCatalogue $messages, $options = array())
7676
copy($fullpath, $fullpath.'~');
7777
}
7878
} else {
79-
$directory = dirname($fullpath);
79+
$directory = \dirname($fullpath);
8080
if (!file_exists($directory) && !@mkdir($directory, 0777, true)) {
8181
throw new \RuntimeException(sprintf('Unable to create directory "%s".', $directory));
8282
}

Dumper/IcuResFileDumper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
4343
$data = $indexes = $resources = '';
4444

4545
foreach ($messages->all($domain) as $source => $target) {
46-
$indexes .= pack('v', strlen($data) + 28);
46+
$indexes .= pack('v', \strlen($data) + 28);
4747
$data .= $source."\0";
4848
}
4949

@@ -54,15 +54,15 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
5454
foreach ($messages->all($domain) as $source => $target) {
5555
$resources .= pack('V', $this->getPosition($data));
5656

57-
$data .= pack('V', strlen($target))
57+
$data .= pack('V', \strlen($target))
5858
.mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8')
5959
.$this->writePadding($data)
6060
;
6161
}
6262

6363
$resOffset = $this->getPosition($data);
6464

65-
$data .= pack('v', count($messages->all($domain)))
65+
$data .= pack('v', \count($messages->all($domain)))
6666
.$indexes
6767
.$this->writePadding($data)
6868
.$resources
@@ -76,7 +76,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
7676
$keyTop, // Index keys top
7777
$bundleTop, // Index resources top
7878
$bundleTop, // Index bundle top
79-
count($messages->all($domain)), // Index max table length
79+
\count($messages->all($domain)), // Index max table length
8080
0 // Index attributes
8181
);
8282

@@ -94,7 +94,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
9494

9595
private function writePadding($data)
9696
{
97-
$padding = strlen($data) % 4;
97+
$padding = \strlen($data) % 4;
9898

9999
if ($padding) {
100100
return str_repeat("\xAA", 4 - $padding);
@@ -103,7 +103,7 @@ private function writePadding($data)
103103

104104
private function getPosition($data)
105105
{
106-
return (strlen($data) + 28) / 4;
106+
return (\strlen($data) + 28) / 4;
107107
}
108108

109109
/**

Dumper/JsonFileDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
3838
if (isset($options['json_encoding'])) {
3939
$flags = $options['json_encoding'];
4040
} else {
41-
$flags = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
41+
$flags = \defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0;
4242
}
4343

4444
return json_encode($messages->all($domain), $flags);

Dumper/MoFileDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function formatCatalogue(MessageCatalogue $messages, $domain, array $opti
5757
'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size),
5858
);
5959

60-
$sourcesSize = strlen($sources);
60+
$sourcesSize = \strlen($sources);
6161
$sourcesStart = $header['offsetHashes'] + 1;
6262

6363
foreach ($offsets as $offset) {

Dumper/XliffFileDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,6 @@ private function dumpXliff2($defaultLocale, MessageCatalogue $messages, $domain,
188188
*/
189189
private function hasMetadataArrayInfo($key, $metadata = null)
190190
{
191-
return null !== $metadata && array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || is_array($metadata[$key]));
191+
return null !== $metadata && array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || \is_array($metadata[$key]));
192192
}
193193
}

Extractor/AbstractFileExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ abstract class AbstractFileExtractor
2525
*/
2626
protected function extractFiles($resource)
2727
{
28-
if (is_array($resource) || $resource instanceof \Traversable) {
28+
if (\is_array($resource) || $resource instanceof \Traversable) {
2929
$files = array();
3030
foreach ($resource as $file) {
3131
if ($this->canBeExtracted($file)) {

Loader/ArrayLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private function flatten(array &$messages, array $subnode = null, $path = null)
5252
$subnode = &$messages;
5353
}
5454
foreach ($subnode as $key => $value) {
55-
if (is_array($value)) {
55+
if (\is_array($value)) {
5656
$nodePath = $path ? $path.'.'.$key : $key;
5757
$this->flatten($messages, $value, $nodePath);
5858
if (null === $path) {

0 commit comments

Comments
 (0)