From 91b2a116435dba96c0a0883c3998a4a632390256 Mon Sep 17 00:00:00 2001 From: wxa Date: Mon, 29 Mar 2021 09:11:11 +0300 Subject: [PATCH] Add deprecation error to old model static calls [MAILPOET-3484] --- lib/Models/DynamicSegment.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Models/DynamicSegment.php b/lib/Models/DynamicSegment.php index 6719d2a2e0..8e06a6bd79 100644 --- a/lib/Models/DynamicSegment.php +++ b/lib/Models/DynamicSegment.php @@ -116,6 +116,14 @@ class DynamicSegment extends MailPoetSegment { return parent::__get($key); } + /** + * @deprecated This is here for displaying the deprecation warning for static calls. + */ + public static function __callStatic($name, $arguments) { + self::deprecationError($name); + return parent::__callStatic($name, $arguments); + } + private static function deprecationError($methodName) { trigger_error('Calling ' . $methodName . ' is deprecated and will be removed. Use MailPoet\Segments\DynamicSegments\DynamicSegmentsListingRepository and respective Doctrine entities instead.', E_USER_DEPRECATED); }