src/Extension/ExtensionRegistry.php
public function add(ExtensionField $extension)
    {
        $extendee = trim($extension->getExtendee(), '\\');
        $number   = $extension->getTag();

        if ( ! isset($this->extensions[$extendee])) {
            $this->extensions[$extendee] = [];
        }

        $this->extensions[$extendee][$number] = $extension;
    }
public function add(ExtensionField $extension)
    {
        $extendee = trim($extension->getExtendee(), '\\');
        $number   = $extension->getTag();

        if ( ! isset($this->extensions[$extendee])) {
            $this->extensions[$extendee] = [];
        }

        $this->extensions[$extendee][$number] = $extension;
    }
public function add ( ExtensionField $ extension ) { $ extendee = trim ( $ extension -> getExtendee ( ) , '\\' ) ; $ number = $ extension -> getTag ( ) ; if ( ! isset ( $ this -> extensions [ $ extendee ] ) ) { $ this -> extensions [ $ extendee ] = [ ] ; } $ this -> extensions [ $ extendee ] [ $ number ] = $ extension ; }
Adds an element to the registry.

@param \Protobuf\Extension\ExtensionField $extension
Adds an element to the registry .