fix phpstan/phpcs

This commit is contained in:
Dennis Eichhorn 2021-06-26 14:38:08 +02:00
parent b8277f868f
commit 0155f78254
4 changed files with 6 additions and 6 deletions

View File

@ -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'));
}
}

View File

@ -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;

View File

@ -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);

View File

@ -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",