PluginProbe
WooCommerce / 11.1.0-rc.2
WooCommerce v11.1.0-rc.2
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / src / Admin / Features / Navigation / RemovedDeprecated.php
RemovedDeprecated.php
51 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 declare(strict_types=1);
3
4 namespace Automattic\WooCommerce\Admin\Features\Navigation;
5
6 use WC_Tracks;
7
8 /**
9 * Handle calls to deprecated methods.
10 */
11 class RemovedDeprecated {
12 /**
13 * Handle deprecated method calls.
14 *
15 * @param string $name The name of the deprecated method.
16 */
17 private static function handle_deprecated_method_call( $name ) {
18 $logger = wc_get_logger();
19
20 if ( $logger ) {
21 $logger->warning(
22 "The WooCommerce Admin Navigation feature and its classes (Screen, Menu, CoreMenu) are deprecated since 9.3 with no alternative. Please remove the call to $name."
23 );
24 }
25
26 if ( class_exists( 'WC_Tracks' ) ) {
27 WC_Tracks::record_event( 'deprecated_navigation_method_called' );
28 }
29 }
30
31 /**
32 * Handle calls to deprecated methods.
33 *
34 * @param string $name The name of the deprecated method.
35 * @param array $arguments The arguments passed to the deprecated method.
36 */
37 public function __call( $name, $arguments ) {
38 self::handle_deprecated_method_call( $name );
39 }
40
41 /**
42 * Handle static calls to deprecated methods.
43 *
44 * @param string $name The name of the deprecated method.
45 * @param array $arguments The arguments passed to the deprecated method.
46 */
47 public static function __callStatic( $name, $arguments ) {
48 self::handle_deprecated_method_call( $name );
49 }
50 }
51