-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code cleanup #4
code cleanup #4
Conversation
Also including a minor bug fix in |
Is anybody watching for these pull requests? Would love to get some kind of acknowledgement. |
I'll take a look in the morning, fully agree with you. Coding standards are at a low level, it should not even be the subject of discussion. After a few days of use, there seem to be serious bugs, especially bad is the way how settings are stored in the vendor folder, also logs, database credentials are hardcoded, when access tokens are stored in the file, somehow email address is missing and later authentication does not pass... Some methods return the record ID as float, refers to 6 and probably a lot more ... Due to all of this, I have serious problems to deploy my custom Drupal integration to Pantheon and there is no other way than to try to improve the SDK. I wish I had never met Pantheon and Zoho SDK, but it's not my choice. |
Dear @sumanthchilka, Config in vendor? require_once('rtfm.php') |
Fixed merge conflicts, and incorporated latest changes from master branch. Glad to see some work being done here, even if there's a long way to go before the code style is solid. :) |
Why not use phpcs to do some linting? Though |
1f523ba
to
d108aa8
Compare
Code cleanup will be done in the upcoming versions of the SDK |
This is the official Zoho API SDK, yet its coding style falls well below today's standards.
Simple things like the following should be addressed:
?>
PHP tag.__DIR__
instead ofdirname(__FILE__)
.switch()
where appropriate, instead of endlessif/else()
statements.$str = "" . $var;
for strings and$num = $var + 0;
for numbers.About item (6), the results of that
+ 0
technique are unpredictable. It depends on what value is in the variable. Look over this to see why:So it's always better to use (int) or (float) typecasts whenever a specific type is needed.
There are many third-party SDK's for Zoho's API, and one reason may be that this official library does not live up to today's standards. I will provide such improvements in a pull-request if you will review and accept the changes. Please acknowledge this and I will proceed.
Please see the changes made in this pull-request for example updates.