Created
January 29, 2018 15:02
-
-
Save lmuzinic/2cc2c18c4114cefccb38e749022965d2 to your computer and use it in GitHub Desktop.
Infection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User | |
{ | |
// ... | |
public function isAdmin() | |
{ | |
if ($this->status === self::ADMIN) { | |
return true; | |
} | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User | |
{ | |
// ... | |
- public function isAdmin() | |
+ protected function isAdmin() | |
{ | |
if ($this->status === self::ADMIN) { | |
return true; | |
} | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User | |
{ | |
// ... | |
public function isAdmin() | |
{ | |
- if ($this->status === self::ADMIN) { | |
+ if ($this->status !== self::ADMIN) { | |
return true; | |
} | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User | |
{ | |
// ... | |
public function isAdmin() | |
{ | |
if ($this->status === self::ADMIN) { | |
- return true; | |
+ return false; | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment