diff --git a/admin/survey/SurveyAdmin.php b/admin/survey/SurveyAdmin.php index c4febcab3..9f054498c 100644 --- a/admin/survey/SurveyAdmin.php +++ b/admin/survey/SurveyAdmin.php @@ -37,6 +37,7 @@ * slideshow (prezentacija) * social_network (socialna omrežja - generator imen) * quiz (kviz s pravilnimi/napacnimi odgovori) + * voting (volitve z anonimnimi vabili) * uporabnost (evalvacija strani - split screen) * panel (povezovanje ankete s panelom - npr. Valicon, GFK...) * 360_stopinj (adecco) @@ -1168,6 +1169,18 @@ class SurveyAdmin echo ''; echo ''; echo ''; + } + # volitve + if (isset($modules['voting'])) { + $css = ($this->first_action == A_VOTING) ? 'on' : 'off'; + + echo '
  •  
  • '; + + echo '
  • '; + echo ''; + echo ''; + echo ''; + echo '
  • '; } # napredni parapodatki if (isset($modules['advanced_paradata'])) { @@ -1776,6 +1789,14 @@ class SurveyAdmin || isset($modules['slideshow'])) ? '' : ' side-right'; echo '
  • '; echo '
  • ' . $lang['srv_kviz'] . '
  • '; + } + #volitve + if (isset($modules['voting'])) { + $_active = ($_GET['a'] == A_VOTING) ? ' active' : ''; + $_right = (isset($modules['social_network']) + || isset($modules['slideshow'])) ? '' : ' side-right'; + echo '
  • '; + echo '
  • ' . $lang['srv_voting'] . '
  • '; } #napredni parapodatki if (isset($modules['advanced_paradata'])) { @@ -2183,6 +2204,7 @@ class SurveyAdmin || $_GET['a'] == 'uporabnost' || ($_GET['a'] == 'hierarhija_superadmin' && $hierarhija_type < 5) || $_GET['a'] == 'kviz' + || $_GET['a'] == 'voting' || $_GET['a'] == 'slideshow' || $_GET['a'] == 'vnos' || $_GET['a'] == A_TELEPHONE @@ -2433,6 +2455,7 @@ class SurveyAdmin elseif ($_GET['a'] == 'uporabnost' || ($_GET['a'] == 'hierarhija_superadmin' && $hierarhija_type < 5) || $_GET['a'] == 'kviz' + || $_GET['a'] == 'voting' || $_GET['a'] == 'slideshow' || $_GET['a'] == 'vnos' || $_GET['a'] == A_TELEPHONE @@ -3143,6 +3166,10 @@ class SurveyAdmin echo '
  • '; echo 'checkUserAccess($what='kviz') ? 'class="user_access_locked"' : '').'>' . $lang['srv_vrsta_survey_type_6'] . '
  • '; + # Volitve + echo '
  • '; + echo 'checkUserAccess($what='voting') ? 'class="user_access_locked"' : '').'>' . $lang['srv_vrsta_survey_type_18'] . '
  • '; + # Socialna omrezja echo '
  • '; echo 'checkUserAccess($what='social_network') ? 'class="user_access_locked"' : '').'>' . $lang['srv_vrsta_survey_type_8'] . '
  • '; diff --git a/admin/survey/SurveyAdminAjax.php b/admin/survey/SurveyAdminAjax.php index 531cfa638..3e598b140 100644 --- a/admin/survey/SurveyAdminAjax.php +++ b/admin/survey/SurveyAdminAjax.php @@ -6119,6 +6119,11 @@ class SurveyAdminAjax { $sq = new SurveyQuiz($this->anketa); $sq->displaySettings(); } + elseif ($what == 'voting' && $value == '1'){ + // volitve + $sv = new SurveyVoting($this->anketa); + $sv->displaySettings(); + } elseif ($what == 'advanced_paradata' && $value == '1'){ // kviz $sap = new SurveyAdvancedParadata($this->anketa); diff --git a/admin/survey/SurveyAdminSettings.php b/admin/survey/SurveyAdminSettings.php index 04edbc78d..502edd6a2 100644 --- a/admin/survey/SurveyAdminSettings.php +++ b/admin/survey/SurveyAdminSettings.php @@ -8697,6 +8697,22 @@ class SurveyAdminSettings { } echo ''; } + elseif ($_GET['a'] == 'voting'){ + + echo '
    '.$lang['srv_voting'].''; + echo ''; + echo '
    '; + + echo '
    '; + + echo '
    '; + if(isset($modules['voting'])){ + $sv = new SurveyVoting($this->anketa); + $sv->displaySettings(); + } + echo '
    '; + } elseif ($_GET['a'] == 'advanced_paradata'){ echo '
    '.$lang['srv_advanced_paradata'].''; diff --git a/admin/survey/classes/class.SurveyInfo.php b/admin/survey/classes/class.SurveyInfo.php index 46b8fcc01..590a4c59a 100644 --- a/admin/survey/classes/class.SurveyInfo.php +++ b/admin/survey/classes/class.SurveyInfo.php @@ -725,6 +725,11 @@ class SurveyInfo $module_availible = false; break; + case 'voting': + if(!$userAccess->checkUserAccess($what='voting')) + $module_availible = false; + break; + case 'social_network': if(!$userAccess->checkUserAccess($what='social_network')) $module_availible = false; @@ -792,6 +797,11 @@ class SurveyInfo return false; break; + case 'voting': + if(!$userAccess->checkUserAccess($what='voting')) + return false; + break; + case 'social_network': if(!$userAccess->checkUserAccess($what='social_network')) return false; diff --git a/admin/survey/classes/class.SurveyStatistic.php b/admin/survey/classes/class.SurveyStatistic.php index ca2b4bf28..092775db5 100644 --- a/admin/survey/classes/class.SurveyStatistic.php +++ b/admin/survey/classes/class.SurveyStatistic.php @@ -929,6 +929,10 @@ class SurveyStatistic { $enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_6']; $prefix = ', '; } + if (isset($modules['voting'])) { + $enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_18']; + $prefix = ', '; + } if (isset($modules['phone'])) { $enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_7']; $prefix = ', '; diff --git a/admin/survey/classes/tracking/CrossRoad.php b/admin/survey/classes/tracking/CrossRoad.php index 45d89105b..6dcd8f336 100644 --- a/admin/survey/classes/tracking/CrossRoad.php +++ b/admin/survey/classes/tracking/CrossRoad.php @@ -183,6 +183,7 @@ class CrossRoad { case A_UPORABNOST: case A_HIERARHIJA_SUPERADMIN: case A_KVIZ: + case A_VOTING: case A_ADVANCED_PARADATA: case A_JSON_SURVEY_EXPORT: case A_VNOS: diff --git a/admin/survey/definition.php b/admin/survey/definition.php index 2c265a256..d1e68e676 100644 --- a/admin/survey/definition.php +++ b/admin/survey/definition.php @@ -39,6 +39,7 @@ define("NAVI_HIERARHIJA_SUPERADMIN", "NAVI_HIERARHIJA_SUPERADMIN"); define("NAVI_HIERARHIJA", "NAVI_HIERARHIJA"); define("NAVI_KVIZ", "NAVI_KVIZ"); + define("NAVI_VOTING", "NAVI_VOTING"); define("NAVI_VNOS", "NAVI_VNOS"); define("NAVI_PHONE", "NAVI_PHONE"); define("NAVI_360", "NAVI_360"); @@ -178,6 +179,7 @@ define('A_UPORABNOST', 'uporabnost'); define('A_HIERARHIJA_SUPERADMIN', 'hierarhija_superadmin'); define('A_KVIZ', 'kviz'); + define('A_VOTING', 'voting'); define('A_VNOS', 'vnos'); define('A_PHONE', 'telefon'); # Telefon define('T_PHONE', 'telefon'); # Telefon diff --git a/admin/survey/export/latexclasses/class.LatexStatus.php b/admin/survey/export/latexclasses/class.LatexStatus.php index a4434a7de..590107af3 100644 --- a/admin/survey/export/latexclasses/class.LatexStatus.php +++ b/admin/survey/export/latexclasses/class.LatexStatus.php @@ -261,6 +261,10 @@ class LatexStatus { $enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_6']; $prefix = ', '; } + if ($row['voting'] == 1) { + $enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_18']; + $prefix = ', '; + } if ($row['phone'] == 1) { $enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_7']; $prefix = ', '; diff --git a/admin/survey/modules/mod_voting/class.SurveyVoting.php b/admin/survey/modules/mod_voting/class.SurveyVoting.php new file mode 100644 index 000000000..34133bcc3 --- /dev/null +++ b/admin/survey/modules/mod_voting/class.SurveyVoting.php @@ -0,0 +1,104 @@ + 0){ + $this->anketa = $anketa; + } + } + + + // Nastavitve volitev + public function displaySettings(){ + global $lang; + + echo 'Nastavitve volitev'; + + // Posebne opcije in navodile za anketo kviz + /*echo '
    '.$lang['srv_kviz_navodila_1'].''; + echo '

    '.$lang['srv_kviz_navodila_2'].'

    '; + echo '

    '.$lang['srv_kviz_navodila_3'].'

    '; + echo '

    '.$lang['srv_kviz_navodila_4'].'

    '; + echo '

    '.$lang['srv_kviz_navodila_6'].' '.Help::display('DataPiping').'

    '; + echo '

    '.$lang['srv_kviz_navodila_7'].'

    '; + echo '
    ';*/ + + + /*echo '
    '.$lang['settings'].''; + + // Pridobimo trenutne nastavitve + $settings = $this->getSettings(); + + // Prikaz rezultatov v zakljucku + echo ''.$lang['srv_quiz_results'].':'; + echo ''; + echo ''; + + echo '
    '; + + // Prikaz grafa rezultatov v zakljucku + echo ''.$lang['srv_quiz_results_chart'].':'; + echo ''; + echo ''; + + echo '

    '; + + echo '
    '; + + + // Gumb shrani + echo '
    '; + echo ''; + echo '
    '; + echo '
    '; */ + } + + // Pridobimo trenutne nastavitve kviza za anketo + public function getSettings(){ + + $settings = array(); + + // Default vrednosti + /* $settings['results'] = '1'; + $settings['results_chart'] = '0'; + + $sql = sisplet_query("SELECT * FROM srv_quiz_settings WHERE ank_id='".$this->anketa."'"); + if(mysqli_num_rows($sql) > 0){ + $row = mysqli_fetch_array($sql); + + $settings['results'] = $row['results']; + $settings['results_chart'] = $row['results_chart']; + }*/ + + return $settings; + } + + + public function ajax() { + + if(isset($_GET['a']) && $_GET['a'] == 'save_settings'){ + + /*$results = isset($_POST['results']) ? $_POST['results'] : ''; + $results_chart = isset($_POST['results_chart']) ? $_POST['results_chart'] : '0'; + + $sql = sisplet_query("INSERT INTO srv_quiz_settings + (ank_id, results, results_chart) VALUES ('".$this->anketa."', '".$results."', '".$results_chart."') + ON DUPLICATE KEY UPDATE results='".$results."', results_chart='".$results_chart."'"); + if (!$sql) echo mysqli_error($GLOBALS['connect_db']);*/ + } + + } +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index 60ae7033e..79958fab7 100644 --- a/composer.lock +++ b/composer.lock @@ -257,16 +257,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", "shasum": "" }, "require": { @@ -304,7 +304,7 @@ "keywords": [ "promise" ], - "time": "2020-09-30 07:37:28" + "time": "2021-03-07 09:25:29" }, { "name": "guzzlehttp/psr7", @@ -2261,7 +2261,7 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.19", + "version": "v4.4.20", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", diff --git a/frontend/payments/classes/class.UserAccess.php b/frontend/payments/classes/class.UserAccess.php index 76b0c76df..5796c8fcf 100644 --- a/frontend/payments/classes/class.UserAccess.php +++ b/frontend/payments/classes/class.UserAccess.php @@ -74,6 +74,7 @@ class UserAccess{ 'uporabnost' => 3, // Evalvacija strani (split screen) //'vnos' => 2, // Vnos vprasalnikov 'kviz' => 2, // Kviz + 'voting' => 3, // Volitve 'social_network' => 3, // Socialna omrezja 'slideshow' => 3, // Prezentacija 'telephone' => 3, // Telefonska anketa diff --git a/lang/1.php b/lang/1.php index 1533734cf..89ca4de75 100644 --- a/lang/1.php +++ b/lang/1.php @@ -3034,6 +3034,7 @@ $lang = array ( "srv_vrsta_survey_type_15" => "Panel", "srv_vrsta_survey_type_16" => "Napredni parapodatki", "srv_vrsta_survey_type_17" => "JSON izvoz ankete", + "srv_vrsta_survey_type_18" => "Volitve", "srv_vrsta_survey_with_pool" => "Dodajanje glasovanja", "srv_vrsta_survey_with_form" => "Dodajanje forme", "srv_vrsta_survey_with_conditions" => "Dodajanje pogojev", @@ -3108,6 +3109,7 @@ $lang = array ( "srv_kviz_interpretacije" => "Različne interpretacije", "srv_zakljucek_vprasalnika" => "Zaključek vprašalnika", "srv_kviz_konec_note" => "Če ni izbrana nobena opcija, vidi rezultate samo administrator", + "srv_voting" => "Volitve", "srv_advanced_paradata" => "Napredni parapodatki", "srv_advanced_paradata_collect_post_time" => "Beleži \"post time\"", "srv_json_survey_export" => "JSON izvoz ankete", diff --git a/lang/2.php b/lang/2.php index 265ef1cea..efff1ce74 100644 --- a/lang/2.php +++ b/lang/2.php @@ -3010,6 +3010,7 @@ $lang = array ( "srv_vrsta_survey_type_15" => "Panel", "srv_vrsta_survey_type_16" => "Advanced paradata", "srv_vrsta_survey_type_17" => "JSON survey export", + "srv_vrsta_survey_type_18" => "Voting", "srv_vrsta_survey_with_pool" => "Add vote", "srv_vrsta_survey_with_form" => "Add Form", "srv_vrsta_survey_with_conditions" => "Add conditions", @@ -3080,6 +3081,7 @@ $lang = array ( "srv_kviz_interpretacije" => "Different interpretations", "srv_zakljucek_vprasalnika" => "Survey end", "srv_kviz_konec_note" => "If no option is selected, only administrator can view results", + "srv_voting" => "Voting", "srv_advanced_paradata" => "Advanced paradata", "srv_advanced_paradata_collect_post_time" => "Collect \"post time\"", "srv_json_survey_export" => "JSON survey export", diff --git a/public/css/admin.css b/public/css/admin.css index f3d4838af..fd1575cba 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -7561,6 +7561,10 @@ span.module_icon.quiz::before { content: "Q"; } +span.module_icon.voting::before { + content: "VOTE"; +} + span.module_icon.advanced_paradata::before { content: "AP"; } diff --git a/resources/sass/admin/icons/modules.scss b/resources/sass/admin/icons/modules.scss index 810dbc2f7..a916db9e5 100644 --- a/resources/sass/admin/icons/modules.scss +++ b/resources/sass/admin/icons/modules.scss @@ -48,6 +48,9 @@ span.module_icon.social::before{ span.module_icon.quiz::before{ content: "Q"; } +span.module_icon.voting::before{ + content: "VOTE"; +} span.module_icon.advanced_paradata::before{ content: "AP"; } diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index cb4b211ca..16b646449 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -999,6 +999,7 @@ return array( 'SurveyUserSetting' => $baseDir . '/admin/survey/classes/class.SurveyUserSetting.php', 'SurveyVariablesProfiles' => $baseDir . '/admin/survey/classes/class.SurveyVariablesProfiles.php', 'SurveyVizualizacija' => $baseDir . '/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php', + 'SurveyVoting' => $baseDir . '/admin/survey/modules/mod_voting/class.SurveyVoting.php', 'SurveyZankaProfiles' => $baseDir . '/admin/survey/classes/class.SurveyZankaProfiles.php', 'SurveyZoom' => $baseDir . '/admin/survey/classes/class.SurveyZoom.php', 'Symfony\\Polyfill\\Intl\\Idn\\Idn' => $vendorDir . '/symfony/polyfill-intl-idn/Idn.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index a4b75cc39..876c615d4 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -11,8 +11,8 @@ return array( 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '3109cb1a231dcd04bee1f9f620d46975' => $vendorDir . '/paragonie/sodium_compat/autoload.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', '2bf0564df058fbe21b5554296cc8571a' => $baseDir . '/main/survey/class.EvalvacijaMain.php', '5bc35216aa4f6cb823ce4a5cec52fdce' => $baseDir . '/main/survey/mobile-detect/Mobile_Detect.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 608711b83..974b6dd62 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -12,8 +12,8 @@ class ComposerStaticInit6b03163c371c5541881b55b762b8c779 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '3109cb1a231dcd04bee1f9f620d46975' => __DIR__ . '/..' . '/paragonie/sodium_compat/autoload.php', 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', '2bf0564df058fbe21b5554296cc8571a' => __DIR__ . '/../..' . '/main/survey/class.EvalvacijaMain.php', '5bc35216aa4f6cb823ce4a5cec52fdce' => __DIR__ . '/../..' . '/main/survey/mobile-detect/Mobile_Detect.php', @@ -1203,6 +1203,7 @@ class ComposerStaticInit6b03163c371c5541881b55b762b8c779 'SurveyUserSetting' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyUserSetting.php', 'SurveyVariablesProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyVariablesProfiles.php', 'SurveyVizualizacija' => __DIR__ . '/../..' . '/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php', + 'SurveyVoting' => __DIR__ . '/../..' . '/admin/survey/modules/mod_voting/class.SurveyVoting.php', 'SurveyZankaProfiles' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyZankaProfiles.php', 'SurveyZoom' => __DIR__ . '/../..' . '/admin/survey/classes/class.SurveyZoom.php', 'Symfony\\Polyfill\\Intl\\Idn\\Idn' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Idn.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index aacbfa4d2..ac0ec526a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1204,59 +1204,6 @@ "url" ] }, - { - "name": "guzzlehttp/promises", - "version": "1.4.0", - "version_normalized": "1.4.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "60d379c243457e073cff02bc323a2a86cb355631" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631", - "reference": "60d379c243457e073cff02bc323a2a86cb355631", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "time": "2020-09-30 07:37:28", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ] - }, { "name": "symfony/polyfill-php72", "version": "v1.22.1", @@ -1961,5 +1908,58 @@ "rest", "sdk" ] + }, + { + "name": "guzzlehttp/promises", + "version": "1.4.1", + "version_normalized": "1.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "time": "2021-03-07 09:25:29", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ] } ] diff --git a/vendor/guzzlehttp/promises/.php_cs.dist b/vendor/guzzlehttp/promises/.php_cs.dist deleted file mode 100644 index a321876e8..000000000 --- a/vendor/guzzlehttp/promises/.php_cs.dist +++ /dev/null @@ -1,88 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => ['operators' => ['=>' => null]], - 'blank_line_after_opening_tag' => true, - 'class_attributes_separation' => ['elements' => ['method']], - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => false, - 'dir_constant' => true, - 'final_static_access' => true, - 'fully_qualified_strict_types' => true, - 'function_to_constant' => true, - 'function_typehint_space' => true, - 'header_comment' => false, - 'is_null' => ['use_yoda_style' => false], - 'list_syntax' => ['syntax' => 'short'], - 'lowercase_cast' => true, - 'magic_method_casing' => true, - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - //'native_constant_invocation' => true, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_extra_blank_lines' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_spaces_around_offset' => true, - 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unset_cast' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_in_blank_line' => true, - 'normalize_index_brace' => true, - 'ordered_imports' => true, - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => ['target' => 'newest'], - 'php_unit_dedicate_assert_internal_type' => ['target' => 'newest'], - 'php_unit_expectation' => ['target' => 'newest'], - 'php_unit_mock' => ['target' => 'newest'], - 'php_unit_mock_short_will_return' => true, - 'php_unit_no_expectation_annotation' => ['target' => 'newest'], - 'php_unit_test_annotation' => ['style' => 'prefix'], - //'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - 'phpdoc_align' => ['align' => 'vertical'], - //'phpdoc_line_span' => ['method' => 'multi', 'property' => 'multi'], - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], - 'phpdoc_var_without_name' => true, - 'return_assignment' => true, - 'short_scalar_cast' => true, - 'single_trait_insert_per_statement' => true, - 'standardize_not_equals' => true, - //'static_lambda' => true, - 'ternary_to_null_coalescing' => true, - 'trim_array_spaces' => true, - 'visibility_required' => true, - 'yoda_style' => false, - // 'native_function_invocation' => true, - 'braces' => ['allow_single_line_closure'=>true], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') - ->name('*.php') - ) -; - -return $config; diff --git a/vendor/guzzlehttp/promises/CHANGELOG.md b/vendor/guzzlehttp/promises/CHANGELOG.md index 4b63b2c74..14796c472 100644 --- a/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 1.4.1 - 2021-02-18 + +- Fixed `each_limit` skipping promises and failing ## 1.4.0 - 2020-09-30 diff --git a/vendor/guzzlehttp/promises/phpstan-baseline.neon b/vendor/guzzlehttp/promises/phpstan-baseline.neon deleted file mode 100644 index 26012c2d4..000000000 --- a/vendor/guzzlehttp/promises/phpstan-baseline.neon +++ /dev/null @@ -1,7 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Parameter \\#1 \\$function of function register_shutdown_function expects callable\\(\\)\\: void, Closure\\(\\)\\: mixed given\\.$#" - count: 1 - path: src/TaskQueue.php - diff --git a/vendor/guzzlehttp/promises/phpstan.neon.dist b/vendor/guzzlehttp/promises/phpstan.neon.dist deleted file mode 100644 index b533a8c99..000000000 --- a/vendor/guzzlehttp/promises/phpstan.neon.dist +++ /dev/null @@ -1,10 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - level: 5 - paths: - - src - - ignoreErrors: - - "#^Dead catch - Exception is already caught by Throwable above\\.$#" diff --git a/vendor/guzzlehttp/promises/psalm.xml b/vendor/guzzlehttp/promises/psalm.xml deleted file mode 100644 index 3e4e3d085..000000000 --- a/vendor/guzzlehttp/promises/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/vendor/guzzlehttp/promises/src/EachPromise.php b/vendor/guzzlehttp/promises/src/EachPromise.php index fbb8876c7..748f4712c 100644 --- a/vendor/guzzlehttp/promises/src/EachPromise.php +++ b/vendor/guzzlehttp/promises/src/EachPromise.php @@ -10,6 +10,8 @@ class EachPromise implements PromisorInterface { private $pending = []; + private $nextPendingIndex = 0; + /** @var \Iterator|null */ private $iterable; @@ -121,6 +123,7 @@ class EachPromise implements PromisorInterface $clearFn = function () { $this->iterable = $this->concurrency = $this->pending = null; $this->onFulfilled = $this->onRejected = null; + $this->nextPendingIndex = 0; }; $this->aggregate->then($clearFn, $clearFn); @@ -163,11 +166,9 @@ class EachPromise implements PromisorInterface $promise = Create::promiseFor($this->iterable->current()); $key = $this->iterable->key(); - // Iterable keys may not be unique, so we add the promises at the end - // of the pending array and retrieve the array index being used - $this->pending[] = null; - end($this->pending); - $idx = key($this->pending); + // Iterable keys may not be unique, so we use a counter to + // guarantee uniqueness + $idx = $this->nextPendingIndex++; $this->pending[$idx] = $promise->then( function ($value) use ($idx, $key) {