diff --git a/core/components/minishop3/src/Controllers/Customer/Customer.php b/core/components/minishop3/src/Controllers/Customer/Customer.php index ebf23747..0243bdae 100644 --- a/core/components/minishop3/src/Controllers/Customer/Customer.php +++ b/core/components/minishop3/src/Controllers/Customer/Customer.php @@ -302,17 +302,6 @@ public function validate(string $key, mixed $value): mixed return $response['data']['value']; } - /** - * Get customer ID for order (legacy method) - * - * @deprecated Use getOrCreate() instead - * @return int Customer ID or 0 if not found/created - */ - public function getId(): int - { - return $this->getOrCreate(); - } - public function create(array $customerData): msCustomer|null { // Allow plugins to modify data before creation diff --git a/core/components/minishop3/src/Services/Customer/RegisterService.php b/core/components/minishop3/src/Services/Customer/RegisterService.php index 546e12f7..ebc46a23 100644 --- a/core/components/minishop3/src/Services/Customer/RegisterService.php +++ b/core/components/minishop3/src/Services/Customer/RegisterService.php @@ -67,7 +67,7 @@ public function setEmailVerification(EmailVerificationService $service): void * * Used in: * - Register API processor (explicit user registration) - * - Customer::getId() (automatic registration during checkout) + * - Customer::getOrCreate() (automatic registration during checkout) * * @param array $data Customer data: * - email (required) diff --git a/core/components/minishop3/src/Services/Order/OrderService.php b/core/components/minishop3/src/Services/Order/OrderService.php index cc722446..42250edf 100644 --- a/core/components/minishop3/src/Services/Order/OrderService.php +++ b/core/components/minishop3/src/Services/Order/OrderService.php @@ -118,38 +118,6 @@ public function updateProducts(msOrder $order): bool return $order->save(); } - /** - * Handle order save with events - * - * @deprecated Logic moved to msOrder::save(), this method kept for backward compatibility - * - * @param msOrder $order - * @param bool|null $cacheFlag - * @return bool - */ - public function handleOrderSave(msOrder $order, ?bool $cacheFlag = null): bool - { - // Simply delegate call to msOrder::save() - // It already contains all event logic - return $order->save($cacheFlag); - } - - /** - * Delete order with events - * - * @deprecated Logic moved to msOrder::remove(), this method kept for backward compatibility - * - * @param msOrder $order - * @param array $ancestors - * @return bool Deletion result - */ - public function removeOrder(msOrder $order, array $ancestors = []): bool - { - // Simply delegate call to msOrder::remove() - // It already contains all event logic - return $order->remove($ancestors); - } - /** * Get order statistics * diff --git a/core/components/minishop3/tests/Unit/Regression/DeprecatedPassThroughRemovedTest.php b/core/components/minishop3/tests/Unit/Regression/DeprecatedPassThroughRemovedTest.php new file mode 100644 index 00000000..23496274 --- /dev/null +++ b/core/components/minishop3/tests/Unit/Regression/DeprecatedPassThroughRemovedTest.php @@ -0,0 +1,48 @@ + + */ + public static function removedPassThroughsProvider(): iterable + { + yield 'OrderService::handleOrderSave' => [OrderService::class, 'handleOrderSave']; + yield 'OrderService::removeOrder' => [OrderService::class, 'removeOrder']; + yield 'Customer::getId' => [Customer::class, 'getId']; + } + + #[DataProvider('removedPassThroughsProvider')] + public function testDeprecatedPassThroughIsRemoved(string $class, string $method): void + { + self::assertFalse( + method_exists($class, $method), + sprintf('%s::%s() must remain removed (deprecated pass-through).', $class, $method) + ); + + $reflection = new \ReflectionClass($class); + self::assertFalse( + $reflection->hasMethod($method), + sprintf('%s::%s() must not be redeclared (checked via reflection).', $class, $method) + ); + } +}