Skip to content

Commit 8b9153b

Browse files
authored
Apply fixes from StyleCI (overtrue#154)
1 parent 05dda4d commit 8b9153b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/FileDictLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct($path)
5050
public function map(Closure $callback)
5151
{
5252
for ($i = 0; $i < 100; ++$i) {
53-
$segment = $this->path . '/' . sprintf($this->segmentName, $i);
53+
$segment = $this->path.'/'.sprintf($this->segmentName, $i);
5454

5555
if (file_exists($segment)) {
5656
$dictionary = (array) include $segment;
@@ -66,7 +66,7 @@ public function map(Closure $callback)
6666
*/
6767
public function mapSurname(Closure $callback)
6868
{
69-
$surnames = $this->path . '/surnames';
69+
$surnames = $this->path.'/surnames';
7070

7171
if (file_exists($surnames)) {
7272
$dictionary = (array) include $surnames;

src/GeneratorFileDictLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct($path)
5858
$this->path = $path;
5959

6060
for ($i = 0; $i < 100; ++$i) {
61-
$segment = $this->path . '/' . sprintf($this->segmentName, $i);
61+
$segment = $this->path.'/'.sprintf($this->segmentName, $i);
6262

6363
if (file_exists($segment) && is_file($segment)) {
6464
array_push(static::$handles, $this->openFile($segment));
@@ -137,7 +137,7 @@ public function map(Closure $callback)
137137
public function mapSurname(Closure $callback)
138138
{
139139
if (!static::$surnamesHandle instanceof SplFileObject) {
140-
static::$surnamesHandle = $this->openFile($this->path . '/surnames');
140+
static::$surnamesHandle = $this->openFile($this->path.'/surnames');
141141
}
142142

143143
$this->traversing($this->getGenerator([static::$surnamesHandle]), $callback);

src/MemoryFileDictLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct($path)
5656
$this->path = $path;
5757

5858
for ($i = 0; $i < 100; ++$i) {
59-
$segment = $path . '/' . sprintf($this->segmentName, $i);
59+
$segment = $path.'/'.sprintf($this->segmentName, $i);
6060

6161
if (file_exists($segment)) {
6262
$this->segments[] = (array) include $segment;
@@ -84,7 +84,7 @@ public function map(Closure $callback)
8484
public function mapSurname(Closure $callback)
8585
{
8686
if (empty($this->surnames)) {
87-
$surnames = $this->path . '/surnames';
87+
$surnames = $this->path.'/surnames';
8888

8989
if (file_exists($surnames)) {
9090
$this->surnames = (array) include $surnames;

src/Pinyin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function setLoader(DictLoaderInterface $loader)
197197
public function getLoader()
198198
{
199199
if (!($this->loader instanceof DictLoaderInterface)) {
200-
$dataDir = dirname(__DIR__) . '/data/';
200+
$dataDir = dirname(__DIR__).'/data/';
201201

202202
$loaderName = $this->loader;
203203
$this->loader = new $loaderName($dataDir);
@@ -244,7 +244,7 @@ protected function convertSurname($string, $dictLoader)
244244
$dictLoader->mapSurname(function ($dictionary) use (&$string) {
245245
foreach ($dictionary as $surname => $pinyin) {
246246
if (0 === strpos($string, $surname)) {
247-
$string = $pinyin . mb_substr($string, mb_strlen($surname, 'UTF-8'), mb_strlen($string, 'UTF-8') - 1, 'UTF-8');
247+
$string = $pinyin.mb_substr($string, mb_strlen($surname, 'UTF-8'), mb_strlen($string, 'UTF-8') - 1, 'UTF-8');
248248

249249
break;
250250
}
@@ -297,7 +297,7 @@ public function hasOption($option, $check)
297297
protected function prepare($string, $option = \PINYIN_DEFAULT)
298298
{
299299
$string = preg_replace_callback('~[a-z0-9_-]+~i', function ($matches) {
300-
return "\t" . $matches[0];
300+
return "\t".$matches[0];
301301
}, $string);
302302

303303
$regex = array('\p{Han}', '\p{Z}', '\p{M}', "\t");
@@ -347,7 +347,7 @@ protected function formatTone($pinyin, $option = \PINYIN_NO_TONE)
347347
$umlaut = 'v';
348348
}
349349

350-
$pinyin = str_replace($unicode, $umlaut, $pinyin) . ($this->hasOption($option, PINYIN_ASCII_TONE) ? $replacement[1] : '');
350+
$pinyin = str_replace($unicode, $umlaut, $pinyin).($this->hasOption($option, PINYIN_ASCII_TONE) ? $replacement[1] : '');
351351
}
352352
}
353353

0 commit comments

Comments
 (0)