php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #68337 Object-Oriented version of finfo is not properly documented
Submitted: 2014-11-01 16:43 UTC Modified: 2014-11-03 11:55 UTC
From: teo8976 at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: teo8976 at gmail dot com
New email:
PHP Version: OS:

 

 [2014-11-01 16:43 UTC] teo8976 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.finfo-open
---

Figuring out the interface of the Finfo class is ridiculously cumbersome. It's left to the reader's educated guesses.

For comparison, have a look at how other classes are documented:
http://es1.php.net/manual/en/class.mysqli.php
http://es1.php.net/manual/en/class.simplexmlelement.php

There's no such kind of documentation for the Finfo class.
At http://php.net/manual/en/book.fileinfo.php it is not even mentioned that it exists as a class. The sections of the documentation include a "Fileinfo functions" section and nothing about the Finfo class. At first sight, one couldn't even tell there exists an Object-Oriented API at all!

Then only by browsing the function reference, you find out that there exists an object oriented API, as all functions are presented like this:

  Procedural style:
  string finfo_file ( resource $finfo , string $file_name = NULL [, int $options = FILEINFO_NONE [, resource $context = NULL ]] )

  Object oriented style:
  public string finfo::file ( string $file_name = NULL [, int $options = FILEINFO_NONE [, resource $context = NULL ]] )


So that allows me to figure out that there exists a Finfo class. If, however, I want to look for a reference for that class, I have a hard time finding out information. There's no reference page for that class (or if there is one, it's hidden somewhere). In order to find out the documentation of its constructor, I have to GUESS that the constructor is the OO-equivalent of the function finfo_open(). If I want a list of method of the class I have to build it myself by looking at the list of functions, browse the documentation page of each one of them to see its corresponding method in the finfo class.

This is pathetic. It even discourages Object Oriented programming which should instead be encouraged.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-03 11:55 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=335155
Log: Add OO documentation for finfo.

Fixes doc bug #68337 (Object-Oriented version of finfo is not properly
documented).
 [2014-11-03 11:55 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2014-11-03 11:55 UTC] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC