original_string: public static function fromArray(array $data, $filter = false){
          $class = get_called_class();
          $object = new static();
          foreach($data as $key => $value){
              if(!$filter || property_exists($class, $key)){
                  $object->$key = $value;
              }
          }
          return $object;
      }
code: public static function fromArray(array $data, $filter = false){
          $class = get_called_class();
          $object = new static();
          foreach($data as $key => $value){
              if(!$filter || property_exists($class, $key)){
                  $object->$key = $value;
              }
          }
          return $object;
      }
code_tokens: public static function fromArray ( array $ data , $ filter = false ) { $ class = get_called_class ( ) ; $ object = new static ( ) ; foreach ( $ data as $ key => $ value ) { if ( ! $ filter || property_exists ( $ class , $ key ) ) { $ object -> $ key = $ value ; } } return $ object ; }
docstring: Create a Struct from an associative array
  @param array $data associative array array('property'=>data)
  @param bool $filter (optional) if true, $data array keys which are not defined as properties in the Struct will be ignored
  @return Struct
docstring_tokens: Create a Struct from an associative array