Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ public static function is_admin_page( $page = 'formidable' ) {
public static function is_view_builder_page() {
global $pagenow;

if ( $pagenow !== 'post.php' && $pagenow !== 'post-new.php' && $pagenow !== 'edit.php' ) {
if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php', 'edit.php' ), true ) ) {
return false;
}

Expand Down
11 changes: 7 additions & 4 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

// CodeQuality
use Rector\CodeQuality\Rector\Assign\CombinedAssignRector;
use Rector\CodeQuality\Rector\BooleanAnd\RepeatedAndNotEqualToNotInArrayRector;
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
Expand Down Expand Up @@ -149,14 +148,14 @@
// This changes \t to an actual tab character. We don't want this rule.
JoinStringConcatRector::class,
LocallyCalledStaticMethodToNonStaticRector::class,
RepeatedAndNotEqualToNotInArrayRector::class,
ShortenElseIfRector::class,
// This changes if is_array() && empty() to if === [].
SimplifyEmptyArrayCheckRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
SimplifyRegexPatternRector::class,
SingleInArrayToCompareRector::class,
SingularSwitchToIfRector::class,
// This flips ! empty to empty in ternary statements, but ! empty statements are typically easier to read.
SwitchNegatedTernaryRector::class,
UnusedForeachValueToArrayKeysRector::class,

Expand All @@ -178,19 +177,23 @@

// DeadCode
RemoveAlwaysTrueIfConditionRector::class,
// The FrmFieldType.php file has a few empty functions with only a return; line.
// We may want to remove that at some point, but I think it's there to prevent another
// static analysis error.
RemoveDeadReturnRector::class,
RemoveParentCallWithoutParentRector::class,
RemoveUnusedConstructorParamRector::class,
RemoveUnusedForeachKeyRector::class,
RemoveUnusedPrivateMethodParameterRector::class,
RemoveUnusedPrivateMethodRector::class,
// We never want to remove a param tag. Leave this exception.
// We never want to remove a valid param tag. Leave this exception.
RemoveUselessParamTagRector::class,
RemoveUselessReturnTagRector::class,

// EarlyReturn
// This breaks if statements up into multiple if statements. It adds too many lines.
ChangeOrIfContinueToMultiContinueRector::class,
// This breaks a return statement up into multiple return statements. It does not look very good.
// This breaks a return statement up into multiple return statements. It adds too many lines.
ReturnBinaryOrToEarlyReturnRector::class,
ReturnEarlyIfVariableRector::class,

Expand Down
Loading