Have you ever been afraid of your own code? Afraid to review it? Afraid to present it to clients or management? Afraid to explain it because, unwittingly, you have created a digital Jekyll and Hyde?
That used to be me once upon a time until I took testing more seriously.
Let's be honest, testing doesn't quite have the allure of writing production code, and it isn't as glamorous as writing complex data structures and algorithms. Are you excited to write a test case for code that you “know” works?
While this doesn't make testing any less important, it has resulted in testing often being seen as an afterthought by so many; including managers, other developers-even me!
In addition, testing didn't help me allay my fears because, somehow, all the nasty bugs were never exposed by my test cases. Okay, it didn't help that I never went back and updated …
Once upon a time (long before the mouse was invented), the only way to talk to a computer was via command line commands. A user would type a preset command and the computer would execute the associated instruction(s) and respond to the user by displaying some text.
Of course, it was not without its disadvantages especially for users who weren't very comfortable with computers. This and other innovations that followed in the early computing days gave rise to the Graphical User Interface which has made interaction with computers more intuitive and inclusive.
The Command Line Interface (CLI) has, however, not lost its relevance. With less pressure on CPU resources, the CLI presents a powerful medium for executing tasks without hassle.
We will see this first hand in this article as we'll use the Symfony CLI to scaffold (rapidly reducing development time by automatically generating needed files and application configuration) and …
The username and password are dead! Well, not really. But considering the times we live in, it’s dangerous to rely on them alone. Computers are getting faster and better at guessing our passwords. And there are numerous databases containing stolen passwords roaming the web. Consequently, you also need to use Two-factor Authentication (2FA) in order to keep your account safe.
- A basic working understanding of PHP and Symfony
- PHP 7.4
- A Twilio account
- The Authy app
- The Symfony CLI
Let's get started
To get started, create a new Symfony project, named
2-fa-demo, and switch to the newly created project’s directory using the commands below.
symfony new 2-fa-demo cd 2-fa-demo
Next, you need to install …