Page MenuHomeDevCentral

D4181.id10950.diff
No OneTemporary

D4181.id10950.diff

diff --git a/workspaces/src/Engines/I18n/TextFileMessage.php b/workspaces/src/Engines/I18n/TextFileMessage.php
--- a/workspaces/src/Engines/I18n/TextFileMessage.php
+++ b/workspaces/src/Engines/I18n/TextFileMessage.php
@@ -25,14 +25,14 @@
class TextFileMessage extends Message {
/**
- * @var string The folder where the message is stored.
+ * The folder where the message is stored.
*/
- public $folder;
+ public string $folder;
/**
- * @var string The message filename, without extension or language suffix.
+ * The message filename, without extension or language suffix.
*/
- public $filename;
+ public string $filename;
/**
* Initializes a new instance of the TextFileMessage class.
@@ -40,7 +40,7 @@
* @param string $folder The folder where the message is stored.
* @param string $filename The message filename, without extension or language suffix.
*/
- public function __construct ($folder, $filename) {
+ public function __construct (string $folder, string $filename) {
$this->folder = $folder;
$this->filename = $filename;
@@ -49,7 +49,7 @@
foreach ($files as $file) {
if (str_starts_with($file, $filename . '-') && get_extension($file) == 'txt') {
$lang = substr($file, strlen($filename) + 1, -4);
- if (strpos($lang, '-') !== false) {
+ if (str_contains($lang, '-')) {
//The user have quux-lang.txt and quux-foo-lang.txt files
continue;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Aug 23, 04:02 (17 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4026701
Default Alt Text
D4181.id10950.diff (1 KB)

Event Timeline