mirror of
https://github.com/flarum/core.git
synced 2025-08-10 18:35:56 +02:00
Apply fixes from StyleCI
This commit is contained in:
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Admin\Middleware;
|
||||||
|
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
use Flarum\Settings\SettingsRepositoryInterface;
|
||||||
@@ -22,7 +29,7 @@ class GatherDebugInformation implements Middleware
|
|||||||
$currentUser = get_current_user();
|
$currentUser = get_current_user();
|
||||||
if ($user !== $currentUser) {
|
if ($user !== $currentUser) {
|
||||||
$this->settings->set(
|
$this->settings->set(
|
||||||
"core.web_user",
|
'core.web_user',
|
||||||
$currentUser
|
$currentUser
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -44,7 +44,7 @@ class ApplicationInfoProvider
|
|||||||
{
|
{
|
||||||
$status = $this->settings->get('schedule.last_run');
|
$status = $this->settings->get('schedule.last_run');
|
||||||
|
|
||||||
$key = match(true) {
|
$key = match (true) {
|
||||||
! $status => 'never-run',
|
! $status => 'never-run',
|
||||||
Carbon::parse($status) > Carbon::now()->subMinutes(5) => 'active',
|
Carbon::parse($status) > Carbon::now()->subMinutes(5) => 'active',
|
||||||
default => 'inactive'
|
default => 'inactive'
|
||||||
|
@@ -10,18 +10,10 @@
|
|||||||
namespace Flarum\Foundation\Console;
|
namespace Flarum\Foundation\Console;
|
||||||
|
|
||||||
use Flarum\Console\AbstractCommand;
|
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\Renderer\CliRenderer;
|
||||||
use Flarum\Foundation\Info\Report;
|
use Flarum\Foundation\Info\Report;
|
||||||
use Flarum\Settings\SettingsRepositoryInterface;
|
|
||||||
use Illuminate\Contracts\Container\Container;
|
use Illuminate\Contracts\Container\Container;
|
||||||
use Illuminate\Database\ConnectionInterface;
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Helper\Table;
|
|
||||||
use Symfony\Component\Console\Helper\TableStyle;
|
|
||||||
|
|
||||||
class InfoCommand extends AbstractCommand
|
class InfoCommand extends AbstractCommand
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info\Concerns;
|
||||||
|
|
||||||
trait PackageVersionFromPath
|
trait PackageVersionFromPath
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info\Renderer;
|
||||||
|
|
||||||
use Flarum\Foundation\Info\RendererInterface;
|
use Flarum\Foundation\Info\RendererInterface;
|
||||||
@@ -10,7 +17,8 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||||||
class CliRenderer implements RendererInterface
|
class CliRenderer implements RendererInterface
|
||||||
{
|
{
|
||||||
public function __construct(protected OutputInterface $output)
|
public function __construct(protected OutputInterface $output)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public function heading(string $title): void
|
public function heading(string $title): void
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info;
|
||||||
|
|
||||||
interface RendererInterface
|
interface RendererInterface
|
||||||
@@ -13,5 +20,4 @@ interface RendererInterface
|
|||||||
public function open(): void;
|
public function open(): void;
|
||||||
|
|
||||||
public function close(): void;
|
public function close(): void;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info;
|
||||||
|
|
||||||
use Illuminate\Contracts\Container\Container;
|
use Illuminate\Contracts\Container\Container;
|
||||||
@@ -17,8 +24,8 @@ class Report
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
protected RendererInterface $renderer,
|
protected RendererInterface $renderer,
|
||||||
protected Container $container
|
protected Container $container
|
||||||
)
|
) {
|
||||||
{}
|
}
|
||||||
|
|
||||||
public function render(): void
|
public function render(): void
|
||||||
{
|
{
|
||||||
@@ -26,7 +33,7 @@ class Report
|
|||||||
|
|
||||||
$this->renderer->open();
|
$this->renderer->open();
|
||||||
|
|
||||||
foreach($sections as &$section) {
|
foreach ($sections as &$section) {
|
||||||
$section = $this->container->make($section);
|
$section = $this->container->make($section);
|
||||||
|
|
||||||
$section($this->renderer);
|
$section($this->renderer);
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info\Section;
|
||||||
|
|
||||||
use Flarum\Foundation\Application;
|
use Flarum\Foundation\Application;
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info\Section;
|
||||||
|
|
||||||
use Flarum\Foundation\Config;
|
use Flarum\Foundation\Config;
|
||||||
@@ -20,7 +27,7 @@ class Debug implements SectionInterface
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ($this->config->inDebugMode()) {
|
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
|
<?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;
|
namespace Flarum\Foundation\Info\Section;
|
||||||
|
|
||||||
use Flarum\Extension\Extension;
|
use Flarum\Extension\Extension;
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info\Section;
|
||||||
|
|
||||||
use Flarum\Foundation\ApplicationInfoProvider;
|
use Flarum\Foundation\ApplicationInfoProvider;
|
||||||
@@ -13,8 +20,7 @@ class Features implements SectionInterface
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
protected ApplicationInfoProvider $appInfo,
|
protected ApplicationInfoProvider $appInfo,
|
||||||
protected Container $container
|
protected Container $container
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __invoke(RendererInterface $renderer): void
|
public function __invoke(RendererInterface $renderer): void
|
||||||
@@ -51,7 +57,7 @@ class Features implements SectionInterface
|
|||||||
$configured = $this->container->make('flarum.mail.configured_driver');
|
$configured = $this->container->make('flarum.mail.configured_driver');
|
||||||
|
|
||||||
if ($driver instanceof NullDriver) {
|
if ($driver instanceof NullDriver) {
|
||||||
$configured .= " (not active)";
|
$configured .= ' (not active)';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $configured;
|
return $configured;
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info\Section;
|
||||||
|
|
||||||
use Flarum\Foundation\ApplicationInfoProvider;
|
use Flarum\Foundation\ApplicationInfoProvider;
|
||||||
|
@@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?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;
|
namespace Flarum\Foundation\Info;
|
||||||
|
|
||||||
interface SectionInterface
|
interface SectionInterface
|
||||||
|
Reference in New Issue
Block a user