From 59d4612a0a45153c0ba56825dffa6640f12be2f1 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 13 Jan 2026 18:41:21 +0900 Subject: [PATCH] Documentation update for development part --- .phan/config.php | 121 ++++++++++++++++++++++-------------------- README.md | 27 ++++++++-- phpunit.xml | 5 +- src/Client/Client.php | 2 +- 4 files changed, 88 insertions(+), 67 deletions(-) diff --git a/.phan/config.php b/.phan/config.php index 9679218..f5aa264 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -26,74 +26,77 @@ // use Phan\Config; return [ - "minimum_target_php_version" => "7.4", - // If true, missing properties will be created when - // they are first seen. If false, we'll report an - // error message. - "allow_missing_properties" => false, + // turn color on (-C) + "color_issue_messages_if_supported" => true, + // set minimum version + "minimum_target_php_version" => "7.4", + // If true, missing properties will be created when + // they are first seen. If false, we'll report an + // error message. + "allow_missing_properties" => false, - // Allow null to be cast as any type and for any - // type to be cast to null. - "null_casts_as_any_type" => false, + // Allow null to be cast as any type and for any + // type to be cast to null. + "null_casts_as_any_type" => false, - // Backwards Compatibility Checking - 'backward_compatibility_checks' => true, + // Backwards Compatibility Checking + 'backward_compatibility_checks' => true, - // Run a quick version of checks that takes less - // time - "quick_mode" => false, + // Run a quick version of checks that takes less + // time + "quick_mode" => false, - // Only emit critical issues to start with - // (0 is low severity, 5 is normal severity, 10 is critical) - "minimum_severity" => 10, + // Only emit critical issues to start with + // (0 is low severity, 5 is normal severity, 10 is critical) + "minimum_severity" => 10, - // default false for include path check - "enable_include_path_checks" => true, - "include_paths" => [ - ], - 'ignore_undeclared_variables_in_global_scope' => true, + // default false for include path check + "enable_include_path_checks" => true, + "include_paths" => [ + ], + 'ignore_undeclared_variables_in_global_scope' => true, - "file_list" => [ - ], + "file_list" => [ + ], - // A list of directories that should be parsed for class and - // method information. After excluding the directories - // defined in exclude_analysis_directory_list, the remaining - // files will be statically analyzed for errors. - // - // Thus, both first-party and third-party code being used by - // your application should be included in this list. - 'directory_list' => [ - // Change this to include the folders you wish to analyze - // (and the folders of their dependencies) - 'src/' - // 'www', - // To speed up analysis, we recommend going back later and - // limiting this to only the vendor/ subdirectories your - // project depends on. - // `phan --init` will generate a list of folders for you - //'www/vendor', - ], + // A list of directories that should be parsed for class and + // method information. After excluding the directories + // defined in exclude_analysis_directory_list, the remaining + // files will be statically analyzed for errors. + // + // Thus, both first-party and third-party code being used by + // your application should be included in this list. + 'directory_list' => [ + // Change this to include the folders you wish to analyze + // (and the folders of their dependencies) + 'src/' + // 'www', + // To speed up analysis, we recommend going back later and + // limiting this to only the vendor/ subdirectories your + // project depends on. + // `phan --init` will generate a list of folders for you + //'www/vendor', + ], - // A list of directories holding code that we want - // to parse, but not analyze - "exclude_analysis_directory_list" => [ - 'vendor', - 'test', - ], - 'exclude_file_list' => [ - ], + // A list of directories holding code that we want + // to parse, but not analyze + "exclude_analysis_directory_list" => [ + 'vendor', + 'test', + ], + 'exclude_file_list' => [ + ], - // what not to show as problem - 'suppress_issue_types' => [ - // 'PhanUndeclaredMethod', - 'PhanEmptyFile', - ], + // what not to show as problem + 'suppress_issue_types' => [ + // 'PhanUndeclaredMethod', + 'PhanEmptyFile', + ], - // Override to hardcode existence and types of (non-builtin) globals in the global scope. - // Class names should be prefixed with `\`. - // - // (E.g. `['_FOO' => '\FooClass', 'page' => '\PageClass', 'userId' => 'int']`) - 'globals_type_map' => [], + // Override to hardcode existence and types of (non-builtin) globals in the global scope. + // Class names should be prefixed with `\`. + // + // (E.g. `['_FOO' => '\FooClass', 'page' => '\PageClass', 'userId' => 'int']`) + 'globals_type_map' => [], ]; diff --git a/README.md b/README.md index 48c55c7..ff11154 100644 --- a/README.md +++ b/README.md @@ -155,16 +155,37 @@ On exception the log data is in the error message json (see exceptions) ## Development +Run `composer install` or `phive install` to setup the tools + +phpcs config is stored in `phpcs.xml` and should be picked up by the standard tools + +* we use tabs instead of spaces for indents, the rest is standard PSR1+PSR12 + +### Direct tests + +These direct run tests exist: + +* `tests/aws_read_env_tests.php`: Equal to running `tests/aws_gift_card_tests.php?info=true`, will output env test data +* `test/aws_gift_card_tests.php`: The following parameters exists + * info: set to print out info + * fund: set to run funds get tests + * gift: run all the gift card get/set/remove tests + * mocks: run the error checks + * debug: print out debug information + * debug_mock: print out all the debug logs too + ### Phan -`vendor/bin/phan --analyze-twice` +`vendor/bin/phan --analyze-twice` or `tools/phan --analyze-twice` ### PHPstan -`vendor/bin/phpstan` +`vendor/bin/phpstan` or `tools/phpstan` + +> [!notice] Level 9 is set as we have various mixed values that cannot be easily changed into a direct value type ### PHPUnit Unit tests have to be run from base folder with -`vendor/bin/phpunit test/phpUnitTests/` +`vendor/bin/phpunit` or `tools/phpunit` diff --git a/phpunit.xml b/phpunit.xml index e6ce2d1..cd2e13c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,9 +1,6 @@ - + - diff --git a/src/Client/Client.php b/src/Client/Client.php index faaa8ef..7aee74d 100644 --- a/src/Client/Client.php +++ b/src/Client/Client.php @@ -19,7 +19,7 @@ class Client implements ClientInterface * * @param string $url The URL being requested, * including domain and protocol - * @param array $headers Headers to be used in the request + * @param array $headers Headers to be used in the request * @param array|string $params Can be nested for arrays and hashes * @return string Result as json string */