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

fix: phpstan issues & use fully qualified imports #2783

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Timber\Factory\PostFactory;
use Timber\Factory\UserFactory;
use WP_Post;

/**
* Class Post
Expand Down Expand Up @@ -55,9 +56,9 @@ class Post extends CoreEntity implements DatedInterface, Setupable
*
* @since 2.0.0
*
* @var \WP_Post|null
* @var WP_Post|null
*/
protected ?\WP_Post $wp_object;
protected ?WP_Post $wp_object;

/**
* @var string What does this class represent in WordPress terms?
Expand Down Expand Up @@ -175,7 +176,7 @@ class Post extends CoreEntity implements DatedInterface, Setupable
* @internal
* @return \Timber\Post
*/
public static function build(\WP_Post $wp_post): self
public static function build(WP_Post $wp_post): self
{
$post = new static();

Expand Down Expand Up @@ -267,7 +268,7 @@ public function __call($field, $args)
*
* @return WP_Post|null
*/
public function wp_object(): ?\WP_Post
public function wp_object(): ?WP_Post
{
return $this->wp_object;
}
Expand Down Expand Up @@ -1736,7 +1737,7 @@ public function pagination()
* Finds any WP_Post objects and converts them to Timber\Post objects.
*
* @api
* @param array|\WP_Post $data
* @param array|WP_Post $data
*/
public function convert($data)
{
Expand Down
1 change: 1 addition & 0 deletions src/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Timber;

use JsonSerializable;
use WP_Theme;

/**
* Class Theme
Expand Down