Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> niezgodność typów argumentów metody, error: must be an instance of string, string given - wtf?
Can I
post 20.04.2007, 19:14:05
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 7.06.2006
Skąd: Coventry, UK

Ostrzeżenie: (0%)
-----


cześć,

mam interfejs:
  1. <?php
  2. interface UserDAO {
  3.  
  4. public function findUsersByFornameSurnameOrEmail( string $queryStr );
  5.  
  6. }
  7. ?>


i implementację w MySQLUserDAO. testuję to sobie i dostaję taki błąd:

Cytat
Argument 1 passed to MySQLUserDAO::findUsersByFornameSurnameOrEmail() must be an instance
of string, string given, called in (...)


wywołanie w teście wygląda tak:

  1. <?php
  2. $queryStr = "jan";
  3. $actualUsers = $this->dao->findUsersByFornameSurnameOrEmail( $queryStr );
  4. ?>


czy te typy argumentów to muszą być typy zdefiniowane przeze mnie, a nie wbudowane w PHP?

Ten post edytował Can I 20.04.2007, 19:18:53


--------------------
stay all night, we're save the population
flash / flex / web developer
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 26.04.2024 - 11:12