src/PleasingPrefixFilter.php
protected function getRules( $content )
  {
    $rules = array();
    if( preg_match_all( '#{((?:[^{}]++|(?R))*+)}#', $content, $groups, PREG_SET_ORDER ) )
    {
      foreach( $groups as $group )
      {
        if( strpos( $group[ 1 ], '{' ) === false )
        {
          $set = preg_split( '#(\r|\n)#', $group[ 1 ] );

          foreach( $set as $s )
          {
            if( !empty($s) && $rule = CssRule::fromString( $s ) )
            {
              $rules[] = $rule;
            }
          }
        }
        else
        {
          $rules = array_merge( $rules, $this->getRules( $group[ 1 ] ) );
        }
      }
    }

    return (!empty($rules)) ? $rules : null;
  }
protected function getRules( $content )
  {
    $rules = array();
    if( preg_match_all( '#{((?:[^{}]++|(?R))*+)}#', $content, $groups, PREG_SET_ORDER ) )
    {
      foreach( $groups as $group )
      {
        if( strpos( $group[ 1 ], '{' ) === false )
        {
          $set = preg_split( '#(\r|\n)#', $group[ 1 ] );

          foreach( $set as $s )
          {
            if( !empty($s) && $rule = CssRule::fromString( $s ) )
            {
              $rules[] = $rule;
            }
          }
        }
        else
        {
          $rules = array_merge( $rules, $this->getRules( $group[ 1 ] ) );
        }
      }
    }

    return (!empty($rules)) ? $rules : null;
  }
@param $content

@return CssRule[]