Welcome Guest, Not a member yet? Register   Sign In
Declaration of xxx should be compatible with yyy
#1

OK, I just migrated my web app from CI 2.1.4 to CI 3.0.0 and I am now getting a PHP Runtime Notice that shouldn't be related to the upgrade, but nonetheless it's there and I could use some help.

Quote:A PHP Error was encountered
Severity: Runtime Notice
Message: Declaration of Customer:Confusedave() should be compatible with Person:Confusedave(&$person_data, $person_id = false)
Filename: models/Customer.php
Line Number: 243

Here is the context.  Three different times I am extending Person and on methods keeping the base variables, but adding to it.  This means that the save function in Person cannot have the exact same declaration as the classes that extend it.  I would prefer not to just suppress these warnings, but I could use some help getting to the bottom of how to declare these functions so that it doesn't generate the notice.

Customer.php
Code:
class Customer extends Person
{
...
function save(&$person_data, &$customer_data,$customer_id=false)
{
...

Person.php
Code:
class Person extends CI_Model
{
...
function save(&$person_data,$person_id=false)
{
...
Reply


Messages In This Thread
Declaration of xxx should be compatible with yyy - by objecttothis - 04-15-2015, 12:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB