Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[static-analysis] Fix static analysis level 2 errors. #679

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
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
93 changes: 93 additions & 0 deletions .phpstan/stubs/includes/entities/class-fs-entity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php

/**
* @param mixed $object
*
* @return array<string, mixed>
*/
function fs_get_object_public_vars($object) {
return [];
}

class FS_Entity {

/**
* @var int
*/
public $id;

/**
* @var string
*/
public $updated;

/**
* @var string
*/
public $created;

/**
* FS_Entity constructor.
* @param mixed $entity
*/
function __construct($entity = false) {
// Implementation here
}

/**
* @return string
*/
static function get_type() {
// Implementation here
return '';
}

/**
* @param mixed $entity1
* @param mixed $entity2
* @return bool
*/
static function equals($entity1, $entity2) {
// Implementation here
return false;
}

/**
* @var bool
*/
private $_is_updated = false;

/**
* @param string $key
* @param bool $val
* @return bool
*/
function update($key, $val = false) {
return false;
}

/**
* @return bool
*/
function is_updated() {
// Implementation here
return $this->_is_updated;
}

/**
* @param int $id
* @return bool
*/
static function is_valid_id($id) {
// Implementation here
return false;
}

/**
* @return string
*/
public static function get_class_name() {
// Implementation here
return '';
}
}
129 changes: 129 additions & 0 deletions .phpstan/stubs/includes/fs-plugin-info-dialog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php
class FS_Plugin_Plan extends FS_Entity {

/**
* @var int
*/
public $plugin_id;

/**
* @var string
*/
public $name;

/**
* @var string
*/
public $title;

/**
* @var string
*/
public $description;

/**
* @var bool
*/
public $is_free_localhost;

/**
* @var bool
*/
public $is_block_features;

/**
* @var string
*/
public $license_type;

/**
* @var bool
*/
public $is_https_support;

/**
* @var int
*/
public $trial_period;

/**
* @var bool
*/
public $is_require_subscription;

/**
* @var string
*/
public $support_kb;

/**
* @var string
*/
public $support_forum;

/**
* @var string
*/
public $support_email;

/**
* @var string
*/
public $support_phone;

/**
* @var string
*/
public $support_skype;

/**
* @var bool
*/
public $is_success_manager;

/**
* @var bool
*/
public $is_featured;

/**
* @var bool
*/
public $is_hidden;

/**
* @var array<string, mixed>
*/
public $pricing;

/**
* @var array<string, mixed>
*/
public $features;

/**
* FS_Plugin_Plan constructor.
* @param object|bool $plan
*/
public function __construct($plan = false) {}

/**
* @return string
*/
public static function get_type() {}

/**
* @return bool
*/
public function is_free() {}

/**
* @return bool
*/
public function has_technical_support() {}

/**
* @return bool
*/
public function has_trial() {}
}
Loading
Loading