This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | setter with fluent interface | ||
---|---|---|---|
Product: | php | Reporter: | derk <derk> |
Component: | Editor | Assignee: | Ondrej Brejla <obrejla> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | maghiel, OndrejBrejla |
Priority: | P3 | ||
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
derk
2009-09-03 16:30:36 UTC
batch reassigning bump I disagree, this would be really not desirable. I use Fluent Interface many times too, but in *some* classes. IMHO IF this would be implemented, please implement it as an (non default) option. Consider following: class Apple { public function setColor($color) { $this->_color = $color; return $this; } public function setCanBeRed($canBeRed) { $this->_canBeRed = (bool) $canBeRed; return $this; } } $apple = new Apple(); $apple->setCanBeRed(false) ->setColor('red'); Now I would have to raise an exception in setColor if canBeRed is false, or just let setColor return an instance of self, but imho the code isnt that fluent anymore then :p A bit a bad example, but it's late and tomorrow is holiday so I'm already drunk, but I hope you'll get my point ;) I mean it's not real-world example. Use "enable" instead "set" in this specific case. P3 since 4 votes... Fixed in web-main #b666f7d49969 Integrated into 'main-golden', will be available in build *201206200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b666f7d49969 User: Ondrej Brejla <obrejla@netbeans.org> Log: #171418 - setter with fluent interface Just tested it, exactly how I wanted to see the implementation :) This feature will save me tons of time. Want me to mark as VERIFIED FIXED? Thanks. I thinks that it's QA privilege ;) (In reply to comment #9) > Thanks. I thinks that it's QA privilege ;) Ah ok, maybe I could only do it when I was in netcat then ;) |