Skip to content

Conversation

cedric-anne
Copy link
Contributor

fixes #410

Multiple hash_* have the same exact return value documentation. It is therefore not possible to add a specific pattern to the generator/config/detectErrorType.php script to detect specifically hash_file and hash_hmac_file functions.

@silasjoisten
Copy link
Collaborator

@cedric-anne please remove the hash_file it was already generated in https://github.com/thecodingmachine/safe/pull/692/files

@cedric-anne
Copy link
Contributor Author

@cedric-anne please remove the hash_file it was already generated in https://github.com/thecodingmachine/safe/pull/692/files

It is now generated because I fixed the PHP documentation, see php/doc-en#4671. I did not find any other way to add it to earlier PHP versions than adding it to the lib/special_cases.php file.

@silasjoisten
Copy link
Collaborator

Amazing! 🤩 Well that is the issue the generate command is pinned to a specific commit e.g. PHP 8.1

 // PHP documentation is a living document, which broadly reflects
// "the current state of PHP". There is no guarantee that any version
// of the documentation accurately reflects the state of PHP at any
// given time, but these are some best-guess commits that approximately
// match the state of PHP at the time of writing.
$versions = [
    "8.1" => "9097ea48f608dbbbf795235a31af82b85bd94430",
    "8.2" => "8f4e8cf3de08208e71eb0117f1c970c27e9120c9",
    "8.3" => "7453a50321f0834421cebea8edade14deef5466b",
    "8.4" => "d553fa36940639b0889ec4358fa3bbb92f123b69",
    "8.5" => "master",
];

Due to your change at the docs, the bot was able to clone the repository with master and generate the hash_file that is not so cool but i guess there is no other way. Thats why we have to maintain the special_cases.php That also explains your issue. #676

@silasjoisten silasjoisten merged commit db00812 into thecodingmachine:master May 15, 2025
10 checks passed
@silasjoisten
Copy link
Collaborator

Thank you great job!

@cedric-anne
Copy link
Contributor Author

Amazing! 🤩 Well that is the issue the generate command is pinned to a specific commit e.g. PHP 8.1

 // PHP documentation is a living document, which broadly reflects
// "the current state of PHP". There is no guarantee that any version
// of the documentation accurately reflects the state of PHP at any
// given time, but these are some best-guess commits that approximately
// match the state of PHP at the time of writing.
$versions = [
    "8.1" => "9097ea48f608dbbbf795235a31af82b85bd94430",
    "8.2" => "8f4e8cf3de08208e71eb0117f1c970c27e9120c9",
    "8.3" => "7453a50321f0834421cebea8edade14deef5466b",
    "8.4" => "d553fa36940639b0889ec4358fa3bbb92f123b69",
    "8.5" => "master",
];

Due to your change at the docs, the bot was able to clone the repository with master and generate the hash_file that is not so cool but i guess there is no other way. Thats why we have to maintain the special_cases.php That also explains your issue. #676

There are probably a lot of fixes that could be made in the PHP documentation to use , &return.falseforfailure;. where it is missing or where a custom sentence is used, but I do not think I will find time to do it.

Most of the issues I find recently were find by comparing manually the generated files. If you compare generated files between PHP 8.3 and PHP 8.4, you may detect a lot of remaining issues, for instance on the imap_* functions. I will probably not find the time to work on this anymore. I had to fix issues related to a project I work on, so I take this opportunity to fix some more issues here, but I have to focus on something else now.

@cedric-anne cedric-anne deleted the fix/hash_file branch May 15, 2025 06:35
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.

Missing function Safe\hash_file
2 participants