Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Strip whitespace (or other characters) from the beginning and end of a string
trim(string $string, string $characters = " \n\r\t\v\x00"): string
public function callMethod($method, $params = [], $captureReturnValueCallback = null)
{
$method = trim($method);
switch ($method) {
case '$sync':
{
$method = trim($method);
switch ($method) {
case '$sync':
$pattern = "/,\s*?key\(([\s\S]*)\)/"; //everything between ",key(" and ")"
$expression = preg_replace_callback($pattern, function ($match) use (&$cachedKey) {
$cachedKey = trim($match[1]) ?: $cachedKey;
return "";
}, $expression);
$expression = preg_replace_callback($pattern, function ($match) use (&$cachedKey) {
$cachedKey = trim($match[1]) ?: $cachedKey;
return "";
}, $expression);
$component = $component::getName();
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringContainsString(
$escapedComponentName,
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringContainsString(
$escapedComponentName,
$component = $component::getName();
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringNotContainsString(
$escapedComponentName,
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringNotContainsString(
$escapedComponentName,
$component = $component::getName();
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringContainsString(
$escapedComponentName,
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringContainsString(
$escapedComponentName,
$component = $component::getName();
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringNotContainsString(
$escapedComponentName,
}
$escapedComponentName = trim(htmlspecialchars(json_encode(['name' => $component])), '{}');
\PHPUnit\Framework\Assert::assertStringNotContainsString(
$escapedComponentName,
$disk = Arr::pull($options, 'disk') ?: $this->disk;
$newPath = trim($path.'/'.$name, '/');
Storage::disk($disk)->put(
$newPath, $this->storage->readStream($this->path), $options
$newPath = trim($path.'/'.$name, '/');
Storage::disk($disk)->put(
$newPath, $this->storage->readStream($this->path), $options
protected function getModel($request, $model)
{
if ($this->isClassName($model)) {
return trim($model);
} else {
return $request->route($model, null) ??
((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
{
if ($this->isClassName($model)) {
return trim($model);
} else {
return $request->route($model, null) ??
((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
return trim($model);
} else {
return $request->route($model, null) ??
((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
}
}
} else {
return $request->route($model, null) ??
((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
}
}
{
$segments = explode('|', $this->recaller);
return count($segments) >= 3 && trim($segments[0]) !== '' && trim($segments[1]) !== '';
}
$segments = explode('|', $this->recaller);
return count($segments) >= 3 && trim($segments[0]) !== '' && trim($segments[1]) !== '';
}
}
return $this->qualifyClass(
$this->getDefaultNamespace(trim($rootNamespace, '\\')).'\\'.$name
);
}
return $this->qualifyClass(
$this->getDefaultNamespace(trim($rootNamespace, '\\')).'\\'.$name
);
}
protected function getNamespace($name)
{
return trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\');
}
{
return trim(implode('\\', array_slice(explode('\\', $name), 0, -1)), '\\');
}
protected function sortImports($stub)
{
if (preg_match('/(?P<imports>(?:use [^;{]+;$\n?)+)/m', $stub, $match)) {
$imports = explode("\n", trim($match['imports']));
sort($imports);
{
if (preg_match('/(?P<imports>(?:use [^;{]+;$\n?)+)/m', $stub, $match)) {
$imports = explode("\n", trim($match['imports']));
sort($imports);
sort($imports);
return str_replace(trim($match['imports']), implode("\n", $imports), $stub);
}
return $stub;
return str_replace(trim($match['imports']), implode("\n", $imports), $stub);
}
return $stub;
protected function getNameInput()
{
return trim($this->argument('name'));
}
{
return trim($this->argument('name'));
}