Book description
Utilize the power of modular programming to improve code readability, maintainability, and testability
About This Book
- This book demonstrates code reusability and distributed development to get high speed, maintainable, and fast applications
- It illustrates the development of a complete modular application developed using PHP7 in detail
- This book provides a high-level overview of the Symfony framework, a set of tools and a development methodology that are needed to build a modular web shop application
Who This Book Is For
This step-by-step guide is divided into two sections. The first section explores all the fundamentals of modular design technique with respect to PHP 7. The latter section demonstrates the practical development of individual modules of a web shop application.
What You Will Learn
- Discover the new features of PHP 7 that are relevant to modular application development
- Write manageable code based on the GoF design patterns and SOLID principles
- Define the application requirements of a working modular application
- Explore the ins and outs of the Symfony framework
- Build a set of modules based on the Symfony framework that comprise a simple web shop app
- Use core modules to set the structure and dependencies for other modules to use
- Set up entities that are relevant to the module functionality and see how to manage these entities
In Detail
Modular design techniques help you build readable, manageable, reusable, and more efficient codes. PHP 7, which is a popular open source scripting language, is used to build modular functions for your software. With this book, you will gain a deep insight into the modular programming paradigm and how to achieve modularity in your PHP code.
We start with a brief introduction to the new features of PHP 7, some of which open a door to new concepts used in modular development. With design patterns being at the heart of all modular PHP code, you will learn about the GoF design patterns and how to apply them. You will see how to write code that is easy to maintain and extend over time with the help of the SOLID design principles.
Throughout the rest of the book, you will build different working modules of a modern web shop application using the Symfony framework, which will give you a deep understanding of modular application development using PHP 7.
Style and approach
This book is for intermediate-level PHP developers with little to no knowledge of modular programming who want to understand design patterns and principles in order to better utilize the existing frameworks for modular application development.
Table of contents
-
Modular Programming with PHP 7
- Table of Contents
- Modular Programming with PHP 7
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Preface
-
1. Ecosystem Overview
-
Getting ready for PHP 7
- Scalar type hints
- Return type hints
- Anonymous classes
- The Closure::call() method
- Generator delegation
- Generator return expressions
- The null coalesce operator
- The Spaceship operator
- Throwables
- The \ParseError
- Level support for the dirname() function
- The integer division function
- Constant arrays
- Uniform variable syntax
- Secure random number generator
- Filtered unserialize()
- Context sensitive lexer
- Group use declarations
- Unicode enhancements
- Assertions
- Changes to the list() construct
- Session options
- Deprecated features
- Frameworks
- Summary
-
Getting ready for PHP 7
- 2. GoF Design Patterns
- 3. SOLID Design Principles
- 4. Requirement Specification for a Modular Web Shop App
- 5. Symfony at a Glance
- 6. Building the Core Module
- 7. Building the Catalog Module
- 8. Building the Customer Module
- 9. Building the Payment Module
- 10. Building the Shipment Module
-
11. Building the Sales Module
- Requirements
- Dependencies
-
Implementation
- Creating a Cart entity
- Creating the cart item entity
- Creating an Order entity
- Creating a SalesOrderItem entity
- Overriding the add_to_cart_url service
- Overriding the checkout_menu service
- Overriding the customer orders service
- Overriding the bestsellers service
- Creating the Cart page
- Creating the Payment service
- Creating the Shipment service
- Creating the Checkout page
- Creating the order success page
- Creating a store manager dashboard
- Unit testing
- Functional testing
- Summary
- 12. Integrating and Distributing Modules
- Index
Product information
- Title: Modular Programming with PHP 7
- Author(s):
- Release date: September 2016
- Publisher(s): Packt Publishing
- ISBN: 9781786462954
You might also like
book
PHP 7 Programming Blueprints
Learn how to exploit the impressive power of PHP 7 with this collection of practical project …
book
PHP 7 Programming Cookbook
Over 80 recipes that will take your PHP 7 web development skills to the next level! …
book
Mastering PHP 7
Effective, readable, and robust codes in PHP Key Features [*] Leverage the newest tools available in …
book
PHP 7: Real World Application Development
Use new features of PHP 7 to solve practical, real-world problems faced by PHP developers like …