honeybee / trellis

Library for defining structured entities in php.
Mozilla Public License 2.0
8 stars 1 forks source link

Remove toBoolean() calls around getOption() for boolean options #15

Closed graste closed 8 years ago

graste commented 8 years ago

See https://github.com/honeybee/trellis/issues/14

This PR removes the toBoolean() calls around $this->getOption() calls in validation rules. This improves the performance quite a bit by "only" losing on the functionality of having string "false" interpreted as false for boolean options in rules.

For ArticleType->createEntity() this is about 7% faster (1000 articles created). The TextRule apply is about 18% faster on short text and ~5% faster on a 20x longer text.