mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-16 13:07:46 +02:00
refactor: update code base to php 8 and set phpstan lvl to 6
This commit is contained in:
parent
4a33c50fb6
commit
6b74a9e98a
124 changed files with 1810 additions and 2157 deletions
|
|
@ -9,6 +9,7 @@
|
|||
namespace App\Models;
|
||||
|
||||
use App\Entities\Language;
|
||||
use CodeIgniter\Database\Exceptions\DataException;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class LanguageModel extends Model
|
||||
|
|
@ -41,14 +42,17 @@ class LanguageModel extends Model
|
|||
*/
|
||||
protected $useTimestamps = false;
|
||||
|
||||
public function getLanguageOptions()
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getLanguageOptions(): array
|
||||
{
|
||||
if (!($options = cache('language_options'))) {
|
||||
$languages = $this->findAll();
|
||||
|
||||
$options = array_reduce(
|
||||
$languages,
|
||||
function ($result, $language) {
|
||||
function (array $result, Language $language): array {
|
||||
$result[$language->code] = $language->native_name;
|
||||
return $result;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue