src/Utils.php
public static function getDirective(MessageInterface $message, $part)
    {
        $parts = AbstractMessage::parseHeader($message, 'Cache-Control');

        foreach ($parts as $line) {
            if (isset($line[$part])) {
                return $line[$part];
            } elseif (in_array($part, $line)) {
                return true;
            }
        }

        return null;
    }
public static function getDirective(MessageInterface $message, $part)
    {
        $parts = AbstractMessage::parseHeader($message, 'Cache-Control');

        foreach ($parts as $line) {
            if (isset($line[$part])) {
                return $line[$part];
            } elseif (in_array($part, $line)) {
                return true;
            }
        }

        return null;
    }
public static function getDirective ( MessageInterface $ message , $ part ) { $ parts = AbstractMessage :: parseHeader ( $ message , 'Cache-Control' ) ; foreach ( $ parts as $ line ) { if ( isset ( $ line [ $ part ] ) ) { return $ line [ $ part ] ; } elseif ( in_array ( $ part , $ line ) ) { return true ; } } return null ; }
Get a cache control directive from a message.

@param MessageInterface $message Message to retrieve
@param string           $part    Cache directive to retrieve

@return mixed|bool|null
Get a cache control directive from a message .