summaryrefslogtreecommitdiff
path: root/vendor/thecodingmachine/safe/generated/fileinfo.php
diff options
context:
space:
mode:
authorwn_ <invalid@email.com>2024-12-09 17:58:28 +0000
committerwn_ <invalid@email.com>2024-12-09 17:58:28 +0000
commitf6a8facfd4bfc40025c069eebc37094d826aff58 (patch)
tree871aab0d8adafe736d954cae1783c260699c0ec3 /vendor/thecodingmachine/safe/generated/fileinfo.php
parentcd2c10f9f71409df24fc74c1bbd7d5ddbf48d991 (diff)
Bump 'spomky-labs/otphp' to 11.3.x.
This is mainly for PHP 8.4 compatibility.
Diffstat (limited to 'vendor/thecodingmachine/safe/generated/fileinfo.php')
-rw-r--r--vendor/thecodingmachine/safe/generated/fileinfo.php79
1 files changed, 0 insertions, 79 deletions
diff --git a/vendor/thecodingmachine/safe/generated/fileinfo.php b/vendor/thecodingmachine/safe/generated/fileinfo.php
deleted file mode 100644
index 8bbfd3c47..000000000
--- a/vendor/thecodingmachine/safe/generated/fileinfo.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-
-namespace Safe;
-
-use Safe\Exceptions\FileinfoException;
-
-/**
- * This function closes the instance opened by finfo_open.
- *
- * @param resource $finfo An finfo instance, returned by finfo_open.
- * @throws FileinfoException
- *
- */
-function finfo_close($finfo): void
-{
- error_clear_last();
- $result = \finfo_close($finfo);
- if ($result === false) {
- throw FileinfoException::createFromPhpError();
- }
-}
-
-
-/**
- * Procedural style
- *
- * Object-oriented style (constructor):
- *
- * This function opens a magic database and returns its instance.
- *
- * @param int $flags One or disjunction of more Fileinfo
- * constants.
- * @param string $magic_database Name of a magic database file, usually something like
- * /path/to/magic.mime. If not specified, the
- * MAGIC environment variable is used. If the
- * environment variable isn't set, then PHP's bundled magic database will
- * be used.
- *
- * Passing NULL or an empty string will be equivalent to the default
- * value.
- * @return resource (Procedural style only)
- * Returns an finfo instance on success.
- * @throws FileinfoException
- *
- */
-function finfo_open(int $flags = FILEINFO_NONE, string $magic_database = null)
-{
- error_clear_last();
- if ($magic_database !== null) {
- $result = \finfo_open($flags, $magic_database);
- } else {
- $result = \finfo_open($flags);
- }
- if ($result === false) {
- throw FileinfoException::createFromPhpError();
- }
- return $result;
-}
-
-
-/**
- * Returns the MIME content type for a file as determined by using
- * information from the magic.mime file.
- *
- * @param string|resource $filename Path to the tested file.
- * @return string Returns the content type in MIME format, like
- * text/plain or application/octet-stream.
- * @throws FileinfoException
- *
- */
-function mime_content_type($filename): string
-{
- error_clear_last();
- $result = \mime_content_type($filename);
- if ($result === false) {
- throw FileinfoException::createFromPhpError();
- }
- return $result;
-}