Cleaning the source code and making it “right”

Notice: This thread is very old.
juzna.cz
Member | 248
+
0
-

There are some places in Nette FW, which are not much right and though they work, they increate the WTF effect, especially when something stops working.

I'm not sure if current state is desired, or if we should hunt such things and send pull requests.

Here are examples:

  • requiring an interface but accessing properties (here)
  • using constant for one context in another one: CONTENT_* in Nette\Latte\Compiler::$context (example)
  • no typehint where it should be: all macros receive MacroNode and PhpWriter, though typehint is only for the former one
  • phpdoc doesn't match: example
  • wrong types in phpdoc (here)
  • not fully qualified class name in phpdoc: SplObjectStorage, stdClass are treated as if in namespace

Which of these do you consider desired, and which can be treated as bugs?

Jan Tvrdík
Nette guru | 2595
+
0
-

I think that the first two examples are fine and the others should by considered as bugs.