phpstan level 3, fixed deprecations, code cleanup (#811)

This commit is contained in:
Kevin Papst
2019-05-28 12:24:21 +02:00
committed by GitHub
parent d9dca96a32
commit 393abe9e62
69 changed files with 381 additions and 189 deletions

View File

@@ -28,9 +28,6 @@ class EnhancedChoiceTypeExtension extends AbstractTypeExtension
*/
protected $type = null;
/**
* @param null|string $type
*/
public function __construct(ThemeConfiguration $configuration)
{
$this->type = $configuration->getSelectPicker();

View File

@@ -79,7 +79,7 @@ abstract class AbstractToolbarForm extends AbstractType
/**
* @param FormBuilderInterface $builder
* @param null|string $label
* @param string $label
*/
protected function addVisibilityChoice(FormBuilderInterface $builder, string $label = 'label.visible')
{

View File

@@ -42,8 +42,8 @@ class ActivityType extends AbstractType
/**
* @param Activity $choiceValue
* @param $key
* @param $value
* @param string $key
* @param mixed $value
* @return array
*/
public function choiceAttr($choiceValue, $key, $value)

View File

@@ -78,7 +78,7 @@ class DateRangeType extends AbstractType
* A better way would be to use the Intl NumberFormatter, but if that is not available
* and the Symfony polyfill is used, this method would not work properly.
*
* @param $string
* @param string $string
* @return string
*/
protected function convertArabicPersian($string)

View File

@@ -24,8 +24,8 @@ class ProjectType extends AbstractType
{
/**
* @param Project $choiceValue
* @param $key
* @param $value
* @param string $key
* @param mixed $value
* @return array
*/
public function choiceAttr($choiceValue, $key, $value)

View File

@@ -24,7 +24,6 @@ class UserRoleType extends AbstractType
protected $roles = [];
/**
* UserRolesType constructor.
* @param string[] $roles
*/
public function __construct(array $roles = [])
@@ -38,11 +37,12 @@ class UserRoleType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$roles = [];
/* @var string[] $value */
foreach ($this->roles as $key => $value) {
$roles[$key] = $key;
foreach ($value as $value2) {
$roles[$value2] = $value2;
if (is_array($value)) {
foreach ($value as $value2) {
$roles[$value2] = $value2;
}
}
}