php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59382 Make pecl/solr classes non-final
Submitted: 2010-08-23 10:44 UTC Modified: 2011-06-04 04:13 UTC
From: lstrojny@php.net Assigned: iekpo (profile)
Status: Closed Package: solr (PECL)
PHP Version: 5.3.2 OS:
Private report: No CVE-ID: None
 [2010-08-23 10:44 UTC] lstrojny@php.net
Description:
------------
To allow extending pecl/solr classes and allow mocking them with PHPUnit it would be required to remove the final keyword. Attached is a patch which does that for the current trunk version, but should also apply for 0.9.11.

Reproduce code:
---------------
class MockedSolrClient extends SolrClient{}
$client = new MockedSolrClient(array('hostname' => 'localhost'));
var_dump($client);

Expected result:
----------------
object(MockedSolrClient)#1 (1) {
  ["_hashtable_index":"SolrClient":private]=>
  int(16995)
}


Actual result:
--------------
Fatal error: Class MockedSolrClient may not inherit from final class (SolrClient) in Command line code on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-23 20:03 UTC] iekpo@php.net
I will make these changes in the next release.
 [2011-06-04 04:13 UTC] iekpo@php.net
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

This has been fixed in the next release.

Code has been checked into SVN
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC