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

Handle column type methods using __call magic method #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

khalilst
Copy link

This PR removes MOST of the column type methods and handle them using __call method.
It will support the probably missing types.

And it reduced files size from 8360 to 4415 (46% lower) and line count from 348 to 175 (49% lower).

@khalilst khalilst force-pushed the type-methods-by-magic-method-call branch from f790287 to 0fb141f Compare June 26, 2021 05:18
@khalilst khalilst force-pushed the type-methods-by-magic-method-call branch from 0fb141f to a157287 Compare June 26, 2021 05:44
return "character({$column->length})";
}
if(substr($method, 0, 4) === 'type') {
$type = substr($method, 4, strlen($method) - 4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khalilst it should also use strtolower to ensure types work no matter how many capital letters are used.

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

Successfully merging this pull request may close these issues.

2 participants