/**
* @param string $source
* @param string $destination
*
* @throws \Spatie\Php7to5\Exceptions\InvalidParameter
*/
protected function isEqual($source, $destination)
{
if (!ends_with($destination, DIRECTORY_SEPARATOR)) {
$destination = $destination . DIRECTORY_SEPARATOR;
}
if (!ends_with($source, DIRECTORY_SEPARATOR)) {
$source = $source . DIRECTORY_SEPARATOR;
}
if ($destination === $source) {
throw InvalidParameter::destinationDirectoryIsSource();
}
}