midgardproject / midgard-php5

PHP5 API for Midgard persistent storage framework
http://www.midgard-project.org/api-docs/midgard/php/ratatoskr/
GNU Lesser General Public License v2.1
9 stars 2 forks source link

More inconsistencies in object constructor #36

Closed flack closed 13 years ago

flack commented 13 years ago

Since #20, the following throws an InvaliArgumentException:

$t = new midgard_topic('');

This, however, returns an empty object:

$t = new midgard_topic(0);

So I was wondering: Is this a bug or a feature of some sorts?

BTW,

$t = new midgard_topic(-1);

and all other negative values also return objects, which definitely looks like a bug

bergie commented 13 years ago

Agreed, 0 and negative integers (and strings that are not GUIDs) should throw exceptions

indeyets commented 13 years ago

I added test for this in 522c4bb335b3596cad7f7791eaabb1130e3e938d (failing at the moment). it should be fixed in core. I'll submit ticket

indeyets commented 13 years ago

core issue: midgardproject/midgard-core#75