Skip to content

Commit

Permalink
Merge pull request #271 from level-level/fix/php-8.2-deprecation-warn…
Browse files Browse the repository at this point in the history
…ings-in-v0.4.-

Fix/php 8.2 deprecation warnings in v0.4.
  • Loading branch information
Floris-ll authored Jun 26, 2024
2 parents 98fe894 + 72ec8ed commit d117c42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions clarkson-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
*/
class Clarkson_Core {

/**
* @var Autoloader
*/
public $autoloader;

/**
* Initializes all neccessery objects. Is automatically called on 'init'.
*
Expand Down
8 changes: 7 additions & 1 deletion wordpress-objects/Clarkson_Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class Clarkson_Object implements \JsonSerializable {
*/
protected static $posts;

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

/**
* Clarkson_Object constructor.
*
Expand Down Expand Up @@ -643,8 +648,9 @@ public function has_term( $term ) {
* If you want something else, then just overwrite it in your own WordPress object.
*
* We can't just return $this->_post, because these values will only return raw unfiltered data.
* @return array<string,mixed>
*/
public function jsonSerialize() {
public function jsonSerialize(): array {
$data['id'] = $this->get_id();
$data['link'] = $this->get_permalink();
$data['slug'] = $this->get_post_name();
Expand Down

0 comments on commit d117c42

Please sign in to comment.