Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 7
WindowsWrapper
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 7
 wrap
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 5
 getPriority
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
<?php
namespace Shellbox\Command;
class WindowsWrapper extends Wrapper {
    /**
     * Windows should be the outermost wrapper because of its special quoting
     */
    public const PRIORITY = 80;
    public function wrap( Command $command ) {
        // Windows Shell bypassed, but command run is "cmd.exe /C "{$cmd}"
        // This solves some shell parsing issues, see T207248.
        // This should be unnecessary in PHP 8.0+.
        $command->unsafeCommand(
            'cmd /s /c "' . $command->getCommandString() . '"'
        );
        $command->procOpenOptions( [ 'bypass_shell' => true ] );
    }
    public function getPriority() {
        return self::PRIORITY;
    }
}