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:
@@ -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
|
||||
);
|
||||
}
|
||||
|
@@ -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'
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -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.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user