Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find whether the type of a variable is string
<?php is_string(mixed $value): bool
<?php public function pull($properties = null)
{
$wantsASingleValue = is_string($properties);
$properties = is_array($properties) ? $properties : func_get_args();
<?php static function isAPrimitive($target) {
return
is_numeric($target) ||
is_string($target) ||
is_bool($target) ||
is_null($target);
}
<?php static function escapeStringForHtml($subject)
{
if (is_string($subject) || is_numeric($subject)) {
return htmlspecialchars($subject, ENT_QUOTES|ENT_SUBSTITUTE);
}
<?php static function generateBladeView($subject, $data = [])
{
if (! is_string($subject)) {
return tap($subject)->with($data);
}
<?php protected function tryingToSetStringOrIntegerToEnum($subject)
{
if (! is_string($subject) && ! is_int($subject)) return;
$target = $this->subTarget ?? $this->component;
<?php if (empty($params)) {
$test = collect(data_get($this->effects, 'dispatches'))->contains('name', '=', $value);
} elseif (isset($params[0]) && ! is_string($params[0]) && is_callable($params[0])) {
$event = collect(data_get($this->effects, 'dispatches'))->first(function ($item) use ($value) {
return $item['name'] === $value;
});
<?php public static function canUnserialize($subject)
{
if (is_string($subject)) {
return (string) str($subject)->startsWith(['livewire-file:', 'livewire-files:']);
}
<?php public static function unserializeFromLivewireRequest($subject)
{
if (is_string($subject)) {
if (str($subject)->startsWith('livewire-file:')) {
return static::createFromLivewire(str($subject)->after('livewire-file:'));
}
<?php if (! $uses) return;
if (is_string($uses)) {
$class = str($uses)->before('@')->toString();
$method = str($uses)->after('@')->toString();
<?php if (! $queryString = $this->getQueryString()) return;
foreach ($queryString as $key => $value) {
$key = is_string($key) ? $key : $value;
$alias = $value['as'] ?? $key;
$history = $value['history'] ?? true;
$keep = $value['alwaysShow'] ?? $value['keep'] ?? false;
<?php {
$actual = $this->get($name);
if (! is_string($value) && is_callable($value)) {
PHPUnit::assertTrue($value($actual));
} else {
$strict ? PHPUnit::assertSame($value, $actual) : PHPUnit::assertEquals($value, $actual);
<?php protected function render($component, $default = null)
{
if ($html = store($component)->get('skipRender', false)) {
$html = value(is_string($html) ? $html : $default);
if (! $html) return;
<?php protected function propertySynth($keyOrTarget, $context, $path): Synth
{
return is_string($keyOrTarget)
? $this->getSynthesizerByKey($keyOrTarget, $context, $path)
: $this->getSynthesizerByTarget($keyOrTarget, $context, $path);
}
<?php ->filter(function ($value, $key) use ($persistentMiddleware) {
return $persistentMiddleware->contains(function($iValue, $iKey) use ($value) {
if (! is_string($value)) return false;
return Str::before($value, ':') == $iValue;
<?php public function define($ability, $callback)
{
if (is_array($callback) && isset($callback[0]) && is_string($callback[0])) {
$callback = $callback[0].'@'.$callback[1];
}