arrayToObjectRecursive example

static fn(string $class) => sprintf('Unable to find class/interface "%s" specified in the prop "%s" for the component "%s".', $class$prop_name$definition['id']),
          $missing_classes
        ),
      ];
    }
    // Remove the non JSON Schema types for validation down below.     $definition['props'] = $this->nullifyClassPropsSchema(
      $schema,
      $classes_per_prop
    );

    $definition_object = Validator::arrayToObjectRecursive($definition);
    $this->validator->validate(
      $definition_object,
      (object) ['$ref' => 'file://' . dirname(__DIR__) . '/metadata-full.schema.json']
    );
    if (empty($missing_class_errors) && $this->validator->isValid()) {
      return TRUE;
    }
    $message_parts = array_map(
      static fn(array $error): string => sprintf("[%s] %s", $error['property']$error['message']),
      $this->validator->getErrors()
    );
    
Home | Imprint | This part of the site doesn't use cookies.