Skip to content

Instantly share code, notes, and snippets.

@yayaenan
Created January 4, 2019 14:47
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 yayaenan/990a995803b29e23ad8331c4865c4bbb to your computer and use it in GitHub Desktop.
Save yayaenan/990a995803b29e23ad8331c4865c4bbb to your computer and use it in GitHub Desktop.
yaya
<?php
final class Thermostat
{
public function thermostatController($switch,$temperature)
{
if ($switch == "ON"){
if ($temperature >= 23){
return "OFF";
}else{
return "ON";
}
}else{
if($temperature < 5){
return "ON";
}else{
return "OFF";
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment