Skip to content

Commit

Permalink
Rector: InlineSimplePropertyAnnotationRector nutzen (#5291)
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Aug 8, 2022
1 parent 5a6ec15 commit 8e203ae
Show file tree
Hide file tree
Showing 40 changed files with 127 additions and 367 deletions.
2 changes: 2 additions & 0 deletions rector.php
Expand Up @@ -9,6 +9,7 @@
use Rector\CodeQuality\Rector\Identical\SimplifyConditionsRector;
use Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector;
use Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector;
use Rector\CodingStyle\Rector\Property\InlineSimplePropertyAnnotationRector;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector;
Expand Down Expand Up @@ -66,6 +67,7 @@
// after some basic rectors have been enabled we can finally enable whole-sets (when diffs get stable and reviewable)
// $services->set(Rector\SOLID\Rector\If_\ChangeAndIfToEarlyReturnRector::class);
$services->set(CombinedAssignRector::class);
$services->set(InlineSimplePropertyAnnotationRector::class);
$services->set(SimplifyBoolIdenticalTrueRector::class);
$services->set(SimplifyConditionsRector::class);
$services->set(SimplifyDeMorganBinaryRector::class);
Expand Down
4 changes: 1 addition & 3 deletions redaxo/src/addons/backup/lib/tar.php
Expand Up @@ -19,9 +19,7 @@
*/
class rex_backup_tar
{
/**
* @var Tar
*/
/** @var Tar */
private $tar;

// constructor to omit warnings
Expand Down
4 changes: 1 addition & 3 deletions redaxo/src/addons/install/lib/package/package_update.php
Expand Up @@ -9,9 +9,7 @@
*/
class rex_install_package_update extends rex_install_package_download
{
/**
* @var rex_addon
*/
/** @var rex_addon */
private $addon;

protected function getPackages()
Expand Down
12 changes: 3 additions & 9 deletions redaxo/src/addons/install/lib/packages.php
Expand Up @@ -7,17 +7,11 @@
*/
class rex_install_packages
{
/**
* @var array<string, array{name: string, author: string, shortdescription: string, description: string, website: string, created: string, updated: string, files: array<int, array{version: string, description: string, path: string, checksum: string, created: string, updated: string}>}>|null
*/
/** @var array<string, array{name: string, author: string, shortdescription: string, description: string, website: string, created: string, updated: string, files: array<int, array{version: string, description: string, path: string, checksum: string, created: string, updated: string}>}>|null */
private static $updatePackages;
/**
* @var array<string, array{name: string, author: string, shortdescription: string, description: string, website: string, created: string, updated: string, files: array<int, array{version: string, description: string, path: string, checksum: string, created: string, updated: string}>}>|null
*/
/** @var array<string, array{name: string, author: string, shortdescription: string, description: string, website: string, created: string, updated: string, files: array<int, array{version: string, description: string, path: string, checksum: string, created: string, updated: string}>}>|null */
private static $addPackages;
/**
* @var array<string, array{name: string, author: string, shortdescription: string, description: string, website: string, created: string, updated: string, status: bool, files: array<int, array{version: string, description: string, path: string, checksum: string, created: string, updated: string, redaxo_versions: list<string>, status: bool}>}>|null
*/
/** @var array<string, array{name: string, author: string, shortdescription: string, description: string, website: string, created: string, updated: string, status: bool, files: array<int, array{version: string, description: string, path: string, checksum: string, created: string, updated: string, redaxo_versions: list<string>, status: bool}>}>|null */
private static $myPackages;

/**
Expand Down
4 changes: 1 addition & 3 deletions redaxo/src/addons/media_manager/lib/effect_abstract.php
Expand Up @@ -5,9 +5,7 @@
*/
abstract class rex_effect_abstract
{
/**
* @var rex_managed_media
*/
/** @var rex_managed_media */
public $media;

/**
Expand Down
8 changes: 2 additions & 6 deletions redaxo/src/addons/mediapool/lib/media_category_select.php
Expand Up @@ -7,14 +7,10 @@
*/
class rex_media_category_select extends rex_select
{
/**
* @var bool
*/
/** @var bool */
private $checkPerms;

/**
* @var int|int[]|null
*/
/** @var int|int[]|null */
private $rootId;

private $loaded = false;
Expand Down
Expand Up @@ -5,9 +5,7 @@
*/
class rex_form_widget_linklist_element extends rex_form_element
{
/**
* @var int
*/
/** @var int */
private $categoryId = 0;

// 1. Parameter nicht genutzt, muss aber hier stehen,
Expand Down
Expand Up @@ -5,9 +5,7 @@
*/
class rex_form_widget_linkmap_element extends rex_form_element
{
/**
* @var int
*/
/** @var int */
private $categoryId = 0;

// 1. Parameter nicht genutzt, muss aber hier stehen,
Expand Down
8 changes: 2 additions & 6 deletions redaxo/src/addons/structure/lib/linkmap/linkmap.php
Expand Up @@ -7,9 +7,7 @@
*/
class rex_linkmap_category_tree extends rex_linkmap_tree_renderer
{
/**
* @var rex_context
*/
/** @var rex_context */
private $context;

public function __construct(rex_context $context)
Expand Down Expand Up @@ -52,9 +50,7 @@ protected function treeItem(rex_category $cat, $liClasses, $linkClasses, $subHtm
*/
class rex_linkmap_article_list extends rex_linkmap_article_list_renderer
{
/**
* @var rex_context
*/
/** @var rex_context */
private $context;

public function __construct(rex_context $context)
Expand Down
4 changes: 1 addition & 3 deletions redaxo/src/addons/structure/lib/linkmap/sitemap.php
Expand Up @@ -7,9 +7,7 @@
*/
class rex_sitemap_category_tree extends rex_linkmap_tree_renderer
{
/**
* @var rex_context
*/
/** @var rex_context */
private $context;

public function __construct(rex_context $context)
Expand Down
20 changes: 5 additions & 15 deletions redaxo/src/addons/structure/lib/select_category.php
Expand Up @@ -5,26 +5,16 @@
*/
class rex_category_select extends rex_select
{
/**
* @var bool
*/
/** @var bool */
private $ignoreOfflines;
/**
* @var null|int
*/
/** @var null|int */
private $clang;
/**
* @var bool
*/
/** @var bool */
private $checkPerms;
/**
* @var bool
*/
/** @var bool */
private $addHomepage;

/**
* @var int|int[]|null
*/
/** @var int|int[]|null */
private $rootId;

private $loaded;
Expand Down
4 changes: 1 addition & 3 deletions redaxo/src/addons/structure/lib/structure_context.php
Expand Up @@ -7,9 +7,7 @@
*/
class rex_structure_context
{
/**
* @var array
*/
/** @var array */
private $params;

public function __construct(array $params)
Expand Down
Expand Up @@ -5,13 +5,9 @@
*/
class rex_module
{
/**
* @var int
*/
/** @var int */
private $id;
/**
* @var string|null
*/
/** @var string|null */
private $key;

public function __construct(int $moduleId)
Expand Down
Expand Up @@ -8,13 +8,9 @@
*/
class rex_template
{
/**
* @var int
*/
/** @var int */
private $id;
/**
* @var string|null
*/
/** @var string|null */
private $key;

public function __construct($templateId)
Expand Down
Expand Up @@ -8,43 +8,25 @@
*/
class rex_article_content_base
{
/**
* @var string
*/
/** @var string */
public $warning;
/**
* @var string
*/
/** @var string */
public $info;
/**
* @var bool
*/
/** @var bool */
public $debug;

/**
* @var int
*/
/** @var int */
public $template_id;
/**
* @var array
*/
/** @var array */
public $template_attributes;

/**
* @var int
*/
/** @var int */
protected $category_id;
/**
* @var int
*/
/** @var int */
protected $article_id;
/**
* @var int
*/
/** @var int */
protected $slice_id;
/**
* @var int
*/
/** @var int */
protected $getSlice;
/**
* @var 'view'|'edit'
Expand All @@ -55,33 +37,21 @@ class rex_article_content_base
*/
protected $function;

/**
* @var int
*/
/** @var int */
protected $ctype;
/**
* @var int
*/
/** @var int */
protected $clang;

/**
* @var bool
*/
/** @var bool */
protected $eval;

/**
* @var int
*/
/** @var int */
protected $slice_revision;

/**
* @var rex_sql|null
*/
/** @var rex_sql|null */
protected $ARTICLE;

/**
* @var rex_sql|null
*/
/** @var rex_sql|null */
private $sliceSql;

/**
Expand Down
Expand Up @@ -7,29 +7,17 @@ class rex_extension_point_slice_menu extends rex_extension_point
{
public const NAME = 'SLICE_MENU';

/**
* @var array{label?: string, url?: string, attributes?: array{class: string[], title: string}}
*/
/** @var array{label?: string, url?: string, attributes?: array{class: string[], title: string}} */
private $menuEditAction = [];
/**
* @var array{label?: string, url?: string, attributes?: array{class: string[], title: string, data-confirm: string}}
*/
/** @var array{label?: string, url?: string, attributes?: array{class: string[], title: string, data-confirm: string}} */
private $menuDeleteAction = [];
/**
* @var array{label?: string, url?: string, attributes?: array{class: string[]}}
*/
/** @var array{label?: string, url?: string, attributes?: array{class: string[]}} */
private $menuStatusAction = [];
/**
* @var array{hidden_label?: string, url?: string, icon?: string, attributes?: array{class: string[], title: string}}
*/
/** @var array{hidden_label?: string, url?: string, icon?: string, attributes?: array{class: string[], title: string}} */
private $menuMoveupAction = [];
/**
* @var array{hidden_label?: string, url?: string, icon?: string, attributes?: array{class: string[], title: string}}
*/
/** @var array{hidden_label?: string, url?: string, icon?: string, attributes?: array{class: string[], title: string}} */
private $menuMovedownAction = [];
/**
* @var array
*/
/** @var array */
private $additionalActions = [];

/** @var rex_context */
Expand Down
Expand Up @@ -4,21 +4,13 @@
*/
class rex_template_select extends rex_select
{
/**
* @var bool
*/
/** @var bool */
private $loaded = false;
/**
* @var null|int
*/
/** @var null|int */
private $categoryId;
/**
* @var null|string[]
*/
/** @var null|string[] */
private $templates;
/**
* @var int
*/
/** @var int */
private $clangId;

/**
Expand Down

0 comments on commit 8e203ae

Please sign in to comment.