MCPcopy Create free account
hub / github.com/error311/FileRise / boolFromMixed

Method boolFromMixed

src/FileRise/Domain/FolderModel.php:2288–2298  ·  view source on GitHub ↗
($value)

Source from the content-addressed store, hash-verified

2286 }
2287
2288 private static function boolFromMixed($value): bool
2289 {
2290 if (is_bool($value)) {
2291 return $value;
2292 }
2293 if (is_int($value) || is_float($value)) {
2294 return ((int)$value) !== 0;
2295 }
2296 $s = strtolower(trim((string)$value));
2297 return in_array($s, ['1', 'true', 'yes', 'on'], true);
2298 }
2299
2300 private static function intFromMixed($value, int $min = 0, int $max = 0): int
2301 {

Callers 2

createShareFolderLinkMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected