-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Strong typing for the view layer #634
API Strong typing for the view layer #634
Conversation
private static array $composite_db = [ | ||
"Hash" => "Varchar(255)", // SHA of the base content | ||
"Filename" => "Varchar(255)", // Path identifier of the base content | ||
"Variant" => "Varchar(255)", // Identifier of the variant to the base, if given | ||
]; | ||
|
||
private static array $casting = [ | ||
'URL' => 'Varchar', | ||
'AbsoluteURL' => 'Varchar', | ||
'Basename' => 'Varchar', | ||
'Title' => 'Varchar', | ||
'MimeType' => 'Varchar', | ||
'String' => 'Text', | ||
'Tag' => 'HTMLFragment', | ||
'getTag' => 'HTMLFragment', | ||
'Size' => 'Varchar', | ||
'AttributesHTML' => 'HTMLFragment', | ||
'getAttributesHTML' => 'HTMLFragment', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These have just been moved from below, so they're not buried below methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are methods in this class I have intentionally not added strict typing for, because they're defined in interfaces or are calling other code that isn't strongly typed, and I didn't want this PR to stretch tooo far beyond the goal of cleaning up the view layer.
d39556f
to
fdb242d
Compare
I want a good base of known types for things that will be going into the template layer before I start abstracting it, and this gets me part of the way there.
Issue