57 $bytes[3] = strval(intval($bytes[3]) + 1);
58 }
59 // TODO: if this ip reaches config('custom.physical-last-ip'), we should do something
60 $this->ip =implode('.', $bytes);61 Log::info($this->ip . " is now attached to " . $this->mac_address . " for user " . $this->user->name);
62 } else {
63 Log::info($this->ip . " is now detached from " . $this->mac_address . " for user " . $this->user->name);
61 Log::info($this->ip . " is now attached to " . $this->mac_address . " for user " . $this->user->name);
62 } else {
63 Log::info($this->ip . " is now detached from " . $this->mac_address . " for user " . $this->user->name);
64 $this->ip = null;65 }
66 $this->saveQuietly();
67 }
This issue is raised when an attempt is made to access an undefined property. This may not have been intended, and it is advisable to give the code another look to make sure the property is defined in the scope it is used in.
class User
{
private string $firstName = 'John';
public function getFirstName(): void
{
return $this->firstName;
}
public function getLastName(): void
{
return $this->lastName; // invalid: property "lastName" is not defined
}
}
class User
{
private string $firstName = 'John';
private string $lastName = 'Doe';
public function getFirstName(): void
{
return $this->firstName;
}
public function getLastName(): void
{
return $this->lastName;
}
}