WordPress / block-development-examples

Practical examples for building WordPress blocks and extending the Editor.
https://wordpress.github.io/block-development-examples/
GNU General Public License v2.0
205 stars 31 forks source link

new interactivity-api-quiz-1835f example #77

Closed juanmaguitar closed 10 months ago

juanmaguitar commented 10 months ago

This is a draft for a new Interactivity API example based on https://github.com/SantosGuillamot/interactivity-api-examples/tree/trunk/src/blocks/quiz and updated to the latest API available from GB 17.2

juanmaguitar commented 10 months ago

@ryanwelcher There are a lot of PHP CodeSniffer errors that I have ignored temporarily to be able to open this draft PR but that we should fix. I'm getting the following message along with all the PHP errors and warnings

PHPCBF CAN FIX THE 34 MARKED SNIFF VIOLATIONS AUTOMATICALLY

but I get the following when I try to use phpcbf with a .php file

⬢  interactivity-api-countdown-3cd73e  interactivity-api-countdown-getters ⦿ phpcbf interactivity-api-countdown-3cd73e.php
ERROR: Referenced sniff "WordPress" does not exist

Run "phpcbf --help" for usage information

Shouldn't this "WordPress" sniff gets installed when doing composer install from the root of the project? I also had to install phpcbf using brew install php-code-sniffer. shouldn't this also get installed with composer install ?

Some extra instructions at Coding Standards (or links to pages with these instructions) about how to install these tools and how to use them would be useful

ryanwelcher commented 10 months ago

@juanmaguitar I'll take a look and see if I can reproduce.

ryanwelcher commented 10 months ago

@juanmaguitar I have addressed the linting errors in this PR and added some commands to making checking/fixing PHP errors easier.