mirror of
https://github.com/Karaka-Management/oms-Tag.git
synced 2026-01-11 15:48:42 +00:00
fix phpstan/phpcs
This commit is contained in:
parent
b8277f868f
commit
0155f78254
|
|
@ -51,7 +51,7 @@ final class Installer extends InstallerAbstract
|
|||
*/
|
||||
private static function installDefaultColors(ModuleInfo $info, SettingsInterface $cfgHandler) : void
|
||||
{
|
||||
$setting = new Setting();
|
||||
$setting = new Setting();
|
||||
SettingMapper::create($setting->with(0, '1007500001', '#ff000000;#ff00ff00;#ffffffff', 'Tag'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ final class ApiController extends Controller
|
|||
{
|
||||
/** @var Tag $tag */
|
||||
$tag = TagMapper::get((int) $request->getData('id'));
|
||||
$tag->setTitle((string) ($request->getData('title') ?? $tag->getTitle()));
|
||||
$tag->setL11n((string) ($request->getData('title') ?? $tag->getL11n()));
|
||||
$tag->color = \str_pad($request->getData('color') ?? $tag->color, 9, 'ff', \STR_PAD_RIGHT);
|
||||
|
||||
return $tag;
|
||||
|
|
|
|||
|
|
@ -161,13 +161,13 @@ class Tag implements \JsonSerializable, ArrayableInterface
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setL11n($title, string $lang = ISO639x1Enum::_EN) : void
|
||||
public function setL11n(string|TagL11n $title, string $lang = ISO639x1Enum::_EN) : void
|
||||
{
|
||||
if ($title instanceof TagL11n) {
|
||||
$this->title = $title;
|
||||
} elseif ($this->title instanceof TagL11n && \is_string($title)) {
|
||||
} elseif ($this->title instanceof TagL11n) {
|
||||
$this->title->title = $title;
|
||||
} elseif (\is_string($title)) {
|
||||
} else {
|
||||
$this->title = new TagL11n();
|
||||
$this->title->title = $title;
|
||||
$this->title->setLanguage($lang);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
],
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">=9.4",
|
||||
"friendsofphp/php-cs-fixer": ">=2.18",
|
||||
"friendsofphp/php-cs-fixer": ">=3.0",
|
||||
"squizlabs/php_codesniffer": ">=3.5",
|
||||
"phpmd/phpmd": ">=2.9",
|
||||
"phpstan/phpstan": ">=0.12.58",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user