mirror of
https://github.com/laravel/valet.git
synced 2026-02-08 01:10:08 +01:00
Clean up helpers
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
* Set or get a global console writer.
|
* Set or get a global console writer.
|
||||||
*
|
*
|
||||||
* @param null|Symfony\Component\Console\Output\ConsoleOutputInterface $writer
|
* @param null|Symfony\Component\Console\Output\ConsoleOutputInterface $writer
|
||||||
* @return void|Symfony\Component\Console\Output\ConsoleOutputInterface
|
* @return Symfony\Component\Console\Output\ConsoleOutputInterface
|
||||||
*/
|
*/
|
||||||
function writer($writer = null)
|
function writer($writer = null)
|
||||||
{
|
{
|
||||||
@@ -47,7 +47,7 @@ function writer($writer = null)
|
|||||||
return $container->make('writer');
|
return $container->make('writer');
|
||||||
}
|
}
|
||||||
|
|
||||||
Container::getInstance()->instance('writer', $writer);
|
return Container::getInstance()->instance('writer', $writer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -109,7 +109,6 @@ function output($output)
|
|||||||
writer()->writeln($output);
|
writer()->writeln($output);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('resolve')) {
|
|
||||||
/**
|
/**
|
||||||
* Resolve the given class from the container.
|
* Resolve the given class from the container.
|
||||||
*
|
*
|
||||||
@@ -120,7 +119,6 @@ function resolve($class)
|
|||||||
{
|
{
|
||||||
return Container::getInstance()->make($class);
|
return Container::getInstance()->make($class);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swap the given class implementation in the container.
|
* Swap the given class implementation in the container.
|
||||||
@@ -134,7 +132,6 @@ function swap($class, $instance)
|
|||||||
Container::getInstance()->instance($class, $instance);
|
Container::getInstance()->instance($class, $instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('retry')) {
|
|
||||||
/**
|
/**
|
||||||
* Retry the given function N times.
|
* Retry the given function N times.
|
||||||
*
|
*
|
||||||
@@ -162,7 +159,6 @@ function retry($retries, $fn, $sleep = 0)
|
|||||||
goto beginning;
|
goto beginning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify that the script is currently running as "sudo".
|
* Verify that the script is currently running as "sudo".
|
||||||
@@ -176,7 +172,6 @@ function should_be_sudo()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! function_exists('tap')) {
|
|
||||||
/**
|
/**
|
||||||
* Tap the given value.
|
* Tap the given value.
|
||||||
*
|
*
|
||||||
@@ -190,9 +185,7 @@ function tap($value, callable $callback)
|
|||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (! function_exists('ends_with')) {
|
|
||||||
/**
|
/**
|
||||||
* Determine if a given string ends with a given substring.
|
* Determine if a given string ends with a given substring.
|
||||||
*
|
*
|
||||||
@@ -210,9 +203,7 @@ function ends_with($haystack, $needles)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (! function_exists('starts_with')) {
|
|
||||||
/**
|
/**
|
||||||
* Determine if a given string starts with a given substring.
|
* Determine if a given string starts with a given substring.
|
||||||
*
|
*
|
||||||
@@ -230,7 +221,6 @@ function starts_with($haystack, $needles)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the user.
|
* Get the user.
|
||||||
|
|||||||
Reference in New Issue
Block a user