Skip to content

fix(stubs): update test stubs#2457

Merged
CarlSchwan merged 1 commit intomasterfrom
fix/noid/update-test-stubs
Apr 27, 2026
Merged

fix(stubs): update test stubs#2457
CarlSchwan merged 1 commit intomasterfrom
fix/noid/update-test-stubs

Conversation

@cristianscheid
Copy link
Copy Markdown
Contributor

@cristianscheid cristianscheid commented Apr 23, 2026

  • Resolves: #

Summary

  • Updates stubs located inside tests/stubs

How I updated the stubs

  • checkout to master on server and circles
  • git pull origin master on server and circles
  • composer install on server and circles
  • git clone https://codeberg.org/provokateurin/php-stubs-updater inside circles app folder
  • composer install inside php-stubs-updater/ folder
  • from circles app folder:
php -d memory_limit=-1 php-stubs-updater/update-stubs.php tests/stubs ../../

I'm aware that more specific folders could have been passed as param instead of just ../../, but as I didn't knew exactly which folders are needed I used nextcloud's root and memory_limit=-1

  • psalm reported a class or interface oc\db\querybuilder\typedquerybuilder that does not exist error, so I added <file name="tests/stubs/oc_db_querybuilder_typedquerybuilder.php" /> to psalm.xml and ran generate-empty-psalm-stubs.php to create the missing empty stub file
  • ran the update-stubs.php command once again

@provokateurin would appreciate some input here to know if I did it correctly.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@cristianscheid cristianscheid self-assigned this Apr 23, 2026
@cristianscheid cristianscheid force-pushed the fix/noid/update-test-stubs branch from a5e7b62 to 5fc252e Compare April 23, 2026 18:39
Copy link
Copy Markdown
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is roughly the process :) You can make it faster by giving more specific paths, to avoid checking all php files. For groupfolders I never had to raise the memory limit and I would guess that you don't need it for circles either if you give more specific paths. IIRC I originally added the stubs to circles and didn't have to use it either.

@cristianscheid
Copy link
Copy Markdown
Contributor Author

cristianscheid commented Apr 23, 2026

Yes that is roughly the process :) You can make it faster by giving more specific paths, to avoid checking all php files. For groupfolders I never had to raise the memory limit and I would guess that you don't need it for circles either if you give more specific paths. IIRC I originally added the stubs to circles and didn't have to use it either.

Thanks for the input and for this great tool! I also had to add a file on the psaml.xml and run generate-empty-psalm-stubs.php (details on main PR comment).

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid cristianscheid force-pushed the fix/noid/update-test-stubs branch from 5fc252e to 16d57c4 Compare April 27, 2026 10:35
@CarlSchwan CarlSchwan enabled auto-merge April 27, 2026 10:36
@CarlSchwan CarlSchwan merged commit bacca8c into master Apr 27, 2026
41 checks passed
@CarlSchwan CarlSchwan deleted the fix/noid/update-test-stubs branch April 27, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants