src/PhpSigep/Cache/Storage/Adapter/AdapterOptions.php
public function setKeyPattern($keyPattern)
    {
        $keyPattern = (string)$keyPattern;
        if ($this->keyPattern !== $keyPattern) {
            // validate pattern
            if ($keyPattern !== '') {
                ErrorHandler::start(E_WARNING);
                $result = preg_match($keyPattern, '');
                $error  = ErrorHandler::stop();
                if ($result === false) {
                    throw new Exception\InvalidArgumentException(
                        sprintf(
                            'Invalid pattern "%s"%s',
                            $keyPattern,
                            ($error ? ': ' . $error->getMessage() : '')
                        ),
                        0,
                        $error
                    );
                }
            }

            $this->keyPattern = $keyPattern;
        }

        return $this;
    }
public function setKeyPattern($keyPattern)
    {
        $keyPattern = (string)$keyPattern;
        if ($this->keyPattern !== $keyPattern) {
            // validate pattern
            if ($keyPattern !== '') {
                ErrorHandler::start(E_WARNING);
                $result = preg_match($keyPattern, '');
                $error  = ErrorHandler::stop();
                if ($result === false) {
                    throw new Exception\InvalidArgumentException(
                        sprintf(
                            'Invalid pattern "%s"%s',
                            $keyPattern,
                            ($error ? ': ' . $error->getMessage() : '')
                        ),
                        0,
                        $error
                    );
                }
            }

            $this->keyPattern = $keyPattern;
        }

        return $this;
    }
public function setKeyPattern ( $ keyPattern ) { $ keyPattern = ( string ) $ keyPattern ; if ( $ this -> keyPattern !== $ keyPattern ) { // validate pattern if ( $ keyPattern !== '' ) { ErrorHandler :: start ( E_WARNING ) ; $ result = preg_match ( $ keyPattern , '' ) ; $ error = ErrorHandler :: stop ( ) ; if ( $ result === false ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Invalid pattern "%s"%s' , $ keyPattern , ( $ error ? ': ' . $ error -> getMessage ( ) : '' ) ) , 0 , $ error ) ; } } $ this -> keyPattern = $ keyPattern ; } return $ this ; }
Set key pattern

@param  null|string $keyPattern
@throws Exception\InvalidArgumentException
@return AdapterOptions
Set key pattern