Address dynamic class property deprecation warnings

This commit is contained in:
Aaron van Geffen 2022-12-25 13:50:33 +01:00
parent 49390c372d
commit 7897172256
17 changed files with 54 additions and 8 deletions

View File

@ -13,6 +13,7 @@ class Asset
protected $subdir; protected $subdir;
protected $filename; protected $filename;
protected $title; protected $title;
protected $slug;
protected $mimetype; protected $mimetype;
protected $image_width; protected $image_width;
protected $image_height; protected $image_height;
@ -364,7 +365,7 @@ class Asset
public function isImage() public function isImage()
{ {
return substr($this->mimetype, 0, 5) === 'image'; return isset($this->mimetype) && substr($this->mimetype, 0, 5) === 'image';
} }
public function getImage() public function getImage()

View File

@ -12,6 +12,7 @@ class AssetIterator extends Asset
private $res_assets; private $res_assets;
private $res_meta; private $res_meta;
private $res_thumbs; private $res_thumbs;
private Database $db;
protected function __construct($res_assets, $res_meta, $res_thumbs, $return_format) protected function __construct($res_assets, $res_meta, $res_thumbs, $return_format)
{ {

View File

@ -17,6 +17,7 @@ class Database
private $connection; private $connection;
private $query_count = 0; private $query_count = 0;
private $logged_queries = []; private $logged_queries = [];
private array $db_callback;
/** /**
* Initialises a new database connection. * Initialises a new database connection.

View File

@ -20,6 +20,13 @@ class GenericTable
public $form_above; public $form_above;
public $form_below; public $form_below;
private $sort_direction;
private $sort_order;
private $base_url;
private $start;
private $items_per_page;
private $recordCount;
public function __construct($options) public function __construct($options)
{ {
// Make sure we're actually sorting on something sortable. // Make sure we're actually sorting on something sortable.

View File

@ -21,7 +21,7 @@ class Guest extends User
$this->is_guest = true; $this->is_guest = true;
$this->is_admin = false; $this->is_admin = false;
$this->first_name = 'Guest'; $this->first_name = 'Guest';
$this->last_name = ''; $this->surname = '';
} }
public function updateAccessTime() public function updateAccessTime()

View File

@ -11,6 +11,7 @@ class PhotoMosaic
private $queue = []; private $queue = [];
const NUM_DAYS_CUTOFF = 7; const NUM_DAYS_CUTOFF = 7;
private AssetIterator $iterator;
public function __construct(AssetIterator $iterator) public function __construct(AssetIterator $iterator)
{ {

View File

@ -16,6 +16,7 @@ class Thumbnail
private $width; private $width;
private $height; private $height;
private $crop_mode; private $crop_mode;
private string $filename_suffix;
const CROP_MODE_NONE = 0; const CROP_MODE_NONE = 0;
const CROP_MODE_BOUNDARY = 1; const CROP_MODE_BOUNDARY = 1;

View File

@ -12,17 +12,20 @@
*/ */
abstract class User abstract class User
{ {
protected $id_user; protected int $id_user;
protected $first_name; protected string $first_name;
protected $surname; protected string $surname;
protected $emailaddress; protected string $slug;
protected string $emailaddress;
protected string $password_hash;
protected $creation_time; protected $creation_time;
protected $last_action_time; protected $last_action_time;
protected $ip_address; protected $ip_address;
protected $is_admin; protected $is_admin;
protected string $reset_key;
protected $is_logged; protected bool $is_logged;
protected $is_guest; protected bool $is_guest;
/** /**
* Returns user id. * Returns user id.

View File

@ -8,6 +8,8 @@
class AlbumButtonBox extends SubTemplate class AlbumButtonBox extends SubTemplate
{ {
private $buttons;
public function __construct($buttons) public function __construct($buttons)
{ {
$this->buttons = $buttons; $this->buttons = $buttons;

View File

@ -8,6 +8,11 @@
class AlbumHeaderBox extends SubTemplate class AlbumHeaderBox extends SubTemplate
{ {
private $back_link_title;
private $back_link;
private $description;
private $title;
public function __construct($title, $description, $back_link, $back_link_title) public function __construct($title, $description, $back_link, $back_link_title)
{ {
$this->title = $title; $this->title = $title;

View File

@ -8,6 +8,10 @@
class Alert extends SubTemplate class Alert extends SubTemplate
{ {
private $_type;
private $_message;
private $_title;
public function __construct($title = '', $message = '', $type = 'alert') public function __construct($title = '', $message = '', $type = 'alert')
{ {
$this->_title = $title; $this->_title = $title;

View File

@ -8,6 +8,10 @@
class DummyBox extends SubTemplate class DummyBox extends SubTemplate
{ {
private $_class;
private $_content;
private $_title;
public function __construct($title = '', $content = '', $class = '') public function __construct($title = '', $content = '', $class = '')
{ {
$this->_title = $title; $this->_title = $title;

View File

@ -8,6 +8,15 @@
class FormView extends SubTemplate class FormView extends SubTemplate
{ {
private $content_below;
private $content_above;
private $data;
private $missing;
private $fields;
private $request_method;
private $request_url;
private $title;
public function __construct(Form $form, $title = '') public function __construct(Form $form, $title = '')
{ {
$this->title = $title; $this->title = $title;

View File

@ -8,6 +8,8 @@
class MediaUploader extends SubTemplate class MediaUploader extends SubTemplate
{ {
private Tag $tag;
public function __construct(Tag $tag) public function __construct(Tag $tag)
{ {
$this->tag = $tag; $this->tag = $tag;

View File

@ -10,6 +10,7 @@ class Pagination extends SubTemplate
{ {
private $index; private $index;
private static $unique_index_count = 0; private static $unique_index_count = 0;
private string $class;
public function __construct(PageIndex $index) public function __construct(PageIndex $index)
{ {

View File

@ -10,6 +10,7 @@ class PhotosIndex extends SubTemplate
{ {
protected $mosaic; protected $mosaic;
protected $show_edit_buttons; protected $show_edit_buttons;
protected $show_headers;
protected $show_labels; protected $show_labels;
protected $row_limit = 1000; protected $row_limit = 1000;
protected $previous_header = ''; protected $previous_header = '';

View File

@ -8,6 +8,9 @@
class TabularData extends SubTemplate class TabularData extends SubTemplate
{ {
private Pagination $pager;
private GenericTable $_t;
public function __construct(GenericTable $table) public function __construct(GenericTable $table)
{ {
$this->_t = $table; $this->_t = $table;