O'Reilly logo

PhpStorm Cookbook by Ankur Kumar, Mukund Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a new PHP method

If classes that represent real-world entities are nouns, they do not have any existence without verbs—the actions to be performed. To be able to maximize the technical profit for the manager you work for, you must be ready to use functions for all the verbs that exist in your use case.

Getting ready

Say for example, you have a pizza cooking task at hand. The recipe would consist of a (bare minimum) pizza bread (a noun), cheese (a noun), some salt (a noun). If you ponder over your problem, you will realize that you need to apply cheese to your pizza bread and add salt according to taste. If you look at this scenario from a technical perspective, you would most probably decide that there would be a PizzaDish class with functions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required