Skip to content

Commit a75ec92

Browse files
committed
build: updated Mago to 1.18.1
1 parent 959796f commit a75ec92

73 files changed

Lines changed: 423 additions & 1712 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Ignore 3rd party code
2+
.claude/
23
phpmyfaq/admin/assets/js/editor/
34
phpmyfaq/src/libs/
45

composer.lock

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { defineConfig, globalIgnores } from 'eslint/config';
44
import tseslint from 'typescript-eslint';
55

66
const ignoresConfig = globalIgnores([
7+
'.claude/*',
78
'babel.config.cjs',
89
'commitlint.config.cjs',
910
'coverage/*',
@@ -18,6 +19,11 @@ const ignoresConfig = globalIgnores([
1819
export default defineConfig([
1920
{
2021
extends: [ignoresConfig, eslint.configs.recommended, tseslint.configs.strict],
22+
languageOptions: {
23+
parserOptions: {
24+
tsconfigRootDir: import.meta.dirname,
25+
},
26+
},
2127
rules: {
2228
'@typescript-eslint/no-unused-vars': [
2329
'error',

phpmyfaq/src/phpMyFAQ/Controller/Administration/Api/OpenSearchController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ public function statistics(): JsonResponse
119119

120120
return $this->json([
121121
'index' => $indexName,
122-
'stats' => $this->configuration
123-
->getOpenSearch()
124-
->indices()
125-
->stats(['index' => $indexName]),
122+
'stats' => $this->configuration->getOpenSearch()->indices()->stats(['index' => $indexName]),
126123
], Response::HTTP_OK);
127124
}
128125

phpmyfaq/src/phpMyFAQ/Search.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,7 @@ public function getSearchesCount(): int
462462

463463
$result = $this->configuration->getDb()->query($sql);
464464

465-
return (int) $this->configuration
466-
->getDb()
467-
->fetchObject($result)
468-
->count;
465+
return (int) $this->configuration->getDb()->fetchObject($result)->count;
469466
}
470467

471468
public function setCategory(Category $category): void

phpmyfaq/src/phpMyFAQ/Translation.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,7 @@ protected function checkCurrentLanguage(): void
429429
protected function filename(string $language): string
430430
{
431431
return (
432-
self::$translation?->translationsDir
433-
. DIRECTORY_SEPARATOR
434-
. 'language_'
435-
. strtolower($language)
436-
. '.php'
432+
self::$translation?->translationsDir . DIRECTORY_SEPARATOR . 'language_' . strtolower($language) . '.php'
437433
);
438434
}
439435

phpmyfaq/src/phpMyFAQ/User/UserData.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ public function fetch(string $key, string $value): ?string
111111
return null;
112112
}
113113

114-
return $this->configuration
115-
->getDb()
116-
->fetchObject($res)
117-
->$key;
114+
return $this->configuration->getDb()->fetchObject($res)->$key;
118115
}
119116

120117
/**

tests/phpMyFAQ/Administration/Backup/BackupRepositoryTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,7 @@ public function testAddWithEmptyCreated(): void
203203
public function testAddEscapesAllInputs(): void
204204
{
205205
$this->mockDb->method('nextId')->willReturn(1);
206-
$this->mockDb
207-
->expects($this->exactly(4))
208-
->method('escape')
209-
->willReturnArgument(0);
206+
$this->mockDb->expects($this->exactly(4))->method('escape')->willReturnArgument(0);
210207
$this->mockDb->method('query')->willReturn(true);
211208

212209
$this->repository->add('backup.sql', 'authkey123', 'authcode456', '2025-12-22 10:00:00');

tests/phpMyFAQ/Administration/BackupTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,7 @@ public function testGenerateBackupQueriesIntegration(): void
370370
'INSERT INTO faqconfig (meta_key, meta_value) VALUES ("main.currentVersion", "4.0.0");',
371371
];
372372

373-
$this->mockDatabaseHelper
374-
->expects($this->exactly(2))
375-
->method('buildInsertQueries')
376-
->willReturn($mockQueries);
373+
$this->mockDatabaseHelper->expects($this->exactly(2))->method('buildInsertQueries')->willReturn($mockQueries);
377374

378375
$result = $this->backup->generateBackupQueries('table1 table2');
379376

tests/phpMyFAQ/Administration/CategoryTest.php

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,9 @@ public function testGetOwnerWithoutCategories(): void
8282

8383
public function testLoadCategoriesWithoutLanguage(): void
8484
{
85-
$this->databaseMock
86-
->expects($this->once())
87-
->method('query')
88-
->willReturn(true);
85+
$this->databaseMock->expects($this->once())->method('query')->willReturn(true);
8986

90-
$this->databaseMock
91-
->expects($this->once())
92-
->method('fetchArray')
93-
->willReturn(null);
87+
$this->databaseMock->expects($this->once())->method('fetchArray')->willReturn(null);
9488

9589
$result = $this->category->loadCategories();
9690
$this->assertIsArray($result);
@@ -101,21 +95,11 @@ public function testLoadCategoriesWithLanguage(): void
10195
{
10296
$this->category->setLanguage('de');
10397

104-
$this->databaseMock
105-
->expects($this->once())
106-
->method('escape')
107-
->with('de')
108-
->willReturn('de');
98+
$this->databaseMock->expects($this->once())->method('escape')->with('de')->willReturn('de');
10999

110-
$this->databaseMock
111-
->expects($this->once())
112-
->method('query')
113-
->willReturn(true);
100+
$this->databaseMock->expects($this->once())->method('query')->willReturn(true);
114101

115-
$this->databaseMock
116-
->expects($this->once())
117-
->method('fetchArray')
118-
->willReturn(null);
102+
$this->databaseMock->expects($this->once())->method('fetchArray')->willReturn(null);
119103

120104
$result = $this->category->loadCategories();
121105
$this->assertIsArray($result);
@@ -136,10 +120,7 @@ public function testLoadCategoriesWithSampleData(): void
136120
'image' => 'test.png',
137121
];
138122

139-
$this->databaseMock
140-
->expects($this->once())
141-
->method('query')
142-
->willReturn(true);
123+
$this->databaseMock->expects($this->once())->method('query')->willReturn(true);
143124

144125
$this->databaseMock
145126
->expects($this->exactly(2))
@@ -159,15 +140,9 @@ public function testLoadCategoriesWithInvalidLanguage(): void
159140
{
160141
$this->category->setLanguage('invalid_lang_123');
161142

162-
$this->databaseMock
163-
->expects($this->once())
164-
->method('query')
165-
->willReturn(true);
143+
$this->databaseMock->expects($this->once())->method('query')->willReturn(true);
166144

167-
$this->databaseMock
168-
->expects($this->once())
169-
->method('fetchArray')
170-
->willReturn(null);
145+
$this->databaseMock->expects($this->once())->method('fetchArray')->willReturn(null);
171146

172147
$result = $this->category->loadCategories();
173148
$this->assertIsArray($result);
@@ -214,10 +189,7 @@ public function testBuildAdminCategoryTreeWithSpecificParent(): void
214189

215190
public function testFluentInterface(): void
216191
{
217-
$result = $this->category
218-
->setLanguage('de')
219-
->setUser(42)
220-
->setGroups([1, 2, 3]);
192+
$result = $this->category->setLanguage('de')->setUser(42)->setGroups([1, 2, 3]);
221193

222194
$this->assertInstanceOf(Category::class, $result);
223195
$this->assertEquals('de', $this->category->getLanguage());
@@ -240,10 +212,7 @@ public function testGetOwnerAfterLoadingCategories(): void
240212
'image' => 'test.png',
241213
];
242214

243-
$this->databaseMock
244-
->expects($this->once())
245-
->method('query')
246-
->willReturn(true);
215+
$this->databaseMock->expects($this->once())->method('query')->willReturn(true);
247216

248217
$this->databaseMock
249218
->expects($this->exactly(2))

0 commit comments

Comments
 (0)