Hello everyone! I've been trying to figure this out but I don't know what it is going on.
Failed Test 1 - testStatingSomething
CODE RUN
$this->assertEquals("Whatever.", $this->bob->respondTo("Tom-ay-to, tom-aaaah-to."));
TEST ERROR
BobTest::testStatingSomething
ParseError: syntax error, unexpected token "public", expecting end of file
/mnt/exercism-iteration/Bob.php:5
I've tested locally in my computer with the input "Tom-ay-to, tom-aaaah-to." and it works as expected.
I just want to make sure is not a bug. I must have been missing something.
Thank you!
`<?php
declare(strict_types=1);
public function respondTo(string $str): string
{
$output = "";
if (strtolower($str) == $str) {
if (mb_strrchr($str, '?') == true) {
$output = 'Sure.';
}
} elseif (strtoupper($str) == $str) {
if (mb_strrchr($str, '?') == true) {
$output = "Calm down, I know what I'm doing!";
} else {
$output = 'Whoa, chill out!';
}
} elseif (trim($str) == "") {
$output = 'Fine. Be that way!';
} else {
$output = 'Whatever.';
}
return $output;
}
`