In Part 4 of the Data Store Project series, you’ll build the API for each implementation of the data store. The API will hide away the implementation, allowing you to switch implementations without having to change the code that uses the API. What You’ll Be Doing x What You Will Learn x Prerequisites See the list of prerequisites and suggestions on the series landing page.
Labs
Labs are hands-on coding projects that you build along with Tonya as she explains the code, concepts, and thought processes behind it. You can use the labs to further your code knowledge or to use right in your projects. Each lab ties into the Docx to ensure you have the information you need.
Each lab is designed to further your understanding and mastery of code. You learn more about how to think about its construction, quality, maintainability, programmatic and logical thought, and problem-solving. While you may be building a specific thing, Tonya presents the why of it to make it adaptable far beyond that specific implementation, thereby giving you the means to make it your own, in any context.
Build Tests Scaffolding
Build Test for Get Item
Build the Get Item Scaffolding
Push to GitHub, PR, Merge, & Sync
We’re done with both requirements documents. It’s time to push the branch to GitHub. In this episode, you’ll: Push the branch to GitHub Create a Pull Request (PR) Change the master repo to your GitHub account instead of the original on Know the Code Walk through the PR GUI Merge it into the master branch Delete the requirements branch Pull the updated master branch down to your machine to sync you up with GitHub
Document the API Basics
Let’s create a new requirements document for the Data Store’s API. Then we work together to layout how we are going to build it.
Planning Introduction
You’ll be introduced to the lab and what you’ll be doing in it. You’ll learn that the best practice in development and engineering is to first planning out what you are going to build before you start coding.
Walk Through the Plugin’s Code
Everything is installed on your local machine. Let’s walk through the plugin’s code together. You’ll also commit the updated composer.lockfile and fix the root namespace too. Then you’ll push those changes to your repo on GitHub.
Run and Review WPCS
Let’s walk through the PHPCS and WPCS code sniffers and then run them.
Setup Local by Flywheel’s Server
If you are using Local by Flywheel, you need to install and setup PHPUnit before you can get to work. SSH into your project’s server Download this script Then you’ll follow the instructions to finish the installation and setup.