Skip to content

Commit f1d4037

Browse files
committed
Apply fixes from StyleCI
1 parent 8be36de commit f1d4037

File tree

10 files changed

+21
-24
lines changed

10 files changed

+21
-24
lines changed

extensions/nicknames/tests/integration/api/EditUserTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ public function markdownInjectionNicknames(): array
146146
return [
147147
'markdown link syntax' => ['[CLICK](https://evil.com)'],
148148
'square brackets only' => ['[username]'],
149-
'angle brackets' => ['<evil.com>'],
150-
'parentheses' => ['evil(com)'],
149+
'angle brackets' => ['<evil.com>'],
150+
'parentheses' => ['evil(com)'],
151151
];
152152
}
153153
}

framework/core/src/Api/Serializer/SystemInfoSerializer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
namespace Flarum\Api\Serializer;
1111

12-
use stdClass;
13-
1412
class SystemInfoSerializer extends AbstractSerializer
1513
{
1614
protected function getDefaultAttributes($data)

framework/core/src/Extension/ExtensionManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function getExtensions()
131131
// Set abandoned status if the package is marked as abandoned in composer
132132
// The abandoned field can be either true (no replacement) or a string (replacement package name)
133133
$abandoned = Arr::get($package, 'abandoned');
134-
if (is_string($abandoned) && !empty($abandoned)) {
134+
if (is_string($abandoned) && ! empty($abandoned)) {
135135
// Always set abandoned status if a replacement package is specified
136136
$extension->setAbandoned($abandoned);
137137
} elseif ($abandoned === true) {
@@ -141,7 +141,7 @@ public function getExtensions()
141141
$isFromFlarumComposer = str_contains($distUrl, 'flarum.org/composer');
142142

143143
// Only set abandoned if NOT from flarum.org/composer
144-
if (!$isFromFlarumComposer) {
144+
if (! $isFromFlarumComposer) {
145145
$extension->setAbandoned($abandoned);
146146
}
147147
}

framework/core/src/Foundation/AbstractValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected function getAttributeNames()
9898
{
9999
$cache = resolve(Cache::class);
100100

101-
$cacheKey = 'core.validation.attributes.' . $this->translator->getLocale() . '.' . static::class;
101+
$cacheKey = 'core.validation.attributes.'.$this->translator->getLocale().'.'.static::class;
102102

103103
if ($cached = $cache->get($cacheKey)) {
104104
return $cached;

framework/core/src/Foundation/Console/InfoCommand.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ private function detectWebServerPhpVersion(): ?string
185185
{
186186
// Try common PHP binary paths for web servers
187187
$possiblePhpBinaries = [
188-
'/usr/bin/php-fpm' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,
189-
'/usr/sbin/php-fpm' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION,
188+
'/usr/bin/php-fpm'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION,
189+
'/usr/sbin/php-fpm'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION,
190190
'/usr/local/bin/php',
191191
'/usr/bin/php',
192192
];
@@ -197,7 +197,7 @@ private function detectWebServerPhpVersion(): ?string
197197
$status = null;
198198
exec("$phpBinary -v 2>&1 | head -n 1", $output, $status);
199199

200-
if ($status === 0 && !empty($output[0])) {
200+
if ($status === 0 && ! empty($output[0])) {
201201
// Extract version from output like "PHP 8.3.1 (fpm-fcgi) ..."
202202
if (preg_match('/PHP\s+([\d.]+)/', $output[0], $matches)) {
203203
return $matches[1];
@@ -216,21 +216,21 @@ private function detectWebServerPhpVersion(): ?string
216216
private function detectWebServerMemoryLimit(): ?string
217217
{
218218
// Try to detect PHP-FPM pool configuration
219-
$phpVersion = PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;
219+
$phpVersion = PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;
220220

221221
$possiblePaths = [
222222
// Docker PHP paths (most common for containerized setups)
223-
"/usr/local/etc/php/php.ini",
224-
"/usr/local/etc/php/conf.d/memory.ini",
223+
'/usr/local/etc/php/php.ini',
224+
'/usr/local/etc/php/conf.d/memory.ini',
225225
// Common PHP-FPM pool paths
226226
"/etc/php/{$phpVersion}/fpm/pool.d/www.conf",
227227
"/etc/php{$phpVersion}/fpm/pool.d/www.conf",
228-
"/etc/php-fpm.d/www.conf",
229-
"/usr/local/etc/php-fpm.d/www.conf",
228+
'/etc/php-fpm.d/www.conf',
229+
'/usr/local/etc/php-fpm.d/www.conf',
230230
// Common php.ini paths for web
231231
"/etc/php/{$phpVersion}/fpm/php.ini",
232232
"/etc/php{$phpVersion}/fpm/php.ini",
233-
"/etc/php.ini",
233+
'/etc/php.ini',
234234
];
235235

236236
foreach ($possiblePaths as $path) {
@@ -252,7 +252,7 @@ private function detectWebServerMemoryLimit(): ?string
252252
// Also scan /usr/local/etc/php/conf.d/ directory for any INI files with memory_limit
253253
$confDir = '/usr/local/etc/php/conf.d';
254254
if (@is_dir($confDir) && @is_readable($confDir)) {
255-
$iniFiles = @glob($confDir . '/*.ini');
255+
$iniFiles = @glob($confDir.'/*.ini');
256256
if ($iniFiles) {
257257
foreach ($iniFiles as $iniFile) {
258258
if (@is_readable($iniFile)) {

framework/core/src/Foundation/Event/ApplicationBooted.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@
1414
*/
1515
class ApplicationBooted
1616
{
17-
1817
}

framework/core/src/Mail/MailgunDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class MailgunDriver implements DriverInterface
2020
{
2121
use ValidatesMailSettings;
22-
22+
2323
public function availableSettings(): array
2424
{
2525
return [

framework/core/src/Mail/SetTranslatorLocaleForEmailTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ protected function setTranslatorLocaleForEmail(
2727
): void {
2828
$users = resolve(UserRepository::class);
2929
$user = $users->findByEmail($email);
30-
31-
$locale = $user
30+
31+
$locale = $user
3232
? ($user->getPreference('locale') ?? $settings->get('default_locale'))
3333
: $settings->get('default_locale');
3434

framework/core/src/Mail/ValidatesMailSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function noWhitespace(): callable
2020
{
2121
return function ($attribute, $value, $fail) {
2222
if ($value !== trim($value)) {
23-
$fail('The ' . str_replace('_', ' ', $attribute) . ' must not contain leading or trailing whitespace.');
23+
$fail('The '.str_replace('_', ' ', $attribute).' must not contain leading or trailing whitespace.');
2424
}
2525
};
2626
}

framework/core/tests/integration/api/settings/MailSettingsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function smtpDriverWithWhitespaceIsInvalidated()
4949
);
5050

5151
$this->assertEquals(200, $mailSettingsResponse->getStatusCode());
52-
52+
5353
$data = json_decode((string) $mailSettingsResponse->getBody(), true);
5454

5555
$this->assertFalse($data['data']['attributes']['sending']);
@@ -88,7 +88,7 @@ public function smtpDriverWithValidSettingsIsNotInvalidated()
8888
);
8989

9090
$this->assertEquals(200, $mailSettingsResponse->getStatusCode());
91-
91+
9292
$data = json_decode((string) $mailSettingsResponse->getBody(), true);
9393

9494
$this->assertEmpty($data['data']['attributes']['errors']);

0 commit comments

Comments
 (0)