Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions config/currency.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

use Igniter\Flame\Currency\Converters\FixerIO;
use Igniter\Flame\Currency\Converters\OpenExchangeRates;
use Igniter\Flame\Currency\Formatters\PHPIntl;
use Igniter\System\Models\Currency;

return [

/*
Expand Down Expand Up @@ -36,12 +41,12 @@
'converters' => [

'fixerio' => [
'class' => \Igniter\Flame\Currency\Converters\FixerIO::class,
'class' => FixerIO::class,
'apiKey' => '',
],

'openexchangerates' => [
'class' => \Igniter\Flame\Currency\Converters\OpenExchangeRates::class,
'class' => OpenExchangeRates::class,
'apiKey' => '',
],

Expand All @@ -56,7 +61,7 @@
|
*/

'model' => \Igniter\System\Models\Currency::class,
'model' => Currency::class,

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -114,7 +119,7 @@
'formatters' => [

'php_intl' => [
'class' => \Igniter\Flame\Currency\Formatters\PHPIntl::class,
'class' => PHPIntl::class,
],

],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function dropForeignKey($tableName, $options)
$table->dropForeignKeyIfExists($foreignKey);
$table->dropIndexIfExists(sprintf('%s_%s_foreign', $tableName, $foreignKey));
});
} catch (\Exception $ex) {
} catch (Exception $ex) {
Log::error($ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
Expand All @@ -14,7 +15,7 @@

public function up()
{
$morphMap = \Illuminate\Database\Eloquent\Relations\Relation::$morphMap;
$morphMap = Relation::$morphMap;
$this->morphMap = array_flip($morphMap);

$this->updateMorphClassName([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function createMediaAttachment($path, $tagName, $modelClass)

$media->save();
$model->media()->save($media);
} catch (\Exception $ex) {
} catch (Exception $ex) {
Log::debug($ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function dropForeignKey($tableName, $options)
$table->dropForeignKeyIfExists($foreignKey);
$table->dropIndexIfExists(sprintf('%s_%s_foreign', $tableName, $foreignKey));
});
} catch (\Exception $ex) {
} catch (Exception $ex) {
Log::error($ex);
}
}
Expand Down
96 changes: 96 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,30 @@ parameters:
count: 1
path: src/Flame/Providers/EventServiceProvider.php

-
message: '#^Method Igniter\\Flame\\Scaffold\\Console\\MakeComponent\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Overwrite existing…''\}\}\.$#'
identifier: return.type
count: 1
path: src/Flame/Scaffold/Console/MakeComponent.php

-
message: '#^Method Igniter\\Flame\\Scaffold\\Console\\MakeController\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Overwrite existing…''\}\}\.$#'
identifier: return.type
count: 1
path: src/Flame/Scaffold/Console/MakeController.php

-
message: '#^Method Igniter\\Flame\\Scaffold\\Console\\MakeExtension\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Overwrite existing…''\}\}\.$#'
identifier: return.type
count: 1
path: src/Flame/Scaffold/Console/MakeExtension.php

-
message: '#^Method Igniter\\Flame\\Scaffold\\Console\\MakeModel\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Overwrite existing…''\}\}\.$#'
identifier: return.type
count: 1
path: src/Flame/Scaffold/Console/MakeModel.php

-
message: '#^Igniter\\Flame\\Support\\Extendable\:\:extendableCall\(\) calls parent\:\:__call\(\) but Igniter\\Flame\\Support\\Extendable does not extend any class\.$#'
identifier: class.noParent
Expand Down Expand Up @@ -846,6 +870,12 @@ parameters:
count: 1
path: src/Flame/Support/Helpers/helpers.php

-
message: '#^Parameter \#1 \$message of static method Illuminate\\Log\\Logger\:\:error\(\) expects array\|Illuminate\\Contracts\\Support\\Arrayable\|Illuminate\\Contracts\\Support\\Jsonable\|Illuminate\\Support\\Stringable\|string, Exception given\.$#'
identifier: argument.type
count: 1
path: src/Flame/Support/Helpers/helpers.php

-
message: '#^Call to an undefined static method Illuminate\\Routing\\Controller\:\:__callStatic\(\)\.$#'
identifier: staticMethod.notFound
Expand Down Expand Up @@ -972,6 +1002,72 @@ parameters:
count: 1
path: src/System/Classes/Controller.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\ExtensionRefresh\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''pretend'', null, 1, ''Dump the SQL…''\}, array\{''step'', null, 4, ''The number of…''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/ExtensionRefresh.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\ExtensionRemove\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Force remove\.''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/ExtensionRemove.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\IgniterDown\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''database'', null, 4, ''The database…''\}, array\{''force'', null, 1, ''Force the operation…''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/IgniterDown.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\IgniterInstall\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Force the operation…''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/IgniterInstall.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\IgniterPackageDiscover\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Force the operation…''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/IgniterPackageDiscover.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\IgniterUp\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''database'', null, 4, ''The database…''\}, array\{''force'', null, 1, ''Force the operation…''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/IgniterUp.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\IgniterUpdate\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Force updates\.''\}, array\{''check'', null, 1, ''Run update checks…''\}, array\{''core'', null, 1, ''Update core…''\}, array\{''addons'', null, 12, ''Update specified…''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/IgniterUpdate.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\IgniterUtil\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''admin'', null, 1, ''Compile admin…''\}, array\{''minify'', null, 2, ''Whether to minify…''\}, array\{''carteKey'', null, 2, ''Specify a carteKey…''\}, array\{''theme'', null, 2, ''Specify a theme…''\}, array\{''extensions'', null, 1, ''Set the version…''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/IgniterUtil.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\ThemePublish\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''existing'', null, 1, ''Publish and…''\}, array\{''force'', null, 1, ''Force publish\.''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/ThemePublish.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\ThemeRemove\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''force'', null, 1, ''Force remove\.''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/ThemeRemove.php

-
message: '#^Method Igniter\\System\\Console\\Commands\\ThemeVendorPublish\:\:getOptions\(\) should return array\<array\{0\: non\-empty\-string, 1\?\: non\-empty\-array\<string\>\|string, 2\?\: int\<0, 31\>, 3\?\: string, 4\?\: mixed, 5\?\: \(Closure\(Symfony\\Component\\Console\\Completion\\CompletionInput, Symfony\\Component\\Console\\Completion\\CompletionSuggestions\)\: list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\)\|list\<string\|Symfony\\Component\\Console\\Completion\\Suggestion\>\}\|Symfony\\Component\\Console\\Input\\InputOption\> but returns array\{array\{''existing'', null, 1, ''Publish and…''\}, array\{''all'', null, 1, ''Publish assets for…''\}, array\{''theme'', null, 10, ''One or many theme…'', array\{\}\}, array\{''force'', null, 1, ''Force publish\.''\}\}\.$#'
identifier: return.type
count: 1
path: src/System/Console/Commands/ThemeVendorPublish.php

-
message: '#^Call to an undefined method Igniter\\Flame\\Database\\Builder\:\:sorted\(\)\.$#'
identifier: method.notFound
Expand Down
4 changes: 3 additions & 1 deletion resources/models/system/generalsettings.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Igniter\System\Models\Currency;

return [
'form' => [
'toolbar' => [
Expand Down Expand Up @@ -96,7 +98,7 @@
'tab' => 'lang:igniter::system.settings.text_tab_site',
'type' => 'radiotoggle',
'default' => 'openexchangerates',
'options' => [\Igniter\System\Models\Currency::class, 'getConverterDropdownOptions'],
'options' => [Currency::class, 'getConverterDropdownOptions'],
],
'currency_converter[oer][apiKey]' => [
'label' => 'lang:igniter::system.settings.label_currency_converter_oer_api_key',
Expand Down
6 changes: 3 additions & 3 deletions src/Admin/Classes/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ protected function processHandlers(): mixed

throw new AjaxException($response);
} catch (MassAssignmentException $ex) {
throw new FlashException(lang('igniter::admin.form.mass_assignment_failed', ['attribute' => $ex->getMessage()]));
throw new FlashException(lang('igniter::admin.form.mass_assignment_failed', ['attribute' => $ex->getMessage()]), 'danger', $ex->getCode(), $ex);
}
}

protected function getRequiredPermissionsForAction(string $actionToCheck): array
{
return collect((array)$this->requiredPermissions)
return collect((array) $this->requiredPermissions)
->map(fn($permission, $action): ?array => (!is_string($action) || $action === '*' || $action === $actionToCheck)
? (array)$permission : null)
? (array) $permission : null)
->filter()
->collapse()
->all();
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Classes/BaseWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function bindToController(): void
*/
protected function fillFromConfig(?array $properties = null)
{
$properties = is_null($properties) ? array_keys((array)$this->config) : $properties;
$properties ??= array_keys((array)$this->config);

foreach ($properties as $property) {
if (property_exists($this, $property)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Classes/MainMenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function options($value = null)
*/
public function displayAs($type, array $config = []): static
{
$this->type = !is_null($type) ? $type : $this->type;
$this->type = $type ?? $this->type;
$this->config = $this->evalConfig($config);

return $this;
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Classes/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Navigation
public function setContext(string $itemCode, ?string $parentCode = null): void
{
$this->navContextItemCode = $itemCode;
$this->navContextParentCode = is_null($parentCode) ? $itemCode : $parentCode;
$this->navContextParentCode = $parentCode ?? $itemCode;
}

public function getNavItems(): array
Expand Down
5 changes: 3 additions & 2 deletions src/Admin/Facades/AdminMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Igniter\Admin\Facades;

use Igniter\Admin\Classes\Navigation;
use Igniter\User\Auth\UserGuard;
use Illuminate\Support\Facades\Facade;
use Override;

Expand Down Expand Up @@ -42,14 +43,14 @@
* @method static string compileFileContent(string $filePath)
* @method static string makeViewContent(string $view, array $data = [])
*
* @see \Igniter\Admin\Classes\Navigation
* @see Navigation
*/
class AdminMenu extends Facade
{
/**
* Get the registered name of the component.
*
* @see \Igniter\User\Auth\UserGuard
* @see UserGuard
*/
#[Override]
protected static function getFacadeAccessor(): string
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Helpers/AdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/**
* Admin Helper
* @see \Igniter\Admin\Helpers\AdminHelper
* @see AdminHelper
*/
class AdminHelper
{
Expand Down
2 changes: 1 addition & 1 deletion src/Admin/Http/Actions/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ protected function getRedirectUrl(?string $context = null): string
{
$redirectContext = explode('-', (string)$context, 2)[0];
$redirectAction = explode('-', (string)$context, 2)[1] ?? '';
$redirectSource = in_array($redirectAction, ['new', 'close'])
$redirectSource = in_array($redirectAction, ['new', 'close'], true)
? 'redirect'.studly_case($redirectAction)
: 'redirect';

Expand Down
2 changes: 1 addition & 1 deletion src/Admin/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function registerFacadeAliases()

foreach ([
'AdminMenu' => AdminMenu::class,
'Template' => \Igniter\Admin\Facades\Template::class,
'Template' => Facades\Template::class,
] as $alias => $class) {
$loader->alias($alias, $class);
}
Expand Down
Loading
Loading