This repository has been archived on 2025-08-17. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
versa/src/Enum/ProjectLanguage.php

23 lines
427 B
PHP

<?php
declare(strict_types=1);
namespace App\Enum;
enum ProjectLanguage: string
{
case JavaScript = 'javascript';
case PHP = 'php';
/**
* @param non-empty-string $language
*/
public static function isValid(string $language): bool
{
return in_array(
haystack: array_column(self::cases(), 'value'),
needle: $language,
strict: true,
);
}
}