Minor update in DB IO for phpstan check

This commit is contained in:
Clemens Schwaighofer
2022-02-09 10:32:26 +09:00
parent 03f0de5026
commit c584af8393
3 changed files with 25 additions and 11 deletions

View File

@@ -300,6 +300,22 @@ function randomIdF() // eslint-disable-line no-unused-vars
return Math.random().toString(36).substring(2);
}
/**
* generate a number between min/max
* with min/max inclusive.
* eg: 1,5 will create a number ranging from 1 o 5
* @param {Number} min minimum int number inclusive
* @param {Number} max maximumg int number inclusive
* @return {Number} Random number
*/
function getRandomIntInclusive(min, max) // eslint-disable-line no-unused-vars
{
min = Math.ceil(min);
max = Math.floor(max);
// The maximum is inclusive and the minimum is inclusive
return Math.floor(Math.random() * (max - min + 1) + min);
}
/**
* check if name is a function
* @param {string} name Name of function to check if exists