Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required parameter $params follows optional parameter $type in file /vendor/instamojo/instamojo-php/src/Instamojo.php on line 193 #63

Open
rajuaryan21 opened this issue Aug 23, 2021 · 2 comments

Comments

@rajuaryan21
Copy link

PHP Version: 8.0.9

is there any support for php 8.0?

As per the php 8.0 specification, the required parameter should come first and optional parameters should follow required parameters.

Can you guys please fix this?

@rajuaryan21
Copy link
Author

So, insted of

static function init($type='app', $params, $test=false)
{
self::validateTypeParams($type, $params);
self::$authType = $type;
self::$clientId = $params['client_id'];
self::$clientSecret = $params['client_secret'];
self::$username = isset($params['username']) ? $params['username'] : '';
self::$password = isset($params['password']) ? $params['password'] : '';
self::$baseUrl = Instamojo::PRODUCTION_BASE_URL;
self::$scope = isset($params['scope']) ? $params['scope'] : null;
...
...

We can have this

static function init($params, $type='app', $test=false)
{
self::validateTypeParams($type, $params);
self::$authType = $type;
self::$clientId = $params['client_id'];
self::$clientSecret = $params['client_secret'];
self::$username = isset($params['username']) ? $params['username'] : '';
self::$password = isset($params['password']) ? $params['password'] : '';
self::$baseUrl = Instamojo::PRODUCTION_BASE_URL;
self::$scope = isset($params['scope']) ? $params['scope'] : null;

....
....

@rajuaryan21
Copy link
Author

I see a bunch of other related errors in php 8 with this repository. Any plan to support already rolling php 8 version in the market?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant