diff --git a/src/PageUtils/AbstractBinaryInput.php b/src/PageUtils/AbstractBinaryInput.php index a16e449..938ea1a 100644 --- a/src/PageUtils/AbstractBinaryInput.php +++ b/src/PageUtils/AbstractBinaryInput.php @@ -41,9 +41,11 @@ public function getResponseReader(): ResponseReader /** * Get base64 representation of the file. * + * @param int|null $timeout + * * @return mixed */ - public function getBase64(int $timeout = null) + public function getBase64(?int $timeout = null) { $response = $this->responseReader->waitForResponse($timeout); @@ -54,10 +56,23 @@ public function getBase64(int $timeout = null) return $response->getResultData('data'); } + /** + * Get raw binary data. + * + * @param int|null $timeout + * + * @return string + */ + public function getRawBinary(int $timeout = null): string + { + return \base64_decode($this->getBase64($timeout), true); + } + /** * Save data to the given file. * * @param string $path + * @param int $timeout * * @throws FilesystemException * @throws ScreenshotFailed