public static function getComposerExecutor()
    {
        $executor = PHP_BINARY . ' ';
        $composer = static::getComposerLocation();

        if ($composer !== static::DEFAULT_PATH && is_executable($composer)) {
            $file = fopen($composer, 'rb');
            $firstLine = fgets($file);
            fclose($file);

            if (!preg_match('/^#!.+php/i', $firstLine)) {
                $executor = '';
            }
        }

        return $executor . $composer;
    }