Restructure src/ and tests/ from package-by-type to package-by-domain
All checks were successful
CI / Coding Standards (push) Successful in 43s
CI / PHPStan (push) Successful in 52s
CI / Tests (PHP 8.1) (push) Successful in 47s
CI / Tests (PHP 8.2) (push) Successful in 49s
CI / Tests (PHP 8.3) (push) Successful in 37s
CI / No Debug Code (push) Successful in 2s

All classes are now organised by domain (Availability, Booking, Auth).
Each domain package contains its value object, repository, admin controller,
REST endpoint, and any shortcode pages under a matching sub-namespace.
Cross-cutting wiring (Plugin, AdminMenu, RestRegistrar, ShortcodeRegistrar,
Schema) lives at src/ root. Tests mirror the domain structure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 16:37:30 -03:00
parent ed49924f95
commit 2fb2ca392d
26 changed files with 108 additions and 83 deletions

View File

@@ -1,11 +1,13 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Admin;
namespace Unsupervised\Schedular;
use Unsupervised\Schedular\Data\AvailabilityRepository;
use Unsupervised\Schedular\Data\BookingRepository;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Availability\AvailabilityController;
use Unsupervised\Schedular\Availability\AvailabilityRepository;
use Unsupervised\Schedular\Auth\RoleManager;
use Unsupervised\Schedular\Booking\BookingRepository;
use Unsupervised\Schedular\Booking\LessonController;
class AdminMenu {

View File

@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Frontend;
namespace Unsupervised\Schedular\Auth;
class LoginPage {

View File

@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Roles;
namespace Unsupervised\Schedular\Auth;
class RoleManager {

View File

@@ -1,11 +1,9 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Admin;
namespace Unsupervised\Schedular\Availability;
use Unsupervised\Schedular\Data\AvailabilityRepository;
use Unsupervised\Schedular\Model\AvailabilitySlot;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Auth\RoleManager;
class AvailabilityController {

View File

@@ -1,11 +1,9 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Api;
namespace Unsupervised\Schedular\Availability;
use Unsupervised\Schedular\Data\AvailabilityRepository;
use Unsupervised\Schedular\Model\AvailabilitySlot;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Auth\RoleManager;
class AvailabilityEndpoint {

View File

@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Data;
use Unsupervised\Schedular\Model\AvailabilitySlot;
namespace Unsupervised\Schedular\Availability;
class AvailabilityRepository {

View File

@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Model;
namespace Unsupervised\Schedular\Availability;
class AvailabilitySlot {

View File

@@ -1,12 +1,10 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Api;
namespace Unsupervised\Schedular\Booking;
use Unsupervised\Schedular\Data\AvailabilityRepository;
use Unsupervised\Schedular\Data\BookingRepository;
use Unsupervised\Schedular\Model\Lesson;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Availability\AvailabilityRepository;
use Unsupervised\Schedular\Auth\RoleManager;
class BookingEndpoint {

View File

@@ -1,9 +1,9 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Frontend;
namespace Unsupervised\Schedular\Booking;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Auth\RoleManager;
class BookingPage {

View File

@@ -1,9 +1,7 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Data;
use Unsupervised\Schedular\Model\Lesson;
namespace Unsupervised\Schedular\Booking;
class BookingRepository {

View File

@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Model;
namespace Unsupervised\Schedular\Booking;
class Lesson {

View File

@@ -1,10 +1,9 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Admin;
namespace Unsupervised\Schedular\Booking;
use Unsupervised\Schedular\Data\BookingRepository;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Auth\RoleManager;
class LessonController {

View File

@@ -3,8 +3,7 @@ declare(strict_types=1);
namespace Unsupervised\Schedular;
use Unsupervised\Schedular\Data\Schema;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Auth\RoleManager;
class Installer {

View File

@@ -3,12 +3,9 @@ declare(strict_types=1);
namespace Unsupervised\Schedular;
use Unsupervised\Schedular\Admin\AdminMenu;
use Unsupervised\Schedular\Api\RestRegistrar;
use Unsupervised\Schedular\Data\AvailabilityRepository;
use Unsupervised\Schedular\Data\BookingRepository;
use Unsupervised\Schedular\Frontend\ShortcodeRegistrar;
use Unsupervised\Schedular\Roles\RoleManager;
use Unsupervised\Schedular\Auth\RoleManager;
use Unsupervised\Schedular\Availability\AvailabilityRepository;
use Unsupervised\Schedular\Booking\BookingRepository;
class Plugin {

View File

@@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Api;
namespace Unsupervised\Schedular;
use Unsupervised\Schedular\Data\AvailabilityRepository;
use Unsupervised\Schedular\Data\BookingRepository;
use Unsupervised\Schedular\Availability\AvailabilityEndpoint;
use Unsupervised\Schedular\Availability\AvailabilityRepository;
use Unsupervised\Schedular\Booking\BookingEndpoint;
use Unsupervised\Schedular\Booking\BookingRepository;
class RestRegistrar {

View File

@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Data;
namespace Unsupervised\Schedular;
class Schema {

View File

@@ -1,7 +1,10 @@
<?php
declare(strict_types=1);
namespace Unsupervised\Schedular\Frontend;
namespace Unsupervised\Schedular;
use Unsupervised\Schedular\Auth\LoginPage;
use Unsupervised\Schedular\Booking\BookingPage;
class ShortcodeRegistrar {