getStatusCode()) { return self::STATE_SUCCESS; } if (404 === $response->getStatusCode()) { return self::STATE_PENDING; } return null === $exception ? self::STATE_PENDING : self::STATE_FAILURE; } protected function refreshState(): Waiter { if (!$this->awsClient instanceof S3Client) { throw new InvalidArgument('missing client injected in waiter result'); } if (!$this->input instanceof HeadObjectRequest) { throw new InvalidArgument('missing last request injected in waiter result'); } return $this->awsClient->objectExists($this->input); } }