Skip to content
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
5 changes: 0 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ 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#'
- '#^Access to an undefined property SimplerStatic\\Query::\$updated_at#'
- '#^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:
37 changes: 20 additions & 17 deletions src/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -78,7 +81,7 @@ class Page extends Model {
protected static $table_name = 'pages';

/**
* @var mixed[]
* @var array<string, string>
*/
protected static $columns = [
'id' => 'BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT',
Expand Down