2018 was a weird year. It felt like it just zoomed by and nothing eventful happened. In fact, I feel like most people I have talked to this year felt the same exact way. But, then I sat down to my end of year write up and realized that this year was way more packed than I thought.
PhpStorm protected branches featureWednesday 12, December 2018mglaman
Recently, while working on a little project, I decided to clean up some of the commits on the master branch before pushing it to Packagist. To be lazy, I decided to use PhpStorm's interactive rebase tool instead of the good ole command line.
BUT I COULD NOT! And I started to go mad.
OK PhpStorm, what methods does my entity have?Wednesday 10, October 2018mglaman
Working in object-oriented programming is great. You can define interfaces which specify a contract that implementers need to fulfill. You can then extend these to define your end requirement and provide the implementation. This also means you can guarantee an object that implements that interface will have a guaranteed set of known methods. In Drupal, all entities implement EntityInterface, this is how we know that an entity can return its identifier, label, language, and other common methods.
When I work, I try to follow the principles of Test-Driven Development. I have found it to aid me in writing cleaner code, identifying odd coupling of components or crazy accidental dependencies between components. It also lets me write my API first by using mocks against interfaces I have defined. PhpStorm's auto-test functionality speeds up my test-driven development process.