-1

I just open this topic because i'm trying to figure this out for days....

Error_log [08-Aug-2013 14:57:37 UTC] PHP Strict Standards: Declaration of uploaded::Download() should be compatible with DownloadClass::Download($link, $FileName, $cookie = 0, $post = 0, $referer = '', $caching = false) in /home/srv26/public_html/hosts/uploaded.class.php on line 3

Line 3:

final class uploaded extends DownloadClass implements Hosts {

Does anyeone have any idea of this error? Thanks for all! =)

final class uploaded extends DownloadClass implements Hosts {
    public static function Download($link, $caching = false) {
        parent::Download($Frag, '', $Cookies, 0, '', $caching);
    }
}


abstract class DownloadClass extends cmmf {
    protected static function Download($link, $FileName, $cookie = 0, $post = 0, $referer = '', $caching = false){
        [..........]
    }
}

uploaded.class The file is like this...

final class uploaded extends DownloadClass implements Hosts {
    public static function Download($link, $caching = false) {
        parent::Download($Frag, '', $Cookies, 0, '', $caching);
    }
}

DownloadClass

abstract class DownloadClass extends cmmf {
    protected static function Download($link, $FileName, $cookie = 0, $post = 0, $referer = '', $caching = false){
        [..........]
    }
}
Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
user758499
  • 21
  • 5

1 Answers1

0

Easy thing:

The two definitions of the Download function differ.

Make them the same.

The point of extending an abstract class is that the abstract class sets the template for ALL methods that any child class might have, so that it does not matter for any consuming code to check WHICH incarnation of child class it has to deal with.

So you wanted to have a shortcut parameter list that gets filled with defined default variables. That will work only if you create a new function name. If you are using the same function name, that error will stay.

Sven
  • 69,403
  • 10
  • 107
  • 109
  • Could you give me an example of that, please? Please check the other post here with part of the file.. – user758499 Aug 08 '13 at 19:35
  • The `DownloadClass::Download()` method has 6 parameters. The `uploaded::Download()` method has only 2. It MUST have 6 of the same type. – Sven Aug 08 '13 at 19:37
  • Man, thank you veeeeeeeeeeeeeeeery much!!!!! I change the Download for DownloadFile and its ok now =)) – user758499 Aug 08 '13 at 20:13