Skip to content

Commit

Permalink
Attempt to fix PHP 8.4 deprecation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
acicovic committed Oct 18, 2024
1 parent be67fa9 commit 096bf59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/class-parsely.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ public function set_default_content_helper_settings_values(): void {
* for context (Default null for current).
* @return string
*/
public static function get_settings_url( int $_blog_id = null ): string {
public static function get_settings_url( ?int $_blog_id = null ): string {
return get_admin_url( $_blog_id, 'options-general.php?page=' . self::MENU_SLUG );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function is_pch_feature_enabled_for_user(): bool {
* @param WP_REST_Request|null $request The request object.
* @return bool|WP_Error True if the endpoint is available.
*/
public function is_available_to_current_user( WP_REST_Request $request = null ) {
public function is_available_to_current_user( ?WP_REST_Request $request = null ) {
$can_use_feature = $this->is_pch_feature_enabled_for_user();

if ( ! $can_use_feature ) {
Expand Down
8 changes: 4 additions & 4 deletions src/services/content-api/class-content-api-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ protected function register_endpoints(): void {
*/
public function get_post_details(
string $url,
string $period_start = null,
string $period_end = null
?string $period_start = null,
?string $period_end = null
) {
/** @var Endpoints\Endpoint_Analytics_Post_Details $endpoint */
$endpoint = $this->get_endpoint( '/analytics/post/detail' );
Expand Down Expand Up @@ -117,8 +117,8 @@ public function get_post_details(
*/
public function get_post_referrers(
string $url,
string $period_start = null,
string $period_end = null
?string $period_start = null,
?string $period_end = null
) {
/** @var Endpoints\Endpoint_Referrers_Post_Detail $endpoint */
$endpoint = $this->get_endpoint( '/referrers/post/detail' );
Expand Down

0 comments on commit 096bf59

Please sign in to comment.