Change 'generated' notice to @phpdoc-style annotation

While it isn't an official part of the syntax, it integrates better with other
tools that ignore diffs on generated code.
Fix undefined index error, fixes #2224
Merge pull request #2210 from Firehed/master

Change 'generated' notice to @phpdoc-style annotation