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
3 changes: 1 addition & 2 deletions classes/controllers/FrmAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1630,8 +1630,7 @@ private static function is_our_callback_array( $callback ) {
private static function add_missing_tables() {
FrmAppHelper::permission_check( 'frm_view_forms' );

$inbox = new FrmInbox();
$error = $inbox->check_for_error();
$error = FrmInbox::check_for_error();

if ( ! $error || 'failed-to-create-tables' !== $error['key'] ) {
// Confirm the inbox item with this CTA exists.
Expand Down
3 changes: 1 addition & 2 deletions classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,7 @@ public static function display_forms_list( $params = array(), $message = '', $er
die();
}

$inbox = new FrmInbox();
$error = $inbox->check_for_error();
$error = FrmInbox::check_for_error();

if ( $error ) {
$show_messages = array( $error['subject'] . '. ' . $error['message'] );
Expand Down
1 change: 1 addition & 0 deletions classes/models/FrmInbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ public static function check_for_error() {
return $message;
}
}

return false;
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"phpstan/extension-installer": "^1.3",
"slevomat/coding-standard": "~8.0",
"friendsofphp/php-cs-fixer": "^3.54",
"rector/rector": "^2.2.14"
"rector/rector": "^2.2.14",
"phpstan/phpstan-strict-rules": "^2.0"
},
"config": {
"allow-plugins": {
Expand Down
27 changes: 26 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,31 @@ parameters:
- message: '#function array_map expects#'
- message: '#expects resource#'
- message: '#might not be defined#'
- message: '#expects false, string given#'
- message: '#array given#'
- message: '#Cannot use \+\+ on int\|false#'
- message: '#Only booleans are allowed in an (elseif|if) condition#'
- message: '#Only booleans are allowed in a negated boolean#'
- message: '#Only booleans are allowed in a ternary operator condition#'
- message: '#Loose comparison via "(!=|==)" is not allowed#'
- message: '#Variable property access on#'
- message: '#does not call parent constructor#'
- message: '#Only booleans are allowed in (&&|\|\|)#'
- message: '#Variable method call on#'
- message: '#requires parameter \#[\d]* to be set#'
- message: '#array_filter\(\) requires parameter \#2 to be passed to avoid loose comparison semantics.#'
- message: '#Static call to __construct\(\) is only allowed on a parent class in the constructor#'
- message: '#Variable static method call on#'
-
message: '#should be contravariant with#'
paths:
- classes/helpers/FrmFormsListHelper.php
- classes/models/FrmInstallerSkin.php
- '#Construct empty\(\) is not allowed. Use more strict comparison#'
-
message: '#Foreach overwrites \$ip with its value variable.#'
path: classes/helpers/FrmAppHelper.php
-
message: '#Only numeric types are allowed#'
paths:
- classes/helpers/FrmCSVExportHelper.php
- classes/models/FrmStyle.php