private function isValidOptionalH5pData($h5pData, $requirements, $library_name) {
    $valid = TRUE;

    foreach ($h5pData as $key => $value) {
      if (isset($requirements[$key])) {
        $valid = $this->isValidRequirement($value, $requirements[$key], $library_name, $key) && $valid;
      }
      // Else: ignore, a package can have parameters that this library doesn't care about, but that library
      // specific implementations does care about...
    }

    return $valid;
  }
private function isValidOptionalH5pData($h5pData, $requirements, $library_name) {
    $valid = TRUE;

    foreach ($h5pData as $key => $value) {
      if (isset($requirements[$key])) {
        $valid = $this->isValidRequirement($value, $requirements[$key], $library_name, $key) && $valid;
      }
      // Else: ignore, a package can have parameters that this library doesn't care about, but that library
      // specific implementations does care about...
    }

    return $valid;
  }
private function isValidOptionalH5pData ( $ h5pData , $ requirements , $ library_name ) { $ valid = TRUE ; foreach ( $ h5pData as $ key => $ value ) { if ( isset ( $ requirements [ $ key ] ) ) { $ valid = $ this -> isValidRequirement ( $ value , $ requirements [ $ key ] , $ library_name , $ key ) && $ valid ; } // Else: ignore, a package can have parameters that this library doesn't care about, but that library // specific implementations does care about... } return $ valid ; }
Helper function for isValidH5pData

Validates the optional part of the h5pData

Triggers error messages

@param array $h5pData
h5p data
@param array $requirements
Validation pattern
@param string $library_name
Name of the library we are processing
@return boolean
TRUE if the optional part of the $h5pData is valid
Helper function for isValidH5pData