- Details
I have just answered a question on Stackoverflow: 3rd party dependency conflict in developing Wordpress Plugin
The issue found by the developer is related to a PHP error:
Fatal error: Cannot redeclare GuzzleHttp\uri_template() (previously declared in /nas/content/staging/project/wp-content/plugins/my-plugin/vendor/guzzlehttp/guzzle/src/functions.php:17) in /nas/content/staging/project/wp-content/plugins/other-plugin/includes/lib/aws-sdk/GuzzleHttp/functions.php on line 31
To save the answer for future reference:
- Details
In software engineering, SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible, and maintainable. The principles are a subset of many principles promoted by American software engineer and instructor Robert C. Martin, first introduced in his 2000 paper Design Principles and Design Patterns.
The SOLID concepts are:
- Details
Long time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.
Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
- Details
Object Calisthenics are programming exercises, formalized as a set of 9 rules invented by Jeff Bay in his book The ThoughtWorks Anthology. The word Object is related to Object-Oriented Programming. The word Calisthenics is derived from greek, and means exercises under the context of gymnastics. By trying to follow these rules as much as possible, you will naturally change how you write code. It doesn’t mean you have to follow all these rules, all the time. Find your balance with these rules, use some of them only if you feel comfortable with them.
Only One Level Of Indentation Per Method Don’t Use The ELSE Keyword Wrap All Primitives And Strings First Class Collections One Dot Per Line Don’t Abbreviate Keep All Entities Small No Classes With More Than Two Instance Variables No Getters/ Setters/ Properties
Ref:
- Details
Xdebug is an extension for PHP to assist with debugging and development. It works based on the DBGP protocol. The magic of the debugging starts when the PHP development IDE (in my case VSCode) calls the Xdebug service, and it calls back to the client establishing the two-way channel. In most cases, the configuration between the IDE and Xdebug is solved with a few tweaks of both components. I have contributed to maintaining this page with the instructions to configure Visual Studio Code for Joomla and integrate it with Xdebug: Visual Studio Code. Besides all these notes, there is always one more twist. This week, on Wednesday afternoon, all the sudden Xdebug stopped working, and none of the usual suspects was the cause. If you face a similar issue, these are my notes about the process to find out why the IDE and Xdebug stopped working.
The Xdebug boot process is clearly shown in this graph:
Aníbal Sánchez
Versatile Software Engineer | Full-Stack Developer (PHP, Laravel, Java, Spring, Vue.js/Vite) | Data Science Enthusiast | Open Source Contributor | Tech Entrepreneur
- PHP-Prefixer / Product Manager
- PHP-Prefixer is an automated online service powered by a complex rule-based system that applies prefixes to Composer dependencies.
- Extly Tech / Team Leader
- Empower your project with our web solutions. Today, working on Laravel, Amazon AWS, and Ionic. A Joomla Volunteer.
- linkedin.com/in/anibalsanchez
- github.com/anibalsanchez
- @anibal_sanchez
- facebook/anibal.sanchez
- stackexchange/anibal