Skip to content
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

A few typing opportunities still exist in ClassStructureTrait and Schema #114

Open
skewty opened this issue Mar 2, 2021 · 0 comments
Open

Comments

@skewty
Copy link

skewty commented Mar 2, 2021

trait ClassStructureTrait
{
    use ObjectItemTrait;

    /**
     * Add union static here so nested object fields can be type hinted as such:
     *      class Book extends ClassStructure { public Author $author; }
     * without getting a type warning from IDE (phpStorm).
     * 
     * @return Wrapper|static
     */
    public static function schema()
class Schema extends JsonSchema implements MetaHolder, SchemaContract, HasDefault
{
    /**
     * Add union int here so fields can be type hinted as such:
     *      class Book extends ClassStructure { public int $id; }
     * without getting a type warning from IDE (phpStorm).
     * 
     * @return static|int
     */
    public static function integer() 

   // similar union typing should exist for the others like: string, boolean, number
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant