private function shouldApplyDefaultValue($requiredOnly, $schema, $name = null, $parentSchema = null)
    {
        // required-only mode is off
        if (!$requiredOnly) {
            return true;
        }
        // draft-04 required is set
        if (
            $name !== null
            && isset($parentSchema->required)
            && is_array($parentSchema->required)
            && in_array($name, $parentSchema->required)
        ) {
            return true;
        }
        // draft-03 required is set
        if (isset($schema->required) && !is_array($schema->required) && $schema->required) {
            return true;
        }
        // default case
        return false;
    }
private function shouldApplyDefaultValue($requiredOnly, $schema, $name = null, $parentSchema = null)
    {
        // required-only mode is off
        if (!$requiredOnly) {
            return true;
        }
        // draft-04 required is set
        if (
            $name !== null
            && isset($parentSchema->required)
            && is_array($parentSchema->required)
            && in_array($name, $parentSchema->required)
        ) {
            return true;
        }
        // draft-03 required is set
        if (isset($schema->required) && !is_array($schema->required) && $schema->required) {
            return true;
        }
        // default case
        return false;
    }
private function shouldApplyDefaultValue ( $ requiredOnly , $ schema , $ name = null , $ parentSchema = null ) { // required-only mode is off if ( ! $ requiredOnly ) { return true ; } // draft-04 required is set if ( $ name !== null && isset ( $ parentSchema -> required ) && is_array ( $ parentSchema -> required ) && in_array ( $ name , $ parentSchema -> required ) ) { return true ; } // draft-03 required is set if ( isset ( $ schema -> required ) && ! is_array ( $ schema -> required ) && $ schema -> required ) { return true ; } // default case return false ; }
Check whether a default should be applied for this value

@param mixed $schema
@param mixed $parentSchema
@param bool  $requiredOnly

@return bool
Check whether a default should be applied for this value