Fix all PHPCS coding standards violations
CI / Coding Standards (push) Successful in 44s
CI / PHPStan (push) Successful in 49s
CI / Tests (PHP 8.1) (push) Successful in 54s
CI / Tests (PHP 8.2) (push) Successful in 51s
CI / Tests (PHP 8.3) (push) Successful in 39s
CI / No Debug Code (push) Successful in 3s

- Add phpcs.xml.dist: excludes PSR-4 file naming, camelCase naming,
  short array syntax, and redundant per-method/property docblocks
- Fix wp_unslash() on all $_POST reads (LoginPage, AvailabilityController)
- Add phpcs:ignore for password field (must not be sanitized)
- Fix Yoda conditions throughout (AvailabilityRepository, AvailabilityEndpoint,
  BookingEndpoint, AvailabilityController)
- Fix inline comments to end with full stops (AdminMenu)
- Replace short ternary ?: with explicit full ternary (BookingEndpoint)
- Rename $namespace param to $route_namespace (reserved keyword warning)
- Add short descriptions to doc blocks that had tag-only blocks
- Add nonce suppression comment in handleFormAction (nonce verified by caller)
- Update composer.json and CI to use phpcs.xml.dist

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 16:20:49 -03:00
parent e24c3ce850
commit ed49924f95
24 changed files with 857 additions and 715 deletions
+12 -13
View File
@@ -10,19 +10,18 @@ use Unsupervised\Schedular\Data\BookingRepository;
use Unsupervised\Schedular\Frontend\ShortcodeRegistrar;
use Unsupervised\Schedular\Roles\RoleManager;
class Plugin
{
public static function boot(): void
{
load_plugin_textdomain('unsupervised-schedular', false, dirname(plugin_basename(USC_PLUGIN_FILE)) . '/languages');
class Plugin {
global $wpdb;
$availability = new AvailabilityRepository($wpdb);
$bookings = new BookingRepository($wpdb);
public static function boot(): void {
load_plugin_textdomain( 'unsupervised-schedular', false, dirname( plugin_basename( USC_PLUGIN_FILE ) ) . '/languages' );
(new RoleManager())->register();
(new AdminMenu($availability, $bookings))->register();
(new RestRegistrar($availability, $bookings))->register();
(new ShortcodeRegistrar())->register();
}
global $wpdb;
$availability = new AvailabilityRepository( $wpdb );
$bookings = new BookingRepository( $wpdb );
( new RoleManager() )->register();
( new AdminMenu( $availability, $bookings ) )->register();
( new RestRegistrar( $availability, $bookings ) )->register();
( new ShortcodeRegistrar() )->register();
}
}