diff --git a/.github/workflows/fix-style.yml b/.github/workflows/fix-style.yml index 3d6d1e1..4390be4 100644 --- a/.github/workflows/fix-style.yml +++ b/.github/workflows/fix-style.yml @@ -13,9 +13,9 @@ jobs: ref: ${{ github.head_ref }} - name: Run PHP CS Fixer - uses: docker://oskarstark/php-cs-fixer-ga:2.19.0 + uses: docker://oskarstark/php-cs-fixer-ga:3.1.0 with: - args: --config=.php_cs.dist --allow-risky=yes + args: --config=.php-cs-fixer.dist.php --allow-risky=yes - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..4a2e7db --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,12 @@ +name: Tests + +on: ["push"] + +jobs: + build-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2.3.4 + - uses: php-actions/composer@v5 + - uses: NWBY/pest-action@v1.2.0 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..7463d16 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,215 @@ + true, + 'array_indentation' => true, + 'array_push' => true, + 'backtick_to_shell_exec' => true, + 'binary_operator_spaces' => [ + 'default' => 'single_space', + 'operators' => [ + '=>' => 'align', + ], + ], + 'clean_namespace' => true, + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'combine_nested_dirname' => true, + 'comment_to_phpdoc' => true, + 'compact_nullable_typehint' => true, + 'dir_constant' => true, + 'doctrine_annotation_braces' => true, + 'doctrine_annotation_indentation' => true, + 'echo_tag_syntax' => [ + 'format' => 'short', + ], + 'ereg_to_preg' => true, + 'explicit_indirect_variable' => true, + 'explicit_string_variable' => true, + 'full_opening_tag' => true, + 'function_declaration' => true, + 'function_to_constant' => true, + 'function_typehint_space' => true, + 'heredoc_indentation' => true, + 'list_syntax' => true, + 'method_chaining_indentation' => true, + 'modernize_types_casting' => true, + 'multiline_comment_opening_closing' => true, + 'native_function_type_declaration_casing' => true, + 'no_break_comment' => true, + 'no_null_property_initialization' => true, + 'no_php4_constructor' => true, + 'no_superfluous_phpdoc_tags' => true, + 'no_unneeded_curly_braces' => true, + 'no_unneeded_final_method' => true, + 'no_unset_cast' => true, + 'no_unset_on_property' => true, + 'no_useless_else' => false, + 'no_useless_sprintf' => true, + 'non_printable_character' => true, + 'nullable_type_declaration_for_default_null_value' => true, + 'operator_linebreak' => true, + 'ordered_class_elements' => [ + 'order'=> [ + 'use_trait', + 'constant_public', + 'constant_protected', + 'constant_private', + 'property_public', + 'property_protected', + 'property_private', + 'construct', + 'destruct', + 'magic', + 'phpunit', + 'method', + ], + ], + 'ordered_interfaces' => true, + 'ordered_traits' => true, + 'php_unit_construct' => true, + 'php_unit_expectation' => true, + 'php_unit_fqcn_annotation' => true, + 'php_unit_method_casing' => ['case' => 'snake_case'], + 'phpdoc_add_missing_param_annotation' => true, + 'phpdoc_align' => true, + 'phpdoc_no_alias_tag' => true, + 'phpdoc_order' => true, + 'phpdoc_return_self_reference' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_tag_type' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types_order' => true, + 'phpdoc_var_annotation_correct_order' => true, + 'return_assignment' => true, + 'self_static_accessor' => true, + 'simple_to_complex_string_variable' => true, + 'simplified_if_return' => true, + 'simplified_null_return' => true, + 'single_space_after_construct' => true, + 'standardize_increment' => true, + 'ternary_to_null_coalescing' => true, + 'types_spaces' => true, + 'array_syntax' => ['syntax' => 'short'], + 'blank_line_after_namespace' => true, + 'blank_line_after_opening_tag' => true, + 'blank_line_before_statement' => ['statements' => ['return']], + 'braces' => true, + 'cast_spaces' => true, + 'class_attributes_separation' => true, + 'class_definition' => true, + 'concat_space' => ['spacing' => 'one'], + 'declare_equal_normalize' => true, + 'elseif' => true, + 'encoding' => true, + 'full_opening_tag' => true, + 'fully_qualified_strict_types' => true, // added by Shift + 'function_declaration' => true, + 'function_typehint_space' => true, + 'heredoc_to_nowdoc' => true, + 'include' => true, + 'increment_style' => ['style' => 'post'], + 'indentation_type' => true, + 'linebreak_after_opening_tag' => true, + 'line_ending' => true, + 'lowercase_cast' => true, + 'constant_case' => true, + 'lowercase_keywords' => true, + 'lowercase_static_reference' => true, // added from Symfony + 'magic_method_casing' => true, // added from Symfony + 'magic_constant_casing' => true, + 'method_argument_space' => true, + 'native_function_casing' => true, + 'no_alias_functions' => true, + 'no_extra_blank_lines' => ['tokens' => ['extra', 'throw', 'use', 'use_trait']], + 'no_blank_lines_after_class_opening' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_closing_tag' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_leading_import_slash' => true, + 'no_leading_namespace_whitespace' => true, + 'no_mixed_echo_print' => ['use' => 'echo'], + 'no_multiline_whitespace_around_double_arrow' => true, + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], + 'no_short_bool_cast' => true, + 'no_singleline_whitespace_before_semicolons' => true, + 'no_spaces_after_function_name' => true, + 'no_spaces_around_offset' => true, + 'no_spaces_inside_parenthesis' => true, + 'no_trailing_comma_in_list_call' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_trailing_whitespace' => true, + 'no_trailing_whitespace_in_comment' => true, + 'no_unused_imports' => true, + 'no_unneeded_control_parentheses' => true, + 'no_unreachable_default_argument_value' => true, + 'no_useless_return' => true, + 'no_whitespace_before_comma_in_array' => true, + 'no_whitespace_in_blank_line' => true, + 'normalize_index_brace' => true, + 'not_operator_with_successor_space' => true, + 'object_operator_without_whitespace' => true, + 'ordered_imports' => ['sort_algorithm' => 'alpha'], + 'phpdoc_indent' => true, + 'phpdoc_inline_tag_normalizer' => true, + 'phpdoc_no_access' => true, + 'phpdoc_no_package' => true, + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_scalar' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_summary' => true, + 'phpdoc_to_comment' => true, + 'phpdoc_trim' => true, + 'phpdoc_types' => true, + 'phpdoc_var_without_name' => true, + 'self_accessor' => true, + 'short_scalar_cast' => true, + 'simplified_null_return' => true, + 'single_blank_line_at_eof' => true, + 'single_blank_line_before_namespace' => true, + 'single_class_element_per_statement' => true, + 'single_import_per_statement' => true, + 'single_line_after_imports' => true, + 'single_line_comment_style' => ['comment_types' => ['hash']], + 'single_quote' => true, + 'space_after_semicolon' => true, + 'standardize_not_equals' => true, + 'switch_case_semicolon_to_colon' => true, + 'switch_case_space' => true, + 'ternary_operator_spaces' => true, + 'trailing_comma_in_multiline' => true, + 'trim_array_spaces' => true, + 'unary_operator_spaces' => true, + 'use_arrow_functions' => true, + 'visibility_required' => ['elements' => ['method', 'property']], + 'whitespace_after_comma_in_array' => true, + 'return_type_declaration' => ['space_before' => 'none'], + 'psr_autoloading' => true, +]; + +$finder = Symfony\Component\Finder\Finder::create() + ->notPath('vendor') + ->in([ + __DIR__ . '/src', + __DIR__ . '/tests', + __DIR__ . '/migrations', + __DIR__ . '/config', + ]) + ->name('*.php') + ->notName('*.blade.php') + ->notName('index.php') + ->notName('server.php') + ->notName('_ide_helper.php') + ->ignoreDotFiles(true) + ->ignoreVCS(true); + +$config = new PhpCsFixer\Config(); + +return $config + ->setRiskyAllowed(true) + ->setFinder($finder) + ->setRules($rules) + ->setUsingCache(false) + ->setCacheFile(__DIR__ . '.php_cs.cache'); diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index 58dbece..0000000 --- a/.php_cs.dist +++ /dev/null @@ -1,141 +0,0 @@ - ['syntax' => 'short'], - 'binary_operator_spaces' => [ - 'default' => 'single_space', - 'operators' => ['=>' => 'align'], - ], - 'blank_line_after_namespace' => true, - 'blank_line_after_opening_tag' => true, - 'blank_line_before_statement' => [ - 'statements' => ['return'], - ], - 'braces' => true, - 'cast_spaces' => true, - 'class_attributes_separation' => [ - 'elements' => ['method'], - ], - 'class_definition' => true, - 'concat_space' => [ - 'spacing' => 'one', // added by Isern - ], - 'declare_equal_normalize' => true, - 'elseif' => true, - 'encoding' => true, - 'full_opening_tag' => true, - 'fully_qualified_strict_types' => true, // added by Shift - 'function_declaration' => true, - 'function_typehint_space' => true, - 'heredoc_to_nowdoc' => true, - 'include' => true, - 'increment_style' => ['style' => 'post'], - 'indentation_type' => true, - 'linebreak_after_opening_tag' => true, - 'line_ending' => true, - 'lowercase_cast' => true, - 'lowercase_constants' => true, - 'lowercase_keywords' => true, - 'lowercase_static_reference' => true, // added from Symfony - 'magic_method_casing' => true, // added from Symfony - 'magic_constant_casing' => true, - 'method_argument_space' => true, - 'native_function_casing' => true, - 'no_alias_functions' => true, - 'no_extra_blank_lines' => [ - 'tokens' => [ - 'extra', - 'throw', - 'use', - 'use_trait', - ], - ], - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_closing_tag' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_mixed_echo_print' => [ - 'use' => 'echo', - ], - 'no_multiline_whitespace_around_double_arrow' => true, - 'multiline_whitespace_before_semicolons' => [ - 'strategy' => 'no_multi_line', - ], - 'no_short_bool_cast' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_spaces_after_function_name' => true, - 'no_spaces_around_offset' => true, - 'no_spaces_inside_parenthesis' => true, - 'no_trailing_comma_in_list_call' => true, - 'no_trailing_comma_in_singleline_array' => true, - 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => true, - 'no_unused_imports' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unreachable_default_argument_value' => true, - 'no_useless_return' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'normalize_index_brace' => true, - 'not_operator_with_successor_space' => true, - 'object_operator_without_whitespace' => true, - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], - 'phpdoc_indent' => true, - 'phpdoc_inline_tag' => true, - 'phpdoc_no_access' => true, - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_summary' => true, - 'phpdoc_to_comment' => true, - 'phpdoc_trim' => true, - 'phpdoc_types' => true, - 'phpdoc_var_without_name' => true, - 'psr4' => true, - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'simplified_null_return' => true, - 'single_blank_line_at_eof' => true, - 'single_blank_line_before_namespace' => true, - 'single_class_element_per_statement' => true, - 'single_import_per_statement' => true, - 'single_line_after_imports' => true, - 'single_line_comment_style' => [ - 'comment_types' => ['hash'], - ], - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'switch_case_semicolon_to_colon' => true, - 'switch_case_space' => true, - 'ternary_operator_spaces' => true, - 'trailing_comma_in_multiline_array' => true, - 'trim_array_spaces' => true, - 'unary_operator_spaces' => true, - 'visibility_required' => [ - 'elements' => ['method', 'property'], - ], - 'whitespace_after_comma_in_array' => true, -]; - -$finder = Symfony\Component\Finder\Finder::create() - ->notPath('vendor') - ->in([ - __DIR__ . '/src', - __DIR__ . '/tests', - __DIR__ . '/config', - ]) - ->name('*.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return PhpCsFixer\Config::create() - ->setFinder($finder) - ->setRules($rules) - ->setRiskyAllowed(true) - ->setUsingCache(true) - ->setCacheFile(__DIR__ . '.php_cs.cache'); diff --git a/composer.json b/composer.json index 997b64f..eb5e77a 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,11 @@ }, "autoload": { "psr-4": { - "Malico\\MeSomb\\": "src/", + "Malico\\MeSomb\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { "Tests\\": "tests/" } }, @@ -34,9 +38,12 @@ "minimum-stability": "dev", "prefer-stable": true, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19", + "friendsofphp/php-cs-fixer": "^3.1", "nunomaduro/collision": "^5.3", - "orchestra/testbench": "^6.20" + "orchestra/testbench": "^6.20", + "pestphp/pest": "^1.19", + "pestphp/pest-plugin-laravel": "^1.1", + "spatie/ray": "^1.30" }, "scripts": { "post-autoload-dump": [ diff --git a/composer.lock b/composer.lock index ed7c5d8..2638fd2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "516f8986f36c1e39fe0b2949152a82fe", + "content-hash": "6c8111296054e901930b865eff029a43", "packages": [ { "name": "brick/math", @@ -746,16 +746,16 @@ }, { "name": "laravel/framework", - "version": "v8.58.0", + "version": "v8.62.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "1b819bf99d87bd543a4d4895e5b3350f61ea7a23" + "reference": "60a7e00488167ce2babf3a2aeb3677e48aaf39be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/1b819bf99d87bd543a4d4895e5b3350f61ea7a23", - "reference": "1b819bf99d87bd543a4d4895e5b3350f61ea7a23", + "url": "https://api.github.com/repos/laravel/framework/zipball/60a7e00488167ce2babf3a2aeb3677e48aaf39be", + "reference": "60a7e00488167ce2babf3a2aeb3677e48aaf39be", "shasum": "" }, "require": { @@ -765,15 +765,17 @@ "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "league/commonmark": "^1.3|^2.0", + "laravel/serializable-closure": "^1.0", + "league/commonmark": "^1.3|^2.0.2", "league/flysystem": "^1.1", "monolog/monolog": "^2.0", "nesbot/carbon": "^2.31", "opis/closure": "^3.6", "php": "^7.3|^8.0", "psr/container": "^1.0", + "psr/log": "^1.0 || ^2.0", "psr/simple-cache": "^1.0", - "ramsey/uuid": "^4.0", + "ramsey/uuid": "^4.2.2", "swiftmailer/swiftmailer": "^6.0", "symfony/console": "^5.1.4", "symfony/error-handler": "^5.1.4", @@ -792,7 +794,8 @@ "tightenco/collect": "<5.5.33" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" }, "replace": { "illuminate/auth": "self.version", @@ -829,21 +832,21 @@ }, "require-dev": { "aws/aws-sdk-php": "^3.189.0", - "doctrine/dbal": "^2.6|^3.0", + "doctrine/dbal": "^2.13.3|^3.1.2", "filp/whoops": "^2.8", "guzzlehttp/guzzle": "^6.5.5|^7.0.1", "league/flysystem-cached-adapter": "^1.0", - "mockery/mockery": "^1.4.2", + "mockery/mockery": "^1.4.4", "orchestra/testbench-core": "^6.23", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.5.8|^9.3.3", + "phpunit/phpunit": "^8.5.19|^9.5.8", "predis/predis": "^1.1.2", "symfony/cache": "^5.1.4" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.189.0).", "brianium/paratest": "Required to run tests in parallel (^6.0).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).", "ext-ftp": "Required to use the Flysystem FTP driver.", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-memcached": "Required to use the memcache cache driver.", @@ -857,10 +860,10 @@ "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", - "mockery/mockery": "Required to use mocking (^1.4.2).", + "mockery/mockery": "Required to use mocking (^1.4.4).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^8.5.8|^9.3.3).", + "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8).", "predis/predis": "Required to use the predis connector (^1.1.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0).", @@ -910,7 +913,66 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-08-31T13:55:57+00:00" + "time": "2021-09-28T13:30:25+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "679e24d36ff8b9be0e36f5222244ec8602e18867" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/679e24d36ff8b9be0e36f5222244ec8602e18867", + "reference": "679e24d36ff8b9be0e36f5222244ec8602e18867", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "pestphp/pest": "^1.18", + "phpstan/phpstan": "^0.12.98", + "symfony/var-dumper": "^5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2021-09-29T13:25:52+00:00" }, { "name": "league/commonmark", @@ -1201,16 +1263,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b38b25d7b372e9fddb00335400467b223349fd7e", + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e", "shasum": "" }, "require": { @@ -1241,7 +1303,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.8.0" }, "funding": [ { @@ -1253,7 +1315,7 @@ "type": "tidelift" } ], - "time": "2021-01-18T20:58:21+00:00" + "time": "2021-09-25T08:23:19+00:00" }, { "name": "malico/mobile-cm-php", @@ -1297,24 +1359,24 @@ }, { "name": "monolog/monolog", - "version": "2.3.2", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "71312564759a7db5b789296369c1a264efc43aad" + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/71312564759a7db5b789296369c1a264efc43aad", - "reference": "71312564759a7db5b789296369c1a264efc43aad", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", + "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", "shasum": "" }, "require": { "php": ">=7.2", - "psr/log": "^1.0.1" + "psr/log": "^1.0.1 || ^2.0 || ^3.0" }, "provide": { - "psr/log-implementation": "1.0.0" + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" }, "require-dev": { "aws/aws-sdk-php": "^2.4.9 || ^3.0", @@ -1322,14 +1384,14 @@ "elasticsearch/elasticsearch": "^7", "graylog2/gelf-php": "^1.4.2", "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4", + "php-amqplib/php-amqplib": "~2.4 || ^3", "php-console/php-console": "^3.1.3", "phpspec/prophecy": "^1.6.1", "phpstan/phpstan": "^0.12.91", "phpunit/phpunit": "^8.5", "predis/predis": "^1.1", "rollbar/rollbar": "^1.3", - "ruflin/elastica": ">=0.90 <7.0.1", + "ruflin/elastica": ">=0.90@dev", "swiftmailer/swiftmailer": "^5.3|^6.0" }, "suggest": { @@ -1337,8 +1399,11 @@ "doctrine/couchdb": "Allow sending log messages to a CouchDB server", "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", "ext-mbstring": "Allow to work properly with unicode symbols", "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", @@ -1377,7 +1442,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.3.2" + "source": "https://github.com/Seldaek/monolog/tree/2.3.5" }, "funding": [ { @@ -1389,7 +1454,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T07:42:52+00:00" + "time": "2021-10-01T21:08:31+00:00" }, { "name": "nesbot/carbon", @@ -1549,20 +1614,20 @@ }, { "name": "nette/utils", - "version": "v3.2.3", + "version": "v3.2.5", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "5c36cc1ba9bb6abb8a9e425cf054e0c3fd5b9822" + "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/5c36cc1ba9bb6abb8a9e425cf054e0c3fd5b9822", - "reference": "5c36cc1ba9bb6abb8a9e425cf054e0c3fd5b9822", + "url": "https://api.github.com/repos/nette/utils/zipball/9cd80396ca58d7969ab44fc7afcf03624dfa526e", + "reference": "9cd80396ca58d7969ab44fc7afcf03624dfa526e", "shasum": "" }, "require": { - "php": ">=7.2 <8.1" + "php": ">=7.2 <8.2" }, "conflict": { "nette/di": "<3.0.6" @@ -1628,9 +1693,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.3" + "source": "https://github.com/nette/utils/tree/v3.2.5" }, - "time": "2021-08-16T21:05:00+00:00" + "time": "2021-09-20T10:50:11+00:00" }, { "name": "opis/closure", @@ -2250,24 +2315,25 @@ }, { "name": "ramsey/uuid", - "version": "4.2.1", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "fe665a03df4f056aa65af552a96e1976df8c8dae" + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/fe665a03df4f056aa65af552a96e1976df8c8dae", - "reference": "fe665a03df4f056aa65af552a96e1976df8c8dae", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", + "reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df", "shasum": "" }, "require": { "brick/math": "^0.8 || ^0.9", "ext-json": "*", - "php": "^7.2 || ^8", + "php": "^7.2 || ^8.0", "ramsey/collection": "^1.0", - "symfony/polyfill-ctype": "^1.8" + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-php80": "^1.14" }, "replace": { "rhumsaa/uuid": "self.version" @@ -2331,7 +2397,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.2.1" + "source": "https://github.com/ramsey/uuid/tree/4.2.3" }, "funding": [ { @@ -2343,7 +2409,7 @@ "type": "tidelift" } ], - "time": "2021-08-11T01:06:55+00:00" + "time": "2021-09-25T23:10:38+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -3099,16 +3165,16 @@ }, { "name": "symfony/http-kernel", - "version": "v5.3.7", + "version": "v5.3.9", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "a3a78e37935a527b50376c22ac1cec35b57fe787" + "reference": "ceaf46a992f60e90645e7279825a830f733a17c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a3a78e37935a527b50376c22ac1cec35b57fe787", - "reference": "a3a78e37935a527b50376c22ac1cec35b57fe787", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ceaf46a992f60e90645e7279825a830f733a17c5", + "reference": "ceaf46a992f60e90645e7279825a830f733a17c5", "shasum": "" }, "require": { @@ -3191,7 +3257,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.3.7" + "source": "https://github.com/symfony/http-kernel/tree/v5.3.9" }, "funding": [ { @@ -3207,20 +3273,20 @@ "type": "tidelift" } ], - "time": "2021-08-30T12:37:19+00:00" + "time": "2021-09-28T10:25:11+00:00" }, { "name": "symfony/mime", - "version": "v5.3.7", + "version": "v5.3.8", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ae887cb3b044658676129f5e97aeb7e9eb69c2d8" + "reference": "a756033d0a7e53db389618653ae991eba5a19a11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ae887cb3b044658676129f5e97aeb7e9eb69c2d8", - "reference": "ae887cb3b044658676129f5e97aeb7e9eb69c2d8", + "url": "https://api.github.com/repos/symfony/mime/zipball/a756033d0a7e53db389618653ae991eba5a19a11", + "reference": "a756033d0a7e53db389618653ae991eba5a19a11", "shasum": "" }, "require": { @@ -3274,7 +3340,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.3.7" + "source": "https://github.com/symfony/mime/tree/v5.3.8" }, "funding": [ { @@ -3290,7 +3356,7 @@ "type": "tidelift" } ], - "time": "2021-08-20T11:40:01+00:00" + "time": "2021-09-10T12:30:38+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4416,16 +4482,16 @@ }, { "name": "symfony/translation", - "version": "v5.3.7", + "version": "v5.3.9", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6" + "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6", - "reference": "4d595a6d15fd3a2c67f6f31d14d15d3b7356d7a6", + "url": "https://api.github.com/repos/symfony/translation/zipball/6e69f3551c1a3356cf6ea8d019bf039a0f8b6886", + "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886", "shasum": "" }, "require": { @@ -4491,7 +4557,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.3.7" + "source": "https://github.com/symfony/translation/tree/v5.3.9" }, "funding": [ { @@ -4589,16 +4655,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.3.7", + "version": "v5.3.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "3ad5af4aed07d0a0201bbcfc42658fe6c5b2fb8f" + "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3ad5af4aed07d0a0201bbcfc42658fe6c5b2fb8f", - "reference": "3ad5af4aed07d0a0201bbcfc42658fe6c5b2fb8f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eaaea4098be1c90c8285543e1356a09c8aa5c8da", + "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da", "shasum": "" }, "require": { @@ -4657,7 +4723,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.3.7" + "source": "https://github.com/symfony/var-dumper/tree/v5.3.8" }, "funding": [ { @@ -4673,7 +4739,7 @@ "type": "tidelift" } ], - "time": "2021-08-04T23:19:25+00:00" + "time": "2021-09-24T15:59:58+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -4730,31 +4796,31 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.3.0", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" + "reference": "accaddf133651d4b5cf81a119f25296736ffc850" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", - "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/accaddf133651d4b5cf81a119f25296736ffc850", + "reference": "accaddf133651d4b5cf81a119f25296736ffc850", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.1", + "graham-campbell/result-type": "^1.0.2", "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.7.4", - "symfony/polyfill-ctype": "^1.17", - "symfony/polyfill-mbstring": "^1.17", - "symfony/polyfill-php80": "^1.17" + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" + "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" }, "suggest": { "ext-filter": "Required to use the boolean validator." @@ -4777,13 +4843,11 @@ "authors": [ { "name": "Graham Campbell", - "email": "graham@alt-three.com", - "homepage": "https://gjcampbell.co.uk/" + "email": "hello@gjcampbell.co.uk" }, { "name": "Vance Lucas", - "email": "vance@vancelucas.com", - "homepage": "https://vancelucas.com/" + "email": "vance@vancelucas.com" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", @@ -4794,7 +4858,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.1" }, "funding": [ { @@ -4806,7 +4870,7 @@ "type": "tidelift" } ], - "time": "2021-01-20T15:23:13+00:00" + "time": "2021-10-02T19:24:42+00:00" }, { "name": "voku/portable-ascii", @@ -5348,16 +5412,16 @@ }, { "name": "filp/whoops", - "version": "2.14.1", + "version": "2.14.3", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "15ead64e9828f0fc90932114429c4f7923570cb1" + "reference": "89584ce67dd32307f1063cc43846674f4679feda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/15ead64e9828f0fc90932114429c4f7923570cb1", - "reference": "15ead64e9828f0fc90932114429c4f7923570cb1", + "url": "https://api.github.com/repos/filp/whoops/zipball/89584ce67dd32307f1063cc43846674f4679feda", + "reference": "89584ce67dd32307f1063cc43846674f4679feda", "shasum": "" }, "require": { @@ -5407,7 +5471,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.14.1" + "source": "https://github.com/filp/whoops/tree/2.14.3" }, "funding": [ { @@ -5415,89 +5479,69 @@ "type": "github" } ], - "time": "2021-08-29T12:00:00+00:00" + "time": "2021-09-19T12:00:00+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.2", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307" + "reference": "cf4cedb9e8991c2daa94a756176d81bf487e4c4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5c737c2e18ba502b75b44832b31fe627f82e307", - "reference": "d5c737c2e18ba502b75b44832b31fe627f82e307", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cf4cedb9e8991c2daa94a756176d81bf487e4c4b", + "reference": "cf4cedb9e8991c2daa94a756176d81bf487e4c4b", "shasum": "" }, "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", + "composer/semver": "^3.2", + "composer/xdebug-handler": "^2.0", + "doctrine/annotations": "^1.12", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + "php": "^7.1.3 || ^8.0", + "php-cs-fixer/diff": "^2.0", + "symfony/console": "^4.4.20 || ^5.1.3", + "symfony/event-dispatcher": "^4.4.20 || ^5.0", + "symfony/filesystem": "^4.4.20 || ^5.0", + "symfony/finder": "^4.4.20 || ^5.0", + "symfony/options-resolver": "^4.4.20 || ^5.0", + "symfony/polyfill-php72": "^1.23", + "symfony/polyfill-php81": "^1.23", + "symfony/process": "^4.4.20 || ^5.0", + "symfony/stopwatch": "^4.4.20 || ^5.0" }, "require-dev": { - "justinrainbow/json-schema": "^5.0", + "justinrainbow/json-schema": "^5.2", "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", + "mikey179/vfsstream": "^1.6.8", + "php-coveralls/php-coveralls": "^2.4.3", + "php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy": "^1.10.3", "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + "symfony/phpunit-bridge": "^5.2.4", + "symfony/yaml": "^4.4.20 || ^5.0" }, "suggest": { "ext-dom": "For handling output formats in XML", "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." }, "bin": [ "php-cs-fixer" ], "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5516,7 +5560,7 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.2" + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.1.0" }, "funding": [ { @@ -5524,7 +5568,7 @@ "type": "github" } ], - "time": "2021-08-18T19:55:46+00:00" + "time": "2021-08-29T20:16:20+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -5579,16 +5623,16 @@ }, { "name": "mockery/mockery", - "version": "1.4.3", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea" + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/d1339f64479af1bee0e82a0413813fe5345a54ea", - "reference": "d1339f64479af1bee0e82a0413813fe5345a54ea", + "url": "https://api.github.com/repos/mockery/mockery/zipball/e01123a0e847d52d186c5eb4b9bf58b0c6d00346", + "reference": "e01123a0e847d52d186c5eb4b9bf58b0c6d00346", "shasum": "" }, "require": { @@ -5645,9 +5689,9 @@ ], "support": { "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.4.3" + "source": "https://github.com/mockery/mockery/tree/1.4.4" }, - "time": "2021-02-24T09:51:49+00:00" + "time": "2021-09-13T15:28:59+00:00" }, { "name": "myclabs/deep-copy", @@ -5709,16 +5753,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.12.0", + "version": "v4.13.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143" + "reference": "50953a2691a922aa1769461637869a0a2faa3f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", + "reference": "50953a2691a922aa1769461637869a0a2faa3f53", "shasum": "" }, "require": { @@ -5759,39 +5803,38 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" }, - "time": "2021-07-21T10:44:31+00:00" + "time": "2021-09-20T12:20:58+00:00" }, { "name": "nunomaduro/collision", - "version": "v5.9.0", + "version": "v5.10.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "63456f5c3e8c4bc52bd573e5c85674d64d84fd43" + "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/63456f5c3e8c4bc52bd573e5c85674d64d84fd43", - "reference": "63456f5c3e8c4bc52bd573e5c85674d64d84fd43", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/3004cfa49c022183395eabc6d0e5207dfe498d00", + "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", - "filp/whoops": "^2.7.2", + "filp/whoops": "^2.14.3", "php": "^7.3 || ^8.0", "symfony/console": "^5.0" }, "require-dev": { "brianium/paratest": "^6.1", "fideloper/proxy": "^4.4.1", - "friendsofphp/php-cs-fixer": "^3.0", "fruitcake/laravel-cors": "^2.0.3", - "laravel/framework": "^8.0 || ^9.0", + "laravel/framework": "8.x-dev", "nunomaduro/larastan": "^0.6.2", "nunomaduro/mock-final-classes": "^1.0", - "orchestra/testbench": "^6.0 || ^7.0", + "orchestra/testbench": "^6.0", "phpstan/phpstan": "^0.12.64", "phpunit/phpunit": "^9.5.0" }, @@ -5849,26 +5892,26 @@ "type": "patreon" } ], - "time": "2021-08-26T15:32:09+00:00" + "time": "2021-09-20T15:06:32+00:00" }, { "name": "orchestra/testbench", - "version": "v6.20.1", + "version": "v6.21.1", "source": { "type": "git", "url": "https://github.com/orchestral/testbench.git", - "reference": "986ff30846bca4547cf11ed422511673450dcb02" + "reference": "f61383c001a97f0a116b0c58f74385424aa9de33" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/986ff30846bca4547cf11ed422511673450dcb02", - "reference": "986ff30846bca4547cf11ed422511673450dcb02", + "url": "https://api.github.com/repos/orchestral/testbench/zipball/f61383c001a97f0a116b0c58f74385424aa9de33", + "reference": "f61383c001a97f0a116b0c58f74385424aa9de33", "shasum": "" }, "require": { "laravel/framework": "^8.54", "mockery/mockery": "^1.4.2", - "orchestra/testbench-core": "^6.24.1", + "orchestra/testbench-core": "^6.25.2", "php": "^7.3 || ^8.0", "phpunit/phpunit": "^8.4 || ^9.3.3", "spatie/laravel-ray": "^1.18" @@ -5902,7 +5945,7 @@ ], "support": { "issues": "https://github.com/orchestral/testbench/issues", - "source": "https://github.com/orchestral/testbench/tree/v6.20.1" + "source": "https://github.com/orchestral/testbench/tree/v6.21.1" }, "funding": [ { @@ -5914,20 +5957,20 @@ "type": "liberapay" } ], - "time": "2021-08-25T05:23:48+00:00" + "time": "2021-09-18T09:37:03+00:00" }, { "name": "orchestra/testbench-core", - "version": "v6.24.1", + "version": "v6.25.2", "source": { "type": "git", "url": "https://github.com/orchestral/testbench-core.git", - "reference": "0e77a2e62cf9be1e541cb44f65d3ac4774015c87" + "reference": "03d8cce6e500a9c64da4cbaa776236c91b2572a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/0e77a2e62cf9be1e541cb44f65d3ac4774015c87", - "reference": "0e77a2e62cf9be1e541cb44f65d3ac4774015c87", + "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/03d8cce6e500a9c64da4cbaa776236c91b2572a1", + "reference": "03d8cce6e500a9c64da4cbaa776236c91b2572a1", "shasum": "" }, "require": { @@ -5964,7 +6007,10 @@ "autoload": { "psr-4": { "Orchestra\\Testbench\\": "src/" - } + }, + "files": [ + "src/helpers.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6001,7 +6047,258 @@ "type": "liberapay" } ], - "time": "2021-08-25T05:01:24+00:00" + "time": "2021-09-18T01:47:58+00:00" + }, + { + "name": "pestphp/pest", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest.git", + "reference": "ba06c5a76d95bbdef93aa4e05b489c3335b6c8c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest/zipball/ba06c5a76d95bbdef93aa4e05b489c3335b6c8c1", + "reference": "ba06c5a76d95bbdef93aa4e05b489c3335b6c8c1", + "shasum": "" + }, + "require": { + "nunomaduro/collision": "^5.4.0|^6.0", + "pestphp/pest-plugin": "^1.0.0", + "php": "^7.3 || ^8.0", + "phpunit/phpunit": "^9.5.5" + }, + "require-dev": { + "illuminate/console": "^8.47.0", + "illuminate/support": "^8.47.0", + "laravel/dusk": "^6.15.0", + "pestphp/pest-dev-tools": "dev-master", + "pestphp/pest-plugin-parallel": "^1.0" + }, + "bin": [ + "bin/pest" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "pest": { + "plugins": [ + "Pest\\Plugins\\Coverage", + "Pest\\Plugins\\Init", + "Pest\\Plugins\\Version", + "Pest\\Plugins\\Environment" + ] + }, + "laravel": { + "providers": [ + "Pest\\Laravel\\PestServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Pest\\": "src/" + }, + "files": [ + "src/Functions.php", + "src/Pest.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An elegant PHP Testing Framework.", + "keywords": [ + "framework", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "issues": "https://github.com/pestphp/pest/issues", + "source": "https://github.com/pestphp/pest/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://github.com/lukeraymonddowning", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/octoper", + "type": "github" + }, + { + "url": "https://github.com/olivernybroe", + "type": "github" + }, + { + "url": "https://github.com/owenvoke", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2021-09-25T12:52:12+00:00" + }, + { + "name": "pestphp/pest-plugin", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin.git", + "reference": "fc8519de148699fe612d9c669be60554cd2db4fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/fc8519de148699fe612d9c669be60554cd2db4fa", + "reference": "fc8519de148699fe612d9c669be60554cd2db4fa", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0", + "php": "^7.3 || ^8.0" + }, + "conflict": { + "pestphp/pest": "<1.0" + }, + "require-dev": { + "composer/composer": "^1.10.19", + "pestphp/pest": "^1.0", + "pestphp/pest-dev-tools": "dev-master" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "class": "Pest\\Plugin\\Manager" + }, + "autoload": { + "psr-4": { + "Pest\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest plugin manager", + "keywords": [ + "framework", + "manager", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin/tree/v1.0.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2021-01-03T15:53:42+00:00" + }, + { + "name": "pestphp/pest-plugin-laravel", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-laravel.git", + "reference": "bacc1ef1f537cf9adf692b6930e54f607ae530ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-laravel/zipball/bacc1ef1f537cf9adf692b6930e54f607ae530ad", + "reference": "bacc1ef1f537cf9adf692b6930e54f607ae530ad", + "shasum": "" + }, + "require": { + "laravel/framework": "^7.0 || ^8.0", + "pestphp/pest": "^1.7", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "orchestra/testbench": "^5.12.1 || ^6.7.2", + "pestphp/pest-dev-tools": "dev-master" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Pest\\Laravel\\": "src/" + }, + "files": [ + "src/Autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest Laravel Plugin", + "keywords": [ + "framework", + "laravel", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-laravel/tree/v1.1.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2021-07-07T09:11:42+00:00" }, { "name": "phar-io/manifest", @@ -6116,16 +6413,16 @@ }, { "name": "php-cs-fixer/diff", - "version": "v1.3.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", "shasum": "" }, "require": { @@ -6153,21 +6450,18 @@ { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" } ], - "description": "sebastian/diff v2 backport support for PHP5.6", + "description": "sebastian/diff v3 backport support for PHP 5.6+", "homepage": "https://github.com/PHP-CS-Fixer", "keywords": [ "diff" ], "support": { "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" }, - "time": "2020-10-14T08:39:05+00:00" + "time": "2020-10-14T08:32:19+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -6280,16 +6574,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -6297,7 +6591,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -6323,39 +6618,39 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2021-10-02T14:08:47+00:00" }, { "name": "phpspec/prophecy", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -6390,29 +6685,29 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" }, - "time": "2021-03-17T13:42:18+00:00" + "time": "2021-09-10T09:02:12+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.6", + "version": "9.2.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f6293e1b30a2354e8428e004689671b83871edde" + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", - "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.12.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -6461,7 +6756,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" }, "funding": [ { @@ -6469,7 +6764,7 @@ "type": "github" } ], - "time": "2021-03-28T07:26:59+00:00" + "time": "2021-09-17T05:39:03+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6714,16 +7009,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.9", + "version": "9.5.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", - "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { @@ -6739,7 +7034,7 @@ "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.7", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -6801,7 +7096,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.9" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" }, "funding": [ { @@ -6813,7 +7108,7 @@ "type": "github" } ], - "time": "2021-08-31T06:47:40+00:00" + "time": "2021-09-25T07:38:51+00:00" }, { "name": "pimple/pimple", @@ -7770,7 +8065,6 @@ "type": "github" } ], - "abandoned": true, "time": "2020-09-28T06:45:17+00:00" }, { @@ -7946,16 +8240,16 @@ }, { "name": "spatie/laravel-ray", - "version": "1.25.1", + "version": "1.26.1", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ray.git", - "reference": "67481e11a026835f72652e073527dc11a85fcce8" + "reference": "5ecc2ebbdad8ae3ec31274596d922495cff69184" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/67481e11a026835f72652e073527dc11a85fcce8", - "reference": "67481e11a026835f72652e073527dc11a85fcce8", + "url": "https://api.github.com/repos/spatie/laravel-ray/zipball/5ecc2ebbdad8ae3ec31274596d922495cff69184", + "reference": "5ecc2ebbdad8ae3ec31274596d922495cff69184", "shasum": "" }, "require": { @@ -8012,7 +8306,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-ray/issues", - "source": "https://github.com/spatie/laravel-ray/tree/1.25.1" + "source": "https://github.com/spatie/laravel-ray/tree/1.26.1" }, "funding": [ { @@ -8024,7 +8318,7 @@ "type": "other" } ], - "time": "2021-09-07T07:27:13+00:00" + "time": "2021-10-01T13:08:05+00:00" }, { "name": "spatie/macroable", @@ -8078,16 +8372,16 @@ }, { "name": "spatie/ray", - "version": "1.30.0", + "version": "1.30.2", "source": { "type": "git", "url": "https://github.com/spatie/ray.git", - "reference": "8eff2ec7f7f5a5b74519a052302fcfb274c53b97" + "reference": "f6344f8abf3ede60c963d9d3f7f35fb526b6138c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ray/zipball/8eff2ec7f7f5a5b74519a052302fcfb274c53b97", - "reference": "8eff2ec7f7f5a5b74519a052302fcfb274c53b97", + "url": "https://api.github.com/repos/spatie/ray/zipball/f6344f8abf3ede60c963d9d3f7f35fb526b6138c", + "reference": "f6344f8abf3ede60c963d9d3f7f35fb526b6138c", "shasum": "" }, "require": { @@ -8137,7 +8431,7 @@ ], "support": { "issues": "https://github.com/spatie/ray/issues", - "source": "https://github.com/spatie/ray/tree/1.30.0" + "source": "https://github.com/spatie/ray/tree/1.30.2" }, "funding": [ { @@ -8149,7 +8443,7 @@ "type": "other" } ], - "time": "2021-08-20T09:09:05+00:00" + "time": "2021-09-10T07:22:57+00:00" }, { "name": "symfony/filesystem", @@ -8283,74 +8577,6 @@ ], "time": "2021-08-04T21:20:46+00:00" }, - { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, { "name": "symfony/stopwatch", "version": "v5.3.4", diff --git a/config/mesomb.php b/config/mesomb.php index 2b7bf37..0aac1a3 100644 --- a/config/mesomb.php +++ b/config/mesomb.php @@ -4,75 +4,47 @@ /* * Api Version - * - * @var string */ 'version' => 'v1.0', /* * MeSomb Application Key * Copy from https://mesomb.hachther.com/en/applications/{id} - * - * @var string */ 'key' => env('MeSomb_APP_KEY'), /* * MeSomb API Application Key * Copy from https://mesomb.hachther.com/en/applications/{id} - * - * @var string */ 'api_key' => env('MeSomb_API_KEY'), /* * PIN used for MeSomb Pin * Configure @ https://mesomb.hachther.com/en/applications/{id}/settings/setpin/ - * - * @var int|string */ 'pin' => env('MeSomb_PIN', null), /* * Supported Payment Methods - * - * @var array */ 'currencies' => ['XAF', 'XOF'], /* * Support Payment Methods * Array in order of preference - * - * @var array */ 'services' => ['MTN', 'ORANGE'], /* * Set to True if your application uses uuid instead auto-incrmenting ids - * - * @var bool */ 'uses_uuid' => false, /* - * Failed Payments - * - * @var array - */ - 'failed_payments' => [ - /* - * Add Failed requests to queue ( to check transactions) - * - * @var bool - */ - 'check' => false, - ], - - /* - * Application Cache Key - * * Used to store the application Status */ 'application_cache_key' => 'mesomb_application_status', + + 'throw_exceptions' => true, ]; diff --git a/migrations/2020_08_07_192645_create_mesomb_tables.php b/migrations/2020_08_07_192645_create_mesomb_tables.php index 9b0522b..c235817 100644 --- a/migrations/2020_08_07_192645_create_mesomb_tables.php +++ b/migrations/2020_08_07_192645_create_mesomb_tables.php @@ -41,11 +41,11 @@ function (Blueprint $table) { } else { $table->nullableMorphs('payable'); } - + $table->timestamps(); } ); - + Schema::create( 'mesomb_deposits', function (Blueprint $table) { @@ -101,7 +101,7 @@ function (Blueprint $table) { 'PostpaidBill', 'AirtimePurchase', 'ENEOPrepaid', - 'CDEBill' + 'CDEBill', ] ); $table->string('service'); diff --git a/migrations/2020_08_21_124204_update_transactions_add_direction.php b/migrations/2020_08_21_124204_update_transactions_add_direction.php index 5b61b5c..221676e 100644 --- a/migrations/2020_08_21_124204_update_transactions_add_direction.php +++ b/migrations/2020_08_21_124204_update_transactions_add_direction.php @@ -16,7 +16,7 @@ public function up() Schema::table( 'mesomb_transactions', function (Blueprint $table) { - $table->enum('direction', ["0", "-1", "1"])->nullable(); + $table->enum('direction', ['0', '-1', '1'])->nullable(); } ); } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6b14583..29839eb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,11 +6,8 @@ - - ./tests/Feature - - - ./tests/Unit + + ./tests diff --git a/src/Application.php b/src/Application.php index 4d43e0a..5808b0b 100644 --- a/src/Application.php +++ b/src/Application.php @@ -12,13 +12,13 @@ class Application * * @return void */ - protected static function generateURL() : string + protected static function generateURL(): string { - return 'https://mesomb.hachther.com/api/' . - config('mesomb.version') . - '/applications/' . - config('mesomb.key') . - '/status'; + return 'https://mesomb.hachther.com/api/' + . config('mesomb.version') + . '/applications/' + . config('mesomb.key') + . '/status'; } /** diff --git a/src/Deposit.php b/src/Deposit.php index caa418b..818fe42 100644 --- a/src/Deposit.php +++ b/src/Deposit.php @@ -4,14 +4,15 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\Http; +use Malico\MeSomb\Helper\HandleExceptions; use Malico\MeSomb\Helper\RecordTransaction; -use Malico\MeSomb\Jobs\CheckFailedTransactions; use Malico\MeSomb\Model\Deposit as DepositModel; use Malico\MobileCM\Network; class Deposit { - use RecordTransaction; + use HandleExceptions, RecordTransaction; + /** * Deposit URL. * @@ -44,24 +45,19 @@ public function __construct($receiver, $amount, $service = null) /** * Generate Deposit URL. - * - * @return void */ - protected function generateURL() : void + protected function generateURL(): void { - $this->url = 'https://mesomb.hachther.com/api/' . - config('mesomb.version') . - '/applications/' . - config('mesomb.key') . - '/deposit/'; + $version = config('mesomb.version'); + $key = config('mesomb.key'); + + $this->url = "https://mesomb.hachther.com/api/{$version}/applications/{$key}/deposit/"; } /** * Determine receiver's Network. - * - * @return string */ - protected function getReceiverService() : string + protected function getReceiverService(): string { if (Network::isOrange($this->receiver)) { return 'ORANGE'; @@ -75,11 +71,9 @@ protected function getReceiverService() : string /** * Save Deposit bef[return description]ore request. * - * @param array $data - * - * @return array + * @param array $data */ - protected function saveDeposit($data) : array + protected function saveDeposit($data): array { $this->deposit_model = DepositModel::create($data); @@ -90,10 +84,8 @@ protected function saveDeposit($data) : array /** * Prep Request Data. - * - * @return array */ - protected function prepareData() : array + protected function prepareData(): array { $data = [ 'service' => $this->service, @@ -120,26 +112,20 @@ protected function recordDeposit($response) /** * Make Deposit Request. - * - * @return \Malico\MeSomb\Model\Deposit */ - public function pay() : DepositModel + public function pay(): DepositModel { $data = $this->prepareData(); $response = Http::withToken(config('mesomb.api_key'), 'Token') - ->post($this->url, $data); - - if ($response->serverError()) { - if (config('mesomb.failed_payments.check')) { - CheckFailedTransactions::dispatchNow($this->deposit_model); - } - } - - $response->throw(); + ->post($this->url, $data); $this->recordDeposit($response->json()); + if ($response->failed()) { + $this->handleException($response); + } + return $this->deposit_model; } } diff --git a/src/Exceptions/InsufficientBalanceException.php b/src/Exceptions/InsufficientBalanceException.php new file mode 100644 index 0000000..3a10882 --- /dev/null +++ b/src/Exceptions/InsufficientBalanceException.php @@ -0,0 +1,9 @@ + InsufficientBalanceException::class, + 'subscriber-not-found' => InvalidPhoneNumberException::class, + 'subscriber-invalid-length' => InvalidPhoneNumberException::class, + 'subscriber-invalid-secret-code' => InvalidPinException::class, + 'subscriber-invalid-min-amount' => InvalidAmountException::class, + 'subscriber-invalid-max-amount' => InvalidAmountException::class, + 'subscriber-timeout' => TimeoutException::class, + 'subscriber-internal-error' => TimeoutException::class, + ]; + + public function handleException(Response $response) + { + if (! config('mesomb.throw_exceptions')) { + return; + } + + $body = (object) $response->json(); + + if (isset($this->errorCodes[$body->code])) { + $class = $this->errorCodes[$body->code]; + throw new $class($body->detail); + } else { + $response->throw(); + } + } +} diff --git a/src/Helper/HasDeposits.php b/src/Helper/HasDeposits.php index 35ca1db..a3007e7 100644 --- a/src/Helper/HasDeposits.php +++ b/src/Helper/HasDeposits.php @@ -19,8 +19,8 @@ public function deposits() /** * Make Deposit. * - * @param string|int $receiver - * @param int|float $amount + * @param int|string $receiver + * @param float|int $amount * * @return Malico\MeSomb\Builder\DepositBuilder */ diff --git a/src/Helper/HasPayments.php b/src/Helper/HasPayments.php index 6368e29..30040a8 100644 --- a/src/Helper/HasPayments.php +++ b/src/Helper/HasPayments.php @@ -19,8 +19,8 @@ public function payments() /** * Make Payment. * - * @param string|int $payer - * @param int|float $amount + * @param int|string $payer + * @param float|int $amount * * @return Malico\MeSomb\Builder\PaymentBuilder */ diff --git a/src/Helper/HasTransactions.php b/src/Helper/HasTransactions.php index 8112c70..401bfec 100644 --- a/src/Helper/HasTransactions.php +++ b/src/Helper/HasTransactions.php @@ -2,24 +2,22 @@ namespace Malico\MeSomb\Helper; +use Illuminate\Database\Eloquent\Relations\MorphOne; + trait HasTransactions { /** * Deposit|Payment Transaction. - * - * @return Illuminate\Database\Eloquent\Relations\MorphOne */ - public function transaction() + public function transaction(): MorphOne { return $this->morphOne('Malico\MeSomb\Model\Transaction', 'transacable'); } /** * Succesful Transactoin. - * - * @return void */ - public function toggleToSuccess() + public function toggleToSuccess(): void { $this->update(['success' => true]); diff --git a/src/Helper/ModelUUID.php b/src/Helper/ModelUUID.php index 389a8ae..44d5b9e 100644 --- a/src/Helper/ModelUUID.php +++ b/src/Helper/ModelUUID.php @@ -8,10 +8,8 @@ trait ModelUUID { /** * Set UUID for newly created Models. - * - * @return void */ - protected static function boot() + protected static function boot(): void { parent::boot(); diff --git a/src/Helper/PaymentData.php b/src/Helper/PaymentData.php index 42bedc8..a6bd8f5 100644 --- a/src/Helper/PaymentData.php +++ b/src/Helper/PaymentData.php @@ -7,13 +7,14 @@ trait PaymentData /** * Amount to be Paid for Service. * - * @var int | string + * @var int|string */ protected $amount; + /** * Users Telephone Number. * - * @var int | string + * @var int|string */ protected $payer; @@ -71,7 +72,7 @@ trait PaymentData /** * Modify Payer. * - * @param string|int $value + * @param int|string $value * * @return Malico\MeSomb\Payment */ @@ -97,7 +98,7 @@ public function phone($value) /** * Modify Amount. * - * @param string|int $value + * @param int|string $value * * @return Malico\MeSomb\Payment */ @@ -111,7 +112,7 @@ public function amount($value) /** * Modify Reference. * - * @param string $value + * @param string $value * * @return Malico\MeSomb\Payment */ @@ -125,7 +126,7 @@ public function reference($value) /** * Modify Message. * - * @param string $value + * @param string $value * * @return Malico\MeSomb\Payment */ @@ -139,7 +140,7 @@ public function message($value) /** * Modify Currency. * - * @param string $value + * @param string $value * * @return Malico\MeSomb\Payment */ @@ -153,7 +154,7 @@ public function currency($value) /** * Modify Service. * - * @param string $value + * @param string $value * * @return Malico\MeSomb\Payment */ @@ -167,7 +168,7 @@ public function service($value) /** * Modify Fees. * - * @param string $value + * @param string $value * * @return Malico\MeSomb\Payment */ @@ -181,7 +182,7 @@ public function fees($value) /** * Modify Request ID. * - * @param string $value + * @param string $value * * @return Malico\MeSomb\Payment */ diff --git a/src/Helper/RecordTransaction.php b/src/Helper/RecordTransaction.php index 4463e6d..e78bd94 100644 --- a/src/Helper/RecordTransaction.php +++ b/src/Helper/RecordTransaction.php @@ -24,12 +24,8 @@ trait RecordTransaction /** * Extract on Fields saved in DB. - * - * @param array $data - * - * @return array */ - protected function extractSavableTransactionDetails(array $data) : array + protected function extractSavableTransactionDetails(array $data): array { return Arr::only($data, $this->transaction_fields); } @@ -38,15 +34,13 @@ protected function extractSavableTransactionDetails(array $data) : array * Save {Model} Transaction. * * @param array $data - * - * @return void */ - protected function saveTransaction($data, $model) : void + protected function saveTransaction($data, $model): void { $data = $this->extractSavableTransactionDetails($data); $data['ts'] = Carbon::parse($data['ts']); - $data['direction'] = strval($data['direction']); + $data['direction'] = (string) ($data['direction']); $model->transaction()->updateOrCreate($data); } @@ -54,12 +48,9 @@ protected function saveTransaction($data, $model) : void /** * Save Transaction. * - * @param array $response - * @param \Illuminate\Database\Eloquent\Model $model - * - * @return void + * @param \Illuminate\Database\Eloquent\Model $model */ - protected function recordTransaction(array $response, $model) : void + protected function recordTransaction(array $response, $model): void { if (Arr::has($response, 'transaction')) { $transaction = Arr::get($response, 'transaction'); diff --git a/src/Jobs/CheckFailedTransactions.php b/src/Jobs/CheckFailedTransactions.php index b172d3c..e8fab41 100644 --- a/src/Jobs/CheckFailedTransactions.php +++ b/src/Jobs/CheckFailedTransactions.php @@ -16,7 +16,7 @@ class CheckFailedTransactions implements ShouldQueue /** * Transaction Model. * - * @var \Malico\MeSomb\Model\Payment | \Malico\MeSomb\Model\Deposit + * @var \Malico\MeSomb\Model\Deposit|\Malico\MeSomb\Model\Payment */ protected $model; diff --git a/src/Model/Deposit.php b/src/Model/Deposit.php index 2f7defd..35d3390 100644 --- a/src/Model/Deposit.php +++ b/src/Model/Deposit.php @@ -8,21 +8,21 @@ class Deposit extends Model { - use ModelUUID, HasTransactions; + use HasTransactions, ModelUUID; /** - * The "type" of the auto-incrementing ID. + * Indicates if the IDs are auto-incrementing. * - * @var string + * @var bool */ - protected $keyType = 'string'; + public $incrementing = false; /** - * Indicates if the IDs are auto-incrementing. + * The "type" of the auto-incrementing ID. * - * @var bool + * @var string */ - public $incrementing = false; + protected $keyType = 'string'; /** * Guarded Properties. diff --git a/src/Model/Payment.php b/src/Model/Payment.php index 479267c..ef8ef9a 100644 --- a/src/Model/Payment.php +++ b/src/Model/Payment.php @@ -9,21 +9,21 @@ class Payment extends Model { - use ModelUUID, HasTransactions, HasDeposits; + use HasDeposits, HasTransactions, ModelUUID; /** - * The "type" of the auto-incrementing ID. + * Indicates if the IDs are auto-incrementing. * - * @var string + * @var bool */ - protected $keyType = 'string'; + public $incrementing = false; /** - * Indicates if the IDs are auto-incrementing. + * The "type" of the auto-incrementing ID. * - * @var bool + * @var string */ - public $incrementing = false; + protected $keyType = 'string'; /** * Payment Model Table. @@ -59,6 +59,5 @@ public function refund() if ($this->success && $this->transaction->successful()) { return $this->deposit($this->payer, $this->transaction->amount)->pay(); } - } } diff --git a/src/Model/Transaction.php b/src/Model/Transaction.php index 6c21a2a..1c8c038 100644 --- a/src/Model/Transaction.php +++ b/src/Model/Transaction.php @@ -10,18 +10,18 @@ class Transaction extends Model use ModelUUID; /** - * The "type" of the auto-incrementing ID. + * Indicates if the IDs are auto-incrementing. * - * @var string + * @var bool */ - protected $keyType = 'string'; + public $incrementing = false; /** - * Indicates if the IDs are auto-incrementing. + * The "type" of the auto-incrementing ID. * - * @var bool + * @var string */ - public $incrementing = false; + protected $keyType = 'string'; /** * Guarded Properties. diff --git a/src/Payment.php b/src/Payment.php index af82bf2..c7a384c 100644 --- a/src/Payment.php +++ b/src/Payment.php @@ -4,15 +4,15 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\Http; +use Malico\MeSomb\Helper\HandleExceptions; use Malico\MeSomb\Helper\PaymentData; use Malico\MeSomb\Helper\RecordTransaction; -use Malico\MeSomb\Jobs\CheckFailedTransactions; use Malico\MeSomb\Model\Payment as PaymentModel; use Malico\MobileCM\Network; class Payment { - use PaymentData, RecordTransaction; + use HandleExceptions, PaymentData, RecordTransaction; /** * MeSomb Payment Payment URL. @@ -24,7 +24,7 @@ class Payment /** * Payment Model. * - * @var Malico\MeSomb\Model\Payment | null + * @var null|Malico\MeSomb\Model\Payment */ protected $payment_model; @@ -50,20 +50,18 @@ public function __construct( /** * Generate Payment URL. - * - * @return void */ - protected function generateURL() : void + protected function generateURL(): void { - $this->url = 'https://mesomb.hachther.com/api/' . config('mesomb.version') . '/payment/online/'; + $version = config('mesomb.version'); + + $this->url = "https://mesomb.hachther.com/api/{$version}/payment/online/"; } /** * Determine payer's Network. - * - * @return string */ - protected function getPayerService() : string + protected function getPayerService(): string { if (Network::isOrange($this->payer)) { return 'ORANGE'; @@ -77,11 +75,9 @@ protected function getPayerService() : string /** * Save Payment before request. * - * @param array $data - * - * @return array + * @param array $data */ - protected function savePayment($data) : array + protected function savePayment($data): array { $this->payment_model = PaymentModel::create($data); @@ -93,10 +89,8 @@ protected function savePayment($data) : array /** * Prep Request Data. - * - * @return array */ - protected function prepareData() : array + protected function prepareData(): array { $data = [ 'service' => $this->service, @@ -108,9 +102,7 @@ protected function prepareData() : array 'redirect'=> $this->redirect, ]; - return array_filter($this->savePayment($data), function ($val) { - return ! is_null($val); - }); + return array_filter($this->savePayment($data), fn ($val) => ! is_null($val)); } /** @@ -131,16 +123,12 @@ public function pay() ->withHeaders($headers) ->post($this->url, $data); - if ($response->serverError()) { - if (config('mesomb.failed_payments.check')) { - CheckFailedTransactions::dispatch($this->payment_model); - } + $this->recordPayment($response->json()); - $response->throw(); + if ($response->failed()) { + $this->handleException($response); } - $this->recordPayment($response->json()); - return $this->payment_model; } diff --git a/src/Transaction.php b/src/Transaction.php index d54d2a4..f03d852 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -4,40 +4,40 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Http; -use Malico\Momo\Model\Transaction; +use Malico\MeSomb\Model\Transaction as ModelTransaction; class Transaction { /** * Generate Checking URL. - * - * @return string */ - public static function getURL(string $id) : string + public static function getURL(string $id): string { - return 'https://mesomb.hachther.com/api/' . - config('mesomb.version') . - '/applications/' . - config('mesomb.key') . - '/transactions/' . - $id; + $config = config('mesomb.version'); + $key = config('mesomb.key'); + + return "https://mesomb.hachther.com/api/{$config}/applications/{$key}/transactions/{$id}"; } /** * Check Transaction sTatus. * - * @param \Malico\MeSomb\Model\Payment | \Malico\MeSomb\Model\Deposit $model + * @param \Malico\MeSomb\Model\Deposit|\Malico\MeSomb\Model\Payment $model * - * @return \Malico\MeSomb\Model\Transaction|null + * @return null|\Malico\MeSomb\Model\Transaction */ public static function checkStatus($model) { if (is_string($model)) { $id = $model; - } else { + } elseif ($model->transaction) { $id = $model->transaction->pk; } + if (! $id) { + return; + } + $response = Http::withToken(config('mesomb.api_key'), 'Token') ->get(self::getURL($id)); @@ -53,9 +53,8 @@ public static function checkStatus($model) return $model->transaction; } else { - return self::updateOrCreate($data); + return ModelTransaction::updateOrCreate($data); } } - } } diff --git a/src/Transactions.php b/src/Transactions.php index 9dd1155..a396247 100644 --- a/src/Transactions.php +++ b/src/Transactions.php @@ -8,16 +8,14 @@ class Transactions { /** * Generate transactions url URL. - * - * @return string */ - public static function getURL() : string + public static function getURL(): string { - return 'https://mesomb.hachther.com/api/' . - config('mesomb.version') . - '/applications/' . - config('mesomb.key') . - '/transactions/'; + return 'https://mesomb.hachther.com/api/' + . config('mesomb.version') + . '/applications/' + . config('mesomb.key') + . '/transactions/'; } /** @@ -25,7 +23,7 @@ public static function getURL() : string * * @param * - * @return \Transactions|null + * @return null|\Transactions */ public static function getTransactions() { @@ -35,10 +33,7 @@ public static function getTransactions() $response->throw(); if ($response->successful()) { - $data = $response->json(); - - return $data; + return $response->json(); } - } } diff --git a/tests/DepositTest.php b/tests/DepositTest.php new file mode 100644 index 0000000..3872ae9 --- /dev/null +++ b/tests/DepositTest.php @@ -0,0 +1,120 @@ + Http::response([ + 'success' => true, + 'redirect' => 'https://malico.me', + 'message' => 'Deposit Successful', + 'status' => 'SUCCESS', + 'transaction' => [ + 'id' => Str::uuid(), + 'pk' => Str::uuid(), + 'status' => 'SUCCESS', + 'amount' => '100', + 'type' => 'DEPOSIT', + 'service' => 'MTN', + 'message' => 'Deposit Successful', + 'b_party' => '+237676956703', + 'fees' => 3, + 'external_id' => '', + 'ts' => '2020-01-01T00:00:00.000Z', + 'reference' => '', + 'direction' => 1, + ], + ], 200), + ]); +} + +function fakeServerErrorResponse() +{ + Http::fake([ + 'https://mesomb.hachther.com/api/*' => Http::response([], 500), + ]); +} + +function fakeClientErrorResponse($code = 'subscriber-insufficient-balance') +{ + Http::fake([ + 'https://mesomb.hachther.com/api/*' => Http::response([ + 'code' => $code, + 'detail' => 'Subscriber does not have enough balance', + ], 500), + ]); +} + +it('sends deposit api request', function () { + fakeDepositResponse(); + + $request = new Deposit('676956703', 196); + $request->pay(); + + Http::assertSent(fn (Request $clientRequest) => Str::is('https://mesomb.hachther.com/api/v*/applications/*/deposit/', $clientRequest->url())); +}); + +it('sends required fields to deposit api request', function () { + fakeDepositResponse(); + + $request = new Deposit('676956703', 196); + $request->pay(); + + Http::assertSent(function (Request $clientRequest) { + ray($clientRequest->data()); + + return Arr::has( + $clientRequest->data(), + ['amount', 'service', 'receiver', 'pin'] + ); + }); +}); + +it('creates deposit model after api_request', function () { + fakeDepositResponse(); + + $request = new Deposit('676956703', 196); + + $deposit = $request->pay(); + + assertDatabaseHas('mesomb_deposits', [ + 'id' => $deposit->id, + 'success' => true, + ]); +}); + +it('creates transaction model after api_request', function () { + fakeDepositResponse(); + + $request = new Deposit('676956703', 196); + + $deposit = $request->pay(); + + assertDatabaseHas('mesomb_transactions', [ + 'id' => $deposit->transaction->id, + 'status' => 'SUCCESS', + ]); +}); + +it('creates failed deposit model after api_request', function () { + fakeServerErrorResponse(null); + withoutExceptionHandling(); + + $request = new Deposit('676956703', 196); + + $deposit = $request->pay(); + + assertDatabaseHas('mesomb_deposits', [ + 'id' => $deposit->id, + 'success' => false, + ]); +}); diff --git a/tests/PaymentTest.php b/tests/PaymentTest.php new file mode 100644 index 0000000..0904808 --- /dev/null +++ b/tests/PaymentTest.php @@ -0,0 +1,160 @@ + Http::response([ + 'success' => true, + 'redirect' => 'https://malico.me', + 'message' => 'Payment Successful', + 'status' => 'SUCCESS', + 'transaction' => [ + 'id' => Str::uuid(), + 'pk' => Str::uuid(), + 'status' => 'SUCCESS', + 'amount' => '100', + 'type' => 'PAYMENT', + 'service' => 'MTN', + 'message' => 'PAYMENT Successful', + 'b_party' => '+237676956703', + 'fees' => 3, + 'external_id' => '', + 'ts' => '2020-01-01T00:00:00.000Z', + 'reference' => '', + 'direction' => 1, + ], + ], 200), + ]); +} + +function fakeServerErrorResponse($code = 'subscriber-insufficient-balance', $message = 'Subscriber does not have enough balance') +{ + Http::fake([ + 'https://mesomb.hachther.com/api/*' => Http::response([ + 'code' => $code, + 'detail' => $message, + ], 500), + ]); +} + +function fakeClientErrorResponse($statusCode = 400) +{ + Http::fake([ + 'https://mesomb.hachther.com/api/*' => Http::response([], $statusCode), + ]); +} + +it('makes payment to right api url', function () { + fakePaymentResponse(); + + $request = new Payment(67282929, 100); + $request->pay(); + + Http::assertSent(fn (Request $clientRequest) => Str::is('https://mesomb.hachther.com/api/v*/payment/online/', $clientRequest->url())); +}); + +it('sends required information', function () { + fakePaymentResponse(); + + $request = new Payment(67282929, 100); + $request->pay(); + + Http::assertSent(function (Request $clientRequest) { + ray($clientRequest->data()); + + return Arr::has( + $clientRequest->data(), + ['amount', 'service', 'payer'] + ); + }); +}); + +it('creates payment model after request', function () { + fakePaymentResponse(); + + $request = new Payment(67282929, 100); + $payment = $request->pay(); + + assertDatabaseHas('mesomb_payments', [ + 'id' => $payment->id, + 'amount' => 100, + 'status' => 'SUCCESS', + 'service' => 'MTN', + 'payer' => 67282929, + ]); +}); + +it('creates transaction model after api_request', function () { + fakePaymentResponse(); + + $request = new Payment(67282929, 100); + $payment = $request->pay(); + + assertDatabaseHas('mesomb_transactions', [ + 'id' => $payment->transaction->id, + 'pk' => $payment->transaction->pk, + 'status' => 'SUCCESS', + 'amount' => 100, + 'type' => 'PAYMENT', + ]); +}); + +it('creates failed payment model after api_request', function () { + fakeServerErrorResponse(); + withoutExceptionHandling(); + + $request = new Payment(67282929, 100); + $payment = $request->pay(); + + assertDatabaseHas('mesomb_payments', [ + 'id' => $payment->id, + 'success' => false, + ]); +}); + +it('throws exception when balance is insufficient', function () { + fakeServerErrorResponse(); + + $request = new Payment(67282929, 100); + + expect(fn () => $request->pay())->toThrow(InsufficientBalanceException::class, 'Subscriber does not have enough balance'); +}); + +it('throws exception when payer is not a subscriber', function () { + fakeServerErrorResponse('subscriber-not-found'); + + $request = new Payment(67282929, 100); + + expect(fn () => $request->pay())->toThrow(InvalidPhoneNumberException::class); +}); + +it('throws exception when payer length is too long', function () { + fakeServerErrorResponse('subscriber-invalid-length'); + + $request = new Payment(67282929, 100); + + expect(fn () => $request->pay())->toThrow(InvalidPhoneNumberException::class); +}); + +it('throws exception when pin is invalid', function () { + fakeServerErrorResponse('subscriber-invalid-secret-code'); + + $request = new Payment(67282929, 100); + + expect(fn () => $request->pay())->toThrow(InvalidPinException::class); +}); diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..1e613d0 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,15 @@ +in(__DIR__); + +function withoutExceptionHandling() +{ + Config::set('mesomb.throw_exceptions', false); + + return test(); +} diff --git a/tests/TestCase.php b/tests/TestCase.php index 98a71a4..63109fa 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,13 +6,12 @@ use Malico\MeSomb\MeSombServiceProvider; use Orchestra\Testbench\TestCase as TestbenchTestCase; -class TestCase extends TestbenchTestCase +abstract class TestCase extends TestbenchTestCase { use RefreshDatabase; /** * Setup the test environment. - * @return void */ protected function setUp(): void { @@ -22,7 +21,7 @@ protected function setUp(): void /** * Get package providers. * - * @param \Illuminate\Foundation\Application $app + * @param \Illuminate\Foundation\Application $app * * @return array */