Skip to content

Commit 3f13970

Browse files
committed
Do not use mb_* string functions, they are not needed.
1 parent de7af15 commit 3f13970

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Exporter/Image.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class Image implements ExporterInterface
3434
*/
3535
public function __construct()
3636
{
37-
if (0 === mb_stripos(PHP_OS, 'WIN')) {
37+
if (0 === stripos(PHP_OS, 'WIN')) {
3838
$this->executable = 'dot.exe';
3939
}
4040
}

src/Importer/Text.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ private function createNode(string $label): AttributeNodeInterface
5151
private function parse(string $subject): array
5252
{
5353
$result = [
54-
'value' => mb_substr($subject, 1, mb_strpos($subject, '[', 1) - 1),
54+
'value' => substr($subject, 1, strpos($subject, '[', 1) - 1),
5555
'children' => [],
5656
];
5757

58-
if (false === $nextBracket = mb_strpos($subject, '[', 1)) {
58+
if (false === $nextBracket = strpos($subject, '[', 1)) {
5959
return $result;
6060
}
6161

6262
// Todo: Improve the regex.
63-
preg_match_all('#[^\[\]]+|\[(?<nested>(?R)*)]#', mb_substr($subject, $nextBracket, -1), $matches);
63+
preg_match_all('#[^\[\]]+|\[(?<nested>(?R)*)]#', substr($subject, $nextBracket, -1), $matches);
6464

6565
$result['children'] = array_map(
6666
static function (string $match): string {

src/Node/TrieNode.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public function add(NodeInterface ...$nodes): NodeInterface
2323

2424
$hash = hash('sha256', $node->getKey() . $data);
2525

26-
$node = new self($hash, mb_substr($data, 0, 1));
26+
$node = new self($hash, substr($data, 0, 1));
2727
$parent = $this->append($node);
2828

29-
$dataWithoutFirstLetter = mb_substr($data, 1);
29+
$dataWithoutFirstLetter = substr($data, 1);
3030

3131
if ('' < $dataWithoutFirstLetter) {
3232
$parent->add(new self($hash, $dataWithoutFirstLetter));

0 commit comments

Comments
 (0)