public static isInteractive ( integer | resource $fileDescriptor = self::STDOUT ) : boolean | ||
$fileDescriptor | integer | resource | |
return | boolean |
public static function isInteractive($fileDescriptor = self::STDOUT)
{
return function_exists('posix_isatty') && @posix_isatty($fileDescriptor);
}
/** * @covers \JBZoo\Utils\Cli::isInteractive */ public function testCanDetectIfFileDescriptorIsInteractive() { $this->assertInternalType('boolean', Cli::isInteractive(STDOUT)); }