-
Notifications
You must be signed in to change notification settings - Fork 164
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
Lib framework code optimizations #948
Lib framework code optimizations #948
Conversation
… more closely adhere to PSR-12; changed array initializers to short-array (square bracket) syntax;
One more thing that I changed ... there was a heavy usage of |
Thank you @TheDigitalOrchard @Shadow243 can you please review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray 🎉, this is a cleaning refactoring!
Replacing array_key_exists()
with just empty()
might introduce a potential issue where accessing a non-existent key in an array could trigger a notice-level error in PHP. This is because empty()
will attempt to access the key directly without first checking if it exists, leading to an undefined offset error if the key is not present. Therefore, it's essential to ensure the key exists using isset()
or array_key_exists()
before using empty()
to avoid generating notice-level errors.
Master (from which we will soon branch 2.x) requires PHP 7.4: Stable branch Cypht 1.4.x requires PHP 5.6: |
@TheDigitalOrchard please address conflicts. |
Cypht 1.4.0 was released in July 2023. We will release Cypht 2.0 any day now. It will be one of the largest releases in Cypht's history, with numerous changes and enhancements. Most are incremental (just adding an optional feature) but some are disruptive (like moving to Bootstrap 5, revamp of account creation, etc.) which is why it's Cypht 2.0 and not 1.5.0. Furthermore, many of these changes were contributed by developers that are new to the project. A lot of big changes + new developers = I expect a lot of bugs. We have many developers active, and things will stabilize nicely in Cypht 2.1, 2.2, etc. The process is that each bug will be fixed in master, and then backported to the 2.x branch. Backporting becomes more difficult as 2.x and master diverge. This cleanup PR affects a lot of files. It would be really good to get this in before 2.0. If not, we should at least backport to the 2.x branch when the time comes. |
@kroky Are these conflicts still present? I'm a bit lost here. Not seeing them and everything is pushed. But I can't see how to mark them as resolved here. What am I missing? |
@kroky Figured it out. Forgot to sync and pull the master branch. Once I did that, I saw the conflicts and resolved them. |
Thanks for the details @marclaporte. On that note, I'm not seeing a |
Yes. @kroky will create the branch soon, along with a release of 2.0 alpha. https://github.com/cypht-org/cypht/wiki/Lifecycle |
@TheDigitalOrchard I don't see any conflicts. We can merge but we should resolve first the conversation about libsodium... |
Yes, re-reading the original Will push a fix. That may involve reverting to the original code. |
…ments intead of three separate `if` statements
Original libsodium logic check restored, but the only change being correct |
@TheDigitalOrchard looks good, thanks! |
@TheDigitalOrchard please see: #999 |
Pullrequest
No functional changes. Code cleanup, whitespace; short-array syntax; single quotes; closer adherence to PSR-12 syntax guidelines.
Now, I understand there may be some clashing with personal preferences, such as how "else" begins on the next line, but I did see some of the newer files already adhering to PSR-12, so figured this was a safe change to make.
(Sidenote, Packagist.org still says this library is compatible back to PHP 5, but that doesn't appear to be true anymore.)
Issues
Checklist
How2Test
Todo