shouldThrowException) { throw $this->shouldThrowException; } return new ScrapingResult( ['http://example.com/image1.jpg', 'http://example.com/image2.jpg'], 2 ); } public function simulateError(\Exception $exception): void { $this->shouldThrowException = $exception; } public function supports(string $sourceType): bool { return true; } }