Skip to content

Conversation

@johnbillion
Copy link
Contributor

@johnbillion johnbillion commented Apr 19, 2023

See #71.

  • generate.sh
  • visitor62.php
  • functionMap62.php

@IanDelMar
Copy link
Contributor

functionMap.php and functionMap62.php only differ in $httpReturnType and visitor.php and visitor62.php only differ in using functionMap.php or functionMap62.php, right?

Wouldn't it then be possible to define $httpReturnType in functionMap.php like this:

$httpReturnType = 'array{headers: \WpOrg\Requests\Utility\CaseInsensitiveDictionary, body: string, response: array{code: int,message: string}, cookies: array<int, \WP_HTTP_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error';
if (file_exists(__DIR__.'/source/wordpress/wp-includes/Requests/Cookie/Jar.php')) {
    $httpReturnType = 'array{headers: \Requests_Utility_CaseInsensitiveDictionary, body: string, response: array{code: int,message: string}, cookies: array<int, \WP_HTTP_Cookie>, filename: string|null, http_response: \WP_HTTP_Requests_Response}|\WP_Error';
}

and only have one visitor and one functionsMap file?

@szepeviktor
Copy link
Member

Wouldn't it then be possible to define $httpReturnType in functionMap.php like this:

Yes!!

@johnbillion
Copy link
Contributor Author

I did wonder that but I thought we might like to keep the version sniffing code in generate.sh. What do you think Viktor?

@szepeviktor
Copy link
Member

I'd like to keep functionMap62.php 🙃

Please go with Ian's solution.

@johnbillion
Copy link
Contributor Author

I think #85 is a simpler approach

@szepeviktor
Copy link
Member

Yes.

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

Successfully merging this pull request may close these issues.

3 participants