Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Custom types. #33

Closed
jmalloc opened this Issue · 0 comments

1 participant

@jmalloc
Collaborator

Syntax example.

:Eloquent\SomeType

The colon indicates that this type referenced should be treated as an implementation of the Type interface, instead of producing an ObjectType.

This eliminates the need for a registry.

@jmalloc jmalloc referenced this issue from a commit
@jmalloc jmalloc Implemented extension types (fixes #33).
An extension type is specified by preceeding a class name with a colon, eg: `:Foo\Bar`. The parser produces an `ExtensionType` instance with the class name set to `Foo\Bar`.

Attributes are supported, and are passed to the `ExtensionType` instance unmodified, eg: `:Foo\Bar { myAttribute: true }`.
Support for arbitrary attributes required modification of `Parser::parseAttributes()`, the `$supportedAttributes` parameter is now nullable to indicate that there is no restriction on the supported attribute names.

`ExtensionType` exposes two methods:
 * `className()` which returns a ClassName instance; and
 * `attributes()` which returns the attributes array.
b46f13a
@jmalloc jmalloc referenced this issue from a commit
@jmalloc jmalloc Implemented extension types (fixes #33).
An extension type is specified by preceeding a class name with a colon, eg: `:Foo\Bar`. The parser produces an `ExtensionType` instance with the class name set to `Foo\Bar`.

Attributes are supported, and are passed to the `ExtensionType` instance unmodified, eg: `:Foo\Bar { myAttribute: true }`.
Support for arbitrary attributes required modification of `Parser::parseAttributes()`, the `$supportedAttributes` parameter is now nullable to indicate that there is no restriction on the supported attribute names.

`ExtensionType` exposes two methods:
 * `className()` which returns a ClassName instance; and
 * `attributes()` which returns the attributes array.
40517a0
@jmalloc jmalloc closed this issue from a commit
@jmalloc jmalloc Implemented custom types (fixes #33).
A custom type is specified by preceeding a class name with a colon, eg: `:Foo\Bar`. The parser produces an `ExtensionType` instance with the class name set to `Foo\Bar`.

Attributes are supported, and are passed to the `ExtensionType` instance unmodified, eg: `:Foo\Bar { myCustomAttribute: true }`.
Support for arbitrary attributes required modification of `Parser::parseAttributes()`, the `$supportedAttributes` parameter is now nullable to indicate that there is no restriction on the supported attribute names.

`ExtensionType` exposes two methods:
 * `className()` which returns a ClassName instance; and
 * `attributes()` which returns the attributes array.
c638b78
@jmalloc jmalloc closed this in c638b78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.