php/Element.php
private function getSerializedConfig() {
		// Ensure that '_' comes first in the output.
		$config = [ '_' => true ];
		$config = $this->getConfig( $config );
		// Post-process config array to turn Tag references into ID references
		// and HtmlSnippet references into a { html: 'string' } JSON form.
		$replaceElements = function ( &$item ) {
			if ( $item instanceof Tag ) {
				$item->ensureInfusableId();
				$item = [ 'tag' => $item->getAttribute( 'id' ) ];
			} elseif ( $item instanceof HtmlSnippet ) {
				$item = [ 'html' => (string)$item ];
			}
		};
		array_walk_recursive( $config, $replaceElements );
		// Set '_' last to ensure that subclasses can't accidentally step on it.
		$config['_'] = $this->getJavaScriptClassName();
		return $config;
	}
private function getSerializedConfig() {
		// Ensure that '_' comes first in the output.
		$config = [ '_' => true ];
		$config = $this->getConfig( $config );
		// Post-process config array to turn Tag references into ID references
		// and HtmlSnippet references into a { html: 'string' } JSON form.
		$replaceElements = function ( &$item ) {
			if ( $item instanceof Tag ) {
				$item->ensureInfusableId();
				$item = [ 'tag' => $item->getAttribute( 'id' ) ];
			} elseif ( $item instanceof HtmlSnippet ) {
				$item = [ 'html' => (string)$item ];
			}
		};
		array_walk_recursive( $config, $replaceElements );
		// Set '_' last to ensure that subclasses can't accidentally step on it.
		$config['_'] = $this->getJavaScriptClassName();
		return $config;
	}
private function getSerializedConfig ( ) { // Ensure that '_' comes first in the output. $ config = [ '_' => true ] ; $ config = $ this -> getConfig ( $ config ) ; // Post-process config array to turn Tag references into ID references // and HtmlSnippet references into a { html: 'string' } JSON form. $ replaceElements = function ( & $ item ) { if ( $ item instanceof Tag ) { $ item -> ensureInfusableId ( ) ; $ item = [ 'tag' => $ item -> getAttribute ( 'id' ) ] ; } elseif ( $ item instanceof HtmlSnippet ) { $ item = [ 'html' => ( string ) $ item ] ; } } ; array_walk_recursive ( $ config , $ replaceElements ) ; // Set '_' last to ensure that subclasses can't accidentally step on it. $ config [ '_' ] = $ this -> getJavaScriptClassName ( ) ; return $ config ; }
Create a modified version of the configuration array suitable for
JSON serialization by replacing `Tag` references and
`HtmlSnippet`s.

@return array A serialized configuration array.
Create a modified version of the configuration array suitable for JSON serialization by replacing Tag references and HtmlSnippet s .