php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73766 Reflection return method name as lowercases
Submitted: 2016-12-16 23:26 UTC Modified: 2021-06-11 16:19 UTC
From: mozek007 at seznam dot cz Assigned: danack (profile)
Status: Closed Package: imagick (PECL)
PHP Version: 7.0.14 OS: unix
Private report: No CVE-ID: None
 [2016-12-16 23:26 UTC] mozek007 at seznam dot cz
Description:
------------
PHP Reflection getMethod->getName return method name as lowercase. 


Test script:
---------------
```
$ref = new \ReflectionClass('Imagick');
var_dump($ref->getMethod('readImageBlob')->getName()); //return lowercase value `readimageblob`. 

problem found here:
https://github.com/phpstan/phpstan/pull/40

Expected result:
----------------
readImageBlob

Actual result:
--------------
readimageblob

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-16 23:36 UTC] mozek007 at seznam dot cz
same problem here: https://github.com/padraic/mockery/issues/162
 [2016-12-16 23:40 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2016-12-16 23:40 UTC] cmb@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Note that `readimageblob` is the canonical name[1] and that method
names are case-insensitive in PHP, anyway.

[1] <https://github.com/mkoppanen/imagick/blob/3.4.2/imagick_class.c#L3766>
 [2016-12-17 00:39 UTC] mozek007 at seznam dot cz
cmb: Thanks for explaining. I think in this case is wrong phpdoc
`public function readImageBlob ($image, $filename = null) {}`

and web documentation: http://php.net/manual/en/imagick.readimageblob.php. 

method names are case-insensitive in PHP: Yes, but united coding style not.
 [2016-12-17 00:52 UTC] cmb@php.net
-Status: Not a bug +Status: Re-Opened -Type: Bug +Type: Documentation Problem
 [2016-12-17 00:52 UTC] cmb@php.net
Okay, reopening as doc bug.
 [2016-12-17 00:52 UTC] cmb@php.net
-Assigned To: cmb +Assigned To:
 [2016-12-20 14:20 UTC] danack@php.net
"but united coding style not."

The decision about case for method names was made a long time ago, by the previous maintainers of Imagick. Imagick is a separate project from PHP, and so isn't required to have a 'united' code style with anything else.

Although I have been thinking about converting the case to be camelCase, it is really not that high on my list of priorities. It would be higher if users of Imagick contributed more to any of:

* the documentation.
* code contributions to support new features of ImageMagick in Imagick.
* cash money (I need to acquire a Windows box to be able to investigate Windows issues, as well as start producing 'official' binaries).
* anyone else helping to investigate issues either here or at https://github.com/mkoppanen/imagick/issues

Just to note, the earliest that changing the internal casing of the methods would possibly happen is for the next major version of Imagick, for which there are other issues https://github.com/mkoppanen/imagick/issues/142
 [2018-01-29 23:47 UTC] vrana@php.net
-Status: Re-Opened +Status: Verified
 [2021-06-11 16:19 UTC] danack@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: danack
 [2021-06-11 16:19 UTC] danack@php.net
This is fixed in the next release of Imagick.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC