From 8484735453bc6cbce7e6de6fa3bc0c8d384043d2 Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 7 Jan 2025 16:10:27 -0600 Subject: [PATCH 1/4] refactor: mv custom/lib src --- {custom/lib => src}/Auth.php | 0 {custom/lib => src}/CreateUserArgs.php | 0 {custom/lib => src}/MagicLinkArgsBase.php | 0 {custom/lib => src}/MagicLinkOptions.php | 0 {custom/lib => src}/MagicLinkWithEmailArgs.php | 0 {custom/lib => src}/MagicLinkWithPhoneArgs.php | 0 {custom/lib => src}/MagicLinkWithUserArgs.php | 0 {custom/lib => src}/Passage.php | 0 {custom/lib => src}/PassageError.php | 0 {custom/lib => src}/PassageUser.php | 0 {custom/lib => src}/UpdateUserArgs.php | 0 {custom/lib => src}/User.php | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename {custom/lib => src}/Auth.php (100%) rename {custom/lib => src}/CreateUserArgs.php (100%) rename {custom/lib => src}/MagicLinkArgsBase.php (100%) rename {custom/lib => src}/MagicLinkOptions.php (100%) rename {custom/lib => src}/MagicLinkWithEmailArgs.php (100%) rename {custom/lib => src}/MagicLinkWithPhoneArgs.php (100%) rename {custom/lib => src}/MagicLinkWithUserArgs.php (100%) rename {custom/lib => src}/Passage.php (100%) rename {custom/lib => src}/PassageError.php (100%) rename {custom/lib => src}/PassageUser.php (100%) rename {custom/lib => src}/UpdateUserArgs.php (100%) rename {custom/lib => src}/User.php (100%) diff --git a/custom/lib/Auth.php b/src/Auth.php similarity index 100% rename from custom/lib/Auth.php rename to src/Auth.php diff --git a/custom/lib/CreateUserArgs.php b/src/CreateUserArgs.php similarity index 100% rename from custom/lib/CreateUserArgs.php rename to src/CreateUserArgs.php diff --git a/custom/lib/MagicLinkArgsBase.php b/src/MagicLinkArgsBase.php similarity index 100% rename from custom/lib/MagicLinkArgsBase.php rename to src/MagicLinkArgsBase.php diff --git a/custom/lib/MagicLinkOptions.php b/src/MagicLinkOptions.php similarity index 100% rename from custom/lib/MagicLinkOptions.php rename to src/MagicLinkOptions.php diff --git a/custom/lib/MagicLinkWithEmailArgs.php b/src/MagicLinkWithEmailArgs.php similarity index 100% rename from custom/lib/MagicLinkWithEmailArgs.php rename to src/MagicLinkWithEmailArgs.php diff --git a/custom/lib/MagicLinkWithPhoneArgs.php b/src/MagicLinkWithPhoneArgs.php similarity index 100% rename from custom/lib/MagicLinkWithPhoneArgs.php rename to src/MagicLinkWithPhoneArgs.php diff --git a/custom/lib/MagicLinkWithUserArgs.php b/src/MagicLinkWithUserArgs.php similarity index 100% rename from custom/lib/MagicLinkWithUserArgs.php rename to src/MagicLinkWithUserArgs.php diff --git a/custom/lib/Passage.php b/src/Passage.php similarity index 100% rename from custom/lib/Passage.php rename to src/Passage.php diff --git a/custom/lib/PassageError.php b/src/PassageError.php similarity index 100% rename from custom/lib/PassageError.php rename to src/PassageError.php diff --git a/custom/lib/PassageUser.php b/src/PassageUser.php similarity index 100% rename from custom/lib/PassageUser.php rename to src/PassageUser.php diff --git a/custom/lib/UpdateUserArgs.php b/src/UpdateUserArgs.php similarity index 100% rename from custom/lib/UpdateUserArgs.php rename to src/UpdateUserArgs.php diff --git a/custom/lib/User.php b/src/User.php similarity index 100% rename from custom/lib/User.php rename to src/User.php From ec487a5eb5a57ac850e045f8bfba353f53b003b4 Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 7 Jan 2025 16:10:44 -0600 Subject: [PATCH 2/4] refactor: mv custom/test tests --- {custom/test => tests}/AuthTest.php | 4 ++-- {custom/test => tests}/PassageErrorTest.php | 0 {custom/test => tests}/PassageTest.php | 0 {custom/test => tests}/UserTest.php | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename {custom/test => tests}/AuthTest.php (89%) rename {custom/test => tests}/PassageErrorTest.php (100%) rename {custom/test => tests}/PassageTest.php (100%) rename {custom/test => tests}/UserTest.php (91%) diff --git a/custom/test/AuthTest.php b/tests/AuthTest.php similarity index 89% rename from custom/test/AuthTest.php rename to tests/AuthTest.php index c7a7c83..ec315e6 100644 --- a/custom/test/AuthTest.php +++ b/tests/AuthTest.php @@ -19,8 +19,8 @@ public function setUp(): void { parent::setUp(); - include __DIR__ . '/../../vendor/autoload.php'; - Dotenv::createUnsafeImmutable(__DIR__ . '/../../')->safeLoad(); + include __DIR__ . '/../vendor/autoload.php'; + Dotenv::createUnsafeImmutable(__DIR__ . '/..')->safeLoad(); $this->appId = getenv('APP_ID'); $this->apiKey = getenv('API_KEY'); diff --git a/custom/test/PassageErrorTest.php b/tests/PassageErrorTest.php similarity index 100% rename from custom/test/PassageErrorTest.php rename to tests/PassageErrorTest.php diff --git a/custom/test/PassageTest.php b/tests/PassageTest.php similarity index 100% rename from custom/test/PassageTest.php rename to tests/PassageTest.php diff --git a/custom/test/UserTest.php b/tests/UserTest.php similarity index 91% rename from custom/test/UserTest.php rename to tests/UserTest.php index 3a3975f..95c44bc 100644 --- a/custom/test/UserTest.php +++ b/tests/UserTest.php @@ -20,8 +20,8 @@ public function setUp(): void { parent::setUp(); - include __DIR__ . '/../../vendor/autoload.php'; - Dotenv::createUnsafeImmutable(__DIR__ . '/../../')->safeLoad(); + include __DIR__ . '/../vendor/autoload.php'; + Dotenv::createUnsafeImmutable(__DIR__ . '/..')->safeLoad(); $this->appId = getenv('APP_ID'); $this->apiKey = getenv('API_KEY'); From ed400efc7236d3ba4721ca476f84f7a58e771e5f Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 7 Jan 2025 16:11:00 -0600 Subject: [PATCH 3/4] chore: update autoload and script dirs --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index e3b2933..637dea5 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,8 @@ } ], "scripts": { - "lint": "./vendor/bin/phpcs --standard=PSR12 --report=full custom", - "phpcs-fix": "./vendor/bin/phpcbf --standard=PSR12 custom", + "lint": "./vendor/bin/phpcs --standard=PSR12 --report=full src", + "phpcs-fix": "./vendor/bin/phpcbf --standard=PSR12 src", "format": "./vendor/bin/php-cs-fixer fix --allow-risky=yes --rules=@PSR12" }, "require": { @@ -53,12 +53,12 @@ "OpenAPI\\Client\\": [ "generated/lib/" ], - "Passage\\Client\\": "custom/lib/" + "Passage\\Client\\": "src/" } }, "autoload-dev": { "psr-4": { - "Passage\\Client\\Test\\": "custom/test/" + "Passage\\Client\\Test\\": "tests/" } } } From e54af75c65b4a4b61dc394500f146ef5ba8847f5 Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 7 Jan 2025 16:19:44 -0600 Subject: [PATCH 4/4] ci: update dirs in on-pull-request workflow --- .github/workflows/on-pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index c3ce9c1..c1fb68b 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -22,7 +22,7 @@ jobs: php-version: '8.1' tools: phpcs, cs2pr - name: Lint - run: phpcs -q --standard=PSR12 --report=checkstyle custom | cs2pr + run: phpcs -q --standard=PSR12 --report=checkstyle src | cs2pr format: name: Format runs-on: ubuntu-latest @@ -45,4 +45,4 @@ jobs: - name: Install dependencies run: composer install - name: Test - run: ./vendor/bin/phpunit custom/test/ \ No newline at end of file + run: ./vendor/bin/phpunit tests/ \ No newline at end of file