Skip to content

Commit

Permalink
SplFile{Info,Object} stub fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
isfedorov committed Aug 26, 2024
1 parent 2630c46 commit 640e800
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions SPL/SPL_c1.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function getPerms(): int|false {}
* @link https://php.net/manual/en/splfileinfo.getinode.php
* @return int|false The inode number for the filesystem object on success, or <b>FALSE</b> on failure.
* @since 5.1.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getInode(): int|false {}
Expand All @@ -93,6 +94,7 @@ public function getInode(): int|false {}
* @link https://php.net/manual/en/splfileinfo.getsize.php
* @return int|false The filesize in bytes on success, or <b>FALSE</b> on failure.
* @since 5.1.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getSize(): int|false {}
Expand All @@ -102,6 +104,7 @@ public function getSize(): int|false {}
* @link https://php.net/manual/en/splfileinfo.getowner.php
* @return int|false The owner id in numerical format on success, or <b>FALSE</b> on failure.
* @since 5.1.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getOwner(): int|false {}
Expand All @@ -111,6 +114,7 @@ public function getOwner(): int|false {}
* @link https://php.net/manual/en/splfileinfo.getgroup.php
* @return int|false The group id in numerical format on success, or <b>FALSE</b> on failure.
* @since 5.1.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getGroup(): int|false {}
Expand All @@ -120,6 +124,7 @@ public function getGroup(): int|false {}
* @link https://php.net/manual/en/splfileinfo.getatime.php
* @return int|false The time the file was last accessed on success, or <b>FALSE</b> on failure.
* @since 5.1.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getATime(): int|false {}
Expand All @@ -138,6 +143,7 @@ public function getMTime(): int|false {}
* @link https://php.net/manual/en/splfileinfo.getctime.php
* @return int|false The last change time, in a Unix timestamp on success, or <b>FALSE</b> on failure.
* @since 5.1.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getCTime(): int|false {}
Expand All @@ -149,6 +155,7 @@ public function getCTime(): int|false {}
* May be one of file, link,
* or dir
* @since 5.1.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getType(): string|false {}
Expand Down Expand Up @@ -212,6 +219,7 @@ public function isLink(): bool {}
* @link https://php.net/manual/en/splfileinfo.getlinktarget.php
* @return string|false The target of the filesystem link on success, or <b>FALSE</b> on failure.
* @since 5.2.2
* @throws \RuntimeException on error.
*/
#[TentativeType]
public function getLinkTarget(): string|false {}
Expand All @@ -227,23 +235,25 @@ public function getRealPath(): string|false {}

/**
* Gets an SplFileInfo object for the file
* @template T of SplFileInfo
* @link https://php.net/manual/en/splfileinfo.getfileinfo.php
* @param string $class [optional] <p>
* @param class-string<T> $class [optional] <p>
* Name of an <b>SplFileInfo</b> derived class to use.
* </p>
* @return SplFileInfo An <b>SplFileInfo</b> object created for the file.
* @return T An <b>SplFileInfo</b> object created for the file.
* @since 5.1.2
*/
#[TentativeType]
public function getFileInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = null): SplFileInfo {}

/**
* Gets an SplFileInfo object for the path
* @template T of SplFileInfo
* @link https://php.net/manual/en/splfileinfo.getpathinfo.php
* @param string $class [optional] <p>
* @param class-string<T> $class [optional] <p>
* Name of an <b>SplFileInfo</b> derived class to use.
* </p>
* @return SplFileInfo|null A <b>SplFileInfo</b> object for the parent path of the file on success, or <b>NULL</b> on failure.
* @return T|null A <b>SplFileInfo</b> object for the parent path of the file on success, or <b>NULL</b> on failure.
* @since 5.1.2
*/
#[TentativeType]
Expand All @@ -263,6 +273,7 @@ public function getPathInfo(#[LanguageLevelTypeAware(['8.0' => 'string|null'], d
* </p>
* @return SplFileObject The opened file as an <b>SplFileObject</b> object.
* @since 5.1.2
* @throws \RuntimeException If the file cannot be opened (e.g. insufficient access rights).
*/
#[TentativeType]
public function openFile(
Expand All @@ -273,8 +284,9 @@ public function openFile(

/**
* Sets the class name used with <b>SplFileInfo::openFile</b>
* @template T of SplFileObject
* @link https://php.net/manual/en/splfileinfo.setfileclass.php
* @param string $class [optional] <p>
* @param class-string<T> $class [optional] <p>
* The class name to use when openFile() is called.
* </p>
* @return void
Expand All @@ -285,8 +297,9 @@ public function setFileClass(#[LanguageLevelTypeAware(['8.0' => 'string'], defau

/**
* Sets the class used with getFileInfo and getPathInfo
* @template T of SplFileInfo
* @link https://php.net/manual/en/splfileinfo.setinfoclass.php
* @param string $class [optional] <p>
* @param class-string<T> $class [optional] <p>
* The class name to use.
* </p>
* @return void
Expand Down Expand Up @@ -645,6 +658,8 @@ public function __construct(
* Rewind the file to the first line
* @link https://php.net/manual/en/splfileobject.rewind.php
* @return void
*
* @throws RuntimeException If cannot be rewound
*/
#[TentativeType]
public function rewind(): void {}
Expand All @@ -669,6 +684,8 @@ public function valid(): bool {}
* Gets line from file
* @link https://php.net/manual/en/splfileobject.fgets.php
* @return string a string containing the next line from the file.
*
* @throws RuntimeException If the file cannot be read
*/
#[TentativeType]
public function fgets(): string {}
Expand Down Expand Up @@ -970,6 +987,8 @@ public function getFlags(): int {}
* The maximum length of a line.
* </p>
* @return void
*
* @throws DomainException When <i>maxLength</i> is less than zero.
*/
#[TentativeType]
public function setMaxLineLen(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength): void {}
Expand Down Expand Up @@ -1009,6 +1028,7 @@ public function getChildren() {}
* The zero-based line number to seek to.
* </p>
* @return void
* @throws LogicException If the <i>line</i> is negative
*/
#[TentativeType]
public function seek(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $line): void {}
Expand Down

0 comments on commit 640e800

Please sign in to comment.