protected function getLoggerModuleNameForType()
    {
        $reflection = new ReflectionClass($this);

        $filename = $reflection->getFileName();
        $match    = str_contains($filename, 'app') ? [1 => 'core'] : null;

        if (!isset($match[1]) and ! preg_match("'src(.*?)src'si", $filename, $match)) {
            throw new Exception('Unable to resolve current module name.');
        }

        if (!isset($match[1])) {
            throw new Exception('Unable to resolve current module namespace.');
        }

        $reserved = [
            'components', 'modules'
        ];

       return str_contains($match[1], 'core')
           ? 'core'
           : trim(str_replace($reserved, '', $match[1]), DIRECTORY_SEPARATOR);
    }
protected function getLoggerModuleNameForType()
    {
        $reflection = new ReflectionClass($this);

        $filename = $reflection->getFileName();
        $match    = str_contains($filename, 'app') ? [1 => 'core'] : null;

        if (!isset($match[1]) and ! preg_match("'src(.*?)src'si", $filename, $match)) {
            throw new Exception('Unable to resolve current module name.');
        }

        if (!isset($match[1])) {
            throw new Exception('Unable to resolve current module namespace.');
        }

        $reserved = [
            'components', 'modules'
        ];

       return str_contains($match[1], 'core')
           ? 'core'
           : trim(str_replace($reserved, '', $match[1]), DIRECTORY_SEPARATOR);
    }
protected function getLoggerModuleNameForType ( ) { $ reflection = new ReflectionClass ( $ this ) ; $ filename = $ reflection -> getFileName ( ) ; $ match = str_contains ( $ filename , 'app' ) ? [ 1 => 'core' ] : null ; if ( ! isset ( $ match [ 1 ] ) and ! preg_match ( "'src(.*?)src'si" , $ filename , $ match ) ) { throw new Exception ( 'Unable to resolve current module name.' ) ; } if ( ! isset ( $ match [ 1 ] ) ) { throw new Exception ( 'Unable to resolve current module namespace.' ) ; } $ reserved = [ 'components' , 'modules' ] ; return str_contains ( $ match [ 1 ] , 'core' ) ? 'core' : trim ( str_replace ( $ reserved , '' , $ match [ 1 ] ) , DIRECTORY_SEPARATOR ) ; }
Returns a name of the type. In the default the module name based on class namespace will be returned.

@return string
@throws Exception
Returns a name of the type . In the default the module name based on class namespace will be returned .