| @@ -9,11 +9,8 @@ | ||
| 9 | 9 | |
| 10 | 10 | namespace Packetery\Module\Framework; |
| 11 | 11 | |
| 12 | 12 | use Automattic\WooCommerce\Utilities\FeaturesUtil; |
| 13 | -use Automattic\WooCommerce\Utilities\LoggingUtil; | |
| 14 | -use stdClass; | |
| 15 | -use WC_Admin_Status; | |
| 16 | 13 | use WC_Blocks_Utils; |
| 17 | 14 | use WC_Data_Store; |
| 18 | 15 | use WC_Logger; |
| 19 | 16 | use WC_Logger_Interface; |
| @@ -74,8 +71,17 @@ | ||
| 74 | 71 | public function getProduct( $theProduct ) { |
| 75 | 72 | return wc_get_product( $theProduct ); |
| 76 | 73 | } |
| 77 | 74 | |
| 75 | + /** | |
| 76 | + * Creates new logger instance. | |
| 77 | + * | |
| 78 | + * @return WC_Logger | |
| 79 | + */ | |
| 80 | + public function createLogger(): WC_Logger { | |
| 81 | + return new WC_Logger(); | |
| 82 | + } | |
| 83 | + | |
| 78 | 84 | public function isCheckout(): bool { |
| 79 | 85 | return is_checkout(); |
| 80 | 86 | } |
| 81 | 87 | |
| @@ -135,39 +141,6 @@ | ||
| 135 | 141 | * @return WC_Data_Store|WC_Shipping_Zone_Data_Store_Interface |
| 136 | 142 | */ |
| 137 | 143 | public function dataStoreLoad( string $objectType ): object { |
| 138 | 144 | return WC_Data_Store::load( $objectType ); |
| 139 | - } | |
| 140 | - | |
| 141 | - /** | |
| 142 | - * Returns WC_Abstract_Order[] | |
| 143 | - * | |
| 144 | - * @param array<string, mixed> $args | |
| 145 | - * | |
| 146 | - * @return array<mixed, mixed> | |
| 147 | - */ | |
| 148 | - public function getOrdersWithoutPagination( array $args ): array { | |
| 149 | - $results = wc_get_orders( $args ); | |
| 150 | - | |
| 151 | - if ( is_array( $results ) ) { | |
| 152 | - return $results; | |
| 153 | - } | |
| 154 | - | |
| 155 | - if ( $results instanceof stdClass && isset( $results->orders ) && is_array( $results->orders ) ) { | |
| 156 | - return $results->orders; | |
| 157 | - } | |
| 158 | - | |
| 159 | - return []; | |
| 160 | - } | |
| 161 | - | |
| 162 | - public function adminStatusStatusReport(): void { | |
| 163 | - WC_Admin_Status::status_report(); | |
| 164 | - } | |
| 165 | - | |
| 166 | - public function loggingUtilGetLogDirectory( bool $createDir = true ): ?string { | |
| 167 | - if ( class_exists( LoggingUtil::class ) === false ) { | |
| 168 | - return null; | |
| 169 | - } | |
| 170 | - | |
| 171 | - return LoggingUtil::get_log_directory( $createDir ); | |
| 172 | 145 | } |
| 173 | 146 | } |