Documentation update for development part

This commit is contained in:
2026-01-13 18:41:21 +09:00
parent aeb84dcb60
commit 59d4612a0a
4 changed files with 88 additions and 67 deletions

View File

@@ -26,74 +26,77 @@
// use Phan\Config; // use Phan\Config;
return [ return [
"minimum_target_php_version" => "7.4", // turn color on (-C)
// If true, missing properties will be created when "color_issue_messages_if_supported" => true,
// they are first seen. If false, we'll report an // set minimum version
// error message. "minimum_target_php_version" => "7.4",
"allow_missing_properties" => false, // 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 // Allow null to be cast as any type and for any
// type to be cast to null. // type to be cast to null.
"null_casts_as_any_type" => false, "null_casts_as_any_type" => false,
// Backwards Compatibility Checking // Backwards Compatibility Checking
'backward_compatibility_checks' => true, 'backward_compatibility_checks' => true,
// Run a quick version of checks that takes less // Run a quick version of checks that takes less
// time // time
"quick_mode" => false, "quick_mode" => false,
// Only emit critical issues to start with // Only emit critical issues to start with
// (0 is low severity, 5 is normal severity, 10 is critical) // (0 is low severity, 5 is normal severity, 10 is critical)
"minimum_severity" => 10, "minimum_severity" => 10,
// default false for include path check // default false for include path check
"enable_include_path_checks" => true, "enable_include_path_checks" => true,
"include_paths" => [ "include_paths" => [
], ],
'ignore_undeclared_variables_in_global_scope' => true, 'ignore_undeclared_variables_in_global_scope' => true,
"file_list" => [ "file_list" => [
], ],
// A list of directories that should be parsed for class and // A list of directories that should be parsed for class and
// method information. After excluding the directories // method information. After excluding the directories
// defined in exclude_analysis_directory_list, the remaining // defined in exclude_analysis_directory_list, the remaining
// files will be statically analyzed for errors. // files will be statically analyzed for errors.
// //
// Thus, both first-party and third-party code being used by // Thus, both first-party and third-party code being used by
// your application should be included in this list. // your application should be included in this list.
'directory_list' => [ 'directory_list' => [
// Change this to include the folders you wish to analyze // Change this to include the folders you wish to analyze
// (and the folders of their dependencies) // (and the folders of their dependencies)
'src/' 'src/'
// 'www', // 'www',
// To speed up analysis, we recommend going back later and // To speed up analysis, we recommend going back later and
// limiting this to only the vendor/ subdirectories your // limiting this to only the vendor/ subdirectories your
// project depends on. // project depends on.
// `phan --init` will generate a list of folders for you // `phan --init` will generate a list of folders for you
//'www/vendor', //'www/vendor',
], ],
// A list of directories holding code that we want // A list of directories holding code that we want
// to parse, but not analyze // to parse, but not analyze
"exclude_analysis_directory_list" => [ "exclude_analysis_directory_list" => [
'vendor', 'vendor',
'test', 'test',
], ],
'exclude_file_list' => [ 'exclude_file_list' => [
], ],
// what not to show as problem // what not to show as problem
'suppress_issue_types' => [ 'suppress_issue_types' => [
// 'PhanUndeclaredMethod', // 'PhanUndeclaredMethod',
'PhanEmptyFile', 'PhanEmptyFile',
], ],
// Override to hardcode existence and types of (non-builtin) globals in the global scope. // Override to hardcode existence and types of (non-builtin) globals in the global scope.
// Class names should be prefixed with `\`. // Class names should be prefixed with `\`.
// //
// (E.g. `['_FOO' => '\FooClass', 'page' => '\PageClass', 'userId' => 'int']`) // (E.g. `['_FOO' => '\FooClass', 'page' => '\PageClass', 'userId' => 'int']`)
'globals_type_map' => [], 'globals_type_map' => [],
]; ];

View File

@@ -155,16 +155,37 @@ On exception the log data is in the error message json (see exceptions)
## Development ## 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 ### Phan
`vendor/bin/phan --analyze-twice` `vendor/bin/phan --analyze-twice` or `tools/phan --analyze-twice`
### PHPstan ### 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 ### PHPUnit
Unit tests have to be run from base folder with Unit tests have to be run from base folder with
`vendor/bin/phpunit test/phpUnitTests/` `vendor/bin/phpunit` or `tools/phpunit`

View File

@@ -1,9 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<phpunit colors="true" cacheDirectory=".phpunit.cache"> <phpunit colors="true" cacheDirectory=".phpunit.cache" bootstrap="vendor/autoload.php" >
<!-- Below removes final from classes for mock tests --> <!-- Below removes final from classes for mock tests -->
<!-- <extensions>
<extension class="test\phpUnit\Extension\BypassFinalExtension" file="test/phpUnit/Extension/BypassFinalExtension.php" />
</extensions> -->
<extensions> <extensions>
<bootstrap class="DG\BypassFinals\PHPUnitExtension"/> <bootstrap class="DG\BypassFinals\PHPUnitExtension"/>
</extensions> </extensions>

View File

@@ -19,7 +19,7 @@ class Client implements ClientInterface
* *
* @param string $url The URL being requested, * @param string $url The URL being requested,
* including domain and protocol * including domain and protocol
* @param array<int,string> $headers Headers to be used in the request * @param array<int,string> $headers Headers to be used in the request
* @param array<mixed>|string $params Can be nested for arrays and hashes * @param array<mixed>|string $params Can be nested for arrays and hashes
* @return string Result as json string * @return string Result as json string
*/ */