Skip to content

Refactor CastInterface and Cast #26

@rodber

Description

@rodber

The concept of CastInterface is misleading as what this package does is type checking against dynamic variables. Cast is often understood as type casting/conversion, which is not what is happening here. The name was poorly chosen.

What Cast does is that it takes a variable and it offers methods to access that variable typed:

public function int(): int {
    return $this->var;
}

^ This is what Cast does, it uses this trick to enable you to dynamic typed access.

As this is not converting anything, we need a new name for the next major.

I suggest TypedInterface.

$typed->int();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions