src/Core/CoreHelper.php
public static function GetCompressor($serviceContext, $isRequest)
    {
        $compressor = null;
        if ($isRequest) {
            switch ($serviceContext->IppConfiguration->Message->Request->CompressionFormat) {
                case CompressionFormat::GZip:
                    $compressor = new GZipCompressor();
                    break;
                case CompressionFormat::Deflate:
                    $compressor = new DeflateCompressor();
                    break;
            }
        } else {
            switch ($serviceContext->IppConfiguration->Message->Response->CompressionFormat) {
                case CompressionFormat::GZip:
                    $compressor = new GZipCompressor();
                    break;
                case CompressionFormat::Deflate:
                    $compressor = new DeflateCompressor();
                    break;
            }
        }

        return $compressor;
    }
public static function GetCompressor($serviceContext, $isRequest)
    {
        $compressor = null;
        if ($isRequest) {
            switch ($serviceContext->IppConfiguration->Message->Request->CompressionFormat) {
                case CompressionFormat::GZip:
                    $compressor = new GZipCompressor();
                    break;
                case CompressionFormat::Deflate:
                    $compressor = new DeflateCompressor();
                    break;
            }
        } else {
            switch ($serviceContext->IppConfiguration->Message->Response->CompressionFormat) {
                case CompressionFormat::GZip:
                    $compressor = new GZipCompressor();
                    break;
                case CompressionFormat::Deflate:
                    $compressor = new DeflateCompressor();
                    break;
            }
        }

        return $compressor;
    }
Gets the compression mechanism using the service context and the depending on the request and response.
@param ServiceContext serviceContext The service context object.
@param bool isRequest Specifies whether to return compression mechanism for reqeust or response.
@return CompressorBase The Compression mechanism.