original_string: public static function validateData($data)
      {
          // @todo Prior code also checked for $data being an array, but the docs
          // at https://docs.theplatform.com/help/wsf-handling-data-service-exceptions#tp-toc4
          // don't show that.
          $required = [
              'responseCode',
              'isException',
              'title',
          ];
  
          // The error description is only returned for client errors. According
          // to thePlatform support, the documentation is wrong about description
          // always being included.
          if (isset($data['responseCode']) && $data['responseCode'] >= 400 && $data['responseCode'] < 500) {
              $required[] = 'description';
          }
  
          foreach ($required as $key) {
              if (empty($data[$key])) {
                  throw new \InvalidArgumentException(sprintf('Required key %s is missing.', $key));
              }
          }
      }
code: public static function validateData($data)
      {
          // @todo Prior code also checked for $data being an array, but the docs
          // at https://docs.theplatform.com/help/wsf-handling-data-service-exceptions#tp-toc4
          // don't show that.
          $required = [
              'responseCode',
              'isException',
              'title',
          ];
  
          // The error description is only returned for client errors. According
          // to thePlatform support, the documentation is wrong about description
          // always being included.
          if (isset($data['responseCode']) && $data['responseCode'] >= 400 && $data['responseCode'] < 500) {
              $required[] = 'description';
          }
  
          foreach ($required as $key) {
              if (empty($data[$key])) {
                  throw new \InvalidArgumentException(sprintf('Required key %s is missing.', $key));
              }
          }
      }
code_tokens: public static function validateData ( $ data ) { // @todo Prior code also checked for $data being an array, but the docs // at https://docs.theplatform.com/help/wsf-handling-data-service-exceptions#tp-toc4 // don't show that. $ required = [ 'responseCode' , 'isException' , 'title' , ] ; // The error description is only returned for client errors. According // to thePlatform support, the documentation is wrong about description // always being included. if ( isset ( $ data [ 'responseCode' ] ) && $ data [ 'responseCode' ] >= 400 && $ data [ 'responseCode' ] < 500 ) { $ required [ ] = 'description' ; } foreach ( $ required as $ key ) { if ( empty ( $ data [ $ key ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Required key %s is missing.' , $ key ) ) ; } } }
docstring: Validate required data in the MPX error.
  
  @param array $data The array of data returned by MPX.
  
  @throws \InvalidArgumentException Thrown if a required key in $data is missing.
  
  @see https://docs.theplatform.com/help/wsf-handling-data-service-exceptions#tp-toc4
docstring_tokens: Validate required data in the MPX error .