private function createOptionsForTruncateTrace($thrower): ?array
    {
        if ($thrower) {
            if (is_string($thrower)) {
                return [
                    'namespace' => $thrower,
                ];
            }
            if (is_object($thrower)) {
                return [
                    'namespace' => preg_replace('/(\\\\[^\\\\]+)$/s', '', get_class($thrower)),
                ];
            }
            return null;
        }
        $options = $this->howTruncateTrace;
        if ($options === null) {
            $options = Opts::getHowTruncateTrace();
        }
        if (!$options) {
            return null;
        }
        if ($options === true) {
            $ns = preg_replace('/(\\\\[^\\\\]+)$/s', '', get_class($this));
            /* True: use the current namespace for errors.
             * It is nested namespace for the target namespace.
             * Truncate it.
             */
            if ($ns === 'axy\errors') {
                /* Trimming for axy\errors will result "axy". And it spreads to all axy-libs.
                 * Therefore, do not trim it.
                 * Return because axy\errors do not throws any exception.
                 * And return requires for TraceTruncateTest::testAxyNS()
                 */
                return null;
            }
            $ns = preg_replace('/(\\\\[^\\\\]+)$/s', '', $ns);
            $options = [
                'namespace' => $ns,
            ];
        } elseif (!is_array($options)) {
            $options = [
                'namespace' => $options,
            ];
        }
        return $options;
    }
private function createOptionsForTruncateTrace($thrower): ?array
    {
        if ($thrower) {
            if (is_string($thrower)) {
                return [
                    'namespace' => $thrower,
                ];
            }
            if (is_object($thrower)) {
                return [
                    'namespace' => preg_replace('/(\\\\[^\\\\]+)$/s', '', get_class($thrower)),
                ];
            }
            return null;
        }
        $options = $this->howTruncateTrace;
        if ($options === null) {
            $options = Opts::getHowTruncateTrace();
        }
        if (!$options) {
            return null;
        }
        if ($options === true) {
            $ns = preg_replace('/(\\\\[^\\\\]+)$/s', '', get_class($this));
            /* True: use the current namespace for errors.
             * It is nested namespace for the target namespace.
             * Truncate it.
             */
            if ($ns === 'axy\errors') {
                /* Trimming for axy\errors will result "axy". And it spreads to all axy-libs.
                 * Therefore, do not trim it.
                 * Return because axy\errors do not throws any exception.
                 * And return requires for TraceTruncateTest::testAxyNS()
                 */
                return null;
            }
            $ns = preg_replace('/(\\\\[^\\\\]+)$/s', '', $ns);
            $options = [
                'namespace' => $ns,
            ];
        } elseif (!is_array($options)) {
            $options = [
                'namespace' => $options,
            ];
        }
        return $options;
    }
private function createOptionsForTruncateTrace ( $ thrower ) : ? array { if ( $ thrower ) { if ( is_string ( $ thrower ) ) { return [ 'namespace' => $ thrower , ] ; } if ( is_object ( $ thrower ) ) { return [ 'namespace' => preg_replace ( '/(\\\\[^\\\\]+)$/s' , '' , get_class ( $ thrower ) ) , ] ; } return null ; } $ options = $ this -> howTruncateTrace ; if ( $ options === null ) { $ options = Opts :: getHowTruncateTrace ( ) ; } if ( ! $ options ) { return null ; } if ( $ options === true ) { $ ns = preg_replace ( '/(\\\\[^\\\\]+)$/s' , '' , get_class ( $ this ) ) ; /* True: use the current namespace for errors.
             * It is nested namespace for the target namespace.
             * Truncate it.
             */ if ( $ ns === 'axy\errors' ) { /* Trimming for axy\errors will result "axy". And it spreads to all axy-libs.
                 * Therefore, do not trim it.
                 * Return because axy\errors do not throws any exception.
                 * And return requires for TraceTruncateTest::testAxyNS()
                 */ return null ; } $ ns = preg_replace ( '/(\\\\[^\\\\]+)$/s' , '' , $ ns ) ; $ options = [ 'namespace' => $ ns , ] ; } elseif ( ! is_array ( $ options ) ) { $ options = [ 'namespace' => $ options , ] ; } return $ options ; }
Creates an options list for truncate

@param mixed $thrower
@return array|null
Creates an options list for truncate