Closed nonbinary closed 7 years ago
This does not, however, feel optimal. Since the DonorMapper->findByKey throws an exception if the donor does not exist, and I'd like the AddCommand to throw an exception... I predict clashes. Maybe we should add a new function to DonorMapper, or change DonorMapper's exception to something more specific?
Yupp. Logic looks good. Will merge when I get home to my computer..
Yes I agree. DonorMapper::hasKey()
.
Feel free to add in this pr. It's better logic and more readable. So go for it!
Hm. Now I did donorMapper->hasKey(). Is DonorMapper::hasKey() preferrable?
No no that's what I mean. Sorry about the confusion. It's de-facto standard to write $object->method()
when you are referencing a concrete object, but ClassName::method()
when you mean a method in a class.. but I see how this can be confused with static access..
You can drop the else keyword now as it doesn't fill any logical value..
And if you have time the new DonorMapperSpec..
Am working on the DonorMapperSpec. Am having some trouble with boolean return values. But I'll get there.
Here's what I'd thought the test should look like. But it confuses the return values here.
Cool. Merging!
Solution to bug #51