User talk:RMCD bot/botclasses.php

Deprecated code needs to be updated in order to make it work again
See Bots/Noticeboard/Archive 15. Some of the framework functions that I don't use have not been upgraded. still uses  and   is still using.

Special:ApiFeatureUsage – wbm1058 (talk) 19:57, 14 October 2021 (UTC)

Wrong @return types
Hello. I hope you're doing well. For botclasses.php, my code editor is throwing some warnings (red underlines of various variables) due to things like. It thinks these are variables of type api, Api, and The, respectively. This could be fixed by changing to something like. Is this the right spot to request changes? Hope this helps. Thanks. – Novem Linguae (talk) 07:58, 1 December 2022 (UTC)
 * Hi . What code editor are you using? I just use Windows Notepad, which is primitive I guess but gets the job done for me. I've upgraded to PHP 8 which is throwing warnings that earlier PHP versions did not, and upgraded my code accordingly. The at sign only appears in the comments and as far as I know is not a special character in the PHP language. Are you just getting warnings from your code editor or are you getting PHP runtime errors as well? wbm1058 (talk) 11:59, 1 December 2022 (UTC)
 * Only the code editor is giving warnings. Fancy code editors read the doc blocks and keep track of what types the variables are supposed to be, then alert you with red squiggle underlines when it thinks it's found a variable that is the wrong type.  tells the code editor that this method always returns a class of type "The". A little thing, but easily fixable, so I figured I'd mention it. I use VS Code. It's free, and you can start taking advantage of things like "search all files in a folder" and code highlighting without any complicated setup. – Novem Linguae  (talk) 12:45, 1 December 2022 (UTC)
 * , feel free to update the doc blocks yourself and post your new version here to my subpage yourself. Thanks, wbm1058 (talk) 13:30, 1 December 2022 (UTC)

Improved indentation and braces
Thanks for maintaining this. I've used it in for a couple years now and it works great.

I just made some edits to improve indentation and braces, which should hopefully make the code easier to read and maintain. Not sure how bold to be on this user page. If too bold, feel free to revert. Or if you like me modernizing the code, let me know too and I can do more.

The edits were with an automated tool so should be less risky than doing them manually. I don't anticipate any problems. I did a quick test of login and getpage and things worked fine. – Novem Linguae (talk) 07:50, 2 April 2024 (UTC)
 * that's fine. You might ping me when you edit this page, as I rarely look at my watchlist or log into my bots' accounts to see their pings. Just noticing your change now, two months later. OK, we'll consistently use spaces rather than tabs, I've never been sure about which and have needed to make tweaks to get things to align in the past. I didn't realize that the closing ?> for  wasn't necessary; that's counter-intuitive. – wbm1058 (talk) 16:35, 1 June 2024 (UTC)
 * @Wbm1058. I actually like tabs better, but most of this file is spaces so I went with that. In regards to ?>, one time I accidentally had ?> plus a space character, and that space was printing before I sent my headers. I could not for the life of me figure out why my webpage was displaying blank. Deleting the ?> completely eliminates that type of bug and I think has become common in the industry. I certainly like that trick :) – Novem Linguae (talk) 17:06, 1 June 2024 (UTC)