
function randInt(min = 1, max = 10, except = null) {
let result = null
while (result === except) {
result = Math.floor(Math.random() * (max - min + 1)) + min
}
return result;
}const three = createTableWithContent(randInt(1, 10, two), "three");
| Value: | {1,4} | inherit |
| Initial: | see individual properties |
| Applies to: | all elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column |
| Inherited: | no |
| Percentages: | refer to width of containing block |
| Media: | visual |
| Computed value: | see individual properties |
Или другой вариант – сделать нестатические методы приватными/защищенными
class MyModel {
public static function __callStatic($method, $parameters) {
$methodName = $method.'Method';
return (new static)->$methodName(...$parameters);
}
public function testMethod() {
echo 'It\'s OK';
return $this;
}
}
MyModel::test();