Skip to content

Commit

Permalink
fix(helper): nah, let's better not rely on a potential php-src bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSdot committed May 10, 2024
1 parent d3c2902 commit 8213369
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Closure;
use Illuminate\Support\Collection;

if (! function_exists(\Laravel\Prompts\text::class)) {
if (! function_exists('\Laravel\Prompts\text')) {
/**
* Prompt the user for text input.
*/
Expand All @@ -15,7 +15,7 @@ function text(string $label, string $placeholder = '', string $default = '', boo
}
}

if (! function_exists(\Laravel\Prompts\textarea::class)) {
if (! function_exists('\Laravel\Prompts\textarea')) {
/**
* Prompt the user for multiline text input.
*/
Expand All @@ -25,7 +25,7 @@ function textarea(string $label, string $placeholder = '', string $default = '',
}
}

if (! function_exists(\Laravel\Prompts\password::class)) {
if (! function_exists('\Laravel\Prompts\password')) {
/**
* Prompt the user for input, hiding the value.
*/
Expand All @@ -35,7 +35,7 @@ function password(string $label, string $placeholder = '', bool|string $required
}
}

if (! function_exists(\Laravel\Prompts\select::class)) {
if (! function_exists('\Laravel\Prompts\select')) {
/**
* Prompt the user to select an option.
*
Expand All @@ -48,7 +48,7 @@ function select(string $label, array|Collection $options, int|string|null $defau
}
}

if (! function_exists(\Laravel\Prompts\multiselect::class)) {
if (! function_exists('\Laravel\Prompts\multiselect')) {
/**
* Prompt the user to select multiple options.
*
Expand All @@ -62,7 +62,7 @@ function multiselect(string $label, array|Collection $options, array|Collection
}
}

if (! function_exists(\Laravel\Prompts\confirm::class)) {
if (! function_exists('\Laravel\Prompts\confirm')) {
/**
* Prompt the user to confirm an action.
*/
Expand All @@ -72,7 +72,7 @@ function confirm(string $label, bool $default = true, string $yes = 'Yes', strin
}
}

if (! function_exists(\Laravel\Prompts\pause::class)) {
if (! function_exists('\Laravel\Prompts\pause')) {
/**
* Prompt the user to continue or cancel after pausing.
*/
Expand All @@ -82,7 +82,7 @@ function pause(string $message = 'Press enter to continue...'): bool
}
}

if (! function_exists(\Laravel\Prompts\suggest::class)) {
if (! function_exists('\Laravel\Prompts\suggest')) {
/**
* Prompt the user for text input with auto-completion.
*
Expand All @@ -94,7 +94,7 @@ function suggest(string $label, array|Collection|Closure $options, string $place
}
}

if (! function_exists(\Laravel\Prompts\search::class)) {
if (! function_exists('\Laravel\Prompts\search')) {
/**
* Allow the user to search for an option.
*
Expand All @@ -107,7 +107,7 @@ function search(string $label, Closure $options, string $placeholder = '', int $
}
}

if (! function_exists(\Laravel\Prompts\multisearch::class)) {
if (! function_exists('\Laravel\Prompts\multisearch')) {
/**
* Allow the user to search for multiple option.
*
Expand All @@ -120,7 +120,7 @@ function multisearch(string $label, Closure $options, string $placeholder = '',
}
}

if (! function_exists(\Laravel\Prompts\spin::class)) {
if (! function_exists('\Laravel\Prompts\spin')) {
/**
* Render a spinner while the given callback is executing.
*
Expand All @@ -135,7 +135,7 @@ function spin(Closure $callback, string $message = ''): mixed
}
}

if (! function_exists(\Laravel\Prompts\note::class)) {
if (! function_exists('\Laravel\Prompts\note')) {
/**
* Display a note.
*/
Expand All @@ -145,7 +145,7 @@ function note(string $message, ?string $type = null): void
}
}

if (! function_exists(\Laravel\Prompts\error::class)) {
if (! function_exists('\Laravel\Prompts\error')) {
/**
* Display an error.
*/
Expand All @@ -155,7 +155,7 @@ function error(string $message): void
}
}

if (! function_exists(\Laravel\Prompts\warning::class)) {
if (! function_exists('\Laravel\Prompts\warning')) {
/**
* Display a warning.
*/
Expand All @@ -165,7 +165,7 @@ function warning(string $message): void
}
}

if (! function_exists(\Laravel\Prompts\alert::class)) {
if (! function_exists('\Laravel\Prompts\alert')) {
/**
* Display an alert.
*/
Expand All @@ -175,7 +175,7 @@ function alert(string $message): void
}
}

if (! function_exists(\Laravel\Prompts\info::class)) {
if (! function_exists('\Laravel\Prompts\info')) {
/**
* Display an informational message.
*/
Expand All @@ -185,7 +185,7 @@ function info(string $message): void
}
}

if (! function_exists(\Laravel\Prompts\intro::class)) {
if (! function_exists('\Laravel\Prompts\intro')) {
/**
* Display an introduction.
*/
Expand All @@ -195,7 +195,7 @@ function intro(string $message): void
}
}

if (! function_exists(\Laravel\Prompts\outro::class)) {
if (! function_exists('\Laravel\Prompts\outro')) {
/**
* Display a closing message.
*/
Expand All @@ -205,7 +205,7 @@ function outro(string $message): void
}
}

if (! function_exists(\Laravel\Prompts\table::class)) {
if (! function_exists('\Laravel\Prompts\table')) {
/**
* Display a table.
*
Expand All @@ -218,7 +218,7 @@ function table(array|Collection $headers = [], array|Collection|null $rows = nul
}
}

if (! function_exists(\Laravel\Prompts\progress::class)) {
if (! function_exists('\Laravel\Prompts\progress')) {
/**
* Display a progress bar.
*
Expand All @@ -241,7 +241,7 @@ function progress(string $label, iterable|int $steps, ?Closure $callback = null,
}
}

if (! function_exists(\Laravel\Prompts\form::class)) {
if (! function_exists('\Laravel\Prompts\form')) {
function form(): FormBuilder
{
return new FormBuilder();
Expand Down

0 comments on commit 8213369

Please sign in to comment.