Initial commit
This commit is contained in:
26
app/helpers.php
Normal file
26
app/helpers.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/* SECTIONS HELPERS */
|
||||
if( !function_exists( 'section_must_be' ) ){
|
||||
|
||||
function section_must_be( array|string $sections, string $item ): bool
|
||||
{
|
||||
if( is_array($sections) ){
|
||||
return in_array( $item, $sections );
|
||||
}
|
||||
return $sections === $item;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( !function_exists( 'section_must_not_be' ) ){
|
||||
|
||||
function section_must_not_be( array|string $sections, string $item ): bool
|
||||
{
|
||||
if( is_array($sections) ){
|
||||
return ! in_array( $item, $sections );
|
||||
}
|
||||
return $sections !== $item;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user