Documentation

Str extends Facade
in package

Facade base class Adds the ability to define a fallback instance.

Tags
see
Str

Table of Contents

$app  : Application
The application instance being facaded.
$resolvedInstance  : array<string|int, mixed>
The resolved object instances.
__callStatic()  : mixed
Handle dynamic, static calls to the object.
after()  :
ascii()  :
before()  :
camel()  :
clearResolvedInstance()  : void
Clear a resolved facade instance.
clearResolvedInstances()  : void
Clear all of the resolved instances.
contains()  :
endsWith()  :
finish()  :
getClassId()  :
getClassNamespace()  :
getFacadeApplication()  : Application
Get the application instance behind the facade.
getFacadeRoot()  : mixed
Get the root object behind the facade.
getPrecedingSymbols()  :
is()  :
kebab()  :
length()  :
limit()  :
lower()  :
normalizeClassName()  :
normalizeEol()  :
ordinal()  :
parseCallback()  :
plural()  :
random()  :
replaceArray()  :
replaceFirst()  :
replaceLast()  :
setFacadeApplication()  : void
Set the application instance.
shouldReceive()  : Expectation
Initiate a mock expectation on the facade.
singular()  :
slug()  :
snake()  :
spy()  : void
Convert the facade into a Mockery spy.
start()  :
startsWith()  :
studly()  :
substr()  :
swap()  : void
Hotswap the underlying instance behind the facade.
title()  :
ucfirst()  :
upper()  :
words()  :
createFreshMockInstance()  : Expectation
Create a fresh mock instance for the given class.
createMock()  : MockInterface
Create a fresh mock instance for the given class.
getFacadeAccessor()  : string
Get the registered name of the component.
getFacadeInstance()  : mixed
If the accessor is not found via getFacadeAccessor, use this instance as a fallback.
getMockableClass()  : string|null
Get the mockable class for the bound instance.
isMock()  : bool
Determines whether a mock is set as the instance of the facade.
resolveFacadeInstance()  : mixed
Resolve the facade root instance from the container.

Properties

$resolvedInstance

The resolved object instances.

protected static array<string|int, mixed> $resolvedInstance

Methods

__callStatic()

Handle dynamic, static calls to the object.

public static __callStatic(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string
$args : array<string|int, mixed>
Tags
throws
RuntimeException
Return values
mixed

after()

public static after(string $subject, string $search) :
Parameters
$subject : string
$search : string
Return values

ascii()

public static ascii(string $value, string $language = 'en') :
Parameters
$value : string
$language = 'en' : string
Return values

before()

public static before(string $subject, string $search) :
Parameters
$subject : string
$search : string
Return values

camel()

public static camel(string $value) :
Parameters
$value : string
Return values

clearResolvedInstance()

Clear a resolved facade instance.

public static clearResolvedInstance(string $name) : void
Parameters
$name : string
Return values
void

clearResolvedInstances()

Clear all of the resolved instances.

public static clearResolvedInstances() : void
Return values
void

contains()

public static contains(string $haystack, string|array<string|int, mixed> $needles) :
Parameters
$haystack : string
$needles : string|array<string|int, mixed>
Return values

endsWith()

public static endsWith(string $haystack, string|array<string|int, mixed> $needles) :
Parameters
$haystack : string
$needles : string|array<string|int, mixed>
Return values

finish()

public static finish(string $value, string $cap) :
Parameters
$value : string
$cap : string
Return values

getClassId()

public static getClassId(string $name) :
Parameters
$name : string
Return values

getClassNamespace()

public static getClassNamespace(string $name) :
Parameters
$name : string
Return values

getFacadeApplication()

Get the application instance behind the facade.

public static getFacadeApplication() : Application
Return values
Application

getFacadeRoot()

Get the root object behind the facade.

public static getFacadeRoot() : mixed
Return values
mixed

getPrecedingSymbols()

public static getPrecedingSymbols(string $string, string $symbol) :
Parameters
$string : string
$symbol : string
Return values

is()

public static is(string|array<string|int, mixed> $pattern, string $value) :
Parameters
$pattern : string|array<string|int, mixed>
$value : string
Return values

kebab()

public static kebab(string $value) :
Parameters
$value : string
Return values

length()

public static length(string $value, string $encoding = null) :
Parameters
$value : string
$encoding = null : string
Return values

limit()

public static limit(string $value, int $limit = 100, string $end = '...') :
Parameters
$value : string
$limit = 100 : int
$end = '...' : string
Return values

lower()

public static lower(string $value) :
Parameters
$value : string
Return values

normalizeClassName()

public static normalizeClassName(string $name) :
Parameters
$name : string
Return values

normalizeEol()

public static normalizeEol(string $string) :
Parameters
$string : string
Return values

ordinal()

public static ordinal(int $number) :
Parameters
$number : int
Return values

parseCallback()

public static parseCallback(string $callback, string $default = null) :
Parameters
$callback : string
$default = null : string
Return values

plural()

public static plural(string $value, int $count) :
Parameters
$value : string
$count : int
Return values

random()

public static random(int $length = 16) :
Parameters
$length = 16 : int
Return values

replaceArray()

public static replaceArray(string $search, array<string|int, mixed> $replace, string $subject) :
Parameters
$search : string
$replace : array<string|int, mixed>
$subject : string
Return values

replaceFirst()

public static replaceFirst(string $search, string $replace, string $subject) :
Parameters
$search : string
$replace : string
$subject : string
Return values

replaceLast()

public static replaceLast(string $search, string $replace, string $subject) :
Parameters
$search : string
$replace : string
$subject : string
Return values

setFacadeApplication()

Set the application instance.

public static setFacadeApplication(Application $app) : void
Parameters
$app : Application
Return values
void

shouldReceive()

Initiate a mock expectation on the facade.

public static shouldReceive() : Expectation
Return values
Expectation

singular()

public static singular(string $value) :
Parameters
$value : string
Return values

slug()

public static slug(string $title, string $seperator = '-', string $language = 'en') :
Parameters
$title : string
$seperator = '-' : string
$language = 'en' : string
Return values

snake()

public static snake(string $value, string $delimiter = '_') :
Parameters
$value : string
$delimiter = '_' : string
Return values

spy()

Convert the facade into a Mockery spy.

public static spy() : void
Return values
void

start()

public static start(string $value, string $prefix) :
Parameters
$value : string
$prefix : string
Return values

startsWith()

public static startsWith(string $haystack, string|array<string|int, mixed> $needles) :
Parameters
$haystack : string
$needles : string|array<string|int, mixed>
Return values

studly()

public static studly(string $value) :
Parameters
$value : string
Return values

substr()

public static substr(string $string, int $start, int $length = null) :
Parameters
$string : string
$start : int
$length = null : int
Return values

swap()

Hotswap the underlying instance behind the facade.

public static swap(mixed $instance) : void
Parameters
$instance : mixed
Return values
void

title()

public static title(string $value) :
Parameters
$value : string
Return values

ucfirst()

public static ucfirst(string $string) :
Parameters
$string : string
Return values

upper()

public static upper(string $value) :
Parameters
$value : string
Return values

words()

public static words(string $value, int $words = 100, mixed $end) :
Parameters
$value : string
$words = 100 : int
$end : mixed
Return values

createFreshMockInstance()

Create a fresh mock instance for the given class.

protected static createFreshMockInstance() : Expectation
Return values
Expectation

createMock()

Create a fresh mock instance for the given class.

protected static createMock() : MockInterface
Return values
MockInterface

getFacadeAccessor()

Get the registered name of the component.

protected static getFacadeAccessor() : string
Return values
string

getFacadeInstance()

If the accessor is not found via getFacadeAccessor, use this instance as a fallback.

protected static getFacadeInstance() : mixed
Return values
mixed

getMockableClass()

Get the mockable class for the bound instance.

protected static getMockableClass() : string|null
Return values
string|null

isMock()

Determines whether a mock is set as the instance of the facade.

protected static isMock() : bool
Return values
bool

resolveFacadeInstance()

Resolve the facade root instance from the container.

protected static resolveFacadeInstance(string|object $name) : mixed
Parameters
$name : string|object
Return values
mixed

Search results