HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/slenders.komma.pro/app/Komma/Kms/Core/Sections/SectionTabGroups.php
<?php
namespace App\Komma\Kms\Core\Sections;

/**
 * Class SectionTabGroups
 * @package App\Komma\Kms\Core\Sections
 *
 * Defines tab groups.
 */
abstract class SectionTabGroups
{
    const None = '';
    const General = 'general';
    const Languages = 'languages';

    /**
     * Check if the passed group is really a group that is defined as a constant in this class.
     *
     * @param string $group
     * @param bool $strict If true it will only consider a role as valid if it is an int. If it for example is a numeric string it won't consider it valid
     * @return bool Returns true if the group is a valid one, false otherwise
     */
    static function isValidGroup(string $group, $strict = false) {
        return in_array($group, self::getAllGroups(), $strict);
    }

    /**
     * Returns an array containing integers representing the defined groups.
     *
     * @return string[]
     */
    private static function getAllGroups()
    {
        $thisClassAsReflectionClass = new \ReflectionClass(__CLASS__);
        return $thisClassAsReflectionClass->getConstants();
    }
}