abstract class OAuthResponse implements Iterator

Base class for all resource, represents the response of the callAPI method.

It implements the Iterator interface to allow the use of the foreach statement.

Properties

private string $provider The name of the provider
private array $values The properties of the resource

Methods

__construct(string $provider, array|object $values, array $mapping = [])

Constructs a OAuthResponse object

setPropertyValue(string $property, string $value, array $mapping)

Sets the value of a property

string
getProvider()

Returns the name of the provider

mixed|null
__get(string $property)

Allows direct read-only access to a property

bool
__isset(string $property)

Allows to test (isset) directly the existence of a property

mixed|null
__call(string $method, array $arguments)

Defines a dynamic getter for the properties.

rewind()

Rewinds back to the first property of the resource.

mixed
current()

Returns the current property

scalar
key()

Returns the name of the current property

next()

Moves forward to next property

bool
valid()

Checks if current position is valid

Details

at line 33
__construct(string $provider, array|object $values, array $mapping = [])

Constructs a OAuthResponse object

Parameters

string $provider the provider name.
array|object $values the properties of the resource.
array $mapping Match between OAuth client fields and fields returned by the provider.

at line 60
protected setPropertyValue(string $property, string $value, array $mapping)

Sets the value of a property

Parameters

string $property the property name.
string $value the value of the property.
array $mapping Match between OAuth client fields and fields returned by the provider.

at line 75
string getProvider()

Returns the name of the provider

Return Value

string the provider name.

at line 86
mixed|null __get(string $property)

Allows direct read-only access to a property

Parameters

string $property the name of the property.

Return Value

mixed|null the value of the property or null if the propery doesn't exists.

at line 110
bool __isset(string $property)

Allows to test (isset) directly the existence of a property

Parameters

string $property the name of the property.

Return Value

bool true if the property exists, false otherwise

at line 124
mixed|null __call(string $method, array $arguments)

Defines a dynamic getter for the properties.

For example, if the property is named 'my_property', a call to the getMyProperty() method will get the value of my_property.

Parameters

string $method the name of the getter.
array $arguments arguments passed to the getter, ignored.

Return Value

mixed|null the value of the property or null

at line 159
rewind()

Rewinds back to the first property of the resource.

at line 168
mixed current()

Returns the current property

Return Value

mixed the current property

at line 177
scalar key()

Returns the name of the current property

Return Value

scalar the name of the current property

at line 184
next()

Moves forward to next property

at line 193
bool valid()

Checks if current position is valid

Return Value

bool true if current position is valid