xref: /PHP-8.1/ext/fileinfo/fileinfo.stub.php (revision 50f31829)
1<?php
2
3/** @generate-class-entries */
4
5/** @not-serializable */
6class finfo
7{
8    /** @alias finfo_open */
9    public function __construct(int $flags = FILEINFO_NONE, ?string $magic_database = null) {}
10
11    /**
12     * @param resource|null $context
13     * @tentative-return-type
14     * @alias finfo_file
15     */
16    public function file(string $filename, int $flags = FILEINFO_NONE, $context = null): string|false {}
17
18    /**
19     * @param resource|null $context
20     * @tentative-return-type
21     * @alias finfo_buffer
22     */
23    public function buffer(string $string, int $flags = FILEINFO_NONE, $context = null): string|false {}
24
25    /**
26     * @return bool
27     * @alias finfo_set_flags
28     */
29    public function set_flags(int $flags) {} // TODO make return type void
30}
31
32/** @refcount 1 */
33function finfo_open(int $flags = FILEINFO_NONE, ?string $magic_database = null): finfo|false {}
34
35function finfo_close(finfo $finfo): bool {}
36
37function finfo_set_flags(finfo $finfo, int $flags): bool {} // TODO make return type void
38
39/**
40 * @param resource|null $context
41 * @refcount 1
42 */
43function finfo_file(finfo $finfo, string $filename, int $flags = FILEINFO_NONE, $context = null): string|false {}
44
45/**
46 * @param resource|null $context
47 * @refcount 1
48 */
49function finfo_buffer(finfo $finfo, string $string, int $flags = FILEINFO_NONE, $context = null): string|false {}
50
51/**
52 * @param resource|string $filename
53 * @refcount 1
54 */
55function mime_content_type($filename): string|false {}
56