public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Trace
data/web/inc/lib/vendor/illuminate/collections/functions.php
Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.
Author
Date
Commit
Line
Code
1
<?php
3
namespace Illuminate\Support;
5
if (! function_exists('Illuminate\Support\enum_value')) {
6
/**
7
* Return a scalar value for the given value that might be an enum.
8
*
9
* @internal
10
*
11
* @template TValue
12
* @template TDefault
13
*
14
* @param TValue $value
15
* @param TDefault|callable(TValue): TDefault $default
16
* @return ($value is empty ? TDefault : mixed)
17
*/
18
function enum_value($value, $default = null)
19
{
20
return match (true) {
21
$value instanceof \BackedEnum => $value->value,
22
$value instanceof \UnitEnum => $value->name,
24
default => $value ?? value($default),
25
};
26
}
27
}