Generate a defineMap key not already taken
@return int
161250
private function getFreeKey()
    {
        $index = count($this->maps);

        while (isset($this->maps[$index]))
            $index++;

        return $index;
    }
81022
protected function generateKey()
    {
        $split = '.';
        $prefix = config('laravel-sms.storage.prefix', 'laravel_sms');
        $args = func_get_args();
        array_unshift($args, $this->token);
        $args = array_filter($args, function ($value) {
            return $value && is_string($value);
        });
        if (!(empty($args))) {
            $prefix .= $split . implode($split, $args);
        }

        return $prefix;
    }
768685
protected function getMappedKeyIndex($mappedKey, $key)
    {
        $startSize = strlen($this->getStartMapDelimiter()) - 1;
        $key = substr($key, $startSize, strrpos($key, $this->getEndMapDelimiter())-$startSize);
        return substr($mappedKey, strlen($key . self::MAPPED_KEY_SEPARATOR));
    }
1250071
protected function defineConstants()
    {
        if (! empty($this->constants)) {
            foreach ($this->constants as $key => $value) {
                defined($key) || define($key, $value);
            }
        }

        return $this;
    }
1218437
protected function getMimeMappings()
    {
        $sCacheKey = 'mimes';
        $aCache    = $this->getCache($sCacheKey);

        if ($aCache) {
            return $aCache;
        }

        // --------------------------------------------------------------------------

        //  Try to work it out using Nail's mapping
        if (file_exists(NAILS_APP_PATH . 'application/config/mimes.php')) {
            require NAILS_APP_PATH . 'application/config/mimes.php';
        } else {
            require NAILS_COMMON_PATH . 'config/mimes.php';
        }

        // --------------------------------------------------------------------------

        //  Make sure we at least have an empty array
        if (!isset($mimes)) {
            $mimes = [];
        }

        // --------------------------------------------------------------------------

        $this->setCache($sCacheKey, $mimes);

        // --------------------------------------------------------------------------

        return $mimes;
    }
1252741
public function generateActivationKey()
    {
        $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $charactersLength = strlen($characters);
        $activationKey = '';
        for ($i = 0; $i < 40; $i++) {
            $activationKey .= $characters[rand(0, $charactersLength - 1)];
        }
        return $activationKey;
    }
26027
private function _generateKey()
    {
        if ($this->_key == '') {
            $this->_key = pack(
                'H*',
                hash('SHA256', md5(uniqid()))
            );
        }

        return $this->_key;
    }
1017372
protected function getMapper()
    {
        if (null === $this->mapper) {
            $this->mapper = $this->getServiceLocator()
                    ->get($this->getModuleNamespace() . '\Mapper\\' . $this->getEntityName());
        }
        return $this->mapper;
    }
1157389
protected function define(MapperDefinition $map)
    {
        $map->type($this->classType());

        $map->ignoreUnmappedProperties();

        if ($this->basePath) {
            $pathColumn = $map->property($this->fullPathPropertyName())
                ->mappedVia(function ($fullPath) {
                    return $this->relativePathCalculator->getRelativePath($this->basePath, $fullPath);
                }, function ($relativePath) {
                    return $this->relativePathCalculator->resolveRelativePath($this->basePath, $relativePath);
                })
                ->to($this->pathColumnName);
        } else {
            $pathColumn = $map->property($this->fullPathPropertyName())
                ->to($this->pathColumnName);
        }

        if ($this->allowInMemoryFiles) {
            $pathColumn->asText();
        } else {
            $pathColumn->asVarchar(self::MAX_PATH_LENGTH);
        }

        if ($this->clientNameColumnName) {
            $map->property($this->clientFileNamePropertyName())
                ->to($this->clientNameColumnName)
                ->nullable()
                ->asVarchar(self::MAX_CLIENT_FILE_NAME_LENGTH);
        }
    }
1261465
protected function getOptionsMap()
    {
        $optionSet = $this->Options();
        $optionMap = $optionSet->map('Value', 'Title');
        if ($optionMap instanceof Map) {
            return $optionMap->toArray();
        }
        return $optionMap;
    }
273056
protected static function generateRandomKey()
  {
    $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
    $baseKey = '';
    for ($i = 0; $i < self::$baseKeyLength; $i++) {
      $baseKey .= $chars[rand(0, count($chars) - 1)];
    }
    $baseKey .= uniqid();

    return $baseKey;
  }
24526
protected function generateRegistryItemKey() {
		
		if (!count($this->filteredBy)) {
			return null;
		}
		return md5($this->grid->id . CJSON::encode($this->filteredBy));
	}
161873
public function key()
    {
        if (empty($this->key) && !empty($this->definition->primary)) {
            $keys = array_values(
                array_filter(
                    preg_split('~[\s,]+~', $this->definition->primary)
                )
            );
            $keys = array_map(
                function ($key) {
                    return Normalise::toVariable($key);
                },
                $keys
            );

            $this->key = count($keys) > 1 ? $keys : array_shift($keys);
        }

        if (empty($this->key) && $this->has('id')) {
            $this->key = 'id';
        }

        return $this->key;
    }
464991
private function createMapping()
    {
        $columns = $this->pdoStatement->columnCount();
        if ($columns > 0) {
            $this->mapping = [];
            for ($i = 0; $i < $columns; $i++) {
                $meta = $this->pdoStatement->getColumnMeta($i);
                $this->mapping[$i] = [$meta['table'], $meta['name']];
            }
        }
    }
628230
public function generateMappings()
    {
        if (! count($this->mappings)) {
            return '';
        }

        $this->source_keys = array_flip(array_keys($this->sources));

        // group mappings by generated line number.
        $groupedMap = $groupedMapEncoded = [];

        foreach ($this->mappings as $m) {
            $groupedMap[$m['generated_line']][] = $m;
        }

        ksort($groupedMap);
        $lastGeneratedLine = $lastOriginalIndex = $lastOriginalLine = $lastOriginalColumn = 0;

        foreach ($groupedMap as $lineNumber => $line_map) {
            while (++$lastGeneratedLine < $lineNumber) {
                $groupedMapEncoded[] = ';';
            }

            $lineMapEncoded = [];
            $lastGeneratedColumn = 0;

            foreach ($line_map as $m) {
                $mapEncoded = $this->encoder->encode($m['generated_column'] - $lastGeneratedColumn);
                $lastGeneratedColumn = $m['generated_column'];

                // find the index
                if ($m['source_file']) {
                    $index = $this->findFileIndex($m['source_file']);

                    if ($index !== false) {
                        $mapEncoded .= $this->encoder->encode($index - $lastOriginalIndex);
                        $lastOriginalIndex = $index;
                        // lines are stored 0-based in SourceMap spec version 3
                        $mapEncoded .= $this->encoder->encode($m['original_line'] - 1 - $lastOriginalLine);
                        $lastOriginalLine = $m['original_line'] - 1;
                        $mapEncoded .= $this->encoder->encode($m['original_column'] - $lastOriginalColumn);
                        $lastOriginalColumn = $m['original_column'];
                    }
                }

                $lineMapEncoded[] = $mapEncoded;
            }

            $groupedMapEncoded[] = implode(',', $lineMapEncoded) . ';';
        }

        return rtrim(implode($groupedMapEncoded), ';');
    }
426551
protected static function determineKeyToValueMap(): array
    {
        // default behavior is to use all public constants of the current class
        $keyToValueMap = [];

        foreach ((new \ReflectionClass(static::class))->getReflectionConstants() as $constant) {
            if ($constant->isPublic()) {
                $keyToValueMap[$constant->name] = $constant->getValue();
            }
        }

        return $keyToValueMap;
    }
109014
protected function generateCacheKey(): string
    {
        return sprintf(
            '%s:%s:%s',
            $this->command,
            $this->collection->getNamespace(),
            md5(serialize($this->params))
        );
    }