MCPcopy Create free account
hub / github.com/deuill/go-php / Get

Method Get

engine/receiver.go:91–102  ·  view source on GitHub ↗

Get returns a named internal property of the receiver object instance, or an error if the property does not exist or is not addressable.

(name string)

Source from the content-addressed store, hash-verified

89// Get returns a named internal property of the receiver object instance, or an
90// error if the property does not exist or is not addressable.
91func (o *ReceiverObject) Get(name string) (*Value, error) {
92 if _, exists := o.values[name]; !exists || !o.values[name].CanInterface() {
93 return nil, fmt.Errorf("Value '%s' does not exist or is not addressable", name)
94 }
95
96 val, err := NewValue(o.values[name].Interface())
97 if err != nil {
98 return nil, err
99 }
100
101 return val, nil
102}
103
104// Set assigns value to named internal property. If the named property does not
105// exist or cannot be set, the method does nothing.

Callers 1

engineReceiverGetFunction · 0.80

Calls 2

NewValueFunction · 0.85
InterfaceMethod · 0.80

Tested by

no test coverage detected