public function encode($filePath) {
        if (!file_exists($filePath) ||
            !is_readable($filePath)) {
            throw new BadMethodCallException(sprintf(
                'File "%s" not found or not readable',
                $filePath
            ));
        }

        $fileContent = file_get_contents($filePath);

        if (!is_string($fileContent)) {
            throw new RuntimeException(sprintf(
                'Unable to read from file "%s"',
                $filePath
            ));
        }

        $fileAsString = base64_encode($fileContent);

        return $fileAsString;
    }