maps the name of the operating system

@param string|null $osName

@return string|null
14323
public function mapOsName(?string $osName): ?string
    {
        if (null === $osName) {
            return null;
        }

        switch (mb_strtolower($osName)) {
            case '':
            case 'unknown':
            case 'other':
                $osName = null;
                break;
            case 'winxp':
            case 'win7':
            case 'win8':
            case 'win8.1':
            case 'win9':
            case 'win10':
            case 'winvista':
            case 'win2000':
            case 'win2003':
            case 'win98':
            case 'win95':
            case 'win31':
            case 'win32':
            case 'winnt':
            case 'winme':
            case 'windows 98':
            case 'windows 2000':
            case 'windows xp':
            case 'windows vista':
            case 'windows 7':
            case 'windows 8':
            case 'windows 8.1':
            case 'windows 10':
            case 'windows server':
            case 'windows unknown ver':
                $osName = 'Windows';
                break;
            case 'winphone7':
            case 'winphone7.5':
            case 'winphone8':
            case 'winphone8.1':
            case 'windows phone':
            case 'windows phone 7':
                $osName = 'Windows Phone OS';
                break;
            case 'winrt8':
            case 'winrt8.1':
                $osName = 'Windows RT';
                break;
            case 'winmobile':
                $osName = 'Windows Mobile OS';
                break;
            case 'wince':
                $osName = 'Windows CE';
                break;
            case 'blackberry os':
                $osName = 'RIM OS';
                break;
            case 'mac':
            case 'macosx':
            case 'os x':
            case 'mac osx':
                $osName = 'Mac OS X';
                break;
            case 'jvm':
            case 'java':
                $osName = 'Java';
                break;
            case 'bada os':
                $osName = 'Bada';
                break;
            case 'symbianos':
            case 'nokia series 40':
            case 'symbian os series 40':
                $osName = 'Symbian OS';
                break;
            case 'gnu/linux':
                $osName = 'Linux';
                break;
            case 'chrome os':
                $osName = 'ChromeOS';
                break;
            case 'mint':
                $osName = 'Linux Mint';
                break;
            default:
                // nothing to do here
                break;
        }

        return $osName;
    }
342433
protected function getFileName (string $fileName)
    {
        if (!$fileName && filter_var ($fileName, FILTER_VALIDATE_URL) === false) {
            return null;
        }

        $explodeFileURL = explode ('/', $fileName);
        $fileName       = end ($explodeFileURL);

        return sanitizeString (pathinfo ($fileName, PATHINFO_FILENAME)) . '.' . pathinfo ($fileName, PATHINFO_EXTENSION);
    }
156190
public function pageName($pageName = null)
    {
        if (null === $pageName) {
            return $this->pageName;
        }

        $this->pageName = $pageName;

        return $this;
    }
202327
public function filename($filename = null)
    {
        if ($filename === null) {
            return $this->_filename;
        }
        $this->_filename = $filename;
    }
1180079
public function mapOsVersion(?string $osVersion, ?string $osName = null): VersionInterface
    {
        return (new PlatformVersionMapper())->mapOsVersion($osVersion, $osName);
    }
322827
public function mapMaker(?string $maker): ?string
    {
        if (null === $maker) {
            return null;
        }

        switch (mb_strtolower(trim($maker))) {
            case '':
            case 'unknown':
            case 'other':
            case 'bot':
            case 'various':
                $maker = null;
                break;
            case 'microsoft':
            case 'microsoft corporation.':
                $maker = 'Microsoft Corporation';
                break;
            case 'apple':
            case 'apple inc.':
            case 'apple computer, inc.':
                $maker = 'Apple Inc';
                break;
            case 'google':
            case 'google inc.':
            case 'google, inc.':
                $maker = 'Google Inc';
                break;
            case 'lunascape & co., ltd.':
                $maker = 'Lunascape Corporation';
                break;
            case 'opera software asa.':
                $maker = 'Opera Software ASA';
                break;
            case 'sun microsystems, inc.':
                $maker = 'Oracle';
                break;
            case 'postbox, inc.':
                $maker = 'Postbox Inc';
                break;
            case 'comodo group, inc.':
                $maker = 'Comodo Group Inc';
                break;
            case 'canonical ltd.':
                $maker = 'Canonical Ltd';
                break;
            case 'gentoo foundation, inc.':
                $maker = 'Gentoo Foundation Inc';
                break;
            case 'omni development, inc.':
                $maker = 'Omni Development Inc';
                break;
            case 'slackware linux, inc.':
                $maker = 'Slackware Linux Inc';
                break;
            case 'red hat, inc.':
                $maker = 'Red Hat Inc';
                break;
            case 'rim':
                $maker = 'Research In Motion Limited';
                break;
            case 'mozilla':
                $maker = 'Mozilla Foundation';
                break;
            case 'majestic-12':
                $maker = 'Majestic-12 Ltd';
                break;
            case 'zum internet':
                $maker = 'ZUMinternet Corp';
                break;
            case 'mojeek ltd.':
                $maker = 'Linkdex Limited';
                break;
            default:
                // nothing to do here
                break;
        }

        return $maker;
    }
1086637
private function optShortName($o) {
		$o = $this->opt($o);
		return is_numeric($this->spec[$o][0]) ? null : $this->spec[$o][0];
	}
1157725
public function getTemplateNamesForFilename($filename)
    {
        $map = $this->getMap();
        $matching = array_filter(array_keys($map), function ($path) use ($filename) {
            return $filename[0] === $path[0] && 0 === strpos($filename, $path);
        });

        $templateNames = [];
        foreach ($matching as $match) {
            $namespace = $map[$match];
            $templateNames[] = self::MAIN_NAMESPACE === $namespace
                ? ltrim(substr($filename, strlen($match)), '/\\')
                : '@'.$namespace.substr($filename, strlen($match));
        }

        return $templateNames;
    }
467099
public static function getClassBaseName($className): string
    {
        $className = ToString::toString($className);
        if (\preg_match('~\\\(?<basename>[^\\\]+)$~u', $className, $matches) === 0) {
            return $className; // no namespace at all
        }

        return $matches['basename']; // without namespace
    }
438016
protected function getClassShortName(?string $className = null): string
	{
		$class = $className ?? static::class;

		$pos = strrpos($class, '\\');

		if($pos === false)
		{
			return $class;
		}

		return substr($class, $pos + 1);
	}
1010022
static String getNormalizedOperatingSystemName(final String osName) {
        String name = osName.toLowerCase(Locale.ENGLISH);
        name = name.replaceAll("[^0-9a-zA-Z_-]", "");
        return name;
    }
477887
protected function getClassName($className = null)
    {
        $parts = explode('\\', $className ?: $this->className);

        return $parts[count($parts) - 1];
    }
619003
public function mapOfficeVersion(string $version): string
    {
        $intVersion = (int) $version;

        if (in_array($intVersion, [2007, 2010, 2013, 2016])) {
            return (string) $intVersion;
        }

        if (16 === $intVersion) {
            return '2016';
        }

        if (15 === $intVersion) {
            return '2013';
        }

        if (14 === $intVersion) {
            return '2010';
        }

        if (12 === $intVersion) {
            return '2007';
        }

        return '0';
    }
409394
protected function getenv($varname): ?string
    {
        $value = getenv($varname, true);

        if ($value === false) {
            $value = getenv($varname);
        }

        return $value !== false ? $value : null;
    }
120820
public function hostname()
    {
        if ($this->host_os === 'WINDOWS') {
            $wmi = new \COM("winmgmts:\\\\.\\root\\cimv2");
            $computer = $wmi->ExecQuery("SELECT * FROM Win32_ComputerSystem");

            foreach ($computer as $c) {
                $hostname = $c->Name;
            }
        } else {
            $hostname = shell_exec('hostname');
        }
        return trim($hostname);
    }
49486
public function name($name = null)
    {
        deprecationWarning(
            get_called_class() . '::name() is deprecated. ' .
            'Use setName()/getName() instead.'
        );
        if ($name !== null) {
            $this->setName($name);
        }

        return $this->getName();
    }
833643
public function mapDeviceMarketingName(?string $marketingName): ?string
    {
        if (null === $marketingName) {
            return null;
        }

        switch (mb_strtolower($marketingName)) {
            case '':
            case 'unknown':
            case 'other':
            case 'various':
                $marketingName = null;
                break;
            case 'lg optimus chat':
                $marketingName = 'Optimus Chat';
                break;
            case 't mobile move balance':
                $marketingName = 'T-Mobile Move Balance';
                break;
            case 'xperia arc so-01c for docomo':
                $marketingName = 'Xperia Arc SO-01C for DoCoMo';
                break;
            case 'galaxy sii':
                $marketingName = 'Galaxy S II';
                break;
            case 'galaxy sii plus':
                $marketingName = 'Galaxy S II Plus';
                break;
            case 'galaxy siii':
            case 'galaxy s3':
                $marketingName = 'Galaxy S III';
                break;
            case 'galaxy s3 lte international':
                $marketingName = 'Galaxy S III LTE International';
                break;
            case 'lifetab':
                $marketingName = 'LifeTab';
                break;
            case 'galaxy sii epic 4g touch':
                $marketingName = 'Galaxy S II Epic 4G Touch';
                break;
            case 'prestigio multipad':
                $marketingName = 'Multipad';
                break;
            case 'samsung galaxy tab 7.0 plus':
                $marketingName = 'Galaxy Tab 7.0 Plus';
                break;
            case 'one touch m\'pop':
                $marketingName = 'One Touch MPop';
                break;
            case 'people\'s tablet':
                $marketingName = 'Peoples Tablet';
                break;
            case 'lumia 530 dual sim':
                $marketingName = 'Lumia 530';
                break;
            case 'droid razr i':
                $marketingName = 'RAZR i';
                break;
            case 'nokia asha 300':
            case '300':
                $marketingName = 'Asha 300';
                break;
            case 'galaxy tabpro 10.1" wifi':
                $marketingName = 'Galaxy Tab Pro 10.1 WiFi';
                break;
            case 'galaxy tab 3 10.1" wifi':
                $marketingName = 'Galaxy Tab 3 10.1 3G WiFi';
                break;
            case 'galaxy tab 4 10.1" wifi':
                $marketingName = 'Galaxy Tab 4 10.1 WiFi';
                break;
            case 'galaxy tab 4 10.1" lte':
                $marketingName = 'Galaxy Tab 4 10.1 LTE';
                break;
            case 'galaxy tab 2 10.1" wifi':
                $marketingName = 'Galaxy Tab 2 10.1 WiFi';
                break;
            case 'galaxy s5':
                $marketingName = 'Galaxy S5';
                break;
            case 'gt-i9515':
                $marketingName = 'Galaxy S4';
                break;
            case 'galaxy tab 3 10.1"':
            case 'galaxy tab 3 (10.1)':
                $marketingName = 'Galaxy Tab 3 10.1 3G';
                break;
            case 'kindle fire hdx 7" wifi':
                $marketingName = 'Kindle Fire HDX 7 WiFi';
                break;
            case 'ideatab b8080-f':
                $marketingName = 'Yoga Tab 10 HD+';
                break;
            case 'galaxy note 4':
                $marketingName = 'Galaxy Note 4';
                break;
            case 'b8000-f':
                $marketingName = 'Yoga B8000-F';
                break;
            case 'iconia a3':
                $marketingName = 'Iconia Tab A3';
                break;
            case 'galaxy trend lite':
                $marketingName = 'Galaxy Trend Lite';
                break;
            case 'one touch 6030x':
                $marketingName = 'One Touch Idol';
                break;
            case 'one mini2':
                $marketingName = 'One Mini 2';
                break;
            case 's iii mini':
                $marketingName = 'Galaxy S III Mini';
                break;
            default:
                // nothing to do here
                break;
        }

        return $marketingName;
    }