src/Model/StructValue.php
protected static function constantSuffix($structName, $value, $index)
    {
        $key = mb_strtoupper($structName . '_' . $value);
        $indexedKey = $key . '_' . $index;
        if (array_key_exists($indexedKey, self::$uniqueConstants)) {
            return self::$uniqueConstants[$indexedKey];
        } elseif (!array_key_exists($key, self::$uniqueConstants)) {
            self::$uniqueConstants[$key] = 0;
        } else {
            self::$uniqueConstants[$key]++;
        }
        self::$uniqueConstants[$indexedKey] = self::$uniqueConstants[$key];
        return self::$uniqueConstants[$key];
    }
protected static function constantSuffix($structName, $value, $index)
    {
        $key = mb_strtoupper($structName . '_' . $value);
        $indexedKey = $key . '_' . $index;
        if (array_key_exists($indexedKey, self::$uniqueConstants)) {
            return self::$uniqueConstants[$indexedKey];
        } elseif (!array_key_exists($key, self::$uniqueConstants)) {
            self::$uniqueConstants[$key] = 0;
        } else {
            self::$uniqueConstants[$key]++;
        }
        self::$uniqueConstants[$indexedKey] = self::$uniqueConstants[$key];
        return self::$uniqueConstants[$key];
    }
protected static function constantSuffix ( $ structName , $ value , $ index ) { $ key = mb_strtoupper ( $ structName . '_' . $ value ) ; $ indexedKey = $ key . '_' . $ index ; if ( array_key_exists ( $ indexedKey , self :: $ uniqueConstants ) ) { return self :: $ uniqueConstants [ $ indexedKey ] ; } elseif ( ! array_key_exists ( $ key , self :: $ uniqueConstants ) ) { self :: $ uniqueConstants [ $ key ] = 0 ; } else { self :: $ uniqueConstants [ $ key ] ++ ; } self :: $ uniqueConstants [ $ indexedKey ] = self :: $ uniqueConstants [ $ key ] ; return self :: $ uniqueConstants [ $ key ] ; }
Returns the index which has to be added at the end of natural constant name defined with the value cleaned
Allows to avoid multiple constant name to be identical
@param string $structName the struct name
@param string $value the value
@param int $index the position of the value
@return int
Returns the index which has to be added at the end of natural constant name defined with the value cleaned Allows to avoid multiple constant name to be identical