Skip to content

Commit 8af5901

Browse files
author
Coby Tamayo
committed
Support calling Event::from_post() on subclasses
1 parent 28d52ce commit 8af5901

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ parameters:
1111
ignoreErrors:
1212
# TODO Figure out how to discover the WP_CLI class
1313
- '#^Call to static method success\(\) on an unknown class WP_CLI\.$#'
14+
- '#^Unsafe usage of new static\(\).$#'
1415
# We can't have strong typehints without union types :(
1516
- '#has no return typehint specified\.#'
1617
- '#^Parameter \#1 \$term of static method Timber\\Timber::get_term\(\) expects int\|WP_Term\|null, array\|WP_Term given\.$#'

src/Event.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public static function post_to_calendar_series(Post $post) : array {
144144
* @return self
145145
*/
146146
public static function from_post(Post $post) : self {
147-
return new self($post);
147+
return new static($post);
148148
}
149149

150150
/**

0 commit comments

Comments
 (0)