Skip to content

More precise inotify related function signatures#2599

Merged
ondrejmirtes merged 1 commit intophpstan:1.10.xfrom
thg2k:pr/1.10.x-inotify
Sep 4, 2023
Merged

More precise inotify related function signatures#2599
ondrejmirtes merged 1 commit intophpstan:1.10.xfrom
thg2k:pr/1.10.x-inotify

Conversation

@thg2k
Copy link
Copy Markdown
Contributor

@thg2k thg2k commented Sep 3, 2023

Changes

  1. inotify_add_watch: Narrowed the returned value: It can only be a non-negative integer according to the man page
  2. inotify_add_watch: Added false in case of failure, same concept as fopen(), in case the file does not exist or is not readable
  3. inotify_queue_len: Narrowed the return value: It can only be zero or positive
  4. inotify_read: Narrowed the return value: Added the shape of the returned array
  5. inotify_read: Added false in case the stream is set a non-blocking.

Question: I have a doubt about point 5, i.e. adding false as possible return type to inotify_read. This can only happen if the inotify stream is set as non-blocking (tested). Should this go to the bleeding version of the signatures map?

@ondrejmirtes
Copy link
Copy Markdown
Member

Let's try this like that :) Thank you!

@ondrejmirtes ondrejmirtes merged commit e7d4c92 into phpstan:1.10.x Sep 4, 2023
@thg2k thg2k deleted the pr/1.10.x-inotify branch September 4, 2023 17:46
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.

2 participants