Skip to content

Instantly share code, notes, and snippets.

@lmuzinic
Created January 29, 2018 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmuzinic/2cc2c18c4114cefccb38e749022965d2 to your computer and use it in GitHub Desktop.
Save lmuzinic/2cc2c18c4114cefccb38e749022965d2 to your computer and use it in GitHub Desktop.
Infection
<?php
class User
{
// ...
public function isAdmin()
{
if ($this->status === self::ADMIN) {
return true;
}
return false;
}
}
<?php
class User
{
// ...
- public function isAdmin()
+ protected function isAdmin()
{
if ($this->status === self::ADMIN) {
return true;
}
return false;
}
}
<?php
class User
{
// ...
public function isAdmin()
{
- if ($this->status === self::ADMIN) {
+ if ($this->status !== self::ADMIN) {
return true;
}
return false;
}
}
<?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