mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 15:39:50 +00:00
Code optimalisations.
This commit is contained in:
@@ -47,7 +47,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
if ('update' === $this->argument('task')) {
|
||||
$this->updateInstructions();
|
||||
@@ -62,7 +62,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
*
|
||||
* @param string $text
|
||||
*/
|
||||
private function boxed(string $text)
|
||||
private function boxed(string $text): void
|
||||
{
|
||||
$parts = explode("\n", wordwrap($text));
|
||||
foreach ($parts as $string) {
|
||||
@@ -75,7 +75,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
*
|
||||
* @param string $text
|
||||
*/
|
||||
private function boxedInfo(string $text)
|
||||
private function boxedInfo(string $text): void
|
||||
{
|
||||
$parts = explode("\n", wordwrap($text));
|
||||
foreach ($parts as $string) {
|
||||
@@ -86,7 +86,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
/**
|
||||
* Render instructions.
|
||||
*/
|
||||
private function installInstructions()
|
||||
private function installInstructions(): void
|
||||
{
|
||||
/** @var string $version */
|
||||
$version = config('firefly.version');
|
||||
@@ -94,8 +94,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
$text = '';
|
||||
foreach (array_keys($config) as $compare) {
|
||||
// if string starts with:
|
||||
$len = \strlen($compare);
|
||||
if (substr($version, 0, $len) === $compare) {
|
||||
if (0 === strpos($version, $compare)) {
|
||||
$text = $config[$compare];
|
||||
}
|
||||
}
|
||||
@@ -120,7 +119,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
/**
|
||||
* Show a line.
|
||||
*/
|
||||
private function showLine()
|
||||
private function showLine(): void
|
||||
{
|
||||
$line = '+';
|
||||
for ($i = 0; $i < 78; ++$i) {
|
||||
@@ -133,7 +132,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
/**
|
||||
* Render upgrade instructions.
|
||||
*/
|
||||
private function updateInstructions()
|
||||
private function updateInstructions(): void
|
||||
{
|
||||
/** @var string $version */
|
||||
$version = config('firefly.version');
|
||||
@@ -141,8 +140,7 @@ class UpgradeFireflyInstructions extends Command
|
||||
$text = '';
|
||||
foreach (array_keys($config) as $compare) {
|
||||
// if string starts with:
|
||||
$len = \strlen($compare);
|
||||
if (substr($version, 0, $len) === $compare) {
|
||||
if (0 === strpos($version, $compare)) {
|
||||
$text = $config[$compare];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user