Bug #51422
closed
static abstract problem in AbstractDriver::verifyConfiguration()
Added by Tomasz Krawczyk about 11 years ago.
Updated about 6 years ago.
Category:
File Abstraction Layer (FAL)
Description
Such an error message I hawe in m y log:
PHP Runtime Notice: Static function TYPO3\\CMS\\Core\\Resource\\Driver\\AbstractDriver::verifyConfiguration() should not be abstract in D:\\wamp\\www\\typo3_src-6.1.3\\typo3\\sysext\\core\\Classes\\Resource\\Driver\\AbstractDriver.php line 144
Method is defined:
static abstract public function verifyConfiguration(array $configuration);
TYPO3 6.1.3, PHP 5.4.16.
For me it wotks if that method is empty but not abstract.
/**
* Checks if a configuration is valid for this driver.
* Throws an exception if a configuration will not work.
*
* @abstract
* @param array $configuration
* @return void
*/
static public function verifyConfiguration(array $configuration) {}
- Status changed from New to Needs Feedback
This looks like a concept bug. Static methods should not be used that way. The abstract shows, that the function should not have been static in first place.
- Category changed from Code Cleanup to File Abstraction Layer (FAL)
- Status changed from Needs Feedback to New
- Assignee set to Andreas Wolf
@Andreas Otto †
Can you confirm that the function definition should be:
abstract public function verifyConfiguration(array $configuration);
- Status changed from New to Accepted
- Assignee deleted (
Andreas Wolf)
I guess not, because the purpose of this method is probably to verify the $configuration BEFORE making an instance of a Driver, so this method has to be static and not bound to a specific object.
"static abstract" is indeed not correct. PHP simply copies static methods from super to subclasses if they are not declared in the subclass.
What we would need is a DriverInterface which provides just the signature of methods required to be implemented (being the "static verifyConfiguration" one of them). The AbstractDriver shouldn't then provide any implementation for this.
On the other hand, this feature "verifyConfiguration" is not used anywhere so we might also as well get rid of it.
- Status changed from Accepted to Resolved
- Is Regression set to No
verifyConfiguration can't be found in the master core anymore. therefore I am closing this one
- Status changed from Resolved to Closed
Also available in: Atom
PDF