protected function endsWith($needle, $haystack) { return substr($haystack, -strlen($needle)) === $needle; }