final class Javascript implements Type, JavascriptInterface, JsonSerializable, Stringable (View source)

Class Javascript

Methods

__construct(string $javascript, array|object|null $scope = null)

Construct a new Javascript

static Javascript
__set_state(array $properties)

No description

string
getCode()

Returns the Javascript's code

object|null
getScope()

Returns the Javascript's scope document

string
__toString()

Returns the Javascript's code

mixed
jsonSerialize()

Returns a representation that can be converted to JSON

Details

final __construct(string $javascript, array|object|null $scope = null)

Construct a new Javascript

Parameters

string $javascript
array|object|null $scope

static Javascript __set_state(array $properties)

No description

Parameters

array $properties

Return Value

Javascript

final string getCode()

Returns the Javascript's code

Return Value

string

final object|null getScope()

Returns the Javascript's scope document

Return Value

object|null

final string __toString()

Returns the Javascript's code

Return Value

string

final mixed jsonSerialize()

Since: 1.2.0

Returns a representation that can be converted to JSON

Return Value

mixed

data which can be serialized by json_encode, which is a value of any type other than a resource.

Exceptions

InvalidArgumentException