diff --git a/phpstan.neon b/phpstan.neon index ad88375..7fe48a4 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -11,9 +11,6 @@ parameters: - %currentWorkingDirectory%/tests/phpstan/bootstrap.php - %currentWorkingDirectory%/tests/phpstan/wp-cli-stubs-2.2.0.php ignoreErrors: - - '#^Access to an undefined property SimplerStatic\\Page::\$url#' - - '#^Access to an undefined property SimplerStatic\\Page::\$http_status_code#' - - '#^Access to private property SimplerStatic\\Page::\$last_checked_at#' - '#^Call to an undefined method SimplerStatic\\Query::save\(\)#' - '#^Call to an undefined method SimplerStatic\\Query::set_status_message\(\)#' - '#^Access to an undefined property SimplerStatic\\Query::\$found_on_id#' @@ -21,7 +18,5 @@ parameters: - '#^Access to an undefined property SimplerStatic\\Model::\$id#' - '#^Access to an undefined property SimplerStatic\\Model::\$updated_at#' - '#^Access to an undefined property SimplerStatic\\Model::\$created_at#' - - '#^Access to an undefined property SimplerStatic\\Page::\$id#' - '#^Access to an undefined property SimplerStatic\\Fetch_Urls_Task::\$archive_dir#' - '#^Access to an undefined property SimplerStatic\\Fetch_Urls_Task::\$archive_start_time#' - excludes_analyse: diff --git a/src/Page.php b/src/Page.php index e78897b..e07d354 100755 --- a/src/Page.php +++ b/src/Page.php @@ -10,53 +10,56 @@ * Simpler Static Page class, for tracking the status of pages / static files */ class Page extends Model { - // TODO: not able to set these props without issues - // /** - // * @var string - // */ - // private $url; - // /** - // * @var int - // */ - // private $http_status_code; - - /* - Note: seems a conflict between the ORM. - for now, set to private vars and ignore warnings - when working with instance vars - */ + /** + * @var string + */ + public $url; + + /** + * @var int + */ + public $http_status_code; + /** * @var string */ private $found_on_id; + /** * @var string */ private $content_hash; + /** * @var string */ - private $last_checked_at; + public $last_checked_at; + /** * @var string */ private $last_modified_at; + /** * @var string */ public $content_type; + /** * @var string */ public $redirect_url; + /** * @var string|null */ public $file_path; + /** * @var string */ private $status_message; + /** * @var string */ @@ -78,7 +81,7 @@ class Page extends Model { protected static $table_name = 'pages'; /** - * @var mixed[] + * @var array */ protected static $columns = [ 'id' => 'BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT',