Project

General

Profile

Actions

Bug #51422

closed

static abstract problem in AbstractDriver::verifyConfiguration()

Added by Tomasz Krawczyk about 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2013-08-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Tomasz Krawczyk about 11 years ago

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) {}

Actions #2

Updated by Philipp Gampe about 11 years ago

  • 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.

Actions #3

Updated by Alexander Opitz about 11 years ago

  • 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);
Actions #4

Updated by Ernesto Baschny about 11 years ago

  • 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.

Actions #5

Updated by Georg Ringer almost 10 years ago

  • 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

Actions #6

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF