src/Charcoal/Model/Service/MetadataLoader.php
private function validateMetadataContainer($metadata, &$type = null, &$bag = null)
    {
        // If variables are provided, clear existing values.
        $type = null;
        $bag  = null;

        if (is_array($metadata)) {
            $type = 'array';
            $bag  = $metadata;
            return true;
        }

        if (is_a($metadata, MetadataInterface::class, true)) {
            if (is_object($metadata)) {
                $type = get_class($metadata);
                $bag  = $metadata;
                return true;
            }
            if (is_string($metadata)) {
                $type = $metadata;
                return true;
            }
        }

        return false;
    }
private function validateMetadataContainer($metadata, &$type = null, &$bag = null)
    {
        // If variables are provided, clear existing values.
        $type = null;
        $bag  = null;

        if (is_array($metadata)) {
            $type = 'array';
            $bag  = $metadata;
            return true;
        }

        if (is_a($metadata, MetadataInterface::class, true)) {
            if (is_object($metadata)) {
                $type = get_class($metadata);
                $bag  = $metadata;
                return true;
            }
            if (is_string($metadata)) {
                $type = $metadata;
                return true;
            }
        }

        return false;
    }
private function validateMetadataContainer ( $ metadata , & $ type = null , & $ bag = null ) { // If variables are provided, clear existing values. $ type = null ; $ bag = null ; if ( is_array ( $ metadata ) ) { $ type = 'array' ; $ bag = $ metadata ; return true ; } if ( is_a ( $ metadata , MetadataInterface :: class , true ) ) { if ( is_object ( $ metadata ) ) { $ type = get_class ( $ metadata ) ; $ bag = $ metadata ; return true ; } if ( is_string ( $ metadata ) ) { $ type = $ metadata ; return true ; } } return false ; }
Validate a metadata type or container.

If specified, the method will also resolve the metadata type or container.

@param  mixed       $metadata The metadata type or container to validate.
@param  string|null $type     If provided, then it is filled with the resolved metadata type.
@param  mixed|null  $bag      If provided, then it is filled with the resolved metadata container.
@return boolean
Validate a metadata type or container .