src/ServiceBus/Internal/Filter.php
public static function create($filterXmlString)
    {
        $filterXml = simplexml_load_string($filterXmlString);
        $attributes = (array) $filterXml->attributes();

        if (array_key_exists('i:type', $attributes)) {
            $type = (string) $attributes['i:type'];
            if ($type === 'TrueFilter') {
                return new TrueFilter();
            }

            if ($type === 'FalseFilter') {
                return new FalseFilter();
            }

            return new self();
        }

        return null;
    }
public static function create($filterXmlString)
    {
        $filterXml = simplexml_load_string($filterXmlString);
        $attributes = (array) $filterXml->attributes();

        if (array_key_exists('i:type', $attributes)) {
            $type = (string) $attributes['i:type'];
            if ($type === 'TrueFilter') {
                return new TrueFilter();
            }

            if ($type === 'FalseFilter') {
                return new FalseFilter();
            }

            return new self();
        }

        return null;
    }
public static function create ( $ filterXmlString ) { $ filterXml = simplexml_load_string ( $ filterXmlString ) ; $ attributes = ( array ) $ filterXml -> attributes ( ) ; if ( array_key_exists ( 'i:type' , $ attributes ) ) { $ type = ( string ) $ attributes [ 'i:type' ] ; if ( $ type === 'TrueFilter' ) { return new TrueFilter ( ) ; } if ( $ type === 'FalseFilter' ) { return new FalseFilter ( ) ; } return new self ( ) ; } return null ; }
Creates a Filter with specified XML based string.

@param string $filterXmlString An XML based filter string

@return Filter|null
Creates a Filter with specified XML based string .