From 567639dff545eeb5f62d1b39e65750489e3a7574 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Sun, 27 Mar 2022 10:15:50 +0200 Subject: [PATCH] Improve updater --- composer.json | 1 - composer.lock | 785 +--------- index.php | 27 +- src/classes/page.php | 10 - src/functions/deleteDirectory.php | 28 - src/pages/maintenance.php | 31 + src/pages/update.php | 75 +- vendor/clue/stream-filter/.github/FUNDING.yml | 2 - vendor/clue/stream-filter/CHANGELOG.md | 86 -- vendor/clue/stream-filter/LICENSE | 21 - vendor/clue/stream-filter/README.md | 326 ----- vendor/clue/stream-filter/composer.json | 26 - .../clue/stream-filter/src/CallbackFilter.php | 120 -- vendor/clue/stream-filter/src/functions.php | 327 ----- .../stream-filter/src/functions_include.php | 6 - vendor/composer/ClassLoader.php | 117 +- vendor/composer/InstalledVersions.php | 826 ++++++----- vendor/composer/autoload_files.php | 10 +- vendor/composer/autoload_psr4.php | 11 - vendor/composer/autoload_real.php | 9 +- vendor/composer/autoload_static.php | 66 +- vendor/composer/installed.json | 817 ----------- vendor/composer/installed.php | 610 ++++---- vendor/knplabs/github-api/CHANGELOG-3.X.md | 114 -- vendor/knplabs/github-api/CHANGELOG.md | 438 ------ vendor/knplabs/github-api/LICENSE | 22 - vendor/knplabs/github-api/README.md | 134 -- vendor/knplabs/github-api/UPGRADE-3.0.md | 21 - vendor/knplabs/github-api/UPGRADE-4.0.md | 11 - vendor/knplabs/github-api/composer.json | 63 - .../github-api/lib/Github/Api/AbstractApi.php | 224 --- .../lib/Github/Api/AcceptHeaderTrait.php | 66 - .../github-api/lib/Github/Api/Apps.php | 201 --- .../lib/Github/Api/Authorizations.php | 65 - .../github-api/lib/Github/Api/CurrentUser.php | 193 --- .../lib/Github/Api/CurrentUser/Emails.php | 94 -- .../lib/Github/Api/CurrentUser/Followers.php | 71 - .../Github/Api/CurrentUser/Memberships.php | 48 - .../Github/Api/CurrentUser/Notifications.php | 145 -- .../lib/Github/Api/CurrentUser/PublicKeys.php | 74 - .../lib/Github/Api/CurrentUser/Starring.php | 97 -- .../lib/Github/Api/CurrentUser/Watchers.php | 75 - .../github-api/lib/Github/Api/Deployment.php | 133 -- .../github-api/lib/Github/Api/Enterprise.php | 51 - .../lib/Github/Api/Enterprise/License.php | 20 - .../Api/Enterprise/ManagementConsole.php | 77 - .../lib/Github/Api/Enterprise/Stats.php | 128 -- .../lib/Github/Api/Enterprise/UserAdmin.php | 36 - .../lib/Github/Api/Gist/Comments.php | 101 -- .../github-api/lib/Github/Api/Gists.php | 182 --- .../github-api/lib/Github/Api/GitData.php | 59 - .../lib/Github/Api/GitData/Blobs.php | 68 - .../lib/Github/Api/GitData/Commits.php | 48 - .../lib/Github/Api/GitData/References.php | 156 -- .../lib/Github/Api/GitData/Tags.php | 65 - .../lib/Github/Api/GitData/Trees.php | 64 - .../github-api/lib/Github/Api/GraphQL.php | 48 - .../github-api/lib/Github/Api/Issue.php | 241 --- .../lib/Github/Api/Issue/Assignees.php | 91 -- .../lib/Github/Api/Issue/Comments.php | 133 -- .../lib/Github/Api/Issue/Events.php | 54 - .../lib/Github/Api/Issue/Labels.php | 192 --- .../lib/Github/Api/Issue/Milestones.php | 139 -- .../lib/Github/Api/Issue/Timeline.php | 34 - .../github-api/lib/Github/Api/Markdown.php | 49 - .../github-api/lib/Github/Api/Meta.php | 23 - .../Api/Miscellaneous/CodeOfConduct.php | 44 - .../lib/Github/Api/Miscellaneous/Emojis.php | 20 - .../Github/Api/Miscellaneous/Gitignore.php | 34 - .../lib/Github/Api/Miscellaneous/Licenses.php | 34 - .../lib/Github/Api/Notification.php | 91 -- .../lib/Github/Api/Organization.php | 134 -- .../Api/Organization/Actions/Secrets.php | 144 -- .../lib/Github/Api/Organization/Hooks.php | 111 -- .../lib/Github/Api/Organization/Members.php | 75 - .../Api/Organization/OutsideCollaborators.php | 52 - .../lib/Github/Api/Organization/Projects.php | 23 - .../lib/Github/Api/Organization/Teams.php | 121 -- .../Github/Api/Project/AbstractProjectApi.php | 45 - .../lib/Github/Api/Project/Cards.php | 60 - .../lib/Github/Api/Project/Columns.php | 73 - .../github-api/lib/Github/Api/PullRequest.php | 198 --- .../lib/Github/Api/PullRequest/Comments.php | 153 -- .../lib/Github/Api/PullRequest/Review.php | 211 --- .../Github/Api/PullRequest/ReviewRequest.php | 72 - .../github-api/lib/Github/Api/RateLimit.php | 70 - .../Api/RateLimit/RateLimitResource.php | 73 - .../github-api/lib/Github/Api/Repo.php | 823 ----------- .../Api/Repository/Actions/Artifacts.php | 82 -- .../Github/Api/Repository/Actions/Secrets.php | 95 -- .../Repository/Actions/SelfHostedRunners.php | 65 - .../Api/Repository/Actions/WorkflowJobs.php | 54 - .../Api/Repository/Actions/WorkflowRuns.php | 155 -- .../Api/Repository/Actions/Workflows.php | 82 -- .../lib/Github/Api/Repository/Assets.php | 123 -- .../Api/Repository/Checks/CheckRuns.php | 86 -- .../Api/Repository/Checks/CheckSuites.php | 74 - .../Github/Api/Repository/Collaborators.php | 84 -- .../lib/Github/Api/Repository/Comments.php | 75 - .../lib/Github/Api/Repository/Commits.php | 33 - .../lib/Github/Api/Repository/Contents.php | 297 ---- .../lib/Github/Api/Repository/DeployKeys.php | 49 - .../lib/Github/Api/Repository/Downloads.php | 60 - .../lib/Github/Api/Repository/Forks.php | 27 - .../lib/Github/Api/Repository/Hooks.php | 57 - .../lib/Github/Api/Repository/Labels.php | 43 - .../lib/Github/Api/Repository/Pages.php | 60 - .../lib/Github/Api/Repository/Projects.php | 23 - .../lib/Github/Api/Repository/Protection.php | 440 ------ .../lib/Github/Api/Repository/Releases.php | 127 -- .../lib/Github/Api/Repository/Stargazers.php | 40 - .../lib/Github/Api/Repository/Statuses.php | 63 - .../lib/Github/Api/Repository/Traffic.php | 67 - .../github-api/lib/Github/Api/Search.php | 130 -- .../github-api/lib/Github/Api/User.php | 249 ---- .../github-api/lib/Github/AuthMethod.php | 30 - .../knplabs/github-api/lib/Github/Client.php | 428 ------ .../Exception/ApiLimitExceedException.php | 46 - .../Exception/BadMethodCallException.php | 10 - .../lib/Github/Exception/ErrorException.php | 10 - .../Github/Exception/ExceptionInterface.php | 9 - .../Exception/InvalidArgumentException.php | 10 - .../Exception/MissingArgumentException.php | 25 - .../lib/Github/Exception/RuntimeException.php | 10 - .../Github/Exception/SsoRequiredException.php | 31 - ...oFactorAuthenticationRequiredException.php | 30 - .../Exception/ValidationFailedException.php | 12 - .../lib/Github/HttpClient/Builder.php | 214 --- .../HttpClient/Message/ResponseMediator.php | 90 -- .../HttpClient/Plugin/Authentication.php | 71 - .../Plugin/GithubExceptionThrower.php | 160 -- .../lib/Github/HttpClient/Plugin/History.php | 44 - .../Github/HttpClient/Plugin/PathPrepend.php | 46 - .../github-api/lib/Github/ResultPager.php | 212 --- .../lib/Github/ResultPagerInterface.php | 104 -- vendor/knplabs/github-api/phpstan.neon.dist | 15 - vendor/php-http/cache-plugin/CHANGELOG.md | 117 -- vendor/php-http/cache-plugin/LICENSE | 19 - vendor/php-http/cache-plugin/README.md | 46 - vendor/php-http/cache-plugin/composer.json | 42 - .../php-http/cache-plugin/phpstan.neon.dist | 5 - .../src/Cache/Generator/CacheKeyGenerator.php | 20 - .../Generator/HeaderCacheKeyGenerator.php | 38 - .../src/Cache/Generator/SimpleGenerator.php | 23 - .../Cache/Listener/AddHeaderCacheListener.php | 40 - .../src/Cache/Listener/CacheListener.php | 28 - .../php-http/cache-plugin/src/CachePlugin.php | 464 ------ .../src/Exception/RewindStreamException.php | 12 - vendor/php-http/client-common/.php_cs.dist | 24 - vendor/php-http/client-common/CHANGELOG.md | 276 ---- vendor/php-http/client-common/LICENSE | 19 - vendor/php-http/client-common/README.md | 55 - vendor/php-http/client-common/composer.json | 67 - .../client-common/src/BatchClient.php | 42 - .../src/BatchClientInterface.php | 34 - .../client-common/src/BatchResult.php | 157 -- .../php-http/client-common/src/Deferred.php | 152 -- .../src/EmulatedHttpAsyncClient.php | 25 - .../client-common/src/EmulatedHttpClient.php | 24 - .../src/Exception/BatchException.php | 37 - .../CircularRedirectionException.php | 16 - .../src/Exception/ClientErrorException.php | 16 - .../Exception/HttpClientNoMatchException.php | 33 - .../Exception/HttpClientNotFoundException.php | 16 - .../src/Exception/LoopException.php | 16 - .../MultipleRedirectionException.php | 16 - .../src/Exception/ServerErrorException.php | 16 - .../client-common/src/FlexibleHttpClient.php | 36 - .../src/HttpAsyncClientDecorator.php | 31 - .../src/HttpAsyncClientEmulator.php | 39 - .../client-common/src/HttpClientDecorator.php | 32 - .../client-common/src/HttpClientEmulator.php | 35 - .../client-common/src/HttpClientPool.php | 24 - .../src/HttpClientPool/HttpClientPool.php | 70 - .../src/HttpClientPool/HttpClientPoolItem.php | 181 --- .../HttpClientPool/LeastUsedClientPool.php | 45 - .../src/HttpClientPool/RandomClientPool.php | 31 - .../HttpClientPool/RoundRobinClientPool.php | 42 - .../client-common/src/HttpClientRouter.php | 74 - .../src/HttpClientRouterInterface.php | 27 - .../client-common/src/HttpMethodsClient.php | 150 -- .../src/HttpMethodsClientInterface.php | 116 -- vendor/php-http/client-common/src/Plugin.php | 33 - .../src/Plugin/AddHostPlugin.php | 76 - .../src/Plugin/AddPathPlugin.php | 78 - .../src/Plugin/AuthenticationPlugin.php | 38 - .../src/Plugin/BaseUriPlugin.php | 57 - .../src/Plugin/ContentLengthPlugin.php | 39 - .../src/Plugin/ContentTypePlugin.php | 122 -- .../client-common/src/Plugin/CookiePlugin.php | 180 --- .../src/Plugin/DecoderPlugin.php | 135 -- .../client-common/src/Plugin/ErrorPlugin.php | 92 -- .../src/Plugin/HeaderAppendPlugin.php | 48 - .../src/Plugin/HeaderDefaultsPlugin.php | 46 - .../src/Plugin/HeaderRemovePlugin.php | 44 - .../src/Plugin/HeaderSetPlugin.php | 44 - .../src/Plugin/HistoryPlugin.php | 49 - .../client-common/src/Plugin/Journal.php | 33 - .../src/Plugin/QueryDefaultsPlugin.php | 50 - .../src/Plugin/RedirectPlugin.php | 265 ---- .../src/Plugin/RequestMatcherPlugin.php | 56 - .../src/Plugin/RequestSeekableBodyPlugin.php | 29 - .../src/Plugin/ResponseSeekableBodyPlugin.php | 32 - .../client-common/src/Plugin/RetryPlugin.php | 179 --- .../src/Plugin/SeekableBodyPlugin.php | 47 - .../src/Plugin/VersionBridgePlugin.php | 24 - .../client-common/src/PluginChain.php | 62 - .../client-common/src/PluginClient.php | 130 -- .../client-common/src/PluginClientBuilder.php | 76 - .../client-common/src/PluginClientFactory.php | 68 - .../client-common/src/VersionBridgeClient.php | 24 - vendor/php-http/discovery/CHANGELOG.md | 315 ---- vendor/php-http/discovery/LICENSE | 19 - vendor/php-http/discovery/README.md | 46 - vendor/php-http/discovery/composer.json | 50 - .../php-http/discovery/src/ClassDiscovery.php | 252 ---- vendor/php-http/discovery/src/Exception.php | 12 - .../ClassInstantiationFailedException.php | 14 - .../Exception/DiscoveryFailedException.php | 51 - .../Exception/NoCandidateFoundException.php | 47 - .../src/Exception/NotFoundException.php | 16 - .../Exception/PuliUnavailableException.php | 12 - .../StrategyUnavailableException.php | 15 - .../src/HttpAsyncClientDiscovery.php | 32 - .../discovery/src/HttpClientDiscovery.php | 32 - .../discovery/src/MessageFactoryDiscovery.php | 34 - .../discovery/src/NotFoundException.php | 14 - .../discovery/src/Psr17FactoryDiscovery.php | 136 -- .../discovery/src/Psr18ClientDiscovery.php | 32 - .../src/Strategy/CommonClassesStrategy.php | 185 --- .../Strategy/CommonPsr17ClassesStrategy.php | 105 -- .../src/Strategy/DiscoveryStrategy.php | 23 - .../src/Strategy/MockClientStrategy.php | 27 - .../src/Strategy/PuliBetaStrategy.php | 92 -- .../discovery/src/StreamFactoryDiscovery.php | 34 - .../discovery/src/UriFactoryDiscovery.php | 34 - .../php-http/httplug/.php-cs-fixer.dist.php | 16 - vendor/php-http/httplug/CHANGELOG.md | 136 -- vendor/php-http/httplug/LICENSE | 20 - vendor/php-http/httplug/README.md | 62 - vendor/php-http/httplug/composer.json | 45 - vendor/php-http/httplug/puli.json | 12 - vendor/php-http/httplug/src/Exception.php | 14 - .../httplug/src/Exception/HttpException.php | 65 - .../src/Exception/NetworkException.php | 28 - .../src/Exception/RequestAwareTrait.php | 26 - .../src/Exception/RequestException.php | 29 - .../src/Exception/TransferException.php | 14 - .../php-http/httplug/src/HttpAsyncClient.php | 25 - vendor/php-http/httplug/src/HttpClient.php | 15 - .../src/Promise/HttpFulfilledPromise.php | 54 - .../src/Promise/HttpRejectedPromise.php | 58 - vendor/php-http/message-factory/CHANGELOG.md | 65 - vendor/php-http/message-factory/LICENSE | 19 - vendor/php-http/message-factory/README.md | 36 - vendor/php-http/message-factory/composer.json | 27 - vendor/php-http/message-factory/puli.json | 43 - .../message-factory/src/MessageFactory.php | 12 - .../message-factory/src/RequestFactory.php | 34 - .../message-factory/src/ResponseFactory.php | 35 - .../message-factory/src/StreamFactory.php | 25 - .../message-factory/src/UriFactory.php | 24 - vendor/php-http/message/CHANGELOG.md | 254 ---- vendor/php-http/message/LICENSE | 19 - vendor/php-http/message/README.md | 51 - vendor/php-http/message/apigen.neon | 6 - vendor/php-http/message/composer.json | 68 - vendor/php-http/message/puli.json | 111 -- .../php-http/message/src/Authentication.php | 25 - .../src/Authentication/AutoBasicAuth.php | 48 - .../message/src/Authentication/BasicAuth.php | 44 - .../message/src/Authentication/Bearer.php | 37 - .../message/src/Authentication/Chain.php | 47 - .../message/src/Authentication/Header.php | 36 - .../message/src/Authentication/Matching.php | 69 - .../message/src/Authentication/QueryParam.php | 47 - .../src/Authentication/RequestConditional.php | 43 - .../message/src/Authentication/Wsse.php | 68 - .../message/src/Builder/ResponseBuilder.php | 146 -- vendor/php-http/message/src/Cookie.php | 524 ------- vendor/php-http/message/src/CookieJar.php | 212 --- vendor/php-http/message/src/CookieUtil.php | 53 - .../src/Decorator/MessageDecorator.php | 133 -- .../src/Decorator/RequestDecorator.php | 86 -- .../src/Decorator/ResponseDecorator.php | 55 - .../message/src/Decorator/StreamDecorator.php | 138 -- .../message/src/Encoding/ChunkStream.php | 39 - .../message/src/Encoding/CompressStream.php | 45 - .../message/src/Encoding/DechunkStream.php | 29 - .../message/src/Encoding/DecompressStream.php | 45 - .../message/src/Encoding/DeflateStream.php | 41 - .../message/src/Encoding/Filter/Chunk.php | 31 - .../message/src/Encoding/FilteredStream.php | 234 --- .../message/src/Encoding/GzipDecodeStream.php | 45 - .../message/src/Encoding/GzipEncodeStream.php | 45 - .../message/src/Encoding/InflateStream.php | 45 - vendor/php-http/message/src/Exception.php | 10 - .../Exception/UnexpectedValueException.php | 9 - vendor/php-http/message/src/Formatter.php | 35 - .../src/Formatter/CurlCommandFormatter.php | 103 -- .../Formatter/FullHttpMessageFormatter.php | 116 -- .../message/src/Formatter/SimpleFormatter.php | 52 - .../DiactorosMessageFactory.php | 82 -- .../MessageFactory/GuzzleMessageFactory.php | 55 - .../src/MessageFactory/SlimMessageFactory.php | 74 - .../php-http/message/src/RequestMatcher.php | 26 - .../RequestMatcher/CallbackRequestMatcher.php | 32 - .../RequestMatcher/RegexRequestMatcher.php | 41 - .../src/RequestMatcher/RequestMatcher.php | 78 - .../message/src/Stream/BufferedStream.php | 273 ---- .../StreamFactory/DiactorosStreamFactory.php | 48 - .../src/StreamFactory/GuzzleStreamFactory.php | 28 - .../src/StreamFactory/SlimStreamFactory.php | 39 - .../src/UriFactory/DiactorosUriFactory.php | 36 - .../src/UriFactory/GuzzleUriFactory.php | 29 - .../message/src/UriFactory/SlimUriFactory.php | 33 - vendor/php-http/message/src/filters.php | 6 - .../multipart-stream-builder/CHANGELOG.md | 78 - .../php-http/multipart-stream-builder/LICENSE | 19 - .../multipart-stream-builder/README.md | 38 - .../multipart-stream-builder/composer.json | 44 - .../src/ApacheMimetypeHelper.php | 142 -- .../src/CustomMimetypeHelper.php | 51 - .../src/MimetypeHelper.php | 27 - .../src/MultipartStreamBuilder.php | 355 ----- vendor/php-http/promise/CHANGELOG.md | 48 - vendor/php-http/promise/LICENSE | 19 - vendor/php-http/promise/README.md | 48 - vendor/php-http/promise/composer.json | 38 - .../php-http/promise/src/FulfilledPromise.php | 58 - vendor/php-http/promise/src/Promise.php | 69 - .../php-http/promise/src/RejectedPromise.php | 58 - vendor/psr/cache/CHANGELOG.md | 16 - vendor/psr/cache/LICENSE.txt | 19 - vendor/psr/cache/README.md | 12 - vendor/psr/cache/composer.json | 25 - vendor/psr/cache/src/CacheException.php | 10 - vendor/psr/cache/src/CacheItemInterface.php | 105 -- .../psr/cache/src/CacheItemPoolInterface.php | 138 -- .../cache/src/InvalidArgumentException.php | 13 - vendor/symfony/options-resolver/CHANGELOG.md | 86 -- .../Debug/OptionsResolverIntrospector.php | 104 -- .../Exception/AccessException.php | 22 - .../Exception/ExceptionInterface.php | 21 - .../Exception/InvalidArgumentException.php | 21 - .../Exception/InvalidOptionsException.php | 23 - .../Exception/MissingOptionsException.php | 23 - .../Exception/NoConfigurationException.php | 26 - .../Exception/NoSuchOptionException.php | 26 - .../Exception/OptionDefinitionException.php | 21 - .../Exception/UndefinedOptionsException.php | 24 - vendor/symfony/options-resolver/LICENSE | 19 - .../options-resolver/OptionConfigurator.php | 137 -- vendor/symfony/options-resolver/Options.php | 22 - .../options-resolver/OptionsResolver.php | 1300 ----------------- vendor/symfony/options-resolver/README.md | 15 - vendor/symfony/options-resolver/composer.json | 29 - 357 files changed, 817 insertions(+), 29901 deletions(-) delete mode 100644 src/functions/deleteDirectory.php create mode 100644 src/pages/maintenance.php delete mode 100644 vendor/clue/stream-filter/.github/FUNDING.yml delete mode 100644 vendor/clue/stream-filter/CHANGELOG.md delete mode 100644 vendor/clue/stream-filter/LICENSE delete mode 100644 vendor/clue/stream-filter/README.md delete mode 100644 vendor/clue/stream-filter/composer.json delete mode 100644 vendor/clue/stream-filter/src/CallbackFilter.php delete mode 100644 vendor/clue/stream-filter/src/functions.php delete mode 100644 vendor/clue/stream-filter/src/functions_include.php delete mode 100644 vendor/knplabs/github-api/CHANGELOG-3.X.md delete mode 100644 vendor/knplabs/github-api/CHANGELOG.md delete mode 100644 vendor/knplabs/github-api/LICENSE delete mode 100644 vendor/knplabs/github-api/README.md delete mode 100644 vendor/knplabs/github-api/UPGRADE-3.0.md delete mode 100644 vendor/knplabs/github-api/UPGRADE-4.0.md delete mode 100644 vendor/knplabs/github-api/composer.json delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Apps.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Authorizations.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Deployment.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Gists.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/References.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/GraphQL.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Markdown.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Meta.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Notification.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/RateLimit.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repo.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/Search.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Api/User.php delete mode 100644 vendor/knplabs/github-api/lib/Github/AuthMethod.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Client.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/InvalidArgumentException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php delete mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php delete mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php delete mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php delete mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php delete mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php delete mode 100644 vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php delete mode 100644 vendor/knplabs/github-api/lib/Github/ResultPager.php delete mode 100644 vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php delete mode 100644 vendor/knplabs/github-api/phpstan.neon.dist delete mode 100644 vendor/php-http/cache-plugin/CHANGELOG.md delete mode 100644 vendor/php-http/cache-plugin/LICENSE delete mode 100644 vendor/php-http/cache-plugin/README.md delete mode 100644 vendor/php-http/cache-plugin/composer.json delete mode 100644 vendor/php-http/cache-plugin/phpstan.neon.dist delete mode 100644 vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php delete mode 100644 vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php delete mode 100644 vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php delete mode 100644 vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php delete mode 100644 vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php delete mode 100644 vendor/php-http/cache-plugin/src/CachePlugin.php delete mode 100644 vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php delete mode 100644 vendor/php-http/client-common/.php_cs.dist delete mode 100644 vendor/php-http/client-common/CHANGELOG.md delete mode 100644 vendor/php-http/client-common/LICENSE delete mode 100644 vendor/php-http/client-common/README.md delete mode 100644 vendor/php-http/client-common/composer.json delete mode 100644 vendor/php-http/client-common/src/BatchClient.php delete mode 100644 vendor/php-http/client-common/src/BatchClientInterface.php delete mode 100644 vendor/php-http/client-common/src/BatchResult.php delete mode 100644 vendor/php-http/client-common/src/Deferred.php delete mode 100644 vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php delete mode 100644 vendor/php-http/client-common/src/EmulatedHttpClient.php delete mode 100644 vendor/php-http/client-common/src/Exception/BatchException.php delete mode 100644 vendor/php-http/client-common/src/Exception/CircularRedirectionException.php delete mode 100644 vendor/php-http/client-common/src/Exception/ClientErrorException.php delete mode 100644 vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php delete mode 100644 vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php delete mode 100644 vendor/php-http/client-common/src/Exception/LoopException.php delete mode 100644 vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php delete mode 100644 vendor/php-http/client-common/src/Exception/ServerErrorException.php delete mode 100644 vendor/php-http/client-common/src/FlexibleHttpClient.php delete mode 100644 vendor/php-http/client-common/src/HttpAsyncClientDecorator.php delete mode 100644 vendor/php-http/client-common/src/HttpAsyncClientEmulator.php delete mode 100644 vendor/php-http/client-common/src/HttpClientDecorator.php delete mode 100644 vendor/php-http/client-common/src/HttpClientEmulator.php delete mode 100644 vendor/php-http/client-common/src/HttpClientPool.php delete mode 100644 vendor/php-http/client-common/src/HttpClientPool/HttpClientPool.php delete mode 100644 vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php delete mode 100644 vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php delete mode 100644 vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php delete mode 100644 vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php delete mode 100644 vendor/php-http/client-common/src/HttpClientRouter.php delete mode 100644 vendor/php-http/client-common/src/HttpClientRouterInterface.php delete mode 100644 vendor/php-http/client-common/src/HttpMethodsClient.php delete mode 100644 vendor/php-http/client-common/src/HttpMethodsClientInterface.php delete mode 100644 vendor/php-http/client-common/src/Plugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/AddHostPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/AddPathPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/CookiePlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/DecoderPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/ErrorPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/HistoryPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/Journal.php delete mode 100644 vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/RedirectPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/RetryPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php delete mode 100644 vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php delete mode 100644 vendor/php-http/client-common/src/PluginChain.php delete mode 100644 vendor/php-http/client-common/src/PluginClient.php delete mode 100644 vendor/php-http/client-common/src/PluginClientBuilder.php delete mode 100644 vendor/php-http/client-common/src/PluginClientFactory.php delete mode 100644 vendor/php-http/client-common/src/VersionBridgeClient.php delete mode 100644 vendor/php-http/discovery/CHANGELOG.md delete mode 100644 vendor/php-http/discovery/LICENSE delete mode 100644 vendor/php-http/discovery/README.md delete mode 100644 vendor/php-http/discovery/composer.json delete mode 100644 vendor/php-http/discovery/src/ClassDiscovery.php delete mode 100644 vendor/php-http/discovery/src/Exception.php delete mode 100644 vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php delete mode 100644 vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php delete mode 100644 vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php delete mode 100644 vendor/php-http/discovery/src/Exception/NotFoundException.php delete mode 100644 vendor/php-http/discovery/src/Exception/PuliUnavailableException.php delete mode 100644 vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php delete mode 100644 vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php delete mode 100644 vendor/php-http/discovery/src/HttpClientDiscovery.php delete mode 100644 vendor/php-http/discovery/src/MessageFactoryDiscovery.php delete mode 100644 vendor/php-http/discovery/src/NotFoundException.php delete mode 100644 vendor/php-http/discovery/src/Psr17FactoryDiscovery.php delete mode 100644 vendor/php-http/discovery/src/Psr18ClientDiscovery.php delete mode 100644 vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php delete mode 100644 vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php delete mode 100644 vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php delete mode 100644 vendor/php-http/discovery/src/Strategy/MockClientStrategy.php delete mode 100644 vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php delete mode 100644 vendor/php-http/discovery/src/StreamFactoryDiscovery.php delete mode 100644 vendor/php-http/discovery/src/UriFactoryDiscovery.php delete mode 100644 vendor/php-http/httplug/.php-cs-fixer.dist.php delete mode 100644 vendor/php-http/httplug/CHANGELOG.md delete mode 100644 vendor/php-http/httplug/LICENSE delete mode 100644 vendor/php-http/httplug/README.md delete mode 100644 vendor/php-http/httplug/composer.json delete mode 100644 vendor/php-http/httplug/puli.json delete mode 100644 vendor/php-http/httplug/src/Exception.php delete mode 100644 vendor/php-http/httplug/src/Exception/HttpException.php delete mode 100644 vendor/php-http/httplug/src/Exception/NetworkException.php delete mode 100644 vendor/php-http/httplug/src/Exception/RequestAwareTrait.php delete mode 100644 vendor/php-http/httplug/src/Exception/RequestException.php delete mode 100644 vendor/php-http/httplug/src/Exception/TransferException.php delete mode 100644 vendor/php-http/httplug/src/HttpAsyncClient.php delete mode 100644 vendor/php-http/httplug/src/HttpClient.php delete mode 100644 vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php delete mode 100644 vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php delete mode 100644 vendor/php-http/message-factory/CHANGELOG.md delete mode 100644 vendor/php-http/message-factory/LICENSE delete mode 100644 vendor/php-http/message-factory/README.md delete mode 100644 vendor/php-http/message-factory/composer.json delete mode 100644 vendor/php-http/message-factory/puli.json delete mode 100644 vendor/php-http/message-factory/src/MessageFactory.php delete mode 100644 vendor/php-http/message-factory/src/RequestFactory.php delete mode 100644 vendor/php-http/message-factory/src/ResponseFactory.php delete mode 100644 vendor/php-http/message-factory/src/StreamFactory.php delete mode 100644 vendor/php-http/message-factory/src/UriFactory.php delete mode 100644 vendor/php-http/message/CHANGELOG.md delete mode 100644 vendor/php-http/message/LICENSE delete mode 100644 vendor/php-http/message/README.md delete mode 100644 vendor/php-http/message/apigen.neon delete mode 100644 vendor/php-http/message/composer.json delete mode 100644 vendor/php-http/message/puli.json delete mode 100644 vendor/php-http/message/src/Authentication.php delete mode 100644 vendor/php-http/message/src/Authentication/AutoBasicAuth.php delete mode 100644 vendor/php-http/message/src/Authentication/BasicAuth.php delete mode 100644 vendor/php-http/message/src/Authentication/Bearer.php delete mode 100644 vendor/php-http/message/src/Authentication/Chain.php delete mode 100644 vendor/php-http/message/src/Authentication/Header.php delete mode 100644 vendor/php-http/message/src/Authentication/Matching.php delete mode 100644 vendor/php-http/message/src/Authentication/QueryParam.php delete mode 100644 vendor/php-http/message/src/Authentication/RequestConditional.php delete mode 100644 vendor/php-http/message/src/Authentication/Wsse.php delete mode 100644 vendor/php-http/message/src/Builder/ResponseBuilder.php delete mode 100644 vendor/php-http/message/src/Cookie.php delete mode 100644 vendor/php-http/message/src/CookieJar.php delete mode 100644 vendor/php-http/message/src/CookieUtil.php delete mode 100644 vendor/php-http/message/src/Decorator/MessageDecorator.php delete mode 100644 vendor/php-http/message/src/Decorator/RequestDecorator.php delete mode 100644 vendor/php-http/message/src/Decorator/ResponseDecorator.php delete mode 100644 vendor/php-http/message/src/Decorator/StreamDecorator.php delete mode 100644 vendor/php-http/message/src/Encoding/ChunkStream.php delete mode 100644 vendor/php-http/message/src/Encoding/CompressStream.php delete mode 100644 vendor/php-http/message/src/Encoding/DechunkStream.php delete mode 100644 vendor/php-http/message/src/Encoding/DecompressStream.php delete mode 100644 vendor/php-http/message/src/Encoding/DeflateStream.php delete mode 100644 vendor/php-http/message/src/Encoding/Filter/Chunk.php delete mode 100644 vendor/php-http/message/src/Encoding/FilteredStream.php delete mode 100644 vendor/php-http/message/src/Encoding/GzipDecodeStream.php delete mode 100644 vendor/php-http/message/src/Encoding/GzipEncodeStream.php delete mode 100644 vendor/php-http/message/src/Encoding/InflateStream.php delete mode 100644 vendor/php-http/message/src/Exception.php delete mode 100644 vendor/php-http/message/src/Exception/UnexpectedValueException.php delete mode 100644 vendor/php-http/message/src/Formatter.php delete mode 100644 vendor/php-http/message/src/Formatter/CurlCommandFormatter.php delete mode 100644 vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php delete mode 100644 vendor/php-http/message/src/Formatter/SimpleFormatter.php delete mode 100644 vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php delete mode 100644 vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php delete mode 100644 vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php delete mode 100644 vendor/php-http/message/src/RequestMatcher.php delete mode 100644 vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php delete mode 100644 vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php delete mode 100644 vendor/php-http/message/src/RequestMatcher/RequestMatcher.php delete mode 100644 vendor/php-http/message/src/Stream/BufferedStream.php delete mode 100644 vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php delete mode 100644 vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php delete mode 100644 vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php delete mode 100644 vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php delete mode 100644 vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php delete mode 100644 vendor/php-http/message/src/UriFactory/SlimUriFactory.php delete mode 100644 vendor/php-http/message/src/filters.php delete mode 100644 vendor/php-http/multipart-stream-builder/CHANGELOG.md delete mode 100644 vendor/php-http/multipart-stream-builder/LICENSE delete mode 100644 vendor/php-http/multipart-stream-builder/README.md delete mode 100644 vendor/php-http/multipart-stream-builder/composer.json delete mode 100644 vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php delete mode 100644 vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php delete mode 100644 vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php delete mode 100644 vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php delete mode 100644 vendor/php-http/promise/CHANGELOG.md delete mode 100644 vendor/php-http/promise/LICENSE delete mode 100644 vendor/php-http/promise/README.md delete mode 100644 vendor/php-http/promise/composer.json delete mode 100644 vendor/php-http/promise/src/FulfilledPromise.php delete mode 100644 vendor/php-http/promise/src/Promise.php delete mode 100644 vendor/php-http/promise/src/RejectedPromise.php delete mode 100644 vendor/psr/cache/CHANGELOG.md delete mode 100644 vendor/psr/cache/LICENSE.txt delete mode 100644 vendor/psr/cache/README.md delete mode 100644 vendor/psr/cache/composer.json delete mode 100644 vendor/psr/cache/src/CacheException.php delete mode 100644 vendor/psr/cache/src/CacheItemInterface.php delete mode 100644 vendor/psr/cache/src/CacheItemPoolInterface.php delete mode 100644 vendor/psr/cache/src/InvalidArgumentException.php delete mode 100644 vendor/symfony/options-resolver/CHANGELOG.md delete mode 100644 vendor/symfony/options-resolver/Debug/OptionsResolverIntrospector.php delete mode 100644 vendor/symfony/options-resolver/Exception/AccessException.php delete mode 100644 vendor/symfony/options-resolver/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/options-resolver/Exception/InvalidArgumentException.php delete mode 100644 vendor/symfony/options-resolver/Exception/InvalidOptionsException.php delete mode 100644 vendor/symfony/options-resolver/Exception/MissingOptionsException.php delete mode 100644 vendor/symfony/options-resolver/Exception/NoConfigurationException.php delete mode 100644 vendor/symfony/options-resolver/Exception/NoSuchOptionException.php delete mode 100644 vendor/symfony/options-resolver/Exception/OptionDefinitionException.php delete mode 100644 vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php delete mode 100644 vendor/symfony/options-resolver/LICENSE delete mode 100644 vendor/symfony/options-resolver/OptionConfigurator.php delete mode 100644 vendor/symfony/options-resolver/Options.php delete mode 100644 vendor/symfony/options-resolver/OptionsResolver.php delete mode 100644 vendor/symfony/options-resolver/README.md delete mode 100644 vendor/symfony/options-resolver/composer.json diff --git a/composer.json b/composer.json index 121668a2..8a4f4e8a 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,6 @@ "embed/embed": "^4.3", "laminas/laminas-diactoros": "^2.8", "grandel/include-directory": "^0.2.2", - "knplabs/github-api": "^3.0", "guzzlehttp/guzzle": "^7.0.1", "http-interop/http-factory-guzzle": "^1.0", "qferr/mjml-php": "^1.1", diff --git a/composer.lock b/composer.lock index c4404f6c..b2fda7bc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,74 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a9023528de34be7d5f1d8155ae3a2d47", + "content-hash": "9d59ba37ed1c4a9cd5bce3b355023840", "packages": [ - { - "name": "clue/stream-filter", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/clue/stream-filter.git", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/d6169430c7731d8509da7aecd0af756a5747b78e", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "Clue\\StreamFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "support": { - "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.6.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "time": "2022-02-21T13:15:14+00:00" - }, { "name": "composer/ca-bundle", "version": "1.3.1", @@ -806,94 +740,6 @@ }, "time": "2021-07-21T13:50:14+00:00" }, - { - "name": "knplabs/github-api", - "version": "v3.5.1", - "source": { - "type": "git", - "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "37b167998e8e1f318b3d99633675cfa007540565" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/37b167998e8e1f318b3d99633675cfa007540565", - "reference": "37b167998e8e1f318b3d99633675cfa007540565", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.2.5 || ^8.0", - "php-http/cache-plugin": "^1.7.1", - "php-http/client-common": "^2.3", - "php-http/discovery": "^1.12", - "php-http/httplug": "^2.2", - "php-http/multipart-stream-builder": "^1.1.2", - "psr/cache": "^1.0|^2.0|^3.0", - "psr/http-client-implementation": "^1.0", - "psr/http-factory-implementation": "^1.0", - "psr/http-message": "^1.0", - "symfony/deprecation-contracts": "^2.2|^3.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "guzzlehttp/guzzle": "^7.2", - "guzzlehttp/psr7": "^1.7", - "http-interop/http-factory-guzzle": "^1.0", - "php-http/mock-client": "^1.4.1", - "phpstan/extension-installer": "^1.0.5", - "phpstan/phpstan": "^0.12.57", - "phpstan/phpstan-deprecation-rules": "^0.12.5", - "phpunit/phpunit": "^8.5 || ^9.4", - "symfony/cache": "^5.1.8", - "symfony/phpunit-bridge": "^5.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.20.x-dev", - "dev-master": "3.4.x-dev" - } - }, - "autoload": { - "psr-4": { - "Github\\": "lib/Github/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" - }, - { - "name": "Thibault Duplessis", - "email": "thibault.duplessis@gmail.com", - "homepage": "http://ornicar.github.com" - } - ], - "description": "GitHub API v3 client", - "homepage": "https://github.com/KnpLabs/php-github-api", - "keywords": [ - "api", - "gh", - "gist", - "github" - ], - "support": { - "issues": "https://github.com/KnpLabs/php-github-api/issues", - "source": "https://github.com/KnpLabs/php-github-api/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://github.com/acrobat", - "type": "github" - } - ], - "time": "2022-02-19T11:15:46+00:00" - }, { "name": "laminas/laminas-diactoros", "version": "2.8.0", @@ -1150,566 +996,6 @@ }, "time": "2020-11-19T17:43:46+00:00" }, - { - "name": "php-http/cache-plugin", - "version": "1.7.5", - "source": { - "type": "git", - "url": "https://github.com/php-http/cache-plugin.git", - "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/63bc3f7242825c9a817db8f78e4c9703b0c471e2", - "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/client-common": "^1.9 || ^2.0", - "php-http/message-factory": "^1.0", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\Plugin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "PSR-6 Cache plugin for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "cache", - "http", - "httplug", - "plugin" - ], - "support": { - "issues": "https://github.com/php-http/cache-plugin/issues", - "source": "https://github.com/php-http/cache-plugin/tree/1.7.5" - }, - "time": "2022-01-18T12:24:56+00:00" - }, - { - "name": "php-http/client-common", - "version": "2.5.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "d135751167d57e27c74de674d6a30cef2dc8e054" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/d135751167d57e27c74de674d6a30cef2dc8e054", - "reference": "d135751167d57e27c74de674d6a30cef2dc8e054", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "common", - "http", - "httplug" - ], - "support": { - "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.5.0" - }, - "time": "2021-11-26T15:01:24+00:00" - }, - { - "name": "php-http/discovery", - "version": "1.14.1", - "source": { - "type": "git", - "url": "https://github.com/php-http/discovery.git", - "reference": "de90ab2b41d7d61609f504e031339776bc8c7223" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/de90ab2b41d7d61609f504e031339776bc8c7223", - "reference": "de90ab2b41d7d61609f504e031339776bc8c7223", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "nyholm/psr7": "<1.0" - }, - "require-dev": { - "graham-campbell/phpspec-skip-example-extension": "^5.0", - "php-http/httplug": "^1.0 || ^2.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1", - "puli/composer-plugin": "1.0.0-beta10" - }, - "suggest": { - "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Discovery\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Finds installed HTTPlug implementations and PSR-7 message factories", - "homepage": "http://php-http.org", - "keywords": [ - "adapter", - "client", - "discovery", - "factory", - "http", - "message", - "psr7" - ], - "support": { - "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.14.1" - }, - "time": "2021-09-18T07:57:46+00:00" - }, - { - "name": "php-http/httplug", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "f640739f80dfa1152533976e3c112477f69274eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/f640739f80dfa1152533976e3c112477f69274eb", - "reference": "f640739f80dfa1152533976e3c112477f69274eb", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1", - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "support": { - "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.3.0" - }, - "time": "2022-02-21T09:52:22+00:00" - }, - { - "name": "php-http/message", - "version": "1.13.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/7886e647a30a966a1a8d1dad1845b71ca8678361", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.5", - "php": "^7.1 || ^8.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.6", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "laminas/laminas-diactoros": "^2.0", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "files": [ - "src/filters.php" - ], - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "support": { - "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.13.0" - }, - "time": "2022-02-11T13:41:14+00:00" - }, - { - "name": "php-http/message-factory", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/master" - }, - "time": "2015-12-19T14:08:53+00:00" - }, - { - "name": "php-http/multipart-stream-builder", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/multipart-stream-builder.git", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/11c1d31f72e01c738bbce9e27649a7cca829c30e", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/discovery": "^1.7", - "php-http/message-factory": "^1.0.2", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "nyholm/psr7": "^1.0", - "php-http/message": "^1.5", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\MultipartStream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - } - ], - "description": "A builder class that help you create a multipart stream", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "multipart stream", - "stream" - ], - "support": { - "issues": "https://github.com/php-http/multipart-stream-builder/issues", - "source": "https://github.com/php-http/multipart-stream-builder/tree/1.2.0" - }, - "time": "2021-05-21T08:32:01+00:00" - }, - { - "name": "php-http/promise", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", - "phpspec/phpspec": "^5.1.2 || ^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.1.0" - }, - "time": "2020-07-07T09:29:14+00:00" - }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, { "name": "psr/http-client", "version": "1.0.1", @@ -2022,73 +1308,6 @@ ], "time": "2021-11-01T23:48:49+00:00" }, - { - "name": "symfony/options-resolver", - "version": "v6.0.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "51f7006670febe4cbcbae177cbffe93ff833250d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/51f7006670febe4cbcbae177cbffe93ff833250d", - "reference": "51f7006670febe4cbcbae177cbffe93ff833250d", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.0.3" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-01-02T09:55:41+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.25.0", @@ -2375,5 +1594,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.0.0" } diff --git a/index.php b/index.php index 4eee896b..1c43835b 100644 --- a/index.php +++ b/index.php @@ -127,30 +127,17 @@ if (!$options || !$options->getOption('isInstalled')) { } /** - * Update - * - * Check for update every 24 hours. + * Database Update */ -use Github\Client; - if ($options && $options->getOption('isInstalled')) { - $updateLastChecked = $options->getOption('updateLastChecked'); + if (-1 === version_compare($options->version, VERSION)) { + $options->setOption('updateAvailable', true); - if (!$updateLastChecked || time() - $updateLastChecked >= 86400) { - try { - $client = new Client(); - $release = $client->api('repo')->releases()->latest('grandeljay', 'wishthis'); - $tag = $release['tag_name']; - $version = str_replace('v', '', $tag); - - if (-1 === version_compare($options->version, $version)) { - $options->setOption('updateAvailable', true); - } - } catch (\Github\Exception\RuntimeException $th) { - echo wishthis\Page::warning($th->getMessage()); + if (isset($user->power) && 100 === $user->power) { + $page = 'update'; + } else { + $page = 'maintenance'; } - - $options->setOption('updateLastChecked', time()); } } diff --git a/src/classes/page.php b/src/classes/page.php index ea2b400f..e1bcffa7 100644 --- a/src/classes/page.php +++ b/src/classes/page.php @@ -433,16 +433,6 @@ class Page ); } - global $options; - - if ($options->getOption('updateAvailable') && isset($user->power) && 100 === $user->power) { - $pages[$system]['items'][] = array( - 'text' => __('Update'), - 'url' => '/?page=update', - 'icon' => 'upload', - ); - } - if (isset($user->power) && 100 === $user->power) { $pages[$system]['items'][] = array( 'text' => __('Settings'), diff --git a/src/functions/deleteDirectory.php b/src/functions/deleteDirectory.php deleted file mode 100644 index 787d1393..00000000 --- a/src/functions/deleteDirectory.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -function delete_directory(string $directoryToDelete) -{ - foreach (scandir($directoryToDelete) as $filename) { - if (in_array($filename, array('.', '..'))) { - continue; - } - - $filepath = $directoryToDelete . '/' . $filename; - - if (is_file($filepath) && !is_dir($filepath)) { - unlink($filepath); - } - - if (is_dir($filepath)) { - delete_directory($filepath); - } - } - - rmdir($directoryToDelete); -} diff --git a/src/pages/maintenance.php b/src/pages/maintenance.php new file mode 100644 index 00000000..036dde4c --- /dev/null +++ b/src/pages/maintenance.php @@ -0,0 +1,31 @@ + + */ + +use wishthis\Page; + +$page = new Page(__FILE__, __('Maintenance')); +$page->header(); +$page->bodyStart(); +$page->navigation(); +?> + +
+
+

title ?>

+ +
+

+

+
+
+
+ +footer(); +$page->bodyEnd(); +?> diff --git a/src/pages/update.php b/src/pages/update.php index aab63633..ea913420 100644 --- a/src/pages/update.php +++ b/src/pages/update.php @@ -8,54 +8,10 @@ use wishthis\{Page, User}; -$page = new Page(__FILE__, __('Update'), 100); -$page->header(); -$page->bodyStart(); -$page->navigation(); - /** * Update */ if ('POST' === $_SERVER['REQUEST_METHOD']) { - /** - * Files - */ - $zip_filename = __DIR__ . '/' . $tag . '.zip'; - - /** Download */ - file_put_contents( - $zip_filename, - file_get_contents('https://github.com/grandeljay/wishthis/archive/refs/tags/' . $tag . '.zip') - ); - - /** Decompress */ - $zip = new ZipArchive(); - - if ($zip->open($zip_filename)) { - $zip->extractTo(__DIR__); - $zip->close(); - - $directory_wishthis_github = __DIR__ . '/wishthis-' . $version; - - foreach (scandir($directory_wishthis_github) as $filename) { - if (in_array($filename, array('.', '..', 'config'))) { - continue; - } - - $filepath = __DIR__ . '/' . $filename; - $filepath_github = $directory_wishthis_github . '/' . $filename; - - if (is_dir($filepath) && is_dir($filepath_github)) { - delete_directory($filepath); - } - - rename($filepath_github, $filepath); - } - } - - /** Delete */ - unlink($zip_filename); - /** * Database */ @@ -87,12 +43,17 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) { } /** Update version */ - $options->setOption('version', $version); + $options->setOption('version', VERSION); $options->setOption('updateAvailable', false); header('Location: /?page=home'); die(); } + +$page = new Page(__FILE__, __('Update'), 100); +$page->header(); +$page->bodyStart(); +$page->navigation(); ?>
@@ -100,33 +61,19 @@ if ('POST' === $_SERVER['REQUEST_METHOD']) {

title ?>

-

-

-
- -
-
- -
-

-
-
+

+

+
- -
-

- - ', $release['body']) ?> -
diff --git a/vendor/clue/stream-filter/.github/FUNDING.yml b/vendor/clue/stream-filter/.github/FUNDING.yml deleted file mode 100644 index 9c09fb87..00000000 --- a/vendor/clue/stream-filter/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: clue -custom: https://clue.engineering/support diff --git a/vendor/clue/stream-filter/CHANGELOG.md b/vendor/clue/stream-filter/CHANGELOG.md deleted file mode 100644 index e6ae94b5..00000000 --- a/vendor/clue/stream-filter/CHANGELOG.md +++ /dev/null @@ -1,86 +0,0 @@ -# Changelog - -## 1.6.0 (2022-02-21) - -* Feature: Support PHP 8.1 release. - (#45 by @clue) - -* Improve documentation to use fully-qualified function names. - (#43 by @SimonFrings and #42 by @PaulRotmann) - -* Improve test suite and use GitHub actions for continuous integration (CI). - (#39 and #40 by @SimonFrings) - -## 1.5.0 (2020-10-02) - -* Feature: Improve performance by using global imports. - (#38 by @clue) - -* Improve API documentation and add support / sponsorship info. - (#30 by @clue and #35 by @SimonFrings) - -* Improve test suite and add `.gitattributes` to exclude dev files from exports. - Prepare PHP 8 support, update to PHPUnit 9 and simplify test matrix. - (#32 and #37 by @clue and #34 and #36 by @SimonFrings) - -## 1.4.1 (2019-04-09) - -* Fix: Check if the function is declared before declaring it. - (#23 by @Niko9911) - -* Improve test suite to also test against PHP 7.2 and - add test for base64 encoding and decoding filters. - (#22 by @arubacao and #25 by @Nyholm and @clue) - -## 1.4.0 (2017-08-18) - -* Feature / Fix: The `fun()` function does not pass filter parameter `null` - to underlying `stream_filter_append()` by default - (#15 by @Nyholm) - - Certain filters (such as `convert.quoted-printable-encode`) do not accept - a filter parameter at all. If no explicit filter parameter is given, we no - longer pass a default `null` value. - - ```php - $encode = Filter\fun('convert.quoted-printable-encode'); - assert('t=C3=A4st' === $encode('täst')); - ``` - -* Add examples and improve documentation - (#13 and #20 by @clue and #18 by @Nyholm) - -* Improve test suite by adding PHPUnit to require-dev, - fix HHVM build for now again and ignore future HHVM build errors, - lock Travis distro so new future defaults will not break the build - and test on PHP 7.1 - (#12, #14 and #19 by @clue and #16 by @Nyholm) - -## 1.3.0 (2015-11-08) - -* Feature: Support accessing built-in filters as callbacks - (#5 by @clue) - - ```php - $fun = Filter\fun('zlib.deflate'); - - $ret = $fun('hello') . $fun('world') . $fun(); - assert('helloworld' === gzinflate($ret)); - ``` - -## 1.2.0 (2015-10-23) - -* Feature: Invoke close event when closing filter (flush buffer) - (#9 by @clue) - -## 1.1.0 (2015-10-22) - -* Feature: Abort filter operation when catching an Exception - (#10 by @clue) - -* Feature: Additional safeguards to prevent filter state corruption - (#7 by @clue) - -## 1.0.0 (2015-10-18) - -* First tagged release diff --git a/vendor/clue/stream-filter/LICENSE b/vendor/clue/stream-filter/LICENSE deleted file mode 100644 index dc09d1e6..00000000 --- a/vendor/clue/stream-filter/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Christian Lück - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/clue/stream-filter/README.md b/vendor/clue/stream-filter/README.md deleted file mode 100644 index 4196c2cc..00000000 --- a/vendor/clue/stream-filter/README.md +++ /dev/null @@ -1,326 +0,0 @@ -# clue/stream-filter - -[![CI status](https://github.com/clue/stream-filter/workflows/CI/badge.svg)](https://github.com/clue/stream-filter/actions) -[![installs on Packagist](https://img.shields.io/packagist/dt/clue/stream-filter?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/stream-filter) - -A simple and modern approach to stream filtering in PHP - -**Table of contents** - -* [Why?](#why) -* [Support us](#support-us) -* [Usage](#usage) - * [append()](#append) - * [prepend()](#prepend) - * [fun()](#fun) - * [remove()](#remove) -* [Install](#install) -* [Tests](#tests) -* [License](#license) - -## Why? - -PHP's stream filtering system is great! - -It offers very powerful stream filtering options and comes with a useful set of built-in filters. -These filters can be used to easily and efficiently perform various transformations on-the-fly, such as: - -* read from a gzip'ed input file, -* transcode from ISO-8859-1 (Latin1) to UTF-8, -* write to a bzip output file -* and much more. - -But let's face it: -Its API is [*difficult to work with*](https://www.php.net/manual/en/php-user-filter.filter.php) -and its documentation is [*subpar*](https://stackoverflow.com/questions/27103269/what-is-a-bucket-brigade). -This combined means its powerful features are often neglected. - -This project aims to make these features more accessible to a broader audience. -* **Lightweight, SOLID design** - - Provides a thin abstraction that is [*just good enough*](https://en.wikipedia.org/wiki/Principle_of_good_enough) - and does not get in your way. - Custom filters require trivial effort. -* **Good test coverage** - - Comes with an automated tests suite and is regularly tested in the *real world* - -## Support us - -We invest a lot of time developing, maintaining and updating our awesome -open-source projects. You can help us sustain this high-quality of our work by -[becoming a sponsor on GitHub](https://github.com/sponsors/clue). Sponsors get -numerous benefits in return, see our [sponsoring page](https://github.com/sponsors/clue) -for details. - -Let's take these projects to the next level together! 🚀 - -## Usage - -This lightweight library consists only of a few simple functions. -All functions reside under the `Clue\StreamFilter` namespace. - -The below examples refer to all functions with their fully-qualified names like this: - -```php -Clue\StreamFilter\append(…); -``` - -As of PHP 5.6+ you can also import each required function into your code like this: - -```php -use function Clue\StreamFilter\append; - -append(…); -``` - -Alternatively, you can also use an import statement similar to this: - -```php -use Clue\StreamFilter as Filter; - -Filter\append(…); -``` - -### append() - -The `append(resource $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource` function can be used to -append a filter callback to the given stream. - -Each stream can have a list of filters attached. -This function appends a filter to the end of this list. - -If the given filter can not be added, it throws an `Exception`. - -The `$stream` can be any valid stream resource, such as: - -```php -$stream = fopen('demo.txt', 'w+'); -``` - -The `$callback` should be a valid callable function which accepts -an individual chunk of data and should return the updated chunk: - -```php -$filter = Clue\StreamFilter\append($stream, function ($chunk) { - // will be called each time you read or write a $chunk to/from the stream - return $chunk; -}); -``` - -As such, you can also use native PHP functions or any other `callable`: - -```php -Clue\StreamFilter\append($stream, 'strtoupper'); - -// will write "HELLO" to the underlying stream -fwrite($stream, 'hello'); -``` - -If the `$callback` accepts invocation without parameters, -then this signature will be invoked once ending (flushing) the filter: - -```php -Clue\StreamFilter\append($stream, function ($chunk = null) { - if ($chunk === null) { - // will be called once ending the filter - return 'end'; - } - // will be called each time you read or write a $chunk to/from the stream - return $chunk; -}); - -fclose($stream); -``` - -> Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data -from the end signal handler if the stream is being closed. - -If your callback throws an `Exception`, then the filter process will be aborted. -In order to play nice with PHP's stream handling, -the `Exception` will be transformed to a PHP warning instead: - -```php -Clue\StreamFilter\append($stream, function ($chunk) { - throw new \RuntimeException('Unexpected chunk'); -}); - -// raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk" -fwrite($stream, 'hello'); -``` - -The optional `$read_write` parameter can be used to only invoke the `$callback` -when either writing to the stream or only when reading from the stream: - -```php -Clue\StreamFilter\append($stream, function ($chunk) { - // will be called each time you write to the stream - return $chunk; -}, STREAM_FILTER_WRITE); - -Clue\StreamFilter\append($stream, function ($chunk) { - // will be called each time you read from the stream - return $chunk; -}, STREAM_FILTER_READ); -``` - -This function returns a filter resource which can be passed to [`remove()`](#remove). - -> Note that once a filter has been added to stream, the stream can no longer be passed to -> [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php) -> (and family). -> -> > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line} -> -> This is due to limitations of PHP's stream filter support, as it can no longer reliably -> tell when the underlying stream resource is actually ready. -> As an alternative, consider calling `stream_select()` on the unfiltered stream and -> then pass the unfiltered data through the [`fun()`](#fun) function. - -### prepend() - -The `prepend(resource $stream, callable $callback, int $read_write = STREAM_FILTER_ALL): resource` function can be used to -prepend a filter callback to the given stream. - -Each stream can have a list of filters attached. -This function prepends a filter to the start of this list. - -If the given filter can not be added, it throws an `Exception`. - -```php -$filter = Clue\StreamFilter\prepend($stream, function ($chunk) { - // will be called each time you read or write a $chunk to/from the stream - return $chunk; -}); -``` - -This function returns a filter resource which can be passed to [`remove()`](#remove). - -Except for the position in the list of filters, this function behaves exactly -like the [`append()`](#append) function. -For more details about its behavior, see also the [`append()`](#append) function. - -### fun() - -The `fun(string $filter, mixed $parameters = null): callable` function can be used to -create a filter function which uses the given built-in `$filter`. - -PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php). -Using `fun()` makes accessing these as easy as passing an input string to filter -and getting the filtered output string. - -```php -$fun = Clue\StreamFilter\fun('string.rot13'); - -assert('grfg' === $fun('test')); -assert('test' === $fun($fun('test')); -``` - -Please note that not all filter functions may be available depending -on installed PHP extensions and the PHP version in use. -In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions -or parameters as Zend PHP. -Accessing an unknown filter function will result in a `RuntimeException`: - -```php -Clue\StreamFilter\fun('unknown'); // throws RuntimeException -``` - -Some filters may accept or require additional filter parameters – most -filters do not require filter parameters. -If given, the optional `$parameters` argument will be passed to the -underlying filter handler as-is. -In particular, note how *not passing* this parameter at all differs from -explicitly passing a `null` value (which many filters do not accept). -Please refer to the individual filter definition for more details. -For example, the `string.strip_tags` filter can be invoked like this: - -```php -$fun = Clue\StreamFilter\fun('string.strip_tags', ''); - -$ret = $fun('h
i
'); -assert('hi' === $ret); -``` - -Under the hood, this function allocates a temporary memory stream, so it's -recommended to clean up the filter function after use. -Also, some filter functions (in particular the -[zlib compression filters](https://www.php.net/manual/en/filters.compression.php)) -may use internal buffers and may emit a final data chunk on close. -The filter function can be closed by invoking without any arguments: - -```php -$fun = Clue\StreamFilter\fun('zlib.deflate'); - -$ret = $fun('hello') . $fun('world') . $fun(); -assert('helloworld' === gzinflate($ret)); -``` - -The filter function must not be used anymore after it has been closed. -Doing so will result in a `RuntimeException`: - -```php -$fun = Clue\StreamFilter\fun('string.rot13'); -$fun(); - -$fun('test'); // throws RuntimeException -``` - -> Note: If you're using the zlib compression filters, then you should be wary -about engine inconsistencies between different PHP versions and HHVM. -These inconsistencies exist in the underlying PHP engines and there's little we -can do about this in this library. -[Our test suite](tests/) contains several test cases that exhibit these issues. -If you feel some test case is missing or outdated, we're happy to accept PRs! :) - -### remove() - -The `remove(resource $filter): bool` function can be used to -remove a filter previously added via [`append()`](#append) or [`prepend()`](#prepend). - -```php -$filter = Clue\StreamFilter\append($stream, function () { - // … -}); -Clue\StreamFilter\remove($filter); -``` - -## Install - -The recommended way to install this library is [through Composer](https://getcomposer.org/). -[New to Composer?](https://getcomposer.org/doc/00-intro.md) - -This project follows [SemVer](https://semver.org/). -This will install the latest supported version: - -```bash -$ composer require clue/stream-filter:^1.6 -``` - -See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. - -This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 8+ and -HHVM. -It's *highly recommended to use the latest supported PHP version* for this project. -Older PHP versions may suffer from a number of inconsistencies documented above. - -## Tests - -To run the test suite, you first need to clone this repo and then install all -dependencies [through Composer](https://getcomposer.org/): - -```bash -$ composer install -``` - -To run the test suite, go to the project root and run: - -```bash -$ vendor/bin/phpunit -``` - -## License - -This project is released under the permissive [MIT license](LICENSE). - -> Did you know that I offer custom development services and issuing invoices for - sponsorships of releases and for contributions? Contact me (@clue) for details. diff --git a/vendor/clue/stream-filter/composer.json b/vendor/clue/stream-filter/composer.json deleted file mode 100644 index 797fb536..00000000 --- a/vendor/clue/stream-filter/composer.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "clue/stream-filter", - "description": "A simple and modern approach to stream filtering in PHP", - "keywords": ["stream", "callback", "filter", "php_user_filter", "stream_filter_append", "stream_filter_register", "bucket brigade"], - "homepage": "https://github.com/clue/php-stream-filter", - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "autoload": { - "psr-4": { "Clue\\StreamFilter\\": "src/" }, - "files": [ "src/functions_include.php" ] - }, - "autoload-dev": { - "psr-4": { "Clue\\Tests\\StreamFilter\\": "tests/" } - } -} diff --git a/vendor/clue/stream-filter/src/CallbackFilter.php b/vendor/clue/stream-filter/src/CallbackFilter.php deleted file mode 100644 index a667fe68..00000000 --- a/vendor/clue/stream-filter/src/CallbackFilter.php +++ /dev/null @@ -1,120 +0,0 @@ -closed = false; - - if (!\is_callable($this->params)) { - throw new \InvalidArgumentException('No valid callback parameter given to stream_filter_(append|prepend)'); - } - $this->callback = $this->params; - - // callback supports end event if it accepts invocation without arguments - $ref = new \ReflectionFunction($this->callback); - $this->supportsClose = ($ref->getNumberOfRequiredParameters() === 0); - - return true; - } - - /** @return void */ - #[\ReturnTypeWillChange] - public function onClose() - { - $this->closed = true; - - // callback supports closing and is not already closed - if ($this->supportsClose) { - $this->supportsClose = false; - // invoke without argument to signal end and discard resulting buffer - try { - \call_user_func($this->callback); - } catch (\Exception $ignored) { - // this might be called during engine shutdown, so it's not safe - // to raise any errors or exceptions here - // trigger_error('Error closing filter: ' . $ignored->getMessage(), E_USER_WARNING); - } - } - - $this->callback = null; - } - - /** @return int */ - #[\ReturnTypeWillChange] - public function filter($in, $out, &$consumed, $closing) - { - // concatenate whole buffer from input brigade - $data = ''; - while ($bucket = \stream_bucket_make_writeable($in)) { - $consumed += $bucket->datalen; - $data .= $bucket->data; - } - - // skip processing callback that already ended - if ($this->closed) { - return \PSFS_FEED_ME; - } - - // only invoke filter function if buffer is not empty - // this may skip flushing a closing filter - if ($data !== '') { - try { - $data = \call_user_func($this->callback, $data); - } catch (\Exception $e) { - // exception should mark filter as closed - $this->onClose(); - \trigger_error('Error invoking filter: ' . $e->getMessage(), \E_USER_WARNING); - - return \PSFS_ERR_FATAL; - } - } - - // mark filter as closed after processing closing chunk - if ($closing) { - $this->closed = true; - - // callback supports closing and is not already closed - if ($this->supportsClose) { - $this->supportsClose = false; - - // invoke without argument to signal end and append resulting buffer - try { - $data .= \call_user_func($this->callback); - } catch (\Exception $e) { - \trigger_error('Error ending filter: ' . $e->getMessage(), \E_USER_WARNING); - - return \PSFS_ERR_FATAL; - } - } - } - - if ($data !== '') { - // create a new bucket for writing the resulting buffer to the output brigade - // reusing an existing bucket turned out to be bugged in some environments (ancient PHP versions and HHVM) - $bucket = @\stream_bucket_new($this->stream, $data); - - // legacy PHP versions (PHP < 5.4) do not support passing data from the event signal handler - // because closing the stream invalidates the stream and its stream bucket brigade before - // invoking the filter close handler. - if ($bucket !== false) { - \stream_bucket_append($out, $bucket); - } - } - - return \PSFS_PASS_ON; - } -} diff --git a/vendor/clue/stream-filter/src/functions.php b/vendor/clue/stream-filter/src/functions.php deleted file mode 100644 index cad88a29..00000000 --- a/vendor/clue/stream-filter/src/functions.php +++ /dev/null @@ -1,327 +0,0 @@ - Note: Legacy PHP versions (PHP < 5.4) do not support passing additional data - * from the end signal handler if the stream is being closed. - * - * If your callback throws an `Exception`, then the filter process will be aborted. - * In order to play nice with PHP's stream handling, - * the `Exception` will be transformed to a PHP warning instead: - * - * ```php - * Clue\StreamFilter\append($stream, function ($chunk) { - * throw new \RuntimeException('Unexpected chunk'); - * }); - * - * // raises an E_USER_WARNING with "Error invoking filter: Unexpected chunk" - * fwrite($stream, 'hello'); - * ``` - * - * The optional `$read_write` parameter can be used to only invoke the `$callback` - * when either writing to the stream or only when reading from the stream: - * - * ```php - * Clue\StreamFilter\append($stream, function ($chunk) { - * // will be called each time you write to the stream - * return $chunk; - * }, STREAM_FILTER_WRITE); - * - * Clue\StreamFilter\append($stream, function ($chunk) { - * // will be called each time you read from the stream - * return $chunk; - * }, STREAM_FILTER_READ); - * ``` - * - * This function returns a filter resource which can be passed to [`remove()`](#remove). - * - * > Note that once a filter has been added to stream, the stream can no longer be passed to - * > [`stream_select()`](https://www.php.net/manual/en/function.stream-select.php) - * > (and family). - * > - * > > Warning: stream_select(): cannot cast a filtered stream on this system in {file} on line {line} - * > - * > This is due to limitations of PHP's stream filter support, as it can no longer reliably - * > tell when the underlying stream resource is actually ready. - * > As an alternative, consider calling `stream_select()` on the unfiltered stream and - * > then pass the unfiltered data through the [`fun()`](#fun) function. - * - * @param resource $stream - * @param callable $callback - * @param int $read_write - * @return resource filter resource which can be used for `remove()` - * @throws \Exception on error - * @uses stream_filter_append() - */ -function append($stream, $callback, $read_write = STREAM_FILTER_ALL) -{ - $ret = @\stream_filter_append($stream, register(), $read_write, $callback); - - // PHP 8 throws above on type errors, older PHP and memory issues can throw here - // @codeCoverageIgnoreStart - if ($ret === false) { - $error = \error_get_last() + array('message' => ''); - throw new \RuntimeException('Unable to append filter: ' . $error['message']); - } - // @codeCoverageIgnoreEnd - - return $ret; -} - -/** - * Prepend a filter callback to the given stream. - * - * Each stream can have a list of filters attached. - * This function prepends a filter to the start of this list. - * - * If the given filter can not be added, it throws an `Exception`. - * - * ```php - * $filter = Clue\StreamFilter\prepend($stream, function ($chunk) { - * // will be called each time you read or write a $chunk to/from the stream - * return $chunk; - * }); - * ``` - * - * This function returns a filter resource which can be passed to [`remove()`](#remove). - * - * Except for the position in the list of filters, this function behaves exactly - * like the [`append()`](#append) function. - * For more details about its behavior, see also the [`append()`](#append) function. - * - * @param resource $stream - * @param callable $callback - * @param int $read_write - * @return resource filter resource which can be used for `remove()` - * @throws \Exception on error - * @uses stream_filter_prepend() - */ -function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL) -{ - $ret = @\stream_filter_prepend($stream, register(), $read_write, $callback); - - // PHP 8 throws above on type errors, older PHP and memory issues can throw here - // @codeCoverageIgnoreStart - if ($ret === false) { - $error = \error_get_last() + array('message' => ''); - throw new \RuntimeException('Unable to prepend filter: ' . $error['message']); - } - // @codeCoverageIgnoreEnd - - return $ret; -} - -/** - * Create a filter function which uses the given built-in `$filter`. - * - * PHP comes with a useful set of [built-in filters](https://www.php.net/manual/en/filters.php). - * Using `fun()` makes accessing these as easy as passing an input string to filter - * and getting the filtered output string. - * - * ```php - * $fun = Clue\StreamFilter\fun('string.rot13'); - * - * assert('grfg' === $fun('test')); - * assert('test' === $fun($fun('test')); - * ``` - * - * Please note that not all filter functions may be available depending - * on installed PHP extensions and the PHP version in use. - * In particular, [HHVM](https://hhvm.com/) may not offer the same filter functions - * or parameters as Zend PHP. - * Accessing an unknown filter function will result in a `RuntimeException`: - * - * ```php - * Clue\StreamFilter\fun('unknown'); // throws RuntimeException - * ``` - * - * Some filters may accept or require additional filter parameters – most - * filters do not require filter parameters. - * If given, the optional `$parameters` argument will be passed to the - * underlying filter handler as-is. - * In particular, note how *not passing* this parameter at all differs from - * explicitly passing a `null` value (which many filters do not accept). - * Please refer to the individual filter definition for more details. - * For example, the `string.strip_tags` filter can be invoked like this: - * - * ```php - * $fun = Clue\StreamFilter\fun('string.strip_tags', '
'); - * - * $ret = $fun('h
i
'); - * assert('hi' === $ret); - * ``` - * - * Under the hood, this function allocates a temporary memory stream, so it's - * recommended to clean up the filter function after use. - * Also, some filter functions (in particular the - * [zlib compression filters](https://www.php.net/manual/en/filters.compression.php)) - * may use internal buffers and may emit a final data chunk on close. - * The filter function can be closed by invoking without any arguments: - * - * ```php - * $fun = Clue\StreamFilter\fun('zlib.deflate'); - * - * $ret = $fun('hello') . $fun('world') . $fun(); - * assert('helloworld' === gzinflate($ret)); - * ``` - * - * The filter function must not be used anymore after it has been closed. - * Doing so will result in a `RuntimeException`: - * - * ```php - * $fun = Clue\StreamFilter\fun('string.rot13'); - * $fun(); - * - * $fun('test'); // throws RuntimeException - * ``` - * - * > Note: If you're using the zlib compression filters, then you should be wary - * about engine inconsistencies between different PHP versions and HHVM. - * These inconsistencies exist in the underlying PHP engines and there's little we - * can do about this in this library. - * [Our test suite](tests/) contains several test cases that exhibit these issues. - * If you feel some test case is missing or outdated, we're happy to accept PRs! :) - * - * @param string $filter built-in filter name. See stream_get_filters() or http://php.net/manual/en/filters.php - * @param mixed $parameters (optional) parameters to pass to the built-in filter as-is - * @return callable a filter callback which can be append()'ed or prepend()'ed - * @throws \RuntimeException on error - * @link http://php.net/manual/en/filters.php - * @see stream_get_filters() - * @see append() - */ -function fun($filter, $parameters = null) -{ - $fp = \fopen('php://memory', 'w'); - if (\func_num_args() === 1) { - $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE); - } else { - $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE, $parameters); - } - - if ($filter === false) { - \fclose($fp); - $error = \error_get_last() + array('message' => ''); - throw new \RuntimeException('Unable to access built-in filter: ' . $error['message']); - } - - // append filter function which buffers internally - $buffer = ''; - append($fp, function ($chunk) use (&$buffer) { - $buffer .= $chunk; - - // always return empty string in order to skip actually writing to stream resource - return ''; - }, \STREAM_FILTER_WRITE); - - $closed = false; - - return function ($chunk = null) use ($fp, $filter, &$buffer, &$closed) { - if ($closed) { - throw new \RuntimeException('Unable to perform operation on closed stream'); - } - if ($chunk === null) { - $closed = true; - $buffer = ''; - \fclose($fp); - return $buffer; - } - // initialize buffer and invoke filters by attempting to write to stream - $buffer = ''; - \fwrite($fp, $chunk); - - // buffer now contains everything the filter function returned - return $buffer; - }; -} - -/** - * Remove a filter previously added via `append()` or `prepend()`. - * - * ```php - * $filter = Clue\StreamFilter\append($stream, function () { - * // … - * }); - * Clue\StreamFilter\remove($filter); - * ``` - * - * @param resource $filter - * @return bool true on success or false on error - * @throws \RuntimeException on error - * @uses stream_filter_remove() - */ -function remove($filter) -{ - if (@\stream_filter_remove($filter) === false) { - // PHP 8 throws above on type errors, older PHP and memory issues can throw here - $error = \error_get_last(); - throw new \RuntimeException('Unable to remove filter: ' . $error['message']); - } -} - -/** - * Registers the callback filter and returns the resulting filter name - * - * There should be little reason to call this function manually. - * - * @return string filter name - * @uses CallbackFilter - */ -function register() -{ - static $registered = null; - if ($registered === null) { - $registered = 'stream-callback'; - \stream_filter_register($registered, __NAMESPACE__ . '\CallbackFilter'); - } - return $registered; -} diff --git a/vendor/clue/stream-filter/src/functions_include.php b/vendor/clue/stream-filter/src/functions_include.php deleted file mode 100644 index 4b315ae8..00000000 --- a/vendor/clue/stream-filter/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ -> - */ private $prefixLengthsPsr4 = array(); - /** - * @var array[] - * @psalm-var array> - */ private $prefixDirsPsr4 = array(); - /** - * @var array[] - * @psalm-var array - */ private $fallbackDirsPsr4 = array(); // PSR-0 - /** - * @var array[] - * @psalm-var array> - */ private $prefixesPsr0 = array(); - /** - * @var array[] - * @psalm-var array - */ private $fallbackDirsPsr0 = array(); - /** @var bool */ private $useIncludePath = false; - - /** - * @var string[] - * @psalm-var array - */ private $classMap = array(); - - /** @var bool */ private $classMapAuthoritative = false; - - /** - * @var bool[] - * @psalm-var array - */ private $missingClasses = array(); - - /** @var ?string */ private $apcuPrefix; - /** - * @var self[] - */ private static $registeredLoaders = array(); - /** - * @param ?string $vendorDir - */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } - /** - * @return string[] - */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -120,47 +75,28 @@ class ClassLoader return array(); } - /** - * @return array[] - * @psalm-return array> - */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } - /** - * @return array[] - * @psalm-return array - */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } - /** - * @return array[] - * @psalm-return array - */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } - /** - * @return string[] Array of classname => path - * @psalm-return array - */ public function getClassMap() { return $this->classMap; } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap - * - * @return void + * @param array $classMap Class to filename map */ public function addClassMap(array $classMap) { @@ -175,11 +111,9 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories */ public function add($prefix, $paths, $prepend = false) { @@ -222,13 +156,11 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException - * - * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -272,10 +204,8 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories - * - * @return void + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories */ public function set($prefix, $paths) { @@ -290,12 +220,10 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException - * - * @return void */ public function setPsr4($prefix, $paths) { @@ -315,8 +243,6 @@ class ClassLoader * Turns on searching the include path for class files. * * @param bool $useIncludePath - * - * @return void */ public function setUseIncludePath($useIncludePath) { @@ -339,8 +265,6 @@ class ClassLoader * that have not been registered with the class map. * * @param bool $classMapAuthoritative - * - * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -361,8 +285,6 @@ class ClassLoader * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix - * - * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -383,8 +305,6 @@ class ClassLoader * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void */ public function register($prepend = false) { @@ -404,8 +324,6 @@ class ClassLoader /** * Unregisters this instance as an autoloader. - * - * @return void */ public function unregister() { @@ -420,7 +338,7 @@ class ClassLoader * Loads the given class or interface. * * @param string $class The name of the class - * @return true|null True if loaded, null otherwise + * @return bool|null True if loaded, null otherwise */ public function loadClass($class) { @@ -429,8 +347,6 @@ class ClassLoader return true; } - - return null; } /** @@ -485,11 +401,6 @@ class ClassLoader return self::$registeredLoaders; } - /** - * @param string $class - * @param string $ext - * @return string|false - */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -561,10 +472,6 @@ class ClassLoader * Scope isolated include. * * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private */ function includeFile($file) { diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index d50e0c9f..53fc4148 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -1,350 +1,512 @@ - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ + + + + + + + + + namespace Composer; use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - */ + + + + + class InstalledVersions { - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null - */ - private static $installed; +private static $installed = array ( + 'root' => + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( + ), + 'reference' => '56e4f7e7ff00c70c04c56fb74af24e134a0e0ec9', + 'name' => '__root__', + ), + 'versions' => + array ( + '__root__' => + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( + ), + 'reference' => '56e4f7e7ff00c70c04c56fb74af24e134a0e0ec9', + ), + 'composer/ca-bundle' => + array ( + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'aliases' => + array ( + ), + 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', + ), + 'dealerdirect/phpcodesniffer-composer-installer' => + array ( + 'pretty_version' => 'v0.7.2', + 'version' => '0.7.2.0', + 'aliases' => + array ( + ), + 'reference' => '1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db', + ), + 'embed/embed' => + array ( + 'pretty_version' => 'v4.4.3', + 'version' => '4.4.3.0', + 'aliases' => + array ( + ), + 'reference' => '2ac32581a8617c3bbe593e3d7799ca9db6974471', + ), + 'gettext/gettext' => + array ( + 'pretty_version' => 'v5.6.1', + 'version' => '5.6.1.0', + 'aliases' => + array ( + ), + 'reference' => '017e249601d32b9a88c2eb4c10eac89bf582a7d3', + ), + 'gettext/languages' => + array ( + 'pretty_version' => '2.9.0', + 'version' => '2.9.0.0', + 'aliases' => + array ( + ), + 'reference' => 'ed56dd2c7f4024cc953ed180d25f02f2640e3ffa', + ), + 'grandel/include-directory' => + array ( + 'pretty_version' => 'v0.2.2', + 'version' => '0.2.2.0', + 'aliases' => + array ( + ), + 'reference' => 'a5c830e8f1527c818b521ab18f2accecb02f9919', + ), + 'guzzlehttp/guzzle' => + array ( + 'pretty_version' => '7.4.1', + 'version' => '7.4.1.0', + 'aliases' => + array ( + ), + 'reference' => 'ee0a041b1760e6a53d2a39c8c34115adc2af2c79', + ), + 'guzzlehttp/promises' => + array ( + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', + 'aliases' => + array ( + ), + 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', + ), + 'guzzlehttp/psr7' => + array ( + 'pretty_version' => '2.1.0', + 'version' => '2.1.0.0', + 'aliases' => + array ( + ), + 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', + ), + 'http-interop/http-factory-guzzle' => + array ( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '8f06e92b95405216b237521cc64c804dd44c4a81', + ), + 'laminas/laminas-diactoros' => + array ( + 'pretty_version' => '2.8.0', + 'version' => '2.8.0.0', + 'aliases' => + array ( + ), + 'reference' => '0c26ef1d95b6d7e6e3943a243ba3dc0797227199', + ), + 'ml/iri' => + array ( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'aliases' => + array ( + ), + 'reference' => 'cbd44fa913e00ea624241b38cefaa99da8d71341', + ), + 'ml/json-ld' => + array ( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c74a1aed5979ed1cfb1be35a55a305fd30e30b93', + ), + 'oscarotero/html-parser' => + array ( + 'pretty_version' => 'v0.1.6', + 'version' => '0.1.6.0', + 'aliases' => + array ( + ), + 'reference' => 'b61e92f634d0dc184339d24630a6968d3ac64ded', + ), + 'psr/http-client' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + ), + 'psr/http-client-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'psr/http-factory' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + ), + 'psr/http-factory-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + 1 => '^1.0', + ), + ), + 'psr/http-message' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + ), + 'psr/http-message-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'qferr/mjml-php' => + array ( + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c6ea36c190e304e399a957f7e03b5a378faf41b9', + ), + 'ralouphie/getallheaders' => + array ( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + ), + 'squizlabs/php_codesniffer' => + array ( + 'pretty_version' => '3.6.2', + 'version' => '3.6.2.0', + 'aliases' => + array ( + ), + 'reference' => '5e4e71592f69da17871dba6e80dd51bce74a351a', + ), + 'symfony/deprecation-contracts' => + array ( + 'pretty_version' => 'v3.0.0', + 'version' => '3.0.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c726b64c1ccfe2896cb7df2e1331c357ad1c8ced', + ), + 'symfony/polyfill-php80' => + array ( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'aliases' => + array ( + ), + 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', + ), + 'symfony/process' => + array ( + 'pretty_version' => 'v5.4.5', + 'version' => '5.4.5.0', + 'aliases' => + array ( + ), + 'reference' => '95440409896f90a5f85db07a32b517ecec17fa4c', + ), + ), +); +private static $canGetVendors; +private static $installedByVendor = array(); - /** - * @var bool|null - */ - private static $canGetVendors; - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - if (1 === \count($packages)) { - return $packages[0]; - } - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } +public static function getInstalledPackages() +{ +$packages = array(); +foreach (self::getInstalled() as $installed) { +$packages[] = array_keys($installed['versions']); +} + + +if (1 === \count($packages)) { +return $packages[0]; +} + +return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); +} + + + + + + + + + +public static function isInstalled($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (isset($installed['versions'][$packageName])) { +return true; +} +} + +return false; +} + + + + + + + + + + + + + + +public static function satisfies(VersionParser $parser, $packageName, $constraint) +{ +$constraint = $parser->parseConstraints($constraint); +$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + +return $provided->matches($constraint); +} + + + + + + + + + + +public static function getVersionRanges($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +$ranges = array(); +if (isset($installed['versions'][$packageName]['pretty_version'])) { +$ranges[] = $installed['versions'][$packageName]['pretty_version']; +} +if (array_key_exists('aliases', $installed['versions'][$packageName])) { +$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); +} +if (array_key_exists('replaced', $installed['versions'][$packageName])) { +$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); +} +if (array_key_exists('provided', $installed['versions'][$packageName])) { +$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); +} + +return implode(' || ', $ranges); +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getVersion($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +if (!isset($installed['versions'][$packageName]['version'])) { +return null; +} + +return $installed['versions'][$packageName]['version']; +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getPrettyVersion($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +if (!isset($installed['versions'][$packageName]['pretty_version'])) { +return null; +} + +return $installed['versions'][$packageName]['pretty_version']; +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getReference($packageName) +{ +foreach (self::getInstalled() as $installed) { +if (!isset($installed['versions'][$packageName])) { +continue; +} + +if (!isset($installed['versions'][$packageName]['reference'])) { +return null; +} + +return $installed['versions'][$packageName]['reference']; +} + +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + + + + + +public static function getRootPackage() +{ +$installed = self::getInstalled(); + +return $installed[0]['root']; +} + + + + + + + +public static function getRawData() +{ +return self::$installed; +} + + + + + + + + + + + + + + + + + + + +public static function reload($data) +{ +self::$installed = $data; +self::$installedByVendor = array(); +} + + + + +private static function getInstalled() +{ +if (null === self::$canGetVendors) { +self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); +} + +$installed = array(); + +if (self::$canGetVendors) { +foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { +if (isset(self::$installedByVendor[$vendorDir])) { +$installed[] = self::$installedByVendor[$vendorDir]; +} elseif (is_file($vendorDir.'/composer/installed.php')) { +$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; +} +} +} + +$installed[] = self::$installed; + +return $installed; +} } diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index dfbfd137..4c798419 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -7,9 +7,11 @@ $baseDir = dirname($vendorDir); return array( '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '9c67151ae59aff4788964ce8eb2a0f43' => $vendorDir . '/clue/stream-filter/src/functions_include.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', + '09fc349b549513bf7f4291502426f919' => $vendorDir . '/embed/embed/src/functions.php', '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -26,8 +28,4 @@ return array( 'cc8e14526dc240491e17a838cb78508c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', - '8cff32064859f4559445b89279f3199c' => $vendorDir . '/php-http/message/src/filters.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - '09fc349b549513bf7f4291502426f919' => $vendorDir . '/embed/embed/src/functions.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 56db7e7e..46a5f785 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -8,31 +8,20 @@ $baseDir = dirname($vendorDir); return array( 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), - 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'), 'Qferrer\\' => array($vendorDir . '/qferr/mjml-php/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), - 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'ML\\JsonLD\\' => array($vendorDir . '/ml/json-ld'), 'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'), - 'Http\\Promise\\' => array($vendorDir . '/php-http/promise/src'), - 'Http\\Message\\MultipartStream\\' => array($vendorDir . '/php-http/multipart-stream-builder/src'), - 'Http\\Message\\' => array($vendorDir . '/php-http/message/src', $vendorDir . '/php-http/message-factory/src'), 'Http\\Factory\\Guzzle\\' => array($vendorDir . '/http-interop/http-factory-guzzle/src'), - 'Http\\Discovery\\' => array($vendorDir . '/php-http/discovery/src'), - 'Http\\Client\\Common\\Plugin\\' => array($vendorDir . '/php-http/cache-plugin/src'), - 'Http\\Client\\Common\\' => array($vendorDir . '/php-http/client-common/src'), - 'Http\\Client\\' => array($vendorDir . '/php-http/httplug/src'), 'HtmlParser\\' => array($vendorDir . '/oscarotero/html-parser/src'), 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'Grandel\\' => array($vendorDir . '/grandel/include-directory/src'), - 'Github\\' => array($vendorDir . '/knplabs/github-api/lib/Github'), 'Gettext\\Languages\\' => array($vendorDir . '/gettext/languages/src'), 'Gettext\\' => array($vendorDir . '/gettext/gettext/src'), 'Embed\\' => array($vendorDir . '/embed/embed/src'), 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'), 'Composer\\CaBundle\\' => array($vendorDir . '/composer/ca-bundle/src'), - 'Clue\\StreamFilter\\' => array($vendorDir . '/clue/stream-filter/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 2c5e14e1..56b5e75a 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -65,16 +65,11 @@ class ComposerAutoloaderInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 } } -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ function composerRequire5f3db9fc1d0cf1dd6a77a1d84501b4b1($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - require $file; + + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; } } diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 3a33c8f3..eb371d69 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -8,9 +8,11 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 { public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '9c67151ae59aff4788964ce8eb2a0f43' => __DIR__ . '/..' . '/clue/stream-filter/src/functions_include.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', + '09fc349b549513bf7f4291502426f919' => __DIR__ . '/..' . '/embed/embed/src/functions.php', '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -27,10 +29,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 'cc8e14526dc240491e17a838cb78508c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.legacy.php', '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', - '8cff32064859f4559445b89279f3199c' => __DIR__ . '/..' . '/php-http/message/src/filters.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', - '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - '09fc349b549513bf7f4291502426f919' => __DIR__ . '/..' . '/embed/embed/src/functions.php', ); public static $prefixLengthsPsr4 = array ( @@ -38,7 +36,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 array ( 'Symfony\\Polyfill\\Php80\\' => 23, 'Symfony\\Component\\Process\\' => 26, - 'Symfony\\Component\\OptionsResolver\\' => 34, ), 'Q' => array ( @@ -48,7 +45,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 array ( 'Psr\\Http\\Message\\' => 17, 'Psr\\Http\\Client\\' => 16, - 'Psr\\Cache\\' => 10, ), 'M' => array ( @@ -60,14 +56,7 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 ), 'H' => array ( - 'Http\\Promise\\' => 13, - 'Http\\Message\\MultipartStream\\' => 29, - 'Http\\Message\\' => 13, 'Http\\Factory\\Guzzle\\' => 20, - 'Http\\Discovery\\' => 15, - 'Http\\Client\\Common\\Plugin\\' => 26, - 'Http\\Client\\Common\\' => 19, - 'Http\\Client\\' => 12, 'HtmlParser\\' => 11, ), 'G' => @@ -76,7 +65,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 'GuzzleHttp\\Promise\\' => 19, 'GuzzleHttp\\' => 11, 'Grandel\\' => 8, - 'Github\\' => 7, 'Gettext\\Languages\\' => 18, 'Gettext\\' => 8, ), @@ -91,7 +79,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 'C' => array ( 'Composer\\CaBundle\\' => 18, - 'Clue\\StreamFilter\\' => 18, ), ); @@ -104,10 +91,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 array ( 0 => __DIR__ . '/..' . '/symfony/process', ), - 'Symfony\\Component\\OptionsResolver\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/options-resolver', - ), 'Qferrer\\' => array ( 0 => __DIR__ . '/..' . '/qferr/mjml-php/src', @@ -121,10 +104,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 array ( 0 => __DIR__ . '/..' . '/psr/http-client/src', ), - 'Psr\\Cache\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/cache/src', - ), 'ML\\JsonLD\\' => array ( 0 => __DIR__ . '/..' . '/ml/json-ld', @@ -133,39 +112,10 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 array ( 0 => __DIR__ . '/..' . '/laminas/laminas-diactoros/src', ), - 'Http\\Promise\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/promise/src', - ), - 'Http\\Message\\MultipartStream\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/multipart-stream-builder/src', - ), - 'Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/message/src', - 1 => __DIR__ . '/..' . '/php-http/message-factory/src', - ), 'Http\\Factory\\Guzzle\\' => array ( 0 => __DIR__ . '/..' . '/http-interop/http-factory-guzzle/src', ), - 'Http\\Discovery\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/discovery/src', - ), - 'Http\\Client\\Common\\Plugin\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/cache-plugin/src', - ), - 'Http\\Client\\Common\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/client-common/src', - ), - 'Http\\Client\\' => - array ( - 0 => __DIR__ . '/..' . '/php-http/httplug/src', - ), 'HtmlParser\\' => array ( 0 => __DIR__ . '/..' . '/oscarotero/html-parser/src', @@ -186,10 +136,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 array ( 0 => __DIR__ . '/..' . '/grandel/include-directory/src', ), - 'Github\\' => - array ( - 0 => __DIR__ . '/..' . '/knplabs/github-api/lib/Github', - ), 'Gettext\\Languages\\' => array ( 0 => __DIR__ . '/..' . '/gettext/languages/src', @@ -210,10 +156,6 @@ class ComposerStaticInit5f3db9fc1d0cf1dd6a77a1d84501b4b1 array ( 0 => __DIR__ . '/..' . '/composer/ca-bundle/src', ), - 'Clue\\StreamFilter\\' => - array ( - 0 => __DIR__ . '/..' . '/clue/stream-filter/src', - ), ); public static $prefixesPsr0 = array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d6ef0c5e..fbfb8bee 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,74 +1,5 @@ { "packages": [ - { - "name": "clue/stream-filter", - "version": "v1.6.0", - "version_normalized": "1.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/clue/stream-filter.git", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/d6169430c7731d8509da7aecd0af756a5747b78e", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" - }, - "time": "2022-02-21T13:15:14+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "Clue\\StreamFilter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "support": { - "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.6.0" - }, - "funding": [ - { - "url": "https://clue.engineering/support", - "type": "custom" - }, - { - "url": "https://github.com/clue", - "type": "github" - } - ], - "install-path": "../clue/stream-filter" - }, { "name": "composer/ca-bundle", "version": "1.3.1", @@ -908,97 +839,6 @@ }, "install-path": "../http-interop/http-factory-guzzle" }, - { - "name": "knplabs/github-api", - "version": "v3.5.1", - "version_normalized": "3.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "37b167998e8e1f318b3d99633675cfa007540565" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/37b167998e8e1f318b3d99633675cfa007540565", - "reference": "37b167998e8e1f318b3d99633675cfa007540565", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^7.2.5 || ^8.0", - "php-http/cache-plugin": "^1.7.1", - "php-http/client-common": "^2.3", - "php-http/discovery": "^1.12", - "php-http/httplug": "^2.2", - "php-http/multipart-stream-builder": "^1.1.2", - "psr/cache": "^1.0|^2.0|^3.0", - "psr/http-client-implementation": "^1.0", - "psr/http-factory-implementation": "^1.0", - "psr/http-message": "^1.0", - "symfony/deprecation-contracts": "^2.2|^3.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "guzzlehttp/guzzle": "^7.2", - "guzzlehttp/psr7": "^1.7", - "http-interop/http-factory-guzzle": "^1.0", - "php-http/mock-client": "^1.4.1", - "phpstan/extension-installer": "^1.0.5", - "phpstan/phpstan": "^0.12.57", - "phpstan/phpstan-deprecation-rules": "^0.12.5", - "phpunit/phpunit": "^8.5 || ^9.4", - "symfony/cache": "^5.1.8", - "symfony/phpunit-bridge": "^5.2" - }, - "time": "2022-02-19T11:15:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.20.x-dev", - "dev-master": "3.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Github\\": "lib/Github/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" - }, - { - "name": "Thibault Duplessis", - "email": "thibault.duplessis@gmail.com", - "homepage": "http://ornicar.github.com" - } - ], - "description": "GitHub API v3 client", - "homepage": "https://github.com/KnpLabs/php-github-api", - "keywords": [ - "api", - "gh", - "gist", - "github" - ], - "support": { - "issues": "https://github.com/KnpLabs/php-github-api/issues", - "source": "https://github.com/KnpLabs/php-github-api/tree/v3.5.1" - }, - "funding": [ - { - "url": "https://github.com/acrobat", - "type": "github" - } - ], - "install-path": "../knplabs/github-api" - }, { "name": "laminas/laminas-diactoros", "version": "2.8.0", @@ -1267,593 +1107,6 @@ }, "install-path": "../oscarotero/html-parser" }, - { - "name": "php-http/cache-plugin", - "version": "1.7.5", - "version_normalized": "1.7.5.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/cache-plugin.git", - "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/63bc3f7242825c9a817db8f78e4c9703b0c471e2", - "reference": "63bc3f7242825c9a817db8f78e4c9703b0c471e2", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/client-common": "^1.9 || ^2.0", - "php-http/message-factory": "^1.0", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "time": "2022-01-18T12:24:56+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Client\\Common\\Plugin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "PSR-6 Cache plugin for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "cache", - "http", - "httplug", - "plugin" - ], - "support": { - "issues": "https://github.com/php-http/cache-plugin/issues", - "source": "https://github.com/php-http/cache-plugin/tree/1.7.5" - }, - "install-path": "../php-http/cache-plugin" - }, - { - "name": "php-http/client-common", - "version": "2.5.0", - "version_normalized": "2.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "d135751167d57e27c74de674d6a30cef2dc8e054" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/d135751167d57e27c74de674d6a30cef2dc8e054", - "reference": "d135751167d57e27c74de674d6a30cef2dc8e054", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" - }, - "time": "2021-11-26T15:01:24+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "common", - "http", - "httplug" - ], - "support": { - "issues": "https://github.com/php-http/client-common/issues", - "source": "https://github.com/php-http/client-common/tree/2.5.0" - }, - "install-path": "../php-http/client-common" - }, - { - "name": "php-http/discovery", - "version": "1.14.1", - "version_normalized": "1.14.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/discovery.git", - "reference": "de90ab2b41d7d61609f504e031339776bc8c7223" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/de90ab2b41d7d61609f504e031339776bc8c7223", - "reference": "de90ab2b41d7d61609f504e031339776bc8c7223", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "nyholm/psr7": "<1.0" - }, - "require-dev": { - "graham-campbell/phpspec-skip-example-extension": "^5.0", - "php-http/httplug": "^1.0 || ^2.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1", - "puli/composer-plugin": "1.0.0-beta10" - }, - "suggest": { - "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" - }, - "time": "2021-09-18T07:57:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Discovery\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Finds installed HTTPlug implementations and PSR-7 message factories", - "homepage": "http://php-http.org", - "keywords": [ - "adapter", - "client", - "discovery", - "factory", - "http", - "message", - "psr7" - ], - "support": { - "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.14.1" - }, - "install-path": "../php-http/discovery" - }, - { - "name": "php-http/httplug", - "version": "2.3.0", - "version_normalized": "2.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "f640739f80dfa1152533976e3c112477f69274eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/f640739f80dfa1152533976e3c112477f69274eb", - "reference": "f640739f80dfa1152533976e3c112477f69274eb", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1", - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "time": "2022-02-21T09:52:22+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "http" - ], - "support": { - "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.3.0" - }, - "install-path": "../php-http/httplug" - }, - { - "name": "php-http/message", - "version": "1.13.0", - "version_normalized": "1.13.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/7886e647a30a966a1a8d1dad1845b71ca8678361", - "reference": "7886e647a30a966a1a8d1dad1845b71ca8678361", - "shasum": "" - }, - "require": { - "clue/stream-filter": "^1.5", - "php": "^7.1 || ^8.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.6", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "laminas/laminas-diactoros": "^2.0", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "time": "2022-02-11T13:41:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/filters.php" - ], - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", - "keywords": [ - "http", - "message", - "psr-7" - ], - "support": { - "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.13.0" - }, - "install-path": "../php-http/message" - }, - { - "name": "php-http/message-factory", - "version": "v1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "time": "2015-12-19T14:08:53+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/master" - }, - "install-path": "../php-http/message-factory" - }, - { - "name": "php-http/multipart-stream-builder", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/multipart-stream-builder.git", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/11c1d31f72e01c738bbce9e27649a7cca829c30e", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "php-http/discovery": "^1.7", - "php-http/message-factory": "^1.0.2", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "nyholm/psr7": "^1.0", - "php-http/message": "^1.5", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" - }, - "time": "2021-05-21T08:32:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Message\\MultipartStream\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - } - ], - "description": "A builder class that help you create a multipart stream", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "multipart stream", - "stream" - ], - "support": { - "issues": "https://github.com/php-http/multipart-stream-builder/issues", - "source": "https://github.com/php-http/multipart-stream-builder/tree/1.2.0" - }, - "install-path": "../php-http/multipart-stream-builder" - }, - { - "name": "php-http/promise", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "reference": "4c4c1f9b7289a2ec57cde7f1e9762a5789506f88", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.3.2", - "phpspec/phpspec": "^5.1.2 || ^6.2" - }, - "time": "2020-07-07T09:29:14+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.1.0" - }, - "install-path": "../php-http/promise" - }, - { - "name": "psr/cache", - "version": "3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "time": "2021-02-03T23:26:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "install-path": "../psr/cache" - }, { "name": "psr/http-client", "version": "1.0.1", @@ -2243,76 +1496,6 @@ ], "install-path": "../symfony/deprecation-contracts" }, - { - "name": "symfony/options-resolver", - "version": "v6.0.3", - "version_normalized": "6.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "51f7006670febe4cbcbae177cbffe93ff833250d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/51f7006670febe4cbcbae177cbffe93ff833250d", - "reference": "51f7006670febe4cbcbae177cbffe93ff833250d", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "time": "2022-01-02T09:55:41+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.0.3" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/options-resolver" - }, { "name": "symfony/polyfill-php80", "version": "v1.25.0", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d82bf928..fb44753e 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,363 +1,253 @@ - array( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => 'a739fb797078662b318e799a9545755c6a03ce82', - 'name' => '__root__', - 'dev' => true, + + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( ), - 'versions' => array( - '__root__' => array( - 'pretty_version' => 'dev-develop', - 'version' => 'dev-develop', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => 'a739fb797078662b318e799a9545755c6a03ce82', - 'dev_requirement' => false, - ), - 'clue/stream-filter' => array( - 'pretty_version' => 'v1.6.0', - 'version' => '1.6.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../clue/stream-filter', - 'aliases' => array(), - 'reference' => 'd6169430c7731d8509da7aecd0af756a5747b78e', - 'dev_requirement' => false, - ), - 'composer/ca-bundle' => array( - 'pretty_version' => '1.3.1', - 'version' => '1.3.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./ca-bundle', - 'aliases' => array(), - 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', - 'dev_requirement' => false, - ), - 'dealerdirect/phpcodesniffer-composer-installer' => array( - 'pretty_version' => 'v0.7.2', - 'version' => '0.7.2.0', - 'type' => 'composer-plugin', - 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', - 'aliases' => array(), - 'reference' => '1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db', - 'dev_requirement' => true, - ), - 'embed/embed' => array( - 'pretty_version' => 'v4.4.3', - 'version' => '4.4.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../embed/embed', - 'aliases' => array(), - 'reference' => '2ac32581a8617c3bbe593e3d7799ca9db6974471', - 'dev_requirement' => false, - ), - 'gettext/gettext' => array( - 'pretty_version' => 'v5.6.1', - 'version' => '5.6.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../gettext/gettext', - 'aliases' => array(), - 'reference' => '017e249601d32b9a88c2eb4c10eac89bf582a7d3', - 'dev_requirement' => false, - ), - 'gettext/languages' => array( - 'pretty_version' => '2.9.0', - 'version' => '2.9.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../gettext/languages', - 'aliases' => array(), - 'reference' => 'ed56dd2c7f4024cc953ed180d25f02f2640e3ffa', - 'dev_requirement' => false, - ), - 'grandel/include-directory' => array( - 'pretty_version' => 'v0.2.2', - 'version' => '0.2.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../grandel/include-directory', - 'aliases' => array(), - 'reference' => 'a5c830e8f1527c818b521ab18f2accecb02f9919', - 'dev_requirement' => false, - ), - 'guzzlehttp/guzzle' => array( - 'pretty_version' => '7.4.1', - 'version' => '7.4.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', - 'aliases' => array(), - 'reference' => 'ee0a041b1760e6a53d2a39c8c34115adc2af2c79', - 'dev_requirement' => false, - ), - 'guzzlehttp/promises' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/promises', - 'aliases' => array(), - 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', - 'dev_requirement' => false, - ), - 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.1.0', - 'version' => '2.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../guzzlehttp/psr7', - 'aliases' => array(), - 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', - 'dev_requirement' => false, - ), - 'http-interop/http-factory-guzzle' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../http-interop/http-factory-guzzle', - 'aliases' => array(), - 'reference' => '8f06e92b95405216b237521cc64c804dd44c4a81', - 'dev_requirement' => false, - ), - 'knplabs/github-api' => array( - 'pretty_version' => 'v3.5.1', - 'version' => '3.5.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../knplabs/github-api', - 'aliases' => array(), - 'reference' => '37b167998e8e1f318b3d99633675cfa007540565', - 'dev_requirement' => false, - ), - 'laminas/laminas-diactoros' => array( - 'pretty_version' => '2.8.0', - 'version' => '2.8.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laminas/laminas-diactoros', - 'aliases' => array(), - 'reference' => '0c26ef1d95b6d7e6e3943a243ba3dc0797227199', - 'dev_requirement' => false, - ), - 'ml/iri' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ml/iri/ML/IRI', - 'aliases' => array(), - 'reference' => 'cbd44fa913e00ea624241b38cefaa99da8d71341', - 'dev_requirement' => false, - ), - 'ml/json-ld' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ml/json-ld', - 'aliases' => array(), - 'reference' => 'c74a1aed5979ed1cfb1be35a55a305fd30e30b93', - 'dev_requirement' => false, - ), - 'oscarotero/html-parser' => array( - 'pretty_version' => 'v0.1.6', - 'version' => '0.1.6.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../oscarotero/html-parser', - 'aliases' => array(), - 'reference' => 'b61e92f634d0dc184339d24630a6968d3ac64ded', - 'dev_requirement' => false, - ), - 'php-http/cache-plugin' => array( - 'pretty_version' => '1.7.5', - 'version' => '1.7.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/cache-plugin', - 'aliases' => array(), - 'reference' => '63bc3f7242825c9a817db8f78e4c9703b0c471e2', - 'dev_requirement' => false, - ), - 'php-http/client-common' => array( - 'pretty_version' => '2.5.0', - 'version' => '2.5.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/client-common', - 'aliases' => array(), - 'reference' => 'd135751167d57e27c74de674d6a30cef2dc8e054', - 'dev_requirement' => false, - ), - 'php-http/discovery' => array( - 'pretty_version' => '1.14.1', - 'version' => '1.14.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/discovery', - 'aliases' => array(), - 'reference' => 'de90ab2b41d7d61609f504e031339776bc8c7223', - 'dev_requirement' => false, - ), - 'php-http/httplug' => array( - 'pretty_version' => '2.3.0', - 'version' => '2.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/httplug', - 'aliases' => array(), - 'reference' => 'f640739f80dfa1152533976e3c112477f69274eb', - 'dev_requirement' => false, - ), - 'php-http/message' => array( - 'pretty_version' => '1.13.0', - 'version' => '1.13.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/message', - 'aliases' => array(), - 'reference' => '7886e647a30a966a1a8d1dad1845b71ca8678361', - 'dev_requirement' => false, - ), - 'php-http/message-factory' => array( - 'pretty_version' => 'v1.0.2', - 'version' => '1.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/message-factory', - 'aliases' => array(), - 'reference' => 'a478cb11f66a6ac48d8954216cfed9aa06a501a1', - 'dev_requirement' => false, - ), - 'php-http/message-factory-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'php-http/multipart-stream-builder' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/multipart-stream-builder', - 'aliases' => array(), - 'reference' => '11c1d31f72e01c738bbce9e27649a7cca829c30e', - 'dev_requirement' => false, - ), - 'php-http/promise' => array( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../php-http/promise', - 'aliases' => array(), - 'reference' => '4c4c1f9b7289a2ec57cde7f1e9762a5789506f88', - 'dev_requirement' => false, - ), - 'psr/cache' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/cache', - 'aliases' => array(), - 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', - 'dev_requirement' => false, - ), - 'psr/http-client' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-client', - 'aliases' => array(), - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - 'dev_requirement' => false, - ), - 'psr/http-client-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-factory', - 'aliases' => array(), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - 'dev_requirement' => false, - ), - 'psr/http-factory-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - 1 => '^1.0', - ), - ), - 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-message', - 'aliases' => array(), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', - 'dev_requirement' => false, - ), - 'psr/http-message-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'qferr/mjml-php' => array( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../qferr/mjml-php', - 'aliases' => array(), - 'reference' => 'c6ea36c190e304e399a957f7e03b5a378faf41b9', - 'dev_requirement' => false, - ), - 'ralouphie/getallheaders' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ralouphie/getallheaders', - 'aliases' => array(), - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', - 'dev_requirement' => false, - ), - 'squizlabs/php_codesniffer' => array( - 'pretty_version' => '3.6.2', - 'version' => '3.6.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', - 'aliases' => array(), - 'reference' => '5e4e71592f69da17871dba6e80dd51bce74a351a', - 'dev_requirement' => true, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.0.0', - 'version' => '3.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => 'c726b64c1ccfe2896cb7df2e1331c357ad1c8ced', - 'dev_requirement' => false, - ), - 'symfony/options-resolver' => array( - 'pretty_version' => 'v6.0.3', - 'version' => '6.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/options-resolver', - 'aliases' => array(), - 'reference' => '51f7006670febe4cbcbae177cbffe93ff833250d', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', - 'dev_requirement' => false, - ), - 'symfony/process' => array( - 'pretty_version' => 'v5.4.5', - 'version' => '5.4.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/process', - 'aliases' => array(), - 'reference' => '95440409896f90a5f85db07a32b517ecec17fa4c', - 'dev_requirement' => false, - ), + 'reference' => '56e4f7e7ff00c70c04c56fb74af24e134a0e0ec9', + 'name' => '__root__', + ), + 'versions' => + array ( + '__root__' => + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( + ), + 'reference' => '56e4f7e7ff00c70c04c56fb74af24e134a0e0ec9', ), + 'composer/ca-bundle' => + array ( + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'aliases' => + array ( + ), + 'reference' => '4c679186f2aca4ab6a0f1b0b9cf9252decb44d0b', + ), + 'dealerdirect/phpcodesniffer-composer-installer' => + array ( + 'pretty_version' => 'v0.7.2', + 'version' => '0.7.2.0', + 'aliases' => + array ( + ), + 'reference' => '1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db', + ), + 'embed/embed' => + array ( + 'pretty_version' => 'v4.4.3', + 'version' => '4.4.3.0', + 'aliases' => + array ( + ), + 'reference' => '2ac32581a8617c3bbe593e3d7799ca9db6974471', + ), + 'gettext/gettext' => + array ( + 'pretty_version' => 'v5.6.1', + 'version' => '5.6.1.0', + 'aliases' => + array ( + ), + 'reference' => '017e249601d32b9a88c2eb4c10eac89bf582a7d3', + ), + 'gettext/languages' => + array ( + 'pretty_version' => '2.9.0', + 'version' => '2.9.0.0', + 'aliases' => + array ( + ), + 'reference' => 'ed56dd2c7f4024cc953ed180d25f02f2640e3ffa', + ), + 'grandel/include-directory' => + array ( + 'pretty_version' => 'v0.2.2', + 'version' => '0.2.2.0', + 'aliases' => + array ( + ), + 'reference' => 'a5c830e8f1527c818b521ab18f2accecb02f9919', + ), + 'guzzlehttp/guzzle' => + array ( + 'pretty_version' => '7.4.1', + 'version' => '7.4.1.0', + 'aliases' => + array ( + ), + 'reference' => 'ee0a041b1760e6a53d2a39c8c34115adc2af2c79', + ), + 'guzzlehttp/promises' => + array ( + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', + 'aliases' => + array ( + ), + 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', + ), + 'guzzlehttp/psr7' => + array ( + 'pretty_version' => '2.1.0', + 'version' => '2.1.0.0', + 'aliases' => + array ( + ), + 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', + ), + 'http-interop/http-factory-guzzle' => + array ( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '8f06e92b95405216b237521cc64c804dd44c4a81', + ), + 'laminas/laminas-diactoros' => + array ( + 'pretty_version' => '2.8.0', + 'version' => '2.8.0.0', + 'aliases' => + array ( + ), + 'reference' => '0c26ef1d95b6d7e6e3943a243ba3dc0797227199', + ), + 'ml/iri' => + array ( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'aliases' => + array ( + ), + 'reference' => 'cbd44fa913e00ea624241b38cefaa99da8d71341', + ), + 'ml/json-ld' => + array ( + 'pretty_version' => '1.2.0', + 'version' => '1.2.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c74a1aed5979ed1cfb1be35a55a305fd30e30b93', + ), + 'oscarotero/html-parser' => + array ( + 'pretty_version' => 'v0.1.6', + 'version' => '0.1.6.0', + 'aliases' => + array ( + ), + 'reference' => 'b61e92f634d0dc184339d24630a6968d3ac64ded', + ), + 'psr/http-client' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + ), + 'psr/http-client-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'psr/http-factory' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + ), + 'psr/http-factory-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + 1 => '^1.0', + ), + ), + 'psr/http-message' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + ), + 'psr/http-message-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'qferr/mjml-php' => + array ( + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c6ea36c190e304e399a957f7e03b5a378faf41b9', + ), + 'ralouphie/getallheaders' => + array ( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + ), + 'squizlabs/php_codesniffer' => + array ( + 'pretty_version' => '3.6.2', + 'version' => '3.6.2.0', + 'aliases' => + array ( + ), + 'reference' => '5e4e71592f69da17871dba6e80dd51bce74a351a', + ), + 'symfony/deprecation-contracts' => + array ( + 'pretty_version' => 'v3.0.0', + 'version' => '3.0.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c726b64c1ccfe2896cb7df2e1331c357ad1c8ced', + ), + 'symfony/polyfill-php80' => + array ( + 'pretty_version' => 'v1.25.0', + 'version' => '1.25.0.0', + 'aliases' => + array ( + ), + 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', + ), + 'symfony/process' => + array ( + 'pretty_version' => 'v5.4.5', + 'version' => '5.4.5.0', + 'aliases' => + array ( + ), + 'reference' => '95440409896f90a5f85db07a32b517ecec17fa4c', + ), + ), ); diff --git a/vendor/knplabs/github-api/CHANGELOG-3.X.md b/vendor/knplabs/github-api/CHANGELOG-3.X.md deleted file mode 100644 index 8155111b..00000000 --- a/vendor/knplabs/github-api/CHANGELOG-3.X.md +++ /dev/null @@ -1,114 +0,0 @@ -# Changelog - -## 3.5.1 - -### Fixed -- Boolean private needed to create private repo! ([mruell](https://github.com/mruell)) [#1051](https://github.com/KnpLabs/php-github-api/issues/1051) - -## 3.5.0 - -### Added -- added support for psr\cache 3.0 ([rconfig](https://github.com/rconfig)) [#1046](https://github.com/KnpLabs/php-github-api/issues/1046) -- Symfony: allow deprecation-contracts version 3 ([glaubinix](https://github.com/glaubinix)) [#1049](https://github.com/KnpLabs/php-github-api/issues/1049) - -### Changed -- Fix internal doc link ([staudenmeir](https://github.com/staudenmeir)) [#1044](https://github.com/KnpLabs/php-github-api/issues/1044) - -### Fixed -- Fix Client URL Prepending For GraphQL Endpoint on Enterprise ([asher-goldberg](https://github.com/asher-goldberg), [acrobat](https://github.com/acrobat)) [#1048](https://github.com/KnpLabs/php-github-api/issues/1048) - -## 3.4.0 - -### Added -- Add create a repository using a template endpoint ([martinbean](https://github.com/martinbean)) [#994](https://github.com/KnpLabs/php-github-api/issues/994) -- Allow fetching repo readme for a specific ref ([bery](https://github.com/bery)) [#1019](https://github.com/KnpLabs/php-github-api/issues/1019) -- allow assigning role to organisation members ([luceos](https://github.com/luceos)) [#1018](https://github.com/KnpLabs/php-github-api/issues/1018) -- Branch lists . ( ? query per_page) ([pitonic](https://github.com/pitonic)) [#1020](https://github.com/KnpLabs/php-github-api/issues/1020) -- Php8.1 support ([acrobat](https://github.com/acrobat)) [#1025](https://github.com/KnpLabs/php-github-api/issues/1025) -- Allow psr/cache 2.0 as well as 1.0 ([johnnoel](https://github.com/johnnoel)) [#1029](https://github.com/KnpLabs/php-github-api/issues/1029) -- adding code_with_match (#1024) ([QuentinRa](https://github.com/QuentinRa)) [#1031](https://github.com/KnpLabs/php-github-api/issues/1031) -- Added dir parameter for Repo readme ([AlexandrePavy](https://github.com/AlexandrePavy)) [#1032](https://github.com/KnpLabs/php-github-api/issues/1032) -- refs #955: deprecate Client::AUTH_* constants and replace them with AuthMethod::AUTH_* const ([ipalo](https://github.com/ipalo)) [#1036](https://github.com/KnpLabs/php-github-api/issues/1036) -- feat: Add `visibility` option to repo create ([gerdemann](https://github.com/gerdemann)) [#1038](https://github.com/KnpLabs/php-github-api/issues/1038) -- Feature get authenticated app ([kdaniel95](https://github.com/kdaniel95)) [#1041](https://github.com/KnpLabs/php-github-api/issues/1041) - -### Changed -- Fix up typos ([dereuromark](https://github.com/dereuromark)) [#1011](https://github.com/KnpLabs/php-github-api/issues/1011) -- Update integration authentication documentation for usage with lcobucci/jwt ^4 ([glaubinix](https://github.com/glaubinix)) [#1017](https://github.com/KnpLabs/php-github-api/issues/1017) -- Update result_pager.md ([tomsowerby](https://github.com/tomsowerby)) [#1023](https://github.com/KnpLabs/php-github-api/issues/1023) -- fix(doc): links to doc in CurrentUser class ([Nek-](https://github.com/Nek-)) [#1026](https://github.com/KnpLabs/php-github-api/issues/1026) -- Fix incorrect phpdoc ([gemal](https://github.com/gemal)) [#1034](https://github.com/KnpLabs/php-github-api/issues/1034) - -### Fixed -- Add accept header for creating repo from template ([davidpeach](https://github.com/davidpeach)) [#1030](https://github.com/KnpLabs/php-github-api/issues/1030) - -## 3.3.0 - -### Added -- Allow costume accept headers for GraphQL Endpoint. ([Necmttn](https://github.com/Necmttn)) [#1001](https://github.com/KnpLabs/php-github-api/issues/1001) -- Add endpoint for approve workflow run ([Nyholm](https://github.com/Nyholm)) [#1006](https://github.com/KnpLabs/php-github-api/issues/1006) - -### Changed -- Update readme and add example for different http client usage ([acrobat](https://github.com/acrobat)) [#1002](https://github.com/KnpLabs/php-github-api/issues/1002) -- Bumped branch alias after new feature merged ([GrahamCampbell](https://github.com/GrahamCampbell)) [#1004](https://github.com/KnpLabs/php-github-api/issues/1004) -- Add comment on AbstractApi::$perPage() ([Nyholm](https://github.com/Nyholm)) [#1007](https://github.com/KnpLabs/php-github-api/issues/1007) - -### Fixed -- Fix publicKey ([Yurunsoft](https://github.com/Yurunsoft)) [#1005](https://github.com/KnpLabs/php-github-api/issues/1005) - -## 3.2.0 - -### Added -- Deprecate ResultPager::postFetch method ([acrobat](https://github.com/acrobat)) [#986](https://github.com/KnpLabs/php-github-api/issues/986) -- Add deprecations to the PR review methods to allow cleanup ([acrobat](https://github.com/acrobat)) [#984](https://github.com/KnpLabs/php-github-api/issues/984) -- Allow binary content downloads of assets ([acrobat](https://github.com/acrobat)) [#990](https://github.com/KnpLabs/php-github-api/issues/990) -- Deployments: added missing 'delete deployment' endpoint ([clxmstaab](https://github.com/clxmstaab)) [#991](https://github.com/KnpLabs/php-github-api/issues/991) -- Events list per authenticated user for all repos ([richard015ar](https://github.com/richard015ar)) [#1000](https://github.com/KnpLabs/php-github-api/issues/1000) - -### Changed -- Fixed branch alias ([GrahamCampbell](https://github.com/GrahamCampbell)) [#975](https://github.com/KnpLabs/php-github-api/issues/975) -- fix typo ([staabm](https://github.com/staabm)) [#977](https://github.com/KnpLabs/php-github-api/issues/977) -- Improved bc check ([acrobat](https://github.com/acrobat)) [#982](https://github.com/KnpLabs/php-github-api/issues/982) -- Correctly link to github actions docs and fix backlinks ([acrobat](https://github.com/acrobat)) [#983](https://github.com/KnpLabs/php-github-api/issues/983) -- Add missing repo hooks documentation ([acrobat](https://github.com/acrobat)) [#987](https://github.com/KnpLabs/php-github-api/issues/987) -- Fix incorrect public key documentation ([acrobat](https://github.com/acrobat)) [#988](https://github.com/KnpLabs/php-github-api/issues/988) -- Fixed incorrect parameters in apps docs ([acrobat](https://github.com/acrobat)) [#989](https://github.com/KnpLabs/php-github-api/issues/989) -- phpdoc: fix typo ([clxmstaab](https://github.com/clxmstaab)) [#993](https://github.com/KnpLabs/php-github-api/issues/993) -- Fix upmerged usage of deprecated phpunit assert ([acrobat](https://github.com/acrobat)) [#995](https://github.com/KnpLabs/php-github-api/issues/995) -- Fix typo ([romainneutron](https://github.com/romainneutron)) [#997](https://github.com/KnpLabs/php-github-api/issues/997) - -### Fixed -- Deployments: use proper media-type for in_progress/queued, inactive state ([staabm](https://github.com/staabm)) [#979](https://github.com/KnpLabs/php-github-api/issues/979) -- [952] doc - Specify lcobucci/jwt version, fix deprecation ([amacrobert-meq](https://github.com/amacrobert-meq), [acrobat](https://github.com/acrobat)) [#953](https://github.com/KnpLabs/php-github-api/issues/953) -- Replace deprecated organization team repository add/remove urls ([acrobat](https://github.com/acrobat)) [#985](https://github.com/KnpLabs/php-github-api/issues/985) -- fixed php warning in GithubExceptionThrower ([clxmstaab](https://github.com/clxmstaab), [acrobat](https://github.com/acrobat)) [#992](https://github.com/KnpLabs/php-github-api/issues/992) - -## 3.1.0 - -### Added -- Add workflow dispatch and allow workflow names. ([fodinabor](https://github.com/fodinabor)) [#969](https://github.com/KnpLabs/php-github-api/issues/969) - -### Changed -- Re-enable roave bc check for 3.x ([acrobat](https://github.com/acrobat)) [#958](https://github.com/KnpLabs/php-github-api/issues/958) -- Cleanup 3.0.0 changelog ([acrobat](https://github.com/acrobat)) [#957](https://github.com/KnpLabs/php-github-api/issues/957) -- Update new GitHub doc links in repo. ([fodinabor](https://github.com/fodinabor)) [#974](https://github.com/KnpLabs/php-github-api/issues/974) - -### Fixed -- Add accept header for the checks API ([Agares](https://github.com/Agares)) [#968](https://github.com/KnpLabs/php-github-api/issues/968) -- ExceptionThrower: adjust rate limit detection ([glaubinix](https://github.com/glaubinix)) [#959](https://github.com/KnpLabs/php-github-api/issues/959) - -## 3.0.0 - -### Added -- Switch to PSR18 client implementation and bump httplug minimum version to ^2.0 ([GrahamCampbell](https://github.com/GrahamCampbell)) [#885](https://github.com/KnpLabs/php-github-api/issues/885) -- Switch to PSR-17 and remove deprecated code ([GrahamCampbell](https://github.com/GrahamCampbell)) [#888](https://github.com/KnpLabs/php-github-api/issues/888) -- Allow PHP8 ([acrobat](https://github.com/acrobat)) [#934](https://github.com/KnpLabs/php-github-api/issues/934) -- [3.x] Make PHP 7.2.5 the minimum version ([GrahamCampbell](https://github.com/GrahamCampbell)) [#942](https://github.com/KnpLabs/php-github-api/issues/942) -- [3.x] Re-worked pagination to not mutate the api classes ([GrahamCampbell](https://github.com/GrahamCampbell)) [#907](https://github.com/KnpLabs/php-github-api/issues/907) & ([acrobat](https://github.com/acrobat)) [#956](https://github.com/KnpLabs/php-github-api/issues/956) -- Prepare 3.0 release and remove remaining deprecated code ([acrobat](https://github.com/acrobat)) [#948](https://github.com/KnpLabs/php-github-api/issues/948) - -### Changed -- Remove BC check on 3.x ([GrahamCampbell](https://github.com/GrahamCampbell)) [#900](https://github.com/KnpLabs/php-github-api/issues/900) -- [3.x] Fix the HTTP methods client ([GrahamCampbell](https://github.com/GrahamCampbell)) [#910](https://github.com/KnpLabs/php-github-api/issues/910) -- fix typo ([michielkempen](https://github.com/michielkempen)) [#920](https://github.com/KnpLabs/php-github-api/issues/920) -- [3.x] Added some additional scalar types and return types ([GrahamCampbell](https://github.com/GrahamCampbell)) [#949](https://github.com/KnpLabs/php-github-api/issues/949) diff --git a/vendor/knplabs/github-api/CHANGELOG.md b/vendor/knplabs/github-api/CHANGELOG.md deleted file mode 100644 index 47980eff..00000000 --- a/vendor/knplabs/github-api/CHANGELOG.md +++ /dev/null @@ -1,438 +0,0 @@ -# Changelog - -## 2.20.0 - -### Added -- Deployments: added missing 'delete deployment' endpoint ([clxmstaab](https://github.com/clxmstaab)) [#991](https://github.com/KnpLabs/php-github-api/issues/991) - -### Changed -- phpdoc: fix typo ([clxmstaab](https://github.com/clxmstaab)) [#993](https://github.com/KnpLabs/php-github-api/issues/993) - -### Fixed -- fixed php warning in GithubExceptionThrower ([clxmstaab](https://github.com/clxmstaab), [acrobat](https://github.com/acrobat)) [#992](https://github.com/KnpLabs/php-github-api/issues/992) - -## 2.19.2 - -### Changed -- Improved bc check ([acrobat](https://github.com/acrobat)) [#982](https://github.com/KnpLabs/php-github-api/issues/982) -- Correctly link to github actions docs and fix backlinks ([acrobat](https://github.com/acrobat)) [#983](https://github.com/KnpLabs/php-github-api/issues/983) -- Add missing repo hooks documentation ([acrobat](https://github.com/acrobat)) [#987](https://github.com/KnpLabs/php-github-api/issues/987) -- Fix incorrect public key documentation ([acrobat](https://github.com/acrobat)) [#988](https://github.com/KnpLabs/php-github-api/issues/988) -- Fixed incorrect parameters in apps docs ([acrobat](https://github.com/acrobat)) [#989](https://github.com/KnpLabs/php-github-api/issues/989) - -### Fixed -- Deployments: use proper media-type for in_progress/queued, inactive state ([staabm](https://github.com/staabm)) [#979](https://github.com/KnpLabs/php-github-api/issues/979) -- backported #979 into 2.x ([staabm](https://github.com/staabm)) [#981](https://github.com/KnpLabs/php-github-api/issues/981) -- [952] doc - Specify lcobucci/jwt version, fix deprecation ([amacrobert-meq](https://github.com/amacrobert-meq), [acrobat](https://github.com/acrobat)) [#953](https://github.com/KnpLabs/php-github-api/issues/953) -- Replace deprecated organization team repository add/remove urls ([acrobat](https://github.com/acrobat)) [#985](https://github.com/KnpLabs/php-github-api/issues/985) - -## 2.19.1 - -### Fixed -- ExceptionThrower: adjust rate limit detection ([glaubinix](https://github.com/glaubinix)) [#959](https://github.com/KnpLabs/php-github-api/issues/959) - -## 2.19.0 - -### Added -- Mark some classes as final ([acrobat](https://github.com/acrobat)) [#954](https://github.com/KnpLabs/php-github-api/issues/954) - -## 2.18.0 - -### Added -- Add parameters to PullRequest commits method ([seanmtaylor](https://github.com/seanmtaylor)) [#938](https://github.com/KnpLabs/php-github-api/issues/938) -- Actions (#872) ([lexor](https://github.com/lexor)) [#939](https://github.com/KnpLabs/php-github-api/issues/939) -- automated security endpoints (#868) ([lexor](https://github.com/lexor)) [#944](https://github.com/KnpLabs/php-github-api/issues/944) - -### Changed -- Update apps.md ([clarkeash](https://github.com/clarkeash)) [#936](https://github.com/KnpLabs/php-github-api/issues/936) - -### Fixed -- Throw exception for graphql errors ([acrobat](https://github.com/acrobat)) [#941](https://github.com/KnpLabs/php-github-api/issues/941) - -## 2.17.0 - -### Added - -- Improve checks api implementation ([acrobat](https://github.com/acrobat)) [#932](https://github.com/KnpLabs/php-github-api/issues/932) - -### Changed -- Missing auth method in list of omitted passwords. ([tobyS](https://github.com/tobyS)) [#933](https://github.com/KnpLabs/php-github-api/issues/933) -- Improve github actions setup ([acrobat](https://github.com/acrobat)) [#935](https://github.com/KnpLabs/php-github-api/issues/935) - -## 2.16.0 - -### Added -- Add support for SSO errors coming from the API ([eiriksm](https://github.com/eiriksm)) [#913](https://github.com/KnpLabs/php-github-api/issues/913) -- Add OutsideCollaborators api ([Matth--](https://github.com/Matth--)) [#925](https://github.com/KnpLabs/php-github-api/issues/925) -- Add support for creating a repo dispatch event ([Nyholm](https://github.com/Nyholm)) [#931](https://github.com/KnpLabs/php-github-api/issues/931) - -### Changed -- Fix: Wrong PHPDoc description ([OskarStark](https://github.com/OskarStark)) [#922](https://github.com/KnpLabs/php-github-api/issues/922) -- Adding GitHub authentication to GraphQL documentation ([legionth](https://github.com/legionth)) [#927](https://github.com/KnpLabs/php-github-api/issues/927) - -### Fixed -- Use RFC3986 for building URI query strings ([GrahamCampbell](https://github.com/GrahamCampbell)) [#908](https://github.com/KnpLabs/php-github-api/issues/908) -- Fix call to test a webhook method ([morrislaptop](https://github.com/morrislaptop)) [#915](https://github.com/KnpLabs/php-github-api/issues/915) - -## 2.15.0 - -### Added -- Prepare deprecation of authentication methods ([acrobat](https://github.com/acrobat)) [#870](https://github.com/KnpLabs/php-github-api/issues/870) -- Add Support For GitData Reference Matching Methods ([nickpoulos](https://github.com/nickpoulos)) [#875](https://github.com/KnpLabs/php-github-api/issues/875) -- Make invalid request error more clear ([acrobat](https://github.com/acrobat)) [#880](https://github.com/KnpLabs/php-github-api/issues/880) -- Show user by ID ([genintho](https://github.com/genintho)) [#894](https://github.com/KnpLabs/php-github-api/issues/894) -- add additional check run methods ([bobeagan](https://github.com/bobeagan), [acrobat](https://github.com/acrobat)) [#865](https://github.com/KnpLabs/php-github-api/issues/865) - -### Changed -- Added phpstan ([clxkoders](https://github.com/clxkoders)) [#871](https://github.com/KnpLabs/php-github-api/issues/871) -- Increase phpstan to level 4 ([acrobat](https://github.com/acrobat)) [#874](https://github.com/KnpLabs/php-github-api/issues/874) -- [Documentation] Add Missing Children to Pull Request Index ([jimlind](https://github.com/jimlind)) [#877](https://github.com/KnpLabs/php-github-api/issues/877) -- [Documentation] Include links to Pull Request Children on Pull Request Doc. ([jimlind](https://github.com/jimlind)) [#878](https://github.com/KnpLabs/php-github-api/issues/878) -- Fix typo in /lib/Github/Api/RateLimit.php ([yoonper](https://github.com/yoonper)) [#886](https://github.com/KnpLabs/php-github-api/issues/886) -- Don't use deprecated auth in examples ([GrahamCampbell](https://github.com/GrahamCampbell)) [#892](https://github.com/KnpLabs/php-github-api/issues/892) -- Removed shadow-cat ([GrahamCampbell](https://github.com/GrahamCampbell)) [#893](https://github.com/KnpLabs/php-github-api/issues/893) -- Don't urlencode integer values ([acrobat](https://github.com/acrobat)) [#895](https://github.com/KnpLabs/php-github-api/issues/895) -- phpstan level 6 fixes ([acrobat](https://github.com/acrobat), [GrahamCampbell](https://github.com/GrahamCampbell)) [#897](https://github.com/KnpLabs/php-github-api/issues/897) - -### Fixed -- fix: use new media type for branch protections ([iBotPeaches](https://github.com/iBotPeaches)) [#881](https://github.com/KnpLabs/php-github-api/issues/881) -- Added missing 'machine-man-preview' accept headers ([vovayatsyuk](https://github.com/vovayatsyuk)) [#883](https://github.com/KnpLabs/php-github-api/issues/883) -- Fix broken roave/bc-check test ([acrobat](https://github.com/acrobat)) [#890](https://github.com/KnpLabs/php-github-api/issues/890) -- Fixed incorrect MissingArgumentException parent constructor values ([acrobat](https://github.com/acrobat)) [#896](https://github.com/KnpLabs/php-github-api/issues/896) -- Added AUTH_ACCESS_TOKEN to allowed methods ([GrahamCampbell](https://github.com/GrahamCampbell)) [#899](https://github.com/KnpLabs/php-github-api/issues/899) - -## 2.14.0 - -### Added -- Replace deprecated Organization\Teams api calls ([lolos](https://github.com/lolos)) [#860](https://github.com/KnpLabs/php-github-api/issues/860) -- Add sort and direction for fetching organizations repos ([pgrimaud](https://github.com/pgrimaud)) [#863](https://github.com/KnpLabs/php-github-api/issues/863) -- Added parameters to Repo/milestones() method ([dereuromark](https://github.com/dereuromark)) [#856](https://github.com/KnpLabs/php-github-api/issues/856) - -### Fixed - -- Remove incorrect MissingArgumentException in Labels api ([bobeagan](https://github.com/bobeagan)) [#861](https://github.com/KnpLabs/php-github-api/issues/861) - -### Changed -- Fix typos in test/Github/Tests/Api/RepoTest.php ([pgrimaud](https://github.com/pgrimaud)) [#862](https://github.com/KnpLabs/php-github-api/issues/862) -- further detail on ResultPager parameters ([sepiariver](https://github.com/sepiariver)) [#843](https://github.com/KnpLabs/php-github-api/issues/843) -- fix phpdoc in labels api ([staabm](https://github.com/staabm)) [#854](https://github.com/KnpLabs/php-github-api/issues/854) -- fix api link in Issue\Labels::add() phpdoc ([staabm](https://github.com/staabm)) [#853](https://github.com/KnpLabs/php-github-api/issues/853) - -## 2.13.0 - -### Added - -- Support the new authorizations API -- Repo community profile API endpoint -- Support for draft PRs -- Missing Apps endpoints -- Test against php 7.4 - -### Changed - -- Allow create & remove to set and remove requests for teams - -## 2.12.1 - -### Fixed - -- Fixed bug in handling of validation errors -- Updated docs to not use deprected string parameter in issue assignee call - -## 2.12.0 - -### Added - -- Support for HTTPlug 2.0 and PSR-18 -- Add support for GitHub Checks -- Add support for GitHub Pages -- Add support to update a Pull Request Review -- Add support to get specific revision of a gist -- Added a 4th argument `$parameters` to `PullRequest::files()` -- Added `Accept` headers to Github Apps - -### Removed - -- Active support for HHVM -- Support for PHP <7.1 - -### Changed - -- Allow tags to be created without the `Tagger` object -- When updating DeployKeys we will first remove existing then add a new DeployKey - -### Fixed - -- In `Trees` we should check if `array_key_exists('sha', $tree)` instead of `isset` to avoid issues with `null`. (#822) - -### Deprecated - -- Passing an integer (`$page`) as 4th arugment in `Comments::all()` is deprecated. It should be an array. - -## 2.11.0 - -### Added - -- Support for Miscellaneous Licenses (#744) -- Structured Limit objects for rate limiting API (#733) -- Support for getting star creation timestamps in activity/starring endpoint (#729) - -### Fixed - -- Added missing has_projects parameter to repo create (#752) -- Proper type hinting for magic methods (#758) -- Allow symlink to files to be downloaded (#751) - -### Changed - -- Fix of PHP version in readme (#747) -- Fix documentation to get release for a tag (#755) -- Declare all used properties in RateLimitResource class (#762) -- Set correct property and return types (#764) -- Fixed install docs broken after 2.0 release of httplug lib (#767) - -## 2.10.1 - -### Fixed - -- Convert the assignee parameter to array to avoid getting a 422 error on github (#738) -- Fix GraphQL test warnings when they do not assert anything (#735) - -### Changed - -- Check for BC breaks during the travis build (#734) - -## 2.10.0 - -### Added - -- Support for "before" parameter on Notification API (#724) - -### Changed - -- Allow unspecified `event` when creating review (#723) - -### Fixed - -- Adjust: installationn access token endpoint (#731) -- Fixed "get single label" example and add correct example for getting issue's labels (#732) -- Add comment about `Key` constructor argument (#722) - -## 2.9.0 - -### Added - -- API endpoint `Github\Api\Repo::transfer()` -- API endpoint `Github\Api\Notification::markThreadRead()` -- API endpoint `Github\Api\Search::topics()` - -### Fixed - -- Make sure to always reset the "per page" in `Github\ResultPager::fetchAll()`. - -## 2.8.0 - -### Added - -- Allow our HTTP plugins to show up in the Symfony web profiler page. (#687) -- Repository documentation to current user (#671) -- Add collaborator permission call (#678) -- Add missing parameters for User/CurrentUser Repositories (#684) -- Pimp the readme with badge poser (#686) - -### Fixed - -- Typo in assignee documentation -- Missing use statement in security example -- Fixed phpdoc typo (#695) -- Replace use of deprecated api to the correct one in the security docs (#697) - -### Changed - -- Updated requirements in readme (#689) - -## 2.7.0 - -### Added - -- Phpunit 6 compatibility -- `Github\Api\AbstractApi::setPage()` to allow you to set the page on all endpoints. -- Support for query parameters and request headers on `Github\Api\User::following` and `Github\Api\User::followers` -- API endpoint `Github\Api\CurrentUser\Emails::allPublic()` -- API endpoint `Github\Api\Search::commits()` -- API endpoint `Github\Api\Miscellaneous\CodeOfConduct` -- API endpoint `Github\Api\Repo::topics()` -- API endpoint `Github\Api\Repo::replaceTopics()` - -### Fixed - -- Fixed bug in `PathPrepend` plugin where "api/vX" could be duplicated. - -### Changed - -- Improved documentation and doc blocks - -### Removed - -- Dropped support for php 5.5 - -### Deprecated - -The following endpoints were deprecated by Github and are also deprecated in the client: - -- `Github\Api\Repo::find()` -- `Github\Api\User::find()` -- `Github\Api\Issue::find()` - -## 2.6.0 - -### Added - -- Support for graphql api [variables](https://developer.github.com/v4/guides/forming-calls/#working-with-variables) (#612) -- Added missing branch protection methods (#616) -- Helper function `fromFile ` to get GraphQL queries from a file (#628) -- Extra parameter `params` to collaborators api calls (#623) -- Documentation for GitData API (#613) - -### Fixed -- Remove `body` as a required parameter when creating an issue (#624) -- Minor fixes in example code (#617) - -## 2.5.0 - -### Added - -- Stable support for graphql api (V4) (#593) -- Stable support for apps (previously integrations) (#592) -- `Repo::events()` - -### Fixed - -- Incorrect link in repository search docs (#594) -- Added the required parameter `$message` on `Review::dismiss`. - -## 2.4.0 - -### Added - -- `Integrations::configure` to allow accessing early access program endpoints. -- Add support for pagination and parameters in the pull request comments -- Add the ability to fetch user installations (`CurrentUser::installations`) -- Allow getting repo info by id (`Repo::showById`) -- Allow fetching repositories for a specific installation and user (`CurrentUser::repositoriesByInstallation`) - -### Changed - -- `PullRequest\Review` and `PullRequest\ReviewRequest` is now part of the official API. No need to call `configure`. - -## 2.3.0 - -### Fixed - -- Issue where we serve the wrong cached response. We vary on authorization header now. - -### Added - -- `PullRequest::status` -- Throw InvalidArgumentException on `PullRequest::merge` when wrong merge method is used. -- Added `Protection::configure` - -### Changed - -- First argument to `Integrations::listRepositories()` is now optional. -- Moved tests from "functional" to "integration" - -## 2.2.0 - -### Added - -- API support for Pull Request Review Requests. -- API support for Traffic. -- API support for issue Assignees. -- API support for Miscellaneous Gitignore and Emojis. -- Added endpoints for issue lock, unlock and issue label show. -- Added more parameters to `User::starred`. -- Fluid interface by allowing `configure()` to return `$this`. -- `configure()` support for issues API. - -### Fixed - -- Cache issue where some requests are not cached -- Issue with `User::all()` creates a query with double question marks. - -## 2.1.0 - -### Added - -- Add support for retrieving a single notification info using his ID -- Add a function to get user organizations -- Added GraphQL support -- Add page variable to organization repo list (Organization::repositories()) -- Add support for pull request review. -- Add support for adding branch protection. - -### Fixed - -- Bug with double slashes when using enterprise URL. -- Bug when headers not being passed to request (#529) - -## 2.0.0 - -### Added - -- Support for JWT authentication -- API for Organization\Members -- API for Integrations -- API for Repo\Cards -- API for Repo\Columns -- API for Repo\Projects -- API for User\MyRepositories -- Methods in Repo API for frequency and participation - -### Changed - -- `ApiLimitExceedException::__construct` has a new second parameter for the remaining API calls. -- First parameter of `Github\Client` has changed type from `\Http\Client\HttpClient` to -`Github\HttpClient\Builder`. A factory class was also added. To upgrade you need to change: - -```php -// Old way does not work: -$github = new Github\Client($httpClient); - -// New way will work: -$github = new Github\Client(new Github\HttpClient\Builder($httpClient)); -$github = Github\Client::createWithHttpClient($httpClient); -``` -- Renamed the currentuser `DeployKeys` api class to `PublicKeys` to reflect to github api name. - -## 2.0.0-rc4 - -### Added - -- HTTPlug to decouple from Guzzle -- `Github\Client::getLastResponse` was added -- Support for PSR-6 cache -- `Github\Client::addPlugin` and `Github\Client::removePlugin` -- `Github\Client::getApiVersion` -- `Github\Client::removeCache` - -### Changed - -- Uses of `Github\HttpClient\HttpClientInterface` is replaced by `Http\Client\HttpClient` ie the constructor of `Github\Client`. -- We use PSR-7's representation of HTTP message instead of `Guzzle\Http\Message\Response` and `Guzzle\Http\Message\Request`. -- `Github\Client::addHeaders` was added instead of `Github\Client::setHeaders` -- Signature of `Github\Client::useCache` has changed. First argument must be a `CacheItemPoolInterface` -- We use PSR-4 instead of PSR-0 - -### Removed - -- Support for PHP 5.3 and 5.4 -- `Github/HttpClient/HttpClientInterface` was removed -- `Github/HttpClient/HttpClient` was removed -- All classes in `Github/HttpClient/HttpClient/Listener/*` were removed -- `Github/HttpClient/CachedHttpClient` was removed -- All classes in `Github/HttpClient/Cache/*` were removed - -## 1.7.1 - -No change log before this version diff --git a/vendor/knplabs/github-api/LICENSE b/vendor/knplabs/github-api/LICENSE deleted file mode 100644 index 0fd8dd8e..00000000 --- a/vendor/knplabs/github-api/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2012 KnpLabs -Copyright (c) 2010 Thibault Duplessis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/knplabs/github-api/README.md b/vendor/knplabs/github-api/README.md deleted file mode 100644 index de79112b..00000000 --- a/vendor/knplabs/github-api/README.md +++ /dev/null @@ -1,134 +0,0 @@ -# PHP GitHub API - -![Build Status](https://github.com/KnpLabs/php-github-api/actions/workflows/ci.yml/badge.svg) -[![StyleCI](https://styleci.io/repos/3948501/shield?style=flat)](https://styleci.io/repos/3948501) -[![Latest Stable Version](https://poser.pugx.org/knplabs/github-api/v/stable)](https://packagist.org/packages/knplabs/github-api) -[![Total Downloads](https://poser.pugx.org/knplabs/github-api/downloads)](https://packagist.org/packages/knplabs/github-api) -[![Monthly Downloads](https://poser.pugx.org/knplabs/github-api/d/monthly)](https://packagist.org/packages/knplabs/github-api) -[![Daily Downloads](https://poser.pugx.org/knplabs/github-api/d/daily)](https://packagist.org/packages/knplabs/github-api) - -A simple Object Oriented wrapper for GitHub API, written with PHP. - -Uses [GitHub API v3](http://developer.github.com/v3/) & supports [GitHub API v4](http://developer.github.com/v4). The object API (v3) is very similar to the RESTful API. - -## Features - -* Light and fast thanks to lazy loading of API classes -* Extensively tested and documented - -## Requirements - -* PHP >= 7.2 -* A [PSR-17 implementation](https://packagist.org/providers/psr/http-factory-implementation) -* A [PSR-18 implementation](https://packagist.org/providers/psr/http-client-implementation) - -## Quick install - -Via [Composer](https://getcomposer.org). - -This command will get you up and running quickly with a Guzzle HTTP client. - -```bash -composer require knplabs/github-api:^3.0 guzzlehttp/guzzle:^7.0.1 http-interop/http-factory-guzzle:^1.0 -``` - -## Advanced install - -We are decoupled from any HTTP messaging client with help by [HTTPlug](https://httplug.io). - -### Using a different http client - -```bash -composer require knplabs/github-api:^3.0 symfony/http-client nyholm/psr7 -``` - -To set up the Github client with this HTTP client - -```php -use Github\Client; -use Symfony\Component\HttpClient\HttplugClient; - -$client = Client::createWithHttpClient(new HttplugClient()); -``` - -Read more about [using different clients in our docs](doc/customize.md). - -## Framework integrations - -### Laravel - -To integrate this library in laravel [Graham Campbell](https://github.com/GrahamCampbell) created [graham-campbell/github](https://github.com/GrahamCampbell/Laravel-GitHub). See the [installation instructions](https://github.com/GrahamCampbell/Laravel-GitHub#installation) to get started in laravel. - -## Basic usage of `php-github-api` client - -```php -api('user')->repositories('ornicar'); -``` - -From `$client` object, you have access to all available GitHub api endpoints. - -## Cache usage - -This example uses the PSR6 cache pool [redis-adapter](https://github.com/php-cache/redis-adapter). See http://www.php-cache.com/ for alternatives. - -```php -connect('127.0.0.1', 6379); -// Create a PSR6 cache pool -$pool = new RedisCachePool($client); - -$client = new \Github\Client(); -$client->addCache($pool); - -// Do some request - -// Stop using cache -$client->removeCache(); -``` - -Using cache, the client will get cached responses if resources haven't changed since last time, -**without** reaching the `X-Rate-Limit` [imposed by github](http://developer.github.com/v3/#rate-limiting). - - -## Documentation - -See the [`doc` directory](doc/) for more detailed documentation. - -## License - -`php-github-api` is licensed under the MIT License - see the LICENSE file for details - -## Maintainers - -Please read [this post](https://knplabs.com/en/blog/news-for-our-foss-projects-maintenance) first. - -This library is maintained by the following people (alphabetically sorted) : -- [@acrobat](https://github.com/acrobat) -- [@Nyholm](https://github.com/Nyholm) - -## Contributors - -- Thanks to [Thibault Duplessis aka. ornicar](https://github.com/ornicar) for his first version of this library. -- Thanks to [Joseph Bielawski aka. stloyd](https://github.com/stloyd) for his contributions and support. -- Thanks to [noloh](https://github.com/noloh) for his contribution on the Object API. -- Thanks to [bshaffer](https://github.com/bshaffer) for his contribution on the Repo API. -- Thanks to [Rolf van de Krol](https://github.com/rolfvandekrol) for his countless contributions. -- Thanks to [Nicolas Pastorino](https://github.com/jeanvoye) for his contribution on the Pull Request API. -- Thanks to [Edoardo Rivello](https://github.com/erivello) for his contribution on the Gists API. -- Thanks to [Miguel Piedrafita](https://github.com/m1guelpf) for his contribution to the v4 & Apps API. -- Thanks to [Emre DEGER](https://github.com/lexor) for his contribution to the Actions API. - -Thanks to GitHub for the high quality API and documentation. diff --git a/vendor/knplabs/github-api/UPGRADE-3.0.md b/vendor/knplabs/github-api/UPGRADE-3.0.md deleted file mode 100644 index 738343d6..00000000 --- a/vendor/knplabs/github-api/UPGRADE-3.0.md +++ /dev/null @@ -1,21 +0,0 @@ -## UPGRADE from 2.x to 3.0 - -### General - -* The `php-http/httplug` dependency requires is bumped to minimum ^2.1. -* A client implementing `psr/http-client-implementation` is required. - To upgrade your application (default install) switch from guzzle 6 to guzzle 7 (or replace `php-http/guzzle6-adapter` with any `psr/http-client-implementation`), see the install instructions in the [README file](README.md) -* All previous deprecated code in version 2 is removed. -* The following classes are now final - * `Github\HttpClient\Message\ResponseMediator` - * `Github\HttpClient\Plugin\Authentication` - * `Github\HttpClient\Plugin\GithubExceptionThrower` - * `Github\HttpClient\Plugin\History` - * `Github\HttpClient\Plugin\PathPrepend` - -### Authentication methods - -* `Github\Client::AUTH_URL_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead. -* `Github\Client::AUTH_URL_CLIENT_ID` use `Github\Client::AUTH_CLIENT_ID` instead. -* `Github\Client::AUTH_HTTP_TOKEN` use `Github\Client::AUTH_ACCESS_TOKEN` instead. -* `Github\Client::AUTH_HTTP_PASSWORD` use `Github\Client::AUTH_ACCESS_TOKEN` instead. diff --git a/vendor/knplabs/github-api/UPGRADE-4.0.md b/vendor/knplabs/github-api/UPGRADE-4.0.md deleted file mode 100644 index 6ede78de..00000000 --- a/vendor/knplabs/github-api/UPGRADE-4.0.md +++ /dev/null @@ -1,11 +0,0 @@ -## UPGRADE from 3.x to 4.0 - -### ResultPager - -* `\Github\ResultPagerInterface::postFetch` is deprecated, and the method will be removed from the ResultPager interface/class. - -### Authentication methods - -* `Github\Client::AUTH_CLIENT_ID` is deprecated, use `Github\AuthMethod::CLIENT_ID` instead. -* `Github\Client::AUTH_ACCESS_TOKEN` is deprecated, use `Github\AuthMethod::ACCESS_TOKEN` instead. -* `Github\Client::AUTH_JWT` is deprecated, use `Github\AuthMethod::JWT` instead. diff --git a/vendor/knplabs/github-api/composer.json b/vendor/knplabs/github-api/composer.json deleted file mode 100644 index b54537bd..00000000 --- a/vendor/knplabs/github-api/composer.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "knplabs/github-api", - "type": "library", - "description": "GitHub API v3 client", - "homepage": "https://github.com/KnpLabs/php-github-api", - "keywords": ["github", "gh", "api", "gist"], - "license": "MIT", - "authors": [ - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" - }, - { - "name": "Thibault Duplessis", - "email": "thibault.duplessis@gmail.com", - "homepage": "http://ornicar.github.com" - } - ], - "require": { - "php": "^7.2.5 || ^8.0", - "ext-json": "*", - "php-http/cache-plugin": "^1.7.1", - "php-http/client-common": "^2.3", - "php-http/discovery": "^1.12", - "php-http/httplug": "^2.2", - "php-http/multipart-stream-builder": "^1.1.2", - "psr/cache": "^1.0|^2.0|^3.0", - "psr/http-client-implementation": "^1.0", - "psr/http-factory-implementation": "^1.0", - "psr/http-message": "^1.0", - "symfony/polyfill-php80": "^1.17", - "symfony/deprecation-contracts": "^2.2|^3.0" - }, - "require-dev": { - "symfony/cache": "^5.1.8", - "guzzlehttp/psr7": "^1.7", - "http-interop/http-factory-guzzle": "^1.0", - "guzzlehttp/guzzle": "^7.2", - "php-http/mock-client": "^1.4.1", - "phpstan/phpstan": "^0.12.57", - "phpstan/extension-installer": "^1.0.5", - "phpstan/phpstan-deprecation-rules": "^0.12.5", - "phpunit/phpunit": "^8.5 || ^9.4", - "symfony/phpunit-bridge": "^5.2" - }, - "autoload": { - "psr-4": { "Github\\": "lib/Github/" } - }, - "autoload-dev": { - "psr-4": { "Github\\Tests\\": "test/Github/Tests/"} - }, - "extra": { - "branch-alias": { - "dev-2.x": "2.20.x-dev", - "dev-master": "3.4.x-dev" - } - }, - "config": { - "allow-plugins": { - "phpstan/extension-installer": true - } - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php b/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php deleted file mode 100644 index 71f71cce..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/AbstractApi.php +++ /dev/null @@ -1,224 +0,0 @@ - - * @author Graham Campbell - */ -abstract class AbstractApi -{ - /** - * The client instance. - * - * @var Client - */ - private $client; - - /** - * The per page parameter. It is used by the ResultPager. - * - * @var int|null - */ - private $perPage; - - /** - * Create a new API instance. - * - * @param Client $client - * - * @return void - */ - public function __construct(Client $client) - { - $this->client = $client; - } - - /** - * Get the client instance. - * - * @return Client - */ - protected function getClient(): Client - { - return $this->client; - } - - /** - * Get the API version. - * - * @return string - */ - protected function getApiVersion(): string - { - return $this->client->getApiVersion(); - } - - /** - * @return $this - */ - public function configure() - { - return $this; - } - - /** - * Send a GET request with query parameters. - * - * @param string $path Request path. - * @param array $parameters GET parameters. - * @param array $requestHeaders Request Headers. - * - * @return array|string - */ - protected function get(string $path, array $parameters = [], array $requestHeaders = []) - { - if (null !== $this->perPage && !isset($parameters['per_page'])) { - $parameters['per_page'] = $this->perPage; - } - - if (array_key_exists('ref', $parameters) && null === $parameters['ref']) { - unset($parameters['ref']); - } - - if (count($parameters) > 0) { - $path .= '?'.http_build_query($parameters, '', '&', PHP_QUERY_RFC3986); - } - - $response = $this->client->getHttpClient()->get($path, $requestHeaders); - - return ResponseMediator::getContent($response); - } - - /** - * Send a HEAD request with query parameters. - * - * @param string $path Request path. - * @param array $parameters HEAD parameters. - * @param array $requestHeaders Request headers. - * - * @return ResponseInterface - */ - protected function head(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface - { - if (array_key_exists('ref', $parameters) && null === $parameters['ref']) { - unset($parameters['ref']); - } - - return $this->client->getHttpClient()->head($path.'?'.http_build_query($parameters, '', '&', PHP_QUERY_RFC3986), $requestHeaders); - } - - /** - * Send a POST request with JSON-encoded parameters. - * - * @param string $path Request path. - * @param array $parameters POST parameters to be JSON encoded. - * @param array $requestHeaders Request headers. - * - * @return array|string - */ - protected function post(string $path, array $parameters = [], array $requestHeaders = []) - { - return $this->postRaw( - $path, - $this->createJsonBody($parameters), - $requestHeaders - ); - } - - /** - * Send a POST request with raw data. - * - * @param string $path Request path. - * @param string $body Request body. - * @param array $requestHeaders Request headers. - * - * @return array|string - */ - protected function postRaw(string $path, $body, array $requestHeaders = []) - { - $response = $this->client->getHttpClient()->post( - $path, - $requestHeaders, - $body - ); - - return ResponseMediator::getContent($response); - } - - /** - * Send a PATCH request with JSON-encoded parameters. - * - * @param string $path Request path. - * @param array $parameters POST parameters to be JSON encoded. - * @param array $requestHeaders Request headers. - * - * @return array|string - */ - protected function patch(string $path, array $parameters = [], array $requestHeaders = []) - { - $response = $this->client->getHttpClient()->patch( - $path, - $requestHeaders, - $this->createJsonBody($parameters) - ); - - return ResponseMediator::getContent($response); - } - - /** - * Send a PUT request with JSON-encoded parameters. - * - * @param string $path Request path. - * @param array $parameters POST parameters to be JSON encoded. - * @param array $requestHeaders Request headers. - * - * @return array|string - */ - protected function put(string $path, array $parameters = [], array $requestHeaders = []) - { - $response = $this->client->getHttpClient()->put( - $path, - $requestHeaders, - $this->createJsonBody($parameters) - ); - - return ResponseMediator::getContent($response); - } - - /** - * Send a DELETE request with JSON-encoded parameters. - * - * @param string $path Request path. - * @param array $parameters POST parameters to be JSON encoded. - * @param array $requestHeaders Request headers. - * - * @return array|string - */ - protected function delete(string $path, array $parameters = [], array $requestHeaders = []) - { - $response = $this->client->getHttpClient()->delete( - $path, - $requestHeaders, - $this->createJsonBody($parameters) - ); - - return ResponseMediator::getContent($response); - } - - /** - * Create a JSON encoded version of an array of parameters. - * - * @param array $parameters Request parameters - * - * @return string|null - */ - protected function createJsonBody(array $parameters): ?string - { - return (count($parameters) === 0) ? null : json_encode($parameters, empty($parameters) ? JSON_FORCE_OBJECT : 0); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php b/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php deleted file mode 100644 index 6a990a56..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/AcceptHeaderTrait.php +++ /dev/null @@ -1,66 +0,0 @@ - - */ -trait AcceptHeaderTrait -{ - /** @var string */ - protected $acceptHeaderValue; - - protected function get(string $path, array $parameters = [], array $requestHeaders = []) - { - return parent::get($path, $parameters, $this->mergeHeaders($requestHeaders)); - } - - protected function head(string $path, array $parameters = [], array $requestHeaders = []): ResponseInterface - { - return parent::head($path, $parameters, $this->mergeHeaders($requestHeaders)); - } - - protected function post(string $path, array $parameters = [], array $requestHeaders = []) - { - return parent::post($path, $parameters, $this->mergeHeaders($requestHeaders)); - } - - protected function postRaw(string $path, $body, array $requestHeaders = []) - { - return parent::postRaw($path, $body, $this->mergeHeaders($requestHeaders)); - } - - protected function patch(string $path, array $parameters = [], array $requestHeaders = []) - { - return parent::patch($path, $parameters, $this->mergeHeaders($requestHeaders)); - } - - protected function put(string $path, array $parameters = [], array $requestHeaders = []) - { - return parent::put($path, $parameters, $this->mergeHeaders($requestHeaders)); - } - - protected function delete(string $path, array $parameters = [], array $requestHeaders = []) - { - return parent::delete($path, $parameters, $this->mergeHeaders($requestHeaders)); - } - - /** - * Append a new accept header on all requests. - * - * @return array - */ - private function mergeHeaders(array $headers = []): array - { - $default = []; - if ($this->acceptHeaderValue) { - $default = ['Accept' => $this->acceptHeaderValue]; - } - - return array_merge($default, $headers); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Apps.php b/vendor/knplabs/github-api/lib/Github/Api/Apps.php deleted file mode 100644 index 9e9a4b6a..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Apps.php +++ /dev/null @@ -1,201 +0,0 @@ - - */ -class Apps extends AbstractApi -{ - use AcceptHeaderTrait; - - private function configurePreviewHeader() - { - $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; - } - - /** - * Create an access token for an installation. - * - * @param int $installationId An integration installation id - * @param int $userId An optional user id on behalf of whom the - * token will be requested - * - * @link https://developer.github.com/v3/apps/#create-a-new-installation-token - * - * @return array token and token metadata - */ - public function createInstallationToken($installationId, $userId = null) - { - $parameters = []; - if ($userId) { - $parameters['user_id'] = $userId; - } - - $this->configurePreviewHeader(); - - return $this->post('/app/installations/'.$installationId.'/access_tokens', $parameters); - } - - /** - * Find all installations for the authenticated application. - * - * @link https://developer.github.com/v3/apps/#find-installations - * - * @return array - */ - public function findInstallations() - { - $this->configurePreviewHeader(); - - return $this->get('/app/installations'); - } - - /** - * Get an installation of the application. - * - * @link https://developer.github.com/v3/apps/#get-an-installation - * - * @param int $installationId An integration installation id - * - * @return array - */ - public function getInstallation($installationId) - { - $this->configurePreviewHeader(); - - return $this->get('/app/installations/'.$installationId); - } - - /** - * Get an installation of the application for an organization. - * - * @link https://developer.github.com/v3/apps/#get-an-organization-installation - * - * @param string $org An organization - * - * @return array - */ - public function getInstallationForOrganization($org) - { - $this->configurePreviewHeader(); - - return $this->get('/org/'.rawurldecode($org).'/installation'); - } - - /** - * Get an installation of the application for a repository. - * - * @link https://developer.github.com/v3/apps/#get-a-repository-installation - * - * @param string $owner the owner of a repository - * @param string $repo the name of the repository - * - * @return array - */ - public function getInstallationForRepo($owner, $repo) - { - $this->configurePreviewHeader(); - - return $this->get('/repos/'.rawurldecode($owner).'/'.rawurldecode($repo).'/installation'); - } - - /** - * Get an installation of the application for a user. - * - * @link https://developer.github.com/v3/apps/#get-a-user-installation - * - * @param string $username - * - * @return array - */ - public function getInstallationForUser($username) - { - $this->configurePreviewHeader(); - - return $this->get('/users/'.rawurldecode($username).'/installation'); - } - - /** - * Delete an installation of the application. - * - * @link https://developer.github.com/v3/apps/#delete-an-installation - * - * @param int $installationId An integration installation id - */ - public function removeInstallation($installationId) - { - $this->configurePreviewHeader(); - - $this->delete('/app/installations/'.$installationId); - } - - /** - * List repositories that are accessible to the authenticated installation. - * - * @link https://developer.github.com/v3/apps/installations/#list-repositories - * - * @param int $userId - * - * @return array - */ - public function listRepositories($userId = null) - { - $parameters = []; - if ($userId) { - $parameters['user_id'] = $userId; - } - - $this->configurePreviewHeader(); - - return $this->get('/installation/repositories', $parameters); - } - - /** - * Add a single repository to an installation. - * - * @link https://developer.github.com/v3/apps/installations/#add-repository-to-installation - * - * @param int $installationId - * @param int $repositoryId - * - * @return array - */ - public function addRepository($installationId, $repositoryId) - { - $this->configurePreviewHeader(); - - return $this->put('/installations/'.$installationId.'/repositories/'.$repositoryId); - } - - /** - * Remove a single repository from an installation. - * - * @link https://developer.github.com/v3/apps/installations/#remove-repository-from-installation - * - * @param int $installationId - * @param int $repositoryId - * - * @return array - */ - public function removeRepository($installationId, $repositoryId) - { - $this->configurePreviewHeader(); - - return $this->delete('/installations/'.$installationId.'/repositories/'.$repositoryId); - } - - /** - * Get the currently authenticated app. - * - * @link https://docs.github.com/en/rest/reference/apps#get-the-authenticated-app - * - * @return array - */ - public function getAuthenticatedApp() - { - return $this->get('/app'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Authorizations.php b/vendor/knplabs/github-api/lib/Github/Api/Authorizations.php deleted file mode 100644 index 6032c7fa..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Authorizations.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class Authorizations extends AbstractApi -{ - /** - * Check an application token. - * - * @param string $clientId - * @param string|null $token - * - * @return array - */ - public function checkToken($clientId, $token = null) - { - return $this->post('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []); - } - - /** - * Reset an application token. - * - * @param string $clientId - * @param string|null $token - * - * @return array - */ - public function resetToken($clientId, $token = null) - { - return $this->patch('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []); - } - - /** - * Revoke an application token. - * - * @param string $clientId - * @param string|null $token - * - * @return void - */ - public function deleteToken($clientId, $token = null) - { - $this->delete('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []); - } - - /** - * Revoke an application authorization. - * - * @param string $clientId - * @param string|null $token - * - * @return void - */ - public function deleteGrant($clientId, $token = null) - { - $this->delete('/applications/'.rawurlencode($clientId).'/grant', $token ? ['access_token' => $token] : []); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php deleted file mode 100644 index b5cbc89a..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser.php +++ /dev/null @@ -1,193 +0,0 @@ - - * @author Felipe Valtl de Mello - */ -class CurrentUser extends AbstractApi -{ - use AcceptHeaderTrait; - - public function show() - { - return $this->get('/user'); - } - - public function update(array $params) - { - return $this->patch('/user', $params); - } - - /** - * @return Emails - */ - public function emails() - { - return new Emails($this->getClient()); - } - - /** - * @return Followers - */ - public function follow() - { - return new Followers($this->getClient()); - } - - public function followers($page = 1) - { - return $this->get('/user/followers', [ - 'page' => $page, - ]); - } - - /** - * @link https://docs.github.com/en/rest/reference/issues#list-user-account-issues-assigned-to-the-authenticated-user - * - * @param array $params - * @param bool $includeOrgIssues - * - * @return array - */ - public function issues(array $params = [], $includeOrgIssues = true) - { - return $this->get($includeOrgIssues ? '/issues' : '/user/issues', array_merge(['page' => 1], $params)); - } - - /** - * @return PublicKeys - */ - public function keys() - { - return new PublicKeys($this->getClient()); - } - - /** - * @return Notifications - */ - public function notifications() - { - return new Notifications($this->getClient()); - } - - /** - * @return Memberships - */ - public function memberships() - { - return new Memberships($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/orgs#list-organizations-for-the-authenticated-user - * - * @return array - */ - public function organizations() - { - return $this->get('/user/orgs'); - } - - /** - * @link https://developer.github.com/v3/orgs/teams/#list-user-teams - * - * @return array - */ - public function teams() - { - return $this->get('/user/teams'); - } - - /** - * @link https://docs.github.com/en/rest/reference/repos#list-repositories-for-the-authenticated-user - * - * @param string $type role in the repository - * @param string $sort sort by - * @param string $direction direction of sort, asc or desc - * @param string $visibility visibility of repository - * @param string $affiliation relationship to repository - * - * @return array - */ - public function repositories($type = 'owner', $sort = 'full_name', $direction = 'asc', $visibility = null, $affiliation = null) - { - $params = [ - 'type' => $type, - 'sort' => $sort, - 'direction' => $direction, - ]; - - if (null !== $visibility) { - unset($params['type']); - $params['visibility'] = $visibility; - } - - if (null !== $affiliation) { - unset($params['type']); - $params['affiliation'] = $affiliation; - } - - return $this->get('/user/repos', $params); - } - - /** - * @return Watchers - */ - public function watchers() - { - return new Watchers($this->getClient()); - } - - /** - * @return Starring - */ - public function starring() - { - return new Starring($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/activity#list-repositories-watched-by-the-authenticated-user - */ - public function subscriptions() - { - return $this->get('/user/subscriptions'); - } - - /** - * @link https://docs.github.com/en/rest/reference/apps#list-app-installations-accessible-to-the-user-access-token - * - * @param array $params - */ - public function installations(array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; - - return $this->get('/user/installations', array_merge(['page' => 1], $params)); - } - - /** - * @link https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-access-token - * - * @param string $installationId the ID of the Installation - * @param array $params - */ - public function repositoriesByInstallation($installationId, array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.machine-man-preview+json'; - - return $this->get(sprintf('/user/installations/%s/repositories', $installationId), array_merge(['page' => 1], $params)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php deleted file mode 100644 index 23f2ab24..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Emails.php +++ /dev/null @@ -1,94 +0,0 @@ - - */ -class Emails extends AbstractApi -{ - /** - * List emails for the authenticated user. - * - * @link http://developer.github.com/v3/users/emails/ - * - * @return array - */ - public function all() - { - return $this->get('/user/emails'); - } - - /** - * List public email addresses for a user. - * - * @link https://developer.github.com/v3/users/emails/#list-public-email-addresses-for-a-user - * - * @return array - */ - public function allPublic() - { - return $this->get('/user/public_emails'); - } - - /** - * Adds one or more email for the authenticated user. - * - * @link http://developer.github.com/v3/users/emails/ - * - * @param string|array $emails - * - * @throws \Github\Exception\InvalidArgumentException - * - * @return array - */ - public function add($emails) - { - if (is_string($emails)) { - $emails = [$emails]; - } elseif (0 === count($emails)) { - throw new InvalidArgumentException('The user emails parameter should be a single email or an array of emails'); - } - - return $this->post('/user/emails', $emails); - } - - /** - * Removes one or more email for the authenticated user. - * - * @link http://developer.github.com/v3/users/emails/ - * - * @param string|array $emails - * - * @throws \Github\Exception\InvalidArgumentException - * - * @return array - */ - public function remove($emails) - { - if (is_string($emails)) { - $emails = [$emails]; - } elseif (0 === count($emails)) { - throw new InvalidArgumentException('The user emails parameter should be a single email or an array of emails'); - } - - return $this->delete('/user/emails', $emails); - } - - /** - * Toggle primary email visibility. - * - * @link https://developer.github.com/v3/users/emails/#toggle-primary-email-visibility - * - * @return array - */ - public function toggleVisibility() - { - return $this->patch('/user/email/visibility'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php deleted file mode 100644 index 52a712ca..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Followers.php +++ /dev/null @@ -1,71 +0,0 @@ - - */ -class Followers extends AbstractApi -{ - /** - * List followed users by the authenticated user. - * - * @link http://developer.github.com/v3/repos/followers/ - * - * @param int $page - * - * @return array - */ - public function all($page = 1) - { - return $this->get('/user/following', [ - 'page' => $page, - ]); - } - - /** - * Check that the authenticated user follows a user. - * - * @link http://developer.github.com/v3/repos/followers/ - * - * @param string $username the username to follow - * - * @return array - */ - public function check($username) - { - return $this->get('/user/following/'.rawurlencode($username)); - } - - /** - * Make the authenticated user follow a user. - * - * @link http://developer.github.com/v3/repos/followers/ - * - * @param string $username the username to follow - * - * @return array - */ - public function follow($username) - { - return $this->put('/user/following/'.rawurlencode($username)); - } - - /** - * Make the authenticated user un-follow a user. - * - * @link http://developer.github.com/v3/repos/followers/ - * - * @param string $username the username to un-follow - * - * @return array - */ - public function unfollow($username) - { - return $this->delete('/user/following/'.rawurlencode($username)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php deleted file mode 100644 index da727397..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Memberships.php +++ /dev/null @@ -1,48 +0,0 @@ -get('/user/memberships/orgs'); - } - - /** - * Get your organization membership. - * - * @link https://developer.github.com/v3/orgs/members/#get-your-organization-membership - * - * @param string $organization - * - * @return array - */ - public function organization($organization) - { - return $this->get('/user/memberships/orgs/'.rawurlencode($organization)); - } - - /** - * Edit your organization membership. - * - * @link https://developer.github.com/v3/orgs/members/#edit-your-organization-membership - * - * @param string $organization - * - * @return array - */ - public function edit($organization) - { - return $this->patch('/user/memberships/orgs/'.rawurlencode($organization), ['state' => 'active']); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php deleted file mode 100644 index 9f3f2ce7..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Notifications.php +++ /dev/null @@ -1,145 +0,0 @@ - - */ -class Notifications extends AbstractApi -{ - /** - * List all notifications for the authenticated user. - * - * @link http://developer.github.com/v3/activity/notifications/#list-your-notifications - * - * @param array $params - * - * @return array - */ - public function all(array $params = []) - { - return $this->get('/notifications', $params); - } - - /** - * List all notifications for the authenticated user in selected repository. - * - * @link http://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param array $params - * - * @return array - */ - public function allInRepository($username, $repository, array $params = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params); - } - - /** - * Mark all notifications as read. - * - * @link http://developer.github.com/v3/activity/notifications/#mark-as-read - * - * @param array $params - * - * @return array - */ - public function markAsReadAll(array $params = []) - { - return $this->put('/notifications', $params); - } - - /** - * Mark all notifications for a repository as read. - * - * @link http://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param array $params - * - * @return array - */ - public function markAsReadInRepository($username, $repository, array $params = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/notifications', $params); - } - - /** - * Mark a notification as read. - * - * @link http://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read - * - * @param int $id the notification number - * @param array $params - * - * @return array - */ - public function markAsRead($id, array $params) - { - return $this->patch('/notifications/threads/'.$id, $params); - } - - /** - * Show a notification. - * - * @link http://developer.github.com/v3/activity/notifications/#view-a-single-thread - * - * @param int $id the notification number - * - * @return array - */ - public function show($id) - { - return $this->get('/notifications/threads/'.$id); - } - - /** - * Show a subscription. - * - * @link http://developer.github.com/v3/activity/notifications/#get-a-thread-subscription - * - * @param int $id the notification number - * - * @return array - */ - public function showSubscription($id) - { - return $this->get('/notifications/threads/'.$id.'/subscription'); - } - - /** - * Create a subscription. - * - * @link http://developer.github.com/v3/activity/notifications/#set-a-thread-subscription - * - * @param int $id the notification number - * @param array $params - * - * @return array - */ - public function createSubscription($id, array $params) - { - return $this->put('/notifications/threads/'.$id.'/subscription', $params); - } - - /** - * Delete a subscription. - * - * @link http://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription - * - * @param int $id the notification number - * - * @return array - */ - public function removeSubscription($id) - { - return $this->delete('/notifications/threads/'.$id.'/subscription'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php deleted file mode 100644 index cb24dec9..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/PublicKeys.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -class PublicKeys extends AbstractApi -{ - /** - * List deploy keys for the authenticated user. - * - * @link https://developer.github.com/v3/users/keys/ - * - * @return array - */ - public function all() - { - return $this->get('/user/keys'); - } - - /** - * Shows deploy key for the authenticated user. - * - * @link https://developer.github.com/v3/users/keys/ - * - * @param int $id - * - * @return array - */ - public function show($id) - { - return $this->get('/user/keys/'.$id); - } - - /** - * Adds deploy key for the authenticated user. - * - * @link https://developer.github.com/v3/users/keys/ - * - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create(array $params) - { - if (!isset($params['title'], $params['key'])) { - throw new MissingArgumentException(['title', 'key']); - } - - return $this->post('/user/keys', $params); - } - - /** - * Removes deploy key for the authenticated user. - * - * @link https://developer.github.com/v3/users/keys/ - * - * @param int $id - * - * @return array - */ - public function remove($id) - { - return $this->delete('/user/keys/'.$id); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php deleted file mode 100644 index ee2c5023..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Starring.php +++ /dev/null @@ -1,97 +0,0 @@ - - */ -class Starring extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @see https://developer.github.com/v3/activity/starring/#list-stargazers - * - * @param string $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if ('star' === $bodyType) { - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.star+json', $this->getApiVersion()); - } - - return $this; - } - - /** - * List repositories starred by the authenticated user. - * - * @link https://developer.github.com/v3/activity/starring/ - * - * @param int $page - * @param int $perPage - * - * @return array - */ - public function all($page = 1, $perPage = 30) - { - return $this->get('/user/starred', [ - 'page' => $page, - 'per_page' => $perPage, - ]); - } - - /** - * Check that the authenticated user starres a repository. - * - * @link https://developer.github.com/v3/activity/starring/ - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array - */ - public function check($username, $repository) - { - return $this->get('/user/starred/'.rawurlencode($username).'/'.rawurlencode($repository)); - } - - /** - * Make the authenticated user star a repository. - * - * @link https://developer.github.com/v3/activity/starring/ - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array - */ - public function star($username, $repository) - { - return $this->put('/user/starred/'.rawurlencode($username).'/'.rawurlencode($repository)); - } - - /** - * Make the authenticated user unstar a repository. - * - * @link https://developer.github.com/v3/activity/starring - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array - */ - public function unstar($username, $repository) - { - return $this->delete('/user/starred/'.rawurlencode($username).'/'.rawurlencode($repository)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php b/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php deleted file mode 100644 index 1ef35972..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/CurrentUser/Watchers.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @revised Felipe Valtl de Mello - */ -class Watchers extends AbstractApi -{ - /** - * List repositories watched by the authenticated user. - * - * @link https://developer.github.com/v3/activity/watching/ - * - * @param int $page - * - * @return array - */ - public function all($page = 1) - { - return $this->get('/user/subscriptions', [ - 'page' => $page, - ]); - } - - /** - * Check that the authenticated user watches a repository. - * - * @link https://developer.github.com/v3/activity/watching/ - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array - */ - public function check($username, $repository) - { - return $this->get('/user/subscriptions/'.rawurlencode($username).'/'.rawurlencode($repository)); - } - - /** - * Make the authenticated user watch a repository. - * - * @link https://developer.github.com/v3/activity/watching/ - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array - */ - public function watch($username, $repository) - { - return $this->put('/user/subscriptions/'.rawurlencode($username).'/'.rawurlencode($repository)); - } - - /** - * Make the authenticated user unwatch a repository. - * - * @link https://developer.github.com/v3/activity/watching/ - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array - */ - public function unwatch($username, $repository) - { - return $this->delete('/user/subscriptions/'.rawurlencode($username).'/'.rawurlencode($repository)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Deployment.php b/vendor/knplabs/github-api/lib/Github/Api/Deployment.php deleted file mode 100644 index f6127357..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Deployment.php +++ /dev/null @@ -1,133 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params); - } - - /** - * Get a deployment in selected repository. - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the deployment - * - * @return array - */ - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id); - } - - /** - * Create a new deployment for the given username and repo. - * - * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment - * - * Important: Once a deployment is created, it cannot be updated. Changes are indicated by creating new statuses. - * @see updateStatus - * - * @param string $username the username - * @param string $repository the repository - * @param array $params the new deployment data - * - * @throws MissingArgumentException - * - * @return array information about the deployment - */ - public function create($username, $repository, array $params) - { - if (!isset($params['ref'])) { - throw new MissingArgumentException(['ref']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments', $params); - } - - /** - * Delete a deployment for the given username and repo. - * - * @link https://docs.github.com/en/rest/reference/repos#delete-a-deployment - * - * Important: Deployments can only be deleted when in inactive state - * @see updateStatus - * - * @return mixed null on success, array on error with 'message' - */ - public function remove(string $username, string $repository, int $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id); - } - - /** - * Updates a deployment by creating a new status update. - * - * @link https://developer.github.com/v3/repos/deployments/#create-a-deployment-status - * - * @param string $username the username - * @param string $repository the repository - * @param int $id the deployment number - * @param array $params The information about the deployment update. - * Must include a "state" field of pending, success, error, or failure. - * May also be given a target_url and description, see link for more details. - * - * @throws MissingArgumentException - * - * @return array information about the deployment - */ - public function updateStatus($username, $repository, $id, array $params) - { - if (!isset($params['state'])) { - throw new MissingArgumentException(['state']); - } - - // adjust media-type per github docs - // https://docs.github.com/en/rest/reference/repos#create-a-deployment-status - if ($params['state'] === 'inactive') { - $this->acceptHeaderValue = 'application/vnd.github.ant-man-preview+json'; - } - if ($params['state'] === 'in_progress' || $params['state'] === 'queued') { - $this->acceptHeaderValue = 'application/vnd.github.flash-preview+json'; - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses', $params); - } - - /** - * Gets all of the status updates tied to a given deployment. - * - * @param string $username the username - * @param string $repository the repository - * @param int $id the deployment identifier - * - * @return array the deployment statuses - */ - public function getStatuses($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/deployments/'.$id.'/statuses'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise.php deleted file mode 100644 index b3daf95a..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Enterprise.php +++ /dev/null @@ -1,51 +0,0 @@ - - * @author Guillermo A. Fisher - */ -class Enterprise extends AbstractApi -{ - /** - * @return Stats - */ - public function stats() - { - return new Stats($this->getClient()); - } - - /** - * @return License - */ - public function license() - { - return new License($this->getClient()); - } - - /** - * @return ManagementConsole - */ - public function console() - { - return new ManagementConsole($this->getClient()); - } - - /** - * @return UserAdmin - */ - public function userAdmin() - { - return new UserAdmin($this->getClient()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php deleted file mode 100644 index 67e1c2a9..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/License.php +++ /dev/null @@ -1,20 +0,0 @@ -get('/enterprise/settings/license'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php deleted file mode 100644 index f11c4764..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/ManagementConsole.php +++ /dev/null @@ -1,77 +0,0 @@ -getWithLicenseHash('/setup/api/configcheck', $hash); - } - - /** - * Retrieves your installation’s settings. - * - * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-settings - * - * @param string $hash md5 hash of your license - * - * @return array array of settings - */ - public function settings($hash) - { - return $this->getWithLicenseHash('/setup/api/settings', $hash); - } - - /** - * Checks your installation’s maintenance status. - * - * @link https://developer.github.com/v3/enterprise/management_console/#check-maintenance-status - * - * @param string $hash md5 hash of your license - * - * @return array array of maintenance status information - */ - public function maintenance($hash) - { - return $this->getWithLicenseHash('/setup/api/maintenance', $hash); - } - - /** - * Retrieves your installation’s authorized SSH keys. - * - * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-authorized-ssh-keys - * - * @param string $hash md5 hash of your license - * - * @return array array of authorized keys - */ - public function keys($hash) - { - return $this->getWithLicenseHash('/setup/api/settings/authorized-keys', $hash); - } - - /** - * Sends an authenticated GET request. - * - * @param string $uri the request URI - * @param string $hash md5 hash of your license - * - * @return array|string - */ - protected function getWithLicenseHash($uri, $hash) - { - return $this->get($uri, ['license_md5' => rawurlencode($hash)]); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php deleted file mode 100644 index 78ba4256..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/Stats.php +++ /dev/null @@ -1,128 +0,0 @@ -show('issues'); - } - - /** - * Returns the number of active and inactive hooks. - * - * @return array array with totals of active and inactive hooks - */ - public function hooks() - { - return $this->show('hooks'); - } - - /** - * Returns the number of open and closed milestones. - * - * @return array array with totals of open and closed milestones - */ - public function milestones() - { - return $this->show('milestones'); - } - - /** - * Returns the number of organizations, teams, team members, and disabled organizations. - * - * @return array array with totals of organizations, teams, team members, and disabled organizations - */ - public function orgs() - { - return $this->show('orgs'); - } - - /** - * Returns the number of comments on issues, pull requests, commits, and gists. - * - * @return array array with totals of comments on issues, pull requests, commits, and gists - */ - public function comments() - { - return $this->show('comments'); - } - - /** - * Returns the number of GitHub Pages sites. - * - * @return array array with totals of GitHub Pages sites - */ - public function pages() - { - return $this->show('pages'); - } - - /** - * Returns the number of suspended and admin users. - * - * @return array array with totals of suspended and admin users - */ - public function users() - { - return $this->show('users'); - } - - /** - * Returns the number of private and public gists. - * - * @return array array with totals of private and public gists - */ - public function gists() - { - return $this->show('gists'); - } - - /** - * Returns the number of merged, mergeable, and unmergeable pull requests. - * - * @return array array with totals of merged, mergeable, and unmergeable pull requests - */ - public function pulls() - { - return $this->show('pulls'); - } - - /** - * Returns the number of organization-owned repositories, root repositories, forks, pushed commits, and wikis. - * - * @return array array with totals of organization-owned repositories, root repositories, forks, pushed commits, and wikis - */ - public function repos() - { - return $this->show('repos'); - } - - /** - * Returns all of the statistics. - * - * @return array array with all of the statistics - */ - public function all() - { - return $this->show('all'); - } - - /** - * @param string $type The type of statistics to show - * - * @return array - */ - public function show($type) - { - return $this->get('/enterprise/stats/'.rawurlencode($type)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php b/vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php deleted file mode 100644 index 0cd55a38..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Enterprise/UserAdmin.php +++ /dev/null @@ -1,36 +0,0 @@ -put('/users/'.rawurldecode($username).'/suspended', ['Content-Length' => 0]); - } - - /** - * Unsuspend a user. - * - * @link https://developer.github.com/v3/users/administration/#unsuspend-a-user - * - * @param string $username - * - * @return array - */ - public function unsuspend($username) - { - return $this->delete('/users/'.rawurldecode($username).'/suspended'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php deleted file mode 100644 index 31587d94..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Gist/Comments.php +++ /dev/null @@ -1,101 +0,0 @@ - - */ -class Comments extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/gists/comments/#custom-media-types - * - * @param string|null $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if (!in_array($bodyType, ['text', 'html', 'full'])) { - $bodyType = 'raw'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); - - return $this; - } - - /** - * Get all comments for a gist. - * - * @param string $gist - * - * @return array - */ - public function all($gist) - { - return $this->get('/gists/'.rawurlencode($gist).'/comments'); - } - - /** - * Get a comment of a gist. - * - * @param string $gist - * @param int $comment - * - * @return array - */ - public function show($gist, $comment) - { - return $this->get('/gists/'.rawurlencode($gist).'/comments/'.$comment); - } - - /** - * Create a comment for gist. - * - * @param string $gist - * @param string $body - * - * @return array - */ - public function create($gist, $body) - { - return $this->post('/gists/'.rawurlencode($gist).'/comments', ['body' => $body]); - } - - /** - * Create a comment for a gist. - * - * @param string $gist - * @param int $comment_id - * @param string $body - * - * @return array - */ - public function update($gist, $comment_id, $body) - { - return $this->patch('/gists/'.rawurlencode($gist).'/comments/'.$comment_id, ['body' => $body]); - } - - /** - * Delete a comment for a gist. - * - * @param string $gist - * @param int $comment - * - * @return array - */ - public function remove($gist, $comment) - { - return $this->delete('/gists/'.rawurlencode($gist).'/comments/'.$comment); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Gists.php b/vendor/knplabs/github-api/lib/Github/Api/Gists.php deleted file mode 100644 index 42bbdb9c..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Gists.php +++ /dev/null @@ -1,182 +0,0 @@ - - * @author Edoardo Rivello - */ -class Gists extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/gists/#custom-media-types - * - * @param string|null $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if ('base64' !== $bodyType) { - $bodyType = 'raw'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $this->getApiVersion(), $bodyType); - - return $this; - } - - /** - * @param string|null $type - * - * @return array|string - */ - public function all($type = null) - { - if (!in_array($type, ['public', 'starred'])) { - return $this->get('/gists'); - } - - return $this->get('/gists/'.rawurlencode($type)); - } - - /** - * @param string $number - * - * @return array - */ - public function show($number) - { - return $this->get('/gists/'.rawurlencode($number)); - } - - /** - * Get a specific revision of a gist. - * - * @param string $number - * @param string $sha - * - * @link https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist - * - * @return array - */ - public function revision($number, $sha) - { - return $this->get('/gists/'.rawurlencode($number).'/'.rawurlencode($sha)); - } - - public function create(array $params) - { - if (!isset($params['files']) || (!is_array($params['files']) || 0 === count($params['files']))) { - throw new MissingArgumentException('files'); - } - - $params['public'] = (bool) $params['public']; - - return $this->post('/gists', $params); - } - - /** - * @param string $id - * @param array $params - * - * @return array - */ - public function update($id, array $params) - { - return $this->patch('/gists/'.rawurlencode($id), $params); - } - - /** - * @param string $id - * - * @return array - */ - public function commits($id) - { - return $this->get('/gists/'.rawurlencode($id).'/commits'); - } - - /** - * @param string $id - * - * @return array - */ - public function fork($id) - { - return $this->post('/gists/'.rawurlencode($id).'/fork'); - } - - /** - * @param string $id - * - * @return array - */ - public function forks($id) - { - return $this->get('/gists/'.rawurlencode($id).'/forks'); - } - - /** - * @param string $id - * - * @return array - */ - public function remove($id) - { - return $this->delete('/gists/'.rawurlencode($id)); - } - - /** - * @param string $id - * - * @return array - */ - public function check($id) - { - return $this->get('/gists/'.rawurlencode($id).'/star'); - } - - /** - * @param string $id - * - * @return array - */ - public function star($id) - { - return $this->put('/gists/'.rawurlencode($id).'/star'); - } - - /** - * @param string $id - * - * @return array - */ - public function unstar($id) - { - return $this->delete('/gists/'.rawurlencode($id).'/star'); - } - - /** - * Get a gist's comments. - * - * @link http://developer.github.com/v3/gists/comments/ - * - * @return Comments - */ - public function comments() - { - return new Comments($this->getClient()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData.php b/vendor/knplabs/github-api/lib/Github/Api/GitData.php deleted file mode 100644 index b7a9f48c..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/GitData.php +++ /dev/null @@ -1,59 +0,0 @@ - - */ -class GitData extends AbstractApi -{ - /** - * @return Blobs - */ - public function blobs() - { - return new Blobs($this->getClient()); - } - - /** - * @return Commits - */ - public function commits() - { - return new Commits($this->getClient()); - } - - /** - * @return References - */ - public function references() - { - return new References($this->getClient()); - } - - /** - * @return Tags - */ - public function tags() - { - return new Tags($this->getClient()); - } - - /** - * @return Trees - */ - public function trees() - { - return new Trees($this->getClient()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php deleted file mode 100644 index 3b7357f3..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/GitData/Blobs.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @author Tobias Nyholm - */ -class Blobs extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the Accept header depending on the blob type. - * - * @param string|null $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if ('raw' === $bodyType) { - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.raw', $this->getApiVersion()); - } - - return $this; - } - - /** - * Show a blob of a sha for a repository. - * - * @param string $username - * @param string $repository - * @param string $sha - * - * @return array - */ - public function show($username, $repository, $sha) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs/'.rawurlencode($sha)); - } - - /** - * Create a blob of a sha for a repository. - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['content'], $params['encoding'])) { - throw new MissingArgumentException(['content', 'encoding']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/blobs', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php deleted file mode 100644 index 4205931f..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/GitData/Commits.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class Commits extends AbstractApi -{ - /** - * Show a commit for a repository. - * - * @param string $username - * @param string $repository - * @param string $sha - * - * @return array - */ - public function show($username, $repository, $sha) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/commits/'.rawurlencode($sha)); - } - - /** - * Create a commit for a repository. - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['message'], $params['tree'], $params['parents'])) { - throw new MissingArgumentException(['message', 'tree', 'parents']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/commits', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/References.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/References.php deleted file mode 100644 index d67cbe51..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/GitData/References.php +++ /dev/null @@ -1,156 +0,0 @@ - - */ -class References extends AbstractApi -{ - /** - * Get all references of a repository. - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function all($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs'); - } - - /** - * Get all matching references for the supplied reference name. - * - * @param string $username - * @param string $repository - * @param string $reference - * - * @return array - */ - public function matching(string $username, string $repository, string $reference): array - { - $reference = $this->encodeReference($reference); - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/matching-refs/'.$reference); - } - - /** - * Get all branches of a repository. - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function branches($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/heads'); - } - - /** - * Get all tags of a repository. - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function tags($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/tags'); - } - - /** - * Show the reference of a repository. - * - * @param string $username - * @param string $repository - * @param string $reference - * - * @return array - */ - public function show($username, $repository, $reference) - { - $reference = $this->encodeReference($reference); - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference); - } - - /** - * Create a reference for a repository. - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['ref'], $params['sha'])) { - throw new MissingArgumentException(['ref', 'sha']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs', $params); - } - - /** - * Update a reference for a repository. - * - * @param string $username - * @param string $repository - * @param string $reference - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function update($username, $repository, $reference, array $params) - { - if (!isset($params['sha'])) { - throw new MissingArgumentException('sha'); - } - - $reference = $this->encodeReference($reference); - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference, $params); - } - - /** - * Delete a reference of a repository. - * - * @param string $username - * @param string $repository - * @param string $reference - * - * @return array - */ - public function remove($username, $repository, $reference) - { - $reference = $this->encodeReference($reference); - - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference); - } - - /** - * Encode the raw reference. - * - * @param string $rawReference - * - * @return string - */ - private function encodeReference($rawReference) - { - return implode('/', array_map('rawurlencode', explode('/', $rawReference))); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php deleted file mode 100644 index 11bf200a..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/GitData/Tags.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class Tags extends AbstractApi -{ - /** - * Get all tags for a repository. - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function all($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/tags'); - } - - /** - * Get a tag for a repository. - * - * @param string $username - * @param string $repository - * @param string $sha - * - * @return array - */ - public function show($username, $repository, $sha) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/tags/'.rawurlencode($sha)); - } - - /** - * Create a tag for a repository. - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['tag'], $params['message'], $params['object'], $params['type'])) { - throw new MissingArgumentException(['tag', 'message', 'object', 'type']); - } - - if (isset($params['tagger']) && !isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { - throw new MissingArgumentException(['tagger.name', 'tagger.email', 'tagger.date']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/tags', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php b/vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php deleted file mode 100644 index 939e8619..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/GitData/Trees.php +++ /dev/null @@ -1,64 +0,0 @@ - - */ -class Trees extends AbstractApi -{ - /** - * Get the tree for a repository. - * - * @param string $username - * @param string $repository - * @param string $sha - * @param bool $recursive - * - * @return array - */ - public function show($username, $repository, $sha, $recursive = false) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/trees/'.rawurlencode($sha), $recursive ? ['recursive' => 1] : []); - } - - /** - * Create tree for a repository. - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['tree']) || !is_array($params['tree'])) { - throw new MissingArgumentException('tree'); - } - - if (!isset($params['tree'][0])) { - $params['tree'] = [$params['tree']]; - } - - foreach ($params['tree'] as $key => $tree) { - if (!isset($tree['path'], $tree['mode'], $tree['type'])) { - throw new MissingArgumentException(["tree.$key.path", "tree.$key.mode", "tree.$key.type"]); - } - - // If `sha` is not set, `content` is required - if (!array_key_exists('sha', $tree) && !isset($tree['content'])) { - throw new MissingArgumentException("tree.$key.content"); - } - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/trees', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/GraphQL.php b/vendor/knplabs/github-api/lib/Github/Api/GraphQL.php deleted file mode 100644 index 02499ad8..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/GraphQL.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -class GraphQL extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * @param string $query - * @param array $variables - * @param string $acceptHeaderValue - * - * @return array - */ - public function execute($query, array $variables = [], string $acceptHeaderValue = 'application/vnd.github.v4+json') - { - $this->acceptHeaderValue = $acceptHeaderValue; - $params = [ - 'query' => $query, - ]; - if (!empty($variables)) { - $params['variables'] = json_encode($variables); - } - - return $this->post('/graphql', $params); - } - - /** - * @param string $file - * @param array $variables - * - * @return array - */ - public function fromFile($file, array $variables = []) - { - return $this->execute(file_get_contents($file), $variables); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue.php b/vendor/knplabs/github-api/lib/Github/Api/Issue.php deleted file mode 100644 index 764f5e44..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Issue.php +++ /dev/null @@ -1,241 +0,0 @@ - - * @author Joseph Bielawski - */ -class Issue extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/issues/#custom-media-types - * - * @param string|null $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if (!in_array($bodyType, ['text', 'html', 'full'])) { - $bodyType = 'raw'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); - - return $this; - } - - /** - * List issues by username, repo and state. - * - * @link http://developer.github.com/v3/issues/ - * - * @param string $username the username - * @param string $repository the repository - * @param array $params the additional parameters like milestone, assignees, labels, sort, direction - * - * @return array list of issues found - */ - public function all($username, $repository, array $params = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues', array_merge(['page' => 1], $params)); - } - - /** - * List issues by organization. - * - * @link http://developer.github.com/v3/issues/ - * - * @param string $organization the organization - * @param string $state the issue state, can be open or closed - * @param array $params the additional parameters like milestone, assignees, labels, sort, direction - * - * @return array list of issues found - */ - public function org($organization, $state, array $params = []) - { - if (!in_array($state, ['open', 'closed'])) { - $state = 'open'; - } - - return $this->get('/orgs/'.rawurlencode($organization).'/issues', array_merge(['page' => 1, 'state' => $state], $params)); - } - - /** - * Get extended information about an issue by its username, repo and number. - * - * @link http://developer.github.com/v3/issues/ - * - * @param string $username the username - * @param string $repository the repository - * @param int $id the issue number - * - * @return array information about the issue - */ - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id); - } - - /** - * Create a new issue for the given username and repo. - * The issue is assigned to the authenticated user. Requires authentication. - * - * @link http://developer.github.com/v3/issues/ - * - * @param string $username the username - * @param string $repository the repository - * @param array $params the new issue data - * - * @throws MissingArgumentException - * - * @return array information about the issue - */ - public function create($username, $repository, array $params) - { - if (!isset($params['title'])) { - throw new MissingArgumentException(['title']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues', $params); - } - - /** - * Update issue information's by username, repo and issue number. Requires authentication. - * - * @link http://developer.github.com/v3/issues/ - * - * @param string $username the username - * @param string $repository the repository - * @param int $id the issue number - * @param array $params key=>value user attributes to update. - * key can be title or body - * - * @return array information about the issue - */ - public function update($username, $repository, $id, array $params) - { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id, $params); - } - - /** - * Lock an issue. Users with push access can lock an issue's conversation. - * - * @link https://developer.github.com/v3/issues/#lock-an-issue - * - * @param string $username - * @param string $repository - * @param int $id - * - * @return string - */ - public function lock($username, $repository, $id) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id.'/lock'); - } - - /** - * Unlock an issue. Users with push access can unlock an issue's conversation. - * - * @link https://developer.github.com/v3/issues/#lock-an-issue - * - * @param string $username - * @param string $repository - * @param int $id - * - * @return string - */ - public function unlock($username, $repository, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id.'/lock'); - } - - /** - * List an issue comments. - * - * @link http://developer.github.com/v3/issues/comments/ - * - * @return Comments - */ - public function comments() - { - return new Comments($this->getClient()); - } - - /** - * List all project events. - * - * @link http://developer.github.com/v3/issues/events/ - * - * @return Events - */ - public function events() - { - return new Events($this->getClient()); - } - - /** - * List all project labels. - * - * @link http://developer.github.com/v3/issues/labels/ - * - * @return Labels - */ - public function labels() - { - return new Labels($this->getClient()); - } - - /** - * List all project milestones. - * - * @link http://developer.github.com/v3/issues/milestones/ - * - * @return Milestones - */ - public function milestones() - { - return new Milestones($this->getClient()); - } - - /** - * List all assignees. - * - * @link https://developer.github.com/v3/issues/assignees/ - * - * @return Assignees - */ - public function assignees() - { - return new Assignees($this->getClient()); - } - - /** - * List all events. - * - * @link https://developer.github.com/v3/issues/timeline/ - * - * @return Timeline - */ - public function timeline() - { - return new Timeline($this->getClient()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php deleted file mode 100644 index 8ae86d1c..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Issue/Assignees.php +++ /dev/null @@ -1,91 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/assignees', $parameters); - } - - /** - * Check to see if a particular user is an assignee for a repository. - * - * @link https://developer.github.com/v3/issues/assignees/#check-assignee - * - * @param string $username - * @param string $repository - * @param string $assignee - * - * @return array - */ - public function check($username, $repository, $assignee) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/assignees/'.rawurlencode($assignee)); - } - - /** - * Add assignees to an Issue. - * - * @link https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue - * - * @param string $username - * @param string $repository - * @param string $issue - * @param array $parameters - * - * @throws InvalidArgumentException - * @throws MissingArgumentException - * - * @return string - */ - public function add($username, $repository, $issue, array $parameters) - { - if (!isset($parameters['assignees'])) { - throw new MissingArgumentException('assignees'); - } - - if (!is_array($parameters['assignees'])) { - throw new InvalidArgumentException('The assignees parameter should be an array of assignees'); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/assignees', $parameters); - } - - /** - * Remove assignees from an Issue. - * - * @link https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue - * - * @param string $username - * @param string $repository - * @param string $issue - * @param array $parameters - * - * @throws MissingArgumentException - * - * @return string - */ - public function remove($username, $repository, $issue, array $parameters) - { - if (!isset($parameters['assignees'])) { - throw new MissingArgumentException('assignees'); - } - - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/assignees', $parameters); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php deleted file mode 100644 index b0fe8787..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Issue/Comments.php +++ /dev/null @@ -1,133 +0,0 @@ - - * @author Tobias Nyholm - */ -class Comments extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/issues/comments/#custom-media-types - * - * @param string|null $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if (!in_array($bodyType, ['raw', 'text', 'html'])) { - $bodyType = 'full'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); - - return $this; - } - - /** - * Get all comments for an issue. - * - * @link https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue - * - * @param string $username - * @param string $repository - * @param int $issue - * @param array $params - * - * @return array - */ - public function all($username, $repository, $issue, array $params = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/comments', $params); - } - - /** - * Get a comment for an issue. - * - * @link https://developer.github.com/v3/issues/comments/#get-a-single-comment - * - * @param string $username - * @param string $repository - * @param int $comment - * - * @return array - */ - public function show($username, $repository, $comment) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment); - } - - /** - * Create a comment for an issue. - * - * @link https://developer.github.com/v3/issues/comments/#create-a-comment - * - * @param string $username - * @param string $repository - * @param int $issue - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, $issue, array $params) - { - if (!isset($params['body'])) { - throw new MissingArgumentException('body'); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/comments', $params); - } - - /** - * Update a comment for an issue. - * - * @link https://developer.github.com/v3/issues/comments/#edit-a-comment - * - * @param string $username - * @param string $repository - * @param int $comment - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function update($username, $repository, $comment, array $params) - { - if (!isset($params['body'])) { - throw new MissingArgumentException('body'); - } - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment, $params); - } - - /** - * Delete a comment for an issue. - * - * @link https://developer.github.com/v3/issues/comments/#delete-a-comment - * - * @param string $username - * @param string $repository - * @param int $comment - * - * @return array - */ - public function remove($username, $repository, $comment) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/comments/'.$comment); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php deleted file mode 100644 index a628b2c6..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Issue/Events.php +++ /dev/null @@ -1,54 +0,0 @@ - - */ -class Events extends AbstractApi -{ - /** - * Get all events for an issue. - * - * @link https://developer.github.com/v3/issues/events/#list-events-for-an-issue - * - * @param string $username - * @param string $repository - * @param int|null $issue - * @param int $page - * - * @return array - */ - public function all($username, $repository, $issue = null, $page = 1) - { - if (null !== $issue) { - $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/events'; - } else { - $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/events'; - } - - return $this->get($path, [ - 'page' => $page, - ]); - } - - /** - * Display an event for an issue. - * - * @link https://developer.github.com/v3/issues/events/#get-a-single-event - * - * @param string $username - * @param string $repository - * @param string $event - * - * @return array - */ - public function show($username, $repository, $event) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/events/'.rawurlencode($event)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php deleted file mode 100644 index d719578d..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Issue/Labels.php +++ /dev/null @@ -1,192 +0,0 @@ - - */ -class Labels extends AbstractApi -{ - /** - * Get all labels for a repository or the labels for a specific issue. - * - * @link https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue - * - * @param string $username - * @param string $repository - * @param int|null $issue - * - * @return array - */ - public function all($username, $repository, $issue = null) - { - if ($issue === null) { - $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels'; - } else { - $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels'; - } - - return $this->get($path); - } - - /** - * Get a single label. - * - * @link https://developer.github.com/v3/issues/labels/#get-a-single-label - * - * @param string $username - * @param string $repository - * @param string $label - * - * @return array - */ - public function show($username, $repository, $label) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); - } - - /** - * Create a label for a repository. - * - * @link https://developer.github.com/v3/issues/labels/#create-a-label - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['name'])) { - throw new MissingArgumentException('name'); - } - if (!isset($params['color'])) { - $params['color'] = 'FFFFFF'; - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels', $params); - } - - /** - * Delete a label for a repository. - * - * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue - * - * @param string $username - * @param string $repository - * @param string $label - * - * @return array - */ - public function deleteLabel($username, $repository, $label) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); - } - - /** - * Edit a label for a repository. - * - * @link https://developer.github.com/v3/issues/labels/#update-a-label - * - * @param string $username - * @param string $repository - * @param string $label - * @param string $newName - * @param string $color - * - * @return array - */ - public function update($username, $repository, $label, $newName, $color) - { - $params = [ - 'name' => $newName, - 'color' => $color, - ]; - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label), $params); - } - - /** - * Add a label to an issue. - * - * @link https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue - * - * @param string $username - * @param string $repository - * @param int $issue - * @param string|array $labels - * - * @return array - * - * @thorws \Github\Exception\InvalidArgumentException - */ - public function add($username, $repository, $issue, $labels) - { - if (is_string($labels)) { - $labels = [$labels]; - } elseif (0 === count($labels)) { - throw new InvalidArgumentException('The labels parameter should be a single label or an array of labels'); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels', $labels); - } - - /** - * Replace labels for an issue. - * - * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue - * - * @param string $username - * @param string $repository - * @param int $issue - * @param array $params - * - * @return array - */ - public function replace($username, $repository, $issue, array $params) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels', $params); - } - - /** - * Remove a label for an issue. - * - * @link https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue - * - * @param string $username - * @param string $repository - * @param int $issue - * @param string $label - * - * @return array|string - */ - public function remove($username, $repository, $issue, $label) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels/'.rawurlencode($label)); - } - - /** - * Remove all labels from an issue. - * - * @link https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue - * - * @param string $username - * @param string $repository - * @param int $issue - * - * @return array|string - */ - public function clear($username, $repository, $issue) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/labels'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php deleted file mode 100644 index 4cf2a3d5..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Issue/Milestones.php +++ /dev/null @@ -1,139 +0,0 @@ - - */ -class Milestones extends AbstractApi -{ - /** - * Get all milestones for a repository. - * - * @link https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository - * - * @param string $username - * @param string $repository - * @param array $params - * - * @return array - */ - public function all($username, $repository, array $params = []) - { - if (isset($params['state']) && !in_array($params['state'], ['open', 'closed', 'all'])) { - $params['state'] = 'open'; - } - if (isset($params['sort']) && !in_array($params['sort'], ['due_date', 'completeness'])) { - $params['sort'] = 'due_date'; - } - if (isset($params['direction']) && !in_array($params['direction'], ['asc', 'desc'])) { - $params['direction'] = 'asc'; - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', array_merge([ - 'page' => 1, - 'state' => 'open', - 'sort' => 'due_date', - 'direction' => 'asc', - ], $params)); - } - - /** - * Get a milestone for a repository. - * - * @link https://developer.github.com/v3/issues/milestones/#get-a-single-milestone - * - * @param string $username - * @param string $repository - * @param int $id - * - * @return array - */ - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id); - } - - /** - * Create a milestone for a repository. - * - * @link https://developer.github.com/v3/issues/milestones/#create-a-milestone - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['title'])) { - throw new MissingArgumentException('title'); - } - if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) { - $params['state'] = 'open'; - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones', $params); - } - - /** - * Update a milestone for a repository. - * - * @link https://developer.github.com/v3/issues/milestones/#update-a-milestone - * - * @param string $username - * @param string $repository - * @param int $id - * @param array $params - * - * @return array - */ - public function update($username, $repository, $id, array $params) - { - if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) { - $params['state'] = 'open'; - } - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id, $params); - } - - /** - * Delete a milestone for a repository. - * - * @link https://developer.github.com/v3/issues/milestones/#delete-a-milestone - * - * @param string $username - * @param string $repository - * @param int $id - * - * @return array|string - */ - public function remove($username, $repository, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id); - } - - /** - * Get the labels of a milestone. - * - * @link https://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone - * - * @param string $username - * @param string $repository - * @param int $id - * - * @return array - */ - public function labels($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/milestones/'.$id.'/labels'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php b/vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php deleted file mode 100644 index 16ec4b06..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Issue/Timeline.php +++ /dev/null @@ -1,34 +0,0 @@ -acceptHeaderValue = 'application/vnd.github.mockingbird-preview'; - - return $this; - } - - /** - * Get all events for a specific issue. - * - * @link https://developer.github.com/v3/issues/timeline/#list-events-for-an-issue - * - * @param string $username - * @param string $repository - * @param int $issue - * - * @return array - */ - public function all($username, $repository, $issue) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$issue.'/timeline'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Markdown.php b/vendor/knplabs/github-api/lib/Github/Api/Markdown.php deleted file mode 100644 index 977b1d04..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Markdown.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class Markdown extends AbstractApi -{ - /** - * @param string $text - * @param string $mode - * @param string $context - * - * @return string - */ - public function render($text, $mode = 'markdown', $context = null) - { - if (!in_array($mode, ['gfm', 'markdown'])) { - $mode = 'markdown'; - } - - $params = [ - 'text' => $text, - 'mode' => $mode, - ]; - if (null !== $context && 'gfm' === $mode) { - $params['context'] = $context; - } - - return $this->post('/markdown', $params); - } - - /** - * @param string $file - * - * @return string - */ - public function renderRaw($file) - { - return $this->post('/markdown/raw', [ - 'file' => $file, - ]); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Meta.php b/vendor/knplabs/github-api/lib/Github/Api/Meta.php deleted file mode 100644 index 0ec81f65..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Meta.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class Meta extends AbstractApi -{ - /** - * Get the ip address of the hook and git servers for the GitHub.com service. - * - * @return array Information about the service of GitHub.com - */ - public function service() - { - return $this->get('/meta'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php deleted file mode 100644 index 64bfaa8b..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/CodeOfConduct.php +++ /dev/null @@ -1,44 +0,0 @@ -acceptHeaderValue = 'application/vnd.github.scarlet-witch-preview+json'; - - return $this; - } - - /** - * List all codes of conduct. - * - * @link https://developer.github.com/v3/codes_of_conduct/#list-all-codes-of-conduct - * - * @return array - */ - public function all() - { - return $this->get('/codes_of_conduct'); - } - - /** - * Get an individual code of conduct. - * - * @link https://developer.github.com/v3/codes_of_conduct/#get-an-individual-code-of-conduct - * - * @param string $key - * - * @return array - */ - public function show($key) - { - return $this->get('/codes_of_conduct/'.rawurlencode($key)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php deleted file mode 100644 index 2a940f6d..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Emojis.php +++ /dev/null @@ -1,20 +0,0 @@ -get('/emojis'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php deleted file mode 100644 index c5f03e7e..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Gitignore.php +++ /dev/null @@ -1,34 +0,0 @@ -get('/gitignore/templates'); - } - - /** - * Get a single template. - * - * @link https://developer.github.com/v3/gitignore/#get-a-single-template - * - * @param string $template - * - * @return array - */ - public function show($template) - { - return $this->get('/gitignore/templates/'.rawurlencode($template)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php b/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php deleted file mode 100644 index f8e55782..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Miscellaneous/Licenses.php +++ /dev/null @@ -1,34 +0,0 @@ -get('/licenses'); - } - - /** - * Get an individual license by its license key. - * - * @link https://developer.github.com/v3/licenses/#get-an-individual-license - * - * @param string $license - * - * @return array - */ - public function show($license) - { - return $this->get('/licenses/'.rawurlencode($license)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Notification.php b/vendor/knplabs/github-api/lib/Github/Api/Notification.php deleted file mode 100644 index e8c9b246..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Notification.php +++ /dev/null @@ -1,91 +0,0 @@ - - */ -class Notification extends AbstractApi -{ - /** - * Get a listing of notifications. - * - * @link https://developer.github.com/v3/activity/notifications/ - * - * @param bool $includingRead - * @param bool $participating - * @param DateTime|null $since - * @param DateTime|null $before - * - * @return array array of notifications - */ - public function all($includingRead = false, $participating = false, DateTime $since = null, DateTime $before = null) - { - $parameters = [ - 'all' => $includingRead, - 'participating' => $participating, - ]; - - if ($since !== null) { - $parameters['since'] = $since->format(DateTime::ISO8601); - } - - if ($before !== null) { - $parameters['before'] = $before->format(DateTime::ISO8601); - } - - return $this->get('/notifications', $parameters); - } - - /** - * Marks all notifications as read from the current date. - * - * Optionally give DateTime to mark as read before that date. - * - * @link https://developer.github.com/v3/activity/notifications/#mark-as-read - * - * @param DateTime|null $since - */ - public function markRead(DateTime $since = null) - { - $parameters = []; - - if ($since !== null) { - $parameters['last_read_at'] = $since->format(DateTime::ISO8601); - } - - $this->put('/notifications', $parameters); - } - - /** - * Mark a single thread as read using its ID. - * - * @link https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read - * - * @param int $id - */ - public function markThreadRead($id) - { - $this->patch('/notifications/threads/'.$id); - } - - /** - * Gets a single thread using its ID. - * - * @link https://developer.github.com/v3/activity/notifications/#view-a-single-thread - * - * @param int $id - */ - public function id($id) - { - return $this->get('/notifications/threads/'.$id); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization.php b/vendor/knplabs/github-api/lib/Github/Api/Organization.php deleted file mode 100644 index d3e76466..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Organization.php +++ /dev/null @@ -1,134 +0,0 @@ - - * @author Joseph Bielawski - */ -class Organization extends AbstractApi -{ - /** - * @link https://developer.github.com/v3/orgs/#list-all-organizations - * - * @return array the organizations - */ - public function all($since = '') - { - return $this->get('/organizations?since='.rawurlencode($since)); - } - - /** - * Get extended information about an organization by its name. - * - * @link http://developer.github.com/v3/orgs/#get - * - * @param string $organization the organization to show - * - * @return array information about the organization - */ - public function show($organization) - { - return $this->get('/orgs/'.rawurlencode($organization)); - } - - public function update($organization, array $params) - { - return $this->patch('/orgs/'.rawurlencode($organization), $params); - } - - /** - * List all repositories across all the organizations that you can access. - * - * @link http://developer.github.com/v3/repos/#list-organization-repositories - * - * @param string $organization the user name - * @param string $type the type of repositories - * @param int $page the page - * @param string $sort sort by - * @param string $direction direction of sort, asc or desc - * - * @return array the repositories - */ - public function repositories($organization, $type = 'all', $page = 1, $sort = null, $direction = null) - { - $parameters = [ - 'type' => $type, - 'page' => $page, - ]; - - if ($sort !== null) { - $parameters['sort'] = $sort; - } - - if ($direction !== null) { - $parameters['direction'] = $direction; - } - - return $this->get('/orgs/'.rawurlencode($organization).'/repos', $parameters); - } - - /** - * @return Members - */ - public function members() - { - return new Members($this->getClient()); - } - - /** - * @return Hooks - */ - public function hooks() - { - return new Hooks($this->getClient()); - } - - /** - * @return Teams - */ - public function teams() - { - return new Teams($this->getClient()); - } - - /** - * @return Secrets - */ - public function secrets(): Secrets - { - return new Secrets($this->getClient()); - } - - /** - * @return OutsideCollaborators - */ - public function outsideCollaborators() - { - return new OutsideCollaborators($this->getClient()); - } - - /** - * @link http://developer.github.com/v3/issues/#list-issues - * - * @param string $organization - * @param array $params - * @param int $page - * - * @return array - */ - public function issues($organization, array $params = [], $page = 1) - { - return $this->get('/orgs/'.rawurlencode($organization).'/issues', array_merge(['page' => $page], $params)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php deleted file mode 100644 index 819e2c46..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Organization/Actions/Secrets.php +++ /dev/null @@ -1,144 +0,0 @@ -get('/orgs/'.rawurlencode($organization).'/actions/secrets'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-an-organization-secret - * - * @param string $organization - * @param string $secretName - * - * @return array|string - */ - public function show(string $organization, string $secretName) - { - return $this->get('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName)); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret - * - * @param string $organization - * @param string $secretName - * @param array $parameters - * - * @return array|string - */ - public function create(string $organization, string $secretName, array $parameters = []) - { - return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName), $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-an-organization-secret - * - * @param string $organization - * @param string $secretName - * @param array $parameters - * - * @return array|string - */ - public function update(string $organization, string $secretName, array $parameters = []) - { - return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName), $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#delete-an-organization-secret - * - * @param string $organization - * @param string $secretName - * - * @return array|string - */ - public function remove(string $organization, string $secretName) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName)); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#list-selected-repositories-for-an-organization-secret - * - * @param string $organization - * @param string $secretName - * - * @return array|string - */ - public function selectedRepositories(string $organization, string $secretName) - { - return $this->get('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#set-selected-repositories-for-an-organization-secret - * - * @param string $organization - * @param string $secretName - * @param array $parameters - * - * @return array|string - */ - public function setSelectedRepositories(string $organization, string $secretName, array $parameters = []) - { - return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories', $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#add-selected-repository-to-an-organization-secret - * - * @param string $organization - * @param string $repositoryId - * @param string $secretName - * - * @return array|string - */ - public function addSecret(string $organization, string $repositoryId, string $secretName) - { - return $this->put('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories/'.$repositoryId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#remove-selected-repository-from-an-organization-secret - * - * @param string $organization - * @param string $repositoryId - * @param string $secretName - * - * @return array|string - */ - public function removeSecret(string $organization, string $repositoryId, string $secretName) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/actions/secrets/'.rawurlencode($secretName).'/repositories/'.$repositoryId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-an-organization-public-key - * - * @param string $organization - * - * @return array|string - */ - public function publicKey(string $organization) - { - return $this->get('/orgs/'.rawurlencode($organization).'/actions/secrets/public-key'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php deleted file mode 100644 index 945cabc8..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Organization/Hooks.php +++ /dev/null @@ -1,111 +0,0 @@ -get('/orgs/'.rawurlencode($organization).'/hooks'); - } - - /** - * Get a single hook. - * - * @link https://developer.github.com/v3/orgs/hooks/#get-single-hook - * - * @param string $organization - * @param int $id - * - * @return array - */ - public function show($organization, $id) - { - return $this->get('/orgs/'.rawurlencode($organization).'/hooks/'.$id); - } - - /** - * Create a hook. - * - * @link https://developer.github.com/v3/orgs/hooks/#create-a-hook - * - * @param string $organization - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function create($organization, array $params) - { - if (!isset($params['name'], $params['config'])) { - throw new MissingArgumentException(['name', 'config']); - } - - return $this->post('/orgs/'.rawurlencode($organization).'/hooks', $params); - } - - /** - * Edit a hook. - * - * @link https://developer.github.com/v3/orgs/hooks/#edit-a-hook - * - * @param string $organization - * @param int $id - * @param array $params - * - * @throws \Github\Exception\MissingArgumentException - * - * @return array - */ - public function update($organization, $id, array $params) - { - if (!isset($params['config'])) { - throw new MissingArgumentException(['config']); - } - - return $this->patch('/orgs/'.rawurlencode($organization).'/hooks/'.$id, $params); - } - - /** - * Ping a hook. - * - * @link https://developer.github.com/v3/orgs/hooks/#ping-a-hook - * - * @param string $organization - * @param int $id - * - * @return array|string - */ - public function ping($organization, $id) - { - return $this->post('/orgs/'.rawurlencode($organization).'/hooks/'.$id.'/pings'); - } - - /** - * Delete a hook. - * - * @link https://developer.github.com/v3/orgs/hooks/#delete-a-hook - * - * @param string $organization - * @param int $id - * - * @return array|string - */ - public function remove($organization, $id) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/hooks/'.$id); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php deleted file mode 100644 index 023e3f8d..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Organization/Members.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -class Members extends AbstractApi -{ - public function all($organization, $type = null, $filter = 'all', $role = null) - { - $parameters = []; - $path = '/orgs/'.rawurlencode($organization).'/'; - if (null === $type) { - $path .= 'members'; - if (null !== $filter) { - $parameters['filter'] = $filter; - } - if (null !== $role) { - $parameters['role'] = $role; - } - } else { - $path .= 'public_members'; - } - - return $this->get($path, $parameters); - } - - public function show($organization, $username) - { - return $this->get('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username)); - } - - public function member($organization, $username) - { - return $this->get('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username)); - } - - public function check($organization, $username) - { - return $this->get('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); - } - - public function publicize($organization, $username) - { - return $this->put('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); - } - - public function conceal($organization, $username) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/public_members/'.rawurlencode($username)); - } - - /* - * Add user to organization - */ - public function add($organization, $username, array $params = []) - { - return $this->put('/orgs/'.rawurlencode($organization).'/memberships/'.rawurlencode($username), $params); - } - - public function addMember($organization, $username) - { - return $this->add($organization, $username); - } - - public function remove($organization, $username) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/members/'.rawurlencode($username)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php deleted file mode 100644 index 958100a5..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Organization/OutsideCollaborators.php +++ /dev/null @@ -1,52 +0,0 @@ - - */ -class OutsideCollaborators extends AbstractApi -{ - /** - * @link https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators-for-an-organization - * - * @param string $organization the organization - * @param array $params - * - * @return array the organizations - */ - public function all($organization, array $params = []) - { - return $this->get('/orgs/'.rawurlencode($organization).'/outside_collaborators', $params); - } - - /** - * @link https://developer.github.com/v3/orgs/outside_collaborators/#convert-an-organization-member-to-outside-collaborator - * - * @param string $organization the organization - * @param string $username the github username - * - * @return array - */ - public function convert($organization, $username) - { - return $this->put('/orgs/'.rawurlencode($organization).'/outside_collaborators/'.rawurldecode($username)); - } - - /** - * @link https://developer.github.com/v3/orgs/outside_collaborators/#remove-outside-collaborator-from-an-organization - * - * @param string $organization the organization - * @param string $username the username - * - * @return array - */ - public function remove($organization, $username) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/outside_collaborators/'.rawurldecode($username)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php deleted file mode 100644 index 2bb7196e..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php +++ /dev/null @@ -1,23 +0,0 @@ -get('/orgs/'.rawurlencode($organization).'/projects', array_merge(['page' => 1], $params)); - } - - public function create($organization, array $params) - { - if (!isset($params['name'])) { - throw new MissingArgumentException(['name']); - } - - return $this->post('/orgs/'.rawurlencode($organization).'/projects', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php b/vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php deleted file mode 100644 index 3af63b73..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Organization/Teams.php +++ /dev/null @@ -1,121 +0,0 @@ - - */ -class Teams extends AbstractApi -{ - public function all($organization) - { - return $this->get('/orgs/'.rawurlencode($organization).'/teams'); - } - - public function create($organization, array $params) - { - if (!isset($params['name'])) { - throw new MissingArgumentException('name'); - } - if (isset($params['repo_names']) && !is_array($params['repo_names'])) { - $params['repo_names'] = [$params['repo_names']]; - } - if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) { - $params['permission'] = 'pull'; - } - - return $this->post('/orgs/'.rawurlencode($organization).'/teams', $params); - } - - /** - * @link https://developer.github.com/v3/teams/#list-teams - */ - public function show($team, $organization) - { - return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team)); - } - - /** - * @link https://developer.github.com/v3/teams/#edit-team - */ - public function update($team, array $params, $organization) - { - if (!isset($params['name'])) { - throw new MissingArgumentException('name'); - } - if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin'])) { - $params['permission'] = 'pull'; - } - - return $this->patch('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team), $params); - } - - /** - * @link https://developer.github.com/v3/teams/#delete-team - */ - public function remove($team, $organization) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team)); - } - - /** - * @link https://developer.github.com/v3/teams/members/#list-team-members - */ - public function members($team, $organization) - { - return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/members'); - } - - /** - * @link https://developer.github.com/v3/teams/members/#get-team-membership - */ - public function check($team, $username, $organization) - { - return $this->get('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username)); - } - - /** - * @link https://developer.github.com/v3/teams/members/#add-or-update-team-membership - */ - public function addMember($team, $username, $organization) - { - return $this->put('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username)); - } - - /** - * @link https://developer.github.com/v3/teams/members/#remove-team-membership - */ - public function removeMember($team, $username, $organization) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/memberships/'.rawurlencode($username)); - } - - public function repositories($team) - { - return $this->get('/teams/'.rawurlencode($team).'/repos'); - } - - public function repository($team, $organization, $repository) - { - return $this->get('/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository)); - } - - public function addRepository($team, $organization, $repository, $params = []) - { - if (isset($params['permission']) && !in_array($params['permission'], ['pull', 'push', 'admin', 'maintain', 'triage'])) { - $params['permission'] = 'pull'; - } - - return $this->put('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository), $params); - } - - public function removeRepository($team, $organization, $repository) - { - return $this->delete('/orgs/'.rawurlencode($organization).'/teams/'.rawurlencode($team).'/repos/'.rawurlencode($organization).'/'.rawurlencode($repository)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php b/vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php deleted file mode 100644 index 049d6756..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Project/AbstractProjectApi.php +++ /dev/null @@ -1,45 +0,0 @@ -acceptHeaderValue = 'application/vnd.github.inertia-preview+json'; - - return $this; - } - - public function show($id, array $params = []) - { - return $this->get('/projects/'.rawurlencode($id), array_merge(['page' => 1], $params)); - } - - public function update($id, array $params) - { - return $this->patch('/projects/'.rawurlencode($id), $params); - } - - public function deleteProject($id) - { - return $this->delete('/projects/'.rawurlencode($id)); - } - - public function columns() - { - return new Columns($this->getClient()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php b/vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php deleted file mode 100644 index 0d670f93..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Project/Cards.php +++ /dev/null @@ -1,60 +0,0 @@ -acceptHeaderValue = 'application/vnd.github.inertia-preview+json'; - - return $this; - } - - public function all($columnId, array $params = []) - { - return $this->get('/projects/columns/'.rawurlencode($columnId).'/cards', array_merge(['page' => 1], $params)); - } - - public function show($id) - { - return $this->get('/projects/columns/cards/'.rawurlencode($id)); - } - - public function create($columnId, array $params) - { - return $this->post('/projects/columns/'.rawurlencode($columnId).'/cards', $params); - } - - public function update($id, array $params) - { - return $this->patch('/projects/columns/cards/'.rawurlencode($id), $params); - } - - public function deleteCard($id) - { - return $this->delete('/projects/columns/cards/'.rawurlencode($id)); - } - - public function move($id, array $params) - { - if (!isset($params['position'])) { - throw new MissingArgumentException(['position']); - } - - return $this->post('/projects/columns/cards/'.rawurlencode($id).'/moves', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php b/vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php deleted file mode 100644 index 5146ac22..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Project/Columns.php +++ /dev/null @@ -1,73 +0,0 @@ -acceptHeaderValue = 'application/vnd.github.inertia-preview+json'; - - return $this; - } - - public function all($projectId, array $params = []) - { - return $this->get('/projects/'.rawurlencode($projectId).'/columns', array_merge(['page' => 1], $params)); - } - - public function show($id) - { - return $this->get('/projects/columns/'.rawurlencode($id)); - } - - public function create($projectId, array $params) - { - if (!isset($params['name'])) { - throw new MissingArgumentException(['name']); - } - - return $this->post('/projects/'.rawurlencode($projectId).'/columns', $params); - } - - public function update($id, array $params) - { - if (!isset($params['name'])) { - throw new MissingArgumentException(['name']); - } - - return $this->patch('/projects/columns/'.rawurlencode($id), $params); - } - - public function deleteColumn($id) - { - return $this->delete('/projects/columns/'.rawurlencode($id)); - } - - public function move($id, array $params) - { - if (!isset($params['position'])) { - throw new MissingArgumentException(['position']); - } - - return $this->post('/projects/columns/'.rawurlencode($id).'/moves', $params); - } - - public function cards() - { - return new Cards($this->getClient()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest.php deleted file mode 100644 index ce1c2b1d..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/PullRequest.php +++ /dev/null @@ -1,198 +0,0 @@ - - */ -class PullRequest extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/pulls/#custom-media-types - * - * @param string|null $bodyType - * @param string|null $apiVersion - * - * @return $this - */ - public function configure($bodyType = null, $apiVersion = null) - { - if (null === $apiVersion) { - $apiVersion = $this->getApiVersion(); - } - - if (!in_array($bodyType, ['text', 'html', 'full', 'diff', 'patch'])) { - $bodyType = 'raw'; - } - - if (!in_array($bodyType, ['diff', 'patch'])) { - $bodyType .= '+json'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $apiVersion, $bodyType); - - return $this; - } - - /** - * Get a listing of a project's pull requests by the username, repository and (optionally) state. - * - * @link http://developer.github.com/v3/pulls/ - * - * @param string $username the username - * @param string $repository the repository - * @param array $parameters a list of extra parameters. - * - * @return array array of pull requests for the project - */ - public function all($username, $repository, array $parameters = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls', $parameters); - } - - /** - * Show all details of a pull request, including the discussions. - * - * @link http://developer.github.com/v3/pulls/ - * - * @param string $username the username - * @param string $repository the repository - * @param int $id the ID of the pull request for which details are retrieved - * - * @return array|string pull request details - */ - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$id); - } - - public function commits($username, $repository, $id, array $parameters = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/commits', $parameters); - } - - public function files($username, $repository, $id, array $parameters = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/files', $parameters); - } - - /** - * All statuses which are the statuses of its head branch. - * - * @see http://developer.github.com/v3/pulls/ - * - * @param string $username the username - * @param string $repository the repository - * @param int $id the ID of the pull request for which statuses are retrieved - * - * @return array array of statuses for the project - */ - public function status($username, $repository, $id) - { - $link = $this->show($username, $repository, $id)['_links']['statuses']['href']; - - return $this->get($link); - } - - public function comments() - { - return new Comments($this->getClient()); - } - - public function reviews() - { - return new Review($this->getClient()); - } - - public function reviewRequests() - { - return new ReviewRequest($this->getClient()); - } - - /** - * Create a pull request. - * - * @link http://developer.github.com/v3/pulls/ - * - * @param string $username the username - * @param string $repository the repository - * @param array $params A String of the branch or commit SHA that you want your changes to be pulled to. - * A String of the branch or commit SHA of your changes. Typically this will be a branch. - * If the branch is in a fork of the original repository, specify the username first: - * "my-user:some-branch". The String title of the Pull Request. The String body of - * the Pull Request. The issue number. Used when title and body is not set. - * - * @throws MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - // Two ways to create PR, using issue or title - if (!isset($params['issue']) && !isset($params['title'])) { - throw new MissingArgumentException(['issue', 'title']); - } - - if (!isset($params['base'], $params['head'])) { - throw new MissingArgumentException(['base', 'head']); - } - - // If `issue` is not sent, then `body` must be sent - if (!isset($params['issue']) && !isset($params['body'])) { - throw new MissingArgumentException(['issue', 'body']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls', $params); - } - - public function update($username, $repository, $id, array $params) - { - if (isset($params['state']) && !in_array($params['state'], ['open', 'closed'])) { - $params['state'] = 'open'; - } - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id), $params); - } - - public function merged($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge'); - } - - public function merge($username, $repository, $id, $message, $sha, $mergeMethod = 'merge', $title = null) - { - if (is_bool($mergeMethod)) { - $mergeMethod = $mergeMethod ? 'squash' : 'merge'; - } - - if (!in_array($mergeMethod, ['merge', 'squash', 'rebase'], true)) { - throw new InvalidArgumentException(sprintf('"$mergeMethod" must be one of ["merge", "squash", "rebase"] ("%s" given).', $mergeMethod)); - } - - $params = [ - 'commit_message' => $message, - 'sha' => $sha, - 'merge_method' => $mergeMethod, - ]; - - if (is_string($title)) { - $params['commit_title'] = $title; - } - - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.rawurlencode($id).'/merge', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php deleted file mode 100644 index 3ded9456..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Comments.php +++ /dev/null @@ -1,153 +0,0 @@ - - */ -class Comments extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/pulls/comments/#custom-media-types - * - * @param string|null $bodyType - * @param string|null $apiVersion - * - * @return $this - */ - public function configure($bodyType = null, $apiVersion = null) - { - if ($apiVersion !== 'squirrel-girl-preview') { - $apiVersion = $this->getApiVersion(); - } - - if (!in_array($bodyType, ['text', 'html', 'full'])) { - $bodyType = 'raw'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $apiVersion, $bodyType); - - return $this; - } - - /** - * Get a listing of a pull request's comments by the username, repository and pull request number - * or all repository comments by the username and repository. - * - * @link https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request - * @link https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository - * - * @param string $username the username - * @param string $repository the repository - * @param int|null $pullRequest the pull request number - * @param array $params a list of extra parameters. - * - * @return array - */ - public function all($username, $repository, $pullRequest = null, array $params = []) - { - if (null !== $pullRequest) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/comments'); - } - - $parameters = array_merge([ - 'page' => 1, - 'per_page' => 30, - ], $params); - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments', $parameters); - } - - /** - * Get a single pull request comment by the username, repository and comment id. - * - * @link https://developer.github.com/v3/pulls/comments/#get-a-single-comment - * - * @param string $username the username - * @param string $repository the repository - * @param int $comment the comment id - * - * @return array - */ - public function show($username, $repository, $comment) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment); - } - - /** - * Create a pull request comment by the username, repository and pull request number. - * - * @link https://developer.github.com/v3/pulls/comments/#create-a-comment - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param array $params a list of extra parameters. - * - * @throws MissingArgumentException - * - * @return array - */ - public function create($username, $repository, $pullRequest, array $params) - { - if (!isset($params['body'])) { - throw new MissingArgumentException('body'); - } - - // If `in_reply_to` is set, other options are not necessary anymore - if (!isset($params['in_reply_to']) && !isset($params['commit_id'], $params['path'], $params['position'])) { - throw new MissingArgumentException(['commit_id', 'path', 'position']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/comments', $params); - } - - /** - * Update a pull request comment by the username, repository and comment id. - * - * @link https://developer.github.com/v3/pulls/comments/#edit-a-comment - * - * @param string $username the username - * @param string $repository the repository - * @param int $comment the comment id - * @param array $params a list of extra parameters. - * - * @throws MissingArgumentException - * - * @return array - */ - public function update($username, $repository, $comment, array $params) - { - if (!isset($params['body'])) { - throw new MissingArgumentException('body'); - } - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment, $params); - } - - /** - * Delete a pull request comment by the username, repository and comment id. - * - * @link https://developer.github.com/v3/pulls/comments/#delete-a-comment - * - * @param string $username the username - * @param string $repository the repository - * @param int $comment the comment id - * - * @return string - */ - public function remove($username, $repository, $comment) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/comments/'.$comment); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php deleted file mode 100644 index ed586ddf..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/Review.php +++ /dev/null @@ -1,211 +0,0 @@ - - */ -class Review extends AbstractApi -{ - use AcceptHeaderTrait; - - public function configure() - { - trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" is deprecated and will be removed.', __METHOD__); - - return $this; - } - - /** - * Get a listing of a pull request's reviews by the username, repository and pull request number. - * - * @link https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param array $params a list of extra parameters. - * - * @return array array of pull request reviews for the pull request - */ - public function all($username, $repository, $pullRequest, array $params = []) - { - if (!empty($params)) { - trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "$params" parameter is deprecated, to paginate the results use the "ResultPager" instead.'); - } - - $parameters = array_merge([ - 'page' => 1, - 'per_page' => 30, - ], $params); - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews', $parameters); - } - - /** - * Get a single pull request review by the username, repository, pull request number and the review id. - * - * @link https://developer.github.com/v3/pulls/reviews/#get-a-single-review - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param int $id the review id - * - * @return array the pull request review - */ - public function show($username, $repository, $pullRequest, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id); - } - - /** - * Delete a single pull request review by the username, repository, pull request number and the review id. - * - * @link https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param int $id the review id - * - * @return array|string - */ - public function remove($username, $repository, $pullRequest, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id); - } - - /** - * Get comments for a single pull request review. - * - * @link https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param int $id the review id - * - * @return array|string - */ - public function comments($username, $repository, $pullRequest, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id.'/comments'); - } - - /** - * Create a pull request review by the username, repository and pull request number. - * - * @link https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param array $params a list of extra parameters. - * - * @throws MissingArgumentException - * - * @return array the pull request review - */ - public function create($username, $repository, $pullRequest, array $params = []) - { - if (array_key_exists('event', $params) && !in_array($params['event'], ['APPROVE', 'REQUEST_CHANGES', 'COMMENT'], true)) { - throw new InvalidArgumentException(sprintf('"event" must be one of ["APPROVE", "REQUEST_CHANGES", "COMMENT"] ("%s" given).', $params['event'])); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews', $params); - } - - /** - * Submit a pull request review by the username, repository, pull request number and the review id. - * - * @link https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param int $id the review id - * @param array $params a list of extra parameters. - * - * @throws MissingArgumentException - * - * @return array the pull request review - */ - public function submit($username, $repository, $pullRequest, $id, array $params = []) - { - if (!isset($params['event'])) { - throw new MissingArgumentException('event'); - } - - if (!in_array($params['event'], ['APPROVE', 'REQUEST_CHANGES', 'COMMENT'], true)) { - throw new InvalidArgumentException(sprintf('"event" must be one of ["APPROVE", "REQUEST_CHANGES", "COMMENT"] ("%s" given).', $params['event'])); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id.'/events', $params); - } - - /** - * Dismiss a pull request review by the username, repository, pull request number and the review id. - * - * @link https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param int $id the review id - * @param string $message a mandatory dismissal message - * - * @return array|string - */ - public function dismiss($username, $repository, $pullRequest, $id, $message) - { - if (!is_string($message)) { - throw new InvalidArgumentException(sprintf('"message" must be a valid string ("%s" given).', gettype($message))); - } - - if (empty($message)) { - throw new InvalidArgumentException('"message" is mandatory and cannot be empty'); - } - - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id.'/dismissals', [ - 'message' => $message, - ]); - } - - /** - * Update a pull request review by the username, repository, pull request number and the review id. - * - * @link https://developer.github.com/v3/pulls/reviews/#update-a-pull-request-review - * - * @param string $username the username - * @param string $repository the repository - * @param int $pullRequest the pull request number - * @param int $id the review id - * @param string $body a mandatory dismissal message - * - * @return array|string - */ - public function update($username, $repository, $pullRequest, $id, $body) - { - if (!is_string($body)) { - throw new InvalidArgumentException(sprintf('"body" must be a valid string ("%s" given).', gettype($body))); - } - - if (empty($body)) { - throw new InvalidArgumentException('"body" is mandatory and cannot be empty'); - } - - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/reviews/'.$id, [ - 'body' => $body, - ]); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php b/vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php deleted file mode 100644 index d95913cc..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/PullRequest/ReviewRequest.php +++ /dev/null @@ -1,72 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', $params); - } - - /** - * @link https://developer.github.com/v3/pulls/review_requests/#create-a-review-request - * - * @param string $username - * @param string $repository - * @param int $pullRequest - * @param array $reviewers - * @param array $teamReviewers - * - * @return string - */ - public function create($username, $repository, $pullRequest, array $reviewers = [], array $teamReviewers = []) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers, 'team_reviewers' => $teamReviewers]); - } - - /** - * @link https://developer.github.com/v3/pulls/review_requests/#delete-a-review-request - * - * @param string $username - * @param string $repository - * @param int $pullRequest - * @param array $reviewers - * @param array $teamReviewers - * - * @return string - */ - public function remove($username, $repository, $pullRequest, array $reviewers = [], array $teamReviewers = []) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers, 'team_reviewers' => $teamReviewers]); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/RateLimit.php b/vendor/knplabs/github-api/lib/Github/Api/RateLimit.php deleted file mode 100644 index 10b8b5b3..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/RateLimit.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ -class RateLimit extends AbstractApi -{ - /** - * @var RateLimitResource[] - */ - protected $resources = []; - - /** - * Gets the rate limit resource objects. - * - * @return RateLimitResource[] - */ - public function getResources() - { - $this->fetchLimits(); - - return $this->resources; - } - - /** - * Returns a rate limit resource object by the given name. - * - * @param string $name - * - * @return RateLimitResource|false - */ - public function getResource($name) - { - // Fetch once per instance - if (empty($this->resources)) { - $this->fetchLimits(); - } - - if (!isset($this->resources[$name])) { - return false; - } - - return $this->resources[$name]; - } - - /** - * Returns the data directly from the GitHub API endpoint. - * - * @return array - */ - protected function fetchLimits() - { - $result = $this->get('/rate_limit') ?: []; - - // Assemble Limit instances - foreach ($result['resources'] as $resourceName => $resource) { - $this->resources[$resourceName] = new RateLimitResource($resourceName, $resource); - } - - return $result; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php b/vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php deleted file mode 100644 index 661a4e52..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/RateLimit/RateLimitResource.php +++ /dev/null @@ -1,73 +0,0 @@ -name = $name; - $this->limit = $data['limit']; - $this->remaining = $data['remaining']; - $this->reset = $data['reset']; - } - - /** - * The name of the Limit, e.g. "core", "graphql", "search". - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The rate limit amount. - * - * @return int - */ - public function getLimit() - { - return $this->limit; - } - - /** - * Number of requests remaining in time period before hitting the rate limit. - * - * @return int - */ - public function getRemaining() - { - return $this->remaining; - } - - /** - * Timestamp for when the rate limit will be reset. - * - * @return int - */ - public function getReset() - { - return $this->reset; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repo.php b/vendor/knplabs/github-api/lib/Github/Api/Repo.php deleted file mode 100644 index 12fe726b..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repo.php +++ /dev/null @@ -1,823 +0,0 @@ - - * @author Thibault Duplessis - */ -class Repo extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * List all public repositories. - * - * @link https://developer.github.com/v3/repos/#list-all-public-repositories - * - * @param int|null $id The integer ID of the last Repository that you’ve seen. - * - * @return array list of users found - */ - public function all($id = null) - { - if (!is_int($id)) { - return $this->get('/repositories'); - } - - return $this->get('/repositories', ['since' => $id]); - } - - /** - * Get the last year of commit activity for a repository grouped by week. - * - * @link http://developer.github.com/v3/repos/statistics/#commit-activity - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * - * @return array commit activity grouped by week - */ - public function activity($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/commit_activity'); - } - - /** - * Get contributor commit statistics for a repository. - * - * @link http://developer.github.com/v3/repos/statistics/#contributors - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * - * @return array list of contributors and their commit statistics - */ - public function statistics($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/contributors'); - } - - /** - * Get a weekly aggregate of the number of additions and deletions pushed to a repository. - * - * @link http://developer.github.com/v3/repos/statistics/#code-frequency - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * - * @return array list of weeks and their commit statistics - */ - public function frequency($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/code_frequency'); - } - - /** - * Get the weekly commit count for the repository owner and everyone else. - * - * @link http://developer.github.com/v3/repos/statistics/#participation - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * - * @return array list of weekly commit count grouped by 'all' and 'owner' - */ - public function participation($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stats/participation'); - } - - /** - * List all repositories for an organization. - * - * @link http://developer.github.com/v3/repos/#list-organization-repositories - * - * @param string $organization the name of the organization - * @param array $params - * - * @return array list of organization repositories - */ - public function org($organization, array $params = []) - { - return $this->get('/orgs/'.$organization.'/repos', array_merge(['start_page' => 1], $params)); - } - - /** - * Get extended information about a repository by its username and repository name. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * - * @return array information about the repository - */ - public function show($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository)); - } - - /** - * Get extended information about a repository by its id. - * Note: at time of writing this is an undocumented feature but GitHub support have advised that it can be relied on. - * - * @link http://developer.github.com/v3/repos/ - * @link https://github.com/piotrmurach/github/issues/283 - * @link https://github.com/piotrmurach/github/issues/282 - * - * @param int $id the id of the repository - * - * @return array information about the repository - */ - public function showById($id) - { - return $this->get('/repositories/'.$id); - } - - /** - * Create repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $name name of the repository - * @param string $description repository description - * @param string $homepage homepage url - * @param bool $public `true` for public, `false` for private - * @param string|null $organization username of organization if applicable - * @param bool $hasIssues `true` to enable issues for this repository, `false` to disable them - * @param bool $hasWiki `true` to enable the wiki for this repository, `false` to disable it - * @param bool $hasDownloads `true` to enable downloads for this repository, `false` to disable them - * @param int $teamId The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. - * @param bool $autoInit `true` to create an initial commit with empty README, `false` for no initial commit - * @param bool $hasProjects `true` to enable projects for this repository or false to disable them. - * @param string|null $visibility - * - * @return array returns repository data - */ - public function create( - $name, - $description = '', - $homepage = '', - $public = true, - $organization = null, - $hasIssues = false, - $hasWiki = false, - $hasDownloads = false, - $teamId = null, - $autoInit = false, - $hasProjects = true, - $visibility = null - ) { - $path = null !== $organization ? '/orgs/'.$organization.'/repos' : '/user/repos'; - - $parameters = [ - 'name' => $name, - 'description' => $description, - 'homepage' => $homepage, - 'private' => ($visibility ?? ($public ? 'public' : 'private')) === 'private', - 'visibility' => $visibility ?? ($public ? 'public' : 'private'), - 'has_issues' => $hasIssues, - 'has_wiki' => $hasWiki, - 'has_downloads' => $hasDownloads, - 'auto_init' => $autoInit, - 'has_projects' => $hasProjects, - ]; - - if ($organization && $teamId) { - $parameters['team_id'] = $teamId; - } - - return $this->post($path, $parameters); - } - - /** - * Set information of a repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param array $values the key => value pairs to post - * - * @return array information about the repository - */ - public function update($username, $repository, array $values) - { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository), $values); - } - - /** - * Delete a repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * - * @return mixed null on success, array on error with 'message' - */ - public function remove($username, $repository) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository)); - } - - /** - * Get the readme content for a repository by its username and repository name. - * - * @link http://developer.github.com/v3/repos/contents/#get-the-readme - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $format one of formats: "raw", "html", or "v3+json" - * @param string $dir The alternate path to look for a README file - * @param array $params additional query params like "ref" to fetch readme for branch/tag - * - * @return string|array the readme content - */ - public function readme($username, $repository, $format = 'raw', $dir = null, $params = []) - { - $path = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme'; - - if (null !== $dir) { - $path .= '/'.rawurlencode($dir); - } - - return $this->get($path, $params, [ - 'Accept' => "application/vnd.github.$format", - ]); - } - - /** - * Create a repository dispatch event. - * - * @link https://developer.github.com/v3/repos/#create-a-repository-dispatch-event - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $eventType A custom webhook event name - * - * @return mixed null on success, array on error with 'message' - */ - public function dispatch($username, $repository, $eventType, array $clientPayload) - { - return $this->post(\sprintf('/repos/%s/%s/dispatches', rawurlencode($username), rawurlencode($repository)), [ - 'event_type' => $eventType, - 'client_payload' => $clientPayload, - ]); - } - - /** - * Manage the collaborators of a repository. - * - * @link http://developer.github.com/v3/repos/collaborators/ - * - * @return Collaborators - */ - public function collaborators() - { - return new Collaborators($this->getClient()); - } - - /** - * Manage the comments of a repository. - * - * @link http://developer.github.com/v3/repos/comments/ - * - * @return Comments - */ - public function comments() - { - return new Comments($this->getClient()); - } - - /** - * Manage the commits of a repository. - * - * @link http://developer.github.com/v3/repos/commits/ - * - * @return Commits - */ - public function commits() - { - return new Commits($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#check-runs - */ - public function checkRuns(): CheckRuns - { - return new CheckRuns($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#check-suites - */ - public function checkSuites(): CheckSuites - { - return new CheckSuites($this->getClient()); - } - - /** - * @link https://developer.github.com/v3/actions/artifacts/#artifacts - */ - public function artifacts(): Artifacts - { - return new Artifacts($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#workflows - */ - public function workflows(): Workflows - { - return new Workflows($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#workflow-runs - */ - public function workflowRuns(): WorkflowRuns - { - return new WorkflowRuns($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#workflow-jobs - */ - public function workflowJobs(): WorkflowJobs - { - return new WorkflowJobs($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#self-hosted-runners - */ - public function selfHostedRunners(): SelfHostedRunners - { - return new SelfHostedRunners($this->getClient()); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#secrets - */ - public function secrets(): Secrets - { - return new Secrets($this->getClient()); - } - - /** - * Manage the content of a repository. - * - * @link http://developer.github.com/v3/repos/contents/ - * - * @return Contents - */ - public function contents() - { - return new Contents($this->getClient()); - } - - /** - * Manage the content of a repository. - * - * @link http://developer.github.com/v3/repos/downloads/ - * - * @return Downloads - */ - public function downloads() - { - return new Downloads($this->getClient()); - } - - /** - * Manage the releases of a repository (Currently Undocumented). - * - * @link http://developer.github.com/v3/repos/ - * - * @return Releases - */ - public function releases() - { - return new Releases($this->getClient()); - } - - /** - * Manage the deploy keys of a repository. - * - * @link http://developer.github.com/v3/repos/keys/ - * - * @return DeployKeys - */ - public function keys() - { - return new DeployKeys($this->getClient()); - } - - /** - * Manage the forks of a repository. - * - * @link http://developer.github.com/v3/repos/forks/ - * - * @return Forks - */ - public function forks() - { - return new Forks($this->getClient()); - } - - /** - * Manage the stargazers of a repository. - * - * @link https://developer.github.com/v3/activity/starring/#list-stargazers - * - * @return Stargazers - */ - public function stargazers() - { - return new Stargazers($this->getClient()); - } - - /** - * Manage the hooks of a repository. - * - * @link http://developer.github.com/v3/issues/jooks/ - * - * @return Hooks - */ - public function hooks() - { - return new Hooks($this->getClient()); - } - - /** - * Manage the labels of a repository. - * - * @link http://developer.github.com/v3/issues/labels/ - * - * @return Labels - */ - public function labels() - { - return new Labels($this->getClient()); - } - - /** - * Manage the statuses of a repository. - * - * @link http://developer.github.com/v3/repos/statuses/ - * - * @return Statuses - */ - public function statuses() - { - return new Statuses($this->getClient()); - } - - /** - * Get the branch(es) of a repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the username - * @param string $repository the name of the repository - * @param string $branch the name of the branch - * @param array $parameters parameters for the query string - * - * @return array list of the repository branches - */ - public function branches($username, $repository, $branch = null, array $parameters = []) - { - $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches'; - if (null !== $branch) { - $url .= '/'.rawurlencode($branch); - } - - return $this->get($url, $parameters); - } - - /** - * Manage the protection of a repository branch. - * - * @link https://developer.github.com/v3/repos/branches/#get-branch-protection - * - * @return Protection - */ - public function protection() - { - return new Protection($this->getClient()); - } - - /** - * Get the contributors of a repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param bool $includingAnonymous by default, the list only shows GitHub users. - * You can include non-users too by setting this to true - * - * @return array list of the repo contributors - */ - public function contributors($username, $repository, $includingAnonymous = false) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contributors', [ - 'anon' => $includingAnonymous ?: null, - ]); - } - - /** - * Get the language breakdown of a repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * - * @return array list of the languages - */ - public function languages($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/languages'); - } - - /** - * Get the tags of a repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param array $params the additional parameters like milestone, assignees, labels, sort, direction - * - * @return array list of the repository tags - */ - public function tags($username, $repository, array $params = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/tags', $params); - } - - /** - * Get the teams of a repository. - * - * @link http://developer.github.com/v3/repos/ - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array list of the languages - */ - public function teams($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/teams'); - } - - /** - * @param string $username - * @param string $repository - * @param int $page - * - * @return array - */ - public function subscribers($username, $repository, $page = 1) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/subscribers', [ - 'page' => $page, - ]); - } - - /** - * Perform a merge. - * - * @link http://developer.github.com/v3/repos/merging/ - * - * @param string $username - * @param string $repository - * @param string $base The name of the base branch that the head will be merged into. - * @param string $head The head to merge. This can be a branch name or a commit SHA1. - * @param string $message Commit message to use for the merge commit. If omitted, a default message will be used. - * - * @return array|string - */ - public function merge($username, $repository, $base, $head, $message = null) - { - $parameters = [ - 'base' => $base, - 'head' => $head, - ]; - - if (is_string($message)) { - $parameters['commit_message'] = $message; - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/merges', $parameters); - } - - /** - * @param string $username - * @param string $repository - * @param array $parameters - * - * @return array - */ - public function milestones($username, $repository, array $parameters = []) - { - return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/milestones', $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/repos#enable-automated-security-fixes - * - * @param string $username - * @param string $repository - * - * @return array|string - */ - public function enableAutomatedSecurityFixes(string $username, string $repository) - { - $this->acceptHeaderValue = 'application/vnd.github.london-preview+json'; - - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/automated-security-fixes'); - } - - /** - * @link https://docs.github.com/en/rest/reference/repos#disable-automated-security-fixes - * - * @param string $username - * @param string $repository - * - * @return array|string - */ - public function disableAutomatedSecurityFixes(string $username, string $repository) - { - $this->acceptHeaderValue = 'application/vnd.github.london-preview+json'; - - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/automated-security-fixes'); - } - - public function projects() - { - return new Projects($this->getClient()); - } - - public function traffic() - { - return new Traffic($this->getClient()); - } - - public function pages() - { - return new Pages($this->getClient()); - } - - /** - * @param string $username - * @param string $repository - * @param int $page - * - * @return array|string - * - * @see https://developer.github.com/v3/activity/events/#list-repository-events - */ - public function events($username, $repository, $page = 1) - { - return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/events', ['page' => $page]); - } - - /** - * Get the community profile metrics for a repository. - * - * @link https://developer.github.com/v3/repos/community/#retrieve-community-profile-metrics - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function communityProfile($username, $repository) - { - //This api is in preview mode, so set the correct accept-header - $this->acceptHeaderValue = 'application/vnd.github.black-panther-preview+json'; - - return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/community/profile'); - } - - /** - * Get the contents of a repository's code of conduct. - * - * @link https://developer.github.com/v3/codes_of_conduct/#get-the-contents-of-a-repositorys-code-of-conduct - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function codeOfConduct($username, $repository) - { - //This api is in preview mode, so set the correct accept-header - $this->acceptHeaderValue = 'application/vnd.github.scarlet-witch-preview+json'; - - return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/community/code_of_conduct'); - } - - /** - * List all topics for a repository. - * - * @link https://developer.github.com/v3/repos/#list-all-topics-for-a-repository - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function topics($username, $repository) - { - //This api is in preview mode, so set the correct accept-header - $this->acceptHeaderValue = 'application/vnd.github.mercy-preview+json'; - - return $this->get('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/topics'); - } - - /** - * Replace all topics for a repository. - * - * @link https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository - * - * @param string $username - * @param string $repository - * @param array $topics - * - * @return array - */ - public function replaceTopics($username, $repository, array $topics) - { - //This api is in preview mode, so set the correct accept-header - $this->acceptHeaderValue = 'application/vnd.github.mercy-preview+json'; - - return $this->put('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/topics', ['names' => $topics]); - } - - /** - * Transfer a repository. - * - * @link https://developer.github.com/v3/repos/#transfer-a-repository - * - * @param string $username - * @param string $repository - * @param string $newOwner - * @param array $teamId - * - * @return array - */ - public function transfer($username, $repository, $newOwner, $teamId = []) - { - return $this->post('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/transfer', ['new_owner' => $newOwner, 'team_id' => $teamId]); - } - - /** - * Create a repository using a template. - * - * @link https://developer.github.com/v3/repos/#create-a-repository-using-a-template - * - * @return array - */ - public function createFromTemplate(string $templateOwner, string $templateRepo, array $parameters = []) - { - //This api is in preview mode, so set the correct accept-header - $this->acceptHeaderValue = 'application/vnd.github.baptiste-preview+json'; - - return $this->post('/repos/'.rawurldecode($templateOwner).'/'.rawurldecode($templateRepo).'/generate', $parameters); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php deleted file mode 100644 index 84f3b060..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Artifacts.php +++ /dev/null @@ -1,82 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts', $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#list-workflow-run-artifacts - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array - */ - public function runArtifacts(string $username, string $repository, int $runId) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/artifacts'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-an-artifact - * - * @param string $username - * @param string $repository - * @param int $artifactId - * - * @return array - */ - public function show(string $username, string $repository, int $artifactId) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts/'.$artifactId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#delete-an-artifact - * - * @param string $username - * @param string $repository - * @param int $artifactId - * - * @return array - */ - public function remove(string $username, string $repository, int $artifactId) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts/'.$artifactId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#download-an-artifact - * - * @param string $username - * @param string $repository - * @param int $artifactId - * @param string $format - * - * @return array - */ - public function download(string $username, string $repository, int $artifactId, string $format = 'zip') - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/artifacts/'.$artifactId.'/'.$format); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php deleted file mode 100644 index 2085a133..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Secrets.php +++ /dev/null @@ -1,95 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-repository-secret - * - * @param string $username - * @param string $repository - * @param string $secretName - * - * @return array|string - */ - public function show(string $username, string $repository, string $secretName) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName)); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret - * - * @param string $username - * @param string $repository - * @param string $secretName - * @param array $parameters - * - * @return array|string - */ - public function create(string $username, string $repository, string $secretName, array $parameters = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName), $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret - * - * @param string $username - * @param string $repository - * @param string $secretName - * @param array $parameters - * - * @return array|string - */ - public function update(string $username, string $repository, string $secretName, array $parameters = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName), $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#delete-a-repository-secret - * - * @param string $username - * @param string $repository - * @param string $secretName - * - * @return array|string - */ - public function remove(string $username, string $repository, string $secretName) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/'.rawurlencode($secretName)); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-repository-public-key - * - * @param string $username - * @param string $repository - * - * @return array|string - */ - public function publicKey(string $username, string $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/secrets/public-key'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php deleted file mode 100644 index 7eb1a9d4..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/SelfHostedRunners.php +++ /dev/null @@ -1,65 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurldecode($repository).'/actions/runners'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-self-hosted-runner-for-a-repository - * - * @param string $username - * @param string $repository - * @param int $runnerId - * - * @return array|string - */ - public function show(string $username, string $repository, int $runnerId) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurldecode($repository).'/actions/runners/'.$runnerId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#delete-a-self-hosted-runner-from-a-repository - * - * @param string $username - * @param string $repository - * @param int $runnerId - * - * @return array|string - */ - public function remove(string $username, string $repository, int $runnerId) - { - return $this->delete('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/actions/runners/'.$runnerId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#list-runner-applications-for-a-repository - * - * @param string $username - * @param string $repository - * - * @return array|string - */ - public function applications(string $username, string $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runners/downloads'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php deleted file mode 100644 index 3167d3db..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowJobs.php +++ /dev/null @@ -1,54 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/jobs', $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-job-for-a-workflow-run - * - * @param string $username - * @param string $repository - * @param int $jobId - * - * @return array - */ - public function show(string $username, string $repository, int $jobId) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/jobs/'.$jobId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#download-job-logs-for-a-workflow-run - * - * @param string $username - * @param string $repository - * @param int $jobId - * - * @return array - */ - public function downloadLogs(string $username, string $repository, int $jobId) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/jobs/'.$jobId.'/logs'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php deleted file mode 100644 index d6f95f1e..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/WorkflowRuns.php +++ /dev/null @@ -1,155 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs', $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#list-workflow-runs - * - * @param string $username - * @param string $repository - * @param string $workflow - * @param array $parameters - * - * @return array - */ - public function listRuns(string $username, string $repository, string $workflow, array $parameters = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.rawurlencode($workflow).'/runs', $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-workflow-run - * - * @param string $username - * @param string $repository - * @param int $runId - * @param array $parameters - * - * @return array - */ - public function show(string $username, string $repository, int $runId, array $parameters = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId, $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array|string - */ - public function remove(string $username, string $repository, int $runId) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#re-run-a-workflow - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array - */ - public function rerun(string $username, string $repository, int $runId) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/rerun'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#cancel-a-workflow-run - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array - */ - public function cancel(string $username, string $repository, int $runId) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/cancel'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-workflow-run-usage - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array - */ - public function usage(string $username, string $repository, int $runId) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/timing'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#download-workflow-run-logs - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array|string - */ - public function downloadLogs(string $username, string $repository, int $runId) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/logs'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#delete-workflow-run-logs - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array|string - */ - public function deleteLogs(string $username, string $repository, int $runId) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/logs'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#approve-a-workflow-run-for-a-fork-pull-request - * - * @param string $username - * @param string $repository - * @param int $runId - * - * @return array|string - * - * @experimental This endpoint is currently in beta. - */ - public function approve(string $username, string $repository, int $runId) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/runs/'.$runId.'/approve'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php deleted file mode 100644 index e425f9d2..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Actions/Workflows.php +++ /dev/null @@ -1,82 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows', $parameters); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-a-workflow - * - * @param string $username - * @param string $repository - * @param string|int $workflow - * - * @return array - */ - public function show(string $username, string $repository, $workflow) - { - if (is_string($workflow)) { - $workflow = rawurlencode($workflow); - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.$workflow); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#get-workflow-usage - * - * @param string $username - * @param string $repository - * @param string|int $workflow - * - * @return array|string - */ - public function usage(string $username, string $repository, $workflow) - { - if (is_string($workflow)) { - $workflow = rawurlencode($workflow); - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.$workflow.'/timing'); - } - - /** - * @link https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event - * - * @param string $username - * @param string $repository - * @param string|int $workflow - * @param string $ref - * @param array $inputs - * - * @return array|string empty - */ - public function dispatches(string $username, string $repository, $workflow, string $ref, array $inputs = null) - { - if (is_string($workflow)) { - $workflow = rawurlencode($workflow); - } - $parameters = array_filter(['ref' => $ref, 'inputs' => $inputs]); - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/actions/workflows/'.$workflow.'/dispatches', $parameters); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php deleted file mode 100644 index 043016e7..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Assets.php +++ /dev/null @@ -1,123 +0,0 @@ - - */ -class Assets extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Get all release's assets in selected repository - * GET /repos/:owner/:repo/releases/:id/assets. - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the release - * - * @return array - */ - public function all($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id.'/assets'); - } - - /** - * Get an asset in selected repository's release - * GET /repos/:owner/:repo/releases/assets/:id. - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the asset - * - * @return array|string - */ - public function show($username, $repository, $id, bool $returnBinaryContent = false) - { - if ($returnBinaryContent) { - $this->acceptHeaderValue = 'application/octet-stream'; - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id); - } - - /** - * Create an asset for selected repository's release - * POST /repos/:owner/:repo/releases/:id/assets?name=:filename. - * - * Creating an asset requires support for server name indentification (SNI) - * so this must be supported by your PHP version. - * - * @see http://developer.github.com/v3/repos/releases/#upload-a-release-asset - * @see http://php.net/manual/en/openssl.constsni.php - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the release - * @param string $name the filename for the asset - * @param string $contentType the content type for the asset - * @param string $content the content of the asset - * - * @throws MissingArgumentException - * @throws ErrorException - * - * @return array - */ - public function create($username, $repository, $id, $name, $contentType, $content) - { - if (!defined('OPENSSL_TLSEXT_SERVER_NAME') || OPENSSL_TLSEXT_SERVER_NAME == 0) { - throw new ErrorException('Asset upload support requires Server Name Indication. This is not supported by your PHP version. See https://www.php.net/manual/en/openssl.constsni.php.'); - } - - // Asset creation requires a separate endpoint, uploads.github.com. - // Change the base url for the HTTP client temporarily while we execute - // this request. - return $this->postRaw('https://uploads.github.com/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id.'/assets?name='.$name, $content, ['Content-Type' => $contentType]); - } - - /** - * Edit an asset in selected repository's release - * PATCH /repos/:owner/:repo/releases/assets/:id. - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the asset - * @param array $params request parameters - * - * @throws MissingArgumentException - * - * @return array - */ - public function edit($username, $repository, $id, array $params) - { - if (!isset($params['name'])) { - throw new MissingArgumentException('name'); - } - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id, $params); - } - - /** - * Delete an asset in selected repository's release - * DELETE /repos/:owner/:repo/releases/assets/:id. - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the asset - * - * @return array - */ - public function remove($username, $repository, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/assets/'.$id); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php deleted file mode 100644 index 37968a01..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckRuns.php +++ /dev/null @@ -1,86 +0,0 @@ -acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs', $params); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#get-a-check-run - * - * @return array - */ - public function show(string $username, string $repository, int $checkRunId) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#update-a-check-run - * - * @return array - */ - public function update(string $username, string $repository, int $checkRunId, array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId, $params); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-run-annotations - * - * @return array - */ - public function annotations(string $username, string $repository, int $checkRunId) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId.'/annotations'); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-runs-in-a-check-suite - * - * @return array - */ - public function allForCheckSuite(string $username, string $repository, int $checkSuiteId, array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/check-runs', $params); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-runs-for-a-git-reference - * - * @return array - */ - public function allForReference(string $username, string $repository, string $ref, array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-runs', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php deleted file mode 100644 index 40c83a56..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Checks/CheckSuites.php +++ /dev/null @@ -1,74 +0,0 @@ -acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites', $params); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#update-repository-preferences-for-check-suites - * - * @return array - */ - public function updatePreferences(string $username, string $repository, array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/preferences', $params); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#get-a-check-suite - * - * @return array - */ - public function getCheckSuite(string $username, string $repository, int $checkSuiteId) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#rerequest-a-check-suite - * - * @return array - */ - public function rerequest(string $username, string $repository, int $checkSuiteId) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/rerequest'); - } - - /** - * @link https://docs.github.com/en/rest/reference/checks#list-check-suites-for-a-git-reference - * - * @return array - */ - public function allForReference(string $username, string $repository, string $ref, array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-suites', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php deleted file mode 100644 index 5c61b9bf..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Collaborators.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ -class Collaborators extends AbstractApi -{ - /** - * @link https://developer.github.com/v3/repos/collaborators/#list-collaborators - * - * @param string $username - * @param string $repository - * @param array $params - * - * @return array|string - */ - public function all($username, $repository, array $params = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators', $params); - } - - /** - * @link https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator - * - * @param string $username - * @param string $repository - * @param string $collaborator - * - * @return array|string - */ - public function check($username, $repository, $collaborator) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator)); - } - - /** - * @link https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator - * - * @param string $username - * @param string $repository - * @param string $collaborator - * @param array $params - * - * @return array|string - */ - public function add($username, $repository, $collaborator, array $params = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator), $params); - } - - /** - * @link https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator - * - * @param string $username - * @param string $repository - * @param string $collaborator - * - * @return array|string - */ - public function remove($username, $repository, $collaborator) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator)); - } - - /** - * @link https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level - * - * @param string $username - * @param string $repository - * @param string $collaborator - * - * @return array|string - */ - public function permission($username, $repository, $collaborator) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/collaborators/'.rawurlencode($collaborator).'/permission'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php deleted file mode 100644 index 40eb2b53..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Comments.php +++ /dev/null @@ -1,75 +0,0 @@ - - * @author Tobias Nyholm - */ -class Comments extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/repos/comments/#custom-media-types - * - * @param string|null $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if (!in_array($bodyType, ['raw', 'text', 'html'])) { - $bodyType = 'full'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s+json', $this->getApiVersion(), $bodyType); - - return $this; - } - - public function all($username, $repository, $sha = null) - { - if (null === $sha) { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments'); - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments'); - } - - public function show($username, $repository, $comment) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment)); - } - - public function create($username, $repository, $sha, array $params) - { - if (!isset($params['body'])) { - throw new MissingArgumentException('body'); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/comments', $params); - } - - public function update($username, $repository, $comment, array $params) - { - if (!isset($params['body'])) { - throw new MissingArgumentException('body'); - } - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment), $params); - } - - public function remove($username, $repository, $comment) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/comments/'.rawurlencode($comment)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php deleted file mode 100644 index 8195e4ba..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Commits.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -class Commits extends AbstractApi -{ - public function all($username, $repository, array $params) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits', $params); - } - - public function compare($username, $repository, $base, $head, $mediaType = null) - { - $headers = []; - if (null !== $mediaType) { - $headers['Accept'] = $mediaType; - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/compare/'.rawurlencode($base).'...'.rawurlencode($head), [], $headers); - } - - public function show($username, $repository, $sha) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php deleted file mode 100644 index bc78503b..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Contents.php +++ /dev/null @@ -1,297 +0,0 @@ - - */ -class Contents extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @link https://developer.github.com/v3/repo/contents/#custom-media-types - * - * @param string|null $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if (!in_array($bodyType, ['html', 'object'])) { - $bodyType = 'raw'; - } - - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.%s', $this->getApiVersion(), $bodyType); - - return $this; - } - - /** - * Get content of README file in a repository. - * - * @link http://developer.github.com/v3/repos/contents/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string|null $reference reference to a branch or commit - * - * @return array information for README file - */ - public function readme($username, $repository, $reference = null) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme', [ - 'ref' => $reference, - ]); - } - - /** - * Get contents of any file or directory in a repository. - * - * @link http://developer.github.com/v3/repos/contents/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string|null $path path to file or directory - * @param string|null $reference reference to a branch or commit - * - * @return array|string information for file | information for each item in directory - */ - public function show($username, $repository, $path = null, $reference = null) - { - $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; - if (null !== $path) { - $url .= '/'.rawurlencode($path); - } - - return $this->get($url, [ - 'ref' => $reference, - ]); - } - - /** - * Creates a new file in a repository. - * - * @link http://developer.github.com/v3/repos/contents/#create-a-file - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $path path to file - * @param string $content contents of the new file - * @param string $message the commit message - * @param string|null $branch name of a branch - * @param null|array $committer information about the committer - * - * @throws MissingArgumentException - * - * @return array information about the new file - */ - public function create($username, $repository, $path, $content, $message, $branch = null, array $committer = null) - { - $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path); - - $parameters = [ - 'content' => base64_encode($content), - 'message' => $message, - ]; - - if (null !== $branch) { - $parameters['branch'] = $branch; - } - - if (null !== $committer) { - if (!isset($committer['name'], $committer['email'])) { - throw new MissingArgumentException(['name', 'email']); - } - $parameters['committer'] = $committer; - } - - return $this->put($url, $parameters); - } - - /** - * Checks that a given path exists in a repository. - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $path path of file to check - * @param string|null $reference reference to a branch or commit - * - * @return bool - */ - public function exists($username, $repository, $path, $reference = null) - { - $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; - - if (null !== $path) { - $url .= '/'.rawurlencode($path); - } - - try { - $response = $this->head($url, [ - 'ref' => $reference, - ]); - - if ($response->getStatusCode() !== 200) { - return false; - } - } catch (TwoFactorAuthenticationRequiredException $ex) { - throw $ex; - } catch (\Exception $ex) { - return false; - } - - return true; - } - - /** - * Updates the contents of a file in a repository. - * - * @link http://developer.github.com/v3/repos/contents/#update-a-file - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $path path to file - * @param string $content contents of the new file - * @param string $message the commit message - * @param string $sha blob SHA of the file being replaced - * @param string|null $branch name of a branch - * @param null|array $committer information about the committer - * - * @throws MissingArgumentException - * - * @return array information about the updated file - */ - public function update($username, $repository, $path, $content, $message, $sha, $branch = null, array $committer = null) - { - $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path); - - $parameters = [ - 'content' => base64_encode($content), - 'message' => $message, - 'sha' => $sha, - ]; - - if (null !== $branch) { - $parameters['branch'] = $branch; - } - - if (null !== $committer) { - if (!isset($committer['name'], $committer['email'])) { - throw new MissingArgumentException(['name', 'email']); - } - $parameters['committer'] = $committer; - } - - return $this->put($url, $parameters); - } - - /** - * Deletes a file from a repository. - * - * @link http://developer.github.com/v3/repos/contents/#delete-a-file - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $path path to file - * @param string $message the commit message - * @param string $sha blob SHA of the file being deleted - * @param string|null $branch name of a branch - * @param null|array $committer information about the committer - * - * @throws MissingArgumentException - * - * @return array information about the updated file - */ - public function rm($username, $repository, $path, $message, $sha, $branch = null, array $committer = null) - { - $url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents/'.rawurlencode($path); - - $parameters = [ - 'message' => $message, - 'sha' => $sha, - ]; - - if (null !== $branch) { - $parameters['branch'] = $branch; - } - - if (null !== $committer) { - if (!isset($committer['name'], $committer['email'])) { - throw new MissingArgumentException(['name', 'email']); - } - $parameters['committer'] = $committer; - } - - return $this->delete($url, $parameters); - } - - /** - * Get content of archives in a repository. - * - * @link http://developer.github.com/v3/repos/contents/ - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $format format of archive: tarball or zipball - * @param string|null $reference reference to a branch or commit - * - * @return string repository archive binary data - */ - public function archive($username, $repository, $format, $reference = null) - { - if (!in_array($format, ['tarball', 'zipball'])) { - $format = 'tarball'; - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/'.rawurlencode($format). - ((null !== $reference) ? ('/'.rawurlencode($reference)) : '')); - } - - /** - * Get the contents of a file in a repository. - * - * @param string $username the user who owns the repository - * @param string $repository the name of the repository - * @param string $path path to file - * @param string|null $reference reference to a branch or commit - * - * @throws InvalidArgumentException If $path is not a file or if its encoding is different from base64 - * @throws ErrorException If $path doesn't include a 'content' index - * - * @return string|null content of file, or null in case of base64_decode failure - */ - public function download($username, $repository, $path, $reference = null) - { - $file = $this->show($username, $repository, $path, $reference); - - if (!isset($file['type']) || !in_array($file['type'], ['file', 'symlink'], true)) { - throw new InvalidArgumentException(sprintf('Path "%s" is not a file or a symlink to a file.', $path)); - } - - if (!isset($file['content'])) { - throw new ErrorException(sprintf('Unable to access "content" for file "%s" (possible keys: "%s").', $path, implode(', ', array_keys($file)))); - } - - if (!isset($file['encoding'])) { - throw new InvalidArgumentException(sprintf('Can\'t decode content of file "%s", as no encoding is defined.', $path)); - } - - if ('base64' !== $file['encoding']) { - throw new InvalidArgumentException(sprintf('Encoding "%s" of file "%s" is not supported.', $file['encoding'], $path)); - } - - return base64_decode($file['content']) ?: null; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php deleted file mode 100644 index 0e45ccb6..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/DeployKeys.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -class DeployKeys extends AbstractApi -{ - public function all($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys'); - } - - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys/'.rawurlencode($id)); - } - - public function create($username, $repository, array $params) - { - if (!isset($params['title'], $params['key'])) { - throw new MissingArgumentException(['title', 'key']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys', $params); - } - - public function update($username, $repository, $id, array $params) - { - if (!isset($params['title'], $params['key'])) { - throw new MissingArgumentException(['title', 'key']); - } - - $this->remove($username, $repository, $id); - - return $this->create($username, $repository, $params); - } - - public function remove($username, $repository, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/keys/'.rawurlencode($id)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php deleted file mode 100644 index c959c615..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Downloads.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ -class Downloads extends AbstractApi -{ - /** - * List downloads in selected repository. - * - * @link http://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * - * @return array - */ - public function all($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads'); - } - - /** - * Get a download in selected repository. - * - * @link http://developer.github.com/v3/repos/downloads/#get-a-single-download - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the download file - * - * @return array - */ - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.$id); - } - - /** - * Delete a download in selected repository. - * - * @link http://developer.github.com/v3/repos/downloads/#delete-a-download - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the download file - * - * @return array - */ - public function remove($username, $repository, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/downloads/'.$id); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php deleted file mode 100644 index 961dc649..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Forks.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class Forks extends AbstractApi -{ - public function all($username, $repository, array $params = []) - { - if (isset($params['sort']) && !in_array($params['sort'], ['newest', 'oldest', 'watchers'])) { - $params['sort'] = 'newest'; - } - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/forks', array_merge(['page' => 1], $params)); - } - - public function create($username, $repository, array $params = []) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/forks', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php deleted file mode 100644 index be87e014..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Hooks.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -class Hooks extends AbstractApi -{ - public function all($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks'); - } - - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id)); - } - - public function create($username, $repository, array $params) - { - if (!isset($params['name'], $params['config'])) { - throw new MissingArgumentException(['name', 'config']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks', $params); - } - - public function update($username, $repository, $id, array $params) - { - if (!isset($params['config'])) { - throw new MissingArgumentException(['config']); - } - - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id), $params); - } - - public function ping($username, $repository, $id) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/pings'); - } - - public function test($username, $repository, $id) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/tests'); - } - - public function remove($username, $repository, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php deleted file mode 100644 index 28ca4d53..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Labels.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -class Labels extends AbstractApi -{ - public function all($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels'); - } - - public function show($username, $repository, $label) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); - } - - public function create($username, $repository, array $params) - { - if (!isset($params['name'], $params['color'])) { - throw new MissingArgumentException(['name', 'color']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels', $params); - } - - public function update($username, $repository, $label, array $params) - { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label), $params); - } - - public function remove($username, $repository, $label) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php deleted file mode 100644 index b641cb95..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Pages.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ -class Pages extends AbstractApi -{ - use AcceptHeaderTrait; - - public function show($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages'); - } - - public function enable($username, $repository, array $params = []) - { - $this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json'; - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params); - } - - public function disable($username, $repository) - { - $this->acceptHeaderValue = 'application/vnd.github.switcheroo-preview+json'; - - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages'); - } - - public function update($username, $repository, array $params = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages', $params); - } - - public function requestBuild($username, $repository) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds'); - } - - public function builds($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds'); - } - - public function showLatestBuild($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/latest'); - } - - public function showBuild($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pages/builds/'.rawurlencode($id)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php deleted file mode 100644 index 9db29f55..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Projects.php +++ /dev/null @@ -1,23 +0,0 @@ -get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/projects', array_merge(['page' => 1], $params)); - } - - public function create($username, $repository, array $params) - { - if (!isset($params['name'])) { - throw new MissingArgumentException(['name']); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/projects', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php deleted file mode 100644 index b559557a..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Protection.php +++ /dev/null @@ -1,440 +0,0 @@ - - */ -class Protection extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Retrieves configured protection for the provided branch. - * - * @link https://developer.github.com/v3/repos/branches/#get-branch-protection - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The branch protection information - */ - public function show($username, $repository, $branch) - { - // Preview endpoint - $this->acceptHeaderValue = 'application/vnd.github.luke-cage-preview+json'; - - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection'); - } - - /** - * Updates the repo's branch protection. - * - * @link https://developer.github.com/v3/repos/branches/#update-branch-protection - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The branch protection information - * - * @return array The updated branch protection information - */ - public function update($username, $repository, $branch, array $params = []) - { - // Preview endpoint - $this->acceptHeaderValue = 'application/vnd.github.luke-cage-preview+json'; - - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection', $params); - } - - /** - * Remove the repo's branch protection. - * - * @link https://developer.github.com/v3/repos/branches/#remove-branch-protection - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - */ - public function remove($username, $repository, $branch) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection'); - } - - /** - * Get required status checks of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#get-required-status-checks-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The required status checks information - */ - public function showStatusChecks($username, $repository, $branch) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks'); - } - - /** - * Update required status checks of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#update-required-status-checks-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The branch status checks information - * - * @return array The updated branch status checks information - */ - public function updateStatusChecks($username, $repository, $branch, array $params = []) - { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks', $params); - } - - /** - * Remove required status checks of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#remove-required-status-checks-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - */ - public function removeStatusChecks($username, $repository, $branch) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks'); - } - - /** - * List required status checks contexts of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The required status checks contexts information - */ - public function showStatusChecksContexts($username, $repository, $branch) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts'); - } - - /** - * Replace required status checks contexts of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#replace-required-status-checks-contexts-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The branch status checks contexts information - * - * @return array The new branch status checks contexts information - */ - public function replaceStatusChecksContexts($username, $repository, $branch, array $params = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts', $params); - } - - /** - * Add required status checks contexts of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#add-required-status-checks-contexts-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The branch status checks contexts information - * - * @return array The updated branch status checks contexts information - */ - public function addStatusChecksContexts($username, $repository, $branch, array $params = []) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts', $params); - } - - /** - * Remove required status checks contexts of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#remove-required-status-checks-contexts-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The branch status checks contexts information - * - * @return array The updated branch status checks contexts information - */ - public function removeStatusChecksContexts($username, $repository, $branch, array $params = []) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_status_checks/contexts', $params); - } - - /** - * Get pull request review enforcement of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#get-pull-request-review-enforcement-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The pull request review enforcement information - */ - public function showPullRequestReviewEnforcement($username, $repository, $branch) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_pull_request_reviews'); - } - - /** - * Update pull request review enforcement of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#update-pull-request-review-enforcement-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The branch status checks information - * - * @return array The updated branch status checks information - */ - public function updatePullRequestReviewEnforcement($username, $repository, $branch, array $params = []) - { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_pull_request_reviews', $params); - } - - /** - * Remove pull request review enforcement of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#remove-pull-request-review-enforcement-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - */ - public function removePullRequestReviewEnforcement($username, $repository, $branch) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/required_pull_request_reviews'); - } - - /** - * Get admin enforcement of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#get-admin-enforcement-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The admin enforcement information - */ - public function showAdminEnforcement($username, $repository, $branch) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/enforce_admins'); - } - - /** - * Add admin enforcement of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#add-admin-enforcement-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The updated admin enforcement information - */ - public function addAdminEnforcement($username, $repository, $branch) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/enforce_admins'); - } - - /** - * Remove admin enforcement of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#remove-admin-enforcement-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - */ - public function removeAdminEnforcement($username, $repository, $branch) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/enforce_admins'); - } - - /** - * Get restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#get-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The branch restrictions information - */ - public function showRestrictions($username, $repository, $branch) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions'); - } - - /** - * Remove restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#remove-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - */ - public function removeRestrictions($username, $repository, $branch) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions'); - } - - /** - * List team restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#list-team-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The branch team restrictions information - */ - public function showTeamRestrictions($username, $repository, $branch) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams'); - } - - /** - * Replace team restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#replace-team-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The list of team slugs with push access - * - * @return array The new branch team restrictions information - */ - public function replaceTeamRestrictions($username, $repository, $branch, array $params = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams', $params); - } - - /** - * Add team restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#add-team-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The list of team slugs with push access - * - * @return array The branch team restrictions information - */ - public function addTeamRestrictions($username, $repository, $branch, array $params = []) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams', $params); - } - - /** - * Remove team restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#remove-team-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The list of team slugs with push access - * - * @return array The updated branch team restrictions information - */ - public function removeTeamRestrictions($username, $repository, $branch, array $params = []) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/teams', $params); - } - - /** - * List user restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#list-user-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * - * @return array The branch user restrictions information - */ - public function showUserRestrictions($username, $repository, $branch) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users'); - } - - /** - * Replace user restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#replace-user-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The list of user logins with push access - * - * @return array The new branch user restrictions information - */ - public function replaceUserRestrictions($username, $repository, $branch, array $params = []) - { - return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users', $params); - } - - /** - * Add user restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#add-user-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The list of user logins with push access - * - * @return array The branch user restrictions information - */ - public function addUserRestrictions($username, $repository, $branch, array $params = []) - { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users', $params); - } - - /** - * Remove user restrictions of protected branch. - * - * @link https://developer.github.com/v3/repos/branches/#remove-user-restrictions-of-protected-branch - * - * @param string $username The user who owns the repository - * @param string $repository The name of the repo - * @param string $branch The name of the branch - * @param array $params The list of user logins with push access - * - * @return array The updated branch user restrictions information - */ - public function removeUserRestrictions($username, $repository, $branch, array $params = []) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection/restrictions/users', $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php deleted file mode 100644 index 10dfe09d..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Releases.php +++ /dev/null @@ -1,127 +0,0 @@ - - * @author Evgeniy Guseletov - */ -class Releases extends AbstractApi -{ - /** - * Get the latest release. - * - * @param string $username - * @param string $repository - * - * @return array - */ - public function latest($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/latest'); - } - - /** - * List releases for a tag. - * - * @param string $username - * @param string $repository - * @param string $tag - * - * @return array - */ - public function tag($username, $repository, $tag) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/tags/'.rawurlencode($tag)); - } - - /** - * List releases in selected repository. - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param array $params the additional parameters like milestone, assignees, labels, sort, direction - * - * @return array - */ - public function all($username, $repository, array $params = []) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases', $params); - } - - /** - * Get a release in selected repository. - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the release - * - * @return array - */ - public function show($username, $repository, $id) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id); - } - - /** - * Create new release in selected repository. - * - * @param string $username - * @param string $repository - * @param array $params - * - * @throws MissingArgumentException - * - * @return array - */ - public function create($username, $repository, array $params) - { - if (!isset($params['tag_name'])) { - throw new MissingArgumentException('tag_name'); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases', $params); - } - - /** - * Edit release in selected repository. - * - * @param string $username - * @param string $repository - * @param int $id - * @param array $params - * - * @return array - */ - public function edit($username, $repository, $id, array $params) - { - return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id, $params); - } - - /** - * Delete a release in selected repository (Not thoroughly tested!). - * - * @param string $username the user who owns the repo - * @param string $repository the name of the repo - * @param int $id the id of the release - * - * @return array - */ - public function remove($username, $repository, $id) - { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/releases/'.$id); - } - - /** - * @return Assets - */ - public function assets() - { - return new Assets($this->getClient()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php deleted file mode 100644 index bef73b9a..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Stargazers.php +++ /dev/null @@ -1,40 +0,0 @@ - - * @author Tobias Nyholm - */ -class Stargazers extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Configure the body type. - * - * @see https://developer.github.com/v3/activity/starring/#alternative-response-with-star-creation-timestamps - * - * @param string $bodyType - * - * @return $this - */ - public function configure($bodyType = null) - { - if ('star' === $bodyType) { - $this->acceptHeaderValue = sprintf('application/vnd.github.%s.star+json', $this->getApiVersion()); - } - - return $this; - } - - public function all($username, $repository) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/stargazers'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php deleted file mode 100644 index c62f4edd..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Statuses.php +++ /dev/null @@ -1,63 +0,0 @@ - - */ -class Statuses extends AbstractApi -{ - /** - * @link http://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-sha - * - * @param string $username - * @param string $repository - * @param string $sha - * - * @return array - */ - public function show($username, $repository, $sha) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/statuses'); - } - - /** - * @link https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref - * - * @param string $username - * @param string $repository - * @param string $sha - * - * @return array - */ - public function combined($username, $repository, $sha) - { - return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/status'); - } - - /** - * @link http://developer.github.com/v3/repos/statuses/#create-a-status - * - * @param string $username - * @param string $repository - * @param string $sha - * @param array $params - * - * @throws MissingArgumentException - * - * @return array - */ - public function create($username, $repository, $sha, array $params = []) - { - if (!isset($params['state'])) { - throw new MissingArgumentException('state'); - } - - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/statuses/'.rawurlencode($sha), $params); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php b/vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php deleted file mode 100644 index d5b550c8..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Repository/Traffic.php +++ /dev/null @@ -1,67 +0,0 @@ - - */ -class Traffic extends AbstractApi -{ - /** - * @link https://developer.github.com/v3/repos/traffic/#list-referrers - * - * @param string $owner - * @param string $repository - * - * @return array - */ - public function referers($owner, $repository) - { - return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/popular/referrers'); - } - - /** - * @link https://developer.github.com/v3/repos/traffic/#list-paths - * - * @param string $owner - * @param string $repository - * - * @return array - */ - public function paths($owner, $repository) - { - return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/popular/paths'); - } - - /** - * @link https://developer.github.com/v3/repos/traffic/#views - * - * @param string $owner - * @param string $repository - * @param string $per - * - * @return array - */ - public function views($owner, $repository, $per = 'day') - { - return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/views?per='.rawurlencode($per)); - } - - /** - * @link https://developer.github.com/v3/repos/traffic/#clones - * - * @param string $owner - * @param string $repository - * @param string $per - * - * @return array - */ - public function clones($owner, $repository, $per = 'day') - { - return $this->get('/repos/'.rawurlencode($owner).'/'.rawurlencode($repository).'/traffic/clones?per='.rawurlencode($per)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/Search.php b/vendor/knplabs/github-api/lib/Github/Api/Search.php deleted file mode 100644 index 96a51ea6..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/Search.php +++ /dev/null @@ -1,130 +0,0 @@ - - */ -class Search extends AbstractApi -{ - use AcceptHeaderTrait; - - /** - * Search repositories by filter (q). - * - * @link https://developer.github.com/v3/search/#search-repositories - * - * @param string $q the filter - * @param string $sort the sort field - * @param string $order asc/desc - * - * @return array list of repositories found - */ - public function repositories($q, $sort = 'updated', $order = 'desc') - { - return $this->get('/search/repositories', ['q' => $q, 'sort' => $sort, 'order' => $order]); - } - - /** - * Search issues by filter (q). - * - * @link https://developer.github.com/v3/search/#search-issues - * - * @param string $q the filter - * @param string $sort the sort field - * @param string $order asc/desc - * - * @return array list of issues found - */ - public function issues($q, $sort = 'updated', $order = 'desc') - { - return $this->get('/search/issues', ['q' => $q, 'sort' => $sort, 'order' => $order]); - } - - /** - * Search code by filter (q). - * - * @link https://developer.github.com/v3/search/#search-code - * - * @param string $q the filter - * @param string $sort the sort field - * @param string $order asc/desc - * - * @return array list of code found - */ - public function code($q, $sort = 'updated', $order = 'desc') - { - return $this->get('/search/code', ['q' => $q, 'sort' => $sort, 'order' => $order]); - } - - /** - * Search code by filter (q), but will return additional data to highlight - * the matched results. - * - * @link https://docs.github.com/en/rest/reference/search#text-match-metadata - * - * @return array list of code found - */ - public function codeWithMatch(string $q, string $sort = 'updated', string $order = 'desc'): array - { - $this->acceptHeaderValue = 'application/vnd.github.v3.text-match+json'; - - return $this->code($q, $sort, $order); - } - - /** - * Search users by filter (q). - * - * @link https://developer.github.com/v3/search/#search-users - * - * @param string $q the filter - * @param string $sort the sort field - * @param string $order asc/desc - * - * @return array list of users found - */ - public function users($q, $sort = 'updated', $order = 'desc') - { - return $this->get('/search/users', ['q' => $q, 'sort' => $sort, 'order' => $order]); - } - - /** - * Search commits by filter (q). - * - * @link https://developer.github.com/v3/search/#search-commits - * - * @param string $q the filter - * @param string $sort the sort field - * @param string $order sort order. asc/desc - * - * @return array - */ - public function commits($q, $sort = null, $order = 'desc') - { - // This api is in preview mode, so set the correct accept-header - $this->acceptHeaderValue = 'application/vnd.github.cloak-preview'; - - return $this->get('/search/commits', ['q' => $q, 'sort' => $sort, 'order' => $order]); - } - - /** - * Search topics by filter (q). - * - * @link https://developer.github.com/v3/search/#search-topics - * - * @param string $q the filter - * - * @return array - */ - public function topics($q) - { - // This api is in preview mode, so set the correct accept-header - $this->acceptHeaderValue = 'application/vnd.github.mercy-preview+json'; - - return $this->get('/search/topics', ['q' => $q]); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Api/User.php b/vendor/knplabs/github-api/lib/Github/Api/User.php deleted file mode 100644 index c1ccc89e..00000000 --- a/vendor/knplabs/github-api/lib/Github/Api/User.php +++ /dev/null @@ -1,249 +0,0 @@ - - * @author Thibault Duplessis - */ -class User extends AbstractApi -{ - /** - * Request all users. - * - * @link https://developer.github.com/v3/users/#get-all-users - * - * @param int|null $id ID of the last user that you've seen - * - * @return array list of users found - */ - public function all($id = null) - { - if (!is_int($id)) { - return $this->get('/users'); - } - - return $this->get('/users', ['since' => $id]); - } - - /** - * Get extended information about a user by its username. - * - * @link http://developer.github.com/v3/users/ - * - * @param string $username the username to show - * - * @return array information about the user - */ - public function show($username) - { - return $this->get('/users/'.rawurlencode($username)); - } - - /** - * Get extended information about a user by its id. - * Note: at time of writing this is an undocumented feature but GitHub support have advised that it can be relied on. - * - * @link http://developer.github.com/v3/users/ - * - * @param int $id the id of the user to show - * - * @return array information about the user - */ - public function showById($id) - { - return $this->get('/user/'.$id); - } - - /** - * Get extended information about a user by its username. - * - * @link https://developer.github.com/v3/orgs/ - * - * @param string $username the username to show - * - * @return array information about organizations that user belongs to - */ - public function organizations($username) - { - return $this->get('/users/'.rawurlencode($username).'/orgs'); - } - - /** - * Get user organizations. - * - * @link https://developer.github.com/v3/orgs/#list-your-organizations - * - * @return array information about organizations that authenticated user belongs to - */ - public function orgs() - { - return $this->get('/user/orgs'); - } - - /** - * Request the users that a specific user is following. - * - * @link http://developer.github.com/v3/users/followers/ - * - * @param string $username the username - * @param array $parameters parameters for the query string - * @param array $requestHeaders additional headers to set in the request - * - * @return array list of followed users - */ - public function following($username, array $parameters = [], array $requestHeaders = []) - { - return $this->get('/users/'.rawurlencode($username).'/following', $parameters, $requestHeaders); - } - - /** - * Request the users following a specific user. - * - * @link http://developer.github.com/v3/users/followers/ - * - * @param string $username the username - * @param array $parameters parameters for the query string - * @param array $requestHeaders additional headers to set in the request - * - * @return array list of following users - */ - public function followers($username, array $parameters = [], array $requestHeaders = []) - { - return $this->get('/users/'.rawurlencode($username).'/followers', $parameters, $requestHeaders); - } - - /** - * Request starred repositories that a specific user has starred. - * - * @link http://developer.github.com/v3/activity/starring/ - * - * @param string $username the username - * @param int $page the page number of the paginated result set - * @param int $perPage the number of results per page - * @param string $sort sort by (possible values: created, updated) - * @param string $direction direction of sort (possible values: asc, desc) - * - * @return array list of starred repositories - */ - public function starred($username, $page = 1, $perPage = 30, $sort = 'created', $direction = 'desc') - { - return $this->get('/users/'.rawurlencode($username).'/starred', [ - 'page' => $page, - 'per_page' => $perPage, - 'sort' => $sort, - 'direction' => $direction, - ]); - } - - /** - * Request the repository that a specific user is watching. - * - * @link http://developer.github.com/v3/activity/watching/ - * - * @param string $username the username - * - * @return array list of watched repositories - */ - public function subscriptions($username) - { - return $this->get('/users/'.rawurlencode($username).'/subscriptions'); - } - - /** - * List public repositories for the specified user. - * - * @link https://developer.github.com/v3/repos/#list-user-repositories - * - * @param string $username the username - * @param string $type role in the repository - * @param string $sort sort by - * @param string $direction direction of sort, asc or desc - * @param string $visibility visibility of repository - * @param string $affiliation relationship to repository - * - * @return array list of the user repositories - */ - public function repositories($username, $type = 'owner', $sort = 'full_name', $direction = 'asc', $visibility = 'all', $affiliation = 'owner,collaborator,organization_member') - { - return $this->get('/users/'.rawurlencode($username).'/repos', [ - 'type' => $type, - 'sort' => $sort, - 'direction' => $direction, - 'visibility' => $visibility, - 'affiliation' => $affiliation, - ]); - } - - /** - * List repositories that are accessible to the authenticated user. - * - * @link https://developer.github.com/v3/repos/#list-your-repositories - * - * @param array $params visibility, affiliation, type, sort, direction - * - * @return array list of the user repositories - */ - public function myRepositories(array $params = []) - { - return $this->get('/user/repos', $params); - } - - /** - * Get the public gists for a user. - * - * @link http://developer.github.com/v3/gists/ - * - * @param string $username the username - * - * @return array list of the user gists - */ - public function gists($username) - { - return $this->get('/users/'.rawurlencode($username).'/gists'); - } - - /** - * Get the public keys for a user. - * - * @link http://developer.github.com/v3/users/keys/#list-public-keys-for-a-user - * - * @param string $username the username - * - * @return array list of the user public keys - */ - public function keys($username) - { - return $this->get('/users/'.rawurlencode($username).'/keys'); - } - - /** - * List events performed by a user. - * - * @link http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user - * - * @param string $username - * - * @return array - */ - public function publicEvents($username) - { - return $this->get('/users/'.rawurlencode($username).'/events/public'); - } - - /** - * List events performed by an authenticated user. - * - * @link https://docs.github.com/en/rest/reference/activity#list-events-for-the-authenticated-user - * - * @return array - */ - public function events(string $username) - { - return $this->get('/users/'.rawurlencode($username).'/events'); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/AuthMethod.php b/vendor/knplabs/github-api/lib/Github/AuthMethod.php deleted file mode 100644 index 4a390699..00000000 --- a/vendor/knplabs/github-api/lib/Github/AuthMethod.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * Website: http://github.com/KnpLabs/php-github-api - */ -class Client -{ - /** - * Authenticate using a client_id/client_secret combination. - * - * @var string - * - * @deprecated Use the AuthMethod const - */ - const AUTH_CLIENT_ID = AuthMethod::CLIENT_ID; - - /** - * Authenticate using a GitHub access token. - * - * @var string - * - * @deprecated Use the AuthMethod const - */ - const AUTH_ACCESS_TOKEN = AuthMethod::ACCESS_TOKEN; - - /** - * Constant for authentication method. - * - * Indicates JSON Web Token authentication required for GitHub apps access - * to the API. - * - * @var string - * - * @deprecated Use the AuthMethod const - */ - const AUTH_JWT = AuthMethod::JWT; - - /** - * @var string - */ - private $apiVersion; - - /** - * @var Builder - */ - private $httpClientBuilder; - - /** - * @var History - */ - private $responseHistory; - - /** - * Instantiate a new GitHub client. - * - * @param Builder|null $httpClientBuilder - * @param string|null $apiVersion - * @param string|null $enterpriseUrl - */ - public function __construct(Builder $httpClientBuilder = null, $apiVersion = null, $enterpriseUrl = null) - { - $this->responseHistory = new History(); - $this->httpClientBuilder = $builder = $httpClientBuilder ?? new Builder(); - $this->apiVersion = $apiVersion ?: 'v3'; - - $builder->addPlugin(new GithubExceptionThrower()); - $builder->addPlugin(new Plugin\HistoryPlugin($this->responseHistory)); - $builder->addPlugin(new Plugin\RedirectPlugin()); - $builder->addPlugin(new Plugin\AddHostPlugin(Psr17FactoryDiscovery::findUriFactory()->createUri('https://api.github.com'))); - $builder->addPlugin(new Plugin\HeaderDefaultsPlugin([ - 'User-Agent' => 'php-github-api (http://github.com/KnpLabs/php-github-api)', - 'Accept' => sprintf('application/vnd.github.%s+json', $this->apiVersion), - ])); - - if ($enterpriseUrl) { - $this->setEnterpriseUrl($enterpriseUrl); - } - } - - /** - * Create a Github\Client using a HTTP client. - * - * @param ClientInterface $httpClient - * - * @return Client - */ - public static function createWithHttpClient(ClientInterface $httpClient): self - { - $builder = new Builder($httpClient); - - return new self($builder); - } - - /** - * @param string $name - * - * @throws InvalidArgumentException - * - * @return AbstractApi - */ - public function api($name): AbstractApi - { - switch ($name) { - case 'me': - case 'current_user': - case 'currentUser': - $api = new Api\CurrentUser($this); - break; - case 'codeOfConduct': - $api = new Api\Miscellaneous\CodeOfConduct($this); - break; - - case 'deployment': - case 'deployments': - $api = new Api\Deployment($this); - break; - - case 'ent': - case 'enterprise': - $api = new Api\Enterprise($this); - break; - - case 'emojis': - $api = new Api\Miscellaneous\Emojis($this); - break; - - case 'git': - case 'git_data': - case 'gitData': - $api = new Api\GitData($this); - break; - - case 'gist': - case 'gists': - $api = new Api\Gists($this); - break; - - case 'gitignore': - $api = new Api\Miscellaneous\Gitignore($this); - break; - - case 'apps': - $api = new Api\Apps($this); - break; - - case 'issue': - case 'issues': - $api = new Api\Issue($this); - break; - - case 'markdown': - $api = new Api\Markdown($this); - break; - - case 'licenses': - $api = new Api\Miscellaneous\Licenses($this); - break; - - case 'notification': - case 'notifications': - $api = new Api\Notification($this); - break; - - case 'organization': - case 'organizations': - $api = new Api\Organization($this); - break; - - case 'org_project': - case 'orgProject': - case 'org_projects': - case 'orgProjects': - case 'organization_project': - case 'organizationProject': - case 'organization_projects': - case 'organizationProjects': - $api = new Api\Organization\Projects($this); - break; - - case 'pr': - case 'pulls': - case 'pullRequest': - case 'pull_request': - case 'pullRequests': - case 'pull_requests': - $api = new Api\PullRequest($this); - break; - - case 'rateLimit': - case 'rate_limit': - $api = new Api\RateLimit($this); - break; - - case 'repo': - case 'repos': - case 'repository': - case 'repositories': - $api = new Api\Repo($this); - break; - - case 'search': - $api = new Api\Search($this); - break; - - case 'team': - case 'teams': - $api = new Api\Organization\Teams($this); - break; - - case 'member': - case 'members': - $api = new Api\Organization\Members($this); - break; - - case 'user': - case 'users': - $api = new Api\User($this); - break; - - case 'authorization': - case 'authorizations': - $api = new Api\Authorizations($this); - break; - - case 'meta': - $api = new Api\Meta($this); - break; - - case 'graphql': - $api = new Api\GraphQL($this); - break; - - case 'outsideCollaborators': - case 'outside_collaborators': - $api = new Api\Organization\OutsideCollaborators($this); - break; - - default: - throw new InvalidArgumentException(sprintf('Undefined api instance called: "%s"', $name)); - } - - return $api; - } - - /** - * Authenticate a user for all next requests. - * - * @param string $tokenOrLogin GitHub private token/username/client ID - * @param string|null $password GitHub password/secret (optionally can contain $authMethod) - * @param string|null $authMethod One of the AUTH_* class constants - * - * @throws InvalidArgumentException If no authentication method was given - * - * @return void - */ - public function authenticate($tokenOrLogin, $password = null, $authMethod = null): void - { - if (null === $authMethod && (AuthMethod::JWT === $password || AuthMethod::ACCESS_TOKEN === $password)) { - $authMethod = $password; - $password = null; - } - - if (null === $authMethod) { - throw new InvalidArgumentException('You need to specify authentication method!'); - } - - $this->getHttpClientBuilder()->removePlugin(Authentication::class); - $this->getHttpClientBuilder()->addPlugin(new Authentication($tokenOrLogin, $password, $authMethod)); - } - - /** - * Sets the URL of your GitHub Enterprise instance. - * - * @param string $enterpriseUrl URL of the API in the form of http(s)://hostname - * - * @return void - */ - private function setEnterpriseUrl($enterpriseUrl): void - { - $builder = $this->getHttpClientBuilder(); - $builder->removePlugin(Plugin\AddHostPlugin::class); - $builder->removePlugin(PathPrepend::class); - - $builder->addPlugin(new Plugin\AddHostPlugin(Psr17FactoryDiscovery::findUriFactory()->createUri($enterpriseUrl))); - - // For GHE, v4 API endpoint is at `api/graphql` so we don't want to add the version number - // For earlier versions add the version number after /api - if ($this->getApiVersion() === 'v4') { - $builder->addPlugin(new PathPrepend('/api')); - } else { - $builder->addPlugin(new PathPrepend(sprintf('/api/%s', $this->getApiVersion()))); - } - } - - /** - * @return string - */ - public function getApiVersion(): string - { - return $this->apiVersion; - } - - /** - * Add a cache plugin to cache responses locally. - * - * @param CacheItemPoolInterface $cachePool - * @param array $config - * - * @return void - */ - public function addCache(CacheItemPoolInterface $cachePool, array $config = []): void - { - $this->getHttpClientBuilder()->addCache($cachePool, $config); - } - - /** - * Remove the cache plugin. - * - * @return void - */ - public function removeCache(): void - { - $this->getHttpClientBuilder()->removeCache(); - } - - /** - * @param string $name - * @param array $args - * - * @return AbstractApi - */ - public function __call($name, $args): AbstractApi - { - try { - return $this->api($name); - } catch (InvalidArgumentException $e) { - throw new BadMethodCallException(sprintf('Undefined method called: "%s"', $name)); - } - } - - /** - * @return null|\Psr\Http\Message\ResponseInterface - */ - public function getLastResponse(): ?ResponseInterface - { - return $this->responseHistory->getLastResponse(); - } - - /** - * @return HttpMethodsClientInterface - */ - public function getHttpClient(): HttpMethodsClientInterface - { - return $this->getHttpClientBuilder()->getHttpClient(); - } - - /** - * @return Builder - */ - protected function getHttpClientBuilder(): Builder - { - return $this->httpClientBuilder; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php b/vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php deleted file mode 100644 index 5c1dd4d8..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/ApiLimitExceedException.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -class ApiLimitExceedException extends RuntimeException -{ - /** @var int */ - private $limit; - /** @var int */ - private $reset; - - /** - * @param int $limit - * @param int $reset - * @param int $code - * @param Throwable|null $previous - */ - public function __construct(int $limit = 5000, int $reset = 1800, int $code = 0, Throwable $previous = null) - { - $this->limit = (int) $limit; - $this->reset = (int) $reset; - - parent::__construct(sprintf('You have reached GitHub hourly limit! Actual limit is: %d', $limit), $code, $previous); - } - - /** - * @return int - */ - public function getLimit(): int - { - return $this->limit; - } - - /** - * @return int - */ - public function getResetTime(): int - { - return $this->reset; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php b/vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php deleted file mode 100644 index 22753d08..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/BadMethodCallException.php +++ /dev/null @@ -1,10 +0,0 @@ - - */ -class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface -{ -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php b/vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php deleted file mode 100644 index b569f730..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/ErrorException.php +++ /dev/null @@ -1,10 +0,0 @@ - - */ -class ErrorException extends \ErrorException implements ExceptionInterface -{ -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php b/vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php deleted file mode 100644 index 87e6d2f7..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/ExceptionInterface.php +++ /dev/null @@ -1,9 +0,0 @@ - - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php b/vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php deleted file mode 100644 index 4cd3aeca..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/MissingArgumentException.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -class MissingArgumentException extends ErrorException -{ - /** - * @param string|array $required - * @param int $code - * @param Throwable|null $previous - */ - public function __construct($required, int $code = 0, Throwable $previous = null) - { - if (is_string($required)) { - $required = [$required]; - } - - parent::__construct(sprintf('One or more of required ("%s") parameters is missing!', implode('", "', $required)), $code, 1, __FILE__, __LINE__, $previous); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php b/vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php deleted file mode 100644 index 827632e9..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/RuntimeException.php +++ /dev/null @@ -1,10 +0,0 @@ - - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php b/vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php deleted file mode 100644 index 1725270a..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/SsoRequiredException.php +++ /dev/null @@ -1,31 +0,0 @@ -url = $url; - - parent::__construct('Resource protected by organization SAML enforcement. You must grant your personal token access to this organization.', $code, $previous); - } - - /** - * @return string - */ - public function getUrl() - { - return $this->url; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php b/vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php deleted file mode 100644 index c57e67b8..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/TwoFactorAuthenticationRequiredException.php +++ /dev/null @@ -1,30 +0,0 @@ -type = $type; - parent::__construct('Two factor authentication is enabled on this account', $code, $previous); - } - - /** - * @return string - */ - public function getType(): string - { - return $this->type; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php b/vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php deleted file mode 100644 index c689e2d6..00000000 --- a/vendor/knplabs/github-api/lib/Github/Exception/ValidationFailedException.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ -class ValidationFailedException extends ErrorException -{ -} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php deleted file mode 100644 index a8713de1..00000000 --- a/vendor/knplabs/github-api/lib/Github/HttpClient/Builder.php +++ /dev/null @@ -1,214 +0,0 @@ - - */ -class Builder -{ - /** - * The object that sends HTTP messages. - * - * @var ClientInterface - */ - private $httpClient; - - /** - * A HTTP client with all our plugins. - * - * @var HttpMethodsClientInterface - */ - private $pluginClient; - - /** - * @var RequestFactoryInterface - */ - private $requestFactory; - - /** - * @var StreamFactoryInterface - */ - private $streamFactory; - - /** - * True if we should create a new Plugin client at next request. - * - * @var bool - */ - private $httpClientModified = true; - - /** - * @var Plugin[] - */ - private $plugins = []; - - /** - * This plugin is special treated because it has to be the very last plugin. - * - * @var Plugin\CachePlugin|null - */ - private $cachePlugin; - - /** - * Http headers. - * - * @var array - */ - private $headers = []; - - /** - * @param ClientInterface|null $httpClient - * @param RequestFactoryInterface|null $requestFactory - * @param StreamFactoryInterface|null $streamFactory - */ - public function __construct( - ClientInterface $httpClient = null, - RequestFactoryInterface $requestFactory = null, - StreamFactoryInterface $streamFactory = null - ) { - $this->httpClient = $httpClient ?? Psr18ClientDiscovery::find(); - $this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory(); - $this->streamFactory = $streamFactory ?? Psr17FactoryDiscovery::findStreamFactory(); - } - - /** - * @return HttpMethodsClientInterface - */ - public function getHttpClient(): HttpMethodsClientInterface - { - if ($this->httpClientModified) { - $this->httpClientModified = false; - - $plugins = $this->plugins; - if ($this->cachePlugin) { - $plugins[] = $this->cachePlugin; - } - - $this->pluginClient = new HttpMethodsClient( - (new PluginClientFactory())->createClient($this->httpClient, $plugins), - $this->requestFactory, - $this->streamFactory - ); - } - - return $this->pluginClient; - } - - /** - * Add a new plugin to the end of the plugin chain. - * - * @param Plugin $plugin - * - * @return void - */ - public function addPlugin(Plugin $plugin): void - { - $this->plugins[] = $plugin; - $this->httpClientModified = true; - } - - /** - * Remove a plugin by its fully qualified class name (FQCN). - * - * @param string $fqcn - * - * @return void - */ - public function removePlugin(string $fqcn): void - { - foreach ($this->plugins as $idx => $plugin) { - if ($plugin instanceof $fqcn) { - unset($this->plugins[$idx]); - $this->httpClientModified = true; - } - } - } - - /** - * Clears used headers. - * - * @return void - */ - public function clearHeaders(): void - { - $this->headers = []; - - $this->removePlugin(Plugin\HeaderAppendPlugin::class); - $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers)); - } - - /** - * @param array $headers - * - * @return void - */ - public function addHeaders(array $headers): void - { - $this->headers = array_merge($this->headers, $headers); - - $this->removePlugin(Plugin\HeaderAppendPlugin::class); - $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers)); - } - - /** - * @param string $header - * @param string $headerValue - * - * @return void - */ - public function addHeaderValue(string $header, string $headerValue): void - { - if (!isset($this->headers[$header])) { - $this->headers[$header] = $headerValue; - } else { - $this->headers[$header] = array_merge((array) $this->headers[$header], [$headerValue]); - } - - $this->removePlugin(Plugin\HeaderAppendPlugin::class); - $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers)); - } - - /** - * Add a cache plugin to cache responses locally. - * - * @param CacheItemPoolInterface $cachePool - * @param array $config - * - * @return void - */ - public function addCache(CacheItemPoolInterface $cachePool, array $config = []): void - { - if (!isset($config['cache_key_generator'])) { - $config['cache_key_generator'] = new HeaderCacheKeyGenerator(['Authorization', 'Cookie', 'Accept', 'Content-type']); - } - $this->cachePlugin = Plugin\CachePlugin::clientCache($cachePool, $this->streamFactory, $config); - $this->httpClientModified = true; - } - - /** - * Remove the cache plugin. - * - * @return void - */ - public function removeCache(): void - { - $this->cachePlugin = null; - $this->httpClientModified = true; - } -} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php deleted file mode 100644 index a72ccef7..00000000 --- a/vendor/knplabs/github-api/lib/Github/HttpClient/Message/ResponseMediator.php +++ /dev/null @@ -1,90 +0,0 @@ -getBody()->__toString(); - if (strpos($response->getHeaderLine('Content-Type'), 'application/json') === 0) { - $content = json_decode($body, true); - if (JSON_ERROR_NONE === json_last_error()) { - return $content; - } - } - - return $body; - } - - /** - * @param ResponseInterface $response - * - * @return array - */ - public static function getPagination(ResponseInterface $response): array - { - $header = self::getHeader($response, 'Link'); - - if (null === $header) { - return []; - } - - $pagination = []; - foreach (explode(',', $header) as $link) { - preg_match('/<(.*)>; rel="(.*)"/i', trim($link, ','), $match); - - /** @var string[] $match */ - if (3 === count($match)) { - $pagination[$match[2]] = $match[1]; - } - } - - return $pagination; - } - - /** - * @param ResponseInterface $response - * - * @return string|null - */ - public static function getApiLimit(ResponseInterface $response): ?string - { - $remainingCallsHeader = self::getHeader($response, 'X-RateLimit-Remaining'); - - if (null === $remainingCallsHeader) { - return null; - } - - $remainingCalls = (int) $remainingCallsHeader; - - if (1 > $remainingCalls) { - throw new ApiLimitExceedException($remainingCalls); - } - - return $remainingCallsHeader; - } - - /** - * Get the value for a single header. - * - * @param ResponseInterface $response - * @param string $name - * - * @return string|null - */ - public static function getHeader(ResponseInterface $response, string $name): ?string - { - $headers = $response->getHeader($name); - - return array_shift($headers); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php deleted file mode 100644 index 91ed9caa..00000000 --- a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/Authentication.php +++ /dev/null @@ -1,71 +0,0 @@ - - */ -final class Authentication implements Plugin -{ - /** - * @var string - */ - private $tokenOrLogin; - - /** - * @var string|null - */ - private $password; - - /** - * @var string|null - */ - private $method; - - /** - * @param string $tokenOrLogin GitHub private token/username/client ID - * @param string|null $password GitHub password/secret (optionally can contain $method) - * @param string|null $method One of the AUTH_* class constants - */ - public function __construct(string $tokenOrLogin, ?string $password, ?string $method) - { - $this->tokenOrLogin = $tokenOrLogin; - $this->password = $password; - $this->method = $method; - } - - /** - * @return Promise - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $request = $request->withHeader( - 'Authorization', - $this->getAuthorizationHeader() - ); - - return $next($request); - } - - private function getAuthorizationHeader(): string - { - switch ($this->method) { - case AuthMethod::CLIENT_ID: - return sprintf('Basic %s', base64_encode($this->tokenOrLogin.':'.$this->password)); - case AuthMethod::ACCESS_TOKEN: - return sprintf('token %s', $this->tokenOrLogin); - case AuthMethod::JWT: - return sprintf('Bearer %s', $this->tokenOrLogin); - default: - throw new RuntimeException(sprintf('%s not yet implemented', $this->method)); - } - } -} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php deleted file mode 100644 index 4603f629..00000000 --- a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/GithubExceptionThrower.php +++ /dev/null @@ -1,160 +0,0 @@ - - * @author Tobias Nyholm - */ -final class GithubExceptionThrower implements Plugin -{ - /** - * @return Promise - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - return $next($request)->then(function (ResponseInterface $response) use ($request) { - if ($response->getStatusCode() < 400 || $response->getStatusCode() > 600) { - $this->checkGraphqlErrors($response); - - return $response; - } - - // If error: - $remaining = ResponseMediator::getHeader($response, 'X-RateLimit-Remaining'); - if ((429 === $response->getStatusCode()) && null !== $remaining && 1 > $remaining && 'rate_limit' !== substr($request->getRequestTarget(), 1, 10)) { - $limit = (int) ResponseMediator::getHeader($response, 'X-RateLimit-Limit'); - $reset = (int) ResponseMediator::getHeader($response, 'X-RateLimit-Reset'); - - throw new ApiLimitExceedException($limit, $reset); - } - - if ((401 === $response->getStatusCode()) && $response->hasHeader('X-GitHub-OTP') && 0 === strpos((string) ResponseMediator::getHeader($response, 'X-GitHub-OTP'), 'required;')) { - $type = substr((string) ResponseMediator::getHeader($response, 'X-GitHub-OTP'), 9); - - throw new TwoFactorAuthenticationRequiredException($type); - } - - $content = ResponseMediator::getContent($response); - if (is_array($content) && isset($content['message'])) { - if (400 === $response->getStatusCode()) { - throw new ErrorException(sprintf('%s (%s)', $content['message'], $response->getReasonPhrase()), 400); - } - - if (422 === $response->getStatusCode() && isset($content['errors'])) { - $errors = []; - foreach ($content['errors'] as $error) { - switch ($error['code'] ?? null) { - case 'missing': - $errors[] = sprintf('The %s %s does not exist, for resource "%s"', $error['field'], $error['value'], $error['resource']); - break; - - case 'missing_field': - $errors[] = sprintf('Field "%s" is missing, for resource "%s"', $error['field'], $error['resource']); - break; - - case 'invalid': - if (isset($error['message'])) { - $errors[] = sprintf('Field "%s" is invalid, for resource "%s": "%s"', $error['field'], $error['resource'], $error['message']); - } else { - $errors[] = sprintf('Field "%s" is invalid, for resource "%s"', $error['field'], $error['resource']); - } - break; - - case 'already_exists': - $errors[] = sprintf('Field "%s" already exists, for resource "%s"', $error['field'], $error['resource']); - break; - - default: - if (is_string($error)) { - $errors[] = $error; - - break; - } - - if (isset($error['message'])) { - $errors[] = $error['message']; - } - break; - - } - } - - throw new ValidationFailedException( - $errors ? 'Validation Failed: '.implode(', ', $errors) : 'Validation Failed', - 422 - ); - } - } - - if (502 == $response->getStatusCode() && isset($content['errors']) && is_array($content['errors'])) { - $errors = []; - foreach ($content['errors'] as $error) { - if (isset($error['message'])) { - $errors[] = $error['message']; - } - } - - throw new RuntimeException(implode(', ', $errors), 502); - } - - if ((403 === $response->getStatusCode()) && $response->hasHeader('X-GitHub-SSO') && 0 === strpos((string) ResponseMediator::getHeader($response, 'X-GitHub-SSO'), 'required;')) { - // The header will look something like this: - // required; url=https://github.com/orgs/octodocs-test/sso?authorization_request=AZSCKtL4U8yX1H3sCQIVnVgmjmon5fWxks5YrqhJgah0b2tlbl9pZM4EuMz4 - // So we strip out the first 14 characters, leaving only the URL. - // @see https://developer.github.com/v3/auth/#authenticating-for-saml-sso - $url = substr((string) ResponseMediator::getHeader($response, 'X-GitHub-SSO'), 14); - - throw new SsoRequiredException($url); - } - - throw new RuntimeException(isset($content['message']) ? $content['message'] : $content, $response->getStatusCode()); - }); - } - - /** - * The graphql api doesn't return a 5xx http status for errors. Instead it returns a 200 with an error body. - * - * @throws RuntimeException - */ - private function checkGraphqlErrors(ResponseInterface $response): void - { - if ($response->getStatusCode() !== 200) { - return; - } - - $content = ResponseMediator::getContent($response); - if (!is_array($content)) { - return; - } - - if (!isset($content['errors']) || !is_array($content['errors'])) { - return; - } - - $errors = []; - foreach ($content['errors'] as $error) { - if (isset($error['message'])) { - $errors[] = $error['message']; - } - } - - if (empty($errors)) { - return; - } - - throw new RuntimeException(implode(', ', $errors)); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php deleted file mode 100644 index 341c288a..00000000 --- a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/History.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -final class History implements Journal -{ - /** - * @var ResponseInterface|null - */ - private $lastResponse; - - /** - * @return ResponseInterface|null - */ - public function getLastResponse(): ?ResponseInterface - { - return $this->lastResponse; - } - - /** - * @return void - */ - public function addSuccess(RequestInterface $request, ResponseInterface $response): void - { - $this->lastResponse = $response; - } - - /** - * @return void - */ - public function addFailure(RequestInterface $request, ClientExceptionInterface $exception): void - { - } -} diff --git a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php b/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php deleted file mode 100644 index c1077299..00000000 --- a/vendor/knplabs/github-api/lib/Github/HttpClient/Plugin/PathPrepend.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -final class PathPrepend implements Plugin -{ - /** - * @var string - */ - private $path; - - /** - * @param string $path - */ - public function __construct(string $path) - { - $this->path = $path; - } - - /** - * @param RequestInterface $request - * @param callable $next - * @param callable $first - * - * @return Promise - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $currentPath = $request->getUri()->getPath(); - if (strpos($currentPath, $this->path) !== 0) { - $uri = $request->getUri()->withPath($this->path.$currentPath); - $request = $request->withUri($uri); - } - - return $next($request); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/ResultPager.php b/vendor/knplabs/github-api/lib/Github/ResultPager.php deleted file mode 100644 index cfd1d605..00000000 --- a/vendor/knplabs/github-api/lib/Github/ResultPager.php +++ /dev/null @@ -1,212 +0,0 @@ - - * @author Mitchel Verschoof - * @author Graham Campbell - */ -class ResultPager implements ResultPagerInterface -{ - /** - * The default number of entries to request per page. - * - * @var int - */ - private const PER_PAGE = 100; - - /** - * The client to use for pagination. - * - * @var Client - */ - private $client; - - /** - * The number of entries to request per page. - * - * @var int - */ - private $perPage; - - /** - * The pagination result from the API. - * - * @var array - */ - private $pagination; - - /** - * Create a new result pager instance. - * - * Example code: - * - * $client = new \Github\Client(); - * $api = $client->api('someApi'); - * $pager = new \Github\ResultPager($client); - * - * @param Client $client - * @param int|null $perPage - * - * @return void - */ - public function __construct(Client $client, int $perPage = null) - { - if (null !== $perPage && ($perPage < 1 || $perPage > 100)) { - throw new ValueError(sprintf('%s::__construct(): Argument #2 ($perPage) must be between 1 and 100, or null', self::class)); - } - - $this->client = $client; - $this->perPage = $perPage ?? self::PER_PAGE; - $this->pagination = []; - } - - /** - * {@inheritdoc} - */ - public function fetch(AbstractApi $api, string $method, array $parameters = []): array - { - $paginatorPerPage = $this->perPage; - $closure = Closure::bind(function (AbstractApi $api) use ($paginatorPerPage) { - $clone = clone $api; - $clone->perPage = $paginatorPerPage; - - return $clone; - }, null, AbstractApi::class); - - $api = $closure($api); - $result = $api->$method(...$parameters); - - $this->postFetch(true); - - return $result; - } - - /** - * {@inheritdoc} - */ - public function fetchAll(AbstractApi $api, string $method, array $parameters = []): array - { - return iterator_to_array($this->fetchAllLazy($api, $method, $parameters)); - } - - /** - * {@inheritdoc} - */ - public function fetchAllLazy(AbstractApi $api, string $method, array $parameters = []): Generator - { - $result = $this->fetch($api, $method, $parameters); - - foreach ($result['items'] ?? $result as $key => $item) { - if (is_string($key)) { - yield $key => $item; - } else { - yield $item; - } - } - - while ($this->hasNext()) { - $result = $this->fetchNext(); - - foreach ($result['items'] ?? $result as $key => $item) { - if (is_string($key)) { - yield $key => $item; - } else { - yield $item; - } - } - } - } - - /** - * {@inheritdoc} - */ - public function postFetch(/* $skipDeprecation = false */): void - { - if (func_num_args() === 0 || (func_num_args() > 0 && false === func_get_arg(0))) { - trigger_deprecation('KnpLabs/php-github-api', '3.2', 'The "%s" method is deprecated and will be removed.', __METHOD__); - } - - $this->setPagination(); - } - - /** - * {@inheritdoc} - */ - public function hasNext(): bool - { - return isset($this->pagination['next']); - } - - /** - * {@inheritdoc} - */ - public function fetchNext(): array - { - return $this->get('next'); - } - - /** - * {@inheritdoc} - */ - public function hasPrevious(): bool - { - return isset($this->pagination['prev']); - } - - /** - * {@inheritdoc} - */ - public function fetchPrevious(): array - { - return $this->get('prev'); - } - - /** - * {@inheritdoc} - */ - public function fetchFirst(): array - { - return $this->get('first'); - } - - /** - * {@inheritdoc} - */ - public function fetchLast(): array - { - return $this->get('last'); - } - - /** - * @param string $key - * - * @return array - */ - protected function get(string $key): array - { - if (!isset($this->pagination[$key])) { - return []; - } - - $result = $this->client->getHttpClient()->get($this->pagination[$key]); - - $this->postFetch(true); - - return ResponseMediator::getContent($result); - } - - private function setPagination(): void - { - $this->pagination = ResponseMediator::getPagination($this->client->getLastResponse()); - } -} diff --git a/vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php b/vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php deleted file mode 100644 index bf7618ee..00000000 --- a/vendor/knplabs/github-api/lib/Github/ResultPagerInterface.php +++ /dev/null @@ -1,104 +0,0 @@ - - * @author Mitchel Verschoof - * @author Graham Campbell - */ -interface ResultPagerInterface -{ - /** - * Fetch a single result (page) from an api call. - * - * @param AbstractApi $api the Api instance - * @param string $method the method name to call on the Api instance - * @param array $parameters the method parameters in an array - * - * @return array returns the result of the Api::$method() call - */ - public function fetch(AbstractApi $api, string $method, array $parameters = []): array; - - /** - * Fetch all results (pages) from an api call. - * - * Use with care - there is no maximum. - * - * @param AbstractApi $api the Api instance - * @param string $method the method name to call on the Api instance - * @param array $parameters the method parameters in an array - * - * @return array returns a merge of the results of the Api::$method() call - */ - public function fetchAll(AbstractApi $api, string $method, array $parameters = []): array; - - /** - * Lazily fetch all results (pages) from an api call. - * - * Use with care - there is no maximum. - * - * @param AbstractApi $api the Api instance - * @param string $method the method name to call on the Api instance - * @param array $parameters the method parameters in an array - * - * @return \Generator returns a merge of the results of the Api::$method() call - */ - public function fetchAllLazy(AbstractApi $api, string $method, array $parameters = []): Generator; - - /** - * Method that performs the actual work to refresh the pagination property. - * - * @deprecated since 3.2 and will be removed in 4.0. - * - * @return void - */ - public function postFetch(): void; - - /** - * Check to determine the availability of a next page. - * - * @return bool - */ - public function hasNext(): bool; - - /** - * Check to determine the availability of a previous page. - * - * @return bool - */ - public function hasPrevious(): bool; - - /** - * Fetch the next page. - * - * @return array - */ - public function fetchNext(): array; - - /** - * Fetch the previous page. - * - * @return array - */ - public function fetchPrevious(): array; - - /** - * Fetch the first page. - * - * @return array - */ - public function fetchFirst(): array; - - /** - * Fetch the last page. - * - * @return array - */ - public function fetchLast(): array; -} diff --git a/vendor/knplabs/github-api/phpstan.neon.dist b/vendor/knplabs/github-api/phpstan.neon.dist deleted file mode 100644 index 9e84171f..00000000 --- a/vendor/knplabs/github-api/phpstan.neon.dist +++ /dev/null @@ -1,15 +0,0 @@ -parameters: - checkMissingIterableValueType: false - - level: 6 - paths: - - lib - - ignoreErrors: - # Ignore typehint errors on api classes - - - message: '#Method (.*) with no typehint specified\.#' - path: lib/Github/Api - - - message: '#Method (.*) has no return typehint specified\.#' - path: lib/Github/Api diff --git a/vendor/php-http/cache-plugin/CHANGELOG.md b/vendor/php-http/cache-plugin/CHANGELOG.md deleted file mode 100644 index 6f006059..00000000 --- a/vendor/php-http/cache-plugin/CHANGELOG.md +++ /dev/null @@ -1,117 +0,0 @@ -# Change Log - -## 1.7.5 - 2022-01-18 - -- Allow installation with psr/cache 3.0 (1.0 and 2.0 are still allowed too) - -## 1.7.4 - 2021-11-30 - -### Added - -- Allow installation with Symfony 6 - -## 1.7.3 - 2021-11-03 - -### Changed - -- Be more defensive about cache hits. A cache entry can technically contain `null`. - -## 1.7.2 - 2021-04-14 - -### Added - -- Allow installation with psr/cache 2.0 (1.0 still allowed too) - -## 1.7.1 - 2020-07-13 - -### Added - -- Support for PHP 8 - -## 1.7.0 - 2019-12-17 - -### Added - -* Support for Symfony 5. -* Support for PSR-17 `StreamFactoryInterface`. -* Added `blacklisted_paths` option, which takes an array of `strings` (regular expressions) and allows to define paths, that shall not be cached in any case. - -## 1.6.0 - 2019-01-23 - -### Added - -* Support for HTTPlug 2 / PSR-18 -* Added `cache_listeners` option, which takes an array of `CacheListener`s, who get notified and can optionally act on a Response based on a cache hit or miss event. An implementation, `AddHeaderCacheListener`, is provided which will add an `X-Cache` header to the response with this information. - -## 1.5.0 - 2017-11-29 - -### Added - -* Support for Symfony 4 - -### Changed - -* Removed check if etag is a string. Etag can never be a string, it is always an array. - -## 1.4.0 - 2017-04-05 - -### Added - -- `CacheKeyGenerator` interface that allow you to configure how the PSR-6 cache key is created. There are two implementations -of this interface: `SimpleGenerator` (default) and `HeaderCacheKeyGenerator`. - -### Fixed - -- Issue where deprecation warning always was triggered. Not it is just triggered if `respect_cache_headers` is used. - -## 1.3.0 - 2017-03-28 - -### Added - -- New `methods` option which allows to configure the request methods which can be cached. -- New `respect_response_cache_directives` option to define specific cache directives to respect when handling responses. -- Introduced `CachePlugin::clientCache` and `CachePlugin::serverCache` factory methods to easily setup the plugin with - the correct config settigns for each usecase. - -### Changed - -- The `no-cache` directive is now respected by the plugin and will not cache the response. If you need the previous behaviour, configure `respect_response_cache_directives`. -- We always rewind the stream after loading response from cache. - -### Deprecated - -- The `respect_cache_headers` option is deprecated and will be removed in 2.0. This option is replaced by the new `respect_response_cache_directives` option. - If you had set `respect_cache_headers` to `false`, set the directives to `[]` to ignore all directives. - - -## 1.2.0 - 2016-08-16 - -### Changed - -- The default value for `default_ttl` is changed from `null` to `0`. - -### Fixed - -- Issue when you use `respect_cache_headers=>false` in combination with `default_ttl=>null`. -- We allow `cache_lifetime` to be set to `null`. - - -## 1.1.0 - 2016-08-04 - -### Added - -- Support for cache validation with ETag and Last-Modified headers. (Enabled automatically when the server sends the relevant headers.) -- `hash_algo` config option used for cache key generation (defaults to **sha1**). - -### Changed - -- Default hash algo used for cache generation (from **md5** to **sha1**). - -### Fixed - -- Cast max age header to integer in order to get valid expiration value. - - -## 1.0.0 - 2016-05-05 - -- Initial release diff --git a/vendor/php-http/cache-plugin/LICENSE b/vendor/php-http/cache-plugin/LICENSE deleted file mode 100644 index 4558d6f0..00000000 --- a/vendor/php-http/cache-plugin/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2016 PHP HTTP Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/cache-plugin/README.md b/vendor/php-http/cache-plugin/README.md deleted file mode 100644 index cef5dab6..00000000 --- a/vendor/php-http/cache-plugin/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Cache Plugin - -[![Latest Version](https://img.shields.io/github/release/php-http/cache-plugin.svg?style=flat-square)](https://github.com/php-http/cache-plugin/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://github.com/php-http/cache-plugin/actions/workflows/tests.yml/badge.svg)](https://github.com/php-http/cache-plugin/actions/workflows/tests.yml) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/cache-plugin.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/cache-plugin) -[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/cache-plugin.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/cache-plugin) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/cache-plugin.svg?style=flat-square)](https://packagist.org/packages/php-http/cache-plugin) - -**PSR-6 Cache plugin for HTTPlug.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/cache-plugin -``` - - -## Documentation - -Please see the [official documentation](http://docs.php-http.org/en/latest/plugins/cache.html). - - -## Testing - -``` bash -$ composer test -``` - - -## Contributing - -Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/cache-plugin/composer.json b/vendor/php-http/cache-plugin/composer.json deleted file mode 100644 index 08dc4bf8..00000000 --- a/vendor/php-http/cache-plugin/composer.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "php-http/cache-plugin", - "description": "PSR-6 Cache plugin for HTTPlug", - "license": "MIT", - "keywords": ["cache", "http", "httplug", "plugin"], - "homepage": "http://httplug.io", - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php": "^7.1 || ^8.0", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "php-http/client-common": "^1.9 || ^2.0", - "php-http/message-factory": "^1.0", - "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0 || ^5.0 || ^6.0" - }, - "require-dev": { - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\Plugin\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "spec\\Http\\Client\\Common\\Plugin\\": "spec/" - } - }, - "scripts": { - "test": "vendor/bin/phpspec run", - "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" - }, - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - } -} diff --git a/vendor/php-http/cache-plugin/phpstan.neon.dist b/vendor/php-http/cache-plugin/phpstan.neon.dist deleted file mode 100644 index ac454e0f..00000000 --- a/vendor/php-http/cache-plugin/phpstan.neon.dist +++ /dev/null @@ -1,5 +0,0 @@ -parameters: - level: 8 - paths: - - src - treatPhpDocTypesAsCertain: false diff --git a/vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php b/vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php deleted file mode 100644 index 30102566..00000000 --- a/vendor/php-http/cache-plugin/src/Cache/Generator/CacheKeyGenerator.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ -interface CacheKeyGenerator -{ - /** - * Generate a cache key from a Request. - * - * @return string - */ - public function generate(RequestInterface $request); -} diff --git a/vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php b/vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php deleted file mode 100644 index 16587beb..00000000 --- a/vendor/php-http/cache-plugin/src/Cache/Generator/HeaderCacheKeyGenerator.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -class HeaderCacheKeyGenerator implements CacheKeyGenerator -{ - /** - * The header names we should take into account when creating the cache key. - * - * @var string[] - */ - private $headerNames; - - /** - * @param string[] $headerNames - */ - public function __construct(array $headerNames) - { - $this->headerNames = $headerNames; - } - - public function generate(RequestInterface $request) - { - $concatenatedHeaders = []; - foreach ($this->headerNames as $headerName) { - $concatenatedHeaders[] = sprintf(' %s:"%s"', $headerName, $request->getHeaderLine($headerName)); - } - - return $request->getMethod().' '.$request->getUri().implode('', $concatenatedHeaders).' '.$request->getBody(); - } -} diff --git a/vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php b/vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php deleted file mode 100644 index 4f0ee903..00000000 --- a/vendor/php-http/cache-plugin/src/Cache/Generator/SimpleGenerator.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -class SimpleGenerator implements CacheKeyGenerator -{ - public function generate(RequestInterface $request) - { - $body = (string) $request->getBody(); - if (!empty($body)) { - $body = ' '.$body; - } - - return $request->getMethod().' '.$request->getUri().$body; - } -} diff --git a/vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php b/vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php deleted file mode 100644 index 282a8a33..00000000 --- a/vendor/php-http/cache-plugin/src/Cache/Listener/AddHeaderCacheListener.php +++ /dev/null @@ -1,40 +0,0 @@ - - */ -class AddHeaderCacheListener implements CacheListener -{ - /** @var string */ - private $headerName; - - /** - * @param string $headerName - */ - public function __construct($headerName = 'X-Cache') - { - $this->headerName = $headerName; - } - - /** - * Called before the cache plugin returns the response, with information on whether that response came from cache. - * - * @param bool $fromCache Whether the `$response` was from the cache or not. - * Note that checking `$cacheItem->isHit()` is not sufficent to determine this. - * @param CacheItemInterface|null $cacheItem - * - * @return ResponseInterface - */ - public function onCacheResponse(RequestInterface $request, ResponseInterface $response, $fromCache, $cacheItem) - { - return $response->withHeader($this->headerName, $fromCache ? 'HIT' : 'MISS'); - } -} diff --git a/vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php b/vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php deleted file mode 100644 index 01b953c2..00000000 --- a/vendor/php-http/cache-plugin/src/Cache/Listener/CacheListener.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -interface CacheListener -{ - /** - * Called before the cache plugin returns the response, with information on whether that response came from cache. - * - * @param bool $fromCache Whether the `$response` was from the cache or not. - * Note that checking `$cacheItem->isHit()` is not sufficent to determine this. - * @param CacheItemInterface|null $cacheItem - * - * @return ResponseInterface - */ - public function onCacheResponse(RequestInterface $request, ResponseInterface $response, $fromCache, $cacheItem); -} diff --git a/vendor/php-http/cache-plugin/src/CachePlugin.php b/vendor/php-http/cache-plugin/src/CachePlugin.php deleted file mode 100644 index 5318dc81..00000000 --- a/vendor/php-http/cache-plugin/src/CachePlugin.php +++ /dev/null @@ -1,464 +0,0 @@ - - */ -final class CachePlugin implements Plugin -{ - use VersionBridgePlugin; - - /** - * @var CacheItemPoolInterface - */ - private $pool; - - /** - * @var StreamFactory|StreamFactoryInterface - */ - private $streamFactory; - - /** - * @var mixed[] - */ - private $config; - - /** - * Cache directives indicating if a response can not be cached. - * - * @var string[] - */ - private $noCacheFlags = ['no-cache', 'private', 'no-store']; - - /** - * @param StreamFactory|StreamFactoryInterface $streamFactory - * @param mixed[] $config - * - * bool respect_cache_headers: Whether to look at the cache directives or ignore them - * int default_ttl: (seconds) If we do not respect cache headers or can't calculate a good ttl, use this value - * string hash_algo: The hashing algorithm to use when generating cache keys - * int cache_lifetime: (seconds) To support serving a previous stale response when the server answers 304 - * we have to store the cache for a longer time than the server originally says it is valid for. - * We store a cache item for $cache_lifetime + max age of the response. - * string[] methods: list of request methods which can be cached - * string[] blacklisted_paths: list of regex for URLs explicitly not to be cached - * string[] respect_response_cache_directives: list of cache directives this plugin will respect while caching responses - * CacheKeyGenerator cache_key_generator: an object to generate the cache key. Defaults to a new instance of SimpleGenerator - * CacheListener[] cache_listeners: an array of objects to act on the response based on the results of the cache check. - * Defaults to an empty array - * } - */ - public function __construct(CacheItemPoolInterface $pool, $streamFactory, array $config = []) - { - if (!($streamFactory instanceof StreamFactory) && !($streamFactory instanceof StreamFactoryInterface)) { - throw new \TypeError(\sprintf('Argument 2 passed to %s::__construct() must be of type %s|%s, %s given.', self::class, StreamFactory::class, StreamFactoryInterface::class, \is_object($streamFactory) ? \get_class($streamFactory) : \gettype($streamFactory))); - } - - $this->pool = $pool; - $this->streamFactory = $streamFactory; - - if (\array_key_exists('respect_cache_headers', $config) && \array_key_exists('respect_response_cache_directives', $config)) { - throw new \InvalidArgumentException('You can\'t provide config option "respect_cache_headers" and "respect_response_cache_directives". Use "respect_response_cache_directives" instead.'); - } - - $optionsResolver = new OptionsResolver(); - $this->configureOptions($optionsResolver); - $this->config = $optionsResolver->resolve($config); - - if (null === $this->config['cache_key_generator']) { - $this->config['cache_key_generator'] = new SimpleGenerator(); - } - } - - /** - * This method will setup the cachePlugin in client cache mode. When using the client cache mode the plugin will - * cache responses with `private` cache directive. - * - * @param StreamFactory|StreamFactoryInterface $streamFactory - * @param mixed[] $config For all possible config options see the constructor docs - * - * @return CachePlugin - */ - public static function clientCache(CacheItemPoolInterface $pool, $streamFactory, array $config = []) - { - // Allow caching of private requests - if (\array_key_exists('respect_response_cache_directives', $config)) { - $config['respect_response_cache_directives'][] = 'no-cache'; - $config['respect_response_cache_directives'][] = 'max-age'; - $config['respect_response_cache_directives'] = array_unique($config['respect_response_cache_directives']); - } else { - $config['respect_response_cache_directives'] = ['no-cache', 'max-age']; - } - - return new self($pool, $streamFactory, $config); - } - - /** - * This method will setup the cachePlugin in server cache mode. This is the default caching behavior it refuses to - * cache responses with the `private`or `no-cache` directives. - * - * @param StreamFactory|StreamFactoryInterface $streamFactory - * @param mixed[] $config For all possible config options see the constructor docs - * - * @return CachePlugin - */ - public static function serverCache(CacheItemPoolInterface $pool, $streamFactory, array $config = []) - { - return new self($pool, $streamFactory, $config); - } - - /** - * {@inheritdoc} - * - * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient) - */ - protected function doHandleRequest(RequestInterface $request, callable $next, callable $first) - { - $method = strtoupper($request->getMethod()); - // if the request not is cachable, move to $next - if (!in_array($method, $this->config['methods'])) { - return $next($request)->then(function (ResponseInterface $response) use ($request) { - $response = $this->handleCacheListeners($request, $response, false, null); - - return $response; - }); - } - - // If we can cache the request - $key = $this->createCacheKey($request); - $cacheItem = $this->pool->getItem($key); - - if ($cacheItem->isHit()) { - $data = $cacheItem->get(); - if (is_array($data)) { - // The array_key_exists() is to be removed in 2.0. - if (array_key_exists('expiresAt', $data) && (null === $data['expiresAt'] || time() < $data['expiresAt'])) { - // This item is still valid according to previous cache headers - $response = $this->createResponseFromCacheItem($cacheItem); - $response = $this->handleCacheListeners($request, $response, true, $cacheItem); - - return new FulfilledPromise($response); - } - - // Add headers to ask the server if this cache is still valid - if ($modifiedSinceValue = $this->getModifiedSinceHeaderValue($cacheItem)) { - $request = $request->withHeader('If-Modified-Since', $modifiedSinceValue); - } - - if ($etag = $this->getETag($cacheItem)) { - $request = $request->withHeader('If-None-Match', $etag); - } - } - } - - return $next($request)->then(function (ResponseInterface $response) use ($request, $cacheItem) { - if (304 === $response->getStatusCode()) { - if (!$cacheItem->isHit()) { - /* - * We do not have the item in cache. This plugin did not add If-Modified-Since - * or If-None-Match headers. Return the response from server. - */ - return $this->handleCacheListeners($request, $response, false, $cacheItem); - } - - // The cached response we have is still valid - $data = $cacheItem->get(); - $maxAge = $this->getMaxAge($response); - $data['expiresAt'] = $this->calculateResponseExpiresAt($maxAge); - $cacheItem->set($data)->expiresAfter($this->calculateCacheItemExpiresAfter($maxAge)); - $this->pool->save($cacheItem); - - return $this->handleCacheListeners($request, $this->createResponseFromCacheItem($cacheItem), true, $cacheItem); - } - - if ($this->isCacheable($response) && $this->isCacheableRequest($request)) { - $bodyStream = $response->getBody(); - $body = $bodyStream->__toString(); - if ($bodyStream->isSeekable()) { - $bodyStream->rewind(); - } else { - $response = $response->withBody($this->streamFactory->createStream($body)); - } - - $maxAge = $this->getMaxAge($response); - $cacheItem - ->expiresAfter($this->calculateCacheItemExpiresAfter($maxAge)) - ->set([ - 'response' => $response, - 'body' => $body, - 'expiresAt' => $this->calculateResponseExpiresAt($maxAge), - 'createdAt' => time(), - 'etag' => $response->getHeader('ETag'), - ]); - $this->pool->save($cacheItem); - } - - return $this->handleCacheListeners($request, $response, false, $cacheItem); - }); - } - - /** - * Calculate the timestamp when this cache item should be dropped from the cache. The lowest value that can be - * returned is $maxAge. - * - * @return int|null Unix system time passed to the PSR-6 cache - */ - private function calculateCacheItemExpiresAfter(?int $maxAge): ?int - { - if (null === $this->config['cache_lifetime'] && null === $maxAge) { - return null; - } - - return $this->config['cache_lifetime'] + $maxAge; - } - - /** - * Calculate the timestamp when a response expires. After that timestamp, we need to send a - * If-Modified-Since / If-None-Match request to validate the response. - * - * @return int|null Unix system time. A null value means that the response expires when the cache item expires - */ - private function calculateResponseExpiresAt(?int $maxAge): ?int - { - if (null === $maxAge) { - return null; - } - - return time() + $maxAge; - } - - /** - * Verify that we can cache this response. - * - * @return bool - */ - protected function isCacheable(ResponseInterface $response) - { - if (!in_array($response->getStatusCode(), [200, 203, 300, 301, 302, 404, 410])) { - return false; - } - - $nocacheDirectives = array_intersect($this->config['respect_response_cache_directives'], $this->noCacheFlags); - foreach ($nocacheDirectives as $nocacheDirective) { - if ($this->getCacheControlDirective($response, $nocacheDirective)) { - return false; - } - } - - return true; - } - - /** - * Verify that we can cache this request. - */ - private function isCacheableRequest(RequestInterface $request): bool - { - $uri = $request->getUri()->__toString(); - foreach ($this->config['blacklisted_paths'] as $regex) { - if (1 === preg_match($regex, $uri)) { - return false; - } - } - - return true; - } - - /** - * Get the value of a parameter in the cache control header. - * - * @param string $name The field of Cache-Control to fetch - * - * @return bool|string The value of the directive, true if directive without value, false if directive not present - */ - private function getCacheControlDirective(ResponseInterface $response, string $name) - { - $headers = $response->getHeader('Cache-Control'); - foreach ($headers as $header) { - if (preg_match(sprintf('|%s=?([0-9]+)?|i', $name), $header, $matches)) { - // return the value for $name if it exists - if (isset($matches[1])) { - return $matches[1]; - } - - return true; - } - } - - return false; - } - - private function createCacheKey(RequestInterface $request): string - { - $key = $this->config['cache_key_generator']->generate($request); - - return hash($this->config['hash_algo'], $key); - } - - /** - * Get a ttl in seconds. - * - * Returns null if we do not respect cache headers and got no defaultTtl. - */ - private function getMaxAge(ResponseInterface $response): ?int - { - if (!in_array('max-age', $this->config['respect_response_cache_directives'], true)) { - return $this->config['default_ttl']; - } - - // check for max age in the Cache-Control header - $maxAge = $this->getCacheControlDirective($response, 'max-age'); - if (!is_bool($maxAge)) { - $ageHeaders = $response->getHeader('Age'); - foreach ($ageHeaders as $age) { - return ((int) $maxAge) - ((int) $age); - } - - return (int) $maxAge; - } - - // check for ttl in the Expires header - $headers = $response->getHeader('Expires'); - foreach ($headers as $header) { - return (new \DateTime($header))->getTimestamp() - (new \DateTime())->getTimestamp(); - } - - return $this->config['default_ttl']; - } - - /** - * Configure an options resolver. - */ - private function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'cache_lifetime' => 86400 * 30, // 30 days - 'default_ttl' => 0, - //Deprecated as of v1.3, to be removed in v2.0. Use respect_response_cache_directives instead - 'respect_cache_headers' => null, - 'hash_algo' => 'sha1', - 'methods' => ['GET', 'HEAD'], - 'respect_response_cache_directives' => ['no-cache', 'private', 'max-age', 'no-store'], - 'cache_key_generator' => null, - 'cache_listeners' => [], - 'blacklisted_paths' => [], - ]); - - $resolver->setAllowedTypes('cache_lifetime', ['int', 'null']); - $resolver->setAllowedTypes('default_ttl', ['int', 'null']); - $resolver->setAllowedTypes('respect_cache_headers', ['bool', 'null']); - $resolver->setAllowedTypes('methods', 'array'); - $resolver->setAllowedTypes('cache_key_generator', ['null', 'Http\Client\Common\Plugin\Cache\Generator\CacheKeyGenerator']); - $resolver->setAllowedTypes('blacklisted_paths', 'array'); - $resolver->setAllowedValues('hash_algo', hash_algos()); - $resolver->setAllowedValues('methods', function ($value) { - /* RFC7230 sections 3.1.1 and 3.2.6 except limited to uppercase characters. */ - $matches = preg_grep('/[^A-Z0-9!#$%&\'*+\-.^_`|~]/', $value); - - return empty($matches); - }); - $resolver->setAllowedTypes('cache_listeners', ['array']); - - $resolver->setNormalizer('respect_cache_headers', function (Options $options, $value) { - if (null !== $value) { - @trigger_error('The option "respect_cache_headers" is deprecated since version 1.3 and will be removed in 2.0. Use "respect_response_cache_directives" instead.', E_USER_DEPRECATED); - } - - return null === $value ? true : $value; - }); - - $resolver->setNormalizer('respect_response_cache_directives', function (Options $options, $value) { - if (false === $options['respect_cache_headers']) { - return []; - } - - return $value; - }); - } - - private function createResponseFromCacheItem(CacheItemInterface $cacheItem): ResponseInterface - { - $data = $cacheItem->get(); - - /** @var ResponseInterface $response */ - $response = $data['response']; - $stream = $this->streamFactory->createStream($data['body']); - - try { - $stream->rewind(); - } catch (\Exception $e) { - throw new RewindStreamException('Cannot rewind stream.', 0, $e); - } - - return $response->withBody($stream); - } - - /** - * Get the value for the "If-Modified-Since" header. - */ - private function getModifiedSinceHeaderValue(CacheItemInterface $cacheItem): ?string - { - $data = $cacheItem->get(); - // The isset() is to be removed in 2.0. - if (!isset($data['createdAt'])) { - return null; - } - - $modified = new \DateTime('@'.$data['createdAt']); - $modified->setTimezone(new \DateTimeZone('GMT')); - - return sprintf('%s GMT', $modified->format('l, d-M-y H:i:s')); - } - - /** - * Get the ETag from the cached response. - */ - private function getETag(CacheItemInterface $cacheItem): ?string - { - $data = $cacheItem->get(); - // The isset() is to be removed in 2.0. - if (!isset($data['etag'])) { - return null; - } - - foreach ($data['etag'] as $etag) { - if (!empty($etag)) { - return $etag; - } - } - - return null; - } - - /** - * Call the registered cache listeners. - */ - private function handleCacheListeners(RequestInterface $request, ResponseInterface $response, bool $cacheHit, ?CacheItemInterface $cacheItem): ResponseInterface - { - foreach ($this->config['cache_listeners'] as $cacheListener) { - $response = $cacheListener->onCacheResponse($request, $response, $cacheHit, $cacheItem); - } - - return $response; - } -} diff --git a/vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php b/vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php deleted file mode 100644 index 1b9eaee3..00000000 --- a/vendor/php-http/cache-plugin/src/Exception/RewindStreamException.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ -class RewindStreamException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/php-http/client-common/.php_cs.dist b/vendor/php-http/client-common/.php_cs.dist deleted file mode 100644 index 24e9bb9e..00000000 --- a/vendor/php-http/client-common/.php_cs.dist +++ /dev/null @@ -1,24 +0,0 @@ -in('src') - ->in('spec') -; -return PhpCsFixer\Config::create() - ->setRules([ - '@PSR2' => true, - '@Symfony' => true, - 'array_syntax' => [ - 'syntax' => 'short', - ], - 'no_empty_phpdoc' => true, - 'phpdoc_to_comment' => false, - 'single_line_throw' => false, - ]) - ->setFinder($finder); diff --git a/vendor/php-http/client-common/CHANGELOG.md b/vendor/php-http/client-common/CHANGELOG.md deleted file mode 100644 index 9b031deb..00000000 --- a/vendor/php-http/client-common/CHANGELOG.md +++ /dev/null @@ -1,276 +0,0 @@ -# Change Log - -## 2.5.0 - 2021-11-26 - -### Added - -- Support for Symfony 6 -- Support for PHP 8.1 - -### Changed - -- Dropped support for Symfony 2 and 3 - please keep using version 2.4.0 of this library if you can't update Symfony. - -## 2.4.0 - 2021-07-05 - -### Added - -- `strict` option to `RedirectPlugin` to allow preserving the request method on redirections with status 300, 301 and 302. - -## 2.3.0 - 2020-07-21 - -### Fixed - -- HttpMethodsClient with PSR RequestFactory -- Bug in the cookie plugin with empty cookies -- Bug when parsing null-valued date headers - -### Changed - -- Deprecation when constructing a HttpMethodsClient with PSR RequestFactory but without a StreamFactory - -## 2.2.1 - 2020-07-13 - -### Fixed - -- Support for PHP 8 -- Plugin callable phpdoc - -## 2.2.0 - 2020-07-02 - -### Added - -- Plugin client builder for making a `PluginClient` -- Support for the PSR-17 request factory in `HttpMethodsClient` - -### Changed - -- Restored support for `symfony/options-resolver: ^2.6` -- Consistent implementation of union type checking - -### Fixed - -- Memory leak when using the `PluginClient` with plugins - -## 2.1.0 - 2019-11-18 - -### Added - -- Support Symfony 5 - -## 2.0.0 - 2019-02-03 - -### Changed - -- HttpClientRouter now throws a HttpClientNoMatchException instead of a RequestException if it can not find a client for the request. -- RetryPlugin will only retry exceptions when there is no response, or a response in the 5xx HTTP code range. -- RetryPlugin also retries when no exception is thrown if the responses has HTTP code in the 5xx range. - The callbacks for exception handling have been renamed and callbacks for response handling have been added. -- Abstract method `HttpClientPool::chooseHttpClient()` has now an explicit return type (`Http\Client\Common\HttpClientPoolItem`) -- Interface method `Plugin::handleRequest(...)` has now an explicit return type (`Http\Promise\Promise`) -- Made classes final that are not intended to be extended. -- Added interfaces for BatchClient, HttpClientRouter and HttpMethodsClient. - (These interfaces use the `Interface` suffix to avoid name collisions.) -- Added an interface for HttpClientPool and moved the abstract class to the HttpClientPool sub namespace. -- AddPathPlugin: Do not add the prefix if the URL already has the same prefix. -- All exceptions in `Http\Client\Common\Exception` are final. - -### Removed - -- Deprecated option `debug_plugins` has been removed from `PluginClient` -- Deprecated options `decider` and `delay` have been removed from `RetryPlugin`, use `exception_decider` and `exception_delay` instead. - -## 1.11.0 - 2021-07-11 - -### Changed - -- Backported from version 2: AddPathPlugin: Do not add the prefix if the URL already has the same prefix. - -## 1.10.0 - 2019-11-18 - -### Added - -- Support for Symfony 5 - -## 1.9.1 - 2019-02-02 - -### Added - -- Updated type hints in doc blocks. - -## 1.9.0 - 2019-01-03 - -### Added - -- Support for PSR-18 clients -- Added traits `VersionBridgePlugin` and `VersionBridgeClient` to help plugins and clients to support both - 1.x and 2.x version of `php-http/client-common` and `php-http/httplug`. - -### Changed - -- RetryPlugin: Renamed the configuration options for the exception retry callback from `decider` to `exception_decider` - and `delay` to `exception_delay`. The old names still work but are deprecated. - -## 1.8.2 - 2018-12-14 - -### Changed - -- When multiple cookies exist, a single header with all cookies is sent as per RFC 6265 Section 5.4 -- AddPathPlugin will now trim of ending slashes in paths - -## 1.8.1 - 2018-10-09 - -### Fixed - -- Reverted change to RetryPlugin so it again waits when retrying to avoid "can only throw objects" error. - -## 1.8.0 - 2018-09-21 - -### Added - - - Add an option on ErrorPlugin to only throw exception on response with 5XX status code. - -### Changed - -- AddPathPlugin no longer add prefix multiple times if a request is restarted - it now only adds the prefix if that request chain has not yet passed through the AddPathPlugin -- RetryPlugin no longer wait for retried requests and use a deferred promise instead - -### Fixed - -- Decoder plugin will now remove header when there is no more encoding, instead of setting to an empty array - -## 1.7.0 - 2017-11-30 - -### Added - -- Symfony 4 support - -### Changed - -- Strict comparison in DecoderPlugin - -## 1.6.0 - 2017-10-16 - -### Added - -- Add HttpClientPool client to leverage load balancing and fallback mechanism [see the documentation](http://docs.php-http.org/en/latest/components/client-common.html) for more details. -- `PluginClientFactory` to create `PluginClient` instances. -- Added new option 'delay' for `RetryPlugin`. -- Added new option 'decider' for `RetryPlugin`. -- Supports more cookie date formats in the Cookie Plugin - -### Changed - -- The `RetryPlugin` does now wait between retries. To disable/change this feature you must write something like: - -```php -$plugin = new RetryPlugin(['delay' => function(RequestInterface $request, Exception $e, $retries) { - return 0; -}); -``` - -### Deprecated - -- The `debug_plugins` option for `PluginClient` is deprecated and will be removed in 2.0. Use the decorator design pattern instead like in [ProfilePlugin](https://github.com/php-http/HttplugBundle/blob/de33f9c14252f22093a5ec7d84f17535ab31a384/Collector/ProfilePlugin.php). - -## 1.5.0 - 2017-03-30 - -### Added - -- `QueryDefaultsPlugin` to add default query parameters. - -## 1.4.2 - 2017-03-18 - -### Deprecated - -- `DecoderPlugin` does not longer claim to support `compress` content encoding - -### Fixed - -- `CookiePlugin` allows main domain cookies to be sent/stored for subdomains -- `DecoderPlugin` uses the right `FilteredStream` to handle `deflate` content encoding - - -## 1.4.1 - 2017-02-20 - -### Fixed - -- Cast return value of `StreamInterface::getSize` to string in `ContentLengthPlugin` - - -## 1.4.0 - 2016-11-04 - -### Added - -- Add Path plugin -- Base URI plugin that combines Add Host and Add Path plugins - - -## 1.3.0 - 2016-10-16 - -### Changed - -- Fix Emulated Trait to use Http based promise which respect the HttpAsyncClient interface -- Require Httplug 1.1 where we use HTTP specific promises. -- RedirectPlugin: use the full URL instead of the URI to properly keep track of redirects -- Add AddPathPlugin for API URLs with base path -- Add BaseUriPlugin that combines AddHostPlugin and AddPathPlugin - - -## 1.2.1 - 2016-07-26 - -### Changed - -- AddHostPlugin also sets the port if specified - - -## 1.2.0 - 2016-07-14 - -### Added - -- Suggest separate plugins in composer.json -- Introduced `debug_plugins` option for `PluginClient` - - -## 1.1.0 - 2016-05-04 - -### Added - -- Add a flexible http client providing both contract, and only emulating what's necessary -- HTTP Client Router: route requests to underlying clients -- Plugin client and core plugins moved here from `php-http/plugins` - -### Deprecated - -- Extending client classes, they will be made final in version 2.0 - - -## 1.0.0 - 2016-01-27 - -### Changed - -- Remove useless interface in BatchException - - -## 0.2.0 - 2016-01-12 - -### Changed - -- Updated package files -- Updated HTTPlug to RC1 - - -## 0.1.1 - 2015-12-26 - -### Added - -- Emulated clients - - -## 0.1.0 - 2015-12-25 - -### Added - -- Batch client from utils -- Methods client from utils -- Emulators and decorators from client-tools diff --git a/vendor/php-http/client-common/LICENSE b/vendor/php-http/client-common/LICENSE deleted file mode 100644 index 4558d6f0..00000000 --- a/vendor/php-http/client-common/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2016 PHP HTTP Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/client-common/README.md b/vendor/php-http/client-common/README.md deleted file mode 100644 index 7d136587..00000000 --- a/vendor/php-http/client-common/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# HTTP Client Common - -[![Latest Version](https://img.shields.io/github/release/php-http/client-common.svg?style=flat-square)](https://github.com/php-http/client-common/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/php-http/client-common/master.svg?style=flat-square)](https://travis-ci.org/php-http/client-common) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/client-common.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/client-common) -[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/client-common.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/client-common) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/client-common.svg?style=flat-square)](https://packagist.org/packages/php-http/client-common) - -**Common HTTP Client implementations and tools for HTTPlug.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/client-common -``` - - -## Usage - -This package provides common tools for HTTP Clients: - -- BatchClient to handle sending requests in parallel -- A convenience client with HTTP method names as class methods -- Emulator, decorator layers for sync/async clients - - -## Documentation - -Please see the [official documentation](http://docs.php-http.org/en/latest/components/client-common.html). - - -## Testing - -``` bash -$ composer test -``` - - -## Contributing - -Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/client-common/composer.json b/vendor/php-http/client-common/composer.json deleted file mode 100644 index 2ea45aa6..00000000 --- a/vendor/php-http/client-common/composer.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "php-http/client-common", - "description": "Common HTTP Client implementations and tools for HTTPlug", - "license": "MIT", - "keywords": ["http", "client", "httplug", "common"], - "homepage": "http://httplug.io", - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php": "^7.1 || ^8.0", - "php-http/httplug": "^2.0", - "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.17" - }, - "require-dev": { - "doctrine/instantiator": "^1.1", - "guzzlehttp/psr7": "^1.4", - "nyholm/psr7": "^1.2", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "phpspec/prophecy": "^1.10.2", - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" - }, - "suggest": { - "ext-json": "To detect JSON responses with the ContentTypePlugin", - "ext-libxml": "To detect XML responses with the ContentTypePlugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" - }, - "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "spec\\Http\\Client\\Common\\": "spec/" - } - }, - "scripts": { - "test": [ - "vendor/bin/phpspec run", - "vendor/bin/phpunit" - ], - "test-ci": [ - "vendor/bin/phpspec run -c phpspec.ci.yml", - "vendor/bin/phpunit" - ] - }, - "config": { - "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-master": "2.3.x-dev" - } - } -} diff --git a/vendor/php-http/client-common/src/BatchClient.php b/vendor/php-http/client-common/src/BatchClient.php deleted file mode 100644 index 51f13ff6..00000000 --- a/vendor/php-http/client-common/src/BatchClient.php +++ /dev/null @@ -1,42 +0,0 @@ -client = $client; - } - - public function sendRequests(array $requests): BatchResult - { - $batchResult = new BatchResult(); - - foreach ($requests as $request) { - try { - $response = $this->client->sendRequest($request); - $batchResult = $batchResult->addResponse($request, $response); - } catch (ClientExceptionInterface $e) { - $batchResult = $batchResult->addException($request, $e); - } - } - - if ($batchResult->hasExceptions()) { - throw new BatchException($batchResult); - } - - return $batchResult; - } -} diff --git a/vendor/php-http/client-common/src/BatchClientInterface.php b/vendor/php-http/client-common/src/BatchClientInterface.php deleted file mode 100644 index d42eb2d4..00000000 --- a/vendor/php-http/client-common/src/BatchClientInterface.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -interface BatchClientInterface -{ - /** - * Send several requests. - * - * You may not assume that the requests are executed in a particular order. If the order matters - * for your application, use sendRequest sequentially. - * - * @param RequestInterface[] $requests The requests to send - * - * @return BatchResult Containing one result per request - * - * @throws BatchException If one or more requests fails. The exception gives access to the - * BatchResult with a map of request to result for success, request to - * exception for failures - */ - public function sendRequests(array $requests): BatchResult; -} diff --git a/vendor/php-http/client-common/src/BatchResult.php b/vendor/php-http/client-common/src/BatchResult.php deleted file mode 100644 index ccaf83cb..00000000 --- a/vendor/php-http/client-common/src/BatchResult.php +++ /dev/null @@ -1,157 +0,0 @@ - - */ -final class BatchResult -{ - /** - * @var \SplObjectStorage - */ - private $responses; - - /** - * @var \SplObjectStorage - */ - private $exceptions; - - public function __construct() - { - $this->responses = new \SplObjectStorage(); - $this->exceptions = new \SplObjectStorage(); - } - - /** - * Checks if there are any successful responses at all. - */ - public function hasResponses(): bool - { - return $this->responses->count() > 0; - } - - /** - * Returns all successful responses. - * - * @return ResponseInterface[] - */ - public function getResponses(): array - { - $responses = []; - - foreach ($this->responses as $request) { - $responses[] = $this->responses[$request]; - } - - return $responses; - } - - /** - * Checks if there is a successful response for a request. - */ - public function isSuccessful(RequestInterface $request): bool - { - return $this->responses->contains($request); - } - - /** - * Returns the response for a successful request. - * - * @throws \UnexpectedValueException If request was not part of the batch or failed - */ - public function getResponseFor(RequestInterface $request): ResponseInterface - { - try { - return $this->responses[$request]; - } catch (\UnexpectedValueException $e) { - throw new \UnexpectedValueException('Request not found', $e->getCode(), $e); - } - } - - /** - * Adds a response in an immutable way. - * - * @return BatchResult the new BatchResult with this request-response pair added to it - */ - public function addResponse(RequestInterface $request, ResponseInterface $response): self - { - $new = clone $this; - $new->responses->attach($request, $response); - - return $new; - } - - /** - * Checks if there are any unsuccessful requests at all. - */ - public function hasExceptions(): bool - { - return $this->exceptions->count() > 0; - } - - /** - * Returns all exceptions for the unsuccessful requests. - * - * @return ClientExceptionInterface[] - */ - public function getExceptions(): array - { - $exceptions = []; - - foreach ($this->exceptions as $request) { - $exceptions[] = $this->exceptions[$request]; - } - - return $exceptions; - } - - /** - * Checks if there is an exception for a request, meaning the request failed. - */ - public function isFailed(RequestInterface $request): bool - { - return $this->exceptions->contains($request); - } - - /** - * Returns the exception for a failed request. - * - * @throws \UnexpectedValueException If request was not part of the batch or was successful - */ - public function getExceptionFor(RequestInterface $request): ClientExceptionInterface - { - try { - return $this->exceptions[$request]; - } catch (\UnexpectedValueException $e) { - throw new \UnexpectedValueException('Request not found', $e->getCode(), $e); - } - } - - /** - * Adds an exception in an immutable way. - * - * @return BatchResult the new BatchResult with this request-exception pair added to it - */ - public function addException(RequestInterface $request, ClientExceptionInterface $exception): self - { - $new = clone $this; - $new->exceptions->attach($request, $exception); - - return $new; - } - - public function __clone() - { - $this->responses = clone $this->responses; - $this->exceptions = clone $this->exceptions; - } -} diff --git a/vendor/php-http/client-common/src/Deferred.php b/vendor/php-http/client-common/src/Deferred.php deleted file mode 100644 index ef2b3098..00000000 --- a/vendor/php-http/client-common/src/Deferred.php +++ /dev/null @@ -1,152 +0,0 @@ -waitCallback = $waitCallback; - $this->state = Promise::PENDING; - $this->onFulfilledCallbacks = []; - $this->onRejectedCallbacks = []; - } - - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null): Promise - { - $deferred = new self($this->waitCallback); - - $this->onFulfilledCallbacks[] = function (ResponseInterface $response) use ($onFulfilled, $deferred) { - try { - if (null !== $onFulfilled) { - $response = $onFulfilled($response); - } - $deferred->resolve($response); - } catch (ClientExceptionInterface $exception) { - $deferred->reject($exception); - } - }; - - $this->onRejectedCallbacks[] = function (ClientExceptionInterface $exception) use ($onRejected, $deferred) { - try { - if (null !== $onRejected) { - $response = $onRejected($exception); - $deferred->resolve($response); - - return; - } - $deferred->reject($exception); - } catch (ClientExceptionInterface $newException) { - $deferred->reject($newException); - } - }; - - return $deferred; - } - - /** - * {@inheritdoc} - */ - public function getState(): string - { - return $this->state; - } - - /** - * Resolve this deferred with a Response. - */ - public function resolve(ResponseInterface $response): void - { - if (Promise::PENDING !== $this->state) { - return; - } - - $this->value = $response; - $this->state = Promise::FULFILLED; - - foreach ($this->onFulfilledCallbacks as $onFulfilledCallback) { - $onFulfilledCallback($response); - } - } - - /** - * Reject this deferred with an Exception. - */ - public function reject(ClientExceptionInterface $exception): void - { - if (Promise::PENDING !== $this->state) { - return; - } - - $this->failure = $exception; - $this->state = Promise::REJECTED; - - foreach ($this->onRejectedCallbacks as $onRejectedCallback) { - $onRejectedCallback($exception); - } - } - - /** - * {@inheritdoc} - */ - public function wait($unwrap = true) - { - if (Promise::PENDING === $this->state) { - $callback = $this->waitCallback; - $callback(); - } - - if (!$unwrap) { - return null; - } - - if (Promise::FULFILLED === $this->state) { - return $this->value; - } - - /** @var ClientExceptionInterface */ - throw $this->failure; - } -} diff --git a/vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php b/vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php deleted file mode 100644 index 008f8880..00000000 --- a/vendor/php-http/client-common/src/EmulatedHttpAsyncClient.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -final class EmulatedHttpAsyncClient implements HttpClient, HttpAsyncClient -{ - use HttpAsyncClientEmulator; - use HttpClientDecorator; - - public function __construct(ClientInterface $httpClient) - { - $this->httpClient = $httpClient; - } -} diff --git a/vendor/php-http/client-common/src/EmulatedHttpClient.php b/vendor/php-http/client-common/src/EmulatedHttpClient.php deleted file mode 100644 index 5c2d8c48..00000000 --- a/vendor/php-http/client-common/src/EmulatedHttpClient.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -final class EmulatedHttpClient implements HttpClient, HttpAsyncClient -{ - use HttpAsyncClientDecorator; - use HttpClientEmulator; - - public function __construct(HttpAsyncClient $httpAsyncClient) - { - $this->httpAsyncClient = $httpAsyncClient; - } -} diff --git a/vendor/php-http/client-common/src/Exception/BatchException.php b/vendor/php-http/client-common/src/Exception/BatchException.php deleted file mode 100644 index a9cb08c8..00000000 --- a/vendor/php-http/client-common/src/Exception/BatchException.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -final class BatchException extends TransferException -{ - /** - * @var BatchResult - */ - private $result; - - public function __construct(BatchResult $result) - { - $this->result = $result; - parent::__construct(); - } - - /** - * Returns the BatchResult that contains all responses and exceptions. - */ - public function getResult(): BatchResult - { - return $this->result; - } -} diff --git a/vendor/php-http/client-common/src/Exception/CircularRedirectionException.php b/vendor/php-http/client-common/src/Exception/CircularRedirectionException.php deleted file mode 100644 index 9db927c2..00000000 --- a/vendor/php-http/client-common/src/Exception/CircularRedirectionException.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -final class CircularRedirectionException extends HttpException -{ -} diff --git a/vendor/php-http/client-common/src/Exception/ClientErrorException.php b/vendor/php-http/client-common/src/Exception/ClientErrorException.php deleted file mode 100644 index c657a3f8..00000000 --- a/vendor/php-http/client-common/src/Exception/ClientErrorException.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -final class ClientErrorException extends HttpException -{ -} diff --git a/vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php b/vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php deleted file mode 100644 index 682c5dd0..00000000 --- a/vendor/php-http/client-common/src/Exception/HttpClientNoMatchException.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -final class HttpClientNoMatchException extends TransferException -{ - /** - * @var RequestInterface - */ - private $request; - - public function __construct(string $message, RequestInterface $request, \Exception $previous = null) - { - $this->request = $request; - - parent::__construct($message, 0, $previous); - } - - public function getRequest(): RequestInterface - { - return $this->request; - } -} diff --git a/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php b/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php deleted file mode 100644 index 509daa53..00000000 --- a/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -final class HttpClientNotFoundException extends TransferException -{ -} diff --git a/vendor/php-http/client-common/src/Exception/LoopException.php b/vendor/php-http/client-common/src/Exception/LoopException.php deleted file mode 100644 index f4e173f3..00000000 --- a/vendor/php-http/client-common/src/Exception/LoopException.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -final class LoopException extends RequestException -{ -} diff --git a/vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php b/vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php deleted file mode 100644 index bf6c9f73..00000000 --- a/vendor/php-http/client-common/src/Exception/MultipleRedirectionException.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -final class MultipleRedirectionException extends HttpException -{ -} diff --git a/vendor/php-http/client-common/src/Exception/ServerErrorException.php b/vendor/php-http/client-common/src/Exception/ServerErrorException.php deleted file mode 100644 index 774b97f0..00000000 --- a/vendor/php-http/client-common/src/Exception/ServerErrorException.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -final class ServerErrorException extends HttpException -{ -} diff --git a/vendor/php-http/client-common/src/FlexibleHttpClient.php b/vendor/php-http/client-common/src/FlexibleHttpClient.php deleted file mode 100644 index c1e327fd..00000000 --- a/vendor/php-http/client-common/src/FlexibleHttpClient.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ -final class FlexibleHttpClient implements HttpClient, HttpAsyncClient -{ - use HttpClientDecorator; - use HttpAsyncClientDecorator; - - /** - * @param ClientInterface|HttpAsyncClient $client - */ - public function __construct($client) - { - if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { - throw new \TypeError( - sprintf('%s::__construct(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) - ); - } - - $this->httpClient = $client instanceof ClientInterface ? $client : new EmulatedHttpClient($client); - $this->httpAsyncClient = $client instanceof HttpAsyncClient ? $client : new EmulatedHttpAsyncClient($client); - } -} diff --git a/vendor/php-http/client-common/src/HttpAsyncClientDecorator.php b/vendor/php-http/client-common/src/HttpAsyncClientDecorator.php deleted file mode 100644 index 2714b4ac..00000000 --- a/vendor/php-http/client-common/src/HttpAsyncClientDecorator.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -trait HttpAsyncClientDecorator -{ - /** - * @var HttpAsyncClient - */ - protected $httpAsyncClient; - - /** - * {@inheritdoc} - * - * @see HttpAsyncClient::sendAsyncRequest - */ - public function sendAsyncRequest(RequestInterface $request) - { - return $this->httpAsyncClient->sendAsyncRequest($request); - } -} diff --git a/vendor/php-http/client-common/src/HttpAsyncClientEmulator.php b/vendor/php-http/client-common/src/HttpAsyncClientEmulator.php deleted file mode 100644 index 53c2535f..00000000 --- a/vendor/php-http/client-common/src/HttpAsyncClientEmulator.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -trait HttpAsyncClientEmulator -{ - /** - * {@inheritdoc} - * - * @see HttpClient::sendRequest - */ - abstract public function sendRequest(RequestInterface $request): ResponseInterface; - - /** - * {@inheritdoc} - * - * @see HttpAsyncClient::sendAsyncRequest - */ - public function sendAsyncRequest(RequestInterface $request) - { - try { - return new Promise\HttpFulfilledPromise($this->sendRequest($request)); - } catch (Exception $e) { - return new Promise\HttpRejectedPromise($e); - } - } -} diff --git a/vendor/php-http/client-common/src/HttpClientDecorator.php b/vendor/php-http/client-common/src/HttpClientDecorator.php deleted file mode 100644 index c00ba6f3..00000000 --- a/vendor/php-http/client-common/src/HttpClientDecorator.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -trait HttpClientDecorator -{ - /** - * @var ClientInterface - */ - protected $httpClient; - - /** - * {@inheritdoc} - * - * @see ClientInterface::sendRequest - */ - public function sendRequest(RequestInterface $request): ResponseInterface - { - return $this->httpClient->sendRequest($request); - } -} diff --git a/vendor/php-http/client-common/src/HttpClientEmulator.php b/vendor/php-http/client-common/src/HttpClientEmulator.php deleted file mode 100644 index 51e2c058..00000000 --- a/vendor/php-http/client-common/src/HttpClientEmulator.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -trait HttpClientEmulator -{ - /** - * {@inheritdoc} - * - * @see HttpClient::sendRequest - */ - public function sendRequest(RequestInterface $request): ResponseInterface - { - $promise = $this->sendAsyncRequest($request); - - return $promise->wait(); - } - - /** - * {@inheritdoc} - * - * @see HttpAsyncClient::sendAsyncRequest - */ - abstract public function sendAsyncRequest(RequestInterface $request); -} diff --git a/vendor/php-http/client-common/src/HttpClientPool.php b/vendor/php-http/client-common/src/HttpClientPool.php deleted file mode 100644 index 24ab4211..00000000 --- a/vendor/php-http/client-common/src/HttpClientPool.php +++ /dev/null @@ -1,24 +0,0 @@ -clientPool[] = $client; - } - - /** - * Return an http client given a specific strategy. - * - * @throws HttpClientNotFoundException When no http client has been found into the pool - * - * @return HttpClientPoolItem Return a http client that can do both sync or async - */ - abstract protected function chooseHttpClient(): HttpClientPoolItem; - - /** - * {@inheritdoc} - */ - public function sendAsyncRequest(RequestInterface $request) - { - return $this->chooseHttpClient()->sendAsyncRequest($request); - } - - /** - * {@inheritdoc} - */ - public function sendRequest(RequestInterface $request): ResponseInterface - { - return $this->chooseHttpClient()->sendRequest($request); - } -} diff --git a/vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php b/vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php deleted file mode 100644 index f29d0655..00000000 --- a/vendor/php-http/client-common/src/HttpClientPool/HttpClientPoolItem.php +++ /dev/null @@ -1,181 +0,0 @@ - - */ -class HttpClientPoolItem implements HttpClient, HttpAsyncClient -{ - /** - * @var int Number of request this client is currently sending - */ - private $sendingRequestCount = 0; - - /** - * @var \DateTime|null Time when this client has been disabled or null if enable - */ - private $disabledAt; - - /** - * Number of seconds until this client is enabled again after an error. - * - * null: never reenable this client. - * - * @var int|null - */ - private $reenableAfter; - - /** - * @var FlexibleHttpClient A http client responding to async and sync request - */ - private $client; - - /** - * @param ClientInterface|HttpAsyncClient $client - * @param int|null $reenableAfter Number of seconds until this client is enabled again after an error - */ - public function __construct($client, int $reenableAfter = null) - { - if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { - throw new \TypeError( - sprintf('%s::__construct(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) - ); - } - - $this->client = new FlexibleHttpClient($client); - $this->reenableAfter = $reenableAfter; - } - - /** - * {@inheritdoc} - */ - public function sendRequest(RequestInterface $request): ResponseInterface - { - if ($this->isDisabled()) { - throw new Exception\RequestException('Cannot send the request as this client has been disabled', $request); - } - - try { - $this->incrementRequestCount(); - $response = $this->client->sendRequest($request); - $this->decrementRequestCount(); - } catch (Exception $e) { - $this->disable(); - $this->decrementRequestCount(); - - throw $e; - } - - return $response; - } - - /** - * {@inheritdoc} - */ - public function sendAsyncRequest(RequestInterface $request) - { - if ($this->isDisabled()) { - throw new Exception\RequestException('Cannot send the request as this client has been disabled', $request); - } - - $this->incrementRequestCount(); - - return $this->client->sendAsyncRequest($request)->then(function ($response) { - $this->decrementRequestCount(); - - return $response; - }, function ($exception) { - $this->disable(); - $this->decrementRequestCount(); - - throw $exception; - }); - } - - /** - * Whether this client is disabled or not. - * - * If the client was disabled, calling this method checks if the client can - * be reenabled and if so enables it. - */ - public function isDisabled(): bool - { - if (null !== $this->reenableAfter && null !== $this->disabledAt) { - // Reenable after a certain time - $now = new \DateTime(); - - if (($now->getTimestamp() - $this->disabledAt->getTimestamp()) >= $this->reenableAfter) { - $this->enable(); - - return false; - } - - return true; - } - - return null !== $this->disabledAt; - } - - /** - * Get current number of request that are currently being sent by the underlying HTTP client. - */ - public function getSendingRequestCount(): int - { - return $this->sendingRequestCount; - } - - /** - * Increment the request count. - */ - private function incrementRequestCount(): void - { - ++$this->sendingRequestCount; - } - - /** - * Decrement the request count. - */ - private function decrementRequestCount(): void - { - --$this->sendingRequestCount; - } - - /** - * Enable the current client. - */ - private function enable(): void - { - $this->disabledAt = null; - } - - /** - * Disable the current client. - */ - private function disable(): void - { - $this->disabledAt = new \DateTime('now'); - } -} diff --git a/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php b/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php deleted file mode 100644 index 789c3579..00000000 --- a/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -final class LeastUsedClientPool extends HttpClientPool -{ - /** - * {@inheritdoc} - */ - protected function chooseHttpClient(): HttpClientPoolItem - { - $clientPool = array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { - return !$clientPoolItem->isDisabled(); - }); - - if (0 === count($clientPool)) { - throw new HttpClientNotFoundException('Cannot choose a http client as there is no one present in the pool'); - } - - usort($clientPool, function (HttpClientPoolItem $clientA, HttpClientPoolItem $clientB) { - if ($clientA->getSendingRequestCount() === $clientB->getSendingRequestCount()) { - return 0; - } - - if ($clientA->getSendingRequestCount() < $clientB->getSendingRequestCount()) { - return -1; - } - - return 1; - }); - - return reset($clientPool); - } -} diff --git a/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php b/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php deleted file mode 100644 index 789ba42f..00000000 --- a/vendor/php-http/client-common/src/HttpClientPool/RandomClientPool.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -final class RandomClientPool extends HttpClientPool -{ - /** - * {@inheritdoc} - */ - protected function chooseHttpClient(): HttpClientPoolItem - { - $clientPool = array_filter($this->clientPool, function (HttpClientPoolItem $clientPoolItem) { - return !$clientPoolItem->isDisabled(); - }); - - if (0 === count($clientPool)) { - throw new HttpClientNotFoundException('Cannot choose a http client as there is no one present in the pool'); - } - - return $clientPool[array_rand($clientPool)]; - } -} diff --git a/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php b/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php deleted file mode 100644 index 7c7b1910..00000000 --- a/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php +++ /dev/null @@ -1,42 +0,0 @@ - - */ -final class RoundRobinClientPool extends HttpClientPool -{ - /** - * {@inheritdoc} - */ - protected function chooseHttpClient(): HttpClientPoolItem - { - $last = current($this->clientPool); - - do { - $client = next($this->clientPool); - - if (false === $client) { - $client = reset($this->clientPool); - - if (false === $client) { - throw new HttpClientNotFoundException('Cannot choose a http client as there is no one present in the pool'); - } - } - - // Case when there is only one and the last one has been disabled - if ($last === $client && $client->isDisabled()) { - throw new HttpClientNotFoundException('Cannot choose a http client as there is no one enabled in the pool'); - } - } while ($client->isDisabled()); - - return $client; - } -} diff --git a/vendor/php-http/client-common/src/HttpClientRouter.php b/vendor/php-http/client-common/src/HttpClientRouter.php deleted file mode 100644 index 040d893a..00000000 --- a/vendor/php-http/client-common/src/HttpClientRouter.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -final class HttpClientRouter implements HttpClientRouterInterface -{ - /** - * @var (array{matcher: RequestMatcher, client: FlexibleHttpClient})[] - */ - private $clients = []; - - /** - * {@inheritdoc} - */ - public function sendRequest(RequestInterface $request): ResponseInterface - { - return $this->chooseHttpClient($request)->sendRequest($request); - } - - /** - * {@inheritdoc} - */ - public function sendAsyncRequest(RequestInterface $request) - { - return $this->chooseHttpClient($request)->sendAsyncRequest($request); - } - - /** - * Add a client to the router. - * - * @param ClientInterface|HttpAsyncClient $client - */ - public function addClient($client, RequestMatcher $requestMatcher): void - { - if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { - throw new \TypeError( - sprintf('%s::addClient(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) - ); - } - - $this->clients[] = [ - 'matcher' => $requestMatcher, - 'client' => new FlexibleHttpClient($client), - ]; - } - - /** - * Choose an HTTP client given a specific request. - */ - private function chooseHttpClient(RequestInterface $request): FlexibleHttpClient - { - foreach ($this->clients as $client) { - if ($client['matcher']->matches($request)) { - return $client['client']; - } - } - - throw new HttpClientNoMatchException('No client found for the specified request', $request); - } -} diff --git a/vendor/php-http/client-common/src/HttpClientRouterInterface.php b/vendor/php-http/client-common/src/HttpClientRouterInterface.php deleted file mode 100644 index ae012cf4..00000000 --- a/vendor/php-http/client-common/src/HttpClientRouterInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -interface HttpClientRouterInterface extends HttpClient, HttpAsyncClient -{ - /** - * Add a client to the router. - * - * @param ClientInterface|HttpAsyncClient $client - */ - public function addClient($client, RequestMatcher $requestMatcher): void; -} diff --git a/vendor/php-http/client-common/src/HttpMethodsClient.php b/vendor/php-http/client-common/src/HttpMethodsClient.php deleted file mode 100644 index 497921b1..00000000 --- a/vendor/php-http/client-common/src/HttpMethodsClient.php +++ /dev/null @@ -1,150 +0,0 @@ -httpClient = $httpClient; - $this->requestFactory = $requestFactory; - $this->streamFactory = $streamFactory; - } - - public function get($uri, array $headers = []): ResponseInterface - { - return $this->send('GET', $uri, $headers, null); - } - - public function head($uri, array $headers = []): ResponseInterface - { - return $this->send('HEAD', $uri, $headers, null); - } - - public function trace($uri, array $headers = []): ResponseInterface - { - return $this->send('TRACE', $uri, $headers, null); - } - - public function post($uri, array $headers = [], $body = null): ResponseInterface - { - return $this->send('POST', $uri, $headers, $body); - } - - public function put($uri, array $headers = [], $body = null): ResponseInterface - { - return $this->send('PUT', $uri, $headers, $body); - } - - public function patch($uri, array $headers = [], $body = null): ResponseInterface - { - return $this->send('PATCH', $uri, $headers, $body); - } - - public function delete($uri, array $headers = [], $body = null): ResponseInterface - { - return $this->send('DELETE', $uri, $headers, $body); - } - - public function options($uri, array $headers = [], $body = null): ResponseInterface - { - return $this->send('OPTIONS', $uri, $headers, $body); - } - - public function send(string $method, $uri, array $headers = [], $body = null): ResponseInterface - { - if (!is_string($uri) && !$uri instanceof UriInterface) { - throw new \TypeError( - sprintf('%s::send(): Argument #2 ($uri) must be of type string|%s, %s given', self::class, UriInterface::class, get_debug_type($uri)) - ); - } - - if (!is_string($body) && !$body instanceof StreamInterface && null !== $body) { - throw new \TypeError( - sprintf('%s::send(): Argument #4 ($body) must be of type string|%s|null, %s given', self::class, StreamInterface::class, get_debug_type($body)) - ); - } - - return $this->sendRequest( - self::createRequest($method, $uri, $headers, $body) - ); - } - - /** - * @param string|UriInterface $uri - * @param string|StreamInterface|null $body - */ - private function createRequest(string $method, $uri, array $headers = [], $body = null): RequestInterface - { - if ($this->requestFactory instanceof RequestFactory) { - return $this->requestFactory->createRequest( - $method, - $uri, - $headers, - $body - ); - } - - $request = $this->requestFactory->createRequest($method, $uri); - - foreach ($headers as $key => $value) { - $request = $request->withHeader($key, $value); - } - - if (null !== $body && '' !== $body) { - if (null === $this->streamFactory) { - throw new \RuntimeException('Cannot create request: A stream factory is required to create a request with a non-empty string body.'); - } - - $request = $request->withBody( - is_string($body) ? $this->streamFactory->createStream($body) : $body - ); - } - - return $request; - } - - public function sendRequest(RequestInterface $request): ResponseInterface - { - return $this->httpClient->sendRequest($request); - } -} diff --git a/vendor/php-http/client-common/src/HttpMethodsClientInterface.php b/vendor/php-http/client-common/src/HttpMethodsClientInterface.php deleted file mode 100644 index bc0829ae..00000000 --- a/vendor/php-http/client-common/src/HttpMethodsClientInterface.php +++ /dev/null @@ -1,116 +0,0 @@ -get('/foo') - * ->post('/bar') - * ; - * - * The client also exposes the sendRequest methods of the wrapped HttpClient. - * - * @author Márk Sági-Kazár - * @author David Buchmann - */ -interface HttpMethodsClientInterface extends HttpClient -{ - /** - * Sends a GET request. - * - * @param string|UriInterface $uri - * - * @throws Exception - */ - public function get($uri, array $headers = []): ResponseInterface; - - /** - * Sends an HEAD request. - * - * @param string|UriInterface $uri - * - * @throws Exception - */ - public function head($uri, array $headers = []): ResponseInterface; - - /** - * Sends a TRACE request. - * - * @param string|UriInterface $uri - * - * @throws Exception - */ - public function trace($uri, array $headers = []): ResponseInterface; - - /** - * Sends a POST request. - * - * @param string|UriInterface $uri - * @param string|StreamInterface|null $body - * - * @throws Exception - */ - public function post($uri, array $headers = [], $body = null): ResponseInterface; - - /** - * Sends a PUT request. - * - * @param string|UriInterface $uri - * @param string|StreamInterface|null $body - * - * @throws Exception - */ - public function put($uri, array $headers = [], $body = null): ResponseInterface; - - /** - * Sends a PATCH request. - * - * @param string|UriInterface $uri - * @param string|StreamInterface|null $body - * - * @throws Exception - */ - public function patch($uri, array $headers = [], $body = null): ResponseInterface; - - /** - * Sends a DELETE request. - * - * @param string|UriInterface $uri - * @param string|StreamInterface|null $body - * - * @throws Exception - */ - public function delete($uri, array $headers = [], $body = null): ResponseInterface; - - /** - * Sends an OPTIONS request. - * - * @param string|UriInterface $uri - * @param string|StreamInterface|null $body - * - * @throws Exception - */ - public function options($uri, array $headers = [], $body = null): ResponseInterface; - - /** - * Sends a request with any HTTP method. - * - * @param string $method HTTP method to use - * @param string|UriInterface $uri - * @param string|StreamInterface|null $body - * - * @throws Exception - */ - public function send(string $method, $uri, array $headers = [], $body = null): ResponseInterface; -} diff --git a/vendor/php-http/client-common/src/Plugin.php b/vendor/php-http/client-common/src/Plugin.php deleted file mode 100644 index 99898b92..00000000 --- a/vendor/php-http/client-common/src/Plugin.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -interface Plugin -{ - /** - * Handle the request and return the response coming from the next callable. - * - * @see http://docs.php-http.org/en/latest/plugins/build-your-own.html - * - * @param callable(RequestInterface): Promise $next Next middleware in the chain, the request is passed as the first argument - * @param callable(RequestInterface): Promise $first First middleware in the chain, used to to restart a request - * - * @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient) - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise; -} diff --git a/vendor/php-http/client-common/src/Plugin/AddHostPlugin.php b/vendor/php-http/client-common/src/Plugin/AddHostPlugin.php deleted file mode 100644 index c7fb05a1..00000000 --- a/vendor/php-http/client-common/src/Plugin/AddHostPlugin.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -final class AddHostPlugin implements Plugin -{ - /** - * @var UriInterface - */ - private $host; - - /** - * @var bool - */ - private $replace; - - /** - * @param array{'replace'?: bool} $config - * - * Configuration options: - * - replace: True will replace all hosts, false will only add host when none is specified. - */ - public function __construct(UriInterface $host, array $config = []) - { - if ('' === $host->getHost()) { - throw new \LogicException('Host can not be empty'); - } - - $this->host = $host; - - $resolver = new OptionsResolver(); - $this->configureOptions($resolver); - $options = $resolver->resolve($config); - - $this->replace = $options['replace']; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - if ($this->replace || '' === $request->getUri()->getHost()) { - $uri = $request->getUri() - ->withHost($this->host->getHost()) - ->withScheme($this->host->getScheme()) - ->withPort($this->host->getPort()) - ; - - $request = $request->withUri($uri); - } - - return $next($request); - } - - private function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'replace' => false, - ]); - $resolver->setAllowedTypes('replace', 'bool'); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php b/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php deleted file mode 100644 index 9d43104f..00000000 --- a/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php +++ /dev/null @@ -1,78 +0,0 @@ - - */ -final class AddPathPlugin implements Plugin -{ - /** - * @var UriInterface - */ - private $uri; - - public function __construct(UriInterface $uri) - { - if ('' === $uri->getPath()) { - throw new \LogicException('URI path cannot be empty'); - } - - if ('/' === substr($uri->getPath(), -1)) { - $uri = $uri->withPath(rtrim($uri->getPath(), '/')); - } - - $this->uri = $uri; - } - - /** - * Adds a prefix in the beginning of the URL's path. - * - * The prefix is not added if that prefix is already on the URL's path. This will fail on the edge - * case of the prefix being repeated, for example if `https://example.com/api/api/foo` is a valid - * URL on the server and the configured prefix is `/api`. - * - * We looked at other solutions, but they are all much more complicated, while still having edge - * cases: - * - Doing an spl_object_hash on `$first` will lead to collisions over time because over time the - * hash can collide. - * - Have the PluginClient provide a magic header to identify the request chain and only apply - * this plugin once. - * - * There are 2 reasons for the AddPathPlugin to be executed twice on the same request: - * - A plugin can restart the chain by calling `$first`, e.g. redirect - * - A plugin can call `$next` more than once, e.g. retry - * - * Depending on the scenario, the path should or should not be added. E.g. `$first` could - * be called after a redirect response from the server. The server likely already has the - * correct path. - * - * No solution fits all use cases. This implementation will work fine for the common use cases. - * If you have a specific situation where this is not the right thing, you can build a custom plugin - * that does exactly what you need. - * - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $prepend = $this->uri->getPath(); - $path = $request->getUri()->getPath(); - - if (substr($path, 0, strlen($prepend)) !== $prepend) { - $request = $request->withUri($request->getUri() - ->withPath($prepend.$path) - ); - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php b/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php deleted file mode 100644 index ce9d4bd1..00000000 --- a/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php +++ /dev/null @@ -1,38 +0,0 @@ - - */ -final class AuthenticationPlugin implements Plugin -{ - /** - * @var Authentication An authentication system - */ - private $authentication; - - public function __construct(Authentication $authentication) - { - $this->authentication = $authentication; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $request = $this->authentication->authenticate($request); - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php b/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php deleted file mode 100644 index 34c3b641..00000000 --- a/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ -final class BaseUriPlugin implements Plugin -{ - /** - * @var AddHostPlugin - */ - private $addHostPlugin; - - /** - * @var AddPathPlugin|null - */ - private $addPathPlugin = null; - - /** - * @param UriInterface $uri Has to contain a host name and can have a path - * @param array $hostConfig Config for AddHostPlugin. @see AddHostPlugin::configureOptions - */ - public function __construct(UriInterface $uri, array $hostConfig = []) - { - $this->addHostPlugin = new AddHostPlugin($uri, $hostConfig); - - if (rtrim($uri->getPath(), '/')) { - $this->addPathPlugin = new AddPathPlugin($uri); - } - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $addHostNext = function (RequestInterface $request) use ($next, $first) { - return $this->addHostPlugin->handleRequest($request, $next, $first); - }; - - if ($this->addPathPlugin) { - return $this->addPathPlugin->handleRequest($request, $addHostNext, $first); - } - - return $addHostNext($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php b/vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php deleted file mode 100644 index f313c330..00000000 --- a/vendor/php-http/client-common/src/Plugin/ContentLengthPlugin.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -final class ContentLengthPlugin implements Plugin -{ - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - if (!$request->hasHeader('Content-Length')) { - $stream = $request->getBody(); - - // Cannot determine the size so we use a chunk stream - if (null === $stream->getSize()) { - $stream = new ChunkStream($stream); - $request = $request->withBody($stream); - $request = $request->withAddedHeader('Transfer-Encoding', 'chunked'); - } else { - $request = $request->withHeader('Content-Length', (string) $stream->getSize()); - } - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php b/vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php deleted file mode 100644 index 9a87f99e..00000000 --- a/vendor/php-http/client-common/src/Plugin/ContentTypePlugin.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ -final class ContentTypePlugin implements Plugin -{ - /** - * Allow to disable the content type detection when stream is too large (as it can consume a lot of resource). - * - * @var bool - * - * true skip the content type detection - * false detect the content type (default value) - */ - private $skipDetection; - - /** - * Determine the size stream limit for which the detection as to be skipped (default to 16Mb). - * - * @var int - */ - private $sizeLimit; - - /** - * @param array{'skip_detection'?: bool, 'size_limit'?: int} $config - * - * Configuration options: - * - skip_detection: true skip detection if stream size is bigger than $size_limit - * - size_limit: size stream limit for which the detection as to be skipped. - */ - public function __construct(array $config = []) - { - $resolver = new OptionsResolver(); - $resolver->setDefaults([ - 'skip_detection' => false, - 'size_limit' => 16000000, - ]); - $resolver->setAllowedTypes('skip_detection', 'bool'); - $resolver->setAllowedTypes('size_limit', 'int'); - - $options = $resolver->resolve($config); - - $this->skipDetection = $options['skip_detection']; - $this->sizeLimit = $options['size_limit']; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - if (!$request->hasHeader('Content-Type')) { - $stream = $request->getBody(); - $streamSize = $stream->getSize(); - - if (!$stream->isSeekable()) { - return $next($request); - } - - if (0 === $streamSize) { - return $next($request); - } - - if ($this->skipDetection && (null === $streamSize || $streamSize >= $this->sizeLimit)) { - return $next($request); - } - - if ($this->isJson($stream)) { - $request = $request->withHeader('Content-Type', 'application/json'); - - return $next($request); - } - - if ($this->isXml($stream)) { - $request = $request->withHeader('Content-Type', 'application/xml'); - - return $next($request); - } - } - - return $next($request); - } - - private function isJson(StreamInterface $stream): bool - { - if (!function_exists('json_decode')) { - return false; - } - $stream->rewind(); - - json_decode($stream->getContents()); - - return JSON_ERROR_NONE === json_last_error(); - } - - private function isXml(StreamInterface $stream): bool - { - if (!function_exists('simplexml_load_string')) { - return false; - } - $stream->rewind(); - - $previousValue = libxml_use_internal_errors(true); - $isXml = simplexml_load_string($stream->getContents()); - libxml_use_internal_errors($previousValue); - - return false !== $isXml; - } -} diff --git a/vendor/php-http/client-common/src/Plugin/CookiePlugin.php b/vendor/php-http/client-common/src/Plugin/CookiePlugin.php deleted file mode 100644 index aa4d5d7e..00000000 --- a/vendor/php-http/client-common/src/Plugin/CookiePlugin.php +++ /dev/null @@ -1,180 +0,0 @@ - - */ -final class CookiePlugin implements Plugin -{ - /** - * Cookie storage. - * - * @var CookieJar - */ - private $cookieJar; - - public function __construct(CookieJar $cookieJar) - { - $this->cookieJar = $cookieJar; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $cookies = []; - foreach ($this->cookieJar->getCookies() as $cookie) { - if ($cookie->isExpired()) { - continue; - } - - if (!$cookie->matchDomain($request->getUri()->getHost())) { - continue; - } - - if (!$cookie->matchPath($request->getUri()->getPath())) { - continue; - } - - if ($cookie->isSecure() && ('https' !== $request->getUri()->getScheme())) { - continue; - } - - $cookies[] = sprintf('%s=%s', $cookie->getName(), $cookie->getValue()); - } - - if (!empty($cookies)) { - $request = $request->withAddedHeader('Cookie', implode('; ', array_unique($cookies))); - } - - return $next($request)->then(function (ResponseInterface $response) use ($request) { - if ($response->hasHeader('Set-Cookie')) { - $setCookies = $response->getHeader('Set-Cookie'); - - foreach ($setCookies as $setCookie) { - $cookie = $this->createCookie($request, $setCookie); - - // Cookie invalid do not use it - if (null === $cookie) { - continue; - } - - // Restrict setting cookie from another domain - if (!preg_match("/\.{$cookie->getDomain()}$/", '.'.$request->getUri()->getHost())) { - continue; - } - - $this->cookieJar->addCookie($cookie); - } - } - - return $response; - }); - } - - /** - * Creates a cookie from a string. - * - * @throws TransferException - */ - private function createCookie(RequestInterface $request, string $setCookieHeader): ?Cookie - { - $parts = array_map('trim', explode(';', $setCookieHeader)); - - if ('' === $parts[0] || false === strpos($parts[0], '=')) { - return null; - } - - list($name, $cookieValue) = $this->createValueKey(array_shift($parts)); - - $maxAge = null; - $expires = null; - $domain = $request->getUri()->getHost(); - $path = $request->getUri()->getPath(); - $secure = false; - $httpOnly = false; - - // Add the cookie pieces into the parsed data array - foreach ($parts as $part) { - list($key, $value) = $this->createValueKey($part); - - switch (strtolower($key)) { - case 'expires': - try { - $expires = CookieUtil::parseDate((string) $value); - } catch (UnexpectedValueException $e) { - throw new TransferException( - sprintf( - 'Cookie header `%s` expires value `%s` could not be converted to date', - $name, - $value - ), - 0, - $e - ); - } - - break; - - case 'max-age': - $maxAge = (int) $value; - - break; - - case 'domain': - $domain = $value; - - break; - - case 'path': - $path = $value; - - break; - - case 'secure': - $secure = true; - - break; - - case 'httponly': - $httpOnly = true; - - break; - } - } - - return new Cookie($name, $cookieValue, $maxAge, $domain, $path, $secure, $httpOnly, $expires); - } - - /** - * Separates key/value pair from cookie. - * - * @param string $part A single cookie value in format key=value - * - * @return array{0:string, 1:?string} - */ - private function createValueKey(string $part): array - { - $parts = explode('=', $part, 2); - $key = trim($parts[0]); - $value = isset($parts[1]) ? trim($parts[1]) : null; - - return [$key, $value]; - } -} diff --git a/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php b/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php deleted file mode 100644 index b685967d..00000000 --- a/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php +++ /dev/null @@ -1,135 +0,0 @@ - - */ -final class DecoderPlugin implements Plugin -{ - /** - * @var bool Whether this plugin decode stream with value in the Content-Encoding header (default to true). - * - * If set to false only the Transfer-Encoding header will be used - */ - private $useContentEncoding; - - /** - * @param array{'use_content_encoding'?: bool} $config - * - * Configuration options: - * - use_content_encoding: Whether this plugin should look at the Content-Encoding header first or only at the Transfer-Encoding (defaults to true). - */ - public function __construct(array $config = []) - { - $resolver = new OptionsResolver(); - $resolver->setDefaults([ - 'use_content_encoding' => true, - ]); - $resolver->setAllowedTypes('use_content_encoding', 'bool'); - $options = $resolver->resolve($config); - - $this->useContentEncoding = $options['use_content_encoding']; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $encodings = extension_loaded('zlib') ? ['gzip', 'deflate'] : ['identity']; - - if ($this->useContentEncoding) { - $request = $request->withHeader('Accept-Encoding', $encodings); - } - $encodings[] = 'chunked'; - $request = $request->withHeader('TE', $encodings); - - return $next($request)->then(function (ResponseInterface $response) { - return $this->decodeResponse($response); - }); - } - - /** - * Decode a response body given its Transfer-Encoding or Content-Encoding value. - */ - private function decodeResponse(ResponseInterface $response): ResponseInterface - { - $response = $this->decodeOnEncodingHeader('Transfer-Encoding', $response); - - if ($this->useContentEncoding) { - $response = $this->decodeOnEncodingHeader('Content-Encoding', $response); - } - - return $response; - } - - /** - * Decode a response on a specific header (content encoding or transfer encoding mainly). - */ - private function decodeOnEncodingHeader(string $headerName, ResponseInterface $response): ResponseInterface - { - if ($response->hasHeader($headerName)) { - $encodings = $response->getHeader($headerName); - $newEncodings = []; - - while ($encoding = array_pop($encodings)) { - $stream = $this->decorateStream($encoding, $response->getBody()); - - if (false === $stream) { - array_unshift($newEncodings, $encoding); - - continue; - } - - $response = $response->withBody($stream); - } - - if (\count($newEncodings) > 0) { - $response = $response->withHeader($headerName, $newEncodings); - } else { - $response = $response->withoutHeader($headerName); - } - } - - return $response; - } - - /** - * Decorate a stream given an encoding. - * - * @return StreamInterface|false A new stream interface or false if encoding is not supported - */ - private function decorateStream(string $encoding, StreamInterface $stream) - { - if ('chunked' === strtolower($encoding)) { - return new Encoding\DechunkStream($stream); - } - - if ('deflate' === strtolower($encoding)) { - return new Encoding\DecompressStream($stream); - } - - if ('gzip' === strtolower($encoding)) { - return new Encoding\GzipDecodeStream($stream); - } - - return false; - } -} diff --git a/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php b/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php deleted file mode 100644 index 06c795f5..00000000 --- a/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ -final class ErrorPlugin implements Plugin -{ - /** - * @var bool Whether this plugin should only throw 5XX Exceptions (default to false). - * - * If set to true 4XX Responses code will never throw an exception - */ - private $onlyServerException; - - /** - * @param array{'only_server_exception'?: bool} $config - * - * Configuration options: - * - only_server_exception: Whether this plugin should only throw 5XX Exceptions (default to false). - */ - public function __construct(array $config = []) - { - $resolver = new OptionsResolver(); - $resolver->setDefaults([ - 'only_server_exception' => false, - ]); - $resolver->setAllowedTypes('only_server_exception', 'bool'); - $options = $resolver->resolve($config); - - $this->onlyServerException = $options['only_server_exception']; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $promise = $next($request); - - return $promise->then(function (ResponseInterface $response) use ($request) { - return $this->transformResponseToException($request, $response); - }); - } - - /** - * Transform response to an error if possible. - * - * @param RequestInterface $request Request of the call - * @param ResponseInterface $response Response of the call - * - * @throws ClientErrorException If response status code is a 4xx - * @throws ServerErrorException If response status code is a 5xx - * - * @return ResponseInterface If status code is not in 4xx or 5xx return response - */ - private function transformResponseToException(RequestInterface $request, ResponseInterface $response): ResponseInterface - { - if (!$this->onlyServerException && $response->getStatusCode() >= 400 && $response->getStatusCode() < 500) { - throw new ClientErrorException($response->getReasonPhrase(), $request, $response); - } - - if ($response->getStatusCode() >= 500 && $response->getStatusCode() < 600) { - throw new ServerErrorException($response->getReasonPhrase(), $request, $response); - } - - return $response; - } -} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php deleted file mode 100644 index 95ea673c..00000000 --- a/vendor/php-http/client-common/src/Plugin/HeaderAppendPlugin.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -final class HeaderAppendPlugin implements Plugin -{ - /** - * @var array - */ - private $headers; - - /** - * @param array $headers Hashmap of header name to header value - */ - public function __construct(array $headers) - { - $this->headers = $headers; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - foreach ($this->headers as $header => $headerValue) { - $request = $request->withAddedHeader($header, $headerValue); - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php deleted file mode 100644 index bf580700..00000000 --- a/vendor/php-http/client-common/src/Plugin/HeaderDefaultsPlugin.php +++ /dev/null @@ -1,46 +0,0 @@ - - */ -final class HeaderDefaultsPlugin implements Plugin -{ - /** - * @var array - */ - private $headers = []; - - /** - * @param array $headers Hashmap of header name to header value - */ - public function __construct(array $headers) - { - $this->headers = $headers; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - foreach ($this->headers as $header => $headerValue) { - if (!$request->hasHeader($header)) { - $request = $request->withHeader($header, $headerValue); - } - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php deleted file mode 100644 index 9f4ca44e..00000000 --- a/vendor/php-http/client-common/src/Plugin/HeaderRemovePlugin.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -final class HeaderRemovePlugin implements Plugin -{ - /** - * @var array - */ - private $headers = []; - - /** - * @param array $headers List of header names to remove from the request - */ - public function __construct(array $headers) - { - $this->headers = $headers; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - foreach ($this->headers as $header) { - if ($request->hasHeader($header)) { - $request = $request->withoutHeader($header); - } - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php b/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php deleted file mode 100644 index 06f00eb8..00000000 --- a/vendor/php-http/client-common/src/Plugin/HeaderSetPlugin.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -final class HeaderSetPlugin implements Plugin -{ - /** - * @var array - */ - private $headers; - - /** - * @param array $headers Hashmap of header name to header value - */ - public function __construct(array $headers) - { - $this->headers = $headers; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - foreach ($this->headers as $header => $headerValue) { - $request = $request->withHeader($header, $headerValue); - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php b/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php deleted file mode 100644 index a1796a6f..00000000 --- a/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php +++ /dev/null @@ -1,49 +0,0 @@ - - */ -final class HistoryPlugin implements Plugin -{ - /** - * Journal use to store request / responses / exception. - * - * @var Journal - */ - private $journal; - - public function __construct(Journal $journal) - { - $this->journal = $journal; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $journal = $this->journal; - - return $next($request)->then(function (ResponseInterface $response) use ($request, $journal) { - $journal->addSuccess($request, $response); - - return $response; - }, function (ClientExceptionInterface $exception) use ($request, $journal) { - $journal->addFailure($request, $exception); - - throw $exception; - }); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/Journal.php b/vendor/php-http/client-common/src/Plugin/Journal.php deleted file mode 100644 index 9faa9381..00000000 --- a/vendor/php-http/client-common/src/Plugin/Journal.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ -interface Journal -{ - /** - * Record a successful call. - * - * @param RequestInterface $request Request use to make the call - * @param ResponseInterface $response Response returned by the call - */ - public function addSuccess(RequestInterface $request, ResponseInterface $response); - - /** - * Record a failed call. - * - * @param RequestInterface $request Request use to make the call - * @param ClientExceptionInterface $exception Exception returned by the call - */ - public function addFailure(RequestInterface $request, ClientExceptionInterface $exception); -} diff --git a/vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php b/vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php deleted file mode 100644 index 4c8087c4..00000000 --- a/vendor/php-http/client-common/src/Plugin/QueryDefaultsPlugin.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ -final class QueryDefaultsPlugin implements Plugin -{ - /** - * @var array - */ - private $queryParams = []; - - /** - * @param array $queryParams Hashmap of query name to query value. Names and values must not be url encoded as - * this plugin will encode them - */ - public function __construct(array $queryParams) - { - $this->queryParams = $queryParams; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $uri = $request->getUri(); - - parse_str($uri->getQuery(), $query); - $query += $this->queryParams; - - $request = $request->withUri( - $uri->withQuery(http_build_query($query)) - ); - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php b/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php deleted file mode 100644 index 5b45826e..00000000 --- a/vendor/php-http/client-common/src/Plugin/RedirectPlugin.php +++ /dev/null @@ -1,265 +0,0 @@ - - */ -final class RedirectPlugin implements Plugin -{ - /** - * Rule on how to redirect, change method for the new request. - * - * @var array - */ - private $redirectCodes = [ - 300 => [ - 'switch' => [ - 'unless' => ['GET', 'HEAD'], - 'to' => 'GET', - ], - 'multiple' => true, - 'permanent' => false, - ], - 301 => [ - 'switch' => [ - 'unless' => ['GET', 'HEAD'], - 'to' => 'GET', - ], - 'multiple' => false, - 'permanent' => true, - ], - 302 => [ - 'switch' => [ - 'unless' => ['GET', 'HEAD'], - 'to' => 'GET', - ], - 'multiple' => false, - 'permanent' => false, - ], - 303 => [ - 'switch' => [ - 'unless' => ['GET', 'HEAD'], - 'to' => 'GET', - ], - 'multiple' => false, - 'permanent' => false, - ], - 307 => [ - 'switch' => false, - 'multiple' => false, - 'permanent' => false, - ], - 308 => [ - 'switch' => false, - 'multiple' => false, - 'permanent' => true, - ], - ]; - - /** - * Determine how header should be preserved from old request. - * - * @var bool|array - * - * true will keep all previous headers (default value) - * false will ditch all previous headers - * string[] will keep only headers with the specified names - */ - private $preserveHeader; - - /** - * Store all previous redirect from 301 / 308 status code. - * - * @var array - */ - private $redirectStorage = []; - - /** - * Whether the location header must be directly used for a multiple redirection status code (300). - * - * @var bool - */ - private $useDefaultForMultiple; - - /** - * @var string[][] Chain identifier => list of URLs for this chain - */ - private $circularDetection = []; - - /** - * @param array{'preserve_header'?: bool|string[], 'use_default_for_multiple'?: bool, 'strict'?: bool} $config - * - * Configuration options: - * - preserve_header: True keeps all headers, false remove all of them, an array is interpreted as a list of header names to keep - * - use_default_for_multiple: Whether the location header must be directly used for a multiple redirection status code (300) - * - strict: When true, redirect codes 300, 301, 302 will not modify request method and body. - */ - public function __construct(array $config = []) - { - $resolver = new OptionsResolver(); - $resolver->setDefaults([ - 'preserve_header' => true, - 'use_default_for_multiple' => true, - 'strict' => false, - ]); - $resolver->setAllowedTypes('preserve_header', ['bool', 'array']); - $resolver->setAllowedTypes('use_default_for_multiple', 'bool'); - $resolver->setAllowedTypes('strict', 'bool'); - $resolver->setNormalizer('preserve_header', function (OptionsResolver $resolver, $value) { - if (is_bool($value) && false === $value) { - return []; - } - - return $value; - }); - $options = $resolver->resolve($config); - - $this->preserveHeader = $options['preserve_header']; - $this->useDefaultForMultiple = $options['use_default_for_multiple']; - - if ($options['strict']) { - $this->redirectCodes[300]['switch'] = false; - $this->redirectCodes[301]['switch'] = false; - $this->redirectCodes[302]['switch'] = false; - } - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - // Check in storage - if (array_key_exists((string) $request->getUri(), $this->redirectStorage)) { - $uri = $this->redirectStorage[(string) $request->getUri()]['uri']; - $statusCode = $this->redirectStorage[(string) $request->getUri()]['status']; - $redirectRequest = $this->buildRedirectRequest($request, $uri, $statusCode); - - return $first($redirectRequest); - } - - return $next($request)->then(function (ResponseInterface $response) use ($request, $first): ResponseInterface { - $statusCode = $response->getStatusCode(); - - if (!array_key_exists($statusCode, $this->redirectCodes)) { - return $response; - } - - $uri = $this->createUri($response, $request); - $redirectRequest = $this->buildRedirectRequest($request, $uri, $statusCode); - $chainIdentifier = spl_object_hash((object) $first); - - if (!array_key_exists($chainIdentifier, $this->circularDetection)) { - $this->circularDetection[$chainIdentifier] = []; - } - - $this->circularDetection[$chainIdentifier][] = (string) $request->getUri(); - - if (in_array((string) $redirectRequest->getUri(), $this->circularDetection[$chainIdentifier])) { - throw new CircularRedirectionException('Circular redirection detected', $request, $response); - } - - if ($this->redirectCodes[$statusCode]['permanent']) { - $this->redirectStorage[(string) $request->getUri()] = [ - 'uri' => $uri, - 'status' => $statusCode, - ]; - } - - // Call redirect request synchronously - return $first($redirectRequest)->wait(); - }); - } - - private function buildRedirectRequest(RequestInterface $originalRequest, UriInterface $targetUri, int $statusCode): RequestInterface - { - $originalRequest = $originalRequest->withUri($targetUri); - - if (false !== $this->redirectCodes[$statusCode]['switch'] && !in_array($originalRequest->getMethod(), $this->redirectCodes[$statusCode]['switch']['unless'])) { - $originalRequest = $originalRequest->withMethod($this->redirectCodes[$statusCode]['switch']['to']); - } - - if (is_array($this->preserveHeader)) { - $headers = array_keys($originalRequest->getHeaders()); - - foreach ($headers as $name) { - if (!in_array($name, $this->preserveHeader)) { - $originalRequest = $originalRequest->withoutHeader($name); - } - } - } - - return $originalRequest; - } - - /** - * Creates a new Uri from the old request and the location header. - * - * @throws HttpException If location header is not usable (missing or incorrect) - * @throws MultipleRedirectionException If a 300 status code is received and default location cannot be resolved (doesn't use the location header or not present) - */ - private function createUri(ResponseInterface $redirectResponse, RequestInterface $originalRequest): UriInterface - { - if ($this->redirectCodes[$redirectResponse->getStatusCode()]['multiple'] && (!$this->useDefaultForMultiple || !$redirectResponse->hasHeader('Location'))) { - throw new MultipleRedirectionException('Cannot choose a redirection', $originalRequest, $redirectResponse); - } - - if (!$redirectResponse->hasHeader('Location')) { - throw new HttpException('Redirect status code, but no location header present in the response', $originalRequest, $redirectResponse); - } - - $location = $redirectResponse->getHeaderLine('Location'); - $parsedLocation = parse_url($location); - - if (false === $parsedLocation) { - throw new HttpException(sprintf('Location %s could not be parsed', $location), $originalRequest, $redirectResponse); - } - - $uri = $originalRequest->getUri(); - - if (array_key_exists('scheme', $parsedLocation)) { - $uri = $uri->withScheme($parsedLocation['scheme']); - } - - if (array_key_exists('host', $parsedLocation)) { - $uri = $uri->withHost($parsedLocation['host']); - } - - if (array_key_exists('port', $parsedLocation)) { - $uri = $uri->withPort($parsedLocation['port']); - } - - if (array_key_exists('path', $parsedLocation)) { - $uri = $uri->withPath($parsedLocation['path']); - } - - if (array_key_exists('query', $parsedLocation)) { - $uri = $uri->withQuery($parsedLocation['query']); - } else { - $uri = $uri->withQuery(''); - } - - if (array_key_exists('fragment', $parsedLocation)) { - $uri = $uri->withFragment($parsedLocation['fragment']); - } else { - $uri = $uri->withFragment(''); - } - - return $uri; - } -} diff --git a/vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php b/vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php deleted file mode 100644 index 45d4375d..00000000 --- a/vendor/php-http/client-common/src/Plugin/RequestMatcherPlugin.php +++ /dev/null @@ -1,56 +0,0 @@ - - */ -final class RequestMatcherPlugin implements Plugin -{ - /** - * @var RequestMatcher - */ - private $requestMatcher; - - /** - * @var Plugin|null - */ - private $successPlugin; - - /** - * @var Plugin|null - */ - private $failurePlugin; - - public function __construct(RequestMatcher $requestMatcher, ?Plugin $delegateOnMatch, Plugin $delegateOnNoMatch = null) - { - $this->requestMatcher = $requestMatcher; - $this->successPlugin = $delegateOnMatch; - $this->failurePlugin = $delegateOnNoMatch; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - if ($this->requestMatcher->matches($request)) { - if (null !== $this->successPlugin) { - return $this->successPlugin->handleRequest($request, $next, $first); - } - } elseif (null !== $this->failurePlugin) { - return $this->failurePlugin->handleRequest($request, $next, $first); - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php b/vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php deleted file mode 100644 index 1b6c5289..00000000 --- a/vendor/php-http/client-common/src/Plugin/RequestSeekableBodyPlugin.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ -final class RequestSeekableBodyPlugin extends SeekableBodyPlugin -{ - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - if (!$request->getBody()->isSeekable()) { - $request = $request->withBody(new BufferedStream($request->getBody(), $this->useFileBuffer, $this->memoryBufferSize)); - } - - return $next($request); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php b/vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php deleted file mode 100644 index 6f941b65..00000000 --- a/vendor/php-http/client-common/src/Plugin/ResponseSeekableBodyPlugin.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -final class ResponseSeekableBodyPlugin extends SeekableBodyPlugin -{ - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - return $next($request)->then(function (ResponseInterface $response) { - if ($response->getBody()->isSeekable()) { - return $response; - } - - return $response->withBody(new BufferedStream($response->getBody(), $this->useFileBuffer, $this->memoryBufferSize)); - }); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/RetryPlugin.php b/vendor/php-http/client-common/src/Plugin/RetryPlugin.php deleted file mode 100644 index 144679ea..00000000 --- a/vendor/php-http/client-common/src/Plugin/RetryPlugin.php +++ /dev/null @@ -1,179 +0,0 @@ - - */ -final class RetryPlugin implements Plugin -{ - /** - * Number of retry before sending an exception. - * - * @var int - */ - private $retry; - - /** - * @var callable - */ - private $errorResponseDelay; - - /** - * @var callable - */ - private $errorResponseDecider; - - /** - * @var callable - */ - private $exceptionDecider; - - /** - * @var callable - */ - private $exceptionDelay; - - /** - * Store the retry counter for each request. - * - * @var array - */ - private $retryStorage = []; - - /** - * @param array{'retries'?: int, 'error_response_decider'?: callable, 'exception_decider'?: callable, 'error_response_delay'?: callable, 'exception_delay'?: callable} $config - * - * Configuration options: - * - retries: Number of retries to attempt if an exception occurs before letting the exception bubble up - * - error_response_decider: A callback that gets a request and response to decide whether the request should be retried - * - exception_decider: A callback that gets a request and an exception to decide after a failure whether the request should be retried - * - error_response_delay: A callback that gets a request and response and the current number of retries and returns how many microseconds we should wait before trying again - * - exception_delay: A callback that gets a request, an exception and the current number of retries and returns how many microseconds we should wait before trying again - */ - public function __construct(array $config = []) - { - $resolver = new OptionsResolver(); - $resolver->setDefaults([ - 'retries' => 1, - 'error_response_decider' => function (RequestInterface $request, ResponseInterface $response) { - // do not retry client errors - return $response->getStatusCode() >= 500 && $response->getStatusCode() < 600; - }, - 'exception_decider' => function (RequestInterface $request, ClientExceptionInterface $e) { - // do not retry client errors - return !$e instanceof HttpException || $e->getCode() >= 500 && $e->getCode() < 600; - }, - 'error_response_delay' => __CLASS__.'::defaultErrorResponseDelay', - 'exception_delay' => __CLASS__.'::defaultExceptionDelay', - ]); - - $resolver->setAllowedTypes('retries', 'int'); - $resolver->setAllowedTypes('error_response_decider', 'callable'); - $resolver->setAllowedTypes('exception_decider', 'callable'); - $resolver->setAllowedTypes('error_response_delay', 'callable'); - $resolver->setAllowedTypes('exception_delay', 'callable'); - $options = $resolver->resolve($config); - - $this->retry = $options['retries']; - $this->errorResponseDecider = $options['error_response_decider']; - $this->errorResponseDelay = $options['error_response_delay']; - $this->exceptionDecider = $options['exception_decider']; - $this->exceptionDelay = $options['exception_delay']; - } - - /** - * {@inheritdoc} - */ - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - $chainIdentifier = spl_object_hash((object) $first); - - return $next($request)->then(function (ResponseInterface $response) use ($request, $next, $first, $chainIdentifier) { - if (!array_key_exists($chainIdentifier, $this->retryStorage)) { - $this->retryStorage[$chainIdentifier] = 0; - } - - if ($this->retryStorage[$chainIdentifier] >= $this->retry) { - unset($this->retryStorage[$chainIdentifier]); - - return $response; - } - - if (call_user_func($this->errorResponseDecider, $request, $response)) { - /** @var int $time */ - $time = call_user_func($this->errorResponseDelay, $request, $response, $this->retryStorage[$chainIdentifier]); - $response = $this->retry($request, $next, $first, $chainIdentifier, $time); - } - - if (array_key_exists($chainIdentifier, $this->retryStorage)) { - unset($this->retryStorage[$chainIdentifier]); - } - - return $response; - }, function (ClientExceptionInterface $exception) use ($request, $next, $first, $chainIdentifier) { - if (!array_key_exists($chainIdentifier, $this->retryStorage)) { - $this->retryStorage[$chainIdentifier] = 0; - } - - if ($this->retryStorage[$chainIdentifier] >= $this->retry) { - unset($this->retryStorage[$chainIdentifier]); - - throw $exception; - } - - if (!call_user_func($this->exceptionDecider, $request, $exception)) { - throw $exception; - } - - /** @var int $time */ - $time = call_user_func($this->exceptionDelay, $request, $exception, $this->retryStorage[$chainIdentifier]); - - return $this->retry($request, $next, $first, $chainIdentifier, $time); - }); - } - - /** - * @param int $retries The number of retries we made before. First time this get called it will be 0. - */ - public static function defaultErrorResponseDelay(RequestInterface $request, ResponseInterface $response, int $retries): int - { - return pow(2, $retries) * 500000; - } - - /** - * @param int $retries The number of retries we made before. First time this get called it will be 0. - */ - public static function defaultExceptionDelay(RequestInterface $request, ClientExceptionInterface $e, int $retries): int - { - return pow(2, $retries) * 500000; - } - - /** - * @throws \Exception if retrying returns a failed promise - */ - private function retry(RequestInterface $request, callable $next, callable $first, string $chainIdentifier, int $delay): ResponseInterface - { - usleep($delay); - - // Retry synchronously - ++$this->retryStorage[$chainIdentifier]; - $promise = $this->handleRequest($request, $next, $first); - - return $promise->wait(); - } -} diff --git a/vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php b/vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php deleted file mode 100644 index 1be2cdeb..00000000 --- a/vendor/php-http/client-common/src/Plugin/SeekableBodyPlugin.php +++ /dev/null @@ -1,47 +0,0 @@ -setDefaults([ - 'use_file_buffer' => true, - 'memory_buffer_size' => 2097152, - ]); - $resolver->setAllowedTypes('use_file_buffer', 'bool'); - $resolver->setAllowedTypes('memory_buffer_size', 'int'); - - $options = $resolver->resolve($config); - - $this->useFileBuffer = $options['use_file_buffer']; - $this->memoryBufferSize = $options['memory_buffer_size']; - } -} diff --git a/vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php b/vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php deleted file mode 100644 index 0a2c714b..00000000 --- a/vendor/php-http/client-common/src/Plugin/VersionBridgePlugin.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -trait VersionBridgePlugin -{ - abstract protected function doHandleRequest(RequestInterface $request, callable $next, callable $first); - - public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise - { - return $this->doHandleRequest($request, $next, $first); - } -} diff --git a/vendor/php-http/client-common/src/PluginChain.php b/vendor/php-http/client-common/src/PluginChain.php deleted file mode 100644 index fcb19141..00000000 --- a/vendor/php-http/client-common/src/PluginChain.php +++ /dev/null @@ -1,62 +0,0 @@ -plugins = $plugins; - $this->clientCallable = $clientCallable; - $this->maxRestarts = (int) ($options['max_restarts'] ?? 0); - } - - private function createChain(): callable - { - $lastCallable = $this->clientCallable; - $reversedPlugins = array_reverse($this->plugins); - - foreach ($reversedPlugins as $plugin) { - $lastCallable = function (RequestInterface $request) use ($plugin, $lastCallable) { - return $plugin->handleRequest($request, $lastCallable, $this); - }; - } - - return $lastCallable; - } - - public function __invoke(RequestInterface $request): Promise - { - if ($this->restarts > $this->maxRestarts) { - throw new LoopException('Too many restarts in plugin client', $request); - } - - ++$this->restarts; - - return $this->createChain()($request); - } -} diff --git a/vendor/php-http/client-common/src/PluginClient.php b/vendor/php-http/client-common/src/PluginClient.php deleted file mode 100644 index d67145df..00000000 --- a/vendor/php-http/client-common/src/PluginClient.php +++ /dev/null @@ -1,130 +0,0 @@ - - */ -final class PluginClient implements HttpClient, HttpAsyncClient -{ - /** - * An HTTP async client. - * - * @var HttpAsyncClient - */ - private $client; - - /** - * The plugin chain. - * - * @var Plugin[] - */ - private $plugins; - - /** - * A list of options. - * - * @var array - */ - private $options; - - /** - * @param ClientInterface|HttpAsyncClient $client An HTTP async client - * @param Plugin[] $plugins A plugin chain - * @param array{'max_restarts'?: int} $options - */ - public function __construct($client, array $plugins = [], array $options = []) - { - if ($client instanceof HttpAsyncClient) { - $this->client = $client; - } elseif ($client instanceof ClientInterface) { - $this->client = new EmulatedHttpAsyncClient($client); - } else { - throw new \TypeError( - sprintf('%s::__construct(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) - ); - } - - $this->plugins = $plugins; - $this->options = $this->configure($options); - } - - /** - * {@inheritdoc} - */ - public function sendRequest(RequestInterface $request): ResponseInterface - { - // If the client doesn't support sync calls, call async - if (!$this->client instanceof ClientInterface) { - return $this->sendAsyncRequest($request)->wait(); - } - - // Else we want to use the synchronous call of the underlying client, - // and not the async one in the case we have both an async and sync call - $pluginChain = $this->createPluginChain($this->plugins, function (RequestInterface $request) { - try { - return new HttpFulfilledPromise($this->client->sendRequest($request)); - } catch (HttplugException $exception) { - return new HttpRejectedPromise($exception); - } - }); - - return $pluginChain($request)->wait(); - } - - /** - * {@inheritdoc} - */ - public function sendAsyncRequest(RequestInterface $request) - { - $pluginChain = $this->createPluginChain($this->plugins, function (RequestInterface $request) { - return $this->client->sendAsyncRequest($request); - }); - - return $pluginChain($request); - } - - /** - * Configure the plugin client. - */ - private function configure(array $options = []): array - { - $resolver = new OptionsResolver(); - $resolver->setDefaults([ - 'max_restarts' => 10, - ]); - - $resolver->setAllowedTypes('max_restarts', 'int'); - - return $resolver->resolve($options); - } - - /** - * Create the plugin chain. - * - * @param Plugin[] $plugins A plugin chain - * @param callable $clientCallable Callable making the HTTP call - * - * @return callable(RequestInterface): Promise - */ - private function createPluginChain(array $plugins, callable $clientCallable): callable - { - /** @var callable(RequestInterface): Promise */ - return new PluginChain($plugins, $clientCallable, $this->options); - } -} diff --git a/vendor/php-http/client-common/src/PluginClientBuilder.php b/vendor/php-http/client-common/src/PluginClientBuilder.php deleted file mode 100644 index 87464982..00000000 --- a/vendor/php-http/client-common/src/PluginClientBuilder.php +++ /dev/null @@ -1,76 +0,0 @@ - - */ -final class PluginClientBuilder -{ - /** @var Plugin[][] List of plugins ordered by priority [priority => Plugin[]]). */ - private $plugins = []; - - /** @var array Array of options to give to the plugin client */ - private $options = []; - - /** - * @param int $priority Priority of the plugin. The higher comes first. - */ - public function addPlugin(Plugin $plugin, int $priority = 0): self - { - $this->plugins[$priority][] = $plugin; - - return $this; - } - - /** - * @param mixed $value - */ - public function setOption(string $name, $value): self - { - $this->options[$name] = $value; - - return $this; - } - - public function removeOption(string $name): self - { - unset($this->options[$name]); - - return $this; - } - - /** - * @param ClientInterface|HttpAsyncClient $client - */ - public function createClient($client): PluginClient - { - if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { - throw new \TypeError( - sprintf('%s::createClient(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) - ); - } - - $plugins = $this->plugins; - - if (0 === count($plugins)) { - $plugins[] = []; - } - - krsort($plugins); - $plugins = array_merge(...$plugins); - - return new PluginClient( - $client, - array_values($plugins), - $this->options - ); - } -} diff --git a/vendor/php-http/client-common/src/PluginClientFactory.php b/vendor/php-http/client-common/src/PluginClientFactory.php deleted file mode 100644 index f7e93e37..00000000 --- a/vendor/php-http/client-common/src/PluginClientFactory.php +++ /dev/null @@ -1,68 +0,0 @@ - - */ -final class PluginClientFactory -{ - /** - * @var (callable(ClientInterface|HttpAsyncClient, Plugin[], array): PluginClient)|null - */ - private static $factory; - - /** - * Set the factory to use. - * The callable to provide must have the same arguments and return type as PluginClientFactory::createClient. - * This is used by the HTTPlugBundle to provide a better Symfony integration. - * Unlike the createClient method, this one is static to allow zero configuration profiling by hooking into early - * application execution. - * - * @internal - * - * @param callable(ClientInterface|HttpAsyncClient, Plugin[], array): PluginClient $factory - */ - public static function setFactory(callable $factory): void - { - static::$factory = $factory; - } - - /** - * @param ClientInterface|HttpAsyncClient $client - * @param Plugin[] $plugins - * @param array{'client_name'?: string} $options - * - * Configuration options: - * - client_name: to give client a name which may be used when displaying client information - * like in the HTTPlugBundle profiler. - * - * @see PluginClient constructor for PluginClient specific $options. - */ - public function createClient($client, array $plugins = [], array $options = []): PluginClient - { - if (!$client instanceof ClientInterface && !$client instanceof HttpAsyncClient) { - throw new \TypeError( - sprintf('%s::createClient(): Argument #1 ($client) must be of type %s|%s, %s given', self::class, ClientInterface::class, HttpAsyncClient::class, get_debug_type($client)) - ); - } - - if (static::$factory) { - $factory = static::$factory; - - return $factory($client, $plugins, $options); - } - - unset($options['client_name']); - - return new PluginClient($client, $plugins, $options); - } -} diff --git a/vendor/php-http/client-common/src/VersionBridgeClient.php b/vendor/php-http/client-common/src/VersionBridgeClient.php deleted file mode 100644 index a608edd7..00000000 --- a/vendor/php-http/client-common/src/VersionBridgeClient.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -trait VersionBridgeClient -{ - abstract protected function doSendRequest(RequestInterface $request); - - public function sendRequest(RequestInterface $request): ResponseInterface - { - return $this->doSendRequest($request); - } -} diff --git a/vendor/php-http/discovery/CHANGELOG.md b/vendor/php-http/discovery/CHANGELOG.md deleted file mode 100644 index f896866a..00000000 --- a/vendor/php-http/discovery/CHANGELOG.md +++ /dev/null @@ -1,315 +0,0 @@ -# Change Log - -## 1.14.1 - 2021-09-18 - -- [#199](https://github.com/php-http/discovery/pull/199) - Fixes message factory discovery for `laminas-diactoros ^2.7` - -## 1.14.0 - 2021-06-21 - -- Deprecate puli as it has been unmaintained for a long time and is not compatible with composer 2 https://github.com/php-http/discovery/pull/195 - -## 1.13.0 - 2020-11-27 - -- Support discovering PSR-17 factories of `slim/psr7` package https://github.com/php-http/discovery/pull/192 - -## 1.12.0 - 2020-09-22 - -- Support discovering HttpClient of `php-http/guzzle7-adapter` https://github.com/php-http/discovery/pull/189 - -## 1.11.0 - 2020-09-22 - -- Use correct method name to find Uri Factory in PSR17 https://github.com/php-http/discovery/pull/181 - -## 1.10.0 - 2020-09-04 - -- Discover PSR-18 implementation of phalcon - -## 1.9.1 - 2020-07-13 - -### Fixed - -- Support PHP 7.4 and 8.0 - -## 1.9.0 - 2020-07-02 - -### Added - -- Support discovering PSR-18 factories of `guzzlehttp/guzzle` 7+ - -## 1.8.0 - 2020-06-14 - -### Added - -- Support discovering PSR-17 factories of `guzzlehttp/psr7` package -- Support discovering PSR-17 factories of `laminas/laminas-diactoros` package -- `ClassDiscovery::getStrategies()` to retrieve the list of current strategies. - -### Fixed - -- Ignore exception during discovery when Symfony HttplugClient checks if HTTPlug is available. - -## 1.7.4 - 2020-01-03 - -### Fixed - -- Improve conditions on Symfony's async HTTPlug client. - -## 1.7.3 - 2019-12-27 - -### Fixed - -- Enough conditions to only use Symfony HTTP client if all needed components are available. - -## 1.7.2 - 2019-12-27 - -### Fixed - -- Allow a condition to specify an interface and not just classes. - -## 1.7.1 - 2019-12-26 - -### Fixed - -- Better conditions to see if Symfony's HTTP clients are available. - -## 1.7.0 - 2019-06-30 - -### Added - -- Dropped support for PHP < 7.1 -- Support for `symfony/http-client` - -## 1.6.1 - 2019-02-23 - -### Fixed - -- MockClientStrategy also provides the mock client when requesting an async client - -## 1.6.0 - 2019-01-23 - -### Added - -- Support for PSR-17 factories -- Support for PSR-18 clients - -## 1.5.2 - 2018-12-31 - -Corrected mistakes in 1.5.1. The different between 1.5.2 and 1.5.0 is that -we removed some PHP 7 code. - -https://github.com/php-http/discovery/compare/1.5.0...1.5.2 - -## 1.5.1 - 2018-12-31 - -This version added new features by mistake. These are reverted in 1.5.2. - -Do not use 1.5.1. - -### Fixed - -- Removed PHP 7 code - -## 1.5.0 - 2018-12-30 - -### Added - -- Support for `nyholm/psr7` version 1.0. -- `ClassDiscovery::safeClassExists` which will help Magento users. -- Support for HTTPlug 2.0 -- Support for Buzz 1.0 -- Better error message when nothing found by introducing a new exception: `NoCandidateFoundException`. - -### Fixed - -- Fixed condition evaluation, it should stop after first invalid condition. - -## 1.4.0 - 2018-02-06 - -### Added - -- Discovery support for nyholm/psr7 - -## 1.3.0 - 2017-08-03 - -### Added - -- Discovery support for CakePHP adapter -- Discovery support for Zend adapter -- Discovery support for Artax adapter - -## 1.2.1 - 2017-03-02 - -### Fixed - -- Fixed minor issue with `MockClientStrategy`, also added more tests. - -## 1.2.0 - 2017-02-12 - -### Added - -- MockClientStrategy class. - -## 1.1.1 - 2016-11-27 - -### Changed - -- Made exception messages clearer. `StrategyUnavailableException` is no longer the previous exception to `DiscoveryFailedException`. -- `CommonClassesStrategy` is using `self` instead of `static`. Using `static` makes no sense when `CommonClassesStrategy` is final. - -## 1.1.0 - 2016-10-20 - -### Added - -- Discovery support for Slim Framework factories - -## 1.0.0 - 2016-07-18 - -### Added - -- Added back `Http\Discovery\NotFoundException` to preserve BC with 0.8 version. You may upgrade from 0.8.x and 0.9.x to 1.0.0 without any BC breaks. -- Added interface `Http\Discovery\Exception` which is implemented by all our exceptions - -### Changed - -- Puli strategy renamed to Puli Beta strategy to prevent incompatibility with a future Puli stable - -### Deprecated - -- For BC reasons, the old `Http\Discovery\NotFoundException` (extending the new exception) will be thrown until version 2.0 - - -## 0.9.1 - 2016-06-28 - -### Changed - -- Dropping PHP 5.4 support because we use the ::class constant. - - -## 0.9.0 - 2016-06-25 - -### Added - -- Discovery strategies to find classes - -### Changed - -- [Puli](http://puli.io) made optional -- Improved exceptions -- **[BC] `NotFoundException` moved to `Http\Discovery\Exception\NotFoundException`** - - -## 0.8.0 - 2016-02-11 - -### Changed - -- Puli composer plugin must be installed separately - - -## 0.7.0 - 2016-01-15 - -### Added - -- Temporary puli.phar (Beta 10) executable - -### Changed - -- Updated HTTPlug dependencies -- Updated Puli dependencies -- Local configuration to make tests passing - -### Removed - -- Puli CLI dependency - - -## 0.6.4 - 2016-01-07 - -### Fixed - -- Puli [not working](https://twitter.com/PuliPHP/status/685132540588507137) with the latest json-schema - - -## 0.6.3 - 2016-01-04 - -### Changed - -- Adjust Puli dependencies - - -## 0.6.2 - 2016-01-04 - -### Changed - -- Make Puli CLI a requirement - - -## 0.6.1 - 2016-01-03 - -### Changed - -- More flexible Puli requirement - - -## 0.6.0 - 2015-12-30 - -### Changed - -- Use [Puli](http://puli.io) for discovery -- Improved exception messages - - -## 0.5.0 - 2015-12-25 - -### Changed - -- Updated message factory dependency (php-http/message) - - -## 0.4.0 - 2015-12-17 - -### Added - -- Array condition evaluation in the Class Discovery - -### Removed - -- Message factories (moved to php-http/utils) - - -## 0.3.0 - 2015-11-18 - -### Added - -- HTTP Async Client Discovery -- Stream factories - -### Changed - -- Discoveries and Factories are final -- Message and Uri factories have the type in their names -- Diactoros Message factory uses Stream factory internally - -### Fixed - -- Improved docblocks for API documentation generation - - -## 0.2.0 - 2015-10-31 - -### Changed - -- Renamed AdapterDiscovery to ClientDiscovery - - -## 0.1.1 - 2015-06-13 - -### Fixed - -- Bad HTTP Adapter class name for Guzzle 5 - - -## 0.1.0 - 2015-06-12 - -### Added - -- Initial release diff --git a/vendor/php-http/discovery/LICENSE b/vendor/php-http/discovery/LICENSE deleted file mode 100644 index 4558d6f0..00000000 --- a/vendor/php-http/discovery/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2016 PHP HTTP Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/discovery/README.md b/vendor/php-http/discovery/README.md deleted file mode 100644 index 6a3d18bc..00000000 --- a/vendor/php-http/discovery/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# HTTPlug Discovery - -[![Latest Version](https://img.shields.io/github/release/php-http/discovery.svg?style=flat-square)](https://github.com/php-http/discovery/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/php-http/discovery/master.svg?style=flat-square)](https://travis-ci.org/php-http/discovery) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/discovery.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/discovery) -[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/discovery.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/discovery) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/discovery.svg?style=flat-square)](https://packagist.org/packages/php-http/discovery) - -**Finds installed HTTPlug implementations and PSR-7 message factories.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/discovery -``` - - -## Documentation - -Please see the [official documentation](http://php-http.readthedocs.org/en/latest/discovery.html). - - -## Testing - -``` bash -$ composer test -``` - - -## Contributing - -Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/discovery/composer.json b/vendor/php-http/discovery/composer.json deleted file mode 100644 index 5ded29e1..00000000 --- a/vendor/php-http/discovery/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "php-http/discovery", - "description": "Finds installed HTTPlug implementations and PSR-7 message factories", - "license": "MIT", - "keywords": ["http", "discovery", "client", "adapter", "message", "factory", "psr7"], - "homepage": "http://php-http.org", - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "graham-campbell/phpspec-skip-example-extension": "^5.0", - "php-http/httplug": "^1.0 || ^2.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.1", - "puli/composer-plugin": "1.0.0-beta10" - }, - "suggest": { - "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories" - }, - "autoload": { - "psr-4": { - "Http\\Discovery\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "spec\\Http\\Discovery\\": "spec/" - } - }, - "scripts": { - "test": "vendor/bin/phpspec run", - "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" - }, - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "conflict": { - "nyholm/psr7": "<1.0" - }, - "prefer-stable": true, - "minimum-stability": "beta" -} diff --git a/vendor/php-http/discovery/src/ClassDiscovery.php b/vendor/php-http/discovery/src/ClassDiscovery.php deleted file mode 100644 index 43529850..00000000 --- a/vendor/php-http/discovery/src/ClassDiscovery.php +++ /dev/null @@ -1,252 +0,0 @@ - - * @author Márk Sági-Kazár - * @author Tobias Nyholm - */ -abstract class ClassDiscovery -{ - /** - * A list of strategies to find classes. - * - * @var array - */ - private static $strategies = [ - Strategy\CommonClassesStrategy::class, - Strategy\CommonPsr17ClassesStrategy::class, - Strategy\PuliBetaStrategy::class, - ]; - - private static $deprecatedStrategies = [ - Strategy\PuliBetaStrategy::class => true, - ]; - - /** - * Discovery cache to make the second time we use discovery faster. - * - * @var array - */ - private static $cache = []; - - /** - * Finds a class. - * - * @param string $type - * - * @return string|\Closure - * - * @throws DiscoveryFailedException - */ - protected static function findOneByType($type) - { - // Look in the cache - if (null !== ($class = self::getFromCache($type))) { - return $class; - } - - $exceptions = []; - foreach (self::$strategies as $strategy) { - try { - $candidates = call_user_func($strategy.'::getCandidates', $type); - } catch (StrategyUnavailableException $e) { - if (!isset(self::$deprecatedStrategies[$strategy])) { - $exceptions[] = $e; - } - - continue; - } - - foreach ($candidates as $candidate) { - if (isset($candidate['condition'])) { - if (!self::evaluateCondition($candidate['condition'])) { - continue; - } - } - - // save the result for later use - self::storeInCache($type, $candidate); - - return $candidate['class']; - } - - $exceptions[] = new NoCandidateFoundException($strategy, $candidates); - } - - throw DiscoveryFailedException::create($exceptions); - } - - /** - * Get a value from cache. - * - * @param string $type - * - * @return string|null - */ - private static function getFromCache($type) - { - if (!isset(self::$cache[$type])) { - return; - } - - $candidate = self::$cache[$type]; - if (isset($candidate['condition'])) { - if (!self::evaluateCondition($candidate['condition'])) { - return; - } - } - - return $candidate['class']; - } - - /** - * Store a value in cache. - * - * @param string $type - * @param string $class - */ - private static function storeInCache($type, $class) - { - self::$cache[$type] = $class; - } - - /** - * Set new strategies and clear the cache. - * - * @param array $strategies string array of fully qualified class name to a DiscoveryStrategy - */ - public static function setStrategies(array $strategies) - { - self::$strategies = $strategies; - self::clearCache(); - } - - /** - * Returns the currently configured discovery strategies as fully qualified class names. - * - * @return string[] - */ - public static function getStrategies(): iterable - { - return self::$strategies; - } - - /** - * Append a strategy at the end of the strategy queue. - * - * @param string $strategy Fully qualified class name to a DiscoveryStrategy - */ - public static function appendStrategy($strategy) - { - self::$strategies[] = $strategy; - self::clearCache(); - } - - /** - * Prepend a strategy at the beginning of the strategy queue. - * - * @param string $strategy Fully qualified class name to a DiscoveryStrategy - */ - public static function prependStrategy($strategy) - { - array_unshift(self::$strategies, $strategy); - self::clearCache(); - } - - /** - * Clear the cache. - */ - public static function clearCache() - { - self::$cache = []; - } - - /** - * Evaluates conditions to boolean. - * - * @param mixed $condition - * - * @return bool - */ - protected static function evaluateCondition($condition) - { - if (is_string($condition)) { - // Should be extended for functions, extensions??? - return self::safeClassExists($condition); - } - if (is_callable($condition)) { - return (bool) $condition(); - } - if (is_bool($condition)) { - return $condition; - } - if (is_array($condition)) { - foreach ($condition as $c) { - if (false === static::evaluateCondition($c)) { - // Immediately stop execution if the condition is false - return false; - } - } - - return true; - } - - return false; - } - - /** - * Get an instance of the $class. - * - * @param string|\Closure $class A FQCN of a class or a closure that instantiate the class. - * - * @return object - * - * @throws ClassInstantiationFailedException - */ - protected static function instantiateClass($class) - { - try { - if (is_string($class)) { - return new $class(); - } - - if (is_callable($class)) { - return $class(); - } - } catch (\Exception $e) { - throw new ClassInstantiationFailedException('Unexpected exception when instantiating class.', 0, $e); - } - - throw new ClassInstantiationFailedException('Could not instantiate class because parameter is neither a callable nor a string'); - } - - /** - * We want to do a "safe" version of PHP's "class_exists" because Magento has a bug - * (or they call it a "feature"). Magento is throwing an exception if you do class_exists() - * on a class that ends with "Factory" and if that file does not exits. - * - * This function will catch all potential exceptions and make sure it returns a boolean. - * - * @param string $class - * @param bool $autoload - * - * @return bool - */ - public static function safeClassExists($class) - { - try { - return class_exists($class) || interface_exists($class); - } catch (\Exception $e) { - return false; - } - } -} diff --git a/vendor/php-http/discovery/src/Exception.php b/vendor/php-http/discovery/src/Exception.php deleted file mode 100644 index 973c9087..00000000 --- a/vendor/php-http/discovery/src/Exception.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ -interface Exception -{ -} diff --git a/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php b/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php deleted file mode 100644 index e95bf5d8..00000000 --- a/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ -final class ClassInstantiationFailedException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php b/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php deleted file mode 100644 index 304b7276..00000000 --- a/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ -final class DiscoveryFailedException extends \Exception implements Exception -{ - /** - * @var \Exception[] - */ - private $exceptions; - - /** - * @param string $message - * @param \Exception[] $exceptions - */ - public function __construct($message, array $exceptions = []) - { - $this->exceptions = $exceptions; - - parent::__construct($message); - } - - /** - * @param \Exception[] $exceptions - */ - public static function create($exceptions) - { - $message = 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors'; - foreach ($exceptions as $e) { - $message .= "\n - ".$e->getMessage(); - } - $message .= "\n\n"; - - return new self($message, $exceptions); - } - - /** - * @return \Exception[] - */ - public function getExceptions() - { - return $this->exceptions; - } -} diff --git a/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php deleted file mode 100644 index 32f65db7..00000000 --- a/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -final class NoCandidateFoundException extends \Exception implements Exception -{ - /** - * @param string $strategy - */ - public function __construct($strategy, array $candidates) - { - $classes = array_map( - function ($a) { - return $a['class']; - }, - $candidates - ); - - $message = sprintf( - 'No valid candidate found using strategy "%s". We tested the following candidates: %s.', - $strategy, - implode(', ', array_map([$this, 'stringify'], $classes)) - ); - - parent::__construct($message); - } - - private function stringify($mixed) - { - if (is_string($mixed)) { - return $mixed; - } - - if (is_array($mixed) && 2 === count($mixed)) { - return sprintf('%s::%s', $this->stringify($mixed[0]), $mixed[1]); - } - - return is_object($mixed) ? get_class($mixed) : gettype($mixed); - } -} diff --git a/vendor/php-http/discovery/src/Exception/NotFoundException.php b/vendor/php-http/discovery/src/Exception/NotFoundException.php deleted file mode 100644 index befbf488..00000000 --- a/vendor/php-http/discovery/src/Exception/NotFoundException.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -/*final */class NotFoundException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php b/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php deleted file mode 100644 index a6ade733..00000000 --- a/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ -final class PuliUnavailableException extends StrategyUnavailableException -{ -} diff --git a/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php b/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php deleted file mode 100644 index 89ecf352..00000000 --- a/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php +++ /dev/null @@ -1,15 +0,0 @@ - - */ -class StrategyUnavailableException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php b/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php deleted file mode 100644 index a0c4d5b7..00000000 --- a/vendor/php-http/discovery/src/HttpAsyncClientDiscovery.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -final class HttpAsyncClientDiscovery extends ClassDiscovery -{ - /** - * Finds an HTTP Async Client. - * - * @return HttpAsyncClient - * - * @throws Exception\NotFoundException - */ - public static function find() - { - try { - $asyncClient = static::findOneByType(HttpAsyncClient::class); - } catch (DiscoveryFailedException $e) { - throw new NotFoundException('No HTTPlug async clients found. Make sure to install a package providing "php-http/async-client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); - } - - return static::instantiateClass($asyncClient); - } -} diff --git a/vendor/php-http/discovery/src/HttpClientDiscovery.php b/vendor/php-http/discovery/src/HttpClientDiscovery.php deleted file mode 100644 index 2072b94d..00000000 --- a/vendor/php-http/discovery/src/HttpClientDiscovery.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -final class HttpClientDiscovery extends ClassDiscovery -{ - /** - * Finds an HTTP Client. - * - * @return HttpClient - * - * @throws Exception\NotFoundException - */ - public static function find() - { - try { - $client = static::findOneByType(HttpClient::class); - } catch (DiscoveryFailedException $e) { - throw new NotFoundException('No HTTPlug clients found. Make sure to install a package providing "php-http/client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); - } - - return static::instantiateClass($client); - } -} diff --git a/vendor/php-http/discovery/src/MessageFactoryDiscovery.php b/vendor/php-http/discovery/src/MessageFactoryDiscovery.php deleted file mode 100644 index 659916dc..00000000 --- a/vendor/php-http/discovery/src/MessageFactoryDiscovery.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. - */ -final class MessageFactoryDiscovery extends ClassDiscovery -{ - /** - * Finds a Message Factory. - * - * @return MessageFactory - * - * @throws Exception\NotFoundException - */ - public static function find() - { - try { - $messageFactory = static::findOneByType(MessageFactory::class); - } catch (DiscoveryFailedException $e) { - throw new NotFoundException('No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); - } - - return static::instantiateClass($messageFactory); - } -} diff --git a/vendor/php-http/discovery/src/NotFoundException.php b/vendor/php-http/discovery/src/NotFoundException.php deleted file mode 100644 index d59dadbf..00000000 --- a/vendor/php-http/discovery/src/NotFoundException.php +++ /dev/null @@ -1,14 +0,0 @@ - - * - * @deprecated since since version 1.0, and will be removed in 2.0. Use {@link \Http\Discovery\Exception\NotFoundException} instead. - */ -final class NotFoundException extends \Http\Discovery\Exception\NotFoundException -{ -} diff --git a/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php b/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php deleted file mode 100644 index a73c6414..00000000 --- a/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php +++ /dev/null @@ -1,136 +0,0 @@ - - */ -final class Psr17FactoryDiscovery extends ClassDiscovery -{ - private static function createException($type, Exception $e) - { - return new \Http\Discovery\Exception\NotFoundException( - 'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation', - 0, - $e - ); - } - - /** - * @return RequestFactoryInterface - * - * @throws Exception\NotFoundException - */ - public static function findRequestFactory() - { - try { - $messageFactory = static::findOneByType(RequestFactoryInterface::class); - } catch (DiscoveryFailedException $e) { - throw self::createException('request factory', $e); - } - - return static::instantiateClass($messageFactory); - } - - /** - * @return ResponseFactoryInterface - * - * @throws Exception\NotFoundException - */ - public static function findResponseFactory() - { - try { - $messageFactory = static::findOneByType(ResponseFactoryInterface::class); - } catch (DiscoveryFailedException $e) { - throw self::createException('response factory', $e); - } - - return static::instantiateClass($messageFactory); - } - - /** - * @return ServerRequestFactoryInterface - * - * @throws Exception\NotFoundException - */ - public static function findServerRequestFactory() - { - try { - $messageFactory = static::findOneByType(ServerRequestFactoryInterface::class); - } catch (DiscoveryFailedException $e) { - throw self::createException('server request factory', $e); - } - - return static::instantiateClass($messageFactory); - } - - /** - * @return StreamFactoryInterface - * - * @throws Exception\NotFoundException - */ - public static function findStreamFactory() - { - try { - $messageFactory = static::findOneByType(StreamFactoryInterface::class); - } catch (DiscoveryFailedException $e) { - throw self::createException('stream factory', $e); - } - - return static::instantiateClass($messageFactory); - } - - /** - * @return UploadedFileFactoryInterface - * - * @throws Exception\NotFoundException - */ - public static function findUploadedFileFactory() - { - try { - $messageFactory = static::findOneByType(UploadedFileFactoryInterface::class); - } catch (DiscoveryFailedException $e) { - throw self::createException('uploaded file factory', $e); - } - - return static::instantiateClass($messageFactory); - } - - /** - * @return UriFactoryInterface - * - * @throws Exception\NotFoundException - */ - public static function findUriFactory() - { - try { - $messageFactory = static::findOneByType(UriFactoryInterface::class); - } catch (DiscoveryFailedException $e) { - throw self::createException('url factory', $e); - } - - return static::instantiateClass($messageFactory); - } - - /** - * @return UriFactoryInterface - * - * @throws Exception\NotFoundException - * - * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method. - */ - public static function findUrlFactory() - { - return static::findUriFactory(); - } -} diff --git a/vendor/php-http/discovery/src/Psr18ClientDiscovery.php b/vendor/php-http/discovery/src/Psr18ClientDiscovery.php deleted file mode 100644 index 7fcdb17a..00000000 --- a/vendor/php-http/discovery/src/Psr18ClientDiscovery.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -final class Psr18ClientDiscovery extends ClassDiscovery -{ - /** - * Finds a PSR-18 HTTP Client. - * - * @return ClientInterface - * - * @throws Exception\NotFoundException - */ - public static function find() - { - try { - $client = static::findOneByType(ClientInterface::class); - } catch (DiscoveryFailedException $e) { - throw new \Http\Discovery\Exception\NotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle6-adapter".', 0, $e); - } - - return static::instantiateClass($client); - } -} diff --git a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php deleted file mode 100644 index e82bcb1d..00000000 --- a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php +++ /dev/null @@ -1,185 +0,0 @@ - - */ -final class CommonClassesStrategy implements DiscoveryStrategy -{ - /** - * @var array - */ - private static $classes = [ - MessageFactory::class => [ - ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], - ['class' => GuzzleMessageFactory::class, 'condition' => [GuzzleRequest::class, GuzzleMessageFactory::class]], - ['class' => DiactorosMessageFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosMessageFactory::class]], - ['class' => DiactorosMessageFactory::class, 'condition' => [DiactorosRequest::class, DiactorosMessageFactory::class]], - ['class' => SlimMessageFactory::class, 'condition' => [SlimRequest::class, SlimMessageFactory::class]], - ], - StreamFactory::class => [ - ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], - ['class' => GuzzleStreamFactory::class, 'condition' => [GuzzleRequest::class, GuzzleStreamFactory::class]], - ['class' => DiactorosStreamFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosStreamFactory::class]], - ['class' => DiactorosStreamFactory::class, 'condition' => [DiactorosRequest::class, DiactorosStreamFactory::class]], - ['class' => SlimStreamFactory::class, 'condition' => [SlimRequest::class, SlimStreamFactory::class]], - ], - UriFactory::class => [ - ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]], - ['class' => GuzzleUriFactory::class, 'condition' => [GuzzleRequest::class, GuzzleUriFactory::class]], - ['class' => DiactorosUriFactory::class, 'condition' => [ZendDiactorosRequest::class, DiactorosUriFactory::class]], - ['class' => DiactorosUriFactory::class, 'condition' => [DiactorosRequest::class, DiactorosUriFactory::class]], - ['class' => SlimUriFactory::class, 'condition' => [SlimRequest::class, SlimUriFactory::class]], - ], - HttpAsyncClient::class => [ - ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, Promise::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]], - ['class' => Guzzle7::class, 'condition' => Guzzle7::class], - ['class' => Guzzle6::class, 'condition' => Guzzle6::class], - ['class' => Curl::class, 'condition' => Curl::class], - ['class' => React::class, 'condition' => React::class], - ], - HttpClient::class => [ - ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, RequestFactory::class, [self::class, 'isPsr17FactoryInstalled']]], - ['class' => Guzzle7::class, 'condition' => Guzzle7::class], - ['class' => Guzzle6::class, 'condition' => Guzzle6::class], - ['class' => Guzzle5::class, 'condition' => Guzzle5::class], - ['class' => Curl::class, 'condition' => Curl::class], - ['class' => Socket::class, 'condition' => Socket::class], - ['class' => Buzz::class, 'condition' => Buzz::class], - ['class' => React::class, 'condition' => React::class], - ['class' => Cake::class, 'condition' => Cake::class], - ['class' => Zend::class, 'condition' => Zend::class], - ['class' => Artax::class, 'condition' => Artax::class], - [ - 'class' => [self::class, 'buzzInstantiate'], - 'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class], - ], - ], - Psr18Client::class => [ - [ - 'class' => [self::class, 'symfonyPsr18Instantiate'], - 'condition' => [SymfonyPsr18::class, Psr17RequestFactory::class], - ], - [ - 'class' => GuzzleHttp::class, - 'condition' => [self::class, 'isGuzzleImplementingPsr18'], - ], - [ - 'class' => [self::class, 'buzzInstantiate'], - 'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class], - ], - ], - ]; - - /** - * {@inheritdoc} - */ - public static function getCandidates($type) - { - if (Psr18Client::class === $type) { - return self::getPsr18Candidates(); - } - - return self::$classes[$type] ?? []; - } - - /** - * @return array The return value is always an array with zero or more elements. Each - * element is an array with two keys ['class' => string, 'condition' => mixed]. - */ - private static function getPsr18Candidates() - { - $candidates = self::$classes[Psr18Client::class]; - - // HTTPlug 2.0 clients implements PSR18Client too. - foreach (self::$classes[HttpClient::class] as $c) { - try { - if (is_subclass_of($c['class'], Psr18Client::class)) { - $candidates[] = $c; - } - } catch (\Throwable $e) { - trigger_error(sprintf('Got exception "%s (%s)" while checking if a PSR-18 Client is available', get_class($e), $e->getMessage()), E_USER_WARNING); - } - } - - return $candidates; - } - - public static function buzzInstantiate() - { - return new \Buzz\Client\FileGetContents(MessageFactoryDiscovery::find()); - } - - public static function symfonyPsr18Instantiate() - { - return new SymfonyPsr18(null, Psr17FactoryDiscovery::findResponseFactory(), Psr17FactoryDiscovery::findStreamFactory()); - } - - public static function isGuzzleImplementingPsr18() - { - return defined('GuzzleHttp\ClientInterface::MAJOR_VERSION'); - } - - /** - * Can be used as a condition. - * - * @return bool - */ - public static function isPsr17FactoryInstalled() - { - try { - Psr17FactoryDiscovery::findResponseFactory(); - } catch (NotFoundException $e) { - return false; - } catch (\Throwable $e) { - trigger_error(sprintf('Got exception "%s (%s)" while checking if a PSR-17 ResponseFactory is available', get_class($e), $e->getMessage()), E_USER_WARNING); - - return false; - } - - return true; - } -} diff --git a/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php deleted file mode 100644 index fc26778f..00000000 --- a/vendor/php-http/discovery/src/Strategy/CommonPsr17ClassesStrategy.php +++ /dev/null @@ -1,105 +0,0 @@ - - */ -final class CommonPsr17ClassesStrategy implements DiscoveryStrategy -{ - /** - * @var array - */ - private static $classes = [ - RequestFactoryInterface::class => [ - 'Phalcon\Http\Message\RequestFactory', - 'Nyholm\Psr7\Factory\Psr17Factory', - 'Zend\Diactoros\RequestFactory', - 'GuzzleHttp\Psr7\HttpFactory', - 'Http\Factory\Diactoros\RequestFactory', - 'Http\Factory\Guzzle\RequestFactory', - 'Http\Factory\Slim\RequestFactory', - 'Laminas\Diactoros\RequestFactory', - 'Slim\Psr7\Factory\RequestFactory', - ], - ResponseFactoryInterface::class => [ - 'Phalcon\Http\Message\ResponseFactory', - 'Nyholm\Psr7\Factory\Psr17Factory', - 'Zend\Diactoros\ResponseFactory', - 'GuzzleHttp\Psr7\HttpFactory', - 'Http\Factory\Diactoros\ResponseFactory', - 'Http\Factory\Guzzle\ResponseFactory', - 'Http\Factory\Slim\ResponseFactory', - 'Laminas\Diactoros\ResponseFactory', - 'Slim\Psr7\Factory\ResponseFactory', - ], - ServerRequestFactoryInterface::class => [ - 'Phalcon\Http\Message\ServerRequestFactory', - 'Nyholm\Psr7\Factory\Psr17Factory', - 'Zend\Diactoros\ServerRequestFactory', - 'GuzzleHttp\Psr7\HttpFactory', - 'Http\Factory\Diactoros\ServerRequestFactory', - 'Http\Factory\Guzzle\ServerRequestFactory', - 'Http\Factory\Slim\ServerRequestFactory', - 'Laminas\Diactoros\ServerRequestFactory', - 'Slim\Psr7\Factory\ServerRequestFactory', - ], - StreamFactoryInterface::class => [ - 'Phalcon\Http\Message\StreamFactory', - 'Nyholm\Psr7\Factory\Psr17Factory', - 'Zend\Diactoros\StreamFactory', - 'GuzzleHttp\Psr7\HttpFactory', - 'Http\Factory\Diactoros\StreamFactory', - 'Http\Factory\Guzzle\StreamFactory', - 'Http\Factory\Slim\StreamFactory', - 'Laminas\Diactoros\StreamFactory', - 'Slim\Psr7\Factory\StreamFactory', - ], - UploadedFileFactoryInterface::class => [ - 'Phalcon\Http\Message\UploadedFileFactory', - 'Nyholm\Psr7\Factory\Psr17Factory', - 'Zend\Diactoros\UploadedFileFactory', - 'GuzzleHttp\Psr7\HttpFactory', - 'Http\Factory\Diactoros\UploadedFileFactory', - 'Http\Factory\Guzzle\UploadedFileFactory', - 'Http\Factory\Slim\UploadedFileFactory', - 'Laminas\Diactoros\UploadedFileFactory', - 'Slim\Psr7\Factory\UploadedFileFactory', - ], - UriFactoryInterface::class => [ - 'Phalcon\Http\Message\UriFactory', - 'Nyholm\Psr7\Factory\Psr17Factory', - 'Zend\Diactoros\UriFactory', - 'GuzzleHttp\Psr7\HttpFactory', - 'Http\Factory\Diactoros\UriFactory', - 'Http\Factory\Guzzle\UriFactory', - 'Http\Factory\Slim\UriFactory', - 'Laminas\Diactoros\UriFactory', - 'Slim\Psr7\Factory\UriFactory', - ], - ]; - - /** - * {@inheritdoc} - */ - public static function getCandidates($type) - { - $candidates = []; - if (isset(self::$classes[$type])) { - foreach (self::$classes[$type] as $class) { - $candidates[] = ['class' => $class, 'condition' => [$class]]; - } - } - - return $candidates; - } -} diff --git a/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php b/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php deleted file mode 100644 index 641485a6..00000000 --- a/vendor/php-http/discovery/src/Strategy/DiscoveryStrategy.php +++ /dev/null @@ -1,23 +0,0 @@ - - */ -interface DiscoveryStrategy -{ - /** - * Find a resource of a specific type. - * - * @param string $type - * - * @return array The return value is always an array with zero or more elements. Each - * element is an array with two keys ['class' => string, 'condition' => mixed]. - * - * @throws StrategyUnavailableException if we cannot use this strategy. - */ - public static function getCandidates($type); -} diff --git a/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php b/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php deleted file mode 100644 index 0cee3f7e..00000000 --- a/vendor/php-http/discovery/src/Strategy/MockClientStrategy.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -final class MockClientStrategy implements DiscoveryStrategy -{ - /** - * {@inheritdoc} - */ - public static function getCandidates($type) - { - if (is_a(HttpClient::class, $type, true) || is_a(HttpAsyncClient::class, $type, true)) { - return [['class' => Mock::class, 'condition' => Mock::class]]; - } - - return []; - } -} diff --git a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php deleted file mode 100644 index c1e1fb7e..00000000 --- a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php +++ /dev/null @@ -1,92 +0,0 @@ - - * @author Márk Sági-Kazár - */ -class PuliBetaStrategy implements DiscoveryStrategy -{ - /** - * @var GeneratedPuliFactory - */ - protected static $puliFactory; - - /** - * @var Discovery - */ - protected static $puliDiscovery; - - /** - * @return GeneratedPuliFactory - * - * @throws PuliUnavailableException - */ - private static function getPuliFactory() - { - if (null === self::$puliFactory) { - if (!defined('PULI_FACTORY_CLASS')) { - throw new PuliUnavailableException('Puli Factory is not available'); - } - - $puliFactoryClass = PULI_FACTORY_CLASS; - - if (!ClassDiscovery::safeClassExists($puliFactoryClass)) { - throw new PuliUnavailableException('Puli Factory class does not exist'); - } - - self::$puliFactory = new $puliFactoryClass(); - } - - return self::$puliFactory; - } - - /** - * Returns the Puli discovery layer. - * - * @return Discovery - * - * @throws PuliUnavailableException - */ - private static function getPuliDiscovery() - { - if (!isset(self::$puliDiscovery)) { - $factory = self::getPuliFactory(); - $repository = $factory->createRepository(); - - self::$puliDiscovery = $factory->createDiscovery($repository); - } - - return self::$puliDiscovery; - } - - /** - * {@inheritdoc} - */ - public static function getCandidates($type) - { - $returnData = []; - $bindings = self::getPuliDiscovery()->findBindings($type); - - foreach ($bindings as $binding) { - $condition = true; - if ($binding->hasParameterValue('depends')) { - $condition = $binding->getParameterValue('depends'); - } - $returnData[] = ['class' => $binding->getClassName(), 'condition' => $condition]; - } - - return $returnData; - } -} diff --git a/vendor/php-http/discovery/src/StreamFactoryDiscovery.php b/vendor/php-http/discovery/src/StreamFactoryDiscovery.php deleted file mode 100644 index e11c49ae..00000000 --- a/vendor/php-http/discovery/src/StreamFactoryDiscovery.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. - */ -final class StreamFactoryDiscovery extends ClassDiscovery -{ - /** - * Finds a Stream Factory. - * - * @return StreamFactory - * - * @throws Exception\NotFoundException - */ - public static function find() - { - try { - $streamFactory = static::findOneByType(StreamFactory::class); - } catch (DiscoveryFailedException $e) { - throw new NotFoundException('No stream factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); - } - - return static::instantiateClass($streamFactory); - } -} diff --git a/vendor/php-http/discovery/src/UriFactoryDiscovery.php b/vendor/php-http/discovery/src/UriFactoryDiscovery.php deleted file mode 100644 index db3add20..00000000 --- a/vendor/php-http/discovery/src/UriFactoryDiscovery.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * @deprecated This will be removed in 2.0. Consider using Psr17FactoryDiscovery. - */ -final class UriFactoryDiscovery extends ClassDiscovery -{ - /** - * Finds a URI Factory. - * - * @return UriFactory - * - * @throws Exception\NotFoundException - */ - public static function find() - { - try { - $uriFactory = static::findOneByType(UriFactory::class); - } catch (DiscoveryFailedException $e) { - throw new NotFoundException('No uri factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.', 0, $e); - } - - return static::instantiateClass($uriFactory); - } -} diff --git a/vendor/php-http/httplug/.php-cs-fixer.dist.php b/vendor/php-http/httplug/.php-cs-fixer.dist.php deleted file mode 100644 index 83809c25..00000000 --- a/vendor/php-http/httplug/.php-cs-fixer.dist.php +++ /dev/null @@ -1,16 +0,0 @@ -in(__DIR__.'/src') - ->name('*.php') -; - -$config = (new PhpCsFixer\Config()) - ->setRiskyAllowed(true) - ->setRules([ - '@Symfony' => true, - ]) - ->setFinder($finder) -; - -return $config; diff --git a/vendor/php-http/httplug/CHANGELOG.md b/vendor/php-http/httplug/CHANGELOG.md deleted file mode 100644 index 26483c2c..00000000 --- a/vendor/php-http/httplug/CHANGELOG.md +++ /dev/null @@ -1,136 +0,0 @@ -# Change Log - - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - - -## [Unreleased] - -## [2.3.0] - 2022-02-21 - -### Changed - -- Enabled the `$onRejected` callback of `HttpRejectedPromise` to return a promise for implementing a retry - mechanism [#168](https://github.com/php-http/httplug/pull/168) - -## [2.2.0] - 2020-07-13 - -### Changed - -- Support PHP 7.1-8.0 - -## [2.1.0] - 2019-12-27 - -### Changed - -- `Http\Client\Exception\NetworkException` no longer extends `Http\Client\Exception\RequestException`, - in accordance with [PSR-18](https://www.php-fig.org/psr/psr-18/) - -## [2.0.0] - 2018-10-31 - -This version is no BC break for consumers using HTTPlug. However, HTTP clients that -implement HTTPlug need to adjust because we add return type declarations. - -### Added - -- Support for PSR-18 (HTTP client). - -### Changed - -- **BC Break:** `HttpClient::sendRequest(RequestInterface $request)` has a return type annotation. The new -signature is `HttpClient::sendRequest(RequestInterface $request): ResponseInterface`. -- **BC Break:** `RequestException::getRequest()` has a return type annotation. The new -signature is `RequestException::getRequest(): RequestInterface`. - -### Removed - -- PHP 5 support - - -## [1.1.0] - 2016-08-31 - -### Added - -- HttpFulfilledPromise and HttpRejectedPromise which respect the HttpAsyncClient interface - - -## [1.0.0] - 2016-01-26 - -### Removed - -- Stability configuration from composer - - -## [1.0.0-RC1] - 2016-01-12 - -### Changed - -- Updated package files -- Updated promise dependency to RC1 - - -## [1.0.0-beta] - 2015-12-17 - -### Added - -- Puli configuration and binding types - -### Changed - -- Exception concept - - -## [1.0.0-alpha3] - 2015-12-13 - -### Changed - -- Async client does not throw exceptions - -### Removed - -- Promise interface moved to its own repository: [php-http/promise](https://github.com/php-http/promise) - - -## [1.0.0-alpha2] - 2015-11-16 - -### Added - -- Async client and Promise interface - - -## [1.0.0-alpha] - 2015-10-26 - -### Added - -- Better domain exceptions. - -### Changed - -- Purpose of the library: general HTTP CLient abstraction. - -### Removed - -- Request options: they should be configured at construction time. -- Multiple request sending: should be done asynchronously using Async Client. -- `getName` method - - -## 0.1.0 - 2015-06-03 - -### Added - -- Initial release - - -[Unreleased]: https://github.com/php-http/httplug/compare/v2.0.0...HEAD -[2.0.0]: https://github.com/php-http/httplug/compare/v1.1.0...HEAD -[1.1.0]: https://github.com/php-http/httplug/compare/v1.0.0...v1.1.0 -[1.0.0]: https://github.com/php-http/httplug/compare/v1.0.0-RC1...v1.0.0 -[1.0.0-RC1]: https://github.com/php-http/httplug/compare/v1.0.0-beta...v1.0.0-RC1 -[1.0.0-beta]: https://github.com/php-http/httplug/compare/v1.0.0-alpha3...v1.0.0-beta -[1.0.0-alpha3]: https://github.com/php-http/httplug/compare/v1.0.0-alpha2...v1.0.0-alpha3 -[1.0.0-alpha2]: https://github.com/php-http/httplug/compare/v1.0.0-alpha...v1.0.0-alpha2 -[1.0.0-alpha]: https://github.com/php-http/httplug/compare/v0.1.0...v1.0.0-alpha diff --git a/vendor/php-http/httplug/LICENSE b/vendor/php-http/httplug/LICENSE deleted file mode 100644 index 8cd264c6..00000000 --- a/vendor/php-http/httplug/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 Eric GELOEN -Copyright (c) 2015 PHP HTTP Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/httplug/README.md b/vendor/php-http/httplug/README.md deleted file mode 100644 index ce60cfaa..00000000 --- a/vendor/php-http/httplug/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# HTTPlug - -[![Latest Version](https://img.shields.io/github/release/php-http/httplug.svg?style=flat-square)](https://github.com/php-http/httplug/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://github.com/php-http/httplug/actions/workflows/ci.yml/badge.svg)](https://github.com/php-http/httplug/actions/workflows/ci.yml) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) -[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/httplug.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/httplug) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/httplug.svg?style=flat-square)](https://packagist.org/packages/php-http/httplug) - -[![Email](https://img.shields.io/badge/email-team@httplug.io-blue.svg?style=flat-square)](mailto:team@httplug.io) - -**HTTPlug, the HTTP client abstraction for PHP.** - - -## Intro - -HTTP client standard built on [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP -messages. The HTTPlug client interface is compatible with the official standard -for the HTTP client interface, [PSR-18](http://www.php-fig.org/psr/psr-18/). -HTTPlug adds an interface for asynchronous HTTP requests, which PSR-18 does not -cover. - -Since HTTPlug has already been widely adopted and a whole ecosystem has been -built around it, we will keep maintaining this package for the time being. -HTTPlug 2.0 and newer extend the PSR-18 interface to allow for a convenient -migration path. - -New client implementations and consumers should use the PSR-18 interfaces -directly. In the long term, we expect PSR-18 to completely replace the need -for HTTPlug. - - -## History - -HTTPlug is the official successor of the [ivory http adapter](https://github.com/egeloen/ivory-http-adapter). -HTTPlug is a predecessor of [PSR-18](http://www.php-fig.org/psr/psr-18/) - - -## Install - -Via Composer - -``` bash -$ composer require php-http/httplug -``` - - -## Documentation - -Please see the [official documentation](http://docs.php-http.org). - - -## Testing - -``` bash -$ composer test -``` - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/httplug/composer.json b/vendor/php-http/httplug/composer.json deleted file mode 100644 index 268b27ec..00000000 --- a/vendor/php-http/httplug/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "php-http/httplug", - "description": "HTTPlug, the HTTP client abstraction for PHP", - "keywords": [ - "http", - "client" - ], - "homepage": "http://httplug.io", - "license": "MIT", - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "require": { - "php": "^7.1 || ^8.0", - "php-http/promise": "^1.1", - "psr/http-client": "^1.0", - "psr/http-message": "^1.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage": "^4.1", - "phpspec/phpspec": "^5.1 || ^6.0" - }, - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Client\\": "src/" - } - }, - "scripts": { - "test": "vendor/bin/phpspec run", - "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" - } -} diff --git a/vendor/php-http/httplug/puli.json b/vendor/php-http/httplug/puli.json deleted file mode 100644 index 41683315..00000000 --- a/vendor/php-http/httplug/puli.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "1.0", - "name": "php-http/httplug", - "binding-types": { - "Http\\Client\\HttpAsyncClient": { - "description": "Async HTTP Client" - }, - "Http\\Client\\HttpClient": { - "description": "HTTP Client" - } - } -} diff --git a/vendor/php-http/httplug/src/Exception.php b/vendor/php-http/httplug/src/Exception.php deleted file mode 100644 index 4df164c9..00000000 --- a/vendor/php-http/httplug/src/Exception.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ -interface Exception extends PsrClientException -{ -} diff --git a/vendor/php-http/httplug/src/Exception/HttpException.php b/vendor/php-http/httplug/src/Exception/HttpException.php deleted file mode 100644 index 6c2a007a..00000000 --- a/vendor/php-http/httplug/src/Exception/HttpException.php +++ /dev/null @@ -1,65 +0,0 @@ - - */ -class HttpException extends RequestException -{ - /** - * @var ResponseInterface - */ - protected $response; - - /** - * @param string $message - */ - public function __construct( - $message, - RequestInterface $request, - ResponseInterface $response, - \Exception $previous = null - ) { - parent::__construct($message, $request, $previous); - - $this->response = $response; - $this->code = $response->getStatusCode(); - } - - /** - * Returns the response. - * - * @return ResponseInterface - */ - public function getResponse() - { - return $this->response; - } - - /** - * Factory method to create a new exception with a normalized error message. - */ - public static function create( - RequestInterface $request, - ResponseInterface $response, - \Exception $previous = null - ) { - $message = sprintf( - '[url] %s [http method] %s [status code] %s [reason phrase] %s', - $request->getRequestTarget(), - $request->getMethod(), - $response->getStatusCode(), - $response->getReasonPhrase() - ); - - return new static($message, $request, $response, $previous); - } -} diff --git a/vendor/php-http/httplug/src/Exception/NetworkException.php b/vendor/php-http/httplug/src/Exception/NetworkException.php deleted file mode 100644 index 9b4f1e8f..00000000 --- a/vendor/php-http/httplug/src/Exception/NetworkException.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ -class NetworkException extends TransferException implements PsrNetworkException -{ - use RequestAwareTrait; - - /** - * @param string $message - */ - public function __construct($message, RequestInterface $request, \Exception $previous = null) - { - $this->setRequest($request); - - parent::__construct($message, 0, $previous); - } -} diff --git a/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php deleted file mode 100644 index 71b4bb8c..00000000 --- a/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php +++ /dev/null @@ -1,26 +0,0 @@ -request = $request; - } - - /** - * {@inheritdoc} - */ - public function getRequest(): RequestInterface - { - return $this->request; - } -} diff --git a/vendor/php-http/httplug/src/Exception/RequestException.php b/vendor/php-http/httplug/src/Exception/RequestException.php deleted file mode 100644 index f6c60ce5..00000000 --- a/vendor/php-http/httplug/src/Exception/RequestException.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ -class RequestException extends TransferException implements PsrRequestException -{ - use RequestAwareTrait; - - /** - * @param string $message - */ - public function __construct($message, RequestInterface $request, \Exception $previous = null) - { - $this->setRequest($request); - - parent::__construct($message, 0, $previous); - } -} diff --git a/vendor/php-http/httplug/src/Exception/TransferException.php b/vendor/php-http/httplug/src/Exception/TransferException.php deleted file mode 100644 index a858cf5e..00000000 --- a/vendor/php-http/httplug/src/Exception/TransferException.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ -class TransferException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/php-http/httplug/src/HttpAsyncClient.php b/vendor/php-http/httplug/src/HttpAsyncClient.php deleted file mode 100644 index c3b9d61a..00000000 --- a/vendor/php-http/httplug/src/HttpAsyncClient.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -interface HttpAsyncClient -{ - /** - * Sends a PSR-7 request in an asynchronous way. - * - * Exceptions related to processing the request are available from the returned Promise. - * - * @return Promise resolves a PSR-7 Response or fails with an Http\Client\Exception - * - * @throws \Exception If processing the request is impossible (eg. bad configuration). - */ - public function sendAsyncRequest(RequestInterface $request); -} diff --git a/vendor/php-http/httplug/src/HttpClient.php b/vendor/php-http/httplug/src/HttpClient.php deleted file mode 100644 index 4442bd01..00000000 --- a/vendor/php-http/httplug/src/HttpClient.php +++ /dev/null @@ -1,15 +0,0 @@ -response = $response; - } - - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) - { - if (null === $onFulfilled) { - return $this; - } - - try { - return new self($onFulfilled($this->response)); - } catch (Exception $e) { - return new HttpRejectedPromise($e); - } - } - - /** - * {@inheritdoc} - */ - public function getState() - { - return Promise::FULFILLED; - } - - /** - * {@inheritdoc} - */ - public function wait($unwrap = true) - { - if ($unwrap) { - return $this->response; - } - } -} diff --git a/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php b/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php deleted file mode 100644 index 624cc8a9..00000000 --- a/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php +++ /dev/null @@ -1,58 +0,0 @@ -exception = $exception; - } - - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) - { - if (null === $onRejected) { - return $this; - } - - try { - $result = $onRejected($this->exception); - if ($result instanceof Promise) { - return $result; - } - - return new HttpFulfilledPromise($result); - } catch (Exception $e) { - return new self($e); - } - } - - /** - * {@inheritdoc} - */ - public function getState() - { - return Promise::REJECTED; - } - - /** - * {@inheritdoc} - */ - public function wait($unwrap = true) - { - if ($unwrap) { - throw $this->exception; - } - } -} diff --git a/vendor/php-http/message-factory/CHANGELOG.md b/vendor/php-http/message-factory/CHANGELOG.md deleted file mode 100644 index 4711924c..00000000 --- a/vendor/php-http/message-factory/CHANGELOG.md +++ /dev/null @@ -1,65 +0,0 @@ -# Change Log - - -## 1.0.2 - 2015-12-19 - -### Added - -- Request and Response factory binding types to Puli - - -## 1.0.1 - 2015-12-17 - -### Added - -- Puli configuration and binding types - - -## 1.0.0 - 2015-12-15 - -### Added - -- Response Factory in order to be reused in Message and Server Message factories -- Request Factory - -### Changed - -- Message Factory extends Request and Response factories - - -## 1.0.0-RC1 - 2015-12-14 - -### Added - -- CS check - -### Changed - -- RuntimeException is thrown when the StreamFactory cannot write to the underlying stream - - -## 0.3.0 - 2015-11-16 - -### Removed - -- Client Context Factory -- Factory Awares and Templates - - -## 0.2.0 - 2015-11-16 - -### Changed - -- Reordered the parameters when creating a message to have the protocol last, -as its the least likely to need to be changed. - - -## 0.1.0 - 2015-06-01 - -### Added - -- Initial release - -### Changed - -- Helpers are renamed to templates diff --git a/vendor/php-http/message-factory/LICENSE b/vendor/php-http/message-factory/LICENSE deleted file mode 100644 index 8e2c4a0b..00000000 --- a/vendor/php-http/message-factory/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 PHP HTTP Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/message-factory/README.md b/vendor/php-http/message-factory/README.md deleted file mode 100644 index 4654495a..00000000 --- a/vendor/php-http/message-factory/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# PSR-7 Message Factory - -[![Latest Version](https://img.shields.io/github/release/php-http/message-factory.svg?style=flat-square)](https://github.com/php-http/message-factory/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message-factory.svg?style=flat-square)](https://packagist.org/packages/php-http/message-factory) - -**Factory interfaces for PSR-7 HTTP Message.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/message-factory -``` - - -## Documentation - -Please see the [official documentation](http://php-http.readthedocs.org/en/latest/message-factory/). - - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/message-factory/composer.json b/vendor/php-http/message-factory/composer.json deleted file mode 100644 index 7c72febe..00000000 --- a/vendor/php-http/message-factory/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "php-http/message-factory", - "description": "Factory interfaces for PSR-7 HTTP Message", - "license": "MIT", - "keywords": ["http", "factory", "message", "stream", "uri"], - "homepage": "http://php-http.org", - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/vendor/php-http/message-factory/puli.json b/vendor/php-http/message-factory/puli.json deleted file mode 100644 index 08d37627..00000000 --- a/vendor/php-http/message-factory/puli.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": "1.0", - "binding-types": { - "Http\\Message\\MessageFactory": { - "description": "PSR-7 Message Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\RequestFactory": { - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\ResponseFactory": { - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\StreamFactory": { - "description": "PSR-7 Stream Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - }, - "Http\\Message\\UriFactory": { - "description": "PSR-7 URI Factory", - "parameters": { - "depends": { - "description": "Optional class dependency which can be checked by consumers" - } - } - } - } -} diff --git a/vendor/php-http/message-factory/src/MessageFactory.php b/vendor/php-http/message-factory/src/MessageFactory.php deleted file mode 100644 index 965aaa80..00000000 --- a/vendor/php-http/message-factory/src/MessageFactory.php +++ /dev/null @@ -1,12 +0,0 @@ - - */ -interface MessageFactory extends RequestFactory, ResponseFactory -{ -} diff --git a/vendor/php-http/message-factory/src/RequestFactory.php b/vendor/php-http/message-factory/src/RequestFactory.php deleted file mode 100644 index 624e82f3..00000000 --- a/vendor/php-http/message-factory/src/RequestFactory.php +++ /dev/null @@ -1,34 +0,0 @@ - - */ -interface RequestFactory -{ - /** - * Creates a new PSR-7 request. - * - * @param string $method - * @param string|UriInterface $uri - * @param array $headers - * @param resource|string|StreamInterface|null $body - * @param string $protocolVersion - * - * @return RequestInterface - */ - public function createRequest( - $method, - $uri, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ); -} diff --git a/vendor/php-http/message-factory/src/ResponseFactory.php b/vendor/php-http/message-factory/src/ResponseFactory.php deleted file mode 100644 index 2411ed3a..00000000 --- a/vendor/php-http/message-factory/src/ResponseFactory.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ -interface ResponseFactory -{ - /** - * Creates a new PSR-7 response. - * - * @param int $statusCode - * @param string|null $reasonPhrase - * @param array $headers - * @param resource|string|StreamInterface|null $body - * @param string $protocolVersion - * - * @return ResponseInterface - */ - public function createResponse( - $statusCode = 200, - $reasonPhrase = null, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ); -} diff --git a/vendor/php-http/message-factory/src/StreamFactory.php b/vendor/php-http/message-factory/src/StreamFactory.php deleted file mode 100644 index 327a902f..00000000 --- a/vendor/php-http/message-factory/src/StreamFactory.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -interface StreamFactory -{ - /** - * Creates a new PSR-7 stream. - * - * @param string|resource|StreamInterface|null $body - * - * @return StreamInterface - * - * @throws \InvalidArgumentException If the stream body is invalid. - * @throws \RuntimeException If creating the stream from $body fails. - */ - public function createStream($body = null); -} diff --git a/vendor/php-http/message-factory/src/UriFactory.php b/vendor/php-http/message-factory/src/UriFactory.php deleted file mode 100644 index f05e6252..00000000 --- a/vendor/php-http/message-factory/src/UriFactory.php +++ /dev/null @@ -1,24 +0,0 @@ - - */ -interface UriFactory -{ - /** - * Creates an PSR-7 URI. - * - * @param string|UriInterface $uri - * - * @return UriInterface - * - * @throws \InvalidArgumentException If the $uri argument can not be converted into a valid URI. - */ - public function createUri($uri); -} diff --git a/vendor/php-http/message/CHANGELOG.md b/vendor/php-http/message/CHANGELOG.md deleted file mode 100644 index a185f461..00000000 --- a/vendor/php-http/message/CHANGELOG.md +++ /dev/null @@ -1,254 +0,0 @@ -# Change Log - - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -## [1.13.0] - 2022-02-11 - -- Added `Formatter::formatResponseForRequest()` to allow the formatter to get context from the request to decide what of the response to output. -- Deprecated `Formatter::formatResponse()` in favor of the new `formatResponseForRequest` method. - -## [1.12.0] - 2021-08-29 - -- Added support for adjusting binary detection regex in FullHttpMessageFormatter. - -## [1.11.2] - 2021-08-03 - -- Support GuzzleHttp/Psr7 version 2.0 in the (deprecated) GuzzleStreamFactory. - -## [1.11.1] - 2021-05-24 - -- Support GuzzleHttp/Psr7 version 2.0 in the (deprecated) GuzzleUriFactory. - -## [1.11.0] - 2020-02-01 - -- Migrated from `zendframework/zend-diactoros` to `laminas/laminas-diactoros`. - Users are encouraged to update their dependencies by simply replacing the Zend package with the Laminas package. - Due to the [laminas-zendframework-brige](https://github.com/laminas/laminas-zendframework-bridge), BC changes - are not expected and legacy code does not need to be refactored (though it is - [recommended and simple](https://docs.laminas.dev/migration/)). -- The diactoros factories of `php-http/message` will return objects from the `Laminas\Diactoros\` namespace, if - the respective classes are available via autoloading, but continue to return objects from `Zend\Diactoros\` - namespace otherwise. - -- Allow to specify the hashing algorithm for WSSE authentication. - -## [1.10.0] - 2020-11-11 - -- Added support for PHP 8.0. - -## [1.9.1] - 2020-10-13 - -- Improved detection of binary stream to not consider newlines, carriage return or tabs as binary. - -## [1.9.0] - 2020-08-17 - -- Omitted binary body in FullHttpMessageFormatter and CurlCommandFormatter. - `[binary stream omitted]` will be shown instead. - -### Added - -- New Header authentication method for arbitrary header authentication. - -## [1.8.0] - 2019-08-05 - -### Changed - -- Raised minimum PHP version to 7.1 - -### Fixed - -- Fatal error on `CurlCommandFormatter` when body is larger than `escapeshellarg` allowed length. -- Do not read stream in message formatter if stream is not seekable. - -## [1.7.2] - 2018-10-30 - -### Fixed - -- FilteredStream uses `@trigger_error` instead of throwing exceptions to not - break careless users. You still need to fix your stream code to respect - `isSeekable`. Seeking does not work as expected, and we will add exceptions - in version 2. - -## [1.7.1] - 2018-10-29 - -### Fixed - -- FilteredStream is not actually seekable - - -## [1.7.0] - 2018-08-15 - -### Fixed - -- Fix CurlCommandFormatter for binary request payloads -- Fix QueryParam authentication to assemble proper URL regardless of PHP `arg_separator.output` directive -- Do not pass `null` parameters to `Clue\StreamFilter\fun` - -### Changed - -- Dropped tests on HHVM - - -## [1.6.0] - 2017-07-05 - -### Added - -- CookieUtil::parseDate to create a date from cookie date string - -### Fixed - -- Fix curl command of CurlFormatter when there is an user-agent header - - -## [1.5.0] - 2017-02-14 - -### Added - -- Check for empty string in Stream factories -- Cookie::createWithoutValidation Static constructor to create a cookie. Will not perform any attribute validation during instantiation. -- Cookie::isValid Method to check if cookie attributes are valid. - -### Fixed - -- FilteredStream::getSize returns null because the contents size is unknown. -- Stream factories does not rewinds streams. The previous behavior was not coherent between factories and inputs. - -### Deprecated - -- FilteredStream::getReadFilter The read filter is internal and should never be used by consuming code. -- FilteredStream::getWriteFilter We did not implement writing to the streams at all. And if we do, the filter is an internal information and should not be used by consuming code. - - -## [1.4.1] - 2016-12-16 - -### Fixed - -- Cookie::matchPath Cookie with root path (`/`) will not match sub path (e.g. `/cookie`). - - -## [1.4.0] - 2016-10-20 - -### Added - -- Message, stream and URI factories for [Slim Framework](https://github.com/slimphp/Slim) -- BufferedStream that allow you to decorate a non-seekable stream with a seekable one. -- cUrlFormatter to be able to redo the request with a cURL command - - -## [1.3.1] - 2016-07-15 - -### Fixed - -- FullHttpMessageFormatter will not read from streams that you cannot rewind (non-seekable) -- FullHttpMessageFormatter will not read from the stream if $maxBodyLength is zero -- FullHttpMessageFormatter rewinds streams after they are read - - -## [1.3.0] - 2016-07-14 - -### Added - -- FullHttpMessageFormatter to include headers and body in the formatted message - -### Fixed - -- #41: Response builder broke header value - - -## [1.2.0] - 2016-03-29 - -### Added - -- The RequestMatcher is built after the Symfony RequestMatcher and separates - scheme, host and path expressions and provides an option to filter on the - method -- New RequestConditional authentication method using request matchers -- Add automatic basic auth info detection based on the URL - -### Changed - -- Improved ResponseBuilder - -### Deprecated - -- RegexRequestMatcher, use RequestMatcher instead -- Matching authenitcation method, use RequestConditional instead - - -## [1.1.0] - 2016-02-25 - -### Added - - - Add a request matcher interface and regex implementation - - Add a callback request matcher implementation - - Add a ResponseBuilder, to create PSR7 Response from a string - -### Fixed - - - Fix casting string on a FilteredStream not filtering the output - - -## [1.0.0] - 2016-01-27 - - -## [0.2.0] - 2015-12-29 - -### Added - -- Autoregistration of stream filters using Composer autoload -- Cookie -- [Apigen](http://www.apigen.org/) configuration - - -## [0.1.2] - 2015-12-26 - -### Added - -- Request and response factory bindings - -### Fixed - -- Chunk filter namespace in Dechunk stream - - -## [0.1.1] - 2015-12-25 - -### Added - -- Formatter - - -## 0.1.0 - 2015-12-24 - -### Added - -- Authentication -- Encoding -- Message decorator -- Message factory (Guzzle, Diactoros) - - -[Unreleased]: https://github.com/php-http/message/compare/1.10.0...HEAD -[1.10.0]: https://github.com/php-http/message/compare/1.9.1...1.10.0 -[1.9.1]: https://github.com/php-http/message/compare/1.9.0...1.9.1 -[1.9.0]: https://github.com/php-http/message/compare/1.8.0...1.9.0 -[1.8.0]: https://github.com/php-http/message/compare/1.7.2...1.8.0 -[1.7.2]: https://github.com/php-http/message/compare/v1.7.1...1.7.2 -[1.7.1]: https://github.com/php-http/message/compare/1.7.0...v1.7.1 -[1.7.0]: https://github.com/php-http/message/compare/1.6.0...1.7.0 -[1.6.0]: https://github.com/php-http/message/compare/1.5.0...1.6.0 -[1.5.0]: https://github.com/php-http/message/compare/v1.4.1...1.5.0 -[1.4.1]: https://github.com/php-http/message/compare/v1.4.0...v1.4.1 -[1.4.0]: https://github.com/php-http/message/compare/v1.3.1...v1.4.0 -[1.3.1]: https://github.com/php-http/message/compare/v1.3.0...v1.3.1 -[1.3.0]: https://github.com/php-http/message/compare/v1.2.0...v1.3.0 -[1.2.0]: https://github.com/php-http/message/compare/v1.1.0...v1.2.0 -[1.1.0]: https://github.com/php-http/message/compare/v1.0.0...v1.1.0 -[1.0.0]: https://github.com/php-http/message/compare/0.2.0...v1.0.0 -[0.2.0]: https://github.com/php-http/message/compare/v0.1.2...0.2.0 -[0.1.2]: https://github.com/php-http/message/compare/v0.1.1...v0.1.2 -[0.1.1]: https://github.com/php-http/message/compare/v0.1.0...v0.1.1 diff --git a/vendor/php-http/message/LICENSE b/vendor/php-http/message/LICENSE deleted file mode 100644 index 4558d6f0..00000000 --- a/vendor/php-http/message/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2016 PHP HTTP Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/message/README.md b/vendor/php-http/message/README.md deleted file mode 100644 index df1a7d55..00000000 --- a/vendor/php-http/message/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# HTTP Message - -[![Latest Version](https://img.shields.io/github/release/php-http/message.svg?style=flat-square)](https://github.com/php-http/message/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/php-http/message/CI?style=flat-square)](https://github.com/php-http/message/actions?query=workflow%3ACI+branch%3Amaster) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/message.svg?style=flat-square)](https://packagist.org/packages/php-http/message) - -**HTTP Message related tools.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/message -``` - - -## Intro - -This package contains various PSR-7 tools which might be useful in an HTTP workflow: - -- Authentication method implementations -- Various Stream encoding tools -- Message decorators -- Message factory implementations for Guzzle PSR-7 and Diactoros -- Cookie implementation -- Request matchers - - -## Documentation - -Please see the [official documentation](http://docs.php-http.org/en/latest/message.html). - - -## Testing - -``` bash -$ composer test -``` - - -## Credits - -Thanks to [Cuzzle](https://github.com/namshi/cuzzle) for inpiration for the `CurlCommandFormatter`. - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/message/apigen.neon b/vendor/php-http/message/apigen.neon deleted file mode 100644 index 0ba1a185..00000000 --- a/vendor/php-http/message/apigen.neon +++ /dev/null @@ -1,6 +0,0 @@ -source: - - src/ - -destination: build/api/ - -templateTheme: bootstrap diff --git a/vendor/php-http/message/composer.json b/vendor/php-http/message/composer.json deleted file mode 100644 index 1a614df8..00000000 --- a/vendor/php-http/message/composer.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "php-http/message", - "description": "HTTP Message related tools", - "keywords": [ - "message", - "http", - "psr-7" - ], - "homepage": "http://php-http.org", - "license": "MIT", - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php": "^7.1 || ^8.0", - "clue/stream-filter": "^1.5", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" - }, - "require-dev": { - "ext-zlib": "*", - "ergebnis/composer-normalize": "^2.6", - "guzzlehttp/psr7": "^1.0", - "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", - "slim/slim": "^3.0", - "laminas/laminas-diactoros": "^2.0" - }, - "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "laminas/laminas-diactoros": "Used with Diactoros Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation" - }, - "config": { - "sort-packages": true, - "allow-plugins": { - "ergebnis/composer-normalize": true - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - }, - "files": [ - "src/filters.php" - ] - }, - "autoload-dev": { - "psr-4": { - "spec\\Http\\Message\\": "spec/" - } - }, - "scripts": { - "test": "vendor/bin/phpspec run", - "test-ci": "vendor/bin/phpspec run -c phpspec.ci.yml" - } -} diff --git a/vendor/php-http/message/puli.json b/vendor/php-http/message/puli.json deleted file mode 100644 index 024a85d9..00000000 --- a/vendor/php-http/message/puli.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "version": "1.0", - "name": "php-http/message", - "bindings": { - "064d003d-78a1-48c4-8f3b-1f92ff25da69": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\DiactorosMessageFactory", - "type": "Http\\Message\\MessageFactory", - "parameters": { - "depends": "Zend\\Diactoros\\Request" - } - }, - "0836751e-6558-4d1b-8993-4a52012947c3": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\SlimMessageFactory", - "type": "Http\\Message\\ResponseFactory" - }, - "1d127622-dc61-4bfa-b9da-d221548d72c3": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\SlimMessageFactory", - "type": "Http\\Message\\RequestFactory" - }, - "2438c2d0-0658-441f-8855-ddaf0f87d54d": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\GuzzleMessageFactory", - "type": "Http\\Message\\MessageFactory", - "parameters": { - "depends": "GuzzleHttp\\Psr7\\Request" - } - }, - "253aa08c-d705-46e7-b1d2-e28c97eef792": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\GuzzleMessageFactory", - "type": "Http\\Message\\RequestFactory", - "parameters": { - "depends": "GuzzleHttp\\Psr7\\Request" - } - }, - "273a34f9-62f4-4ba1-9801-b1284d49ff89": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\StreamFactory\\GuzzleStreamFactory", - "type": "Http\\Message\\StreamFactory", - "parameters": { - "depends": "GuzzleHttp\\Psr7\\Stream" - } - }, - "304b83db-b594-4d83-ae75-1f633adf92f7": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\UriFactory\\GuzzleUriFactory", - "type": "Http\\Message\\UriFactory", - "parameters": { - "depends": "GuzzleHttp\\Psr7\\Uri" - } - }, - "3f4bc1cd-aa95-4702-9fa7-65408e471691": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\UriFactory\\DiactorosUriFactory", - "type": "Http\\Message\\UriFactory", - "parameters": { - "depends": "Zend\\Diactoros\\Uri" - } - }, - "4672a6ee-ad9e-4109-a5d1-b7d46f26c7a1": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\SlimMessageFactory", - "type": "Http\\Message\\MessageFactory" - }, - "6234e947-d3bd-43eb-97d5-7f9e22e6bb1b": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\DiactorosMessageFactory", - "type": "Http\\Message\\ResponseFactory", - "parameters": { - "depends": "Zend\\Diactoros\\Response" - } - }, - "6a9ad6ce-d82c-470f-8e30-60f21d9d95bf": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\UriFactory\\SlimUriFactory", - "type": "Http\\Message\\UriFactory" - }, - "72c2afa0-ea56-4d03-adb6-a9f241a8a734": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\StreamFactory\\SlimStreamFactory", - "type": "Http\\Message\\StreamFactory" - }, - "95c1be8f-39fe-4abd-8351-92cb14379a75": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\StreamFactory\\DiactorosStreamFactory", - "type": "Http\\Message\\StreamFactory", - "parameters": { - "depends": "Zend\\Diactoros\\Stream" - } - }, - "a018af27-7590-4dcf-83a1-497f95604cd6": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\GuzzleMessageFactory", - "type": "Http\\Message\\ResponseFactory", - "parameters": { - "depends": "GuzzleHttp\\Psr7\\Response" - } - }, - "c07955b1-de46-43db-923b-d07fae9382cb": { - "_class": "Puli\\Discovery\\Binding\\ClassBinding", - "class": "Http\\Message\\MessageFactory\\DiactorosMessageFactory", - "type": "Http\\Message\\RequestFactory", - "parameters": { - "depends": "Zend\\Diactoros\\Request" - } - } - } -} diff --git a/vendor/php-http/message/src/Authentication.php b/vendor/php-http/message/src/Authentication.php deleted file mode 100644 index 0fe0cb3a..00000000 --- a/vendor/php-http/message/src/Authentication.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -interface Authentication -{ - /** - * Alter the request to add the authentication credentials. - * - * To do that, the implementation might use pre-stored credentials or do - * separate HTTP requests to obtain a valid token. - * - * @param RequestInterface $request The request without authentication information - * - * @return RequestInterface The request with added authentication information - */ - public function authenticate(RequestInterface $request); -} diff --git a/vendor/php-http/message/src/Authentication/AutoBasicAuth.php b/vendor/php-http/message/src/Authentication/AutoBasicAuth.php deleted file mode 100644 index 7b6a4294..00000000 --- a/vendor/php-http/message/src/Authentication/AutoBasicAuth.php +++ /dev/null @@ -1,48 +0,0 @@ - - */ -final class AutoBasicAuth implements Authentication -{ - /** - * Whether user info should be removed from the URI. - * - * @var bool - */ - private $shouldRemoveUserInfo; - - /** - * @param bool|true $shouldRremoveUserInfo - */ - public function __construct($shouldRremoveUserInfo = true) - { - $this->shouldRemoveUserInfo = (bool) $shouldRremoveUserInfo; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - $uri = $request->getUri(); - $userInfo = $uri->getUserInfo(); - - if (!empty($userInfo)) { - if ($this->shouldRemoveUserInfo) { - $request = $request->withUri($uri->withUserInfo('')); - } - - $request = $request->withHeader('Authorization', sprintf('Basic %s', base64_encode($userInfo))); - } - - return $request; - } -} diff --git a/vendor/php-http/message/src/Authentication/BasicAuth.php b/vendor/php-http/message/src/Authentication/BasicAuth.php deleted file mode 100644 index 23618a53..00000000 --- a/vendor/php-http/message/src/Authentication/BasicAuth.php +++ /dev/null @@ -1,44 +0,0 @@ - - */ -final class BasicAuth implements Authentication -{ - /** - * @var string - */ - private $username; - - /** - * @var string - */ - private $password; - - /** - * @param string $username - * @param string $password - */ - public function __construct($username, $password) - { - $this->username = $username; - $this->password = $password; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - $header = sprintf('Basic %s', base64_encode(sprintf('%s:%s', $this->username, $this->password))); - - return $request->withHeader('Authorization', $header); - } -} diff --git a/vendor/php-http/message/src/Authentication/Bearer.php b/vendor/php-http/message/src/Authentication/Bearer.php deleted file mode 100644 index a8fb21a1..00000000 --- a/vendor/php-http/message/src/Authentication/Bearer.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ -final class Bearer implements Authentication -{ - /** - * @var string - */ - private $token; - - /** - * @param string $token - */ - public function __construct($token) - { - $this->token = $token; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - $header = sprintf('Bearer %s', $this->token); - - return $request->withHeader('Authorization', $header); - } -} diff --git a/vendor/php-http/message/src/Authentication/Chain.php b/vendor/php-http/message/src/Authentication/Chain.php deleted file mode 100644 index 71002bb1..00000000 --- a/vendor/php-http/message/src/Authentication/Chain.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -final class Chain implements Authentication -{ - /** - * @var Authentication[] - */ - private $authenticationChain = []; - - /** - * @param Authentication[] $authenticationChain - */ - public function __construct(array $authenticationChain = []) - { - foreach ($authenticationChain as $authentication) { - if (!$authentication instanceof Authentication) { - throw new \InvalidArgumentException( - 'Members of the authentication chain must be of type Http\Message\Authentication' - ); - } - } - - $this->authenticationChain = $authenticationChain; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - foreach ($this->authenticationChain as $authentication) { - $request = $authentication->authenticate($request); - } - - return $request; - } -} diff --git a/vendor/php-http/message/src/Authentication/Header.php b/vendor/php-http/message/src/Authentication/Header.php deleted file mode 100644 index 77f63827..00000000 --- a/vendor/php-http/message/src/Authentication/Header.php +++ /dev/null @@ -1,36 +0,0 @@ -name = $name; - $this->value = $value; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - return $request->withHeader($this->name, $this->value); - } -} diff --git a/vendor/php-http/message/src/Authentication/Matching.php b/vendor/php-http/message/src/Authentication/Matching.php deleted file mode 100644 index 7a5c247b..00000000 --- a/vendor/php-http/message/src/Authentication/Matching.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * @deprecated since since version 1.2, and will be removed in 2.0. Use {@link RequestConditional} instead. - */ -final class Matching implements Authentication -{ - /** - * @var Authentication - */ - private $authentication; - - /** - * @var CallbackRequestMatcher - */ - private $matcher; - - public function __construct(Authentication $authentication, callable $matcher = null) - { - if (is_null($matcher)) { - $matcher = function () { - return true; - }; - } - - $this->authentication = $authentication; - $this->matcher = new CallbackRequestMatcher($matcher); - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - if ($this->matcher->matches($request)) { - return $this->authentication->authenticate($request); - } - - return $request; - } - - /** - * Creates a matching authentication for an URL. - * - * @param string $url - * - * @return self - */ - public static function createUrlMatcher(Authentication $authentication, $url) - { - $matcher = function (RequestInterface $request) use ($url) { - return preg_match($url, $request->getRequestTarget()); - }; - - return new static($authentication, $matcher); - } -} diff --git a/vendor/php-http/message/src/Authentication/QueryParam.php b/vendor/php-http/message/src/Authentication/QueryParam.php deleted file mode 100644 index 243efef3..00000000 --- a/vendor/php-http/message/src/Authentication/QueryParam.php +++ /dev/null @@ -1,47 +0,0 @@ - - */ -final class QueryParam implements Authentication -{ - /** - * @var array - */ - private $params = []; - - public function __construct(array $params) - { - $this->params = $params; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - $uri = $request->getUri(); - $query = $uri->getQuery(); - $params = []; - - parse_str($query, $params); - - $params = array_merge($params, $this->params); - - $query = http_build_query($params, '', '&'); - - $uri = $uri->withQuery($query); - - return $request->withUri($uri); - } -} diff --git a/vendor/php-http/message/src/Authentication/RequestConditional.php b/vendor/php-http/message/src/Authentication/RequestConditional.php deleted file mode 100644 index 01062cf6..00000000 --- a/vendor/php-http/message/src/Authentication/RequestConditional.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ -final class RequestConditional implements Authentication -{ - /** - * @var RequestMatcher - */ - private $requestMatcher; - - /** - * @var Authentication - */ - private $authentication; - - public function __construct(RequestMatcher $requestMatcher, Authentication $authentication) - { - $this->requestMatcher = $requestMatcher; - $this->authentication = $authentication; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - if ($this->requestMatcher->matches($request)) { - return $this->authentication->authenticate($request); - } - - return $request; - } -} diff --git a/vendor/php-http/message/src/Authentication/Wsse.php b/vendor/php-http/message/src/Authentication/Wsse.php deleted file mode 100644 index f343633d..00000000 --- a/vendor/php-http/message/src/Authentication/Wsse.php +++ /dev/null @@ -1,68 +0,0 @@ - - */ -final class Wsse implements Authentication -{ - /** - * @var string - */ - private $username; - - /** - * @var string - */ - private $password; - - /** - * @var string - */ - private $hashAlgorithm; - - /** - * @param string $username - * @param string $password - * @param string $hashAlgorithm To use a better hashing algorithm than the weak sha1, pass the algorithm to use, e.g. "sha512" - */ - public function __construct($username, $password, $hashAlgorithm = 'sha1') - { - $this->username = $username; - $this->password = $password; - if (false === in_array($hashAlgorithm, hash_algos())) { - throw new InvalidArgumentException(sprintf('Unaccepted hashing algorithm: %s', $hashAlgorithm)); - } - $this->hashAlgorithm = $hashAlgorithm; - } - - /** - * {@inheritdoc} - */ - public function authenticate(RequestInterface $request) - { - $nonce = substr(md5(uniqid(uniqid().'_', true)), 0, 16); - $created = date('c'); - $digest = base64_encode(hash($this->hashAlgorithm, base64_decode($nonce).$created.$this->password, true)); - - $wsse = sprintf( - 'UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"', - $this->username, - $digest, - $nonce, - $created - ); - - return $request - ->withHeader('Authorization', 'WSSE profile="UsernameToken"') - ->withHeader('X-WSSE', $wsse) - ; - } -} diff --git a/vendor/php-http/message/src/Builder/ResponseBuilder.php b/vendor/php-http/message/src/Builder/ResponseBuilder.php deleted file mode 100644 index 4c3ecfc4..00000000 --- a/vendor/php-http/message/src/Builder/ResponseBuilder.php +++ /dev/null @@ -1,146 +0,0 @@ -response = $response; - } - - /** - * Return response. - * - * @return ResponseInterface - */ - public function getResponse() - { - return $this->response; - } - - /** - * Add headers represented by an array of header lines. - * - * @param string[] $headers response headers as array of header lines - * - * @return $this - * - * @throws \UnexpectedValueException for invalid header values - * @throws \InvalidArgumentException for invalid status code arguments - */ - public function setHeadersFromArray(array $headers) - { - $status = array_shift($headers); - $this->setStatus($status); - - foreach ($headers as $headerLine) { - $headerLine = trim($headerLine); - if ('' === $headerLine) { - continue; - } - - $this->addHeader($headerLine); - } - - return $this; - } - - /** - * Add headers represented by a single string. - * - * @param string $headers response headers as single string - * - * @return $this - * - * @throws \InvalidArgumentException if $headers is not a string on object with __toString() - * @throws \UnexpectedValueException for invalid header values - */ - public function setHeadersFromString($headers) - { - if (!(is_string($headers) - || (is_object($headers) && method_exists($headers, '__toString'))) - ) { - throw new \InvalidArgumentException( - sprintf( - '%s expects parameter 1 to be a string, %s given', - __METHOD__, - is_object($headers) ? get_class($headers) : gettype($headers) - ) - ); - } - - $this->setHeadersFromArray(explode("\r\n", $headers)); - - return $this; - } - - /** - * Set response status from a status string. - * - * @param string $statusLine response status as a string - * - * @return $this - * - * @throws \InvalidArgumentException for invalid status line - */ - public function setStatus($statusLine) - { - $parts = explode(' ', $statusLine, 3); - if (count($parts) < 2 || 0 !== strpos(strtolower($parts[0]), 'http/')) { - throw new \InvalidArgumentException( - sprintf('"%s" is not a valid HTTP status line', $statusLine) - ); - } - - $reasonPhrase = count($parts) > 2 ? $parts[2] : ''; - $this->response = $this->response - ->withStatus((int) $parts[1], $reasonPhrase) - ->withProtocolVersion(substr($parts[0], 5)); - - return $this; - } - - /** - * Add header represented by a string. - * - * @param string $headerLine response header as a string - * - * @return $this - * - * @throws \InvalidArgumentException for invalid header names or values - */ - public function addHeader($headerLine) - { - $parts = explode(':', $headerLine, 2); - if (2 !== count($parts)) { - throw new \InvalidArgumentException( - sprintf('"%s" is not a valid HTTP header line', $headerLine) - ); - } - $name = trim($parts[0]); - $value = trim($parts[1]); - if ($this->response->hasHeader($name)) { - $this->response = $this->response->withAddedHeader($name, $value); - } else { - $this->response = $this->response->withHeader($name, $value); - } - - return $this; - } -} diff --git a/vendor/php-http/message/src/Cookie.php b/vendor/php-http/message/src/Cookie.php deleted file mode 100644 index 0cc2d43c..00000000 --- a/vendor/php-http/message/src/Cookie.php +++ /dev/null @@ -1,524 +0,0 @@ - - * - * @see http://tools.ietf.org/search/rfc6265 - */ -final class Cookie -{ - /** - * @var string - */ - private $name; - - /** - * @var string|null - */ - private $value; - - /** - * @var int|null - */ - private $maxAge; - - /** - * @var string|null - */ - private $domain; - - /** - * @var string - */ - private $path; - - /** - * @var bool - */ - private $secure; - - /** - * @var bool - */ - private $httpOnly; - - /** - * Expires attribute is HTTP 1.0 only and should be avoided. - * - * @var \DateTime|null - */ - private $expires; - - /** - * @param string $name - * @param string|null $value - * @param int|null $maxAge - * @param string|null $domain - * @param string|null $path - * @param bool $secure - * @param bool $httpOnly - * @param \DateTime|null $expires Expires attribute is HTTP 1.0 only and should be avoided. - * - * @throws \InvalidArgumentException if name, value or max age is not valid - */ - public function __construct( - $name, - $value = null, - $maxAge = null, - $domain = null, - $path = null, - $secure = false, - $httpOnly = false, - \DateTime $expires = null - ) { - $this->validateName($name); - $this->validateValue($value); - $this->validateMaxAge($maxAge); - - $this->name = $name; - $this->value = $value; - $this->maxAge = $maxAge; - $this->expires = $expires; - $this->domain = $this->normalizeDomain($domain); - $this->path = $this->normalizePath($path); - $this->secure = (bool) $secure; - $this->httpOnly = (bool) $httpOnly; - } - - /** - * Creates a new cookie without any attribute validation. - * - * @param string $name - * @param string|null $value - * @param int $maxAge - * @param string|null $domain - * @param string|null $path - * @param bool $secure - * @param bool $httpOnly - * @param \DateTime|null $expires Expires attribute is HTTP 1.0 only and should be avoided. - */ - public static function createWithoutValidation( - $name, - $value = null, - $maxAge = null, - $domain = null, - $path = null, - $secure = false, - $httpOnly = false, - \DateTime $expires = null - ) { - $cookie = new self('name', null, null, $domain, $path, $secure, $httpOnly, $expires); - $cookie->name = $name; - $cookie->value = $value; - $cookie->maxAge = $maxAge; - - return $cookie; - } - - /** - * Returns the name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Returns the value. - * - * @return string|null - */ - public function getValue() - { - return $this->value; - } - - /** - * Checks if there is a value. - * - * @return bool - */ - public function hasValue() - { - return isset($this->value); - } - - /** - * Sets the value. - * - * @param string|null $value - * - * @return Cookie - */ - public function withValue($value) - { - $this->validateValue($value); - - $new = clone $this; - $new->value = $value; - - return $new; - } - - /** - * Returns the max age. - * - * @return int|null - */ - public function getMaxAge() - { - return $this->maxAge; - } - - /** - * Checks if there is a max age. - * - * @return bool - */ - public function hasMaxAge() - { - return isset($this->maxAge); - } - - /** - * Sets the max age. - * - * @param int|null $maxAge - * - * @return Cookie - */ - public function withMaxAge($maxAge) - { - $this->validateMaxAge($maxAge); - - $new = clone $this; - $new->maxAge = $maxAge; - - return $new; - } - - /** - * Returns the expiration time. - * - * @return \DateTime|null - */ - public function getExpires() - { - return $this->expires; - } - - /** - * Checks if there is an expiration time. - * - * @return bool - */ - public function hasExpires() - { - return isset($this->expires); - } - - /** - * Sets the expires. - * - * @return Cookie - */ - public function withExpires(\DateTime $expires = null) - { - $new = clone $this; - $new->expires = $expires; - - return $new; - } - - /** - * Checks if the cookie is expired. - * - * @return bool - */ - public function isExpired() - { - return isset($this->expires) and $this->expires < new \DateTime(); - } - - /** - * Returns the domain. - * - * @return string|null - */ - public function getDomain() - { - return $this->domain; - } - - /** - * Checks if there is a domain. - * - * @return bool - */ - public function hasDomain() - { - return isset($this->domain); - } - - /** - * Sets the domain. - * - * @param string|null $domain - * - * @return Cookie - */ - public function withDomain($domain) - { - $new = clone $this; - $new->domain = $this->normalizeDomain($domain); - - return $new; - } - - /** - * Checks whether this cookie is meant for this domain. - * - * @see http://tools.ietf.org/html/rfc6265#section-5.1.3 - * - * @param string $domain - * - * @return bool - */ - public function matchDomain($domain) - { - // Domain is not set or exact match - if (!$this->hasDomain() || 0 === strcasecmp($domain, $this->domain)) { - return true; - } - - // Domain is not an IP address - if (filter_var($domain, FILTER_VALIDATE_IP)) { - return false; - } - - return (bool) preg_match(sprintf('/\b%s$/i', preg_quote($this->domain)), $domain); - } - - /** - * Returns the path. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Sets the path. - * - * @param string|null $path - * - * @return Cookie - */ - public function withPath($path) - { - $new = clone $this; - $new->path = $this->normalizePath($path); - - return $new; - } - - /** - * Checks whether this cookie is meant for this path. - * - * @see http://tools.ietf.org/html/rfc6265#section-5.1.4 - * - * @param string $path - * - * @return bool - */ - public function matchPath($path) - { - return $this->path === $path || (0 === strpos($path, rtrim($this->path, '/').'/')); - } - - /** - * Checks whether this cookie may only be sent over HTTPS. - * - * @return bool - */ - public function isSecure() - { - return $this->secure; - } - - /** - * Sets whether this cookie should only be sent over HTTPS. - * - * @param bool $secure - * - * @return Cookie - */ - public function withSecure($secure) - { - $new = clone $this; - $new->secure = (bool) $secure; - - return $new; - } - - /** - * Check whether this cookie may not be accessed through Javascript. - * - * @return bool - */ - public function isHttpOnly() - { - return $this->httpOnly; - } - - /** - * Sets whether this cookie may not be accessed through Javascript. - * - * @param bool $httpOnly - * - * @return Cookie - */ - public function withHttpOnly($httpOnly) - { - $new = clone $this; - $new->httpOnly = (bool) $httpOnly; - - return $new; - } - - /** - * Checks if this cookie represents the same cookie as $cookie. - * - * This does not compare the values, only name, domain and path. - * - * @param Cookie $cookie - * - * @return bool - */ - public function match(self $cookie) - { - return $this->name === $cookie->name && $this->domain === $cookie->domain and $this->path === $cookie->path; - } - - /** - * Validates cookie attributes. - * - * @return bool - */ - public function isValid() - { - try { - $this->validateName($this->name); - $this->validateValue($this->value); - $this->validateMaxAge($this->maxAge); - } catch (\InvalidArgumentException $e) { - return false; - } - - return true; - } - - /** - * Validates the name attribute. - * - * @see http://tools.ietf.org/search/rfc2616#section-2.2 - * - * @param string $name - * - * @throws \InvalidArgumentException if the name is empty or contains invalid characters - */ - private function validateName($name) - { - if (strlen($name) < 1) { - throw new \InvalidArgumentException('The name cannot be empty'); - } - - // Name attribute is a token as per spec in RFC 2616 - if (preg_match('/[\x00-\x20\x22\x28-\x29\x2C\x2F\x3A-\x40\x5B-\x5D\x7B\x7D\x7F]/', $name)) { - throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name)); - } - } - - /** - * Validates a value. - * - * @see http://tools.ietf.org/html/rfc6265#section-4.1.1 - * - * @param string|null $value - * - * @throws \InvalidArgumentException if the value contains invalid characters - */ - private function validateValue($value) - { - if (isset($value)) { - if (preg_match('/[^\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/', $value)) { - throw new \InvalidArgumentException(sprintf('The cookie value "%s" contains invalid characters.', $value)); - } - } - } - - /** - * Validates a Max-Age attribute. - * - * @param int|null $maxAge - * - * @throws \InvalidArgumentException if the Max-Age is not an empty or integer value - */ - private function validateMaxAge($maxAge) - { - if (isset($maxAge)) { - if (!is_int($maxAge)) { - throw new \InvalidArgumentException('Max-Age must be integer'); - } - } - } - - /** - * Remove the leading '.' and lowercase the domain as per spec in RFC 6265. - * - * @see http://tools.ietf.org/html/rfc6265#section-4.1.2.3 - * @see http://tools.ietf.org/html/rfc6265#section-5.1.3 - * @see http://tools.ietf.org/html/rfc6265#section-5.2.3 - * - * @param string|null $domain - * - * @return string - */ - private function normalizeDomain($domain) - { - if (isset($domain)) { - $domain = ltrim(strtolower($domain), '.'); - } - - return $domain; - } - - /** - * Processes path as per spec in RFC 6265. - * - * @see http://tools.ietf.org/html/rfc6265#section-5.1.4 - * @see http://tools.ietf.org/html/rfc6265#section-5.2.4 - * - * @param string|null $path - * - * @return string - */ - private function normalizePath($path) - { - $path = rtrim($path, '/'); - - if (empty($path) or '/' !== substr($path, 0, 1)) { - $path = '/'; - } - - return $path; - } -} diff --git a/vendor/php-http/message/src/CookieJar.php b/vendor/php-http/message/src/CookieJar.php deleted file mode 100644 index 914ad979..00000000 --- a/vendor/php-http/message/src/CookieJar.php +++ /dev/null @@ -1,212 +0,0 @@ - - */ -final class CookieJar implements \Countable, \IteratorAggregate -{ - /** - * @var \SplObjectStorage - */ - private $cookies; - - public function __construct() - { - $this->cookies = new \SplObjectStorage(); - } - - /** - * Checks if there is a cookie. - * - * @return bool - */ - public function hasCookie(Cookie $cookie) - { - return $this->cookies->contains($cookie); - } - - /** - * Adds a cookie. - */ - public function addCookie(Cookie $cookie) - { - if (!$this->hasCookie($cookie)) { - $cookies = $this->getMatchingCookies($cookie); - - foreach ($cookies as $matchingCookie) { - if ($cookie->getValue() !== $matchingCookie->getValue() || $cookie->getMaxAge() > $matchingCookie->getMaxAge()) { - $this->removeCookie($matchingCookie); - - continue; - } - } - - if ($cookie->hasValue()) { - $this->cookies->attach($cookie); - } - } - } - - /** - * Removes a cookie. - */ - public function removeCookie(Cookie $cookie) - { - $this->cookies->detach($cookie); - } - - /** - * Returns the cookies. - * - * @return Cookie[] - */ - public function getCookies() - { - $match = function ($matchCookie) { - return true; - }; - - return $this->findMatchingCookies($match); - } - - /** - * Returns all matching cookies. - * - * @return Cookie[] - */ - public function getMatchingCookies(Cookie $cookie) - { - $match = function ($matchCookie) use ($cookie) { - return $matchCookie->match($cookie); - }; - - return $this->findMatchingCookies($match); - } - - /** - * Finds matching cookies based on a callable. - * - * @return Cookie[] - */ - private function findMatchingCookies(callable $match) - { - $cookies = []; - - foreach ($this->cookies as $cookie) { - if ($match($cookie)) { - $cookies[] = $cookie; - } - } - - return $cookies; - } - - /** - * Checks if there are cookies. - * - * @return bool - */ - public function hasCookies() - { - return $this->cookies->count() > 0; - } - - /** - * Sets the cookies and removes any previous one. - * - * @param Cookie[] $cookies - */ - public function setCookies(array $cookies) - { - $this->clear(); - $this->addCookies($cookies); - } - - /** - * Adds some cookies. - * - * @param Cookie[] $cookies - */ - public function addCookies(array $cookies) - { - foreach ($cookies as $cookie) { - $this->addCookie($cookie); - } - } - - /** - * Removes some cookies. - * - * @param Cookie[] $cookies - */ - public function removeCookies(array $cookies) - { - foreach ($cookies as $cookie) { - $this->removeCookie($cookie); - } - } - - /** - * Removes cookies which match the given parameters. - * - * Null means that parameter should not be matched - * - * @param string|null $name - * @param string|null $domain - * @param string|null $path - */ - public function removeMatchingCookies($name = null, $domain = null, $path = null) - { - $match = function ($cookie) use ($name, $domain, $path) { - $match = true; - - if (isset($name)) { - $match = $match && ($cookie->getName() === $name); - } - - if (isset($domain)) { - $match = $match && $cookie->matchDomain($domain); - } - - if (isset($path)) { - $match = $match && $cookie->matchPath($path); - } - - return $match; - }; - - $cookies = $this->findMatchingCookies($match); - - $this->removeCookies($cookies); - } - - /** - * Removes all cookies. - */ - public function clear() - { - $this->cookies = new \SplObjectStorage(); - } - - /** - * {@inheritdoc} - */ - #[\ReturnTypeWillChange] - public function count() - { - return $this->cookies->count(); - } - - /** - * {@inheritdoc} - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return clone $this->cookies; - } -} diff --git a/vendor/php-http/message/src/CookieUtil.php b/vendor/php-http/message/src/CookieUtil.php deleted file mode 100644 index 44c53145..00000000 --- a/vendor/php-http/message/src/CookieUtil.php +++ /dev/null @@ -1,53 +0,0 @@ - - */ -trait MessageDecorator -{ - /** - * @var MessageInterface - */ - private $message; - - /** - * Returns the decorated message. - * - * Since the underlying Message is immutable as well - * exposing it is not an issue, because it's state cannot be altered - * - * @return MessageInterface - */ - public function getMessage() - { - return $this->message; - } - - /** - * {@inheritdoc} - */ - public function getProtocolVersion() - { - return $this->message->getProtocolVersion(); - } - - /** - * {@inheritdoc} - */ - public function withProtocolVersion($version) - { - $new = clone $this; - $new->message = $this->message->withProtocolVersion($version); - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getHeaders() - { - return $this->message->getHeaders(); - } - - /** - * {@inheritdoc} - */ - public function hasHeader($header) - { - return $this->message->hasHeader($header); - } - - /** - * {@inheritdoc} - */ - public function getHeader($header) - { - return $this->message->getHeader($header); - } - - /** - * {@inheritdoc} - */ - public function getHeaderLine($header) - { - return $this->message->getHeaderLine($header); - } - - /** - * {@inheritdoc} - */ - public function withHeader($header, $value) - { - $new = clone $this; - $new->message = $this->message->withHeader($header, $value); - - return $new; - } - - /** - * {@inheritdoc} - */ - public function withAddedHeader($header, $value) - { - $new = clone $this; - $new->message = $this->message->withAddedHeader($header, $value); - - return $new; - } - - /** - * {@inheritdoc} - */ - public function withoutHeader($header) - { - $new = clone $this; - $new->message = $this->message->withoutHeader($header); - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getBody() - { - return $this->message->getBody(); - } - - /** - * {@inheritdoc} - */ - public function withBody(StreamInterface $body) - { - $new = clone $this; - $new->message = $this->message->withBody($body); - - return $new; - } -} diff --git a/vendor/php-http/message/src/Decorator/RequestDecorator.php b/vendor/php-http/message/src/Decorator/RequestDecorator.php deleted file mode 100644 index bd254a8f..00000000 --- a/vendor/php-http/message/src/Decorator/RequestDecorator.php +++ /dev/null @@ -1,86 +0,0 @@ - - */ -trait RequestDecorator -{ - use MessageDecorator { - getMessage as getRequest; - } - - /** - * Exchanges the underlying request with another. - * - * @return self - */ - public function withRequest(RequestInterface $request) - { - $new = clone $this; - $new->message = $request; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getRequestTarget() - { - return $this->message->getRequestTarget(); - } - - /** - * {@inheritdoc} - */ - public function withRequestTarget($requestTarget) - { - $new = clone $this; - $new->message = $this->message->withRequestTarget($requestTarget); - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getMethod() - { - return $this->message->getMethod(); - } - - /** - * {@inheritdoc} - */ - public function withMethod($method) - { - $new = clone $this; - $new->message = $this->message->withMethod($method); - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getUri() - { - return $this->message->getUri(); - } - - /** - * {@inheritdoc} - */ - public function withUri(UriInterface $uri, $preserveHost = false) - { - $new = clone $this; - $new->message = $this->message->withUri($uri, $preserveHost); - - return $new; - } -} diff --git a/vendor/php-http/message/src/Decorator/ResponseDecorator.php b/vendor/php-http/message/src/Decorator/ResponseDecorator.php deleted file mode 100644 index 20319ed3..00000000 --- a/vendor/php-http/message/src/Decorator/ResponseDecorator.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -trait ResponseDecorator -{ - use MessageDecorator { - getMessage as getResponse; - } - - /** - * Exchanges the underlying response with another. - * - * @return self - */ - public function withResponse(ResponseInterface $response) - { - $new = clone $this; - $new->message = $response; - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getStatusCode() - { - return $this->message->getStatusCode(); - } - - /** - * {@inheritdoc} - */ - public function withStatus($code, $reasonPhrase = '') - { - $new = clone $this; - $new->message = $this->message->withStatus($code, $reasonPhrase); - - return $new; - } - - /** - * {@inheritdoc} - */ - public function getReasonPhrase() - { - return $this->message->getReasonPhrase(); - } -} diff --git a/vendor/php-http/message/src/Decorator/StreamDecorator.php b/vendor/php-http/message/src/Decorator/StreamDecorator.php deleted file mode 100644 index f405c7af..00000000 --- a/vendor/php-http/message/src/Decorator/StreamDecorator.php +++ /dev/null @@ -1,138 +0,0 @@ - - */ -trait StreamDecorator -{ - /** - * @var StreamInterface - */ - protected $stream; - - /** - * {@inheritdoc} - */ - public function __toString() - { - return $this->stream->__toString(); - } - - /** - * {@inheritdoc} - */ - public function close() - { - $this->stream->close(); - } - - /** - * {@inheritdoc} - */ - public function detach() - { - return $this->stream->detach(); - } - - /** - * {@inheritdoc} - */ - public function getSize() - { - return $this->stream->getSize(); - } - - /** - * {@inheritdoc} - */ - public function tell() - { - return $this->stream->tell(); - } - - /** - * {@inheritdoc} - */ - public function eof() - { - return $this->stream->eof(); - } - - /** - * {@inheritdoc} - */ - public function isSeekable() - { - return $this->stream->isSeekable(); - } - - /** - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - $this->stream->seek($offset, $whence); - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - $this->stream->rewind(); - } - - /** - * {@inheritdoc} - */ - public function isWritable() - { - return $this->stream->isWritable(); - } - - /** - * {@inheritdoc} - */ - public function write($string) - { - return $this->stream->write($string); - } - - /** - * {@inheritdoc} - */ - public function isReadable() - { - return $this->stream->isReadable(); - } - - /** - * {@inheritdoc} - */ - public function read($length) - { - return $this->stream->read($length); - } - - /** - * {@inheritdoc} - */ - public function getContents() - { - return $this->stream->getContents(); - } - - /** - * {@inheritdoc} - */ - public function getMetadata($key = null) - { - return $this->stream->getMetadata($key); - } -} diff --git a/vendor/php-http/message/src/Encoding/ChunkStream.php b/vendor/php-http/message/src/Encoding/ChunkStream.php deleted file mode 100644 index 74c2fbd0..00000000 --- a/vendor/php-http/message/src/Encoding/ChunkStream.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -class ChunkStream extends FilteredStream -{ - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'chunk'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'dechunk'; - } - - /** - * {@inheritdoc} - */ - protected function fill() - { - parent::fill(); - - if ($this->stream->eof()) { - $this->buffer .= "0\r\n\r\n"; - } - } -} diff --git a/vendor/php-http/message/src/Encoding/CompressStream.php b/vendor/php-http/message/src/Encoding/CompressStream.php deleted file mode 100644 index bdb740a9..00000000 --- a/vendor/php-http/message/src/Encoding/CompressStream.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class CompressStream extends FilteredStream -{ - /** - * @param int $level - */ - public function __construct(StreamInterface $stream, $level = -1) - { - if (!extension_loaded('zlib')) { - throw new \RuntimeException('The zlib extension must be enabled to use this stream'); - } - - parent::__construct($stream, ['window' => 15, 'level' => $level]); - - // @deprecated will be removed in 2.0 - $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15]); - } - - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'zlib.deflate'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'zlib.inflate'; - } -} diff --git a/vendor/php-http/message/src/Encoding/DechunkStream.php b/vendor/php-http/message/src/Encoding/DechunkStream.php deleted file mode 100644 index 4cade835..00000000 --- a/vendor/php-http/message/src/Encoding/DechunkStream.php +++ /dev/null @@ -1,29 +0,0 @@ - - */ -class DechunkStream extends FilteredStream -{ - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'dechunk'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'chunk'; - } -} diff --git a/vendor/php-http/message/src/Encoding/DecompressStream.php b/vendor/php-http/message/src/Encoding/DecompressStream.php deleted file mode 100644 index ab3a3454..00000000 --- a/vendor/php-http/message/src/Encoding/DecompressStream.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class DecompressStream extends FilteredStream -{ - /** - * @param int $level - */ - public function __construct(StreamInterface $stream, $level = -1) - { - if (!extension_loaded('zlib')) { - throw new \RuntimeException('The zlib extension must be enabled to use this stream'); - } - - parent::__construct($stream, ['window' => 15]); - - // @deprecated will be removed in 2.0 - $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15, 'level' => $level]); - } - - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'zlib.inflate'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'zlib.deflate'; - } -} diff --git a/vendor/php-http/message/src/Encoding/DeflateStream.php b/vendor/php-http/message/src/Encoding/DeflateStream.php deleted file mode 100644 index 2ab3e003..00000000 --- a/vendor/php-http/message/src/Encoding/DeflateStream.php +++ /dev/null @@ -1,41 +0,0 @@ - - */ -class DeflateStream extends FilteredStream -{ - /** - * @param int $level - */ - public function __construct(StreamInterface $stream, $level = -1) - { - parent::__construct($stream, ['window' => -15, 'level' => $level]); - - // @deprecated will be removed in 2.0 - $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15]); - } - - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'zlib.deflate'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'zlib.inflate'; - } -} diff --git a/vendor/php-http/message/src/Encoding/Filter/Chunk.php b/vendor/php-http/message/src/Encoding/Filter/Chunk.php deleted file mode 100644 index 538e2700..00000000 --- a/vendor/php-http/message/src/Encoding/Filter/Chunk.php +++ /dev/null @@ -1,31 +0,0 @@ - - */ -class Chunk extends \php_user_filter -{ - /** - * {@inheritdoc} - */ - #[\ReturnTypeWillChange] - public function filter($in, $out, &$consumed, $closing) - { - while ($bucket = stream_bucket_make_writeable($in)) { - $lenbucket = stream_bucket_new($this->stream, dechex($bucket->datalen)."\r\n"); - stream_bucket_append($out, $lenbucket); - - $consumed += $bucket->datalen; - stream_bucket_append($out, $bucket); - - $lenbucket = stream_bucket_new($this->stream, "\r\n"); - stream_bucket_append($out, $lenbucket); - } - - return PSFS_PASS_ON; - } -} diff --git a/vendor/php-http/message/src/Encoding/FilteredStream.php b/vendor/php-http/message/src/Encoding/FilteredStream.php deleted file mode 100644 index a937c82f..00000000 --- a/vendor/php-http/message/src/Encoding/FilteredStream.php +++ /dev/null @@ -1,234 +0,0 @@ - - */ -abstract class FilteredStream implements StreamInterface -{ - use StreamDecorator { - rewind as private doRewind; - seek as private doSeek; - } - const BUFFER_SIZE = 8192; - - /** - * @var callable - */ - protected $readFilterCallback; - - /** - * @var resource - * - * @deprecated since version 1.5, will be removed in 2.0 - */ - protected $readFilter; - - /** - * @var callable - * - * @deprecated since version 1.5, will be removed in 2.0 - */ - protected $writeFilterCallback; - - /** - * @var resource - * - * @deprecated since version 1.5, will be removed in 2.0 - */ - protected $writeFilter; - - /** - * Internal buffer. - * - * @var string - */ - protected $buffer = ''; - - /** - * @param mixed|null $readFilterOptions - * @param mixed|null $writeFilterOptions deprecated since 1.5, will be removed in 2.0 - */ - public function __construct(StreamInterface $stream, $readFilterOptions = null, $writeFilterOptions = null) - { - if (null !== $readFilterOptions) { - $this->readFilterCallback = Filter\fun($this->readFilter(), $readFilterOptions); - } else { - $this->readFilterCallback = Filter\fun($this->readFilter()); - } - - if (null !== $writeFilterOptions) { - $this->writeFilterCallback = Filter\fun($this->writeFilter(), $writeFilterOptions); - - @trigger_error('The $writeFilterOptions argument is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); - } else { - $this->writeFilterCallback = Filter\fun($this->writeFilter()); - } - - $this->stream = $stream; - } - - /** - * {@inheritdoc} - */ - public function read($length) - { - if (strlen($this->buffer) >= $length) { - $read = substr($this->buffer, 0, $length); - $this->buffer = substr($this->buffer, $length); - - return $read; - } - - if ($this->stream->eof()) { - $buffer = $this->buffer; - $this->buffer = ''; - - return $buffer; - } - - $read = $this->buffer; - $this->buffer = ''; - $this->fill(); - - return $read.$this->read($length - strlen($read)); - } - - /** - * {@inheritdoc} - */ - public function eof() - { - return $this->stream->eof() && '' === $this->buffer; - } - - /** - * Buffer is filled by reading underlying stream. - * - * Callback is reading once more even if the stream is ended. - * This allow to get last data in the PHP buffer otherwise this - * bug is present : https://bugs.php.net/bug.php?id=48725 - */ - protected function fill() - { - $readFilterCallback = $this->readFilterCallback; - $this->buffer .= $readFilterCallback($this->stream->read(self::BUFFER_SIZE)); - - if ($this->stream->eof()) { - $this->buffer .= $readFilterCallback(); - } - } - - /** - * {@inheritdoc} - */ - public function getContents() - { - $buffer = ''; - - while (!$this->eof()) { - $buf = $this->read(self::BUFFER_SIZE); - // Using a loose equality here to match on '' and false. - if (null == $buf) { - break; - } - - $buffer .= $buf; - } - - return $buffer; - } - - /** - * Always returns null because we can't tell the size of a stream when we filter. - */ - public function getSize() - { - return null; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return $this->getContents(); - } - - /** - * Filtered streams are not seekable. - * - * We would need to buffer and process everything to allow seeking. - */ - public function isSeekable() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED); - $this->doRewind(); - } - - /** - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED); - $this->doSeek($offset, $whence); - } - - /** - * Returns the read filter name. - * - * @return string - * - * @deprecated since version 1.5, will be removed in 2.0 - */ - public function getReadFilter() - { - @trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); - - return $this->readFilter(); - } - - /** - * Returns the write filter name. - * - * @return string - */ - abstract protected function readFilter(); - - /** - * Returns the write filter name. - * - * @return string - * - * @deprecated since version 1.5, will be removed in 2.0 - */ - public function getWriteFilter() - { - @trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); - - return $this->writeFilter(); - } - - /** - * Returns the write filter name. - * - * @return string - */ - abstract protected function writeFilter(); -} diff --git a/vendor/php-http/message/src/Encoding/GzipDecodeStream.php b/vendor/php-http/message/src/Encoding/GzipDecodeStream.php deleted file mode 100644 index 92b5dad5..00000000 --- a/vendor/php-http/message/src/Encoding/GzipDecodeStream.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class GzipDecodeStream extends FilteredStream -{ - /** - * @param int $level - */ - public function __construct(StreamInterface $stream, $level = -1) - { - if (!extension_loaded('zlib')) { - throw new \RuntimeException('The zlib extension must be enabled to use this stream'); - } - - parent::__construct($stream, ['window' => 31]); - - // @deprecated will be removed in 2.0 - $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31, 'level' => $level]); - } - - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'zlib.inflate'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'zlib.deflate'; - } -} diff --git a/vendor/php-http/message/src/Encoding/GzipEncodeStream.php b/vendor/php-http/message/src/Encoding/GzipEncodeStream.php deleted file mode 100644 index 13f097a8..00000000 --- a/vendor/php-http/message/src/Encoding/GzipEncodeStream.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class GzipEncodeStream extends FilteredStream -{ - /** - * @param int $level - */ - public function __construct(StreamInterface $stream, $level = -1) - { - if (!extension_loaded('zlib')) { - throw new \RuntimeException('The zlib extension must be enabled to use this stream'); - } - - parent::__construct($stream, ['window' => 31, 'level' => $level]); - - // @deprecated will be removed in 2.0 - $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31]); - } - - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'zlib.deflate'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'zlib.inflate'; - } -} diff --git a/vendor/php-http/message/src/Encoding/InflateStream.php b/vendor/php-http/message/src/Encoding/InflateStream.php deleted file mode 100644 index 06c51875..00000000 --- a/vendor/php-http/message/src/Encoding/InflateStream.php +++ /dev/null @@ -1,45 +0,0 @@ - - */ -class InflateStream extends FilteredStream -{ - /** - * @param int $level - */ - public function __construct(StreamInterface $stream, $level = -1) - { - if (!extension_loaded('zlib')) { - throw new \RuntimeException('The zlib extension must be enabled to use this stream'); - } - - parent::__construct($stream, ['window' => -15]); - - // @deprecated will be removed in 2.0 - $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15, 'level' => $level]); - } - - /** - * {@inheritdoc} - */ - protected function readFilter() - { - return 'zlib.inflate'; - } - - /** - * {@inheritdoc} - */ - protected function writeFilter() - { - return 'zlib.deflate'; - } -} diff --git a/vendor/php-http/message/src/Exception.php b/vendor/php-http/message/src/Exception.php deleted file mode 100644 index 80d4cd9d..00000000 --- a/vendor/php-http/message/src/Exception.php +++ /dev/null @@ -1,10 +0,0 @@ - - * - * The formatResponseForRequest method will be added to this interface in the next major version, replacing the formatRequest method. - * Meanwhile, callers SHOULD check the formatter for the existence of formatResponseForRequest and call that if available. - * - * @method string formatResponseForRequest(ResponseInterface $response, RequestInterface $request) Formats a response in context of its request. - */ -interface Formatter -{ - /** - * Formats a request. - * - * @return string - */ - public function formatRequest(RequestInterface $request); - - /** - * @deprecated since 1.13, use formatResponseForRequest() instead - * - * Formats a response. - * - * @return string - */ - public function formatResponse(ResponseInterface $response); -} diff --git a/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php b/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php deleted file mode 100644 index 80d2971c..00000000 --- a/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php +++ /dev/null @@ -1,103 +0,0 @@ - - */ -class CurlCommandFormatter implements Formatter -{ - /** - * {@inheritdoc} - */ - public function formatRequest(RequestInterface $request) - { - $command = sprintf('curl %s', escapeshellarg((string) $request->getUri()->withFragment(''))); - if ('1.0' === $request->getProtocolVersion()) { - $command .= ' --http1.0'; - } elseif ('2.0' === $request->getProtocolVersion()) { - $command .= ' --http2'; - } - - $method = strtoupper($request->getMethod()); - if ('HEAD' === $method) { - $command .= ' --head'; - } elseif ('GET' !== $method) { - $command .= ' --request '.$method; - } - - $command .= $this->getHeadersAsCommandOptions($request); - - $body = $request->getBody(); - if ($body->getSize() > 0) { - // escapeshellarg argument max length on Windows, but longer body in curl command would be impractical anyways - if ($body->getSize() > 8192) { - $data = '[too long stream omitted]'; - } elseif ($body->isSeekable()) { - $data = $body->__toString(); - $body->rewind(); - // all non-printable ASCII characters and except for \t, \r, \n - if (preg_match('/([\x00-\x09\x0C\x0E-\x1F\x7F])/', $data)) { - $data = '[binary stream omitted]'; - } - } else { - $data = '[non-seekable stream omitted]'; - } - $escapedData = @escapeshellarg($data); - if (empty($escapedData)) { - $escapedData = 'We couldn\'t not escape the data properly'; - } - - $command .= sprintf(' --data %s', $escapedData); - } - - return $command; - } - - /** - * {@inheritdoc} - */ - public function formatResponse(ResponseInterface $response) - { - return ''; - } - - /** - * Formats a response in context of its request. - * - * @return string - */ - public function formatResponseForRequest(ResponseInterface $response, RequestInterface $request) - { - return $this->formatResponse($response); - } - - /** - * @return string - */ - private function getHeadersAsCommandOptions(RequestInterface $request) - { - $command = ''; - foreach ($request->getHeaders() as $name => $values) { - if ('host' === strtolower($name) && $values[0] === $request->getUri()->getHost()) { - continue; - } - - if ('user-agent' === strtolower($name)) { - $command .= sprintf(' -A %s', escapeshellarg($values[0])); - - continue; - } - - $command .= sprintf(' -H %s', escapeshellarg($name.': '.$request->getHeaderLine($name))); - } - - return $command; - } -} diff --git a/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php b/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php deleted file mode 100644 index 8b9b1264..00000000 --- a/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php +++ /dev/null @@ -1,116 +0,0 @@ - - */ -class FullHttpMessageFormatter implements Formatter -{ - /** - * The maximum length of the body. - * - * @var int|null - */ - private $maxBodyLength; - - /** - * @var string - */ - private $binaryDetectionRegex; - - /** - * @param int|null $maxBodyLength - * @param string $binaryDetectionRegex By default, this is all non-printable ASCII characters and except for \t, \r, \n - */ - public function __construct($maxBodyLength = 1000, string $binaryDetectionRegex = '/([\x00-\x09\x0C\x0E-\x1F\x7F])/') - { - $this->maxBodyLength = $maxBodyLength; - $this->binaryDetectionRegex = $binaryDetectionRegex; - } - - /** - * {@inheritdoc} - */ - public function formatRequest(RequestInterface $request) - { - $message = sprintf( - "%s %s HTTP/%s\n", - $request->getMethod(), - $request->getRequestTarget(), - $request->getProtocolVersion() - ); - - foreach ($request->getHeaders() as $name => $values) { - $message .= $name.': '.implode(', ', $values)."\n"; - } - - return $this->addBody($request, $message); - } - - /** - * {@inheritdoc} - */ - public function formatResponse(ResponseInterface $response) - { - $message = sprintf( - "HTTP/%s %s %s\n", - $response->getProtocolVersion(), - $response->getStatusCode(), - $response->getReasonPhrase() - ); - - foreach ($response->getHeaders() as $name => $values) { - $message .= $name.': '.implode(', ', $values)."\n"; - } - - return $this->addBody($response, $message); - } - - /** - * Formats a response in context of its request. - * - * @return string - */ - public function formatResponseForRequest(ResponseInterface $response, RequestInterface $request) - { - return $this->formatResponse($response); - } - - /** - * Add the message body if the stream is seekable. - * - * @param string $message - * - * @return string - */ - private function addBody(MessageInterface $request, $message) - { - $message .= "\n"; - $stream = $request->getBody(); - if (!$stream->isSeekable() || 0 === $this->maxBodyLength) { - // Do not read the stream - return $message; - } - - $data = $stream->__toString(); - $stream->rewind(); - - if (preg_match($this->binaryDetectionRegex, $data)) { - return $message.'[binary stream omitted]'; - } - - if (null === $this->maxBodyLength) { - return $message.$data; - } - - return $message.mb_substr($data, 0, $this->maxBodyLength); - } -} diff --git a/vendor/php-http/message/src/Formatter/SimpleFormatter.php b/vendor/php-http/message/src/Formatter/SimpleFormatter.php deleted file mode 100644 index ee99ae3f..00000000 --- a/vendor/php-http/message/src/Formatter/SimpleFormatter.php +++ /dev/null @@ -1,52 +0,0 @@ - - * @author Márk Sági-Kazár - */ -class SimpleFormatter implements Formatter -{ - /** - * {@inheritdoc} - */ - public function formatRequest(RequestInterface $request) - { - return sprintf( - '%s %s %s', - $request->getMethod(), - $request->getUri()->__toString(), - $request->getProtocolVersion() - ); - } - - /** - * {@inheritdoc} - */ - public function formatResponse(ResponseInterface $response) - { - return sprintf( - '%s %s %s', - $response->getStatusCode(), - $response->getReasonPhrase(), - $response->getProtocolVersion() - ); - } - - /** - * Formats a response in context of its request. - * - * @return string - */ - public function formatResponseForRequest(ResponseInterface $response, RequestInterface $request) - { - return $this->formatResponse($response); - } -} diff --git a/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php b/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php deleted file mode 100644 index 6d54d351..00000000 --- a/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Diactoros PSR-17 factory - */ -final class DiactorosMessageFactory implements MessageFactory -{ - /** - * @var DiactorosStreamFactory - */ - private $streamFactory; - - public function __construct() - { - $this->streamFactory = new DiactorosStreamFactory(); - } - - /** - * {@inheritdoc} - */ - public function createRequest( - $method, - $uri, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ) { - if (class_exists(LaminasRequest::class)) { - return (new LaminasRequest( - $uri, - $method, - $this->streamFactory->createStream($body), - $headers - ))->withProtocolVersion($protocolVersion); - } - - return (new ZendRequest( - $uri, - $method, - $this->streamFactory->createStream($body), - $headers - ))->withProtocolVersion($protocolVersion); - } - - /** - * {@inheritdoc} - */ - public function createResponse( - $statusCode = 200, - $reasonPhrase = null, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ) { - if (class_exists(LaminasResponse::class)) { - return (new LaminasResponse( - $this->streamFactory->createStream($body), - $statusCode, - $headers - ))->withProtocolVersion($protocolVersion); - } - - return (new ZendResponse( - $this->streamFactory->createStream($body), - $statusCode, - $headers - ))->withProtocolVersion($protocolVersion); - } -} diff --git a/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php b/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php deleted file mode 100644 index 02989d9f..00000000 --- a/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Guzzle PSR-17 factory - */ -final class GuzzleMessageFactory implements MessageFactory -{ - /** - * {@inheritdoc} - */ - public function createRequest( - $method, - $uri, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ) { - return new Request( - $method, - $uri, - $headers, - $body, - $protocolVersion - ); - } - - /** - * {@inheritdoc} - */ - public function createResponse( - $statusCode = 200, - $reasonPhrase = null, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ) { - return new Response( - $statusCode, - $headers, - $body, - $protocolVersion, - $reasonPhrase - ); - } -} diff --git a/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php b/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php deleted file mode 100644 index bee93228..00000000 --- a/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Slim PSR-17 factory - */ -final class SlimMessageFactory implements MessageFactory -{ - /** - * @var SlimStreamFactory - */ - private $streamFactory; - - /** - * @var SlimUriFactory - */ - private $uriFactory; - - public function __construct() - { - $this->streamFactory = new SlimStreamFactory(); - $this->uriFactory = new SlimUriFactory(); - } - - /** - * {@inheritdoc} - */ - public function createRequest( - $method, - $uri, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ) { - return (new Request( - $method, - $this->uriFactory->createUri($uri), - new Headers($headers), - [], - [], - $this->streamFactory->createStream($body), - [] - ))->withProtocolVersion($protocolVersion); - } - - /** - * {@inheritdoc} - */ - public function createResponse( - $statusCode = 200, - $reasonPhrase = null, - array $headers = [], - $body = null, - $protocolVersion = '1.1' - ) { - return (new Response( - $statusCode, - new Headers($headers), - $this->streamFactory->createStream($body) - ))->withProtocolVersion($protocolVersion); - } -} diff --git a/vendor/php-http/message/src/RequestMatcher.php b/vendor/php-http/message/src/RequestMatcher.php deleted file mode 100644 index 94fe5324..00000000 --- a/vendor/php-http/message/src/RequestMatcher.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ -interface RequestMatcher -{ - /** - * Decides whether the rule(s) implemented by the strategy matches the supplied request. - * - * @param RequestInterface $request The PSR7 request to check for a match - * - * @return bool true if the request matches, false otherwise - */ - public function matches(RequestInterface $request); -} diff --git a/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php b/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php deleted file mode 100644 index 1197dd95..00000000 --- a/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ -final class CallbackRequestMatcher implements RequestMatcher -{ - /** - * @var callable - */ - private $callback; - - public function __construct(callable $callback) - { - $this->callback = $callback; - } - - /** - * {@inheritdoc} - */ - public function matches(RequestInterface $request) - { - return (bool) call_user_func($this->callback, $request); - } -} diff --git a/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php b/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php deleted file mode 100644 index 91f3729e..00000000 --- a/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * @deprecated since version 1.2 and will be removed in 2.0. Use {@link RequestMatcher} instead. - */ -final class RegexRequestMatcher implements RequestMatcher -{ - /** - * Matching regex. - * - * @var string - */ - private $regex; - - /** - * @param string $regex - */ - public function __construct($regex) - { - $this->regex = $regex; - } - - /** - * {@inheritdoc} - */ - public function matches(RequestInterface $request) - { - return (bool) preg_match($this->regex, (string) $request->getUri()); - } -} diff --git a/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php b/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php deleted file mode 100644 index e2aa0212..00000000 --- a/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php +++ /dev/null @@ -1,78 +0,0 @@ - - * @author Joel Wurtz - */ -final class RequestMatcher implements RequestMatcherInterface -{ - /** - * @var string - */ - private $path; - - /** - * @var string - */ - private $host; - - /** - * @var array - */ - private $methods = []; - - /** - * @var string[] - */ - private $schemes = []; - - /** - * The regular expressions used for path or host must be specified without delimiter. - * You do not need to escape the forward slash / to match it. - * - * @param string|null $path Regular expression for the path - * @param string|null $host Regular expression for the hostname - * @param string|string[]|null $methods Method or list of methods to match - * @param string|string[]|null $schemes Scheme or list of schemes to match (e.g. http or https) - */ - public function __construct($path = null, $host = null, $methods = [], $schemes = []) - { - $this->path = $path; - $this->host = $host; - $this->methods = array_map('strtoupper', (array) $methods); - $this->schemes = array_map('strtolower', (array) $schemes); - } - - /** - * {@inheritdoc} - * - * @api - */ - public function matches(RequestInterface $request) - { - if ($this->schemes && !in_array($request->getUri()->getScheme(), $this->schemes)) { - return false; - } - - if ($this->methods && !in_array($request->getMethod(), $this->methods)) { - return false; - } - - if (null !== $this->path && !preg_match('{'.$this->path.'}', rawurldecode($request->getUri()->getPath()))) { - return false; - } - - if (null !== $this->host && !preg_match('{'.$this->host.'}i', $request->getUri()->getHost())) { - return false; - } - - return true; - } -} diff --git a/vendor/php-http/message/src/Stream/BufferedStream.php b/vendor/php-http/message/src/Stream/BufferedStream.php deleted file mode 100644 index 3d38731d..00000000 --- a/vendor/php-http/message/src/Stream/BufferedStream.php +++ /dev/null @@ -1,273 +0,0 @@ -stream = $stream; - $this->size = $stream->getSize(); - - if ($useFileBuffer) { - $this->resource = fopen('php://temp/maxmemory:'.$memoryBuffer, 'rw+'); - } else { - $this->resource = fopen('php://memory', 'rw+'); - } - - if (false === $this->resource) { - throw new \RuntimeException('Cannot create a resource over temp or memory implementation'); - } - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - try { - $this->rewind(); - - return $this->getContents(); - } catch (\Throwable $throwable) { - return ''; - } catch (\Exception $exception) { // Layer to be BC with PHP 5, remove this when we only support PHP 7+ - return ''; - } - } - - /** - * {@inheritdoc} - */ - public function close() - { - if (null === $this->resource) { - throw new \RuntimeException('Cannot close on a detached stream'); - } - - $this->stream->close(); - fclose($this->resource); - } - - /** - * {@inheritdoc} - */ - public function detach() - { - if (null === $this->resource) { - return; - } - - // Force reading the remaining data of the stream - $this->getContents(); - - $resource = $this->resource; - $this->stream->close(); - $this->stream = null; - $this->resource = null; - - return $resource; - } - - /** - * {@inheritdoc} - */ - public function getSize() - { - if (null === $this->resource) { - return; - } - - if (null === $this->size && $this->stream->eof()) { - return $this->written; - } - - return $this->size; - } - - /** - * {@inheritdoc} - */ - public function tell() - { - if (null === $this->resource) { - throw new \RuntimeException('Cannot tell on a detached stream'); - } - - return ftell($this->resource); - } - - /** - * {@inheritdoc} - */ - public function eof() - { - if (null === $this->resource) { - throw new \RuntimeException('Cannot call eof on a detached stream'); - } - - // We are at the end only when both our resource and underlying stream are at eof - return $this->stream->eof() && (ftell($this->resource) === $this->written); - } - - /** - * {@inheritdoc} - */ - public function isSeekable() - { - return null !== $this->resource; - } - - /** - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) - { - if (null === $this->resource) { - throw new \RuntimeException('Cannot seek on a detached stream'); - } - - fseek($this->resource, $offset, $whence); - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - if (null === $this->resource) { - throw new \RuntimeException('Cannot rewind on a detached stream'); - } - - rewind($this->resource); - } - - /** - * {@inheritdoc} - */ - public function isWritable() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function write($string) - { - throw new \RuntimeException('Cannot write on this stream'); - } - - /** - * {@inheritdoc} - */ - public function isReadable() - { - return null !== $this->resource; - } - - /** - * {@inheritdoc} - */ - public function read($length) - { - if (null === $this->resource) { - throw new \RuntimeException('Cannot read on a detached stream'); - } - if ($length < 0) { - throw new \InvalidArgumentException('Can not read a negative amount of bytes'); - } - - $read = ''; - - // First read from the resource - if (ftell($this->resource) !== $this->written) { - $read = fread($this->resource, $length); - } - - $bytesRead = strlen($read); - - if ($bytesRead < $length) { - $streamRead = $this->stream->read($length - $bytesRead); - - // Write on the underlying stream what we read - $this->written += fwrite($this->resource, $streamRead); - $read .= $streamRead; - } - - return $read; - } - - /** - * {@inheritdoc} - */ - public function getContents() - { - if (null === $this->resource) { - throw new \RuntimeException('Cannot read on a detached stream'); - } - - $read = ''; - - while (!$this->eof()) { - $read .= $this->read(8192); - } - - return $read; - } - - /** - * {@inheritdoc} - */ - public function getMetadata($key = null) - { - if (null === $this->resource) { - if (null === $key) { - return []; - } - - return; - } - - $metadata = stream_get_meta_data($this->resource); - - if (null === $key) { - return $metadata; - } - - if (!array_key_exists($key, $metadata)) { - return; - } - - return $metadata[$key]; - } -} diff --git a/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php b/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php deleted file mode 100644 index 8ae2b288..00000000 --- a/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Diactoros PSR-17 factory - */ -final class DiactorosStreamFactory implements StreamFactory -{ - /** - * {@inheritdoc} - */ - public function createStream($body = null) - { - if ($body instanceof StreamInterface) { - return $body; - } - - if (is_resource($body)) { - if (class_exists(LaminasStream::class)) { - return new LaminasStream($body); - } - - return new ZendStream($body); - } - - if (class_exists(LaminasStream::class)) { - $stream = new LaminasStream('php://memory', 'rw'); - } else { - $stream = new ZendStream('php://memory', 'rw'); - } - - if (null !== $body && '' !== $body) { - $stream->write((string) $body); - } - - return $stream; - } -} diff --git a/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php b/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php deleted file mode 100644 index 14d83e94..00000000 --- a/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Guzzle PSR-17 factory - */ -final class GuzzleStreamFactory implements StreamFactory -{ - /** - * {@inheritdoc} - */ - public function createStream($body = null) - { - if (class_exists(Utils::class)) { - return Utils::streamFor($body); - } - - return \GuzzleHttp\Psr7\stream_for($body); - } -} diff --git a/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php b/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php deleted file mode 100644 index 9274aaee..00000000 --- a/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Slim PSR-17 factory - */ -final class SlimStreamFactory implements StreamFactory -{ - /** - * {@inheritdoc} - */ - public function createStream($body = null) - { - if ($body instanceof StreamInterface) { - return $body; - } - - if (is_resource($body)) { - return new Stream($body); - } - - $resource = fopen('php://memory', 'r+'); - $stream = new Stream($resource); - if (null !== $body && '' !== $body) { - $stream->write((string) $body); - } - - return $stream; - } -} diff --git a/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php b/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php deleted file mode 100644 index be883def..00000000 --- a/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Diactoros PSR-17 factory - */ -final class DiactorosUriFactory implements UriFactory -{ - /** - * {@inheritdoc} - */ - public function createUri($uri) - { - if ($uri instanceof UriInterface) { - return $uri; - } elseif (is_string($uri)) { - if (class_exists(LaminasUri::class)) { - return new LaminasUri($uri); - } - - return new ZendUri($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); - } -} diff --git a/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php b/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php deleted file mode 100644 index e09ac61e..00000000 --- a/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Guzzle PSR-17 factory - */ -final class GuzzleUriFactory implements UriFactory -{ - /** - * {@inheritdoc} - */ - public function createUri($uri) - { - if (class_exists(Utils::class)) { - return Utils::uriFor($uri); - } - - return uri_for($uri); - } -} diff --git a/vendor/php-http/message/src/UriFactory/SlimUriFactory.php b/vendor/php-http/message/src/UriFactory/SlimUriFactory.php deleted file mode 100644 index e5bef036..00000000 --- a/vendor/php-http/message/src/UriFactory/SlimUriFactory.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * @deprecated This will be removed in php-http/message2.0. Consider using the official Slim PSR-17 factory - */ -final class SlimUriFactory implements UriFactory -{ - /** - * {@inheritdoc} - */ - public function createUri($uri) - { - if ($uri instanceof UriInterface) { - return $uri; - } - - if (is_string($uri)) { - return Uri::createFromString($uri); - } - - throw new \InvalidArgumentException('URI must be a string or UriInterface'); - } -} diff --git a/vendor/php-http/message/src/filters.php b/vendor/php-http/message/src/filters.php deleted file mode 100644 index 15ed73de..00000000 --- a/vendor/php-http/message/src/filters.php +++ /dev/null @@ -1,6 +0,0 @@ - - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/multipart-stream-builder/README.md b/vendor/php-http/multipart-stream-builder/README.md deleted file mode 100644 index 764ff73c..00000000 --- a/vendor/php-http/multipart-stream-builder/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# PSR-7 Multipart Stream Builder - -[![Latest Version](https://img.shields.io/github/release/php-http/multipart-stream-builder.svg?style=flat-square)](https://github.com/php-http/multipart-stream-builder/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/php-http/multipart-stream-builder/master.svg?style=flat-square)](https://travis-ci.org/php-http/multipart-stream-builder) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/multipart-stream-builder.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/multipart-stream-builder) -[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/multipart-stream-builder.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/multipart-stream-builder) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/multipart-stream-builder.svg?style=flat-square)](https://packagist.org/packages/php-http/multipart-stream-builder) - -**A builder for Multipart PSR-7 Streams. The builder create streams independenly form any PSR-7 implementation.** - - -## Install - -Via Composer - -``` bash -$ composer require php-http/multipart-stream-builder -``` - -## Documentation - -Please see the [official documentation](http://php-http.readthedocs.org/en/latest/components/multipart-stream-builder.html). - - -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/multipart-stream-builder/composer.json b/vendor/php-http/multipart-stream-builder/composer.json deleted file mode 100644 index 5baa4af1..00000000 --- a/vendor/php-http/multipart-stream-builder/composer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "php-http/multipart-stream-builder", - "description": "A builder class that help you create a multipart stream", - "license": "MIT", - "keywords": ["http", "factory", "message", "stream", "multipart stream"], - "homepage": "http://php-http.org", - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - } - ], - "require": { - "php": "^7.1 || ^8.0", - "psr/http-message": "^1.0", - "psr/http-factory": "^1.0", - "php-http/message-factory": "^1.0.2", - "php-http/discovery": "^1.7" - }, - "require-dev": { - "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3", - "php-http/message": "^1.5", - "nyholm/psr7": "^1.0" - }, - "autoload": { - "psr-4": { - "Http\\Message\\MultipartStream\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "tests\\Http\\Message\\MultipartStream\\": "tests/" - } - }, - "scripts": { - "test": "vendor/bin/phpunit", - "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" - }, - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - } -} diff --git a/vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php b/vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php deleted file mode 100644 index 6e4ca660..00000000 --- a/vendor/php-http/multipart-stream-builder/src/ApacheMimetypeHelper.php +++ /dev/null @@ -1,142 +0,0 @@ - - */ -class ApacheMimetypeHelper implements MimetypeHelper -{ - /** - * {@inheritdoc} - * - * @see http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types - */ - public function getMimetypeFromFilename($filename) - { - return $this->getMimetypeFromExtension(pathinfo($filename, PATHINFO_EXTENSION)); - } - - /** - * {@inheritdoc} - * - * @see http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types - */ - public function getMimetypeFromExtension($extension) - { - static $mimetypes = [ - '7z' => 'application/x-7z-compressed', - 'aac' => 'audio/x-aac', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'asc' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'atom' => 'application/atom+xml', - 'avi' => 'video/x-msvideo', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bzip2', - 'cer' => 'application/pkix-cert', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'css' => 'text/css', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'deb' => 'application/x-debian-package', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dvi' => 'application/x-dvi', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'etx' => 'text/x-setext', - 'flac' => 'audio/flac', - 'flv' => 'video/x-flv', - 'gif' => 'image/gif', - 'gz' => 'application/gzip', - 'htm' => 'text/html', - 'html' => 'text/html', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ini' => 'text/plain', - 'iso' => 'application/x-iso9660-image', - 'jar' => 'application/java-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'latex' => 'application/x-latex', - 'log' => 'text/plain', - 'm4a' => 'audio/mp4', - 'm4v' => 'video/mp4', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4v' => 'video/mp4', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'pbm' => 'image/x-portable-bitmap', - 'pdf' => 'application/pdf', - 'pgm' => 'image/x-portable-graymap', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'ppm' => 'image/x-portable-pixmap', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'qt' => 'video/quicktime', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'svg' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'tar' => 'application/x-tar', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'torrent' => 'application/x-bittorrent', - 'ttf' => 'application/x-font-ttf', - 'txt' => 'text/plain', - 'wav' => 'audio/x-wav', - 'webm' => 'video/webm', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'video/x-ms-wmv', - 'woff' => 'application/x-font-woff', - 'wsdl' => 'application/wsdl+xml', - 'xbm' => 'image/x-xbitmap', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - 'xpm' => 'image/x-xpixmap', - 'xwd' => 'image/x-xwindowdump', - 'yaml' => 'text/yaml', - 'yml' => 'text/yaml', - 'zip' => 'application/zip', - - // Non-Apache standard - 'pkpass' => 'application/vnd.apple.pkpass', - 'msg' => 'application/vnd.ms-outlook', - ]; - - $extension = strtolower($extension); - - return isset($mimetypes[$extension]) - ? $mimetypes[$extension] - : null; - } -} diff --git a/vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php b/vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php deleted file mode 100644 index 9f3f0d92..00000000 --- a/vendor/php-http/multipart-stream-builder/src/CustomMimetypeHelper.php +++ /dev/null @@ -1,51 +0,0 @@ - - */ -class CustomMimetypeHelper extends ApacheMimetypeHelper -{ - /** - * @var array - */ - private $mimetypes = []; - - /** - * @param array $mimetypes should be of type extension => mimetype - */ - public function __construct(array $mimetypes = []) - { - $this->mimetypes = $mimetypes; - } - - /** - * @param string $extension - * @param string $mimetype - * - * @return $this - */ - public function addMimetype($extension, $mimetype) - { - $this->mimetypes[$extension] = $mimetype; - - return $this; - } - - /** - * {@inheritdoc} - * - * Check if we have any defined mimetypes and of not fallback to ApacheMimetypeHelper - */ - public function getMimetypeFromExtension($extension) - { - $extension = strtolower($extension); - - return isset($this->mimetypes[$extension]) - ? $this->mimetypes[$extension] - : parent::getMimetypeFromExtension($extension); - } -} diff --git a/vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php b/vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php deleted file mode 100644 index 7b5917ff..00000000 --- a/vendor/php-http/multipart-stream-builder/src/MimetypeHelper.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -interface MimetypeHelper -{ - /** - * Determines the mimetype of a file by looking at its extension. - * - * @param string $filename - * - * @return string|null - */ - public function getMimetypeFromFilename($filename); - - /** - * Maps a file extensions to a mimetype. - * - * @param string $extension The file extension - * - * @return string|null - */ - public function getMimetypeFromExtension($extension); -} diff --git a/vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php b/vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php deleted file mode 100644 index 6f94dbef..00000000 --- a/vendor/php-http/multipart-stream-builder/src/MultipartStreamBuilder.php +++ /dev/null @@ -1,355 +0,0 @@ - - */ -class MultipartStreamBuilder -{ - /** - * @var HttplugStreamFactory|StreamFactoryInterface - */ - private $streamFactory; - - /** - * @var MimetypeHelper - */ - private $mimetypeHelper; - - /** - * @var string - */ - private $boundary; - - /** - * @var array Element where each Element is an array with keys ['contents', 'headers'] - */ - private $data = []; - - /** - * @param HttplugStreamFactory|StreamFactoryInterface|null $streamFactory - */ - public function __construct($streamFactory = null) - { - if ($streamFactory instanceof StreamFactoryInterface || $streamFactory instanceof HttplugStreamFactory) { - $this->streamFactory = $streamFactory; - - return; - } - - if (null !== $streamFactory) { - throw new \LogicException(sprintf( - 'First arguemnt to the constructor of "%s" must be of type "%s", "%s" or null. Got %s', - __CLASS__, - StreamFactoryInterface::class, - HttplugStreamFactory::class, - \is_object($streamFactory) ? \get_class($streamFactory) : \gettype($streamFactory) - )); - } - - // Try to find a stream factory. - try { - $this->streamFactory = Psr17FactoryDiscovery::findStreamFactory(); - } catch (NotFoundException $psr17Exception) { - try { - $this->streamFactory = StreamFactoryDiscovery::find(); - } catch (NotFoundException $httplugException) { - // we could not find any factory. - throw $psr17Exception; - } - } - } - - /** - * Add a resource to the Multipart Stream. - * - * @param string|resource|\Psr\Http\Message\StreamInterface $resource the filepath, resource or StreamInterface of the data - * @param array $headers additional headers array: ['header-name' => 'header-value'] - * - * @return MultipartStreamBuilder - */ - public function addData($resource, array $headers = []) - { - $stream = $this->createStream($resource); - $this->data[] = ['contents' => $stream, 'headers' => $headers]; - - return $this; - } - - /** - * Add a resource to the Multipart Stream. - * - * @param string $name the formpost name - * @param string|resource|StreamInterface $resource - * @param array $options { - * - * @var array $headers additional headers ['header-name' => 'header-value'] - * @var string $filename - * } - * - * @return MultipartStreamBuilder - */ - public function addResource($name, $resource, array $options = []) - { - $stream = $this->createStream($resource); - - // validate options['headers'] exists - if (!isset($options['headers'])) { - $options['headers'] = []; - } - - // Try to add filename if it is missing - if (empty($options['filename'])) { - $options['filename'] = null; - $uri = $stream->getMetadata('uri'); - if ('php://' !== substr($uri, 0, 6)) { - $options['filename'] = $uri; - } - } - - $this->prepareHeaders($name, $stream, $options['filename'], $options['headers']); - - return $this->addData($stream, $options['headers']); - } - - /** - * Build the stream. - * - * @return StreamInterface - */ - public function build() - { - // Open a temporary read-write stream as buffer. - // If the size is less than predefined limit, things will stay in memory. - // If the size is more than that, things will be stored in temp file. - $buffer = fopen('php://temp', 'r+'); - foreach ($this->data as $data) { - // Add start and headers - fwrite($buffer, "--{$this->getBoundary()}\r\n". - $this->getHeaders($data['headers'])."\r\n"); - - /** @var $contentStream StreamInterface */ - $contentStream = $data['contents']; - - // Read stream into buffer - if ($contentStream->isSeekable()) { - $contentStream->rewind(); // rewind to beginning. - } - if ($contentStream->isReadable()) { - while (!$contentStream->eof()) { - // Read 1MB chunk into buffer until reached EOF. - fwrite($buffer, $contentStream->read(1048576)); - } - } else { - fwrite($buffer, $contentStream->__toString()); - } - fwrite($buffer, "\r\n"); - } - - // Append end - fwrite($buffer, "--{$this->getBoundary()}--\r\n"); - - // Rewind to starting position for reading. - fseek($buffer, 0); - - return $this->createStream($buffer); - } - - /** - * Add extra headers if they are missing. - * - * @param string $name - * @param string $filename - * @param array &$headers - */ - private function prepareHeaders($name, StreamInterface $stream, $filename, array &$headers) - { - $hasFilename = '0' === $filename || $filename; - - // Set a default content-disposition header if one was not provided - if (!$this->hasHeader($headers, 'content-disposition')) { - $headers['Content-Disposition'] = sprintf('form-data; name="%s"', $name); - if ($hasFilename) { - $headers['Content-Disposition'] .= sprintf('; filename="%s"', $this->basename($filename)); - } - } - - // Set a default content-length header if one was not provided - if (!$this->hasHeader($headers, 'content-length')) { - if ($length = $stream->getSize()) { - $headers['Content-Length'] = (string) $length; - } - } - - // Set a default Content-Type if one was not provided - if (!$this->hasHeader($headers, 'content-type') && $hasFilename) { - if ($type = $this->getMimetypeHelper()->getMimetypeFromFilename($filename)) { - $headers['Content-Type'] = $type; - } - } - } - - /** - * Get the headers formatted for the HTTP message. - * - * @return string - */ - private function getHeaders(array $headers) - { - $str = ''; - foreach ($headers as $key => $value) { - $str .= sprintf("%s: %s\r\n", $key, $value); - } - - return $str; - } - - /** - * Check if header exist. - * - * @param string $key case insensitive - * - * @return bool - */ - private function hasHeader(array $headers, $key) - { - $lowercaseHeader = strtolower($key); - foreach ($headers as $k => $v) { - if (strtolower($k) === $lowercaseHeader) { - return true; - } - } - - return false; - } - - /** - * Get the boundary that separates the streams. - * - * @return string - */ - public function getBoundary() - { - if (null === $this->boundary) { - $this->boundary = uniqid('', true); - } - - return $this->boundary; - } - - /** - * @param string $boundary - * - * @return MultipartStreamBuilder - */ - public function setBoundary($boundary) - { - $this->boundary = $boundary; - - return $this; - } - - /** - * @return MimetypeHelper - */ - private function getMimetypeHelper() - { - if (null === $this->mimetypeHelper) { - $this->mimetypeHelper = new ApacheMimetypeHelper(); - } - - return $this->mimetypeHelper; - } - - /** - * If you have custom file extension you may overwrite the default MimetypeHelper with your own. - * - * @return MultipartStreamBuilder - */ - public function setMimetypeHelper(MimetypeHelper $mimetypeHelper) - { - $this->mimetypeHelper = $mimetypeHelper; - - return $this; - } - - /** - * Reset and clear all stored data. This allows you to use builder for a subsequent request. - * - * @return MultipartStreamBuilder - */ - public function reset() - { - $this->data = []; - $this->boundary = null; - - return $this; - } - - /** - * Gets the filename from a given path. - * - * PHP's basename() does not properly support streams or filenames beginning with a non-US-ASCII character. - * - * @author Drupal 8.2 - * - * @param string $path - * - * @return string - */ - private function basename($path) - { - $separators = '/'; - if (DIRECTORY_SEPARATOR != '/') { - // For Windows OS add special separator. - $separators .= DIRECTORY_SEPARATOR; - } - - // Remove right-most slashes when $path points to directory. - $path = rtrim($path, $separators); - - // Returns the trailing part of the $path starting after one of the directory separators. - $filename = preg_match('@[^'.preg_quote($separators, '@').']+$@', $path, $matches) ? $matches[0] : ''; - - return $filename; - } - - /** - * @param string|resource|StreamInterface $resource - * - * @return StreamInterface - */ - private function createStream($resource) - { - if ($resource instanceof StreamInterface) { - return $resource; - } - - if ($this->streamFactory instanceof HttplugStreamFactory) { - return $this->streamFactory->createStream($resource); - } - - // Assert: We are using a PSR17 stream factory. - if (\is_string($resource)) { - return $this->streamFactory->createStream($resource); - } - - if (\is_resource($resource)) { - return $this->streamFactory->createStreamFromResource($resource); - } - - throw new \InvalidArgumentException(sprintf('First argument to "%s::createStream()" must be a string, resource or StreamInterface.', __CLASS__)); - } -} diff --git a/vendor/php-http/promise/CHANGELOG.md b/vendor/php-http/promise/CHANGELOG.md deleted file mode 100644 index 479deb8a..00000000 --- a/vendor/php-http/promise/CHANGELOG.md +++ /dev/null @@ -1,48 +0,0 @@ -# Change Log - -## 1.1.0 - 2020-07-07 - -### Added - -- Test with PHP 7.1, 7.2, 7.3, 7.4 and 8.0 - -### Removed - -- PHP 5 and 7.0 support - -### Fixed - -- Fixed PHPDoc for `Promise::then` - -## 1.0.0 - 2016-01-26 - -### Removed - -- PSR-7 dependency - - -## 1.0.0-RC1 - 2016-01-12 - -### Added - -- Tests for full coverage - -## Changed - -- Updated package files -- Clarified wait method behavior -- Contributing guide moved to the documentation - - -## 0.1.1 - 2015-12-24 - -## Added - -- Fulfilled and Rejected promise implementations - - -## 0.1.0 - 2015-12-13 - -## Added - -- Promise interface diff --git a/vendor/php-http/promise/LICENSE b/vendor/php-http/promise/LICENSE deleted file mode 100644 index 4558d6f0..00000000 --- a/vendor/php-http/promise/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2016 PHP HTTP Team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/php-http/promise/README.md b/vendor/php-http/promise/README.md deleted file mode 100644 index ee95e093..00000000 --- a/vendor/php-http/promise/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Promise - -[![Latest Version](https://img.shields.io/github/release/php-http/promise.svg?style=flat-square)](https://github.com/php-http/promise/releases) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/php-http/promise.svg?style=flat-square)](https://travis-ci.org/php-http/promise) -[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) -[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/promise.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/promise) -[![Total Downloads](https://img.shields.io/packagist/dt/php-http/promise.svg?style=flat-square)](https://packagist.org/packages/php-http/promise) - -**Promise used for asynchronous HTTP requests.** - -**Note:** This will eventually be removed/deprecated and replaced with the upcoming Promise PSR. - - -## Install - -Via Composer - -``` bash -$ composer require php-http/promise -``` - - -## Documentation - -Please see the [official documentation](http://docs.php-http.org/en/latest/components/promise.html). - - -## Testing - -``` bash -$ composer test -``` - - -## Contributing - -Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). - - -## Security - -If you discover any security related issues, please contact us at [security@php-http.org](mailto:security@php-http.org). - - -## License - -The MIT License (MIT). Please see [License File](LICENSE) for more information. diff --git a/vendor/php-http/promise/composer.json b/vendor/php-http/promise/composer.json deleted file mode 100644 index 812167bc..00000000 --- a/vendor/php-http/promise/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "php-http/promise", - "description": "Promise used for asynchronous HTTP requests", - "license": "MIT", - "keywords": ["promise"], - "homepage": "http://httplug.io", - "authors": [ - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "require": { - "php" : "^7.1 || ^8.0" - }, - "require-dev": { - "friends-of-phpspec/phpspec-code-coverage" : "^4.3.2", - "phpspec/phpspec": "^5.1.2 || ^6.2" - }, - "autoload": { - "psr-4": { - "Http\\Promise\\": "src/" - } - }, - "scripts": { - "test": "vendor/bin/phpspec run", - "test-ci": "vendor/bin/phpspec run -c phpspec.yml.ci" - }, - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - } -} diff --git a/vendor/php-http/promise/src/FulfilledPromise.php b/vendor/php-http/promise/src/FulfilledPromise.php deleted file mode 100644 index f60f686a..00000000 --- a/vendor/php-http/promise/src/FulfilledPromise.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ -final class FulfilledPromise implements Promise -{ - /** - * @var mixed - */ - private $result; - - /** - * @param $result - */ - public function __construct($result) - { - $this->result = $result; - } - - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) - { - if (null === $onFulfilled) { - return $this; - } - - try { - return new self($onFulfilled($this->result)); - } catch (\Exception $e) { - return new RejectedPromise($e); - } - } - - /** - * {@inheritdoc} - */ - public function getState() - { - return Promise::FULFILLED; - } - - /** - * {@inheritdoc} - */ - public function wait($unwrap = true) - { - if ($unwrap) { - return $this->result; - } - } -} diff --git a/vendor/php-http/promise/src/Promise.php b/vendor/php-http/promise/src/Promise.php deleted file mode 100644 index 3258ed0d..00000000 --- a/vendor/php-http/promise/src/Promise.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @author Márk Sági-Kazár - */ -interface Promise -{ - /** - * Promise has not been fulfilled or rejected. - */ - const PENDING = 'pending'; - - /** - * Promise has been fulfilled. - */ - const FULFILLED = 'fulfilled'; - - /** - * Promise has been rejected. - */ - const REJECTED = 'rejected'; - - /** - * Adds behavior for when the promise is resolved or rejected (response will be available, or error happens). - * - * If you do not care about one of the cases, you can set the corresponding callable to null - * The callback will be called when the value arrived and never more than once. - * - * @param callable|null $onFulfilled called when a response will be available - * @param callable|null $onRejected called when an exception occurs - * - * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected) - */ - public function then(callable $onFulfilled = null, callable $onRejected = null); - - /** - * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED. - * - * @return string - */ - public function getState(); - - /** - * Wait for the promise to be fulfilled or rejected. - * - * When this method returns, the request has been resolved and if callables have been - * specified, the appropriate one has terminated. - * - * When $unwrap is true (the default), the response is returned, or the exception thrown - * on failure. Otherwise, nothing is returned or thrown. - * - * @param bool $unwrap Whether to return resolved value / throw reason or not - * - * @return mixed Resolved value, null if $unwrap is set to false - * - * @throws \Exception the rejection reason if $unwrap is set to true and the request failed - */ - public function wait($unwrap = true); -} diff --git a/vendor/php-http/promise/src/RejectedPromise.php b/vendor/php-http/promise/src/RejectedPromise.php deleted file mode 100644 index e396a40f..00000000 --- a/vendor/php-http/promise/src/RejectedPromise.php +++ /dev/null @@ -1,58 +0,0 @@ - - */ -final class RejectedPromise implements Promise -{ - /** - * @var \Exception - */ - private $exception; - - /** - * @param \Exception $exception - */ - public function __construct(\Exception $exception) - { - $this->exception = $exception; - } - - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) - { - if (null === $onRejected) { - return $this; - } - - try { - return new FulfilledPromise($onRejected($this->exception)); - } catch (\Exception $e) { - return new self($e); - } - } - - /** - * {@inheritdoc} - */ - public function getState() - { - return Promise::REJECTED; - } - - /** - * {@inheritdoc} - */ - public function wait($unwrap = true) - { - if ($unwrap) { - throw $this->exception; - } - } -} diff --git a/vendor/psr/cache/CHANGELOG.md b/vendor/psr/cache/CHANGELOG.md deleted file mode 100644 index 58ddab05..00000000 --- a/vendor/psr/cache/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.0.1 - 2016-08-06 - -### Fixed - -- Make spacing consistent in phpdoc annotations php-fig/cache#9 - chalasr -- Fix grammar in phpdoc annotations php-fig/cache#10 - chalasr -- Be more specific in docblocks that `getItems()` and `deleteItems()` take an array of strings (`string[]`) compared to just `array` php-fig/cache#8 - GrahamCampbell -- For `expiresAt()` and `expiresAfter()` in CacheItemInterface fix docblock to specify null as a valid parameters as well as an implementation of DateTimeInterface php-fig/cache#7 - GrahamCampbell - -## 1.0.0 - 2015-12-11 - -Initial stable release; reflects accepted PSR-6 specification diff --git a/vendor/psr/cache/LICENSE.txt b/vendor/psr/cache/LICENSE.txt deleted file mode 100644 index b1c2c97b..00000000 --- a/vendor/psr/cache/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015 PHP Framework Interoperability Group - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/psr/cache/README.md b/vendor/psr/cache/README.md deleted file mode 100644 index 9855a318..00000000 --- a/vendor/psr/cache/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Caching Interface -============== - -This repository holds all interfaces related to [PSR-6 (Caching Interface)][psr-url]. - -Note that this is not a Caching implementation of its own. It is merely interfaces that describe the components of a Caching mechanism. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-6/ -[package-url]: https://packagist.org/packages/psr/cache -[implementation-url]: https://packagist.org/providers/psr/cache-implementation diff --git a/vendor/psr/cache/composer.json b/vendor/psr/cache/composer.json deleted file mode 100644 index 4b687971..00000000 --- a/vendor/psr/cache/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/cache", - "description": "Common interface for caching libraries", - "keywords": ["psr", "psr-6", "cache"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=8.0.0" - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/cache/src/CacheException.php b/vendor/psr/cache/src/CacheException.php deleted file mode 100644 index bb785f46..00000000 --- a/vendor/psr/cache/src/CacheException.php +++ /dev/null @@ -1,10 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Debug; - -use Symfony\Component\OptionsResolver\Exception\NoConfigurationException; -use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException; -use Symfony\Component\OptionsResolver\OptionsResolver; - -/** - * @author Maxime Steinhausser - * - * @final - */ -class OptionsResolverIntrospector -{ - private $get; - - public function __construct(OptionsResolver $optionsResolver) - { - $this->get = \Closure::bind(function ($property, $option, $message) { - /** @var OptionsResolver $this */ - if (!$this->isDefined($option)) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist.', $option)); - } - - if (!\array_key_exists($option, $this->{$property})) { - throw new NoConfigurationException($message); - } - - return $this->{$property}[$option]; - }, $optionsResolver, $optionsResolver); - } - - /** - * @throws NoConfigurationException on no configured value - */ - public function getDefault(string $option): mixed - { - return ($this->get)('defaults', $option, sprintf('No default value was set for the "%s" option.', $option)); - } - - /** - * @return \Closure[] - * - * @throws NoConfigurationException on no configured closures - */ - public function getLazyClosures(string $option): array - { - return ($this->get)('lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option)); - } - - /** - * @return string[] - * - * @throws NoConfigurationException on no configured types - */ - public function getAllowedTypes(string $option): array - { - return ($this->get)('allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option)); - } - - /** - * @return mixed[] - * - * @throws NoConfigurationException on no configured values - */ - public function getAllowedValues(string $option): array - { - return ($this->get)('allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option)); - } - - /** - * @throws NoConfigurationException on no configured normalizer - */ - public function getNormalizer(string $option): \Closure - { - return current($this->getNormalizers($option)); - } - - /** - * @throws NoConfigurationException when no normalizer is configured - */ - public function getNormalizers(string $option): array - { - return ($this->get)('normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option)); - } - - /** - * @throws NoConfigurationException on no configured deprecation - */ - public function getDeprecation(string $option): array - { - return ($this->get)('deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option)); - } -} diff --git a/vendor/symfony/options-resolver/Exception/AccessException.php b/vendor/symfony/options-resolver/Exception/AccessException.php deleted file mode 100644 index c12b6806..00000000 --- a/vendor/symfony/options-resolver/Exception/AccessException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when trying to read an option outside of or write it inside of - * {@link \Symfony\Component\OptionsResolver\Options::resolve()}. - * - * @author Bernhard Schussek - */ -class AccessException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/options-resolver/Exception/ExceptionInterface.php b/vendor/symfony/options-resolver/Exception/ExceptionInterface.php deleted file mode 100644 index ea99d050..00000000 --- a/vendor/symfony/options-resolver/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Marker interface for all exceptions thrown by the OptionsResolver component. - * - * @author Bernhard Schussek - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php b/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php deleted file mode 100644 index 6d421d68..00000000 --- a/vendor/symfony/options-resolver/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when an argument is invalid. - * - * @author Bernhard Schussek - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php b/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php deleted file mode 100644 index 6fd4f125..00000000 --- a/vendor/symfony/options-resolver/Exception/InvalidOptionsException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when the value of an option does not match its validation rules. - * - * You should make sure a valid value is passed to the option. - * - * @author Bernhard Schussek - */ -class InvalidOptionsException extends InvalidArgumentException -{ -} diff --git a/vendor/symfony/options-resolver/Exception/MissingOptionsException.php b/vendor/symfony/options-resolver/Exception/MissingOptionsException.php deleted file mode 100644 index faa487f1..00000000 --- a/vendor/symfony/options-resolver/Exception/MissingOptionsException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Exception thrown when a required option is missing. - * - * Add the option to the passed options array. - * - * @author Bernhard Schussek - */ -class MissingOptionsException extends InvalidArgumentException -{ -} diff --git a/vendor/symfony/options-resolver/Exception/NoConfigurationException.php b/vendor/symfony/options-resolver/Exception/NoConfigurationException.php deleted file mode 100644 index 6693ec14..00000000 --- a/vendor/symfony/options-resolver/Exception/NoConfigurationException.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -use Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector; - -/** - * Thrown when trying to introspect an option definition property - * for which no value was configured inside the OptionsResolver instance. - * - * @see OptionsResolverIntrospector - * - * @author Maxime Steinhausser - */ -class NoConfigurationException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php b/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php deleted file mode 100644 index 4c3280f4..00000000 --- a/vendor/symfony/options-resolver/Exception/NoSuchOptionException.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when trying to read an option that has no value set. - * - * When accessing optional options from within a lazy option or normalizer you should first - * check whether the optional option is set. You can do this with `isset($options['optional'])`. - * In contrast to the {@link UndefinedOptionsException}, this is a runtime exception that can - * occur when evaluating lazy options. - * - * @author Tobias Schultze - */ -class NoSuchOptionException extends \OutOfBoundsException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php b/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php deleted file mode 100644 index e8e339d4..00000000 --- a/vendor/symfony/options-resolver/Exception/OptionDefinitionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Thrown when two lazy options have a cyclic dependency. - * - * @author Bernhard Schussek - */ -class OptionDefinitionException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php b/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php deleted file mode 100644 index 6ca3fce4..00000000 --- a/vendor/symfony/options-resolver/Exception/UndefinedOptionsException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver\Exception; - -/** - * Exception thrown when an undefined option is passed. - * - * You should remove the options in question from your code or define them - * beforehand. - * - * @author Bernhard Schussek - */ -class UndefinedOptionsException extends InvalidArgumentException -{ -} diff --git a/vendor/symfony/options-resolver/LICENSE b/vendor/symfony/options-resolver/LICENSE deleted file mode 100644 index 88bf75bb..00000000 --- a/vendor/symfony/options-resolver/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2022 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/options-resolver/OptionConfigurator.php b/vendor/symfony/options-resolver/OptionConfigurator.php deleted file mode 100644 index 37d51384..00000000 --- a/vendor/symfony/options-resolver/OptionConfigurator.php +++ /dev/null @@ -1,137 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver; - -use Symfony\Component\OptionsResolver\Exception\AccessException; - -final class OptionConfigurator -{ - private $name; - private $resolver; - - public function __construct(string $name, OptionsResolver $resolver) - { - $this->name = $name; - $this->resolver = $resolver; - $this->resolver->setDefined($name); - } - - /** - * Adds allowed types for this option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function allowedTypes(string ...$types): static - { - $this->resolver->setAllowedTypes($this->name, $types); - - return $this; - } - - /** - * Sets allowed values for this option. - * - * @param mixed ...$values One or more acceptable values/closures - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function allowedValues(mixed ...$values): static - { - $this->resolver->setAllowedValues($this->name, $values); - - return $this; - } - - /** - * Sets the default value for this option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function default(mixed $value): static - { - $this->resolver->setDefault($this->name, $value); - - return $this; - } - - /** - * Defines an option configurator with the given name. - */ - public function define(string $option): self - { - return $this->resolver->define($option); - } - - /** - * Marks this option as deprecated. - * - * @param string $package The name of the composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string|\Closure $message The deprecation message to use - * - * @return $this - */ - public function deprecated(string $package, string $version, string|\Closure $message = 'The option "%name%" is deprecated.'): static - { - $this->resolver->setDeprecated($this->name, $package, $version, $message); - - return $this; - } - - /** - * Sets the normalizer for this option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function normalize(\Closure $normalizer): static - { - $this->resolver->setNormalizer($this->name, $normalizer); - - return $this; - } - - /** - * Marks this option as required. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function required(): static - { - $this->resolver->setRequired($this->name); - - return $this; - } - - /** - * Sets an info message for an option. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function info(string $info): static - { - $this->resolver->setInfo($this->name, $info); - - return $this; - } -} diff --git a/vendor/symfony/options-resolver/Options.php b/vendor/symfony/options-resolver/Options.php deleted file mode 100644 index d444ec42..00000000 --- a/vendor/symfony/options-resolver/Options.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver; - -/** - * Contains resolved option values. - * - * @author Bernhard Schussek - * @author Tobias Schultze - */ -interface Options extends \ArrayAccess, \Countable -{ -} diff --git a/vendor/symfony/options-resolver/OptionsResolver.php b/vendor/symfony/options-resolver/OptionsResolver.php deleted file mode 100644 index fe776447..00000000 --- a/vendor/symfony/options-resolver/OptionsResolver.php +++ /dev/null @@ -1,1300 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\OptionsResolver; - -use Symfony\Component\OptionsResolver\Exception\AccessException; -use Symfony\Component\OptionsResolver\Exception\InvalidArgumentException; -use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; -use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; -use Symfony\Component\OptionsResolver\Exception\NoSuchOptionException; -use Symfony\Component\OptionsResolver\Exception\OptionDefinitionException; -use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException; - -/** - * Validates options and merges them with default values. - * - * @author Bernhard Schussek - * @author Tobias Schultze - */ -class OptionsResolver implements Options -{ - private const VALIDATION_FUNCTIONS = [ - 'bool' => 'is_bool', - 'boolean' => 'is_bool', - 'int' => 'is_int', - 'integer' => 'is_int', - 'long' => 'is_int', - 'float' => 'is_float', - 'double' => 'is_float', - 'real' => 'is_float', - 'numeric' => 'is_numeric', - 'string' => 'is_string', - 'scalar' => 'is_scalar', - 'array' => 'is_array', - 'iterable' => 'is_iterable', - 'countable' => 'is_countable', - 'callable' => 'is_callable', - 'object' => 'is_object', - 'resource' => 'is_resource', - ]; - - /** - * The names of all defined options. - */ - private $defined = []; - - /** - * The default option values. - */ - private $defaults = []; - - /** - * A list of closure for nested options. - * - * @var \Closure[][] - */ - private $nested = []; - - /** - * The names of required options. - */ - private $required = []; - - /** - * The resolved option values. - */ - private $resolved = []; - - /** - * A list of normalizer closures. - * - * @var \Closure[][] - */ - private $normalizers = []; - - /** - * A list of accepted values for each option. - */ - private $allowedValues = []; - - /** - * A list of accepted types for each option. - */ - private $allowedTypes = []; - - /** - * A list of info messages for each option. - */ - private $info = []; - - /** - * A list of closures for evaluating lazy options. - */ - private $lazy = []; - - /** - * A list of lazy options whose closure is currently being called. - * - * This list helps detecting circular dependencies between lazy options. - */ - private $calling = []; - - /** - * A list of deprecated options. - */ - private $deprecated = []; - - /** - * The list of options provided by the user. - */ - private $given = []; - - /** - * Whether the instance is locked for reading. - * - * Once locked, the options cannot be changed anymore. This is - * necessary in order to avoid inconsistencies during the resolving - * process. If any option is changed after being read, all evaluated - * lazy options that depend on this option would become invalid. - */ - private $locked = false; - - private $parentsOptions = []; - - /** - * Whether the whole options definition is marked as array prototype. - */ - private $prototype; - - /** - * The prototype array's index that is being read. - */ - private $prototypeIndex; - - /** - * Sets the default value of a given option. - * - * If the default value should be set based on other options, you can pass - * a closure with the following signature: - * - * function (Options $options) { - * // ... - * } - * - * The closure will be evaluated when {@link resolve()} is called. The - * closure has access to the resolved values of other options through the - * passed {@link Options} instance: - * - * function (Options $options) { - * if (isset($options['port'])) { - * // ... - * } - * } - * - * If you want to access the previously set default value, add a second - * argument to the closure's signature: - * - * $options->setDefault('name', 'Default Name'); - * - * $options->setDefault('name', function (Options $options, $previousValue) { - * // 'Default Name' === $previousValue - * }); - * - * This is mostly useful if the configuration of the {@link Options} object - * is spread across different locations of your code, such as base and - * sub-classes. - * - * If you want to define nested options, you can pass a closure with the - * following signature: - * - * $options->setDefault('database', function (OptionsResolver $resolver) { - * $resolver->setDefined(['dbname', 'host', 'port', 'user', 'pass']); - * } - * - * To get access to the parent options, add a second argument to the closure's - * signature: - * - * function (OptionsResolver $resolver, Options $parent) { - * // 'default' === $parent['connection'] - * } - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setDefault(string $option, mixed $value): static - { - // Setting is not possible once resolving starts, because then lazy - // options could manipulate the state of the object, leading to - // inconsistent results. - if ($this->locked) { - throw new AccessException('Default values cannot be set from a lazy option or normalizer.'); - } - - // If an option is a closure that should be evaluated lazily, store it - // in the "lazy" property. - if ($value instanceof \Closure) { - $reflClosure = new \ReflectionFunction($value); - $params = $reflClosure->getParameters(); - - if (isset($params[0]) && Options::class === $this->getParameterClassName($params[0])) { - // Initialize the option if no previous value exists - if (!isset($this->defaults[$option])) { - $this->defaults[$option] = null; - } - - // Ignore previous lazy options if the closure has no second parameter - if (!isset($this->lazy[$option]) || !isset($params[1])) { - $this->lazy[$option] = []; - } - - // Store closure for later evaluation - $this->lazy[$option][] = $value; - $this->defined[$option] = true; - - // Make sure the option is processed and is not nested anymore - unset($this->resolved[$option], $this->nested[$option]); - - return $this; - } - - if (isset($params[0]) && null !== ($type = $params[0]->getType()) && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) { - // Store closure for later evaluation - $this->nested[$option][] = $value; - $this->defaults[$option] = []; - $this->defined[$option] = true; - - // Make sure the option is processed and is not lazy anymore - unset($this->resolved[$option], $this->lazy[$option]); - - return $this; - } - } - - // This option is not lazy nor nested anymore - unset($this->lazy[$option], $this->nested[$option]); - - // Yet undefined options can be marked as resolved, because we only need - // to resolve options with lazy closures, normalizers or validation - // rules, none of which can exist for undefined options - // If the option was resolved before, update the resolved value - if (!isset($this->defined[$option]) || \array_key_exists($option, $this->resolved)) { - $this->resolved[$option] = $value; - } - - $this->defaults[$option] = $value; - $this->defined[$option] = true; - - return $this; - } - - /** - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setDefaults(array $defaults): static - { - foreach ($defaults as $option => $value) { - $this->setDefault($option, $value); - } - - return $this; - } - - /** - * Returns whether a default value is set for an option. - * - * Returns true if {@link setDefault()} was called for this option. - * An option is also considered set if it was set to null. - */ - public function hasDefault(string $option): bool - { - return \array_key_exists($option, $this->defaults); - } - - /** - * Marks one or more options as required. - * - * @param string|string[] $optionNames One or more option names - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setRequired(string|array $optionNames): static - { - if ($this->locked) { - throw new AccessException('Options cannot be made required from a lazy option or normalizer.'); - } - - foreach ((array) $optionNames as $option) { - $this->defined[$option] = true; - $this->required[$option] = true; - } - - return $this; - } - - /** - * Returns whether an option is required. - * - * An option is required if it was passed to {@link setRequired()}. - */ - public function isRequired(string $option): bool - { - return isset($this->required[$option]); - } - - /** - * Returns the names of all required options. - * - * @return string[] - * - * @see isRequired() - */ - public function getRequiredOptions(): array - { - return array_keys($this->required); - } - - /** - * Returns whether an option is missing a default value. - * - * An option is missing if it was passed to {@link setRequired()}, but not - * to {@link setDefault()}. This option must be passed explicitly to - * {@link resolve()}, otherwise an exception will be thrown. - */ - public function isMissing(string $option): bool - { - return isset($this->required[$option]) && !\array_key_exists($option, $this->defaults); - } - - /** - * Returns the names of all options missing a default value. - * - * @return string[] - */ - public function getMissingOptions(): array - { - return array_keys(array_diff_key($this->required, $this->defaults)); - } - - /** - * Defines a valid option name. - * - * Defines an option name without setting a default value. The option will - * be accepted when passed to {@link resolve()}. When not passed, the - * option will not be included in the resolved options. - * - * @param string|string[] $optionNames One or more option names - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function setDefined(string|array $optionNames): static - { - if ($this->locked) { - throw new AccessException('Options cannot be defined from a lazy option or normalizer.'); - } - - foreach ((array) $optionNames as $option) { - $this->defined[$option] = true; - } - - return $this; - } - - /** - * Returns whether an option is defined. - * - * Returns true for any option passed to {@link setDefault()}, - * {@link setRequired()} or {@link setDefined()}. - */ - public function isDefined(string $option): bool - { - return isset($this->defined[$option]); - } - - /** - * Returns the names of all defined options. - * - * @return string[] - * - * @see isDefined() - */ - public function getDefinedOptions(): array - { - return array_keys($this->defined); - } - - public function isNested(string $option): bool - { - return isset($this->nested[$option]); - } - - /** - * Deprecates an option, allowed types or values. - * - * Instead of passing the message, you may also pass a closure with the - * following signature: - * - * function (Options $options, $value): string { - * // ... - * } - * - * The closure receives the value as argument and should return a string. - * Return an empty string to ignore the option deprecation. - * - * The closure is invoked when {@link resolve()} is called. The parameter - * passed to the closure is the value of the option after validating it - * and before normalizing it. - * - * @param string $package The name of the composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string|\Closure $message The deprecation message to use - * - * @return $this - */ - public function setDeprecated(string $option, string $package, string $version, string|\Closure $message = 'The option "%name%" is deprecated.'): static - { - if ($this->locked) { - throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if (!\is_string($message) && !$message instanceof \Closure) { - throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', get_debug_type($message))); - } - - // ignore if empty string - if ('' === $message) { - return $this; - } - - $this->deprecated[$option] = [ - 'package' => $package, - 'version' => $version, - 'message' => $message, - ]; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - public function isDeprecated(string $option): bool - { - return isset($this->deprecated[$option]); - } - - /** - * Sets the normalizer for an option. - * - * The normalizer should be a closure with the following signature: - * - * function (Options $options, $value) { - * // ... - * } - * - * The closure is invoked when {@link resolve()} is called. The closure - * has access to the resolved values of other options through the passed - * {@link Options} instance. - * - * The second parameter passed to the closure is the value of - * the option. - * - * The resolved option value is set to the return value of the closure. - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setNormalizer(string $option, \Closure $normalizer) - { - if ($this->locked) { - throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->normalizers[$option] = [$normalizer]; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Adds a normalizer for an option. - * - * The normalizer should be a closure with the following signature: - * - * function (Options $options, $value): mixed { - * // ... - * } - * - * The closure is invoked when {@link resolve()} is called. The closure - * has access to the resolved values of other options through the passed - * {@link Options} instance. - * - * The second parameter passed to the closure is the value of - * the option. - * - * The resolved option value is set to the return value of the closure. - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function addNormalizer(string $option, \Closure $normalizer, bool $forcePrepend = false): static - { - if ($this->locked) { - throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if ($forcePrepend) { - $this->normalizers[$option] = $this->normalizers[$option] ?? []; - array_unshift($this->normalizers[$option], $normalizer); - } else { - $this->normalizers[$option][] = $normalizer; - } - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Sets allowed values for an option. - * - * Instead of passing values, you may also pass a closures with the - * following signature: - * - * function ($value) { - * // return true or false - * } - * - * The closure receives the value as argument and should return true to - * accept the value and false to reject the value. - * - * @param mixed $allowedValues One or more acceptable values/closures - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setAllowedValues(string $option, mixed $allowedValues) - { - if ($this->locked) { - throw new AccessException('Allowed values cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : [$allowedValues]; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Adds allowed values for an option. - * - * The values are merged with the allowed values defined previously. - * - * Instead of passing values, you may also pass a closures with the - * following signature: - * - * function ($value) { - * // return true or false - * } - * - * The closure receives the value as argument and should return true to - * accept the value and false to reject the value. - * - * @param mixed $allowedValues One or more acceptable values/closures - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function addAllowedValues(string $option, mixed $allowedValues) - { - if ($this->locked) { - throw new AccessException('Allowed values cannot be added from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if (!\is_array($allowedValues)) { - $allowedValues = [$allowedValues]; - } - - if (!isset($this->allowedValues[$option])) { - $this->allowedValues[$option] = $allowedValues; - } else { - $this->allowedValues[$option] = array_merge($this->allowedValues[$option], $allowedValues); - } - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Sets allowed types for an option. - * - * Any type for which a corresponding is_() function exists is - * acceptable. Additionally, fully-qualified class or interface names may - * be passed. - * - * @param string|string[] $allowedTypes One or more accepted types - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setAllowedTypes(string $option, string|array $allowedTypes) - { - if ($this->locked) { - throw new AccessException('Allowed types cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->allowedTypes[$option] = (array) $allowedTypes; - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Adds allowed types for an option. - * - * The types are merged with the allowed types defined previously. - * - * Any type for which a corresponding is_() function exists is - * acceptable. Additionally, fully-qualified class or interface names may - * be passed. - * - * @param string|string[] $allowedTypes One or more accepted types - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function addAllowedTypes(string $option, string|array $allowedTypes) - { - if ($this->locked) { - throw new AccessException('Allowed types cannot be added from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - if (!isset($this->allowedTypes[$option])) { - $this->allowedTypes[$option] = (array) $allowedTypes; - } else { - $this->allowedTypes[$option] = array_merge($this->allowedTypes[$option], (array) $allowedTypes); - } - - // Make sure the option is processed - unset($this->resolved[$option]); - - return $this; - } - - /** - * Defines an option configurator with the given name. - */ - public function define(string $option): OptionConfigurator - { - if (isset($this->defined[$option])) { - throw new OptionDefinitionException(sprintf('The option "%s" is already defined.', $option)); - } - - return new OptionConfigurator($option, $this); - } - - /** - * Sets an info message for an option. - * - * @return $this - * - * @throws UndefinedOptionsException If the option is undefined - * @throws AccessException If called from a lazy option or normalizer - */ - public function setInfo(string $option, string $info): static - { - if ($this->locked) { - throw new AccessException('The Info message cannot be set from a lazy option or normalizer.'); - } - - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - $this->info[$option] = $info; - - return $this; - } - - /** - * Gets the info message for an option. - */ - public function getInfo(string $option): ?string - { - if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - return $this->info[$option] ?? null; - } - - /** - * Marks the whole options definition as array prototype. - * - * @return $this - * - * @throws AccessException If called from a lazy option, a normalizer or a root definition - */ - public function setPrototype(bool $prototype): static - { - if ($this->locked) { - throw new AccessException('The prototype property cannot be set from a lazy option or normalizer.'); - } - - if (null === $this->prototype && $prototype) { - throw new AccessException('The prototype property cannot be set from a root definition.'); - } - - $this->prototype = $prototype; - - return $this; - } - - public function isPrototype(): bool - { - return $this->prototype ?? false; - } - - /** - * Removes the option with the given name. - * - * Undefined options are ignored. - * - * @param string|string[] $optionNames One or more option names - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function remove(string|array $optionNames): static - { - if ($this->locked) { - throw new AccessException('Options cannot be removed from a lazy option or normalizer.'); - } - - foreach ((array) $optionNames as $option) { - unset($this->defined[$option], $this->defaults[$option], $this->required[$option], $this->resolved[$option]); - unset($this->lazy[$option], $this->normalizers[$option], $this->allowedTypes[$option], $this->allowedValues[$option], $this->info[$option]); - } - - return $this; - } - - /** - * Removes all options. - * - * @return $this - * - * @throws AccessException If called from a lazy option or normalizer - */ - public function clear(): static - { - if ($this->locked) { - throw new AccessException('Options cannot be cleared from a lazy option or normalizer.'); - } - - $this->defined = []; - $this->defaults = []; - $this->nested = []; - $this->required = []; - $this->resolved = []; - $this->lazy = []; - $this->normalizers = []; - $this->allowedTypes = []; - $this->allowedValues = []; - $this->deprecated = []; - $this->info = []; - - return $this; - } - - /** - * Merges options with the default values stored in the container and - * validates them. - * - * Exceptions are thrown if: - * - * - Undefined options are passed; - * - Required options are missing; - * - Options have invalid types; - * - Options have invalid values. - * - * @throws UndefinedOptionsException If an option name is undefined - * @throws InvalidOptionsException If an option doesn't fulfill the - * specified validation rules - * @throws MissingOptionsException If a required option is missing - * @throws OptionDefinitionException If there is a cyclic dependency between - * lazy options and/or normalizers - * @throws NoSuchOptionException If a lazy option reads an unavailable option - * @throws AccessException If called from a lazy option or normalizer - */ - public function resolve(array $options = []): array - { - if ($this->locked) { - throw new AccessException('Options cannot be resolved from a lazy option or normalizer.'); - } - - // Allow this method to be called multiple times - $clone = clone $this; - - // Make sure that no unknown options are passed - $diff = array_diff_key($options, $clone->defined); - - if (\count($diff) > 0) { - ksort($clone->defined); - ksort($diff); - - throw new UndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', $this->formatOptions(array_keys($diff)), implode('", "', array_keys($clone->defined)))); - } - - // Override options set by the user - foreach ($options as $option => $value) { - $clone->given[$option] = true; - $clone->defaults[$option] = $value; - unset($clone->resolved[$option], $clone->lazy[$option]); - } - - // Check whether any required option is missing - $diff = array_diff_key($clone->required, $clone->defaults); - - if (\count($diff) > 0) { - ksort($diff); - - throw new MissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', $this->formatOptions(array_keys($diff)))); - } - - // Lock the container - $clone->locked = true; - - // Now process the individual options. Use offsetGet(), which resolves - // the option itself and any options that the option depends on - foreach ($clone->defaults as $option => $_) { - $clone->offsetGet($option); - } - - return $clone->resolved; - } - - /** - * Returns the resolved value of an option. - * - * @param bool $triggerDeprecation Whether to trigger the deprecation or not (true by default) - * - * @throws AccessException If accessing this method outside of - * {@link resolve()} - * @throws NoSuchOptionException If the option is not set - * @throws InvalidOptionsException If the option doesn't fulfill the - * specified validation rules - * @throws OptionDefinitionException If there is a cyclic dependency between - * lazy options and/or normalizers - */ - public function offsetGet(mixed $option, bool $triggerDeprecation = true): mixed - { - if (!$this->locked) { - throw new AccessException('Array access is only supported within closures of lazy options and normalizers.'); - } - - // Shortcut for resolved options - if (isset($this->resolved[$option]) || \array_key_exists($option, $this->resolved)) { - if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option]['message'])) { - trigger_deprecation($this->deprecated[$option]['package'], $this->deprecated[$option]['version'], strtr($this->deprecated[$option]['message'], ['%name%' => $option])); - } - - return $this->resolved[$option]; - } - - // Check whether the option is set at all - if (!isset($this->defaults[$option]) && !\array_key_exists($option, $this->defaults)) { - if (!isset($this->defined[$option])) { - throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); - } - - throw new NoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $this->formatOptions([$option]))); - } - - $value = $this->defaults[$option]; - - // Resolve the option if it is a nested definition - if (isset($this->nested[$option])) { - // If the closure is already being called, we have a cyclic dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - if (!\is_array($value)) { - throw new InvalidOptionsException(sprintf('The nested option "%s" with value %s is expected to be of type array, but is of type "%s".', $this->formatOptions([$option]), $this->formatValue($value), get_debug_type($value))); - } - - // The following section must be protected from cyclic calls. - $this->calling[$option] = true; - try { - $resolver = new self(); - $resolver->prototype = false; - $resolver->parentsOptions = $this->parentsOptions; - $resolver->parentsOptions[] = $option; - foreach ($this->nested[$option] as $closure) { - $closure($resolver, $this); - } - - if ($resolver->prototype) { - $values = []; - foreach ($value as $index => $prototypeValue) { - if (!\is_array($prototypeValue)) { - throw new InvalidOptionsException(sprintf('The value of the option "%s" is expected to be of type array of array, but is of type array of "%s".', $this->formatOptions([$option]), get_debug_type($prototypeValue))); - } - - $resolver->prototypeIndex = $index; - $values[$index] = $resolver->resolve($prototypeValue); - } - $value = $values; - } else { - $value = $resolver->resolve($value); - } - } finally { - $resolver->prototypeIndex = null; - unset($this->calling[$option]); - } - } - - // Resolve the option if the default value is lazily evaluated - if (isset($this->lazy[$option])) { - // If the closure is already being called, we have a cyclic - // dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - // The following section must be protected from cyclic - // calls. Set $calling for the current $option to detect a cyclic - // dependency - // BEGIN - $this->calling[$option] = true; - try { - foreach ($this->lazy[$option] as $closure) { - $value = $closure($this, $value); - } - } finally { - unset($this->calling[$option]); - } - // END - } - - // Validate the type of the resolved option - if (isset($this->allowedTypes[$option])) { - $valid = true; - $invalidTypes = []; - - foreach ($this->allowedTypes[$option] as $type) { - if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) { - break; - } - } - - if (!$valid) { - $fmtActualValue = $this->formatValue($value); - $fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]); - $fmtProvidedTypes = implode('|', array_keys($invalidTypes)); - $allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) { - return str_ends_with($item, '[]'); - })) > 0; - - if (\is_array($value) && $allowedContainsArrayType) { - throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); - } - - throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); - } - } - - // Validate the value of the resolved option - if (isset($this->allowedValues[$option])) { - $success = false; - $printableAllowedValues = []; - - foreach ($this->allowedValues[$option] as $allowedValue) { - if ($allowedValue instanceof \Closure) { - if ($allowedValue($value)) { - $success = true; - break; - } - - // Don't include closures in the exception message - continue; - } - - if ($value === $allowedValue) { - $success = true; - break; - } - - $printableAllowedValues[] = $allowedValue; - } - - if (!$success) { - $message = sprintf( - 'The option "%s" with value %s is invalid.', - $option, - $this->formatValue($value) - ); - - if (\count($printableAllowedValues) > 0) { - $message .= sprintf( - ' Accepted values are: %s.', - $this->formatValues($printableAllowedValues) - ); - } - - if (isset($this->info[$option])) { - $message .= sprintf(' Info: %s.', $this->info[$option]); - } - - throw new InvalidOptionsException($message); - } - } - - // Check whether the option is deprecated - // and it is provided by the user or is being called from a lazy evaluation - if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || ($this->calling && \is_string($this->deprecated[$option]['message'])))) { - $deprecation = $this->deprecated[$option]; - $message = $this->deprecated[$option]['message']; - - if ($message instanceof \Closure) { - // If the closure is already being called, we have a cyclic dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - $this->calling[$option] = true; - try { - if (!\is_string($message = $message($this, $value))) { - throw new InvalidOptionsException(sprintf('Invalid type for deprecation message, expected string but got "%s", return an empty string to ignore.', get_debug_type($message))); - } - } finally { - unset($this->calling[$option]); - } - } - - if ('' !== $message) { - trigger_deprecation($deprecation['package'], $deprecation['version'], strtr($message, ['%name%' => $option])); - } - } - - // Normalize the validated option - if (isset($this->normalizers[$option])) { - // If the closure is already being called, we have a cyclic - // dependency - if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); - } - - // The following section must be protected from cyclic - // calls. Set $calling for the current $option to detect a cyclic - // dependency - // BEGIN - $this->calling[$option] = true; - try { - foreach ($this->normalizers[$option] as $normalizer) { - $value = $normalizer($this, $value); - } - } finally { - unset($this->calling[$option]); - } - // END - } - - // Mark as resolved - $this->resolved[$option] = $value; - - return $value; - } - - private function verifyTypes(string $type, mixed $value, array &$invalidTypes, int $level = 0): bool - { - if (\is_array($value) && '[]' === substr($type, -2)) { - $type = substr($type, 0, -2); - $valid = true; - - foreach ($value as $val) { - if (!$this->verifyTypes($type, $val, $invalidTypes, $level + 1)) { - $valid = false; - } - } - - return $valid; - } - - if (('null' === $type && null === $value) || (isset(self::VALIDATION_FUNCTIONS[$type]) ? self::VALIDATION_FUNCTIONS[$type]($value) : $value instanceof $type)) { - return true; - } - - if (!$invalidTypes || $level > 0) { - $invalidTypes[get_debug_type($value)] = true; - } - - return false; - } - - /** - * Returns whether a resolved option with the given name exists. - * - * @throws AccessException If accessing this method outside of {@link resolve()} - * - * @see \ArrayAccess::offsetExists() - */ - public function offsetExists(mixed $option): bool - { - if (!$this->locked) { - throw new AccessException('Array access is only supported within closures of lazy options and normalizers.'); - } - - return \array_key_exists($option, $this->defaults); - } - - /** - * Not supported. - * - * @throws AccessException - */ - public function offsetSet(mixed $option, mixed $value): void - { - throw new AccessException('Setting options via array access is not supported. Use setDefault() instead.'); - } - - /** - * Not supported. - * - * @throws AccessException - */ - public function offsetUnset(mixed $option): void - { - throw new AccessException('Removing options via array access is not supported. Use remove() instead.'); - } - - /** - * Returns the number of set options. - * - * This may be only a subset of the defined options. - * - * @throws AccessException If accessing this method outside of {@link resolve()} - * - * @see \Countable::count() - */ - public function count(): int - { - if (!$this->locked) { - throw new AccessException('Counting is only supported within closures of lazy options and normalizers.'); - } - - return \count($this->defaults); - } - - /** - * Returns a string representation of the value. - * - * This method returns the equivalent PHP tokens for most scalar types - * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped - * in double quotes ("). - */ - private function formatValue(mixed $value): string - { - if (\is_object($value)) { - return \get_class($value); - } - - if (\is_array($value)) { - return 'array'; - } - - if (\is_string($value)) { - return '"'.$value.'"'; - } - - if (\is_resource($value)) { - return 'resource'; - } - - if (null === $value) { - return 'null'; - } - - if (false === $value) { - return 'false'; - } - - if (true === $value) { - return 'true'; - } - - return (string) $value; - } - - /** - * Returns a string representation of a list of values. - * - * Each of the values is converted to a string using - * {@link formatValue()}. The values are then concatenated with commas. - * - * @see formatValue() - */ - private function formatValues(array $values): string - { - foreach ($values as $key => $value) { - $values[$key] = $this->formatValue($value); - } - - return implode(', ', $values); - } - - private function formatOptions(array $options): string - { - if ($this->parentsOptions) { - $prefix = array_shift($this->parentsOptions); - if ($this->parentsOptions) { - $prefix .= sprintf('[%s]', implode('][', $this->parentsOptions)); - } - - if ($this->prototype && null !== $this->prototypeIndex) { - $prefix .= sprintf('[%s]', $this->prototypeIndex); - } - - $options = array_map(static function (string $option) use ($prefix): string { - return sprintf('%s[%s]', $prefix, $option); - }, $options); - } - - return implode('", "', $options); - } - - private function getParameterClassName(\ReflectionParameter $parameter): ?string - { - if (!($type = $parameter->getType()) instanceof \ReflectionNamedType || $type->isBuiltin()) { - return null; - } - - return $type->getName(); - } -} diff --git a/vendor/symfony/options-resolver/README.md b/vendor/symfony/options-resolver/README.md deleted file mode 100644 index c63b9005..00000000 --- a/vendor/symfony/options-resolver/README.md +++ /dev/null @@ -1,15 +0,0 @@ -OptionsResolver Component -========================= - -The OptionsResolver component is `array_replace` on steroids. It allows you to -create an options system with required options, defaults, validation (type, -value), normalization and more. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/options_resolver.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/options-resolver/composer.json b/vendor/symfony/options-resolver/composer.json deleted file mode 100644 index 4fd80d95..00000000 --- a/vendor/symfony/options-resolver/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "symfony/options-resolver", - "type": "library", - "description": "Provides an improved replacement for the array_replace PHP function", - "keywords": ["options", "config", "configuration"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.0.2", - "symfony/deprecation-contracts": "^2.1|^3" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -}