realSubjectService = $realSubjectService; } public function request(): void { if (!$this->checkAccess()) return; $this->realSubjectService->request(); $this->logAcces(); if ($this->checkAccess()) return; $this->logAcces(); } /** * @return true */ private function checkAccess() { $this->logger->log('Proxy: Checking access prior to firing a real request'.PHP_EOL); return true; } /** * @return void */ private function logAcces() { $this->logger->log('Proxy: Logging the time of request'.PHP_EOL); } }