mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 06:28:40 +00:00
fix incrementer from post to pre
This commit is contained in:
parent
9661171851
commit
ebad6f044f
|
|
@ -96,7 +96,7 @@ final class NetPromoterScore
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($this->scores as $score) {
|
foreach ($this->scores as $score) {
|
||||||
if ($score < 7) {
|
if ($score < 7) {
|
||||||
$count++;
|
++$count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,7 +117,7 @@ final class NetPromoterScore
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($this->scores as $score) {
|
foreach ($this->scores as $score) {
|
||||||
if ($score > 6 && $score < 9) {
|
if ($score > 6 && $score < 9) {
|
||||||
$count++;
|
++$count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ final class NetPromoterScore
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($this->scores as $score) {
|
foreach ($this->scores as $score) {
|
||||||
if ($score > 8) {
|
if ($score > 8) {
|
||||||
$count++;
|
++$count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ final class Numbers
|
||||||
if ($n & 1 == 1) {
|
if ($n & 1 == 1) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
$count++;
|
++$count;
|
||||||
$n = $n >> 1;
|
$n = $n >> 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,10 +130,11 @@ final class FileUtils
|
||||||
*/
|
*/
|
||||||
public static function changeFileEncoding(string $file, string $encoding) : void
|
public static function changeFileEncoding(string $file, string $encoding) : void
|
||||||
{
|
{
|
||||||
$content = \file_get_contents($file);
|
$content = \file_get_contents($file);
|
||||||
|
$detected = \mb_detect_encoding($content);
|
||||||
|
|
||||||
if ($content !== false && \preg_match('!!u', $content)) {
|
if ($content !== false) {
|
||||||
\file_put_contents($file, \mb_convert_encoding($content, 'UTF-8', \mb_list_encodings()));
|
\file_put_contents($file, \mb_convert_encoding($content, $encoding, $detected === false ? \mb_list_encodings() : $detected));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user