Translate all code comments from Russian to English [skip ci]

This commit is contained in:
ErickSkrauch
2019-07-15 01:59:56 +03:00
parent 31069562b3
commit 3dbf29d34c
64 changed files with 264 additions and 286 deletions

View File

@@ -1,15 +1,16 @@
<?php
declare(strict_types=1);
namespace api\components\OAuth2\Utils;
class Scopes {
/**
* По стандарту OAuth2 scopes должны разделяться пробелом, а не запятой. Косяк.
* Так что оборачиваем функцию разбора скоупов, заменяя запятые на пробелы.
* Заодно учитываем возможность передать скоупы в виде массива.
* In the earlier versions of Accounts Ely.by backend we had a comma-separated scopes
* list, while by OAuth2 standard it they should be separated by a space. Shit happens :)
* So override scopes validation function to reformat passed value.
*
* @param string|array $scopes
*
* @return string
*/
public static function format($scopes): string {
@@ -21,7 +22,6 @@ class Scopes {
return implode(' ', $scopes);
}
/** @noinspection PhpIncompatibleReturnTypeInspection */
return str_replace(',', ' ', $scopes);
}