original_string: public function check(array $insert, bool $throw = true): bool
      {
          foreach ($this->schema as $key => $rules) {
              // Check each key by given rules and respond
              // due to required flow.
              $result = $this->processRules($key, explode('|', $rules), $insert);
  
              if (!$result['status'] && $throw) {
                  throw new InvalidArgumentException(
                      sprintf($result['message'], $key)
                  );
              }
          }
  
          return $result['status'] ?? true;
      }
code: public function check(array $insert, bool $throw = true): bool
      {
          foreach ($this->schema as $key => $rules) {
              // Check each key by given rules and respond
              // due to required flow.
              $result = $this->processRules($key, explode('|', $rules), $insert);
  
              if (!$result['status'] && $throw) {
                  throw new InvalidArgumentException(
                      sprintf($result['message'], $key)
                  );
              }
          }
  
          return $result['status'] ?? true;
      }
code_tokens: public function check ( array $ insert , bool $ throw = true ) : bool { foreach ( $ this -> schema as $ key => $ rules ) { // Check each key by given rules and respond // due to required flow. $ result = $ this -> processRules ( $ key , explode ( '|' , $ rules ) , $ insert ) ; if ( ! $ result [ 'status' ] && $ throw ) { throw new InvalidArgumentException ( sprintf ( $ result [ 'message' ] , $ key ) ) ; } } return $ result [ 'status' ] ?? true ; }
docstring: Check if given array is matching the schema.
  
  @param  array $insert
  @param  bool  $throw
  
  @return bool
  
  @throws \InvalidArgumentException
docstring_tokens: Check if given array is matching the schema .