public function getDefaultImplementationClassNameForInterface($interfaceName)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        $interfaceName = $this->cleanClassName($interfaceName);

        if (interface_exists($interfaceName) === false) {
            throw new \InvalidArgumentException('"' . $interfaceName . '" does not exist or is not the name of an interface.', 1238769559);
        }
        $this->loadOrReflectClassIfNecessary($interfaceName);

        $classNamesFound = isset($this->classReflectionData[$interfaceName][self::DATA_INTERFACE_IMPLEMENTATIONS]) ? array_keys($this->classReflectionData[$interfaceName][self::DATA_INTERFACE_IMPLEMENTATIONS]) : [];
        if (count($classNamesFound) === 1) {
            return $classNamesFound[0];
        }
        if (count($classNamesFound) !== 2 || !isset($this->classReflectionData[ProxyInterface::class][self::DATA_INTERFACE_IMPLEMENTATIONS])) {
            return false;
        }

        if (isset($this->classReflectionData[ProxyInterface::class][self::DATA_INTERFACE_IMPLEMENTATIONS][$classNamesFound[0]])) {
            return $classNamesFound[0];
        }
        if (isset($this->classReflectionData[ProxyInterface::class][self::DATA_INTERFACE_IMPLEMENTATIONS][$classNamesFound[1]])) {
            return $classNamesFound[1];
        }

        return false;
    }
public function getDefaultImplementationClassNameForInterface($interfaceName)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        $interfaceName = $this->cleanClassName($interfaceName);

        if (interface_exists($interfaceName) === false) {
            throw new \InvalidArgumentException('"' . $interfaceName . '" does not exist or is not the name of an interface.', 1238769559);
        }
        $this->loadOrReflectClassIfNecessary($interfaceName);

        $classNamesFound = isset($this->classReflectionData[$interfaceName][self::DATA_INTERFACE_IMPLEMENTATIONS]) ? array_keys($this->classReflectionData[$interfaceName][self::DATA_INTERFACE_IMPLEMENTATIONS]) : [];
        if (count($classNamesFound) === 1) {
            return $classNamesFound[0];
        }
        if (count($classNamesFound) !== 2 || !isset($this->classReflectionData[ProxyInterface::class][self::DATA_INTERFACE_IMPLEMENTATIONS])) {
            return false;
        }

        if (isset($this->classReflectionData[ProxyInterface::class][self::DATA_INTERFACE_IMPLEMENTATIONS][$classNamesFound[0]])) {
            return $classNamesFound[0];
        }
        if (isset($this->classReflectionData[ProxyInterface::class][self::DATA_INTERFACE_IMPLEMENTATIONS][$classNamesFound[1]])) {
            return $classNamesFound[1];
        }

        return false;
    }
public function getDefaultImplementationClassNameForInterface ( $ interfaceName ) { if ( ! $ this -> initialized ) { $ this -> initialize ( ) ; } $ interfaceName = $ this -> cleanClassName ( $ interfaceName ) ; if ( interface_exists ( $ interfaceName ) === false ) { throw new \ InvalidArgumentException ( '"' . $ interfaceName . '" does not exist or is not the name of an interface.' , 1238769559 ) ; } $ this -> loadOrReflectClassIfNecessary ( $ interfaceName ) ; $ classNamesFound = isset ( $ this -> classReflectionData [ $ interfaceName ] [ self :: DATA_INTERFACE_IMPLEMENTATIONS ] ) ? array_keys ( $ this -> classReflectionData [ $ interfaceName ] [ self :: DATA_INTERFACE_IMPLEMENTATIONS ] ) : [ ] ; if ( count ( $ classNamesFound ) === 1 ) { return $ classNamesFound [ 0 ] ; } if ( count ( $ classNamesFound ) !== 2 || ! isset ( $ this -> classReflectionData [ ProxyInterface :: class ] [ self :: DATA_INTERFACE_IMPLEMENTATIONS ] ) ) { return false ; } if ( isset ( $ this -> classReflectionData [ ProxyInterface :: class ] [ self :: DATA_INTERFACE_IMPLEMENTATIONS ] [ $ classNamesFound [ 0 ] ] ) ) { return $ classNamesFound [ 0 ] ; } if ( isset ( $ this -> classReflectionData [ ProxyInterface :: class ] [ self :: DATA_INTERFACE_IMPLEMENTATIONS ] [ $ classNamesFound [ 1 ] ] ) ) { return $ classNamesFound [ 1 ] ; } return false ; }
Searches for and returns the class name of the default implementation of the given
interface name. If no class implementing the interface was found or more than one
implementation was found in the package defining the interface, false is returned.

@param string $interfaceName Name of the interface
@return mixed Either the class name of the default implementation for the object type or false
@throws \InvalidArgumentException if the given interface does not exist
@api
Searches for and returns the class name of the default implementation of the given interface name . If no class implementing the interface was found or more than one implementation was found in the package defining the interface false is returned .