final public static function format_properties($properties) {
        foreach ($properties as $property => $definition) {
            // Ensures that null is set to its default.
            if (!isset($definition['null'])) {
                $properties[$property]['null'] = NULL_NOT_ALLOWED;
            }
            if (!isset($definition['description'])) {
                $properties[$property]['description'] = $property;
            }

            // If an array is provided, it may be a nested array that is unformatted so rinse and repeat.
            if (is_array($definition['type'])) {
                $properties[$property]['type'] = static::format_properties($definition['type']);
            }
        }
        return $properties;
    }
final public static function format_properties($properties) {
        foreach ($properties as $property => $definition) {
            // Ensures that null is set to its default.
            if (!isset($definition['null'])) {
                $properties[$property]['null'] = NULL_NOT_ALLOWED;
            }
            if (!isset($definition['description'])) {
                $properties[$property]['description'] = $property;
            }

            // If an array is provided, it may be a nested array that is unformatted so rinse and repeat.
            if (is_array($definition['type'])) {
                $properties[$property]['type'] = static::format_properties($definition['type']);
            }
        }
        return $properties;
    }
final public static function format_properties ( $ properties ) { foreach ( $ properties as $ property => $ definition ) { // Ensures that null is set to its default. if ( ! isset ( $ definition [ 'null' ] ) ) { $ properties [ $ property ] [ 'null' ] = NULL_NOT_ALLOWED ; } if ( ! isset ( $ definition [ 'description' ] ) ) { $ properties [ $ property ] [ 'description' ] = $ property ; } // If an array is provided, it may be a nested array that is unformatted so rinse and repeat. if ( is_array ( $ definition [ 'type' ] ) ) { $ properties [ $ property ] [ 'type' ] = static :: format_properties ( $ definition [ 'type' ] ) ; } } return $ properties ; }
Recursively formats a given property definition with the default fields required.

@param array $properties List of properties to format
@return array Formatted array
Recursively formats a given property definition with the default fields required .