Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ jobs:

- name: Run tests
run: vendor/bin/phpstan

- name: Verify documentation
run: ./vendor/bin/mddoc --dry-run=true
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ composer require 'quorum/stream-functions'
### Function: \Quorum\Streams\faccept

```php
function faccept($stream, string ...$accept) : ?string
function faccept($stream, string ...$accept): ?string
```

##### Parameters:
##### Parameters

- ***resource*** `$stream` - The stream to peek, must be a seekable resource
- ***string*** `$accept` - One or more strings to accept

##### Returns:
##### Return Value

- ***string*** | ***null*** - The accepted string or null if none were found

Expand All @@ -47,15 +47,15 @@ If the string is not found, the cursor is reset to its original position.
### Function: \Quorum\Streams\fpeek

```php
function fpeek($stream [, int $length = 1]) : string
function fpeek($stream, int $length = 1): string
```

##### Parameters:
##### Parameters

- ***resource*** `$stream` - The stream to peek, must be a seekable resource
- ***positive-int*** `$length` - Up to length number of bytes read.

##### Returns:
##### Return Value

- ***string*** - The peeked string of up to length bytes

Expand All @@ -66,17 +66,22 @@ The cursor is reset to its original position.
### Function: \Quorum\Streams\funtil

```php
function funtil($stream, string $until [, int $length = 0 [, ?string $buf = null]]) : bool
function funtil(
$stream,
string $until,
int $length = 0,
?string $buf = null,
): bool
```

##### Parameters:
##### Parameters

- ***resource*** `$stream` - The stream to read, must be a seekable resource
- ***string*** `$until` - The string to read until
- ***non-negative-int*** `$length` - The maximum number of bytes to read, defaults to 0 (no limit)
- ***string*** | ***null*** `$buf` - The buffered contents by reference

##### Returns:
##### Return Value

- ***bool***

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"php": "^7.4|^8.0"
},
"require-dev": {
"donatj/mddoc": "^0.11.1",
"donatj/mddoc": "^0.13.0",
"phpstan/phpstan": "^2.2",
"phpunit/phpunit": "^9.6"
},
Expand Down
Loading