1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 08:56:38 +02:00

Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2024-12-31 16:18:03 +00:00
parent cebb1f27f5
commit 55979706f1
13 changed files with 87 additions and 19 deletions

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Admin\Middleware;
use Flarum\Settings\SettingsRepositoryInterface;
@@ -22,7 +29,7 @@ class GatherDebugInformation implements Middleware
$currentUser = get_current_user();
if ($user !== $currentUser) {
$this->settings->set(
"core.web_user",
'core.web_user',
$currentUser
);
}

View File

@@ -44,7 +44,7 @@ class ApplicationInfoProvider
{
$status = $this->settings->get('schedule.last_run');
$key = match(true) {
$key = match (true) {
! $status => 'never-run',
Carbon::parse($status) > Carbon::now()->subMinutes(5) => 'active',
default => 'inactive'

View File

@@ -10,18 +10,10 @@
namespace Flarum\Foundation\Console;
use Flarum\Console\AbstractCommand;
use Flarum\Extension\ExtensionManager;
use Flarum\Foundation\Application;
use Flarum\Foundation\ApplicationInfoProvider;
use Flarum\Foundation\Config;
use Flarum\Foundation\Info\Renderer\CliRenderer;
use Flarum\Foundation\Info\Report;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Container\Container;
use Illuminate\Database\ConnectionInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableStyle;
class InfoCommand extends AbstractCommand
{

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info\Concerns;
trait PackageVersionFromPath

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info\Renderer;
use Flarum\Foundation\Info\RendererInterface;
@@ -10,7 +17,8 @@ use Symfony\Component\Console\Output\OutputInterface;
class CliRenderer implements RendererInterface
{
public function __construct(protected OutputInterface $output)
{}
{
}
public function heading(string $title): void
{

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info;
interface RendererInterface
@@ -13,5 +20,4 @@ interface RendererInterface
public function open(): void;
public function close(): void;
}

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info;
use Illuminate\Contracts\Container\Container;
@@ -17,8 +24,8 @@ class Report
public function __construct(
protected RendererInterface $renderer,
protected Container $container
)
{}
) {
}
public function render(): void
{
@@ -26,7 +33,7 @@ class Report
$this->renderer->open();
foreach($sections as &$section) {
foreach ($sections as &$section) {
$section = $this->container->make($section);
$section($this->renderer);

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info\Section;
use Flarum\Foundation\Application;

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info\Section;
use Flarum\Foundation\Config;
@@ -20,7 +27,7 @@ class Debug implements SectionInterface
);
if ($this->config->inDebugMode()) {
$renderer->heading("Debug mode should not be enabled in production; this will cause javascript and stylesheets to be recompiled on each visit.");
$renderer->heading('Debug mode should not be enabled in production; this will cause javascript and stylesheets to be recompiled on each visit.');
}
}
}

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info\Section;
use Flarum\Extension\Extension;

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info\Section;
use Flarum\Foundation\ApplicationInfoProvider;
@@ -13,8 +20,7 @@ class Features implements SectionInterface
public function __construct(
protected ApplicationInfoProvider $appInfo,
protected Container $container
)
{
) {
}
public function __invoke(RendererInterface $renderer): void
@@ -51,7 +57,7 @@ class Features implements SectionInterface
$configured = $this->container->make('flarum.mail.configured_driver');
if ($driver instanceof NullDriver) {
$configured .= " (not active)";
$configured .= ' (not active)';
}
return $configured;

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info\Section;
use Flarum\Foundation\ApplicationInfoProvider;

View File

@@ -1,5 +1,12 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Foundation\Info;
interface SectionInterface