SSA_Exception
-
I have Simply Schedule Appointment running on Spa demo site with PHP 8.4 in Roots Trellis VM and get this deprecated warnings running with all erroring on:
Deprecated: SSA_Exception::__construct(): Implicitly marking parameter $message as nullable is deprecated, the explicit nullable type must be used instead in /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-exception.php on line 18
Deprecated: SSA_Utils::get_query_period(): Implicitly marking parameter $query_period as nullable is deprecated, the explicit nullable type must be used instead in /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-utils.php on line 602
Deprecated: SSA_Appointment_Model::delete_abandoned(): Implicitly marking parameter $date_modified_max as nullable is deprecated, the explicit nullable type must be used instead in /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-appointment-model.php on line 2132This is a PHP 8.4 deprecation — implicit nullable type declarations (
Type $param = nullwithout the?) which are now deprecated. It’s purely cosmetic (no functional bug), but the deprecation notice text itself is being echoed to the page before WordPress sends its headers, which is what triggers the “headers already sent” warnings on my local Roots Trellis VM.I think we can solve this doing the following:
// includes/class-exception.php:18
- public function __construct( string $message = null, string $code = null ) {
+ public function __construct( ?string $message = null, ?string $code = null ) {
// includes/class-utils.php:602
- public static function get_query_period( Period $query_period = null ) {
+ public static function get_query_period( ?Period $query_period = null ) {
// includes/class-appointment-model.php:2132
- public function delete_abandoned( DateTimeImmutable $date_modified_max = null ) {
+ public function delete_abandoned( ?DateTimeImmutable $date_modified_max = null ) {You probably know all this but just trying to give it a nudge. Great plugin!
P.S. In admin similar errors
Deprecated: SSA_Exception::__construct(): Implicitly marking parameter $message as nullable is deprecated, the explicit nullable type must be used instead in /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-exception.php on line 18
Deprecated: SSA_Exception::__construct(): Implicitly marking parameter $code as nullable is deprecated, the explicit nullable type must be used instead in /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-exception.php on line 18
Deprecated: SSA_Utils::get_query_period(): Implicitly marking parameter $query_period as nullable is deprecated, the explicit nullable type must be used instead in /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-utils.php on line 602
Deprecated: SSA_Appointment_Model::delete_abandoned(): Implicitly marking parameter $date_modified_max as nullable is deprecated, the explicit nullable type must be used instead in /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-appointment-model.php on line 2132
Warning: Cannot modify header information - headers already sent by (output started at /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-exception.php:18) in /srv/www/demo.imagewize.com/current/web/wp/wp-includes/functions.php on line 7220
Warning: Cannot modify header information - headers already sent by (output started at /srv/www/demo.imagewize.com/current/web/app/plugins/simply-schedule-appointments/includes/class-exception.php:18) in /srv/www/demo.imagewize.com/current/web/wp/wp-admin/admin-header.php on line 14The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.