public function getDefinition($instanceOrClass)
    {
        if ($instanceOrClass instanceof BaseElement) {
            $instanceOrClass = get_class($instanceOrClass);
        }

        if (!is_string($instanceOrClass)) {
            throw new InvalidArgumentException(sprintf(
                'Given argument to %s is not an instance of a class extending %s and is not a string',
                __METHOD__,
                BaseElement::class
            ));
        }

        $definitions = $this->getDefinitions();

        if (!isset($definitions[$instanceOrClass])) {
            throw new InvalidArgumentException(sprintf('Unknown element "%s"', $instanceOrClass));
        }

        return $definitions[$instanceOrClass];
    }
public function getDefinition($instanceOrClass)
    {
        if ($instanceOrClass instanceof BaseElement) {
            $instanceOrClass = get_class($instanceOrClass);
        }

        if (!is_string($instanceOrClass)) {
            throw new InvalidArgumentException(sprintf(
                'Given argument to %s is not an instance of a class extending %s and is not a string',
                __METHOD__,
                BaseElement::class
            ));
        }

        $definitions = $this->getDefinitions();

        if (!isset($definitions[$instanceOrClass])) {
            throw new InvalidArgumentException(sprintf('Unknown element "%s"', $instanceOrClass));
        }

        return $definitions[$instanceOrClass];
    }
public function getDefinition ( $ instanceOrClass ) { if ( $ instanceOrClass instanceof BaseElement ) { $ instanceOrClass = get_class ( $ instanceOrClass ) ; } if ( ! is_string ( $ instanceOrClass ) ) { throw new InvalidArgumentException ( sprintf ( 'Given argument to %s is not an instance of a class extending %s and is not a string' , __METHOD__ , BaseElement :: class ) ) ; } $ definitions = $ this -> getDefinitions ( ) ; if ( ! isset ( $ definitions [ $ instanceOrClass ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Unknown element "%s"' , $ instanceOrClass ) ) ; } return $ definitions [ $ instanceOrClass ] ; }
Get the element type data for the given instance or class name of an element.

@param $instanceOrClass
@return mixed
Get the element type data for the given instance or class name of an element .