mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-15 12:37:46 +02:00
refactor: add phpstan and update code to adhere to level 5
- move and refactor Image.php from Libraries to Entities folder - update some database field names / types - update composer packages
This commit is contained in:
parent
b691b927fe
commit
231d578d64
148 changed files with 11189 additions and 11421 deletions
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Entities\Image;
|
||||
use App\Entities\Person;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
|
|
@ -102,9 +103,9 @@ class PersonModel extends Model
|
|||
'full_name' => $fullName,
|
||||
'unique_name' => slugify($fullName),
|
||||
'information_url' => $informationUrl,
|
||||
'image' => download_file($image),
|
||||
'created_by' => user()->id,
|
||||
'updated_by' => user()->id,
|
||||
'image' => new Image(download_file($image)),
|
||||
'created_by' => user_id(),
|
||||
'updated_by' => user_id(),
|
||||
]);
|
||||
return $this->insert($person);
|
||||
}
|
||||
|
|
@ -135,11 +136,12 @@ class PersonModel extends Model
|
|||
$options = [];
|
||||
$locale = service('request')->getLocale();
|
||||
$cacheName = "taxonomy_options_{$locale}";
|
||||
|
||||
/** @var array<string, array> */
|
||||
$personsTaxonomy = lang('PersonsTaxonomy.persons');
|
||||
|
||||
if (!($options = cache($cacheName))) {
|
||||
foreach (
|
||||
(array) lang('PersonsTaxonomy.persons')
|
||||
as $group_key => $group
|
||||
) {
|
||||
foreach ($personsTaxonomy as $group_key => $group) {
|
||||
foreach ($group['roles'] as $role_key => $role) {
|
||||
$options[
|
||||
"{$group_key},{$role_key}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue