File "NoopCommandConnectivityChecker.php"
Full path: /home/orbitecv/orbite-school.orbit.et/vendor/league/flysystem/src/Ftp/NoopCommandConnectivityChecker.php
File size: 602 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Edit Back
<?php
declare(strict_types=1);
namespace League\Flysystem\Ftp;
use TypeError;
use ValueError;
class NoopCommandConnectivityChecker implements ConnectivityChecker
{
public function isConnected($connection): bool
{
// @codeCoverageIgnoreStart
try {
$response = @ftp_raw($connection, 'NOOP');
} catch (TypeError | ValueError $typeError) {
return false;
}
// @codeCoverageIgnoreEnd
$responseCode = $response ? (int) preg_replace('/\D/', '', implode('', $response)) : false;
return $responseCode === 200;
}
}