Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/updater.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGit'Fellow <carlos@reendex.com>2022-08-20 20:36:22 +0300
committerGitHub <noreply@github.com>2022-08-20 20:36:22 +0300
commitc21fbf269f519a71528db994476421afa480f378 (patch)
tree078537f6fc63d774c03ceeaa6da9860393df22f0
parent0de81a2395ba6e08abf2a21f7e98eda8f592fcf2 (diff)
parent922f0792b15cce73797e7213579e00c6ddd47a97 (diff)
Merge branch 'master' into updateDir
Signed-off-by: Git'Fellow <carlos@reendex.com>
-rw-r--r--.drone.yml213
-rw-r--r--.github/workflows/check-same-code-base.yml34
-rw-r--r--.github/workflows/command-rebase.yml51
-rw-r--r--.github/workflows/lint-php-cs.yml39
-rw-r--r--.github/workflows/lint-php.yml53
-rw-r--r--.github/workflows/test-cli.yml34
-rw-r--r--.github/workflows/test-master.yml46
-rw-r--r--.github/workflows/test-stable.yml52
-rw-r--r--.gitignore2
-rw-r--r--.php-cs-fixer.dist.php19
-rw-r--r--Makefile2
-rw-r--r--composer.json21
-rw-r--r--composer.lock511
-rw-r--r--index.php26
-rw-r--r--lib/CommandApplication.php11
-rw-r--r--lib/RecursiveDirectoryIteratorWithoutData.php2
-rw-r--r--lib/UpdateCommand.php30
-rw-r--r--lib/Updater.php8
-rw-r--r--tests/checkSameCodeBase.php95
-rw-r--r--tests/features/bootstrap/FeatureContext.php356
-rw-r--r--tests/features/master.feature2
-rwxr-xr-xupdater.php2
-rw-r--r--vendor-bin/coding-standard/composer.json11
-rw-r--r--vendor-bin/coding-standard/composer.lock2112
-rw-r--r--vendor/autoload.php2
-rw-r--r--vendor/bamarni/composer-bin-plugin/LICENSE (renamed from vendor/symfony/debug/LICENSE)2
-rw-r--r--vendor/bamarni/composer-bin-plugin/README.md239
-rw-r--r--vendor/bamarni/composer-bin-plugin/composer.json46
-rw-r--r--vendor/bamarni/composer-bin-plugin/src/BinCommand.php186
-rw-r--r--vendor/bamarni/composer-bin-plugin/src/CommandProvider.php16
-rw-r--r--vendor/bamarni/composer-bin-plugin/src/Config.php47
-rw-r--r--vendor/bamarni/composer-bin-plugin/src/Plugin.php130
l---------vendor/bin/php-cs-fixer1
-rw-r--r--vendor/composer/ClassLoader.php155
-rw-r--r--vendor/composer/InstalledVersions.php337
-rw-r--r--vendor/composer/autoload_classmap.php70
-rw-r--r--vendor/composer/autoload_files.php3
-rw-r--r--vendor/composer/autoload_psr4.php7
-rw-r--r--vendor/composer/autoload_real.php29
-rw-r--r--vendor/composer/autoload_static.php111
-rw-r--r--vendor/composer/installed.json521
-rw-r--r--vendor/composer/installed.php101
-rw-r--r--vendor/composer/platform_check.php26
-rw-r--r--vendor/psr/container/.gitignore3
-rw-r--r--vendor/psr/container/LICENSE21
-rw-r--r--vendor/psr/container/README.md13
-rw-r--r--vendor/psr/container/composer.json22
-rw-r--r--vendor/psr/container/src/ContainerExceptionInterface.php12
-rw-r--r--vendor/psr/container/src/ContainerInterface.php36
-rw-r--r--vendor/psr/container/src/NotFoundExceptionInterface.php10
-rw-r--r--vendor/psr/log/.gitignore1
-rw-r--r--vendor/psr/log/Psr/Log/AbstractLogger.php128
-rw-r--r--vendor/psr/log/Psr/Log/InvalidArgumentException.php7
-rw-r--r--vendor/psr/log/Psr/Log/LogLevel.php18
-rw-r--r--vendor/psr/log/Psr/Log/LoggerAwareInterface.php18
-rw-r--r--vendor/psr/log/Psr/Log/LoggerAwareTrait.php26
-rw-r--r--vendor/psr/log/Psr/Log/LoggerInterface.php123
-rw-r--r--vendor/psr/log/Psr/Log/LoggerTrait.php140
-rw-r--r--vendor/psr/log/Psr/Log/NullLogger.php28
-rw-r--r--vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php140
-rw-r--r--vendor/psr/log/README.md45
-rw-r--r--vendor/psr/log/composer.json26
-rw-r--r--vendor/symfony/console/Application.php847
-rw-r--r--vendor/symfony/console/CHANGELOG.md85
-rw-r--r--vendor/symfony/console/Command/Command.php206
-rw-r--r--vendor/symfony/console/Command/HelpCommand.php19
-rw-r--r--vendor/symfony/console/Command/ListCommand.php21
-rw-r--r--vendor/symfony/console/Command/LockableTrait.php69
-rw-r--r--vendor/symfony/console/CommandLoader/CommandLoaderInterface.php46
-rw-r--r--vendor/symfony/console/CommandLoader/ContainerCommandLoader.php63
-rw-r--r--vendor/symfony/console/CommandLoader/FactoryCommandLoader.php62
-rw-r--r--vendor/symfony/console/ConsoleEvents.php20
-rw-r--r--vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php98
-rw-r--r--vendor/symfony/console/Descriptor/ApplicationDescription.php81
-rw-r--r--vendor/symfony/console/Descriptor/Descriptor.php41
-rw-r--r--vendor/symfony/console/Descriptor/DescriptorInterface.php8
-rw-r--r--vendor/symfony/console/Descriptor/JsonDescriptor.php98
-rw-r--r--vendor/symfony/console/Descriptor/MarkdownDescriptor.php91
-rw-r--r--vendor/symfony/console/Descriptor/TextDescriptor.php161
-rw-r--r--vendor/symfony/console/Descriptor/XmlDescriptor.php72
-rw-r--r--vendor/symfony/console/Event/ConsoleCommandEvent.php6
-rw-r--r--vendor/symfony/console/Event/ConsoleErrorEvent.php58
-rw-r--r--vendor/symfony/console/Event/ConsoleEvent.php4
-rw-r--r--vendor/symfony/console/Event/ConsoleExceptionEvent.php67
-rw-r--r--vendor/symfony/console/Event/ConsoleTerminateEvent.php9
-rw-r--r--vendor/symfony/console/EventListener/ErrorListener.php95
-rw-r--r--vendor/symfony/console/Exception/CommandNotFoundException.php12
-rw-r--r--vendor/symfony/console/Exception/ExceptionInterface.php2
-rw-r--r--vendor/symfony/console/Exception/MissingInputException.php21
-rw-r--r--vendor/symfony/console/Exception/NamespaceNotFoundException.php21
-rw-r--r--vendor/symfony/console/Formatter/OutputFormatter.php189
-rw-r--r--vendor/symfony/console/Formatter/OutputFormatterInterface.php5
-rw-r--r--vendor/symfony/console/Formatter/OutputFormatterStyle.php158
-rw-r--r--vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php4
-rw-r--r--vendor/symfony/console/Formatter/OutputFormatterStyleStack.php27
-rw-r--r--vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php25
-rw-r--r--vendor/symfony/console/Helper/DebugFormatterHelper.php13
-rw-r--r--vendor/symfony/console/Helper/DescriptorHelper.php22
-rw-r--r--vendor/symfony/console/Helper/Dumper.php64
-rw-r--r--vendor/symfony/console/Helper/FormatterHelper.php22
-rw-r--r--vendor/symfony/console/Helper/Helper.php65
-rw-r--r--vendor/symfony/console/Helper/HelperInterface.php2
-rw-r--r--vendor/symfony/console/Helper/HelperSet.php19
-rw-r--r--vendor/symfony/console/Helper/InputAwareHelper.php2
-rw-r--r--vendor/symfony/console/Helper/ProcessHelper.php58
-rw-r--r--vendor/symfony/console/Helper/ProgressBar.php401
-rw-r--r--vendor/symfony/console/Helper/ProgressIndicator.php74
-rw-r--r--vendor/symfony/console/Helper/QuestionHelper.php395
-rw-r--r--vendor/symfony/console/Helper/SymfonyQuestionHelper.php40
-rw-r--r--vendor/symfony/console/Helper/Table.php570
-rw-r--r--vendor/symfony/console/Helper/TableCell.php17
-rw-r--r--vendor/symfony/console/Helper/TableRows.php32
-rw-r--r--vendor/symfony/console/Helper/TableSeparator.php5
-rw-r--r--vendor/symfony/console/Helper/TableStyle.php246
-rw-r--r--vendor/symfony/console/Input/ArgvInput.php121
-rw-r--r--vendor/symfony/console/Input/ArrayInput.php69
-rw-r--r--vendor/symfony/console/Input/Input.php49
-rw-r--r--vendor/symfony/console/Input/InputArgument.php30
-rw-r--r--vendor/symfony/console/Input/InputAwareInterface.php2
-rw-r--r--vendor/symfony/console/Input/InputDefinition.php86
-rw-r--r--vendor/symfony/console/Input/InputInterface.php30
-rw-r--r--vendor/symfony/console/Input/InputOption.php61
-rw-r--r--vendor/symfony/console/Input/StreamableInputInterface.php37
-rw-r--r--vendor/symfony/console/Input/StringInput.php56
-rw-r--r--vendor/symfony/console/LICENSE2
-rw-r--r--vendor/symfony/console/Logger/ConsoleLogger.php89
-rw-r--r--vendor/symfony/console/Output/BufferedOutput.php5
-rw-r--r--vendor/symfony/console/Output/ConsoleOutput.php45
-rw-r--r--vendor/symfony/console/Output/ConsoleOutputInterface.php9
-rw-r--r--vendor/symfony/console/Output/ConsoleSectionOutput.php143
-rw-r--r--vendor/symfony/console/Output/Output.php14
-rw-r--r--vendor/symfony/console/Output/OutputInterface.php31
-rw-r--r--vendor/symfony/console/Output/StreamOutput.php52
-rw-r--r--vendor/symfony/console/Output/TrimmedBufferOutput.php63
-rw-r--r--vendor/symfony/console/Question/ChoiceQuestion.php45
-rw-r--r--vendor/symfony/console/Question/ConfirmationQuestion.php14
-rw-r--r--vendor/symfony/console/Question/Question.php116
-rw-r--r--vendor/symfony/console/README.md10
-rw-r--r--vendor/symfony/console/Style/OutputStyle.php15
-rw-r--r--vendor/symfony/console/Style/StyleInterface.php12
-rw-r--r--vendor/symfony/console/Style/SymfonyStyle.php195
-rw-r--r--vendor/symfony/console/Terminal.php174
-rw-r--r--vendor/symfony/console/Tester/ApplicationTester.php146
-rw-r--r--vendor/symfony/console/Tester/CommandTester.php86
-rw-r--r--vendor/symfony/console/Tester/TesterTrait.php180
-rw-r--r--vendor/symfony/console/composer.json36
-rw-r--r--vendor/symfony/console/phpunit.xml.dist39
-rw-r--r--vendor/symfony/debug/BufferingLogger.php37
-rw-r--r--vendor/symfony/debug/CHANGELOG.md47
-rw-r--r--vendor/symfony/debug/Debug.php63
-rw-r--r--vendor/symfony/debug/DebugClassLoader.php314
-rw-r--r--vendor/symfony/debug/ErrorHandler.php666
-rw-r--r--vendor/symfony/debug/Exception/ClassNotFoundException.php33
-rw-r--r--vendor/symfony/debug/Exception/ContextErrorException.php36
-rw-r--r--vendor/symfony/debug/Exception/FatalErrorException.php82
-rw-r--r--vendor/symfony/debug/Exception/FatalThrowableError.php44
-rw-r--r--vendor/symfony/debug/Exception/FlattenException.php256
-rw-r--r--vendor/symfony/debug/Exception/UndefinedFunctionException.php33
-rw-r--r--vendor/symfony/debug/Exception/UndefinedMethodException.php33
-rw-r--r--vendor/symfony/debug/ExceptionHandler.php415
-rw-r--r--vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php206
-rw-r--r--vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php32
-rw-r--r--vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php84
-rw-r--r--vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php60
-rw-r--r--vendor/symfony/debug/README.md13
-rw-r--r--vendor/symfony/debug/Resources/ext/README.md134
-rw-r--r--vendor/symfony/debug/Resources/ext/config.m463
-rw-r--r--vendor/symfony/debug/Resources/ext/config.w3213
-rw-r--r--vendor/symfony/debug/Resources/ext/php_symfony_debug.h60
-rw-r--r--vendor/symfony/debug/Resources/ext/symfony_debug.c283
-rw-r--r--vendor/symfony/debug/Resources/ext/tests/001.phpt151
-rw-r--r--vendor/symfony/debug/Resources/ext/tests/002.phpt64
-rw-r--r--vendor/symfony/debug/Resources/ext/tests/002_1.phpt47
-rw-r--r--vendor/symfony/debug/Resources/ext/tests/003.phpt85
-rw-r--r--vendor/symfony/debug/composer.json41
-rw-r--r--vendor/symfony/debug/phpunit.xml.dist31
-rw-r--r--vendor/symfony/deprecation-contracts/.gitignore (renamed from vendor/symfony/console/.gitignore)0
-rw-r--r--vendor/symfony/deprecation-contracts/CHANGELOG.md5
-rw-r--r--vendor/symfony/deprecation-contracts/LICENSE (renamed from vendor/psr/log/LICENSE)16
-rw-r--r--vendor/symfony/deprecation-contracts/README.md26
-rw-r--r--vendor/symfony/deprecation-contracts/composer.json35
-rw-r--r--vendor/symfony/deprecation-contracts/function.php27
-rw-r--r--vendor/symfony/polyfill-mbstring/LICENSE2
-rw-r--r--vendor/symfony/polyfill-mbstring/Mbstring.php415
-rw-r--r--vendor/symfony/polyfill-mbstring/README.md4
-rw-r--r--vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php310
-rw-r--r--vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php5
-rw-r--r--vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php446
-rw-r--r--vendor/symfony/polyfill-mbstring/bootstrap.php162
-rw-r--r--vendor/symfony/polyfill-mbstring/bootstrap80.php143
-rw-r--r--vendor/symfony/polyfill-mbstring/composer.json11
-rw-r--r--vendor/symfony/polyfill-php73/LICENSE19
-rw-r--r--vendor/symfony/polyfill-php73/Php73.php43
-rw-r--r--vendor/symfony/polyfill-php73/README.md18
-rw-r--r--vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php (renamed from vendor/symfony/debug/Exception/OutOfMemoryException.php)13
-rw-r--r--vendor/symfony/polyfill-php73/bootstrap.php31
-rw-r--r--vendor/symfony/polyfill-php73/composer.json36
-rw-r--r--vendor/symfony/polyfill-php80/LICENSE19
-rw-r--r--vendor/symfony/polyfill-php80/Php80.php115
-rw-r--r--vendor/symfony/polyfill-php80/PhpToken.php103
-rw-r--r--vendor/symfony/polyfill-php80/README.md25
-rw-r--r--vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php22
-rw-r--r--vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php7
-rw-r--r--vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php11
-rw-r--r--vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php7
-rw-r--r--vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php7
-rw-r--r--vendor/symfony/polyfill-php80/bootstrap.php42
-rw-r--r--vendor/symfony/polyfill-php80/composer.json40
-rw-r--r--vendor/symfony/service-contracts/.gitignore (renamed from vendor/symfony/debug/.gitignore)0
-rw-r--r--vendor/symfony/service-contracts/Attribute/Required.php25
-rw-r--r--vendor/symfony/service-contracts/Attribute/SubscribedService.php33
-rw-r--r--vendor/symfony/service-contracts/CHANGELOG.md5
-rw-r--r--vendor/symfony/service-contracts/LICENSE19
-rw-r--r--vendor/symfony/service-contracts/README.md9
-rw-r--r--vendor/symfony/service-contracts/ResetInterface.php30
-rw-r--r--vendor/symfony/service-contracts/ServiceLocatorTrait.php128
-rw-r--r--vendor/symfony/service-contracts/ServiceProviderInterface.php36
-rw-r--r--vendor/symfony/service-contracts/ServiceSubscriberInterface.php53
-rw-r--r--vendor/symfony/service-contracts/ServiceSubscriberTrait.php109
-rw-r--r--vendor/symfony/service-contracts/Test/ServiceLocatorTest.php95
-rw-r--r--vendor/symfony/service-contracts/composer.json42
221 files changed, 11953 insertions, 7700 deletions
diff --git a/.drone.yml b/.drone.yml
deleted file mode 100644
index 9c6405d..0000000
--- a/.drone.yml
+++ /dev/null
@@ -1,213 +0,0 @@
-kind: pipeline
-name: check-same-code-base
-
-steps:
- - name: check-same-code-base
- image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
- commands:
- - make check-same-code-base
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php73-cli
-
-steps:
- - name: php73-cli
- image: ghcr.io/nextcloud/continuous-integration-php7.3:latest
- commands:
- - make test-cli
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php74-cli
-
-steps:
- - name: php74-cli
- image: ghcr.io/nextcloud/continuous-integration-php7.4:latest
- commands:
- - make test-cli
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
----
-kind: pipeline
-name: php73-stable19
-
-steps:
- - name: php73-stable19
- image: ghcr.io/nextcloud/continuous-integration-php7.3:latest
- commands:
- - make test-stable19
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php74-stable19
-
-steps:
- - name: php74-stable19
- image: ghcr.io/nextcloud/continuous-integration-php7.4:latest
- commands:
- - make test-stable19
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php73-stable20
-
-steps:
- - name: php73-stable20
- image: ghcr.io/nextcloud/continuous-integration-php7.3:latest
- commands:
- - make test-stable20
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php74-stable20
-
-steps:
- - name: php74-stable20
- image: ghcr.io/nextcloud/continuous-integration-php7.4:latest
- commands:
- - make test-stable20
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php73-stable21
-
-steps:
- - name: php73-stable21
- image: ghcr.io/nextcloud/continuous-integration-php7.3:latest
- commands:
- - make test-stable21
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php74-stable21
-
-steps:
- - name: php74-stable21
- image: ghcr.io/nextcloud/continuous-integration-php7.4:latest
- commands:
- - make test-stable21
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php80-stable21
-
-steps:
- - name: php80-stable21
- image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
- commands:
- - make test-stable21
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php74-master
-
-steps:
- - name: php74-master
- image: ghcr.io/nextcloud/continuous-integration-php7.4:latest
- commands:
- - make test-master
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
-
----
-kind: pipeline
-name: php80-master
-
-steps:
- - name: php80-master
- image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
- commands:
- - make test-master
-
-trigger:
- branch:
- - master
- - stable*
- event:
- - pull_request
- - push
diff --git a/.github/workflows/check-same-code-base.yml b/.github/workflows/check-same-code-base.yml
new file mode 100644
index 0000000..4cf592d
--- /dev/null
+++ b/.github/workflows/check-same-code-base.yml
@@ -0,0 +1,34 @@
+name: Check same code base
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - stable*
+
+permissions:
+ contents: read
+
+jobs:
+ php-lint:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-versions: ["8.0"]
+
+ name: check-same-code-base
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ coverage: none
+
+ - name: check-same-code-base
+ run: make check-same-code-base
diff --git a/.github/workflows/command-rebase.yml b/.github/workflows/command-rebase.yml
new file mode 100644
index 0000000..78fcf5d
--- /dev/null
+++ b/.github/workflows/command-rebase.yml
@@ -0,0 +1,51 @@
+# This workflow is provided via the organization template repository
+#
+# https://github.com/nextcloud/.github
+# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+
+name: Rebase command
+
+on:
+ issue_comment:
+ types: created
+
+permissions:
+ contents: read
+
+jobs:
+ rebase:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: none
+
+ # On pull requests and if the comment starts with `/rebase`
+ if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase')
+
+ steps:
+ - name: Add reaction on start
+ uses: peter-evans/create-or-update-comment@v2
+ with:
+ token: ${{ secrets.COMMAND_BOT_PAT }}
+ repository: ${{ github.event.repository.full_name }}
+ comment-id: ${{ github.event.comment.id }}
+ reaction-type: "+1"
+
+ - name: Checkout the latest code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ token: ${{ secrets.COMMAND_BOT_PAT }}
+
+ - name: Automatic Rebase
+ uses: cirrus-actions/rebase@1.7
+ env:
+ GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
+
+ - name: Add reaction on failure
+ uses: peter-evans/create-or-update-comment@v2
+ if: failure()
+ with:
+ token: ${{ secrets.COMMAND_BOT_PAT }}
+ repository: ${{ github.event.repository.full_name }}
+ comment-id: ${{ github.event.comment.id }}
+ reaction-type: "-1"
diff --git a/.github/workflows/lint-php-cs.yml b/.github/workflows/lint-php-cs.yml
new file mode 100644
index 0000000..eb236b7
--- /dev/null
+++ b/.github/workflows/lint-php-cs.yml
@@ -0,0 +1,39 @@
+# This workflow is provided via the organization template repository
+#
+# https://github.com/nextcloud/.github
+# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+
+name: Lint
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - stable*
+
+permissions:
+ contents: read
+
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+
+ name: php-cs
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: "7.4"
+ coverage: none
+
+ - name: Install dependencies
+ run: composer i
+
+ - name: Lint
+ run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml
new file mode 100644
index 0000000..d089d1b
--- /dev/null
+++ b/.github/workflows/lint-php.yml
@@ -0,0 +1,53 @@
+# This workflow is provided via the organization template repository
+#
+# https://github.com/nextcloud/.github
+# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
+
+name: Lint
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - stable*
+
+permissions:
+ contents: read
+
+jobs:
+ php-lint:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-versions: ["7.4", "8.0", "8.1"]
+
+ name: php-lint
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ coverage: none
+
+ - name: Lint
+ run: composer run lint
+
+ summary:
+ permissions:
+ contents: none
+ runs-on: ubuntu-latest
+ needs: php-lint
+
+ if: always()
+
+ name: php-lint-summary
+
+ steps:
+ - name: Summary status
+ run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
diff --git a/.github/workflows/test-cli.yml b/.github/workflows/test-cli.yml
new file mode 100644
index 0000000..f3b2657
--- /dev/null
+++ b/.github/workflows/test-cli.yml
@@ -0,0 +1,34 @@
+name: Test cli
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - stable*
+
+permissions:
+ contents: read
+
+jobs:
+ php-lint:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-versions: ["7.4"]
+
+ name: test-cli
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ coverage: none
+
+ - name: test-cli
+ run: make test-cli
diff --git a/.github/workflows/test-master.yml b/.github/workflows/test-master.yml
new file mode 100644
index 0000000..30b8814
--- /dev/null
+++ b/.github/workflows/test-master.yml
@@ -0,0 +1,46 @@
+name: Test master
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - stable*
+
+permissions:
+ contents: read
+
+jobs:
+ test-master:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-versions: ["7.4", "8.0", "8.1"]
+
+ name: test-master
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ coverage: none
+
+ - name: test-master
+ run: make test-master
+
+ summary:
+ runs-on: ubuntu-latest
+ needs: test-master
+
+ if: always()
+
+ name: test-master-summary
+
+ steps:
+ - name: Summary status
+ run: if ${{ needs.test-master.result != 'success' }}; then exit 1; fi
diff --git a/.github/workflows/test-stable.yml b/.github/workflows/test-stable.yml
new file mode 100644
index 0000000..f77d183
--- /dev/null
+++ b/.github/workflows/test-stable.yml
@@ -0,0 +1,52 @@
+name: Test stable
+
+on:
+ pull_request:
+ push:
+ branches:
+ - main
+ - master
+ - stable*
+
+permissions:
+ contents: read
+
+jobs:
+ test-stable:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-versions: ["7.4", "8.0"]
+ nextcloud-versions: ["19", "20", "21"]
+ exclude:
+ - php-versions: "8.0"
+ nextcloud-versions: "19"
+ - php-versions: "8.0"
+ nextcloud-versions: "20"
+
+ name: test-stable
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Set up php ${{ matrix.php-versions }}
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-versions }}
+ coverage: none
+
+ - name: test-stable${{ matrix.nextcloud-versions }}
+ run: make test-stable${{ matrix.nextcloud-versions }}
+
+ summary:
+ runs-on: ubuntu-latest
+ needs: test-stable
+
+ if: always()
+
+ name: test-stable-summary
+
+ steps:
+ - name: Summary status
+ run: if ${{ needs.test-stable.result != 'success' }}; then exit 1; fi
diff --git a/.gitignore b/.gitignore
index 96a4bdf..f7ead8c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,4 @@ tests/data
tests/vendor
vendor/symfony/console/Tests
vendor/symfony/debug/Tests
-
+/vendor-bin/**/vendor \ No newline at end of file
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..135545a
--- /dev/null
+++ b/.php-cs-fixer.dist.php
@@ -0,0 +1,19 @@
+<?php
+
+declare(strict_types=1);
+
+require_once './vendor/autoload.php';
+
+use Nextcloud\CodingStandard\Config;
+
+$config = new Config();
+$config
+ ->getFinder()
+ ->notPath('build')
+ ->notPath('l10n')
+ ->notPath('src')
+ ->notPath('vendor')
+ ->notPath('vendor-bin')
+ ->notPath('node_modules')
+ ->in(__DIR__);
+return $config;
diff --git a/Makefile b/Makefile
index ff92142..6f6de78 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ box:
updater.phar: box updater.php lib/*.php buildVersionFile.php
php buildVersionFile.php
composer dump-autoload
- ./box build -c box.json
+ ./box compile -c box.json
chmod +x updater.phar
rm lib/Version.php
diff --git a/composer.json b/composer.json
index 10b2f87..9068302 100644
--- a/composer.json
+++ b/composer.json
@@ -5,10 +5,27 @@
}
},
"config": {
+ "allow-plugins": {
+ "bamarni/composer-bin-plugin": true
+ },
+ "classmap-authoritative": true,
"optimize-autoloader": true,
- "classmap-authoritative": true
+ "platform": {
+ "php": "7.4"
+ },
+ "sort-packages": true
},
"require": {
- "symfony/console": "^3.1"
+ "symfony/console": "^4.4"
+ },
+ "scripts": {
+ "cs:check": "php-cs-fixer fix --dry-run --diff",
+ "cs:fix": "php-cs-fixer fix",
+ "lint": "find . -name \\*.php -not -path './vendor*' -not -path './build/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l",
+ "post-install-cmd": ["@composer bin all install --ansi"],
+ "post-update-cmd": ["@composer bin all update --ansi"]
+ },
+ "require-dev": {
+ "bamarni/composer-bin-plugin": "^1.5"
}
}
diff --git a/composer.lock b/composer.lock
index 6ec278b..a2cc241 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1,38 +1,32 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "hash": "489973e863a86950adf5f6f80f6e0bec",
- "content-hash": "aa14a3132a5656628d30fdd0b7292318",
+ "content-hash": "41e003a0aea3705ba595ca045d13224e",
"packages": [
{
- "name": "psr/log",
- "version": "1.0.2",
+ "name": "psr/container",
+ "version": "1.1.2",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "php": ">=7.4.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -42,53 +36,71 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
"keywords": [
- "log",
- "psr",
- "psr-3"
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
],
- "time": "2016-10-10 12:19:37"
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/1.1.2"
+ },
+ "time": "2021-11-05T16:50:12+00:00"
},
{
"name": "symfony/console",
- "version": "v3.1.6",
+ "version": "v4.4.43",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065"
+ "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/c99da1119ae61e15de0e4829196b9fba6f73d065",
- "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065",
+ "url": "https://api.github.com/repos/symfony/console/zipball/8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
+ "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "symfony/debug": "~2.8|~3.0",
- "symfony/polyfill-mbstring": "~1.0"
+ "php": ">=7.1.3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php73": "^1.8",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2"
+ },
+ "conflict": {
+ "psr/log": ">=3",
+ "symfony/dependency-injection": "<3.4",
+ "symfony/event-dispatcher": "<4.3|>=5",
+ "symfony/lock": "<4.4",
+ "symfony/process": "<3.3"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/event-dispatcher": "~2.8|~3.0",
- "symfony/process": "~2.8|~3.0"
+ "psr/log": "^1|^2",
+ "symfony/config": "^3.4|^4.0|^5.0",
+ "symfony/dependency-injection": "^3.4|^4.0|^5.0",
+ "symfony/event-dispatcher": "^4.3",
+ "symfony/lock": "^4.4|^5.0",
+ "symfony/process": "^3.4|^4.0|^5.0",
+ "symfony/var-dumper": "^4.3|^5.0"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
+ "symfony/lock": "",
"symfony/process": ""
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
- },
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
@@ -111,47 +123,57 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Console Component",
+ "description": "Eases the creation of beautiful and testable command line interfaces",
"homepage": "https://symfony.com",
- "time": "2016-10-06 01:44:51"
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v4.4.43"
+ },
+ "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-06-23T12:22:25+00:00"
},
{
- "name": "symfony/debug",
- "version": "v3.1.6",
+ "name": "symfony/deprecation-contracts",
+ "version": "v2.5.2",
"source": {
"type": "git",
- "url": "https://github.com/symfony/debug.git",
- "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8"
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/e2b3f74a67fc928adc3c1b9027f73e1bc01190a8",
- "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "psr/log": "~1.0"
- },
- "conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
- },
- "require-dev": {
- "symfony/class-loader": "~2.8|~3.0",
- "symfony/http-kernel": "~2.8|~3.0"
+ "php": ">=7.1"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Component\\Debug\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
+ "files": [
+ "function.php"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -160,34 +182,54 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Debug Component",
+ "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
- "time": "2016-09-06 11:02:40"
+ "support": {
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
+ },
+ "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:53:40+00:00"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.2.0",
+ "version": "v1.26.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "dff51f72b0706335131b00a7f49606168c582594"
+ "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
- "reference": "dff51f72b0706335131b00a7f49606168c582594",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-mbstring": "*"
},
"suggest": {
"ext-mbstring": "For best performance"
@@ -195,15 +237,99 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ },
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php73",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php73.git",
+ "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
+ "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
},
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
"files": [
"bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php73\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -220,24 +346,257 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for the Mbstring extension",
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
- "mbstring",
"polyfill",
"portable",
"shim"
],
- "time": "2016-05-18 14:26:46"
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0"
+ },
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php80",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+ "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
+ },
+ "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-05-10T07:21:04+00:00"
+ },
+ {
+ "name": "symfony/service-contracts",
+ "version": "v2.5.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/service-contracts.git",
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/container": "^1.1",
+ "symfony/deprecation-contracts": "^2.1|^3"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
+ },
+ "suggest": {
+ "symfony/service-implementation": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\Service\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to writing services",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/service-contracts/tree/v2.5.2"
+ },
+ "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-05-30T19:17:29+00:00"
+ }
+ ],
+ "packages-dev": [
+ {
+ "name": "bamarni/composer-bin-plugin",
+ "version": "v1.5.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/bamarni/composer-bin-plugin.git",
+ "reference": "49934ffea764864788334c1485fbb08a4b852031"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/49934ffea764864788334c1485fbb08a4b852031",
+ "reference": "49934ffea764864788334c1485fbb08a4b852031",
+ "shasum": ""
+ },
+ "require": {
+ "composer-plugin-api": "^1.0 || ^2.0",
+ "php": "^5.5.9 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "composer/composer": "^1.0 || ^2.0",
+ "symfony/console": "^2.5 || ^3.0 || ^4.0"
+ },
+ "type": "composer-plugin",
+ "extra": {
+ "class": "Bamarni\\Composer\\Bin\\Plugin"
+ },
+ "autoload": {
+ "psr-4": {
+ "Bamarni\\Composer\\Bin\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "No conflicts for your bin dependencies",
+ "keywords": [
+ "composer",
+ "conflict",
+ "dependency",
+ "executable",
+ "isolation",
+ "tool"
+ ],
+ "time": "2022-02-22T21:01:25+00:00"
}
],
- "packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
- "platform-dev": []
+ "platform-dev": [],
+ "platform-overrides": {
+ "php": "7.4"
+ },
+ "plugin-api-version": "1.1.0"
}
diff --git a/index.php b/index.php
index 92c7f2d..a0a5eda 100644
--- a/index.php
+++ b/index.php
@@ -37,7 +37,7 @@ class LogException extends \Exception {
}
class RecursiveDirectoryIteratorWithoutData extends \RecursiveFilterIterator {
- public function accept() {
+ public function accept(): bool {
/** @var \DirectoryIterator $this */
$excludes = [
'.rnd',
@@ -60,7 +60,7 @@ class Auth {
* @param string $password
*/
public function __construct(Updater $updater,
- $password) {
+ $password) {
$this->updater = $updater;
$this->password = $password;
}
@@ -635,6 +635,7 @@ class Updater {
$this->silentLog('[info] downloadUpdate()');
$response = $this->getUpdateServerResponse();
+
$storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/';
if (file_exists($storageLocation)) {
$this->silentLog('[info] storage location exists');
@@ -707,7 +708,7 @@ class Updater {
$this->silentLog('[info] storage location: ' . $storageLocation);
$filesInStorageLocation = scandir($storageLocation);
- $files = array_values(array_filter($filesInStorageLocation, function($path){
+ $files = array_values(array_filter($filesInStorageLocation, function ($path) {
return $path !== '.' && $path !== '..';
}));
// only the downloaded archive
@@ -850,7 +851,7 @@ EOF;
];
$content = "<?php\nhttp_response_code(503);\ndie('Update in process.');";
- foreach($filesToReplace as $file) {
+ foreach ($filesToReplace as $file) {
$this->silentLog('[info] replace ' . $file);
$parentDir = dirname($this->baseDir . '/../' . $file);
if (!file_exists($parentDir)) {
@@ -933,7 +934,7 @@ EOF;
json_decode(file_get_contents($shippedAppsFile), true)['shippedApps'],
json_decode(file_get_contents($newShippedAppsFile), true)['shippedApps']
);
- foreach($shippedApps as $app) {
+ foreach ($shippedApps as $app) {
$this->recursiveDelete($this->baseDir . '/../apps/' . $app);
}
@@ -1104,6 +1105,7 @@ EOF;
if ($state === false) {
throw new \Exception('Could not rmdir $storagelocation');
}
+
$state = unlink($this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/.step');
if ($state === false) {
throw new \Exception('Could not rmdir .step');
@@ -1244,7 +1246,7 @@ EOF;
throw new LogException('Could not open updater.log');
}
- if($this->requestID === null) {
+ if ($this->requestID === null) {
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
@@ -1332,9 +1334,9 @@ if ($currentStep !== []) {
if ($stepState === 'start') {
die(
- sprintf(
- 'Step %s is currently in process. Please reload this page later.',
- $stepNumber
+ sprintf(
+ 'Step %s is currently in process. Please reload this page later.',
+ $stepNumber
)
);
}
@@ -1739,12 +1741,11 @@ if (strpos($updaterUrl, 'index.php') === false) {
$buttonText = 'Start update';
if ($stepNumber > 0) {
$buttonText = 'Continue update';
- }
- ?>
+ } ?>
<button id="startUpdateButton"><?php echo $buttonText ?></button>
<?php
}
- ?>
+ ?>
<button id="retryUpdateButton" class="hidden">Retry update</button>
</div>
</li>
@@ -1826,6 +1827,7 @@ if (strpos($updaterUrl, 'index.php') === false) {
</div>
</body>
+
<?php if ($auth->isAuthenticated()) : ?>
<script>
function escapeHTML(s) {
diff --git a/lib/CommandApplication.php b/lib/CommandApplication.php
index 94e2175..e79e6fd 100644
--- a/lib/CommandApplication.php
+++ b/lib/CommandApplication.php
@@ -39,8 +39,7 @@ class CommandApplication extends Application {
*
* @return string The command name
*/
- protected function getCommandName(InputInterface $input)
- {
+ protected function getCommandName(InputInterface $input) {
// This should return the name of your command.
return 'update';
}
@@ -50,8 +49,7 @@ class CommandApplication extends Application {
*
* @return array An array of default Command instances
*/
- protected function getDefaultCommands()
- {
+ protected function getDefaultCommands() {
// Keep the core default commands to have the HelpCommand
// which is used when using the --help option
$defaultCommands = parent::getDefaultCommands();
@@ -65,12 +63,11 @@ class CommandApplication extends Application {
* Overridden so that the application doesn't expect the command
* name to be the first argument.
*/
- public function getDefinition()
- {
+ public function getDefinition() {
$inputDefinition = parent::getDefinition();
// clear out the normal first argument, which is the command name
$inputDefinition->setArguments();
return $inputDefinition;
}
-} \ No newline at end of file
+}
diff --git a/lib/RecursiveDirectoryIteratorWithoutData.php b/lib/RecursiveDirectoryIteratorWithoutData.php
index 4dc8b22..55298bc 100644
--- a/lib/RecursiveDirectoryIteratorWithoutData.php
+++ b/lib/RecursiveDirectoryIteratorWithoutData.php
@@ -23,7 +23,7 @@
namespace NC\Updater;
class RecursiveDirectoryIteratorWithoutData extends \RecursiveFilterIterator {
- public function accept() {
+ public function accept(): bool {
/** @var \DirectoryIterator $this */
$excludes = [
'.rnd',
diff --git a/lib/UpdateCommand.php b/lib/UpdateCommand.php
index 63765e3..384e91e 100644
--- a/lib/UpdateCommand.php
+++ b/lib/UpdateCommand.php
@@ -23,7 +23,6 @@
namespace NC\Updater;
use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -96,7 +95,7 @@ class UpdateCommand extends Command {
return -1;
}
- if($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
+ if ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
$configFileName = rtrim($dir, '/') . '/config.php';
} else {
$configFileName = $path . '/../config/config.php';
@@ -123,12 +122,12 @@ class UpdateCommand extends Command {
// Check if already a step is in process
$currentStep = $this->updater->currentStep();
$stepNumber = 0;
- if($currentStep !== []) {
+ if ($currentStep !== []) {
$stepState = $currentStep['state'];
$stepNumber = $currentStep['step'];
$this->updater->log('[info] Step ' . $stepNumber . ' is in state "' . $stepState . '".');
- if($stepState === 'start') {
+ if ($stepState === 'start') {
$output->writeln(
sprintf(
'Step %s is currently in process. Please call this command later.',
@@ -157,7 +156,7 @@ class UpdateCommand extends Command {
$output->writeln('');
- if(!$this->updater->updateAvailable() && $stepNumber === 0) {
+ if (!$this->updater->updateAvailable() && $stepNumber === 0) {
$output->writeln('Nothing to do.');
return 0;
}
@@ -168,7 +167,6 @@ class UpdateCommand extends Command {
}
if ($input->isInteractive()) {
-
$this->showCurrentStatus($output, $stepNumber);
$output->writeln('');
@@ -191,7 +189,7 @@ class UpdateCommand extends Command {
$output->writeln('');
- if(function_exists('pcntl_signal')) {
+ if (function_exists('pcntl_signal')) {
// being able to handle stop/terminate command (Ctrl - C)
pcntl_signal(SIGTERM, [$this, 'stopCommand']);
pcntl_signal(SIGINT, [$this, 'stopCommand']);
@@ -204,7 +202,7 @@ class UpdateCommand extends Command {
}
// print already executed steps
- for($i = 1; $i <= $stepNumber; $i++) {
+ for ($i = 1; $i <= $stepNumber; $i++) {
if ($i === 11) {
// no need to ask for maintenance mode on CLI - skip it
continue;
@@ -223,7 +221,7 @@ class UpdateCommand extends Command {
if (function_exists('pcntl_signal_dispatch')) {
pcntl_signal_dispatch();
- if ( $this->shouldStop ) {
+ if ($this->shouldStop) {
break;
}
}
@@ -244,7 +242,7 @@ class UpdateCommand extends Command {
$output->writeln('<error>[✘] ' . $this->checkTexts[$i] . ' failed</error>');
if ($i === 1) {
- if(is_string($result['response'])) {
+ if (is_string($result['response'])) {
$output->writeln('<error>' . $result['response'] . '</error>');
} else {
$output->writeln('<error>The following extra files have been found:</error>');
@@ -253,7 +251,7 @@ class UpdateCommand extends Command {
}
}
} elseif ($i === 2) {
- if(is_string($result['response'])) {
+ if (is_string($result['response'])) {
$output->writeln('<error>' . $result['response'] . '</error>');
} else {
$output->writeln('<error>The following places can not be written to:</error>');
@@ -278,7 +276,6 @@ class UpdateCommand extends Command {
$output->writeln('Update of code successful.');
if ($input->isInteractive()) {
-
$output->writeln('');
$helper = $this->getHelper('question');
@@ -301,7 +298,6 @@ class UpdateCommand extends Command {
$output->writeln('');
if ($input->isInteractive()) {
-
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion($this->checkTexts[11] . ' [y/N] ', false);
@@ -336,16 +332,16 @@ class UpdateCommand extends Command {
}
return -1;
}
- }
+ }
/**
* @param $step integer
* @return array with options 'proceed' which is a boolean and defines if the step succeeded and an optional 'response' string
*/
- protected function executeStep($step) {
+ protected function executeStep($step) {
$this->updater->log('[info] executeStep request for step "' . $step . '"');
try {
- if($step > 12 || $step < 1) {
+ if ($step > 12 || $step < 1) {
throw new \Exception('Invalid step');
}
@@ -447,6 +443,4 @@ class UpdateCommand extends Command {
public function stopCommand() {
$this->shouldStop = true;
}
-
-
}
diff --git a/lib/Updater.php b/lib/Updater.php
index 7ede201..a359003 100644
--- a/lib/Updater.php
+++ b/lib/Updater.php
@@ -518,6 +518,7 @@ class Updater {
$this->silentLog('[info] downloadUpdate()');
$response = $this->getUpdateServerResponse();
+
$storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/downloads/';
if (file_exists($storageLocation)) {
$this->silentLog('[info] storage location exists');
@@ -590,7 +591,7 @@ class Updater {
$this->silentLog('[info] storage location: ' . $storageLocation);
$filesInStorageLocation = scandir($storageLocation);
- $files = array_values(array_filter($filesInStorageLocation, function($path){
+ $files = array_values(array_filter($filesInStorageLocation, function ($path) {
return $path !== '.' && $path !== '..';
}));
// only the downloaded archive
@@ -733,7 +734,7 @@ EOF;
];
$content = "<?php\nhttp_response_code(503);\ndie('Update in process.');";
- foreach($filesToReplace as $file) {
+ foreach ($filesToReplace as $file) {
$this->silentLog('[info] replace ' . $file);
$parentDir = dirname($this->baseDir . '/../' . $file);
if (!file_exists($parentDir)) {
@@ -816,7 +817,7 @@ EOF;
json_decode(file_get_contents($shippedAppsFile), true)['shippedApps'],
json_decode(file_get_contents($newShippedAppsFile), true)['shippedApps']
);
- foreach($shippedApps as $app) {
+ foreach ($shippedApps as $app) {
$this->recursiveDelete($this->baseDir . '/../apps/' . $app);
}
@@ -987,6 +988,7 @@ EOF;
if ($state === false) {
throw new \Exception('Could not rmdir $storagelocation');
}
+
$state = unlink($this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid') . '/.step');
if ($state === false) {
throw new \Exception('Could not rmdir .step');
diff --git a/tests/checkSameCodeBase.php b/tests/checkSameCodeBase.php
index 7fd95cc..0f8f4c4 100644
--- a/tests/checkSameCodeBase.php
+++ b/tests/checkSameCodeBase.php
@@ -11,69 +11,68 @@ $libDir = __DIR__ . '/../lib/';
$indexPhpContent = file_get_contents(__DIR__ . '/../index.php');
function findDiffPos($original, $copy) {
- $lowerLimit = 0;
- $upperLimit = strlen($copy) - 1;
-
- do {
- $index = $lowerLimit + round(($upperLimit - $lowerLimit)/2);
-
- $partOfCopy = substr($copy, 0, $index);
- if(strpos($original, $partOfCopy) === false) {
- $upperLimit = $index;
- } else {
- $lowerLimit = $index;
- }
- } while ($upperLimit - $lowerLimit > 5);
-
- $matchingSubstring = substr($copy, 0, $lowerLimit);
- if(strlen($matchingSubstring) <= 20) {
- $originalStart = 0;
- $copyStart = 0;
- } else {
- $originalStart = strpos($original, $matchingSubstring) + strlen($matchingSubstring) - 20;
- $copyStart = strlen($matchingSubstring) - 20;
- }
- $stringOriginal = substr($original, $originalStart, 40);
- $stringCopy = substr($copy, $copyStart, 40);
-
- echo "diff is in here: (between character $lowerLimit and $upperLimit):" . PHP_EOL;
- echo '...' . $stringOriginal . '...' . PHP_EOL;
- echo '...' . $stringCopy . '...' . PHP_EOL;
+ $lowerLimit = 0;
+ $upperLimit = strlen($copy) - 1;
+
+ do {
+ $index = $lowerLimit + round(($upperLimit - $lowerLimit) / 2);
+
+ $partOfCopy = substr($copy, 0, $index);
+ if (strpos($original, $partOfCopy) === false) {
+ $upperLimit = $index;
+ } else {
+ $lowerLimit = $index;
+ }
+ } while ($upperLimit - $lowerLimit > 5);
+
+ $matchingSubstring = substr($copy, 0, $lowerLimit);
+ if (strlen($matchingSubstring) <= 20) {
+ $originalStart = 0;
+ $copyStart = 0;
+ } else {
+ $originalStart = strpos($original, $matchingSubstring) + strlen($matchingSubstring) - 20;
+ $copyStart = strlen($matchingSubstring) - 20;
+ }
+ $stringOriginal = substr($original, $originalStart, 40);
+ $stringCopy = substr($copy, $copyStart, 40);
+
+ echo "diff is in here: (between character $lowerLimit and $upperLimit):" . PHP_EOL;
+ echo '...' . $stringOriginal . '...' . PHP_EOL;
+ echo '...' . $stringCopy . '...' . PHP_EOL;
}
$iterator = new \RecursiveDirectoryIterator(
- $libDir,
- \RecursiveDirectoryIterator::SKIP_DOTS
+ $libDir,
+ \RecursiveDirectoryIterator::SKIP_DOTS
);
/**
* @var string $path
* @var SplFileInfo $fileInfo
*/
foreach ($iterator as $path => $fileInfo) {
- $fileName = explode($libDir, $path)[1];
+ $fileName = explode($libDir, $path)[1];
- if(array_search($fileName, $excludedFiles) !== false) {
- continue;
- }
+ if (array_search($fileName, $excludedFiles) !== false) {
+ continue;
+ }
- $fileContent = file_get_contents($path);
+ $fileContent = file_get_contents($path);
- $fileContent = explode("namespace NC\\Updater;\n", $fileContent, 2)[1];
+ $fileContent = explode("namespace NC\\Updater;\n", $fileContent, 2)[1];
- $fileContent = trim($fileContent);
+ $fileContent = trim($fileContent);
- if(strpos($indexPhpContent, $fileContent) === false) {
-
- $failedFiles[] = $fileName;
- echo "$fileName" . PHP_EOL . PHP_EOL;
- findDiffPos($indexPhpContent, $fileContent);
- echo PHP_EOL;
- }
+ if (strpos($indexPhpContent, $fileContent) === false) {
+ $failedFiles[] = $fileName;
+ echo "$fileName" . PHP_EOL . PHP_EOL;
+ findDiffPos($indexPhpContent, $fileContent);
+ echo PHP_EOL;
+ }
}
-if($failedFiles !== []) {
- echo "Code is not the same" . PHP_EOL;
- exit(1);
+if ($failedFiles !== []) {
+ echo "Code is not the same" . PHP_EOL;
+ exit(1);
}
-echo "Code is the same" . PHP_EOL; \ No newline at end of file
+echo "Code is the same" . PHP_EOL;
diff --git a/tests/features/bootstrap/FeatureContext.php b/tests/features/bootstrap/FeatureContext.php
index 1d14b7d..6f0090c 100644
--- a/tests/features/bootstrap/FeatureContext.php
+++ b/tests/features/bootstrap/FeatureContext.php
@@ -5,135 +5,130 @@ use Behat\Behat\Context\SnippetAcceptingContext;
/**
* Defines application features from the specific context.
*/
-class FeatureContext implements SnippetAcceptingContext
-{
- protected $buildDir;
- protected $serverDir;
- protected $updateServerDir;
- protected $tmpDownloadDir;
- protected $downloadURL = 'https://download.nextcloud.com/server/releases/';
- protected $dailyDownloadURL = 'https://download.nextcloud.com/server/daily/latest-';
- protected $prereleasesDownloadURL = 'https://download.nextcloud.com/server/prereleases/';
- /** @var resource */
- protected $updaterServerProcess = null;
- /** @var string[] */
- protected $CLIOutput;
- /** @var integer */
- protected $CLIReturnCode;
- /** @var string */
- protected $autoupdater = '1';
- /** @var bool */
- protected $skipIt = false;
-
- public function __construct()
- {
- $baseDir = __DIR__ . '/../../data/';
- $this->serverDir = $baseDir . 'server/';
- $this->tmpDownloadDir = $baseDir . 'downloads/';
- $this->updateServerDir = $baseDir . 'update-server/';
- $this->buildDir = $baseDir . '../../';
- if(!file_exists($baseDir) && !mkdir($baseDir)) {
- throw new RuntimeException('Creating tmp download dir failed');
- }
- if(!file_exists($this->serverDir) && !mkdir($this->serverDir)) {
- throw new RuntimeException('Creating server dir failed');
- }
- if(!file_exists($this->tmpDownloadDir) && !mkdir($this->tmpDownloadDir)) {
- throw new RuntimeException('Creating tmp download dir failed');
- }
- if(!file_exists($this->updateServerDir) && !mkdir($this->updateServerDir)) {
- throw new RuntimeException('Creating update server dir failed');
- }
- }
-
- /**
- * @AfterScenario
- */
- public function stopUpdateServer()
- {
- if(is_resource($this->updaterServerProcess)) {
- proc_terminate($this->updaterServerProcess);
- proc_close($this->updaterServerProcess);
- }
- }
-
- /**
- * @Given /the current (installed )?version is ([0-9.]+((beta|RC)[0-9]?)?|stable[0-9]+|master)/
- */
- public function theCurrentInstalledVersionIs($installed, $version)
- {
+class FeatureContext implements SnippetAcceptingContext {
+ protected $buildDir;
+ protected $serverDir;
+ protected $updateServerDir;
+ protected $tmpDownloadDir;
+ protected $downloadURL = 'https://download.nextcloud.com/server/releases/';
+ protected $dailyDownloadURL = 'https://download.nextcloud.com/server/daily/latest-';
+ protected $prereleasesDownloadURL = 'https://download.nextcloud.com/server/prereleases/';
+ /** @var resource */
+ protected $updaterServerProcess = null;
+ /** @var string[] */
+ protected $CLIOutput;
+ /** @var integer */
+ protected $CLIReturnCode;
+ /** @var string */
+ protected $autoupdater = '1';
+ /** @var bool */
+ protected $skipIt = false;
+
+ public function __construct() {
+ $baseDir = __DIR__ . '/../../data/';
+ $this->serverDir = $baseDir . 'server/';
+ $this->tmpDownloadDir = $baseDir . 'downloads/';
+ $this->updateServerDir = $baseDir . 'update-server/';
+ $this->buildDir = $baseDir . '../../';
+ if (!file_exists($baseDir) && !mkdir($baseDir)) {
+ throw new RuntimeException('Creating tmp download dir failed');
+ }
+ if (!file_exists($this->serverDir) && !mkdir($this->serverDir)) {
+ throw new RuntimeException('Creating server dir failed');
+ }
+ if (!file_exists($this->tmpDownloadDir) && !mkdir($this->tmpDownloadDir)) {
+ throw new RuntimeException('Creating tmp download dir failed');
+ }
+ if (!file_exists($this->updateServerDir) && !mkdir($this->updateServerDir)) {
+ throw new RuntimeException('Creating update server dir failed');
+ }
+ }
+
+ /**
+ * @AfterScenario
+ */
+ public function stopUpdateServer() {
+ if (is_resource($this->updaterServerProcess)) {
+ proc_terminate($this->updaterServerProcess);
+ proc_close($this->updaterServerProcess);
+ }
+ }
+
+ /**
+ * @Given /the current (installed )?version is ([0-9.]+((beta|RC)[0-9]?)?|stable[0-9]+|master)/
+ */
+ public function theCurrentInstalledVersionIs($installed, $version) {
if ($this->skipIt) {
return;
}
- // recursive deletion of server folder
- if(file_exists($this->serverDir)) {
- $iterator = new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($this->serverDir, RecursiveDirectoryIterator::SKIP_DOTS),
- RecursiveIteratorIterator::CHILD_FIRST
- );
-
- foreach ($iterator as $fileInfo) {
- $action = $fileInfo->isDir() ? 'rmdir' : 'unlink';
- $action($fileInfo->getRealPath());
- }
- $state = rmdir($this->serverDir);
- if($state === false) {
- throw new \Exception('Could not rmdir ' . $this->serverDir);
- }
- }
-
- $filename = 'nextcloud-' . $version . '.zip';
-
- if (!file_exists($this->tmpDownloadDir . $filename)) {
- $fp = fopen($this->tmpDownloadDir . $filename, 'w+');
- $url = $this->downloadURL . $filename;
- if (strpos($version, 'RC') !== false || strpos($version, 'beta') !== false) {
- $url = $this->prereleasesDownloadURL . 'nextcloud-' . $version . '.zip';
- } else if(strpos($version, 'stable') !== false || strpos($version, 'master') !== false) {
- $url = $this->dailyDownloadURL . $version . '.zip';
- }
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_FILE, $fp);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Nextcloud Updater');
- if(curl_exec($ch) === false) {
- throw new \Exception('Curl error: ' . curl_error($ch));
- }
- $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- if($httpCode !== 200) {
- throw new \Exception('Download failed - HTTP code: ' . $httpCode);
- }
- curl_close($ch);
- fclose($fp);
- }
-
- $zip = new ZipArchive;
- $zipState = $zip->open($this->tmpDownloadDir . $filename);
- if ($zipState === true) {
- $zip->extractTo($this->serverDir);
- $zip->close();
- } else {
- throw new \Exception('Cant handle ZIP file. Error code is: '.$zipState);
- }
-
- if($installed === '') {
+ // recursive deletion of server folder
+ if (file_exists($this->serverDir)) {
+ $iterator = new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator($this->serverDir, RecursiveDirectoryIterator::SKIP_DOTS),
+ RecursiveIteratorIterator::CHILD_FIRST
+ );
+
+ foreach ($iterator as $fileInfo) {
+ $action = $fileInfo->isDir() ? 'rmdir' : 'unlink';
+ $action($fileInfo->getRealPath());
+ }
+ $state = rmdir($this->serverDir);
+ if ($state === false) {
+ throw new \Exception('Could not rmdir ' . $this->serverDir);
+ }
+ }
+
+ $filename = 'nextcloud-' . $version . '.zip';
+
+ if (!file_exists($this->tmpDownloadDir . $filename)) {
+ $fp = fopen($this->tmpDownloadDir . $filename, 'w+');
+ $url = $this->downloadURL . $filename;
+ if (strpos($version, 'RC') !== false || strpos($version, 'beta') !== false) {
+ $url = $this->prereleasesDownloadURL . 'nextcloud-' . $version . '.zip';
+ } elseif (strpos($version, 'stable') !== false || strpos($version, 'master') !== false) {
+ $url = $this->dailyDownloadURL . $version . '.zip';
+ }
+ $ch = curl_init($url);
+ curl_setopt($ch, CURLOPT_FILE, $fp);
+ curl_setopt($ch, CURLOPT_USERAGENT, 'Nextcloud Updater');
+ if (curl_exec($ch) === false) {
+ throw new \Exception('Curl error: ' . curl_error($ch));
+ }
+ $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ if ($httpCode !== 200) {
+ throw new \Exception('Download failed - HTTP code: ' . $httpCode);
+ }
+ curl_close($ch);
+ fclose($fp);
+ }
+
+ $zip = new ZipArchive;
+ $zipState = $zip->open($this->tmpDownloadDir . $filename);
+ if ($zipState === true) {
+ $zip->extractTo($this->serverDir);
+ $zip->close();
+ } else {
+ throw new \Exception('Cant handle ZIP file. Error code is: '.$zipState);
+ }
+
+ if ($installed === '') {
// the instance should not be installed
return;
}
- chdir($this->serverDir . 'nextcloud');
- shell_exec('chmod +x occ');
- exec('./occ maintenance:install --admin-user=admin --admin-pass=admin 2>&1', $output, $returnCode);
+ chdir($this->serverDir . 'nextcloud');
+ shell_exec('chmod +x occ');
+ exec('./occ maintenance:install --admin-user=admin --admin-pass=admin 2>&1', $output, $returnCode);
- if ($returnCode !== 0) {
- throw new Exception('Install failed' . PHP_EOL . join(PHP_EOL, $output));
- }
- }
+ if ($returnCode !== 0) {
+ throw new Exception('Install failed' . PHP_EOL . join(PHP_EOL, $output));
+ }
+ }
- /**
- * @Given there is no update available
- */
- public function thereIsNoUpdateAvailable()
- {
+ /**
+ * @Given there is no update available
+ */
+ public function thereIsNoUpdateAvailable() {
if ($this->skipIt) {
return;
}
@@ -156,8 +151,7 @@ class FeatureContext implements SnippetAcceptingContext
/**
* @When the CLI updater is run successfully
*/
- public function theCliUpdaterIsRunSuccessfully()
- {
+ public function theCliUpdaterIsRunSuccessfully() {
if ($this->skipIt) {
return;
}
@@ -168,34 +162,33 @@ class FeatureContext implements SnippetAcceptingContext
}
}
- /**
- * @When the CLI updater is run
- */
- public function theCliUpdaterIsRun()
- {
+ /**
+ * @When the CLI updater is run
+ */
+ public function theCliUpdaterIsRun() {
if ($this->skipIt) {
return;
}
- if(!file_exists($this->buildDir . 'updater.phar')) {
- throw new Exception('updater.phar not available - please build it in advance via "box build -c box.json"');
- }
- copy($this->buildDir . 'updater.phar', $this->serverDir . 'nextcloud/updater/updater');
- chdir($this->serverDir . 'nextcloud/updater');
- chmod($this->serverDir . 'nextcloud/updater/updater', 0755);
- exec('./updater -n', $output, $returnCode);
+ if (!file_exists($this->buildDir . 'updater.phar')) {
+ throw new Exception('updater.phar not available - please build it in advance via "box build -c box.json"');
+ }
+ copy($this->buildDir . 'updater.phar', $this->serverDir . 'nextcloud/updater/updater');
+ chdir($this->serverDir . 'nextcloud/updater');
+ chmod($this->serverDir . 'nextcloud/updater/updater', 0755);
+ exec('./updater -n', $output, $returnCode);
- // sleep to let the opcache do it's work and invalidate the status.php
- sleep(5);
+ // sleep to let the opcache do it's work and invalidate the status.php
+ sleep(5);
$this->CLIOutput = $output;
$this->CLIReturnCode = $returnCode;
- }
+ }
/**
* @param $version
* @return string
*/
- public function getSignatureForVersion($version) {
- $signatures = [
+ public function getSignatureForVersion($version) {
+ $signatures = [
'19.0.0beta4' => 'Cum4wIKpCRHNZuOQ/SfDYsIp39/4/Z3EIiMLTV7vFLf1pjsn+q1FRwk7HbT0ileU
9eGbmpJHrmbNFk73g6k2YLOeosznMD89+AtRrRRn7C+sJmXx90+Eejs1aWWBRi8j
wnC4PNYGZCqV10z+bMWNFWuZlkO2o2c+o8I/mIM93trRgnciFzA2YYAILnz4vZ5L
@@ -247,24 +240,23 @@ V367c1FDks7iKs/V96u21NuF14IQzI0mEzMzysPINrKbHC+OU1BKHKOHqRJjkHwQ
fNJsXi16UkYMGUXyQWQXHg==',
];
- if(isset($signatures[$version])) {
+ if (isset($signatures[$version])) {
return $signatures[$version];
}
return '';
- }
+ }
- /**
- * @Given /there is an update to version ([0-9.]+) available/
- */
- public function thereIsAnUpdateToVersionAvailable($version)
- {
+ /**
+ * @Given /there is an update to version ([0-9.]+) available/
+ */
+ public function thereIsAnUpdateToVersionAvailable($version) {
if ($this->skipIt) {
return;
}
$this->runUpdateServer();
- $content = '<?php
+ $content = '<?php
header("Content-Type: application/xml");
?>
<?xml version="1.0" encoding="UTF-8"?>
@@ -277,15 +269,13 @@ fNJsXi16UkYMGUXyQWQXHg==',
<signature>'.$this->getSignatureForVersion($version).'</signature>
</nextcloud>
';
- file_put_contents($this->updateServerDir . 'index.php', $content);
-
- }
+ file_put_contents($this->updateServerDir . 'index.php', $content);
+ }
/**
* @Given there is an update to prerelease version :version available
*/
- public function thereIsAnUpdateToPrereleaseVersionAvailable($version)
- {
+ public function thereIsAnUpdateToPrereleaseVersionAvailable($version) {
if ($this->skipIt) {
return;
}
@@ -305,14 +295,12 @@ fNJsXi16UkYMGUXyQWQXHg==',
</nextcloud>
';
file_put_contents($this->updateServerDir . 'index.php', $content);
-
}
/**
* @Given /there is an update to daily version of (.*) available/
*/
- public function thereIsAnUpdateToDailyVersionAvailable($version)
- {
+ public function thereIsAnUpdateToDailyVersionAvailable($version) {
if ($this->skipIt) {
return;
}
@@ -331,18 +319,16 @@ fNJsXi16UkYMGUXyQWQXHg==',
</nextcloud>
';
file_put_contents($this->updateServerDir . 'index.php', $content);
-
}
/**
* runs the updater server
* @throws Exception
*/
- protected function runUpdateServer()
- {
+ protected function runUpdateServer() {
$configFile = $this->serverDir . 'nextcloud/config/config.php';
$content = file_get_contents($configFile);
- $content = preg_replace('!\$CONFIG\s*=\s*array\s*\(!', "\$CONFIG = array(\n 'updater.server.url' => 'http://localhost:8870/',", $content );
+ $content = preg_replace('!\$CONFIG\s*=\s*array\s*\(!', "\$CONFIG = array(\n 'updater.server.url' => 'http://localhost:8870/',", $content);
file_put_contents($configFile, $content);
if (!is_null($this->updaterServerProcess)) {
@@ -352,7 +338,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
$cmd = "php -S localhost:8870 -t " . $this->updateServerDir . " 2>/dev/null 1>/dev/null";
$this->updaterServerProcess = proc_open($cmd, [], $pipes, $this->updateServerDir);
- if(!is_resource($this->updaterServerProcess)) {
+ if (!is_resource($this->updaterServerProcess)) {
throw new Exception('Update server could not be started');
}
@@ -360,29 +346,27 @@ fNJsXi16UkYMGUXyQWQXHg==',
sleep(1);
}
- /**
- * @Then /the installed version should be ([0-9.]+)/
- */
- public function theInstalledVersionShouldBe2($version)
- {
+ /**
+ * @Then /the installed version should be ([0-9.]+)/
+ */
+ public function theInstalledVersionShouldBe2($version) {
if ($this->skipIt) {
return;
}
- /** @var $OC_Version */
- require $this->serverDir . 'nextcloud/version.php';
+ /** @var $OC_Version */
+ require $this->serverDir . 'nextcloud/version.php';
- $installedVersion = join('.', $OC_Version);
+ $installedVersion = join('.', $OC_Version);
- if (strpos($installedVersion, $version) !== 0) {
- throw new Exception('Version mismatch - Installed: ' . $installedVersion . ' Wanted: ' . $version);
- }
- }
+ if (strpos($installedVersion, $version) !== 0) {
+ throw new Exception('Version mismatch - Installed: ' . $installedVersion . ' Wanted: ' . $version);
+ }
+ }
/**
* @Then /maintenance mode should be (on|off)/
*/
- public function maintenanceModeShouldBe($state)
- {
+ public function maintenanceModeShouldBe($state) {
if ($this->skipIt) {
return;
}
@@ -403,8 +387,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
* @Given the current channel is :channel
* @param string $channel
*/
- public function theCurrentChannelIs($channel)
- {
+ public function theCurrentChannelIs($channel) {
if ($this->skipIt) {
return;
}
@@ -417,8 +400,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
/**
* @Then /upgrade is (not required|required)/
*/
- public function upgradeIs($state)
- {
+ public function upgradeIs($state) {
if ($this->skipIt) {
return;
}
@@ -448,8 +430,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
/**
* @Then /the return code should not be (\S*)/
*/
- public function theReturnCodeShouldNotBe($expectedReturnCode)
- {
+ public function theReturnCodeShouldNotBe($expectedReturnCode) {
if ($this->skipIt) {
return;
}
@@ -461,8 +442,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
/**
* @Then /the output should contain "(.*)"/
*/
- public function theOutputShouldBe($expectedOutput)
- {
+ public function theOutputShouldBe($expectedOutput) {
if ($this->skipIt) {
return;
}
@@ -474,8 +454,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
/**
* @Given /the version number is decreased in the config.php to enforce upgrade/
*/
- public function theVersionNumberIsDecreasedInTheConfigPHPToEnforceUpgrade()
- {
+ public function theVersionNumberIsDecreasedInTheConfigPHPToEnforceUpgrade() {
if ($this->skipIt) {
return;
}
@@ -488,8 +467,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
/**
* @Given there is a folder called :name
*/
- public function thereIsAFolderCalled($name)
- {
+ public function thereIsAFolderCalled($name) {
if ($this->skipIt) {
return;
}
@@ -499,8 +477,7 @@ fNJsXi16UkYMGUXyQWQXHg==',
/**
* @Given there is a config for a secondary apps directory called :name
*/
- public function thereIsAConfigForASecondaryAppsDirectoryCalled($name)
- {
+ public function thereIsAConfigForASecondaryAppsDirectoryCalled($name) {
if ($this->skipIt) {
return;
}
@@ -528,8 +505,7 @@ EOF;
/**
* @Given /PHP is at least in version ([0-9.]+)/
*/
- public function phpIsAtLeastInVersion($version)
- {
+ public function phpIsAtLeastInVersion($version) {
$this->skipIt = !version_compare($version, PHP_VERSION, '<');
}
}
diff --git a/tests/features/master.feature b/tests/features/master.feature
index 888fa8b..498e410 100644
--- a/tests/features/master.feature
+++ b/tests/features/master.feature
@@ -7,6 +7,6 @@ Feature: CLI updater - master base
And the version number is decreased in the config.php to enforce upgrade
When the CLI updater is run successfully
And the output should contain "Update successful"
- Then the installed version should be 22.0
+ Then the installed version should be 25.0
And maintenance mode should be off
And upgrade is not required
diff --git a/updater.php b/updater.php
index b32c07c..1c64796 100755
--- a/updater.php
+++ b/updater.php
@@ -8,4 +8,4 @@ ini_set('log_errors', '1');
date_default_timezone_set('UTC');
$application = new NC\Updater\CommandApplication();
-$application->run(); \ No newline at end of file
+$application->run();
diff --git a/vendor-bin/coding-standard/composer.json b/vendor-bin/coding-standard/composer.json
new file mode 100644
index 0000000..ccaa7cf
--- /dev/null
+++ b/vendor-bin/coding-standard/composer.json
@@ -0,0 +1,11 @@
+{
+ "config": {
+ "platform": {
+ "php": "7.4"
+ },
+ "sort-packages": true
+ },
+ "require-dev": {
+ "nextcloud/coding-standard": "^1.0"
+ }
+}
diff --git a/vendor-bin/coding-standard/composer.lock b/vendor-bin/coding-standard/composer.lock
new file mode 100644
index 0000000..59cc8db
--- /dev/null
+++ b/vendor-bin/coding-standard/composer.lock
@@ -0,0 +1,2112 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "3a73a75c68f7f6783d2d42b988c9f46f",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "composer/pcre",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd",
+ "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.3",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "symfony/phpunit-bridge": "^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/3.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-02-25T20:21:48+00:00"
+ },
+ {
+ "name": "composer/semver",
+ "version": "3.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/semver.git",
+ "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9",
+ "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.4",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Semver\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nils Adermann",
+ "email": "naderman@naderman.de",
+ "homepage": "http://www.naderman.de"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ },
+ {
+ "name": "Rob Bast",
+ "email": "rob.bast@gmail.com",
+ "homepage": "http://robbast.nl"
+ }
+ ],
+ "description": "Semver library that offers utilities, version constraint parsing and validation.",
+ "keywords": [
+ "semantic",
+ "semver",
+ "validation",
+ "versioning"
+ ],
+ "support": {
+ "irc": "irc://irc.freenode.org/composer",
+ "issues": "https://github.com/composer/semver/issues",
+ "source": "https://github.com/composer/semver/tree/3.3.2"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-04-01T19:23:25+00:00"
+ },
+ {
+ "name": "composer/xdebug-handler",
+ "version": "3.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/xdebug-handler.git",
+ "reference": "ced299686f41dce890debac69273b47ffe98a40c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c",
+ "reference": "ced299686f41dce890debac69273b47ffe98a40c",
+ "shasum": ""
+ },
+ "require": {
+ "composer/pcre": "^1 || ^2 || ^3",
+ "php": "^7.2.5 || ^8.0",
+ "psr/log": "^1 || ^2 || ^3"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "symfony/phpunit-bridge": "^6.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Composer\\XdebugHandler\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "John Stevenson",
+ "email": "john-stevenson@blueyonder.co.uk"
+ }
+ ],
+ "description": "Restarts a process without Xdebug.",
+ "keywords": [
+ "Xdebug",
+ "performance"
+ ],
+ "support": {
+ "irc": "irc://irc.freenode.org/composer",
+ "issues": "https://github.com/composer/xdebug-handler/issues",
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-02-25T21:32:43+00:00"
+ },
+ {
+ "name": "doctrine/annotations",
+ "version": "1.13.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/annotations.git",
+ "reference": "648b0343343565c4a056bfc8392201385e8d89f0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0",
+ "reference": "648b0343343565c4a056bfc8392201385e8d89f0",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/lexer": "1.*",
+ "ext-tokenizer": "*",
+ "php": "^7.1 || ^8.0",
+ "psr/cache": "^1 || ^2 || ^3"
+ },
+ "require-dev": {
+ "doctrine/cache": "^1.11 || ^2.0",
+ "doctrine/coding-standard": "^6.0 || ^8.1",
+ "phpstan/phpstan": "^1.4.10 || ^1.8.0",
+ "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5",
+ "symfony/cache": "^4.4 || ^5.2",
+ "vimeo/psalm": "^4.10"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Docblock Annotations Parser",
+ "homepage": "https://www.doctrine-project.org/projects/annotations.html",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ],
+ "support": {
+ "issues": "https://github.com/doctrine/annotations/issues",
+ "source": "https://github.com/doctrine/annotations/tree/1.13.3"
+ },
+ "time": "2022-07-02T10:48:51+00:00"
+ },
+ {
+ "name": "doctrine/lexer",
+ "version": "1.2.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/lexer.git",
+ "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229",
+ "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/coding-standard": "^9.0",
+ "phpstan/phpstan": "^1.3",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "vimeo/psalm": "^4.11"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.",
+ "homepage": "https://www.doctrine-project.org/projects/lexer.html",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "lexer",
+ "parser",
+ "php"
+ ],
+ "support": {
+ "issues": "https://github.com/doctrine/lexer/issues",
+ "source": "https://github.com/doctrine/lexer/tree/1.2.3"
+ },
+ "funding": [
+ {
+ "url": "https://www.doctrine-project.org/sponsorship.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://www.patreon.com/phpdoctrine",
+ "type": "patreon"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-02-28T11:07:21+00:00"
+ },
+ {
+ "name": "friendsofphp/php-cs-fixer",
+ "version": "v3.9.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
+ "reference": "4465d70ba776806857a1ac2a6f877e582445ff36"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/4465d70ba776806857a1ac2a6f877e582445ff36",
+ "reference": "4465d70ba776806857a1ac2a6f877e582445ff36",
+ "shasum": ""
+ },
+ "require": {
+ "composer/semver": "^3.2",
+ "composer/xdebug-handler": "^3.0.3",
+ "doctrine/annotations": "^1.13",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "php": "^7.4 || ^8.0",
+ "php-cs-fixer/diff": "^2.0",
+ "symfony/console": "^5.4 || ^6.0",
+ "symfony/event-dispatcher": "^5.4 || ^6.0",
+ "symfony/filesystem": "^5.4 || ^6.0",
+ "symfony/finder": "^5.4 || ^6.0",
+ "symfony/options-resolver": "^5.4 || ^6.0",
+ "symfony/polyfill-mbstring": "^1.23",
+ "symfony/polyfill-php80": "^1.25",
+ "symfony/polyfill-php81": "^1.25",
+ "symfony/process": "^5.4 || ^6.0",
+ "symfony/stopwatch": "^5.4 || ^6.0"
+ },
+ "require-dev": {
+ "justinrainbow/json-schema": "^5.2",
+ "keradus/cli-executor": "^1.5",
+ "mikey179/vfsstream": "^1.6.10",
+ "php-coveralls/php-coveralls": "^2.5.2",
+ "php-cs-fixer/accessible-object": "^1.1",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
+ "phpspec/prophecy": "^1.15",
+ "phpspec/prophecy-phpunit": "^2.0",
+ "phpunit/phpunit": "^9.5",
+ "phpunitgoodpractices/polyfill": "^1.5",
+ "phpunitgoodpractices/traits": "^1.9.1",
+ "symfony/phpunit-bridge": "^6.0",
+ "symfony/yaml": "^5.4 || ^6.0"
+ },
+ "suggest": {
+ "ext-dom": "For handling output formats in XML",
+ "ext-mbstring": "For handling non-UTF8 characters."
+ },
+ "bin": [
+ "php-cs-fixer"
+ ],
+ "type": "application",
+ "autoload": {
+ "psr-4": {
+ "PhpCsFixer\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Dariusz Rumiński",
+ "email": "dariusz.ruminski@gmail.com"
+ }
+ ],
+ "description": "A tool to automatically fix PHP code style",
+ "support": {
+ "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues",
+ "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.9.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/keradus",
+ "type": "github"
+ }
+ ],
+ "time": "2022-07-22T08:43:51+00:00"
+ },
+ {
+ "name": "nextcloud/coding-standard",
+ "version": "v1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nextcloud/coding-standard.git",
+ "reference": "f3d1f9375e89c605deb1734f59a9f51ecbe80578"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/f3d1f9375e89c605deb1734f59a9f51ecbe80578",
+ "reference": "f3d1f9375e89c605deb1734f59a9f51ecbe80578",
+ "shasum": ""
+ },
+ "require": {
+ "friendsofphp/php-cs-fixer": "^3.2",
+ "php": "^7.3|^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Nextcloud\\CodingStandard\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Christoph Wurst",
+ "email": "christoph@winzerhof-wurst.at"
+ }
+ ],
+ "description": "Nextcloud coding standards for the php cs fixer",
+ "support": {
+ "issues": "https://github.com/nextcloud/coding-standard/issues",
+ "source": "https://github.com/nextcloud/coding-standard/tree/v1.0.0"
+ },
+ "time": "2021-11-10T08:44:10+00:00"
+ },
+ {
+ "name": "php-cs-fixer/diff",
+ "version": "v2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHP-CS-Fixer/diff.git",
+ "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3",
+ "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0",
+ "symfony/process": "^3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "description": "sebastian/diff v3 backport support for PHP 5.6+",
+ "homepage": "https://github.com/PHP-CS-Fixer",
+ "keywords": [
+ "diff"
+ ],
+ "support": {
+ "issues": "https://github.com/PHP-CS-Fixer/diff/issues",
+ "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2"
+ },
+ "time": "2020-10-14T08:32:19+00:00"
+ },
+ {
+ "name": "psr/cache",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/cache.git",
+ "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
+ "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.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": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for caching libraries",
+ "keywords": [
+ "cache",
+ "psr",
+ "psr-6"
+ ],
+ "time": "2016-08-06T20:24:11+00:00"
+ },
+ {
+ "name": "psr/container",
+ "version": "1.1.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.4.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "time": "2021-11-05T16:50:12+00:00"
+ },
+ {
+ "name": "psr/event-dispatcher",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/event-dispatcher.git",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\EventDispatcher\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Standard interfaces for event handling.",
+ "keywords": [
+ "events",
+ "psr",
+ "psr-14"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/event-dispatcher/issues",
+ "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0"
+ },
+ "time": "2019-01-08T18:20:26+00:00"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
+ "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2021-05-03T11:20:27+00:00"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v5.4.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/4d671ab4ddac94ee439ea73649c69d9d200b5000",
+ "reference": "4d671ab4ddac94ee439ea73649c69d9d200b5000",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php73": "^1.9",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/string": "^5.1|^6.0"
+ },
+ "conflict": {
+ "psr/log": ">=3",
+ "symfony/dependency-injection": "<4.4",
+ "symfony/dotenv": "<5.1",
+ "symfony/event-dispatcher": "<4.4",
+ "symfony/lock": "<4.4",
+ "symfony/process": "<4.4"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/event-dispatcher": "^4.4|^5.0|^6.0",
+ "symfony/lock": "^4.4|^5.0|^6.0",
+ "symfony/process": "^4.4|^5.0|^6.0",
+ "symfony/var-dumper": "^4.4|^5.0|^6.0"
+ },
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/lock": "",
+ "symfony/process": ""
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "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": "Eases the creation of beautiful and testable command line interfaces",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "cli",
+ "command line",
+ "console",
+ "terminal"
+ ],
+ "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-06-26T13:00:04+00:00"
+ },
+ {
+ "name": "symfony/deprecation-contracts",
+ "version": "v2.5.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "files": [
+ "function.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "A generic function and convention to trigger deprecation notices",
+ "homepage": "https://symfony.com",
+ "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:53:40+00:00"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v5.4.9",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc",
+ "reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/event-dispatcher-contracts": "^2|^3",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<4.4"
+ },
+ "provide": {
+ "psr/event-dispatcher-implementation": "1.0",
+ "symfony/event-dispatcher-implementation": "2.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^4.4|^5.0|^6.0",
+ "symfony/dependency-injection": "^4.4|^5.0|^6.0",
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/expression-language": "^4.4|^5.0|^6.0",
+ "symfony/http-foundation": "^4.4|^5.0|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/stopwatch": "^4.4|^5.0|^6.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "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 tools that allow your application components to communicate with each other by dispatching events and listening to them",
+ "homepage": "https://symfony.com",
+ "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-05-05T16:45:39+00:00"
+ },
+ {
+ "name": "symfony/event-dispatcher-contracts",
+ "version": "v2.5.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher-contracts.git",
+ "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1",
+ "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/event-dispatcher": "^1"
+ },
+ "suggest": {
+ "symfony/event-dispatcher-implementation": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\EventDispatcher\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to dispatching event",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "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:53:40+00:00"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v5.4.9",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/36a017fa4cce1eff1b8e8129ff53513abcef05ba",
+ "reference": "36a017fa4cce1eff1b8e8129ff53513abcef05ba",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.8",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "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 basic utilities for the filesystem",
+ "homepage": "https://symfony.com",
+ "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-05-20T13:55:35+00:00"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v5.4.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9",
+ "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "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": "Finds files and directories via an intuitive fluent interface",
+ "homepage": "https://symfony.com",
+ "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-04-15T08:07:45+00:00"
+ },
+ {
+ "name": "symfony/options-resolver",
+ "version": "v5.4.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/options-resolver.git",
+ "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/cc1147cb11af1b43f503ac18f31aa3bec213aba8",
+ "reference": "cc1147cb11af1b43f503ac18f31aa3bec213aba8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-php73": "~1.0",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "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"
+ ],
+ "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:53:40+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
+ "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-ctype": "*"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
+ },
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-grapheme",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
+ "reference": "433d05519ce6990bf3530fba6957499d327395c2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2",
+ "reference": "433d05519ce6990bf3530fba6957499d327395c2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's grapheme_* functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "grapheme",
+ "intl",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0"
+ },
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-normalizer",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+ "reference": "219aa369ceff116e673852dce47c3a41794c14bd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd",
+ "reference": "219aa369ceff116e673852dce47c3a41794c14bd",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's Normalizer class and related functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "intl",
+ "normalizer",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0"
+ },
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-mbstring": "*"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ },
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php73",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php73.git",
+ "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
+ "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php73\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php80",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+ "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
+ },
+ "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-05-10T07:21:04+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php81",
+ "version": "v1.26.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1",
+ "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php81\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0"
+ },
+ "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-05-24T11:49:31+00:00"
+ },
+ {
+ "name": "symfony/process",
+ "version": "v5.4.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/process.git",
+ "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/process/zipball/597f3fff8e3e91836bb0bd38f5718b56ddbde2f3",
+ "reference": "597f3fff8e3e91836bb0bd38f5718b56ddbde2f3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/polyfill-php80": "^1.16"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Process\\": ""
+ },
+ "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": "Executes commands in sub-processes",
+ "homepage": "https://symfony.com",
+ "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-04-08T05:07:18+00:00"
+ },
+ {
+ "name": "symfony/service-contracts",
+ "version": "v2.5.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/service-contracts.git",
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/container": "^1.1",
+ "symfony/deprecation-contracts": "^2.1|^3"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
+ },
+ "suggest": {
+ "symfony/service-implementation": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\Service\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to writing services",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "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-05-30T19:17:29+00:00"
+ },
+ {
+ "name": "symfony/stopwatch",
+ "version": "v5.4.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/stopwatch.git",
+ "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/4d04b5c24f3c9a1a168a131f6cbe297155bc0d30",
+ "reference": "4d04b5c24f3c9a1a168a131f6cbe297155bc0d30",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/service-contracts": "^1|^2|^3"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Stopwatch\\": ""
+ },
+ "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 a way to profile code",
+ "homepage": "https://symfony.com",
+ "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-02-18T16:06:09+00:00"
+ },
+ {
+ "name": "symfony/string",
+ "version": "v5.4.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/string.git",
+ "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/string/zipball/4432bc7df82a554b3e413a8570ce2fea90e94097",
+ "reference": "4432bc7df82a554b3e413a8570ce2fea90e94097",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-intl-grapheme": "~1.0",
+ "symfony/polyfill-intl-normalizer": "~1.0",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php80": "~1.15"
+ },
+ "conflict": {
+ "symfony/translation-contracts": ">=3.0"
+ },
+ "require-dev": {
+ "symfony/error-handler": "^4.4|^5.0|^6.0",
+ "symfony/http-client": "^4.4|^5.0|^6.0",
+ "symfony/translation-contracts": "^1.1|^2",
+ "symfony/var-exporter": "^4.4|^5.0|^6.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "Resources/functions.php"
+ ],
+ "psr-4": {
+ "Symfony\\Component\\String\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "grapheme",
+ "i18n",
+ "string",
+ "unicode",
+ "utf-8",
+ "utf8"
+ ],
+ "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-06-26T15:57:47+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": [],
+ "platform-overrides": {
+ "php": "7.4"
+ },
+ "plugin-api-version": "1.1.0"
+}
diff --git a/vendor/autoload.php b/vendor/autoload.php
index c749f66..fe174d4 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInit994b8d870ddb923ebc3ff0ceaaaa96a6::getLoader();
+return ComposerAutoloaderInit2723bf3c902a907c44396c9253500aff::getLoader();
diff --git a/vendor/symfony/debug/LICENSE b/vendor/bamarni/composer-bin-plugin/LICENSE
index 12a7453..b5b6c2f 100644
--- a/vendor/symfony/debug/LICENSE
+++ b/vendor/bamarni/composer-bin-plugin/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2016 Bilal Amarni
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/bamarni/composer-bin-plugin/README.md b/vendor/bamarni/composer-bin-plugin/README.md
new file mode 100644
index 0000000..46c6349
--- /dev/null
+++ b/vendor/bamarni/composer-bin-plugin/README.md
@@ -0,0 +1,239 @@
+# Composer bin plugin — Isolate your bin dependencies
+
+[![Package version](http://img.shields.io/packagist/v/bamarni/composer-bin-plugin.svg?style=flat-square)](https://packagist.org/packages/bamarni/composer-bin-plugin)
+[![Build Status](https://img.shields.io/travis/bamarni/composer-bin-plugin.svg?branch=master&style=flat-square)](https://travis-ci.org/bamarni/composer-bin-plugin?branch=master)
+[![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat-square)](LICENSE)
+
+
+## Table of Contents
+
+1. [Why?](#why)
+1. [How does this plugin work?](#how-does-this-plugin-work)
+1. [Installation](#installation)
+1. [Usage](#usage)
+ 1. [Example](#example)
+ 1. [The `all` bin namespace](#the-all-bin-namespace)
+ 1. [What happens when symlink conflicts?](#what-happens-when-symlink-conflicts)
+1. [Tips](#tips)
+ 1. [Auto-installation](#auto-installation)
+ 1. [Disable links](#disable-links)
+ 1. [Change directory](#change-directory)
+ 1. [Forward mode](#forward-mode)
+ 1. [Reduce clutter](#reduce-clutter)
+1. [Related plugins](#related-plugins)
+
+
+## Why?
+
+In PHP, with Composer, your dependencies are flattened, which might result in conflicts. Most of the time those
+conflicts are legitimate and should be properly resolved. However you may have dev tools that you want to manage
+via Composer for convenience, but should not influence your project dependencies or for which conflicts don't make
+sense. For example: [EtsyPhan][1] and [PhpMetrics][2]. Installing one of those static analysis tools should not change
+your application dependencies, neither should it be a problem to install both of them at the same time.
+
+
+## How does this plugin work?
+
+It allows you to install your *bin vendors* in isolated locations, and still link them to your
+[bin-dir][3] (if you want to).
+
+This is done by registering a `bin` command, which can be used to run Composer commands inside a namespace.
+
+
+## Installation
+
+ # Globally
+ $ composer global require bamarni/composer-bin-plugin
+
+ # In your project
+ $ composer require --dev bamarni/composer-bin-plugin
+
+
+## Usage
+
+ $ composer bin [namespace] [composer_command]
+ $ composer global bin [namespace] [composer_command]
+
+
+### Example
+
+Let's install [Behat][4] and [PhpSpec][5] inside a `bdd` bin namespace, [EtsyPhan][1] in `etsy-phan` and [PhpMetrics][2]
+in `phpmetrics`:
+
+ $ composer bin bdd require behat/behat phpspec/phpspec
+ $ composer bin etsy-phan require etsy/phan
+ $ composer bin phpmetrics require phpmetrics/phpmetrics
+
+This command creates the following directory structure :
+
+ .
+ ├── composer.json
+ ├── composer.lock
+ ├── vendor/
+ │   └── bin
+ │ ├── behat -> ../../vendor-bin/bdd/vendor/behat/behat/bin/behat
+ │ ├── phpspec -> ../../vendor-bin/bdd/vendor/phpspec/phpspec/bin/phpspec
+ │ ├── phan -> ../../vendor-bin/etsy-phan/vendor/etsy/phan/phan
+ │ └── phpmetrics -> ../../vendor-bin/phpmetrics/vendor/phpmetrics/phpmetrics/bin/phpmetrics
+ └── vendor-bin/
+ └── bdd
+ │ ├── composer.json
+ │ ├── composer.lock
+ │ └── vendor/
+ │ ├── behat/
+ │ ├── phpspec/
+ │ └── ...
+ └── etsy-phan
+ │ ├── composer.json
+ │ ├── composer.lock
+ │ └── vendor/
+ │ ├── etsy/
+ │ └── ...
+ └── phpmetrics
+ ├── composer.json
+ ├── composer.lock
+ └── vendor/
+ ├── phpmetrics/
+ └── ...
+
+
+You can continue to run `vendor/bin/behat`, `vendor/bin/phpspec` and co. as before but they will be properly isolated.
+Also, `composer.json` and `composer.lock` files in each namespace will allow you to take advantage of automated dependency
+management as normally provided by Composer.
+
+### The `all` bin namespace
+
+The `all` bin namespace has a special meaning. It runs a command for all existing bin namespaces. For instance, the
+following command would update all your bins :
+
+ $ composer bin all update
+ Changed current directory to vendor-bin/phpspec
+ Loading composer repositories with package information
+ Updating dependencies (including require-dev)
+ Nothing to install or update
+ Generating autoload files
+ Changed current directory to vendor-bin/phpunit
+ Loading composer repositories with package information
+ Updating dependencies (including require-dev)
+ Nothing to install or update
+ Generating autoload files
+
+
+### What happens when symlink conflicts?
+
+If we take the case described in the [example section](#example), there might be more binaries linked due to
+the dependencies. For example [PhpMetrics][2] depends on [Nikic PHP-Parser][6] and as such you will also have `php-parse`
+in `.vendor/bin/`:
+
+ .
+ ├── composer.json
+ ├── composer.lock
+ ├── vendor/
+ │   └── bin
+ │ ├── phpmetrics -> ../../vendor-bin/phpmetrics/vendor/phpmetrics/phpmetrics/bin/phpmetrics
+ │ └── php-parse -> ../../vendor-bin/phpmetrics/vendor/nikic/PHP-Parser/bin/php-parsee
+ └── vendor-bin/
+ └── phpmetrics
+ ├── composer.json
+ ├── composer.lock
+ └── vendor/
+ ├── phpmetrics/
+ ├── nikic/
+ └── ...
+
+But what happens if another bin-namespace has a dependency using [Nikic PHP-Parser][6]? In that situation symlinks would
+collides and are not created (only the colliding ones).
+
+
+## Tips
+
+### Auto-installation
+
+For convenience, you can add the following script in your `composer.json` :
+
+```json
+{
+ "scripts": {
+ "bin": "echo 'bin not installed'",
+ "post-install-cmd": ["@composer bin all install --ansi"],
+ "post-update-cmd": ["@composer bin all update --ansi"]
+ }
+}
+```
+
+This makes sure all your bins are installed during `composer install` and updated during `composer update`.
+
+### Disable links
+
+By default, binaries of the sub namespaces are linked to the root one like described in [example](#example). If you
+wish to disable that behaviour, you can do so by adding a little setting in the extra config:
+
+```json
+{
+ "extra": {
+ "bamarni-bin": {
+ "bin-links": false
+ }
+ }
+}
+```
+
+### Change directory
+
+By default, the packages are looked for in the `vendor-bin` directory. The location can be changed using `target-directory` value in the extra config:
+
+```json
+{
+ "extra": {
+ "bamarni-bin": {
+ "target-directory": "ci/vendor"
+ }
+ }
+}
+```
+
+### Forward mode
+
+There is a `forward mode` which is disabled by default. This can be activated by using the `forward-command` value in the extra config.
+
+```json
+{
+ "extra": {
+ "bamarni-bin": {
+ "forward-command": true
+ }
+ }
+}
+```
+
+If this mode is activated, all your `composer install` and `composer update` commands are forwared to all bin directories.
+This is an replacement for the tasks shown in section [Auto-installation](#auto-installation).
+
+### Reduce clutter
+
+You can add following line to your `.gitignore` file in order to avoid committing dependencies of your tools.
+
+```.gitignore
+/vendor-bin/**/vendor
+```
+
+Updating each tool can create many not legible changes in `composer.lock` files. You can use `.gitattributes` file in order
+to inform git that it shouldn't show diffs of `composer.lock` files.
+
+```.gitattributes
+vendor-bin/**/composer.lock binary
+```
+
+## Related plugins
+
+* [theofidry/composer-inheritance-plugin][7]: Opinionated version of [Wikimedia composer-merge-plugin][8] to work in pair with this plugin.
+
+
+[1]: https://github.com/etsy/phan
+[2]: https://github.com/phpmetrics/PhpMetrics
+[3]: https://getcomposer.org/doc/06-config.md#bin-dir
+[4]: http://behat.org
+[5]: http://phpspec.net
+[6]: https://github.com/nikic/PHP-Parser
+[7]: https://github.com/theofidry/composer-inheritance-plugin
+[8]: https://github.com/wikimedia/composer-merge-plugin
diff --git a/vendor/bamarni/composer-bin-plugin/composer.json b/vendor/bamarni/composer-bin-plugin/composer.json
new file mode 100644
index 0000000..89752c4
--- /dev/null
+++ b/vendor/bamarni/composer-bin-plugin/composer.json
@@ -0,0 +1,46 @@
+{
+ "name": "bamarni/composer-bin-plugin",
+ "type": "composer-plugin",
+ "description": "No conflicts for your bin dependencies",
+ "keywords": [
+ "composer",
+ "dependency",
+ "tool",
+ "isolation",
+ "conflict",
+ "executable"
+ ],
+ "license": "MIT",
+ "require": {
+ "php": "^5.5.9 || ^7.0 || ^8.0",
+ "composer-plugin-api": "^1.0 || ^2.0"
+ },
+ "require-dev": {
+ "composer/composer": "^1.0 || ^2.0",
+ "symfony/console": "^2.5 || ^3.0 || ^4.0"
+ },
+ "config": {
+ "sort-packages": true
+ },
+ "extra": {
+ "class": "Bamarni\\Composer\\Bin\\Plugin"
+ },
+ "autoload": {
+ "psr-4": {
+ "Bamarni\\Composer\\Bin\\": "src"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Bamarni\\Composer\\Bin\\Tests\\": "tests"
+ }
+ },
+ "scripts": {
+ "post-install-cmd": [
+ "@composer bin phpunit install"
+ ],
+ "post-update-cmd": [
+ "@post-install-cmd"
+ ]
+ }
+}
diff --git a/vendor/bamarni/composer-bin-plugin/src/BinCommand.php b/vendor/bamarni/composer-bin-plugin/src/BinCommand.php
new file mode 100644
index 0000000..e7fd540
--- /dev/null
+++ b/vendor/bamarni/composer-bin-plugin/src/BinCommand.php
@@ -0,0 +1,186 @@
+<?php
+
+namespace Bamarni\Composer\Bin;
+
+use Composer\Console\Application as ComposerApplication;
+use Composer\Factory;
+use Composer\IO\IOInterface;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\StringInput;
+use Symfony\Component\Console\Output\OutputInterface;
+use Composer\Command\BaseCommand;
+use Composer\Json\JsonFile;
+
+class BinCommand extends BaseCommand
+{
+ /**
+ * {@inheritDoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('bin')
+ ->setDescription('Run a command inside a bin namespace')
+ ->setDefinition([
+ new InputArgument('namespace', InputArgument::REQUIRED),
+ new InputArgument('args', InputArgument::REQUIRED | InputArgument::IS_ARRAY),
+ ])
+ ->ignoreValidationErrors()
+ ;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $config = new Config($this->getComposer());
+ $this->resetComposers($application = $this->getApplication());
+ /** @var ComposerApplication $application */
+
+ if ($config->binLinksAreEnabled()) {
+ putenv('COMPOSER_BIN_DIR='.$this->createConfig()->get('bin-dir'));
+ }
+
+ $vendorRoot = $config->getTargetDirectory();
+ $namespace = $input->getArgument('namespace');
+
+ $input = new StringInput(preg_replace(
+ sprintf('/bin\s+(--ansi\s)?%s(\s.+)/', preg_quote($namespace, '/')),
+ '$1$2',
+ (string) $input,
+ 1
+ ));
+
+ return ('all' !== $namespace)
+ ? $this->executeInNamespace($application, $vendorRoot.'/'.$namespace, $input, $output)
+ : $this->executeAllNamespaces($application, $vendorRoot, $input, $output)
+ ;
+ }
+
+ /**
+ * @param ComposerApplication $application
+ * @param string $binVendorRoot
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ *
+ * @return int Exit code
+ */
+ private function executeAllNamespaces(ComposerApplication $application, $binVendorRoot, InputInterface $input, OutputInterface $output)
+ {
+ $binRoots = glob($binVendorRoot.'/*', GLOB_ONLYDIR);
+ if (empty($binRoots)) {
+ $this->getIO()->writeError('<warning>Couldn\'t find any bin namespace.</warning>');
+
+ return 0; // Is a valid scenario: the user may not have setup any bin namespace yet
+ }
+
+ $originalWorkingDir = getcwd();
+ $exitCode = 0;
+ foreach ($binRoots as $namespace) {
+ $output->writeln(
+ sprintf('Run in namespace <comment>%s</comment>', $namespace),
+ OutputInterface::VERBOSITY_VERBOSE
+ );
+ $exitCode += $this->executeInNamespace($application, $namespace, $input, $output);
+
+ chdir($originalWorkingDir);
+ $this->resetComposers($application);
+ }
+
+ return min($exitCode, 255);
+ }
+
+ /**
+ * @param ComposerApplication $application
+ * @param string $namespace
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ *
+ * @return int Exit code
+ */
+ private function executeInNamespace(ComposerApplication $application, $namespace, InputInterface $input, OutputInterface $output)
+ {
+ if (!file_exists($namespace)) {
+ mkdir($namespace, 0777, true);
+ }
+
+ $this->chdir($namespace);
+
+ // some plugins require access to composer file e.g. Symfony Flex
+ if (!file_exists(Factory::getComposerFile())) {
+ file_put_contents(Factory::getComposerFile(), '{}');
+ }
+
+ $input = new StringInput((string) $input . ' --working-dir=.');
+
+ $this->getIO()->writeError(
+ sprintf('<info>Run with <comment>%s</comment></info>', $input->__toString()),
+ true,
+ IOInterface::VERBOSE
+ );
+
+ return $application->doRun($input, $output);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function isProxyCommand()
+ {
+ return true;
+ }
+
+ /**
+ * Resets all Composer references in the application.
+ *
+ * @param ComposerApplication $application
+ * @return void
+ */
+ private function resetComposers(ComposerApplication $application)
+ {
+ $application->resetComposer();
+
+ foreach ($this->getApplication()->all() as $command) {
+ if ($command instanceof BaseCommand) {
+ $command->resetComposer();
+ }
+ }
+ }
+
+ /**
+ * @param $dir
+ * @return void
+ */
+ private function chdir($dir)
+ {
+ chdir($dir);
+
+ $this->getIO()->writeError(
+ sprintf('<info>Changed current directory to %s</info>', $dir),
+ true,
+ IOInterface::VERBOSE
+ );
+ }
+
+ /**
+ * @return \Composer\Config
+ * @throws \Composer\Json\JsonValidationException
+ * @throws \Seld\JsonLint\ParsingException
+ */
+ private function createConfig()
+ {
+ $config = Factory::createConfig();
+
+ $file = new JsonFile(Factory::getComposerFile());
+ if (!$file->exists()) {
+ return $config;
+ }
+ $file->validateSchema(JsonFile::LAX_SCHEMA);
+
+ $config->merge($file->read());
+
+ return $config;
+ }
+}
diff --git a/vendor/bamarni/composer-bin-plugin/src/CommandProvider.php b/vendor/bamarni/composer-bin-plugin/src/CommandProvider.php
new file mode 100644
index 0000000..2e8235f
--- /dev/null
+++ b/vendor/bamarni/composer-bin-plugin/src/CommandProvider.php
@@ -0,0 +1,16 @@
+<?php
+
+namespace Bamarni\Composer\Bin;
+
+use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability;
+
+class CommandProvider implements CommandProviderCapability
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function getCommands()
+ {
+ return [new BinCommand];
+ }
+}
diff --git a/vendor/bamarni/composer-bin-plugin/src/Config.php b/vendor/bamarni/composer-bin-plugin/src/Config.php
new file mode 100644
index 0000000..4e98a65
--- /dev/null
+++ b/vendor/bamarni/composer-bin-plugin/src/Config.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace Bamarni\Composer\Bin;
+
+use Composer\Composer;
+
+final class Config
+{
+ private $config;
+
+ public function __construct(Composer $composer)
+ {
+ $extra = $composer->getPackage()->getExtra();
+ $this->config = array_merge(
+ [
+ 'bin-links' => true,
+ 'target-directory' => 'vendor-bin',
+ 'forward-command' => false,
+ ],
+ isset($extra['bamarni-bin']) ? $extra['bamarni-bin'] : []
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function binLinksAreEnabled()
+ {
+ return true === $this->config['bin-links'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getTargetDirectory()
+ {
+ return $this->config['target-directory'];
+ }
+
+ /**
+ * @return bool
+ */
+ public function isCommandForwarded()
+ {
+ return $this->config['forward-command'];
+ }
+}
diff --git a/vendor/bamarni/composer-bin-plugin/src/Plugin.php b/vendor/bamarni/composer-bin-plugin/src/Plugin.php
new file mode 100644
index 0000000..06ea90e
--- /dev/null
+++ b/vendor/bamarni/composer-bin-plugin/src/Plugin.php
@@ -0,0 +1,130 @@
+<?php
+
+namespace Bamarni\Composer\Bin;
+
+use Composer\Composer;
+use Composer\Console\Application;
+use Composer\EventDispatcher\EventSubscriberInterface;
+use Composer\IO\IOInterface;
+use Composer\Plugin\CommandEvent;
+use Composer\Plugin\PluginEvents;
+use Composer\Plugin\PluginInterface;
+use Composer\Plugin\Capable;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputDefinition;
+
+class Plugin implements PluginInterface, Capable, EventSubscriberInterface
+{
+ /**
+ * @var Composer
+ */
+ protected $composer;
+
+ /**
+ * @var IOInterface
+ */
+ protected $io;
+
+ /**
+ * @return void
+ */
+ public function activate(Composer $composer, IOInterface $io)
+ {
+ $this->composer = $composer;
+ $this->io = $io;
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getCapabilities()
+ {
+ return [
+ 'Composer\Plugin\Capability\CommandProvider' => 'Bamarni\Composer\Bin\CommandProvider',
+ ];
+ }
+
+ /**
+ * @return void
+ */
+ public function deactivate(Composer $composer, IOInterface $io)
+ {
+ }
+
+ /**
+ * @return void
+ */
+ public function uninstall(Composer $composer, IOInterface $io)
+ {
+ }
+
+ /**
+ * @return string[]
+ */
+ public static function getSubscribedEvents()
+ {
+ return [
+ PluginEvents::COMMAND => 'onCommandEvent',
+ ];
+ }
+
+ /**
+ * @param CommandEvent $event
+ * @return bool
+ */
+ public function onCommandEvent(CommandEvent $event)
+ {
+ $config = new Config($this->composer);
+
+ if ($config->isCommandForwarded()) {
+ switch ($event->getCommandName()) {
+ case 'update':
+ case 'install':
+ return $this->onCommandEventInstallUpdate($event);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * @param CommandEvent $event
+ * @return bool
+ */
+ protected function onCommandEventInstallUpdate(CommandEvent $event)
+ {
+ $command = new BinCommand();
+ $command->setComposer($this->composer);
+ $command->setApplication(new Application());
+
+ $arguments = [
+ 'command' => $command->getName(),
+ 'namespace' => 'all',
+ 'args' => [],
+ ];
+
+ foreach (array_filter($event->getInput()->getArguments()) as $argument) {
+ $arguments['args'][] = $argument;
+ }
+
+ foreach (array_keys(array_filter($event->getInput()->getOptions())) as $option) {
+ $arguments['args'][] = '--' . $option;
+ }
+
+ $definition = new InputDefinition();
+ $definition->addArgument(new InputArgument('command', InputArgument::REQUIRED));
+ $definition->addArguments($command->getDefinition()->getArguments());
+ $definition->addOptions($command->getDefinition()->getOptions());
+
+ $input = new ArrayInput($arguments, $definition);
+
+ try {
+ $returnCode = $command->run($input, $event->getOutput());
+ } catch (\Exception $e) {
+ return false;
+ }
+
+ return $returnCode === 0;
+ }
+}
diff --git a/vendor/bin/php-cs-fixer b/vendor/bin/php-cs-fixer
new file mode 120000
index 0000000..6241fa7
--- /dev/null
+++ b/vendor/bin/php-cs-fixer
@@ -0,0 +1 @@
+../../vendor-bin/coding-standard/vendor/friendsofphp/php-cs-fixer/php-cs-fixer \ No newline at end of file
diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php
index afef3fa..03b9bb9 100644
--- a/vendor/composer/ClassLoader.php
+++ b/vendor/composer/ClassLoader.php
@@ -37,80 +37,26 @@ namespace Composer\Autoload;
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
- * @see https://www.php-fig.org/psr/psr-0/
- * @see https://www.php-fig.org/psr/psr-4/
+ * @see http://www.php-fig.org/psr/psr-0/
+ * @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
- /** @var ?string */
- private $vendorDir;
-
// PSR-4
- /**
- * @var array[]
- * @psalm-var array<string, array<string, int>>
- */
private $prefixLengthsPsr4 = array();
- /**
- * @var array[]
- * @psalm-var array<string, array<int, string>>
- */
private $prefixDirsPsr4 = array();
- /**
- * @var array[]
- * @psalm-var array<string, string>
- */
private $fallbackDirsPsr4 = array();
// PSR-0
- /**
- * @var array[]
- * @psalm-var array<string, array<string, string[]>>
- */
private $prefixesPsr0 = array();
- /**
- * @var array[]
- * @psalm-var array<string, string>
- */
private $fallbackDirsPsr0 = array();
- /** @var bool */
private $useIncludePath = false;
-
- /**
- * @var string[]
- * @psalm-var array<string, string>
- */
private $classMap = array();
-
- /** @var bool */
private $classMapAuthoritative = false;
-
- /**
- * @var bool[]
- * @psalm-var array<string, bool>
- */
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 +66,28 @@ class ClassLoader
return array();
}
- /**
- * @return array[]
- * @psalm-return array<string, array<int, string>>
- */
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
- /**
- * @return array[]
- * @psalm-return array<string, string>
- */
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
- /**
- * @return array[]
- * @psalm-return array<string, string>
- */
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
- /**
- * @return string[] Array of classname => path
- * @psalm-return array<string, string>
- */
public function getClassMap()
{
return $this->classMap;
}
/**
- * @param string[] $classMap Class to filename map
- * @psalm-param array<string, string> $classMap
- *
- * @return void
+ * @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
@@ -175,11 +102,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 +147,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 +195,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 +211,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 +234,6 @@ class ClassLoader
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
- *
- * @return void
*/
public function setUseIncludePath($useIncludePath)
{
@@ -339,8 +256,6 @@ class ClassLoader
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
- *
- * @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
@@ -361,8 +276,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,44 +296,25 @@ 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)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
-
- if (null === $this->vendorDir) {
- return;
- }
-
- if ($prepend) {
- self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
- } else {
- unset(self::$registeredLoaders[$this->vendorDir]);
- self::$registeredLoaders[$this->vendorDir] = $this;
- }
}
/**
* Unregisters this instance as an autoloader.
- *
- * @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
-
- if (null !== $this->vendorDir) {
- unset(self::$registeredLoaders[$this->vendorDir]);
- }
}
/**
* 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 +323,6 @@ class ClassLoader
return true;
}
-
- return null;
}
/**
@@ -475,21 +367,6 @@ class ClassLoader
return $file;
}
- /**
- * Returns the currently registered loaders indexed by their corresponding vendor directories.
- *
- * @return self[]
- */
- public static function getRegisteredLoaders()
- {
- return self::$registeredLoaders;
- }
-
- /**
- * @param string $class
- * @param string $ext
- * @return string|false
- */
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
@@ -561,10 +438,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
new file mode 100644
index 0000000..b3a4e16
--- /dev/null
+++ b/vendor/composer/InstalledVersions.php
@@ -0,0 +1,337 @@
+<?php
+
+/*
+ * This file is part of Composer.
+ *
+ * (c) Nils Adermann <naderman@naderman.de>
+ * Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * 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 it's presence, you can require `composer-runtime-api ^2.0`
+ */
+class InstalledVersions
+{
+ private static $installed;
+ private static $canGetVendors;
+ 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<string>
+ */
+ 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<string>
+ */
+ 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}
+ */
+ 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}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
+ */
+ 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<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
+ */
+ 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}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
+ */
+ 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;
+ }
+}
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index 570762b..799bc34 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -6,28 +6,33 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
- 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+ 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+ 'Bamarni\\Composer\\Bin\\BinCommand' => $vendorDir . '/bamarni/composer-bin-plugin/src/BinCommand.php',
+ 'Bamarni\\Composer\\Bin\\CommandProvider' => $vendorDir . '/bamarni/composer-bin-plugin/src/CommandProvider.php',
+ 'Bamarni\\Composer\\Bin\\Config' => $vendorDir . '/bamarni/composer-bin-plugin/src/Config.php',
+ 'Bamarni\\Composer\\Bin\\Plugin' => $vendorDir . '/bamarni/composer-bin-plugin/src/Plugin.php',
+ 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
'NC\\Updater\\CommandApplication' => $baseDir . '/lib/CommandApplication.php',
'NC\\Updater\\LogException' => $baseDir . '/lib/LogException.php',
'NC\\Updater\\RecursiveDirectoryIteratorWithoutData' => $baseDir . '/lib/RecursiveDirectoryIteratorWithoutData.php',
'NC\\Updater\\UpdateCommand' => $baseDir . '/lib/UpdateCommand.php',
'NC\\Updater\\UpdateException' => $baseDir . '/lib/UpdateException.php',
'NC\\Updater\\Updater' => $baseDir . '/lib/Updater.php',
- 'NC\\Updater\\Version' => $baseDir . '/lib/Version.php',
- 'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
- 'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
- 'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
- 'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php',
- 'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php',
- 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
- 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
- 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
- 'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
+ 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
+ 'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
+ 'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
+ 'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
+ 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'Symfony\\Component\\Console\\Application' => $vendorDir . '/symfony/console/Application.php',
+ 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => $vendorDir . '/symfony/console/CommandLoader/CommandLoaderInterface.php',
+ 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/ContainerCommandLoader.php',
+ 'Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => $vendorDir . '/symfony/console/CommandLoader/FactoryCommandLoader.php',
'Symfony\\Component\\Console\\Command\\Command' => $vendorDir . '/symfony/console/Command/Command.php',
'Symfony\\Component\\Console\\Command\\HelpCommand' => $vendorDir . '/symfony/console/Command/HelpCommand.php',
'Symfony\\Component\\Console\\Command\\ListCommand' => $vendorDir . '/symfony/console/Command/ListCommand.php',
+ 'Symfony\\Component\\Console\\Command\\LockableTrait' => $vendorDir . '/symfony/console/Command/LockableTrait.php',
'Symfony\\Component\\Console\\ConsoleEvents' => $vendorDir . '/symfony/console/ConsoleEvents.php',
+ 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => $vendorDir . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php',
'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => $vendorDir . '/symfony/console/Descriptor/ApplicationDescription.php',
'Symfony\\Component\\Console\\Descriptor\\Descriptor' => $vendorDir . '/symfony/console/Descriptor/Descriptor.php',
'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => $vendorDir . '/symfony/console/Descriptor/DescriptorInterface.php',
@@ -35,23 +40,28 @@ return array(
'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => $vendorDir . '/symfony/console/Descriptor/MarkdownDescriptor.php',
'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => $vendorDir . '/symfony/console/Descriptor/TextDescriptor.php',
'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => $vendorDir . '/symfony/console/Descriptor/XmlDescriptor.php',
+ 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => $vendorDir . '/symfony/console/EventListener/ErrorListener.php',
'Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => $vendorDir . '/symfony/console/Event/ConsoleCommandEvent.php',
+ 'Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => $vendorDir . '/symfony/console/Event/ConsoleErrorEvent.php',
'Symfony\\Component\\Console\\Event\\ConsoleEvent' => $vendorDir . '/symfony/console/Event/ConsoleEvent.php',
- 'Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent' => $vendorDir . '/symfony/console/Event/ConsoleExceptionEvent.php',
'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => $vendorDir . '/symfony/console/Event/ConsoleTerminateEvent.php',
'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => $vendorDir . '/symfony/console/Exception/CommandNotFoundException.php',
'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/console/Exception/ExceptionInterface.php',
'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/console/Exception/InvalidArgumentException.php',
'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => $vendorDir . '/symfony/console/Exception/InvalidOptionException.php',
'Symfony\\Component\\Console\\Exception\\LogicException' => $vendorDir . '/symfony/console/Exception/LogicException.php',
+ 'Symfony\\Component\\Console\\Exception\\MissingInputException' => $vendorDir . '/symfony/console/Exception/MissingInputException.php',
+ 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => $vendorDir . '/symfony/console/Exception/NamespaceNotFoundException.php',
'Symfony\\Component\\Console\\Exception\\RuntimeException' => $vendorDir . '/symfony/console/Exception/RuntimeException.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => $vendorDir . '/symfony/console/Formatter/OutputFormatter.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterInterface.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyle.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleInterface.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => $vendorDir . '/symfony/console/Formatter/OutputFormatterStyleStack.php',
+ 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => $vendorDir . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php',
'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => $vendorDir . '/symfony/console/Helper/DebugFormatterHelper.php',
'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => $vendorDir . '/symfony/console/Helper/DescriptorHelper.php',
+ 'Symfony\\Component\\Console\\Helper\\Dumper' => $vendorDir . '/symfony/console/Helper/Dumper.php',
'Symfony\\Component\\Console\\Helper\\FormatterHelper' => $vendorDir . '/symfony/console/Helper/FormatterHelper.php',
'Symfony\\Component\\Console\\Helper\\Helper' => $vendorDir . '/symfony/console/Helper/Helper.php',
'Symfony\\Component\\Console\\Helper\\HelperInterface' => $vendorDir . '/symfony/console/Helper/HelperInterface.php',
@@ -64,6 +74,7 @@ return array(
'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => $vendorDir . '/symfony/console/Helper/SymfonyQuestionHelper.php',
'Symfony\\Component\\Console\\Helper\\Table' => $vendorDir . '/symfony/console/Helper/Table.php',
'Symfony\\Component\\Console\\Helper\\TableCell' => $vendorDir . '/symfony/console/Helper/TableCell.php',
+ 'Symfony\\Component\\Console\\Helper\\TableRows' => $vendorDir . '/symfony/console/Helper/TableRows.php',
'Symfony\\Component\\Console\\Helper\\TableSeparator' => $vendorDir . '/symfony/console/Helper/TableSeparator.php',
'Symfony\\Component\\Console\\Helper\\TableStyle' => $vendorDir . '/symfony/console/Helper/TableStyle.php',
'Symfony\\Component\\Console\\Input\\ArgvInput' => $vendorDir . '/symfony/console/Input/ArgvInput.php',
@@ -74,39 +85,40 @@ return array(
'Symfony\\Component\\Console\\Input\\InputDefinition' => $vendorDir . '/symfony/console/Input/InputDefinition.php',
'Symfony\\Component\\Console\\Input\\InputInterface' => $vendorDir . '/symfony/console/Input/InputInterface.php',
'Symfony\\Component\\Console\\Input\\InputOption' => $vendorDir . '/symfony/console/Input/InputOption.php',
+ 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => $vendorDir . '/symfony/console/Input/StreamableInputInterface.php',
'Symfony\\Component\\Console\\Input\\StringInput' => $vendorDir . '/symfony/console/Input/StringInput.php',
'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => $vendorDir . '/symfony/console/Logger/ConsoleLogger.php',
'Symfony\\Component\\Console\\Output\\BufferedOutput' => $vendorDir . '/symfony/console/Output/BufferedOutput.php',
'Symfony\\Component\\Console\\Output\\ConsoleOutput' => $vendorDir . '/symfony/console/Output/ConsoleOutput.php',
'Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => $vendorDir . '/symfony/console/Output/ConsoleOutputInterface.php',
+ 'Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => $vendorDir . '/symfony/console/Output/ConsoleSectionOutput.php',
'Symfony\\Component\\Console\\Output\\NullOutput' => $vendorDir . '/symfony/console/Output/NullOutput.php',
'Symfony\\Component\\Console\\Output\\Output' => $vendorDir . '/symfony/console/Output/Output.php',
'Symfony\\Component\\Console\\Output\\OutputInterface' => $vendorDir . '/symfony/console/Output/OutputInterface.php',
'Symfony\\Component\\Console\\Output\\StreamOutput' => $vendorDir . '/symfony/console/Output/StreamOutput.php',
+ 'Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => $vendorDir . '/symfony/console/Output/TrimmedBufferOutput.php',
'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => $vendorDir . '/symfony/console/Question/ChoiceQuestion.php',
'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => $vendorDir . '/symfony/console/Question/ConfirmationQuestion.php',
'Symfony\\Component\\Console\\Question\\Question' => $vendorDir . '/symfony/console/Question/Question.php',
'Symfony\\Component\\Console\\Style\\OutputStyle' => $vendorDir . '/symfony/console/Style/OutputStyle.php',
'Symfony\\Component\\Console\\Style\\StyleInterface' => $vendorDir . '/symfony/console/Style/StyleInterface.php',
'Symfony\\Component\\Console\\Style\\SymfonyStyle' => $vendorDir . '/symfony/console/Style/SymfonyStyle.php',
+ 'Symfony\\Component\\Console\\Terminal' => $vendorDir . '/symfony/console/Terminal.php',
'Symfony\\Component\\Console\\Tester\\ApplicationTester' => $vendorDir . '/symfony/console/Tester/ApplicationTester.php',
'Symfony\\Component\\Console\\Tester\\CommandTester' => $vendorDir . '/symfony/console/Tester/CommandTester.php',
- 'Symfony\\Component\\Debug\\BufferingLogger' => $vendorDir . '/symfony/debug/BufferingLogger.php',
- 'Symfony\\Component\\Debug\\Debug' => $vendorDir . '/symfony/debug/Debug.php',
- 'Symfony\\Component\\Debug\\DebugClassLoader' => $vendorDir . '/symfony/debug/DebugClassLoader.php',
- 'Symfony\\Component\\Debug\\ErrorHandler' => $vendorDir . '/symfony/debug/ErrorHandler.php',
- 'Symfony\\Component\\Debug\\ExceptionHandler' => $vendorDir . '/symfony/debug/ExceptionHandler.php',
- 'Symfony\\Component\\Debug\\Exception\\ClassNotFoundException' => $vendorDir . '/symfony/debug/Exception/ClassNotFoundException.php',
- 'Symfony\\Component\\Debug\\Exception\\ContextErrorException' => $vendorDir . '/symfony/debug/Exception/ContextErrorException.php',
- 'Symfony\\Component\\Debug\\Exception\\FatalErrorException' => $vendorDir . '/symfony/debug/Exception/FatalErrorException.php',
- 'Symfony\\Component\\Debug\\Exception\\FatalThrowableError' => $vendorDir . '/symfony/debug/Exception/FatalThrowableError.php',
- 'Symfony\\Component\\Debug\\Exception\\FlattenException' => $vendorDir . '/symfony/debug/Exception/FlattenException.php',
- 'Symfony\\Component\\Debug\\Exception\\OutOfMemoryException' => $vendorDir . '/symfony/debug/Exception/OutOfMemoryException.php',
- 'Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException' => $vendorDir . '/symfony/debug/Exception/UndefinedFunctionException.php',
- 'Symfony\\Component\\Debug\\Exception\\UndefinedMethodException' => $vendorDir . '/symfony/debug/Exception/UndefinedMethodException.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\ClassNotFoundFatalErrorHandler' => $vendorDir . '/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\FatalErrorHandlerInterface' => $vendorDir . '/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedFunctionFatalErrorHandler' => $vendorDir . '/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedMethodFatalErrorHandler' => $vendorDir . '/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php',
+ 'Symfony\\Component\\Console\\Tester\\TesterTrait' => $vendorDir . '/symfony/console/Tester/TesterTrait.php',
+ 'Symfony\\Contracts\\Service\\Attribute\\Required' => $vendorDir . '/symfony/service-contracts/Attribute/Required.php',
+ 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => $vendorDir . '/symfony/service-contracts/Attribute/SubscribedService.php',
+ 'Symfony\\Contracts\\Service\\ResetInterface' => $vendorDir . '/symfony/service-contracts/ResetInterface.php',
+ 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php',
+ 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => $vendorDir . '/symfony/service-contracts/ServiceProviderInterface.php',
+ 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberInterface.php',
+ 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceSubscriberTrait.php',
+ 'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => $vendorDir . '/symfony/service-contracts/Test/ServiceLocatorTest.php',
'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php',
+ 'Symfony\\Polyfill\\Php73\\Php73' => $vendorDir . '/symfony/polyfill-php73/Php73.php',
+ 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php',
+ 'Symfony\\Polyfill\\Php80\\PhpToken' => $vendorDir . '/symfony/polyfill-php80/PhpToken.php',
+ 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+ 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php
index 315ab83..920b04e 100644
--- a/vendor/composer/autoload_files.php
+++ b/vendor/composer/autoload_files.php
@@ -6,5 +6,8 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
+ '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
+ '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
+ 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
);
diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php
index 2cef3fe..5325496 100644
--- a/vendor/composer/autoload_psr4.php
+++ b/vendor/composer/autoload_psr4.php
@@ -6,9 +6,12 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
+ 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
+ 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
- 'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
+ 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'),
'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
- 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
+ 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'NC\\Updater\\' => array($baseDir . '/lib'),
+ 'Bamarni\\Composer\\Bin\\' => array($vendorDir . '/bamarni/composer-bin-plugin/src'),
);
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 2096a58..5cd1eb8 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit994b8d870ddb923ebc3ff0ceaaaa96a6
+class ComposerAutoloaderInit2723bf3c902a907c44396c9253500aff
{
private static $loader;
@@ -22,17 +22,15 @@ class ComposerAutoloaderInit994b8d870ddb923ebc3ff0ceaaaa96a6
return self::$loader;
}
- require __DIR__ . '/platform_check.php';
-
- spl_autoload_register(array('ComposerAutoloaderInit994b8d870ddb923ebc3ff0ceaaaa96a6', 'loadClassLoader'), true, true);
- self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
- spl_autoload_unregister(array('ComposerAutoloaderInit994b8d870ddb923ebc3ff0ceaaaa96a6', 'loadClassLoader'));
+ spl_autoload_register(array('ComposerAutoloaderInit2723bf3c902a907c44396c9253500aff', 'loadClassLoader'), true, true);
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
+ spl_autoload_unregister(array('ComposerAutoloaderInit2723bf3c902a907c44396c9253500aff', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
- require __DIR__ . '/autoload_static.php';
+ require_once __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticInit2723bf3c902a907c44396c9253500aff::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@@ -44,28 +42,23 @@ class ComposerAutoloaderInit994b8d870ddb923ebc3ff0ceaaaa96a6
$loader->register(true);
if ($useStaticLoader) {
- $includeFiles = Composer\Autoload\ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6::$files;
+ $includeFiles = Composer\Autoload\ComposerStaticInit2723bf3c902a907c44396c9253500aff::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire994b8d870ddb923ebc3ff0ceaaaa96a6($fileIdentifier, $file);
+ composerRequire2723bf3c902a907c44396c9253500aff($fileIdentifier, $file);
}
return $loader;
}
}
-/**
- * @param string $fileIdentifier
- * @param string $file
- * @return void
- */
-function composerRequire994b8d870ddb923ebc3ff0ceaaaa96a6($fileIdentifier, $file)
+function composerRequire2723bf3c902a907c44396c9253500aff($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 ba2aacb..d6355f2 100644
--- a/vendor/composer/autoload_static.php
+++ b/vendor/composer/autoload_static.php
@@ -4,75 +4,101 @@
namespace Composer\Autoload;
-class ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6
+class ComposerStaticInit2723bf3c902a907c44396c9253500aff
{
public static $files = array (
+ '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
+ '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
+ 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
);
public static $prefixLengthsPsr4 = array (
'S' =>
array (
+ 'Symfony\\Polyfill\\Php80\\' => 23,
+ 'Symfony\\Polyfill\\Php73\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
- 'Symfony\\Component\\Debug\\' => 24,
+ 'Symfony\\Contracts\\Service\\' => 26,
'Symfony\\Component\\Console\\' => 26,
),
'P' =>
array (
- 'Psr\\Log\\' => 8,
+ 'Psr\\Container\\' => 14,
),
'N' =>
array (
'NC\\Updater\\' => 11,
),
+ 'B' =>
+ array (
+ 'Bamarni\\Composer\\Bin\\' => 21,
+ ),
);
public static $prefixDirsPsr4 = array (
+ 'Symfony\\Polyfill\\Php80\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
+ ),
+ 'Symfony\\Polyfill\\Php73\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/symfony/polyfill-php73',
+ ),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
),
- 'Symfony\\Component\\Debug\\' =>
+ 'Symfony\\Contracts\\Service\\' =>
array (
- 0 => __DIR__ . '/..' . '/symfony/debug',
+ 0 => __DIR__ . '/..' . '/symfony/service-contracts',
),
'Symfony\\Component\\Console\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/console',
),
- 'Psr\\Log\\' =>
+ 'Psr\\Container\\' =>
array (
- 0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
+ 0 => __DIR__ . '/..' . '/psr/container/src',
),
'NC\\Updater\\' =>
array (
0 => __DIR__ . '/../..' . '/lib',
),
+ 'Bamarni\\Composer\\Bin\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/bamarni/composer-bin-plugin/src',
+ ),
);
public static $classMap = array (
- 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
+ 'Bamarni\\Composer\\Bin\\BinCommand' => __DIR__ . '/..' . '/bamarni/composer-bin-plugin/src/BinCommand.php',
+ 'Bamarni\\Composer\\Bin\\CommandProvider' => __DIR__ . '/..' . '/bamarni/composer-bin-plugin/src/CommandProvider.php',
+ 'Bamarni\\Composer\\Bin\\Config' => __DIR__ . '/..' . '/bamarni/composer-bin-plugin/src/Config.php',
+ 'Bamarni\\Composer\\Bin\\Plugin' => __DIR__ . '/..' . '/bamarni/composer-bin-plugin/src/Plugin.php',
+ 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php',
'NC\\Updater\\CommandApplication' => __DIR__ . '/../..' . '/lib/CommandApplication.php',
'NC\\Updater\\LogException' => __DIR__ . '/../..' . '/lib/LogException.php',
'NC\\Updater\\RecursiveDirectoryIteratorWithoutData' => __DIR__ . '/../..' . '/lib/RecursiveDirectoryIteratorWithoutData.php',
'NC\\Updater\\UpdateCommand' => __DIR__ . '/../..' . '/lib/UpdateCommand.php',
'NC\\Updater\\UpdateException' => __DIR__ . '/../..' . '/lib/UpdateException.php',
'NC\\Updater\\Updater' => __DIR__ . '/../..' . '/lib/Updater.php',
- 'NC\\Updater\\Version' => __DIR__ . '/../..' . '/lib/Version.php',
- 'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
- 'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
- 'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
- 'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php',
- 'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php',
- 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
- 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
- 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
- 'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
+ 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
+ 'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
+ 'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
+ 'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
+ 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'Symfony\\Component\\Console\\Application' => __DIR__ . '/..' . '/symfony/console/Application.php',
+ 'Symfony\\Component\\Console\\CommandLoader\\CommandLoaderInterface' => __DIR__ . '/..' . '/symfony/console/CommandLoader/CommandLoaderInterface.php',
+ 'Symfony\\Component\\Console\\CommandLoader\\ContainerCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/ContainerCommandLoader.php',
+ 'Symfony\\Component\\Console\\CommandLoader\\FactoryCommandLoader' => __DIR__ . '/..' . '/symfony/console/CommandLoader/FactoryCommandLoader.php',
'Symfony\\Component\\Console\\Command\\Command' => __DIR__ . '/..' . '/symfony/console/Command/Command.php',
'Symfony\\Component\\Console\\Command\\HelpCommand' => __DIR__ . '/..' . '/symfony/console/Command/HelpCommand.php',
'Symfony\\Component\\Console\\Command\\ListCommand' => __DIR__ . '/..' . '/symfony/console/Command/ListCommand.php',
+ 'Symfony\\Component\\Console\\Command\\LockableTrait' => __DIR__ . '/..' . '/symfony/console/Command/LockableTrait.php',
'Symfony\\Component\\Console\\ConsoleEvents' => __DIR__ . '/..' . '/symfony/console/ConsoleEvents.php',
+ 'Symfony\\Component\\Console\\DependencyInjection\\AddConsoleCommandPass' => __DIR__ . '/..' . '/symfony/console/DependencyInjection/AddConsoleCommandPass.php',
'Symfony\\Component\\Console\\Descriptor\\ApplicationDescription' => __DIR__ . '/..' . '/symfony/console/Descriptor/ApplicationDescription.php',
'Symfony\\Component\\Console\\Descriptor\\Descriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/Descriptor.php',
'Symfony\\Component\\Console\\Descriptor\\DescriptorInterface' => __DIR__ . '/..' . '/symfony/console/Descriptor/DescriptorInterface.php',
@@ -80,23 +106,28 @@ class ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6
'Symfony\\Component\\Console\\Descriptor\\MarkdownDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/MarkdownDescriptor.php',
'Symfony\\Component\\Console\\Descriptor\\TextDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/TextDescriptor.php',
'Symfony\\Component\\Console\\Descriptor\\XmlDescriptor' => __DIR__ . '/..' . '/symfony/console/Descriptor/XmlDescriptor.php',
+ 'Symfony\\Component\\Console\\EventListener\\ErrorListener' => __DIR__ . '/..' . '/symfony/console/EventListener/ErrorListener.php',
'Symfony\\Component\\Console\\Event\\ConsoleCommandEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleCommandEvent.php',
+ 'Symfony\\Component\\Console\\Event\\ConsoleErrorEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleErrorEvent.php',
'Symfony\\Component\\Console\\Event\\ConsoleEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleEvent.php',
- 'Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleExceptionEvent.php',
'Symfony\\Component\\Console\\Event\\ConsoleTerminateEvent' => __DIR__ . '/..' . '/symfony/console/Event/ConsoleTerminateEvent.php',
'Symfony\\Component\\Console\\Exception\\CommandNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/CommandNotFoundException.php',
'Symfony\\Component\\Console\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/console/Exception/ExceptionInterface.php',
'Symfony\\Component\\Console\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidArgumentException.php',
'Symfony\\Component\\Console\\Exception\\InvalidOptionException' => __DIR__ . '/..' . '/symfony/console/Exception/InvalidOptionException.php',
'Symfony\\Component\\Console\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/console/Exception/LogicException.php',
+ 'Symfony\\Component\\Console\\Exception\\MissingInputException' => __DIR__ . '/..' . '/symfony/console/Exception/MissingInputException.php',
+ 'Symfony\\Component\\Console\\Exception\\NamespaceNotFoundException' => __DIR__ . '/..' . '/symfony/console/Exception/NamespaceNotFoundException.php',
'Symfony\\Component\\Console\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/console/Exception/RuntimeException.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatter' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatter.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterInterface.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyle.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleInterface.php',
'Symfony\\Component\\Console\\Formatter\\OutputFormatterStyleStack' => __DIR__ . '/..' . '/symfony/console/Formatter/OutputFormatterStyleStack.php',
+ 'Symfony\\Component\\Console\\Formatter\\WrappableOutputFormatterInterface' => __DIR__ . '/..' . '/symfony/console/Formatter/WrappableOutputFormatterInterface.php',
'Symfony\\Component\\Console\\Helper\\DebugFormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DebugFormatterHelper.php',
'Symfony\\Component\\Console\\Helper\\DescriptorHelper' => __DIR__ . '/..' . '/symfony/console/Helper/DescriptorHelper.php',
+ 'Symfony\\Component\\Console\\Helper\\Dumper' => __DIR__ . '/..' . '/symfony/console/Helper/Dumper.php',
'Symfony\\Component\\Console\\Helper\\FormatterHelper' => __DIR__ . '/..' . '/symfony/console/Helper/FormatterHelper.php',
'Symfony\\Component\\Console\\Helper\\Helper' => __DIR__ . '/..' . '/symfony/console/Helper/Helper.php',
'Symfony\\Component\\Console\\Helper\\HelperInterface' => __DIR__ . '/..' . '/symfony/console/Helper/HelperInterface.php',
@@ -109,6 +140,7 @@ class ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6
'Symfony\\Component\\Console\\Helper\\SymfonyQuestionHelper' => __DIR__ . '/..' . '/symfony/console/Helper/SymfonyQuestionHelper.php',
'Symfony\\Component\\Console\\Helper\\Table' => __DIR__ . '/..' . '/symfony/console/Helper/Table.php',
'Symfony\\Component\\Console\\Helper\\TableCell' => __DIR__ . '/..' . '/symfony/console/Helper/TableCell.php',
+ 'Symfony\\Component\\Console\\Helper\\TableRows' => __DIR__ . '/..' . '/symfony/console/Helper/TableRows.php',
'Symfony\\Component\\Console\\Helper\\TableSeparator' => __DIR__ . '/..' . '/symfony/console/Helper/TableSeparator.php',
'Symfony\\Component\\Console\\Helper\\TableStyle' => __DIR__ . '/..' . '/symfony/console/Helper/TableStyle.php',
'Symfony\\Component\\Console\\Input\\ArgvInput' => __DIR__ . '/..' . '/symfony/console/Input/ArgvInput.php',
@@ -119,49 +151,50 @@ class ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6
'Symfony\\Component\\Console\\Input\\InputDefinition' => __DIR__ . '/..' . '/symfony/console/Input/InputDefinition.php',
'Symfony\\Component\\Console\\Input\\InputInterface' => __DIR__ . '/..' . '/symfony/console/Input/InputInterface.php',
'Symfony\\Component\\Console\\Input\\InputOption' => __DIR__ . '/..' . '/symfony/console/Input/InputOption.php',
+ 'Symfony\\Component\\Console\\Input\\StreamableInputInterface' => __DIR__ . '/..' . '/symfony/console/Input/StreamableInputInterface.php',
'Symfony\\Component\\Console\\Input\\StringInput' => __DIR__ . '/..' . '/symfony/console/Input/StringInput.php',
'Symfony\\Component\\Console\\Logger\\ConsoleLogger' => __DIR__ . '/..' . '/symfony/console/Logger/ConsoleLogger.php',
'Symfony\\Component\\Console\\Output\\BufferedOutput' => __DIR__ . '/..' . '/symfony/console/Output/BufferedOutput.php',
'Symfony\\Component\\Console\\Output\\ConsoleOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutput.php',
'Symfony\\Component\\Console\\Output\\ConsoleOutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleOutputInterface.php',
+ 'Symfony\\Component\\Console\\Output\\ConsoleSectionOutput' => __DIR__ . '/..' . '/symfony/console/Output/ConsoleSectionOutput.php',
'Symfony\\Component\\Console\\Output\\NullOutput' => __DIR__ . '/..' . '/symfony/console/Output/NullOutput.php',
'Symfony\\Component\\Console\\Output\\Output' => __DIR__ . '/..' . '/symfony/console/Output/Output.php',
'Symfony\\Component\\Console\\Output\\OutputInterface' => __DIR__ . '/..' . '/symfony/console/Output/OutputInterface.php',
'Symfony\\Component\\Console\\Output\\StreamOutput' => __DIR__ . '/..' . '/symfony/console/Output/StreamOutput.php',
+ 'Symfony\\Component\\Console\\Output\\TrimmedBufferOutput' => __DIR__ . '/..' . '/symfony/console/Output/TrimmedBufferOutput.php',
'Symfony\\Component\\Console\\Question\\ChoiceQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ChoiceQuestion.php',
'Symfony\\Component\\Console\\Question\\ConfirmationQuestion' => __DIR__ . '/..' . '/symfony/console/Question/ConfirmationQuestion.php',
'Symfony\\Component\\Console\\Question\\Question' => __DIR__ . '/..' . '/symfony/console/Question/Question.php',
'Symfony\\Component\\Console\\Style\\OutputStyle' => __DIR__ . '/..' . '/symfony/console/Style/OutputStyle.php',
'Symfony\\Component\\Console\\Style\\StyleInterface' => __DIR__ . '/..' . '/symfony/console/Style/StyleInterface.php',
'Symfony\\Component\\Console\\Style\\SymfonyStyle' => __DIR__ . '/..' . '/symfony/console/Style/SymfonyStyle.php',
+ 'Symfony\\Component\\Console\\Terminal' => __DIR__ . '/..' . '/symfony/console/Terminal.php',
'Symfony\\Component\\Console\\Tester\\ApplicationTester' => __DIR__ . '/..' . '/symfony/console/Tester/ApplicationTester.php',
'Symfony\\Component\\Console\\Tester\\CommandTester' => __DIR__ . '/..' . '/symfony/console/Tester/CommandTester.php',
- 'Symfony\\Component\\Debug\\BufferingLogger' => __DIR__ . '/..' . '/symfony/debug/BufferingLogger.php',
- 'Symfony\\Component\\Debug\\Debug' => __DIR__ . '/..' . '/symfony/debug/Debug.php',
- 'Symfony\\Component\\Debug\\DebugClassLoader' => __DIR__ . '/..' . '/symfony/debug/DebugClassLoader.php',
- 'Symfony\\Component\\Debug\\ErrorHandler' => __DIR__ . '/..' . '/symfony/debug/ErrorHandler.php',
- 'Symfony\\Component\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/symfony/debug/ExceptionHandler.php',
- 'Symfony\\Component\\Debug\\Exception\\ClassNotFoundException' => __DIR__ . '/..' . '/symfony/debug/Exception/ClassNotFoundException.php',
- 'Symfony\\Component\\Debug\\Exception\\ContextErrorException' => __DIR__ . '/..' . '/symfony/debug/Exception/ContextErrorException.php',
- 'Symfony\\Component\\Debug\\Exception\\FatalErrorException' => __DIR__ . '/..' . '/symfony/debug/Exception/FatalErrorException.php',
- 'Symfony\\Component\\Debug\\Exception\\FatalThrowableError' => __DIR__ . '/..' . '/symfony/debug/Exception/FatalThrowableError.php',
- 'Symfony\\Component\\Debug\\Exception\\FlattenException' => __DIR__ . '/..' . '/symfony/debug/Exception/FlattenException.php',
- 'Symfony\\Component\\Debug\\Exception\\OutOfMemoryException' => __DIR__ . '/..' . '/symfony/debug/Exception/OutOfMemoryException.php',
- 'Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException' => __DIR__ . '/..' . '/symfony/debug/Exception/UndefinedFunctionException.php',
- 'Symfony\\Component\\Debug\\Exception\\UndefinedMethodException' => __DIR__ . '/..' . '/symfony/debug/Exception/UndefinedMethodException.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\ClassNotFoundFatalErrorHandler' => __DIR__ . '/..' . '/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\FatalErrorHandlerInterface' => __DIR__ . '/..' . '/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedFunctionFatalErrorHandler' => __DIR__ . '/..' . '/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php',
- 'Symfony\\Component\\Debug\\FatalErrorHandler\\UndefinedMethodFatalErrorHandler' => __DIR__ . '/..' . '/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php',
+ 'Symfony\\Component\\Console\\Tester\\TesterTrait' => __DIR__ . '/..' . '/symfony/console/Tester/TesterTrait.php',
+ 'Symfony\\Contracts\\Service\\Attribute\\Required' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/Required.php',
+ 'Symfony\\Contracts\\Service\\Attribute\\SubscribedService' => __DIR__ . '/..' . '/symfony/service-contracts/Attribute/SubscribedService.php',
+ 'Symfony\\Contracts\\Service\\ResetInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ResetInterface.php',
+ 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php',
+ 'Symfony\\Contracts\\Service\\ServiceProviderInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceProviderInterface.php',
+ 'Symfony\\Contracts\\Service\\ServiceSubscriberInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberInterface.php',
+ 'Symfony\\Contracts\\Service\\ServiceSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceSubscriberTrait.php',
+ 'Symfony\\Contracts\\Service\\Test\\ServiceLocatorTest' => __DIR__ . '/..' . '/symfony/service-contracts/Test/ServiceLocatorTest.php',
'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php',
+ 'Symfony\\Polyfill\\Php73\\Php73' => __DIR__ . '/..' . '/symfony/polyfill-php73/Php73.php',
+ 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php',
+ 'Symfony\\Polyfill\\Php80\\PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/PhpToken.php',
+ 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
+ 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6::$prefixDirsPsr4;
- $loader->classMap = ComposerStaticInit994b8d870ddb923ebc3ff0ceaaaa96a6::$classMap;
+ $loader->prefixLengthsPsr4 = ComposerStaticInit2723bf3c902a907c44396c9253500aff::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit2723bf3c902a907c44396c9253500aff::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInit2723bf3c902a907c44396c9253500aff::$classMap;
}, null, ClassLoader::class);
}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index a0c7fd4..5b5f112 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1,33 +1,76 @@
[
{
- "name": "psr/log",
- "version": "1.0.2",
- "version_normalized": "1.0.2.0",
+ "name": "bamarni/composer-bin-plugin",
+ "version": "v1.5.0",
+ "version_normalized": "1.5.0.0",
"source": {
"type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ "url": "https://github.com/bamarni/composer-bin-plugin.git",
+ "reference": "49934ffea764864788334c1485fbb08a4b852031"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "url": "https://api.github.com/repos/bamarni/composer-bin-plugin/zipball/49934ffea764864788334c1485fbb08a4b852031",
+ "reference": "49934ffea764864788334c1485fbb08a4b852031",
"shasum": ""
},
"require": {
- "php": ">=5.3.0"
+ "composer-plugin-api": "^1.0 || ^2.0",
+ "php": "^5.5.9 || ^7.0 || ^8.0"
},
- "time": "2016-10-10T12:19:37+00:00",
- "type": "library",
+ "require-dev": {
+ "composer/composer": "^1.0 || ^2.0",
+ "symfony/console": "^2.5 || ^3.0 || ^4.0"
+ },
+ "time": "2022-02-22T21:01:25+00:00",
+ "type": "composer-plugin",
"extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
+ "class": "Bamarni\\Composer\\Bin\\Plugin"
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Bamarni\\Composer\\Bin\\": "src"
}
},
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "No conflicts for your bin dependencies",
+ "keywords": [
+ "composer",
+ "conflict",
+ "dependency",
+ "executable",
+ "isolation",
+ "tool"
+ ]
+ },
+ {
+ "name": "psr/container",
+ "version": "1.1.2",
+ "version_normalized": "1.1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
+ "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.4.0"
+ },
+ "time": "2021-11-05T16:50:12+00:00",
+ "type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
- "Psr\\Log\\": "Psr/Log/"
+ "Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -37,54 +80,76 @@
"authors": [
{
"name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
"keywords": [
- "log",
- "psr",
- "psr-3"
- ]
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/1.1.2"
+ }
},
{
- "name": "symfony/debug",
- "version": "v3.1.6",
- "version_normalized": "3.1.6.0",
+ "name": "symfony/console",
+ "version": "v4.4.43",
+ "version_normalized": "4.4.43.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/debug.git",
- "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8"
+ "url": "https://github.com/symfony/console.git",
+ "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/e2b3f74a67fc928adc3c1b9027f73e1bc01190a8",
- "reference": "e2b3f74a67fc928adc3c1b9027f73e1bc01190a8",
+ "url": "https://api.github.com/repos/symfony/console/zipball/8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
+ "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "psr/log": "~1.0"
+ "php": ">=7.1.3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php73": "^1.8",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2"
},
"conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ "psr/log": ">=3",
+ "symfony/dependency-injection": "<3.4",
+ "symfony/event-dispatcher": "<4.3|>=5",
+ "symfony/lock": "<4.4",
+ "symfony/process": "<3.3"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0"
},
"require-dev": {
- "symfony/class-loader": "~2.8|~3.0",
- "symfony/http-kernel": "~2.8|~3.0"
+ "psr/log": "^1|^2",
+ "symfony/config": "^3.4|^4.0|^5.0",
+ "symfony/dependency-injection": "^3.4|^4.0|^5.0",
+ "symfony/event-dispatcher": "^4.3",
+ "symfony/lock": "^4.4|^5.0",
+ "symfony/process": "^3.4|^4.0|^5.0",
+ "symfony/var-dumper": "^4.3|^5.0"
},
- "time": "2016-09-06T11:02:40+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
+ "suggest": {
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/lock": "",
+ "symfony/process": ""
},
+ "time": "2022-06-23T12:22:25+00:00",
+ "type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
- "Symfony\\Component\\Debug\\": ""
+ "Symfony\\Component\\Console\\": ""
},
"exclude-from-classmap": [
"/Tests/"
@@ -104,44 +169,219 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Debug Component",
- "homepage": "https://symfony.com"
+ "description": "Eases the creation of beautiful and testable command line interfaces",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v4.4.43"
+ },
+ "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"
+ }
+ ]
+ },
+ {
+ "name": "symfony/deprecation-contracts",
+ "version": "v2.5.2",
+ "version_normalized": "2.5.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+ "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "time": "2022-01-02T09:53:40+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "function.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "A generic function and convention to trigger deprecation notices",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
+ },
+ "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"
+ }
+ ]
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.2.0",
- "version_normalized": "1.2.0.0",
+ "version": "v1.26.0",
+ "version_normalized": "1.26.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "dff51f72b0706335131b00a7f49606168c582594"
+ "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594",
- "reference": "dff51f72b0706335131b00a7f49606168c582594",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
+ "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-mbstring": "*"
},
"suggest": {
"ext-mbstring": "For best performance"
},
- "time": "2016-05-18T14:26:46+00:00",
+ "time": "2022-05-24T11:49:31+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
},
"installation-source": "dist",
"autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
+ },
+ "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"
+ }
+ ]
+ },
+ {
+ "name": "symfony/polyfill-php73",
+ "version": "v1.26.0",
+ "version_normalized": "1.26.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php73.git",
+ "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/e440d35fa0286f77fb45b79a03fedbeda9307e85",
+ "reference": "e440d35fa0286f77fb45b79a03fedbeda9307e85",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "time": "2022-05-24T11:49:31+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
"files": [
"bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php73\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -158,61 +398,159 @@
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony polyfill for the Mbstring extension",
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
- "mbstring",
"polyfill",
"portable",
"shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0"
+ },
+ "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"
+ }
]
},
{
- "name": "symfony/console",
- "version": "v3.1.6",
- "version_normalized": "3.1.6.0",
+ "name": "symfony/polyfill-php80",
+ "version": "v1.26.0",
+ "version_normalized": "1.26.0.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065"
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/c99da1119ae61e15de0e4829196b9fba6f73d065",
- "reference": "c99da1119ae61e15de0e4829196b9fba6f73d065",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
+ "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
"shasum": ""
},
"require": {
- "php": ">=5.5.9",
- "symfony/debug": "~2.8|~3.0",
- "symfony/polyfill-mbstring": "~1.0"
+ "php": ">=7.1"
},
- "require-dev": {
- "psr/log": "~1.0",
- "symfony/event-dispatcher": "~2.8|~3.0",
- "symfony/process": "~2.8|~3.0"
+ "time": "2022-05-10T07:21:04+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
+ },
+ "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"
+ }
+ ]
+ },
+ {
+ "name": "symfony/service-contracts",
+ "version": "v2.5.2",
+ "version_normalized": "2.5.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/service-contracts.git",
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
+ "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2.5",
+ "psr/container": "^1.1",
+ "symfony/deprecation-contracts": "^2.1|^3"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
},
"suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/process": ""
+ "symfony/service-implementation": ""
},
- "time": "2016-10-06T01:44:51+00:00",
+ "time": "2022-05-30T19:17:29+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
- "Symfony\\Component\\Console\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
+ "Symfony\\Contracts\\Service\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -220,15 +558,40 @@
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
- "description": "Symfony Console Component",
- "homepage": "https://symfony.com"
+ "description": "Generic abstractions related to writing services",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/service-contracts/tree/v2.5.2"
+ },
+ "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"
+ }
+ ]
}
]
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
new file mode 100644
index 0000000..701ecf3
--- /dev/null
+++ b/vendor/composer/installed.php
@@ -0,0 +1,101 @@
+<?php return array(
+ 'root' => array(
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => '0272cf514a21042263535c1555af65a1f920effb',
+ 'name' => '__root__',
+ 'dev' => true,
+ ),
+ 'versions' => array(
+ '__root__' => array(
+ 'pretty_version' => 'dev-master',
+ 'version' => 'dev-master',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'reference' => '0272cf514a21042263535c1555af65a1f920effb',
+ 'dev_requirement' => false,
+ ),
+ 'bamarni/composer-bin-plugin' => array(
+ 'pretty_version' => 'v1.5.0',
+ 'version' => '1.5.0.0',
+ 'type' => 'composer-plugin',
+ 'install_path' => __DIR__ . '/../bamarni/composer-bin-plugin',
+ 'aliases' => array(),
+ 'reference' => '49934ffea764864788334c1485fbb08a4b852031',
+ 'dev_requirement' => true,
+ ),
+ 'psr/container' => array(
+ 'pretty_version' => '1.1.2',
+ 'version' => '1.1.2.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/container',
+ 'aliases' => array(),
+ 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea',
+ 'dev_requirement' => false,
+ ),
+ 'psr/log-implementation' => array(
+ 'dev_requirement' => false,
+ 'provided' => array(
+ 0 => '1.0|2.0',
+ ),
+ ),
+ 'symfony/console' => array(
+ 'pretty_version' => 'v4.4.43',
+ 'version' => '4.4.43.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/console',
+ 'aliases' => array(),
+ 'reference' => '8a2628d2d5639f35113dc1b833ecd91e1ed1cf46',
+ 'dev_requirement' => false,
+ ),
+ 'symfony/deprecation-contracts' => array(
+ 'pretty_version' => 'v2.5.2',
+ 'version' => '2.5.2.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
+ 'aliases' => array(),
+ 'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
+ 'dev_requirement' => false,
+ ),
+ 'symfony/polyfill-mbstring' => array(
+ 'pretty_version' => 'v1.26.0',
+ 'version' => '1.26.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
+ 'aliases' => array(),
+ 'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e',
+ 'dev_requirement' => false,
+ ),
+ 'symfony/polyfill-php73' => array(
+ 'pretty_version' => 'v1.26.0',
+ 'version' => '1.26.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-php73',
+ 'aliases' => array(),
+ 'reference' => 'e440d35fa0286f77fb45b79a03fedbeda9307e85',
+ 'dev_requirement' => false,
+ ),
+ 'symfony/polyfill-php80' => array(
+ 'pretty_version' => 'v1.26.0',
+ 'version' => '1.26.0.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/polyfill-php80',
+ 'aliases' => array(),
+ 'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace',
+ 'dev_requirement' => false,
+ ),
+ 'symfony/service-contracts' => array(
+ 'pretty_version' => 'v2.5.2',
+ 'version' => '2.5.2.0',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../symfony/service-contracts',
+ 'aliases' => array(),
+ 'reference' => '4b426aac47d6427cc1a1d0f7e2ac724627f5966c',
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php
new file mode 100644
index 0000000..580fa96
--- /dev/null
+++ b/vendor/composer/platform_check.php
@@ -0,0 +1,26 @@
+<?php
+
+// platform_check.php @generated by Composer
+
+$issues = array();
+
+if (!(PHP_VERSION_ID >= 70400)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ trigger_error(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
+ E_USER_ERROR
+ );
+}
diff --git a/vendor/psr/container/.gitignore b/vendor/psr/container/.gitignore
new file mode 100644
index 0000000..b2395aa
--- /dev/null
+++ b/vendor/psr/container/.gitignore
@@ -0,0 +1,3 @@
+composer.lock
+composer.phar
+/vendor/
diff --git a/vendor/psr/container/LICENSE b/vendor/psr/container/LICENSE
new file mode 100644
index 0000000..2877a48
--- /dev/null
+++ b/vendor/psr/container/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013-2016 container-interop
+Copyright (c) 2016 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/container/README.md b/vendor/psr/container/README.md
new file mode 100644
index 0000000..1b9d9e5
--- /dev/null
+++ b/vendor/psr/container/README.md
@@ -0,0 +1,13 @@
+Container interface
+==============
+
+This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url].
+
+Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container.
+
+The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist.
+
+[psr-url]: https://www.php-fig.org/psr/psr-11/
+[package-url]: https://packagist.org/packages/psr/container
+[implementation-url]: https://packagist.org/providers/psr/container-implementation
+
diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json
new file mode 100644
index 0000000..017f41e
--- /dev/null
+++ b/vendor/psr/container/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "psr/container",
+ "type": "library",
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"],
+ "homepage": "https://github.com/php-fig/container",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "require": {
+ "php": ">=7.4.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ }
+}
diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php
new file mode 100644
index 0000000..0f213f2
--- /dev/null
+++ b/vendor/psr/container/src/ContainerExceptionInterface.php
@@ -0,0 +1,12 @@
+<?php
+
+namespace Psr\Container;
+
+use Throwable;
+
+/**
+ * Base interface representing a generic exception in a container.
+ */
+interface ContainerExceptionInterface extends Throwable
+{
+}
diff --git a/vendor/psr/container/src/ContainerInterface.php b/vendor/psr/container/src/ContainerInterface.php
new file mode 100644
index 0000000..cf8e7fd
--- /dev/null
+++ b/vendor/psr/container/src/ContainerInterface.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Psr\Container;
+
+/**
+ * Describes the interface of a container that exposes methods to read its entries.
+ */
+interface ContainerInterface
+{
+ /**
+ * Finds an entry of the container by its identifier and returns it.
+ *
+ * @param string $id Identifier of the entry to look for.
+ *
+ * @throws NotFoundExceptionInterface No entry was found for **this** identifier.
+ * @throws ContainerExceptionInterface Error while retrieving the entry.
+ *
+ * @return mixed Entry.
+ */
+ public function get(string $id);
+
+ /**
+ * Returns true if the container can return an entry for the given identifier.
+ * Returns false otherwise.
+ *
+ * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
+ * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
+ *
+ * @param string $id Identifier of the entry to look for.
+ *
+ * @return bool
+ */
+ public function has(string $id);
+}
diff --git a/vendor/psr/container/src/NotFoundExceptionInterface.php b/vendor/psr/container/src/NotFoundExceptionInterface.php
new file mode 100644
index 0000000..650bf46
--- /dev/null
+++ b/vendor/psr/container/src/NotFoundExceptionInterface.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Psr\Container;
+
+/**
+ * No entry was found in the container.
+ */
+interface NotFoundExceptionInterface extends ContainerExceptionInterface
+{
+}
diff --git a/vendor/psr/log/.gitignore b/vendor/psr/log/.gitignore
deleted file mode 100644
index 22d0d82..0000000
--- a/vendor/psr/log/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-vendor
diff --git a/vendor/psr/log/Psr/Log/AbstractLogger.php b/vendor/psr/log/Psr/Log/AbstractLogger.php
deleted file mode 100644
index 90e721a..0000000
--- a/vendor/psr/log/Psr/Log/AbstractLogger.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * This is a simple Logger implementation that other Loggers can inherit from.
- *
- * It simply delegates all log-level-specific methods to the `log` method to
- * reduce boilerplate code that a simple Logger that does the same thing with
- * messages regardless of the error level has to implement.
- */
-abstract class AbstractLogger implements LoggerInterface
-{
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function emergency($message, array $context = array())
- {
- $this->log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-}
diff --git a/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/vendor/psr/log/Psr/Log/InvalidArgumentException.php
deleted file mode 100644
index 67f852d..0000000
--- a/vendor/psr/log/Psr/Log/InvalidArgumentException.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-class InvalidArgumentException extends \InvalidArgumentException
-{
-}
diff --git a/vendor/psr/log/Psr/Log/LogLevel.php b/vendor/psr/log/Psr/Log/LogLevel.php
deleted file mode 100644
index 9cebcac..0000000
--- a/vendor/psr/log/Psr/Log/LogLevel.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Describes log levels.
- */
-class LogLevel
-{
- const EMERGENCY = 'emergency';
- const ALERT = 'alert';
- const CRITICAL = 'critical';
- const ERROR = 'error';
- const WARNING = 'warning';
- const NOTICE = 'notice';
- const INFO = 'info';
- const DEBUG = 'debug';
-}
diff --git a/vendor/psr/log/Psr/Log/LoggerAwareInterface.php b/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
deleted file mode 100644
index 4d64f47..0000000
--- a/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
+++ /dev/null
@@ -1,18 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Describes a logger-aware instance.
- */
-interface LoggerAwareInterface
-{
- /**
- * Sets a logger instance on the object.
- *
- * @param LoggerInterface $logger
- *
- * @return void
- */
- public function setLogger(LoggerInterface $logger);
-}
diff --git a/vendor/psr/log/Psr/Log/LoggerAwareTrait.php b/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
deleted file mode 100644
index 639f79b..0000000
--- a/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Basic Implementation of LoggerAwareInterface.
- */
-trait LoggerAwareTrait
-{
- /**
- * The logger instance.
- *
- * @var LoggerInterface
- */
- protected $logger;
-
- /**
- * Sets a logger.
- *
- * @param LoggerInterface $logger
- */
- public function setLogger(LoggerInterface $logger)
- {
- $this->logger = $logger;
- }
-}
diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/Psr/Log/LoggerInterface.php
deleted file mode 100644
index 5ea7243..0000000
--- a/vendor/psr/log/Psr/Log/LoggerInterface.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * Describes a logger instance.
- *
- * The message MUST be a string or object implementing __toString().
- *
- * The message MAY contain placeholders in the form: {foo} where foo
- * will be replaced by the context data in key "foo".
- *
- * The context array can contain arbitrary data. The only assumption that
- * can be made by implementors is that if an Exception instance is given
- * to produce a stack trace, it MUST be in a key named "exception".
- *
- * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
- * for the full interface specification.
- */
-interface LoggerInterface
-{
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function emergency($message, array $context = array());
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array());
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array());
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array());
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array());
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array());
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array());
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array());
-
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function log($level, $message, array $context = array());
-}
diff --git a/vendor/psr/log/Psr/Log/LoggerTrait.php b/vendor/psr/log/Psr/Log/LoggerTrait.php
deleted file mode 100644
index 867225d..0000000
--- a/vendor/psr/log/Psr/Log/LoggerTrait.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * This is a simple Logger trait that classes unable to extend AbstractLogger
- * (because they extend another class, etc) can include.
- *
- * It simply delegates all log-level-specific methods to the `log` method to
- * reduce boilerplate code that a simple Logger that does the same thing with
- * messages regardless of the error level has to implement.
- */
-trait LoggerTrait
-{
- /**
- * System is unusable.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function emergency($message, array $context = array())
- {
- $this->log(LogLevel::EMERGENCY, $message, $context);
- }
-
- /**
- * Action must be taken immediately.
- *
- * Example: Entire website down, database unavailable, etc. This should
- * trigger the SMS alerts and wake you up.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function alert($message, array $context = array())
- {
- $this->log(LogLevel::ALERT, $message, $context);
- }
-
- /**
- * Critical conditions.
- *
- * Example: Application component unavailable, unexpected exception.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function critical($message, array $context = array())
- {
- $this->log(LogLevel::CRITICAL, $message, $context);
- }
-
- /**
- * Runtime errors that do not require immediate action but should typically
- * be logged and monitored.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function error($message, array $context = array())
- {
- $this->log(LogLevel::ERROR, $message, $context);
- }
-
- /**
- * Exceptional occurrences that are not errors.
- *
- * Example: Use of deprecated APIs, poor use of an API, undesirable things
- * that are not necessarily wrong.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function warning($message, array $context = array())
- {
- $this->log(LogLevel::WARNING, $message, $context);
- }
-
- /**
- * Normal but significant events.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function notice($message, array $context = array())
- {
- $this->log(LogLevel::NOTICE, $message, $context);
- }
-
- /**
- * Interesting events.
- *
- * Example: User logs in, SQL logs.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function info($message, array $context = array())
- {
- $this->log(LogLevel::INFO, $message, $context);
- }
-
- /**
- * Detailed debug information.
- *
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function debug($message, array $context = array())
- {
- $this->log(LogLevel::DEBUG, $message, $context);
- }
-
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- abstract public function log($level, $message, array $context = array());
-}
diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/Psr/Log/NullLogger.php
deleted file mode 100644
index d8cd682..0000000
--- a/vendor/psr/log/Psr/Log/NullLogger.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-namespace Psr\Log;
-
-/**
- * This Logger can be used to avoid conditional log calls.
- *
- * Logging should always be optional, and if no logger is provided to your
- * library creating a NullLogger instance to have something to throw logs at
- * is a good way to avoid littering your code with `if ($this->logger) { }`
- * blocks.
- */
-class NullLogger extends AbstractLogger
-{
- /**
- * Logs with an arbitrary level.
- *
- * @param mixed $level
- * @param string $message
- * @param array $context
- *
- * @return void
- */
- public function log($level, $message, array $context = array())
- {
- // noop
- }
-}
diff --git a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
deleted file mode 100644
index a0391a5..0000000
--- a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-
-namespace Psr\Log\Test;
-
-use Psr\Log\LoggerInterface;
-use Psr\Log\LogLevel;
-
-/**
- * Provides a base test class for ensuring compliance with the LoggerInterface.
- *
- * Implementors can extend the class and implement abstract methods to run this
- * as part of their test suite.
- */
-abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @return LoggerInterface
- */
- abstract public function getLogger();
-
- /**
- * This must return the log messages in order.
- *
- * The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>".
- *
- * Example ->error('Foo') would yield "error Foo".
- *
- * @return string[]
- */
- abstract public function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException \Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- if (method_exists($this, 'createPartialMock')) {
- $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString'));
- } else {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- }
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
-
- $expected = array('warning DUMMY');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextCanContainAnything()
- {
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
-
- $expected = array('warning Crazy context data');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $logger = $this->getLogger();
- $logger->warning('Random message', array('exception' => 'oops'));
- $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
-
- $expected = array(
- 'warning Random message',
- 'critical Uncaught Exception!'
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-}
-
-class DummyTest
-{
- public function __toString()
- {
- }
-}
diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md
deleted file mode 100644
index 574bc1c..0000000
--- a/vendor/psr/log/README.md
+++ /dev/null
@@ -1,45 +0,0 @@
-PSR Log
-=======
-
-This repository holds all interfaces/classes/traits related to
-[PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md).
-
-Note that this is not a logger of its own. It is merely an interface that
-describes a logger. See the specification for more details.
-
-Usage
------
-
-If you need a logger, you can use the interface like this:
-
-```php
-<?php
-
-use Psr\Log\LoggerInterface;
-
-class Foo
-{
- private $logger;
-
- public function __construct(LoggerInterface $logger = null)
- {
- $this->logger = $logger;
- }
-
- public function doSomething()
- {
- if ($this->logger) {
- $this->logger->info('Doing work');
- }
-
- // do something useful
- }
-}
-```
-
-You can then pick one of the implementations of the interface to get a logger.
-
-If you want to implement the interface, you can require this package and
-implement `Psr\Log\LoggerInterface` in your code. Please read the
-[specification text](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)
-for details.
diff --git a/vendor/psr/log/composer.json b/vendor/psr/log/composer.json
deleted file mode 100644
index 87934d7..0000000
--- a/vendor/psr/log/composer.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "psr/log",
- "description": "Common interface for logging libraries",
- "keywords": ["psr", "psr-3", "log"],
- "homepage": "https://github.com/php-fig/log",
- "license": "MIT",
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "require": {
- "php": ">=5.3.0"
- },
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- }
-}
diff --git a/vendor/symfony/console/Application.php b/vendor/symfony/console/Application.php
index 38f38e2..1021a90 100644
--- a/vendor/symfony/console/Application.php
+++ b/vendor/symfony/console/Application.php
@@ -11,32 +11,41 @@
namespace Symfony\Component\Console;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Command\HelpCommand;
+use Symfony\Component\Console\Command\ListCommand;
+use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
+use Symfony\Component\Console\Event\ConsoleCommandEvent;
+use Symfony\Component\Console\Event\ConsoleErrorEvent;
+use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\Console\Exception\CommandNotFoundException;
use Symfony\Component\Console\Exception\ExceptionInterface;
+use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Console\Exception\NamespaceNotFoundException;
+use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Helper\DebugFormatterHelper;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Helper\Helper;
+use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Console\Helper\QuestionHelper;
-use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputAwareInterface;
-use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Command\HelpCommand;
-use Symfony\Component\Console\Command\ListCommand;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Helper\FormatterHelper;
-use Symfony\Component\Console\Event\ConsoleCommandEvent;
-use Symfony\Component\Console\Event\ConsoleExceptionEvent;
-use Symfony\Component\Console\Event\ConsoleTerminateEvent;
-use Symfony\Component\Console\Exception\CommandNotFoundException;
-use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Debug\ErrorHandler as LegacyErrorHandler;
use Symfony\Component\Debug\Exception\FatalThrowableError;
+use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
+use Symfony\Contracts\Service\ResetInterface;
/**
* An Application is the container for a collection of commands.
@@ -53,57 +62,63 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
-class Application
+class Application implements ResetInterface
{
- private $commands = array();
+ private $commands = [];
private $wantHelps = false;
private $runningCommand;
private $name;
private $version;
+ private $commandLoader;
private $catchExceptions = true;
private $autoExit = true;
private $definition;
private $helperSet;
private $dispatcher;
- private $terminalDimensions;
+ private $terminal;
private $defaultCommand;
+ private $singleCommand = false;
+ private $initialized;
/**
- * Constructor.
- *
* @param string $name The name of the application
* @param string $version The version of the application
*/
- public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN')
+ public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN')
{
$this->name = $name;
$this->version = $version;
+ $this->terminal = new Terminal();
$this->defaultCommand = 'list';
- $this->helperSet = $this->getDefaultHelperSet();
- $this->definition = $this->getDefaultInputDefinition();
-
- foreach ($this->getDefaultCommands() as $command) {
- $this->add($command);
- }
}
+ /**
+ * @final since Symfony 4.3, the type-hint will be updated to the interface from symfony/contracts in 5.0
+ */
public function setDispatcher(EventDispatcherInterface $dispatcher)
{
- $this->dispatcher = $dispatcher;
+ $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
+ }
+
+ public function setCommandLoader(CommandLoaderInterface $commandLoader)
+ {
+ $this->commandLoader = $commandLoader;
}
/**
* Runs the current application.
*
- * @param InputInterface $input An Input instance
- * @param OutputInterface $output An Output instance
- *
* @return int 0 if everything went fine, or an error code
*
- * @throws \Exception When doRun returns Exception
+ * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}.
*/
public function run(InputInterface $input = null, OutputInterface $output = null)
{
+ if (\function_exists('putenv')) {
+ @putenv('LINES='.$this->terminal->getHeight());
+ @putenv('COLUMNS='.$this->terminal->getWidth());
+ }
+
if (null === $input) {
$input = new ArgvInput();
}
@@ -112,6 +127,22 @@ class Application
$output = new ConsoleOutput();
}
+ $renderException = function (\Throwable $e) use ($output) {
+ if ($output instanceof ConsoleOutputInterface) {
+ $this->renderThrowable($e, $output->getErrorOutput());
+ } else {
+ $this->renderThrowable($e, $output);
+ }
+ };
+ if ($phpHandler = set_exception_handler($renderException)) {
+ restore_exception_handler();
+ if (!\is_array($phpHandler) || (!$phpHandler[0] instanceof ErrorHandler && !$phpHandler[0] instanceof LegacyErrorHandler)) {
+ $errorHandler = true;
+ } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
+ $phpHandler[0]->setExceptionHandler($errorHandler);
+ }
+ }
+
$this->configureIO($input, $output);
try {
@@ -121,21 +152,31 @@ class Application
throw $e;
}
- if ($output instanceof ConsoleOutputInterface) {
- $this->renderException($e, $output->getErrorOutput());
- } else {
- $this->renderException($e, $output);
- }
+ $renderException($e);
$exitCode = $e->getCode();
if (is_numeric($exitCode)) {
$exitCode = (int) $exitCode;
- if (0 === $exitCode) {
+ if ($exitCode <= 0) {
$exitCode = 1;
}
} else {
$exitCode = 1;
}
+ } finally {
+ // if the exception handler changed, keep it
+ // otherwise, unregister $renderException
+ if (!$phpHandler) {
+ if (set_exception_handler($renderException) === $renderException) {
+ restore_exception_handler();
+ }
+ restore_exception_handler();
+ } elseif (!$errorHandler) {
+ $finalHandler = $phpHandler[0]->setExceptionHandler(null);
+ if ($finalHandler !== $renderException) {
+ $phpHandler[0]->setExceptionHandler($finalHandler);
+ }
+ }
}
if ($this->autoExit) {
@@ -152,24 +193,28 @@ class Application
/**
* Runs the current application.
*
- * @param InputInterface $input An Input instance
- * @param OutputInterface $output An Output instance
- *
* @return int 0 if everything went fine, or an error code
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
- if (true === $input->hasParameterOption(array('--version', '-V'), true)) {
+ if (true === $input->hasParameterOption(['--version', '-V'], true)) {
$output->writeln($this->getLongVersion());
return 0;
}
+ try {
+ // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument.
+ $input->bind($this->getDefinition());
+ } catch (ExceptionInterface $e) {
+ // Errors must be ignored, full binding/validation happens later when the command is known.
+ }
+
$name = $this->getCommandName($input);
- if (true === $input->hasParameterOption(array('--help', '-h'), true)) {
+ if (true === $input->hasParameterOption(['--help', '-h'], true)) {
if (!$name) {
$name = 'help';
- $input = new ArrayInput(array('command' => 'help'));
+ $input = new ArrayInput(['command_name' => $this->defaultCommand]);
} else {
$this->wantHelps = true;
}
@@ -177,11 +222,52 @@ class Application
if (!$name) {
$name = $this->defaultCommand;
- $input = new ArrayInput(array('command' => $this->defaultCommand));
+ $definition = $this->getDefinition();
+ $definition->setArguments(array_merge(
+ $definition->getArguments(),
+ [
+ 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name),
+ ]
+ ));
}
- // the command name MUST be the first element of the input
- $command = $this->find($name);
+ try {
+ $this->runningCommand = null;
+ // the command name MUST be the first element of the input
+ $command = $this->find($name);
+ } catch (\Throwable $e) {
+ if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) {
+ if (null !== $this->dispatcher) {
+ $event = new ConsoleErrorEvent($input, $output, $e);
+ $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
+
+ if (0 === $event->getExitCode()) {
+ return 0;
+ }
+
+ $e = $event->getError();
+ }
+
+ throw $e;
+ }
+
+ $alternative = $alternatives[0];
+
+ $style = new SymfonyStyle($input, $output);
+ $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error');
+ if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) {
+ if (null !== $this->dispatcher) {
+ $event = new ConsoleErrorEvent($input, $output, $e);
+ $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
+
+ return $event->getExitCode();
+ }
+
+ return 1;
+ }
+
+ $command = $this->find($alternative);
+ }
$this->runningCommand = $command;
$exitCode = $this->doRunCommand($command, $input, $output);
@@ -191,10 +277,12 @@ class Application
}
/**
- * Set a helper set to be used with the command.
- *
- * @param HelperSet $helperSet The helper set
+ * {@inheritdoc}
*/
+ public function reset()
+ {
+ }
+
public function setHelperSet(HelperSet $helperSet)
{
$this->helperSet = $helperSet;
@@ -207,14 +295,13 @@ class Application
*/
public function getHelperSet()
{
+ if (!$this->helperSet) {
+ $this->helperSet = $this->getDefaultHelperSet();
+ }
+
return $this->helperSet;
}
- /**
- * Set an input definition to be used with this application.
- *
- * @param InputDefinition $definition The input definition
- */
public function setDefinition(InputDefinition $definition)
{
$this->definition = $definition;
@@ -227,6 +314,17 @@ class Application
*/
public function getDefinition()
{
+ if (!$this->definition) {
+ $this->definition = $this->getDefaultInputDefinition();
+ }
+
+ if ($this->singleCommand) {
+ $inputDefinition = $this->definition;
+ $inputDefinition->setArguments();
+
+ return $inputDefinition;
+ }
+
return $this->definition;
}
@@ -329,13 +427,13 @@ class Application
{
if ('UNKNOWN' !== $this->getName()) {
if ('UNKNOWN' !== $this->getVersion()) {
- return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
+ return sprintf('%s <info>%s</info>', $this->getName(), $this->getVersion());
}
- return sprintf('<info>%s</info>', $this->getName());
+ return $this->getName();
}
- return '<info>Console Tool</info>';
+ return 'Console Tool';
}
/**
@@ -370,22 +468,25 @@ class Application
* If a command with the same name already exists, it will be overridden.
* If the command is not enabled it will not be added.
*
- * @param Command $command A Command object
- *
* @return Command|null The registered command if enabled or null
*/
public function add(Command $command)
{
+ $this->init();
+
$command->setApplication($this);
if (!$command->isEnabled()) {
$command->setApplication(null);
- return;
+ return null;
}
- if (null === $command->getDefinition()) {
- throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command)));
+ // Will throw if the command is not correctly initialized.
+ $command->getDefinition();
+
+ if (!$command->getName()) {
+ throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', \get_class($command)));
}
$this->commands[$command->getName()] = $command;
@@ -404,14 +505,21 @@ class Application
*
* @return Command A Command object
*
- * @throws CommandNotFoundException When command name given does not exist
+ * @throws CommandNotFoundException When given command name does not exist
*/
public function get($name)
{
- if (!isset($this->commands[$name])) {
+ $this->init();
+
+ if (!$this->has($name)) {
throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name));
}
+ // When the command has a different name than the one used at the command loader level
+ if (!isset($this->commands[$name])) {
+ throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name));
+ }
+
$command = $this->commands[$name];
if ($this->wantHelps) {
@@ -435,7 +543,9 @@ class Application
*/
public function has($name)
{
- return isset($this->commands[$name]);
+ $this->init();
+
+ return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name)));
}
/**
@@ -447,8 +557,12 @@ class Application
*/
public function getNamespaces()
{
- $namespaces = array();
+ $namespaces = [];
foreach ($this->all() as $command) {
+ if ($command->isHidden()) {
+ continue;
+ }
+
$namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName()));
foreach ($command->getAliases() as $alias) {
@@ -466,7 +580,7 @@ class Application
*
* @return string A registered namespace
*
- * @throws CommandNotFoundException When namespace is incorrect or ambiguous
+ * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous
*/
public function findNamespace($namespace)
{
@@ -478,7 +592,7 @@ class Application
$message = sprintf('There are no commands defined in the "%s" namespace.', $namespace);
if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) {
- if (1 == count($alternatives)) {
+ if (1 == \count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
@@ -487,12 +601,12 @@ class Application
$message .= implode("\n ", $alternatives);
}
- throw new CommandNotFoundException($message, $alternatives);
+ throw new NamespaceNotFoundException($message, $alternatives);
}
- $exact = in_array($namespace, $namespaces, true);
- if (count($namespaces) > 1 && !$exact) {
- throw new CommandNotFoundException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
+ $exact = \in_array($namespace, $namespaces, true);
+ if (\count($namespaces) > 1 && !$exact) {
+ throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
}
return $exact ? $namespace : reset($namespaces);
@@ -512,11 +626,32 @@ class Application
*/
public function find($name)
{
- $allCommands = array_keys($this->commands);
+ $this->init();
+
+ $aliases = [];
+
+ foreach ($this->commands as $command) {
+ foreach ($command->getAliases() as $alias) {
+ if (!$this->has($alias)) {
+ $this->commands[$alias] = $command;
+ }
+ }
+ }
+
+ if ($this->has($name)) {
+ return $this->get($name);
+ }
+
+ $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands);
$expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name);
$commands = preg_grep('{^'.$expr.'}', $allCommands);
- if (empty($commands) || count(preg_grep('{^'.$expr.'$}', $commands)) < 1) {
+ if (empty($commands)) {
+ $commands = preg_grep('{^'.$expr.'}i', $allCommands);
+ }
+
+ // if no commands matched or we just matched namespaces
+ if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) {
if (false !== $pos = strrpos($name, ':')) {
// check if a namespace exists and contains commands
$this->findNamespace(substr($name, 0, $pos));
@@ -525,7 +660,12 @@ class Application
$message = sprintf('Command "%s" is not defined.', $name);
if ($alternatives = $this->findAlternatives($name, $allCommands)) {
- if (1 == count($alternatives)) {
+ // remove hidden commands
+ $alternatives = array_filter($alternatives, function ($name) {
+ return !$this->get($name)->isHidden();
+ });
+
+ if (1 == \count($alternatives)) {
$message .= "\n\nDid you mean this?\n ";
} else {
$message .= "\n\nDid you mean one of these?\n ";
@@ -533,27 +673,58 @@ class Application
$message .= implode("\n ", $alternatives);
}
- throw new CommandNotFoundException($message, $alternatives);
+ throw new CommandNotFoundException($message, array_values($alternatives));
}
// filter out aliases for commands which are already on the list
- if (count($commands) > 1) {
- $commandList = $this->commands;
- $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) {
+ if (\count($commands) > 1) {
+ $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands;
+ $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) {
+ if (!$commandList[$nameOrAlias] instanceof Command) {
+ $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias);
+ }
+
$commandName = $commandList[$nameOrAlias]->getName();
- return $commandName === $nameOrAlias || !in_array($commandName, $commands);
- });
+ $aliases[$nameOrAlias] = $commandName;
+
+ return $commandName === $nameOrAlias || !\in_array($commandName, $commands);
+ }));
+ }
+
+ if (\count($commands) > 1) {
+ $usableWidth = $this->terminal->getWidth() - 10;
+ $abbrevs = array_values($commands);
+ $maxLen = 0;
+ foreach ($abbrevs as $abbrev) {
+ $maxLen = max(Helper::strlen($abbrev), $maxLen);
+ }
+ $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) {
+ if ($commandList[$cmd]->isHidden()) {
+ unset($commands[array_search($cmd, $commands)]);
+
+ return false;
+ }
+
+ $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription();
+
+ return Helper::strlen($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev;
+ }, array_values($commands));
+
+ if (\count($commands) > 1) {
+ $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs));
+
+ throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands));
+ }
}
- $exact = in_array($name, $commands, true);
- if (count($commands) > 1 && !$exact) {
- $suggestions = $this->getAbbreviationSuggestions(array_values($commands));
+ $command = $this->get(reset($commands));
- throw new CommandNotFoundException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions), array_values($commands));
+ if ($command->isHidden()) {
+ @trigger_error(sprintf('Command "%s" is hidden, finding it using an abbreviation is deprecated since Symfony 4.4, use its full name instead.', $command->getName()), \E_USER_DEPRECATED);
}
- return $this->get($exact ? $name : reset($commands));
+ return $command;
}
/**
@@ -567,17 +738,38 @@ class Application
*/
public function all($namespace = null)
{
+ $this->init();
+
if (null === $namespace) {
- return $this->commands;
+ if (!$this->commandLoader) {
+ return $this->commands;
+ }
+
+ $commands = $this->commands;
+ foreach ($this->commandLoader->getNames() as $name) {
+ if (!isset($commands[$name]) && $this->has($name)) {
+ $commands[$name] = $this->get($name);
+ }
+ }
+
+ return $commands;
}
- $commands = array();
+ $commands = [];
foreach ($this->commands as $name => $command) {
if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) {
$commands[$name] = $command;
}
}
+ if ($this->commandLoader) {
+ foreach ($this->commandLoader->getNames() as $name) {
+ if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) {
+ $commands[$name] = $this->get($name);
+ }
+ }
+ }
+
return $commands;
}
@@ -590,9 +782,9 @@ class Application
*/
public static function getAbbreviations($names)
{
- $abbrevs = array();
+ $abbrevs = [];
foreach ($names as $name) {
- for ($len = strlen($name); $len > 0; --$len) {
+ for ($len = \strlen($name); $len > 0; --$len) {
$abbrev = substr($name, 0, $len);
$abbrevs[$abbrev][] = $name;
}
@@ -604,194 +796,197 @@ class Application
/**
* Renders a caught exception.
*
- * @param \Exception $e An exception instance
- * @param OutputInterface $output An OutputInterface instance
+ * @deprecated since Symfony 4.4, use "renderThrowable()" instead
*/
public function renderException(\Exception $e, OutputInterface $output)
{
+ @trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
+
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
- do {
- $title = sprintf(
- ' [%s%s] ',
- get_class($e),
- $output->isVerbose() && 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''
- );
-
- $len = $this->stringWidth($title);
-
- $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX;
- // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327
- if (defined('HHVM_VERSION') && $width > 1 << 31) {
- $width = 1 << 31;
- }
- $formatter = $output->getFormatter();
- $lines = array();
- foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
- foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
- // pre-format lines to get the right string length
- $lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4;
- $lines[] = array($line, $lineLength);
+ $this->doRenderException($e, $output);
- $len = max($lineLength, $len);
- }
- }
+ $this->finishRenderThrowableOrException($output);
+ }
- $messages = array();
- $messages[] = $emptyLine = $formatter->format(sprintf('<error>%s</error>', str_repeat(' ', $len)));
- $messages[] = $formatter->format(sprintf('<error>%s%s</error>', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title)))));
- foreach ($lines as $line) {
- $messages[] = $formatter->format(sprintf('<error> %s %s</error>', $line[0], str_repeat(' ', $len - $line[1])));
+ public function renderThrowable(\Throwable $e, OutputInterface $output): void
+ {
+ if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'renderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'renderException'))->getDeclaringClass()->getName()) {
+ @trigger_error(sprintf('The "%s::renderException()" method is deprecated since Symfony 4.4, use "renderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
+
+ if (!$e instanceof \Exception) {
+ $e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine());
}
- $messages[] = $emptyLine;
- $messages[] = '';
- $output->writeln($messages, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_QUIET);
+ $this->renderException($e, $output);
- if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
- $output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET);
+ return;
+ }
- // exception related properties
- $trace = $e->getTrace();
- array_unshift($trace, array(
- 'function' => '',
- 'file' => $e->getFile() !== null ? $e->getFile() : 'n/a',
- 'line' => $e->getLine() !== null ? $e->getLine() : 'n/a',
- 'args' => array(),
- ));
-
- for ($i = 0, $count = count($trace); $i < $count; ++$i) {
- $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
- $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
- $function = $trace[$i]['function'];
- $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
- $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';
-
- $output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET);
- }
+ $output->writeln('', OutputInterface::VERBOSITY_QUIET);
- $output->writeln('', OutputInterface::VERBOSITY_QUIET);
- }
- } while ($e = $e->getPrevious());
+ $this->doRenderThrowable($e, $output);
+ $this->finishRenderThrowableOrException($output);
+ }
+
+ private function finishRenderThrowableOrException(OutputInterface $output): void
+ {
if (null !== $this->runningCommand) {
- $output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET);
+ $output->writeln(sprintf('<info>%s</info>', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET);
$output->writeln('', OutputInterface::VERBOSITY_QUIET);
}
}
/**
- * Tries to figure out the terminal width in which this application runs.
- *
- * @return int|null
+ * @deprecated since Symfony 4.4, use "doRenderThrowable()" instead
*/
- protected function getTerminalWidth()
+ protected function doRenderException(\Exception $e, OutputInterface $output)
{
- $dimensions = $this->getTerminalDimensions();
+ @trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
- return $dimensions[0];
+ $this->doActuallyRenderThrowable($e, $output);
}
- /**
- * Tries to figure out the terminal height in which this application runs.
- *
- * @return int|null
- */
- protected function getTerminalHeight()
+ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void
{
- $dimensions = $this->getTerminalDimensions();
+ if (__CLASS__ !== static::class && __CLASS__ === (new \ReflectionMethod($this, 'doRenderThrowable'))->getDeclaringClass()->getName() && __CLASS__ !== (new \ReflectionMethod($this, 'doRenderException'))->getDeclaringClass()->getName()) {
+ @trigger_error(sprintf('The "%s::doRenderException()" method is deprecated since Symfony 4.4, use "doRenderThrowable()" instead.', __CLASS__), \E_USER_DEPRECATED);
+
+ if (!$e instanceof \Exception) {
+ $e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), \E_ERROR, $e->getFile(), $e->getLine());
+ }
+
+ $this->doRenderException($e, $output);
+
+ return;
+ }
- return $dimensions[1];
+ $this->doActuallyRenderThrowable($e, $output);
}
- /**
- * Tries to figure out the terminal dimensions based on the current environment.
- *
- * @return array Array containing width and height
- */
- public function getTerminalDimensions()
+ private function doActuallyRenderThrowable(\Throwable $e, OutputInterface $output): void
{
- if ($this->terminalDimensions) {
- return $this->terminalDimensions;
- }
+ do {
+ $message = trim($e->getMessage());
+ if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $class = get_debug_type($e);
+ $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : '');
+ $len = Helper::strlen($title);
+ } else {
+ $len = 0;
+ }
- if ('\\' === DIRECTORY_SEPARATOR) {
- // extract [w, H] from "wxh (WxH)"
- if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) {
- return array((int) $matches[1], (int) $matches[2]);
+ if (str_contains($message, "@anonymous\0")) {
+ $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
+ return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
+ }, $message);
}
- // extract [w, h] from "wxh"
- if (preg_match('/^(\d+)x(\d+)$/', $this->getConsoleMode(), $matches)) {
- return array((int) $matches[1], (int) $matches[2]);
+
+ $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX;
+ $lines = [];
+ foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) {
+ foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
+ // pre-format lines to get the right string length
+ $lineLength = Helper::strlen($line) + 4;
+ $lines[] = [$line, $lineLength];
+
+ $len = max($lineLength, $len);
+ }
}
- }
- if ($sttyString = $this->getSttyColumns()) {
- // extract [w, h] from "rows h; columns w;"
- if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) {
- return array((int) $matches[2], (int) $matches[1]);
+ $messages = [];
+ if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $messages[] = sprintf('<comment>%s</comment>', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a')));
}
- // extract [w, h] from "; h rows; w columns"
- if (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) {
- return array((int) $matches[2], (int) $matches[1]);
+ $messages[] = $emptyLine = sprintf('<error>%s</error>', str_repeat(' ', $len));
+ if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $messages[] = sprintf('<error>%s%s</error>', $title, str_repeat(' ', max(0, $len - Helper::strlen($title))));
}
- }
+ foreach ($lines as $line) {
+ $messages[] = sprintf('<error> %s %s</error>', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1]));
+ }
+ $messages[] = $emptyLine;
+ $messages[] = '';
- return array(null, null);
- }
+ $output->writeln($messages, OutputInterface::VERBOSITY_QUIET);
- /**
- * Sets terminal dimensions.
- *
- * Can be useful to force terminal dimensions for functional tests.
- *
- * @param int $width The width
- * @param int $height The height
- *
- * @return Application The current application
- */
- public function setTerminalDimensions($width, $height)
- {
- $this->terminalDimensions = array($width, $height);
+ if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
+ $output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET);
- return $this;
+ // exception related properties
+ $trace = $e->getTrace();
+
+ array_unshift($trace, [
+ 'function' => '',
+ 'file' => $e->getFile() ?: 'n/a',
+ 'line' => $e->getLine() ?: 'n/a',
+ 'args' => [],
+ ]);
+
+ for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
+ $class = $trace[$i]['class'] ?? '';
+ $type = $trace[$i]['type'] ?? '';
+ $function = $trace[$i]['function'] ?? '';
+ $file = $trace[$i]['file'] ?? 'n/a';
+ $line = $trace[$i]['line'] ?? 'n/a';
+
+ $output->writeln(sprintf(' %s%s at <info>%s:%s</info>', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET);
+ }
+
+ $output->writeln('', OutputInterface::VERBOSITY_QUIET);
+ }
+ } while ($e = $e->getPrevious());
}
/**
* Configures the input and output instances based on the user arguments and options.
- *
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
*/
protected function configureIO(InputInterface $input, OutputInterface $output)
{
- if (true === $input->hasParameterOption(array('--ansi'), true)) {
+ if (true === $input->hasParameterOption(['--ansi'], true)) {
$output->setDecorated(true);
- } elseif (true === $input->hasParameterOption(array('--no-ansi'), true)) {
+ } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) {
$output->setDecorated(false);
}
- if (true === $input->hasParameterOption(array('--no-interaction', '-n'), true)) {
+ if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) {
$input->setInteractive(false);
- } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('question')) {
- $inputStream = $this->getHelperSet()->get('question')->getInputStream();
- if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
- $input->setInteractive(false);
- }
}
- if (true === $input->hasParameterOption(array('--quiet', '-q'), true)) {
+ switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) {
+ case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break;
+ case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break;
+ case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break;
+ case 3: $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); break;
+ default: $shellVerbosity = 0; break;
+ }
+
+ if (true === $input->hasParameterOption(['--quiet', '-q'], true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
- $input->setInteractive(false);
+ $shellVerbosity = -1;
} else {
- if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || $input->getParameterOption('--verbose', false, true) === 3) {
+ if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
- } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || $input->getParameterOption('--verbose', false, true) === 2) {
+ $shellVerbosity = 3;
+ } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
+ $shellVerbosity = 2;
} elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
+ $shellVerbosity = 1;
}
}
+
+ if (-1 === $shellVerbosity) {
+ $input->setInteractive(false);
+ }
+
+ if (\function_exists('putenv')) {
+ @putenv('SHELL_VERBOSITY='.$shellVerbosity);
+ }
+ $_ENV['SHELL_VERBOSITY'] = $shellVerbosity;
+ $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity;
}
/**
@@ -800,13 +995,7 @@ class Application
* If an event dispatcher has been attached to the application,
* events are also dispatched during the life-cycle of the command.
*
- * @param Command $command A Command instance
- * @param InputInterface $input An Input instance
- * @param OutputInterface $output An Output instance
- *
* @return int 0 if everything went fine, or an error code
- *
- * @throws \Exception when the command being run threw an exception
*/
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
{
@@ -829,36 +1018,32 @@ class Application
}
$event = new ConsoleCommandEvent($command, $input, $output);
- $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
+ $e = null;
- if ($event->commandShouldRun()) {
- try {
- $e = null;
+ try {
+ $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND);
+
+ if ($event->commandShouldRun()) {
$exitCode = $command->run($input, $output);
- } catch (\Exception $x) {
- $e = $x;
- } catch (\Throwable $x) {
- $e = new FatalThrowableError($x);
+ } else {
+ $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
}
- if (null !== $e) {
- $event = new ConsoleExceptionEvent($command, $input, $output, $e, $e->getCode());
- $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event);
+ } catch (\Throwable $e) {
+ $event = new ConsoleErrorEvent($input, $output, $e, $command);
+ $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);
+ $e = $event->getError();
- if ($e !== $event->getException()) {
- $x = $e = $event->getException();
- }
-
- $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode());
- $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
-
- throw $x;
+ if (0 === $exitCode = $event->getExitCode()) {
+ $e = null;
}
- } else {
- $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED;
}
$event = new ConsoleTerminateEvent($command, $input, $output, $exitCode);
- $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
+ $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE);
+
+ if (null !== $e) {
+ throw $e;
+ }
return $event->getExitCode();
}
@@ -866,13 +1051,11 @@ class Application
/**
* Gets the name of the command based on input.
*
- * @param InputInterface $input The input interface
- *
- * @return string The command name
+ * @return string|null
*/
protected function getCommandName(InputInterface $input)
{
- return $input->getFirstArgument();
+ return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument();
}
/**
@@ -882,7 +1065,7 @@ class Application
*/
protected function getDefaultInputDefinition()
{
- return new InputDefinition(array(
+ return new InputDefinition([
new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'),
new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'),
@@ -892,7 +1075,7 @@ class Application
new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'),
new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'),
new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'),
- ));
+ ]);
}
/**
@@ -902,7 +1085,7 @@ class Application
*/
protected function getDefaultCommands()
{
- return array(new HelpCommand(), new ListCommand());
+ return [new HelpCommand(), new ListCommand()];
}
/**
@@ -912,72 +1095,20 @@ class Application
*/
protected function getDefaultHelperSet()
{
- return new HelperSet(array(
+ return new HelperSet([
new FormatterHelper(),
new DebugFormatterHelper(),
new ProcessHelper(),
new QuestionHelper(),
- ));
- }
-
- /**
- * Runs and parses stty -a if it's available, suppressing any error output.
- *
- * @return string
- */
- private function getSttyColumns()
- {
- if (!function_exists('proc_open')) {
- return;
- }
-
- $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
- $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, array('suppress_errors' => true));
- if (is_resource($process)) {
- $info = stream_get_contents($pipes[1]);
- fclose($pipes[1]);
- fclose($pipes[2]);
- proc_close($process);
-
- return $info;
- }
- }
-
- /**
- * Runs and parses mode CON if it's available, suppressing any error output.
- *
- * @return string|null <width>x<height> or null if it could not be parsed
- */
- private function getConsoleMode()
- {
- if (!function_exists('proc_open')) {
- return;
- }
-
- $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
- $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, array('suppress_errors' => true));
- if (is_resource($process)) {
- $info = stream_get_contents($pipes[1]);
- fclose($pipes[1]);
- fclose($pipes[2]);
- proc_close($process);
-
- if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
- return $matches[2].'x'.$matches[1];
- }
- }
+ ]);
}
/**
* Returns abbreviated suggestions in string format.
- *
- * @param array $abbrevs Abbreviated suggestions to convert
- *
- * @return string A formatted string of abbreviated suggestions
*/
- private function getAbbreviationSuggestions($abbrevs)
+ private function getAbbreviationSuggestions(array $abbrevs): string
{
- return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : '');
+ return ' '.implode("\n ", $abbrevs);
}
/**
@@ -992,27 +1123,23 @@ class Application
*/
public function extractNamespace($name, $limit = null)
{
- $parts = explode(':', $name);
- array_pop($parts);
+ $parts = explode(':', $name, -1);
- return implode(':', null === $limit ? $parts : array_slice($parts, 0, $limit));
+ return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
}
/**
* Finds alternative of $name among $collection,
* if nothing is found in $collection, try in $abbrevs.
*
- * @param string $name The string
- * @param array|\Traversable $collection The collection
- *
* @return string[] A sorted array of similar string
*/
- private function findAlternatives($name, $collection)
+ private function findAlternatives(string $name, iterable $collection): array
{
$threshold = 1e3;
- $alternatives = array();
+ $alternatives = [];
- $collectionParts = array();
+ $collectionParts = [];
foreach ($collection as $item) {
$collectionParts[$item] = explode(':', $item);
}
@@ -1028,7 +1155,7 @@ class Application
}
$lev = levenshtein($subname, $parts[$i]);
- if ($lev <= strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) {
+ if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) {
$alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev;
} elseif ($exists) {
$alternatives[$collectionName] += $threshold;
@@ -1038,13 +1165,13 @@ class Application
foreach ($collection as $item) {
$lev = levenshtein($name, $item);
- if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) {
+ if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) {
$alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev;
}
}
$alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; });
- asort($alternatives);
+ ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE);
return array_keys($alternatives);
}
@@ -1052,23 +1179,34 @@ class Application
/**
* Sets the default Command name.
*
- * @param string $commandName The Command name
+ * @param string $commandName The Command name
+ * @param bool $isSingleCommand Set to true if there is only one command in this application
+ *
+ * @return self
*/
- public function setDefaultCommand($commandName)
+ public function setDefaultCommand($commandName, $isSingleCommand = false)
{
$this->defaultCommand = $commandName;
- }
- private function stringWidth($string)
- {
- if (false === $encoding = mb_detect_encoding($string, null, true)) {
- return strlen($string);
+ if ($isSingleCommand) {
+ // Ensure the command exist
+ $this->find($commandName);
+
+ $this->singleCommand = true;
}
- return mb_strwidth($string, $encoding);
+ return $this;
+ }
+
+ /**
+ * @internal
+ */
+ public function isSingleCommand(): bool
+ {
+ return $this->singleCommand;
}
- private function splitStringByWidth($string, $width)
+ private function splitStringByWidth(string $string, int $width): array
{
// str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly.
// additionally, array_slice() is not enough as some character has doubled width.
@@ -1078,22 +1216,27 @@ class Application
}
$utf8String = mb_convert_encoding($string, 'utf8', $encoding);
- $lines = array();
+ $lines = [];
$line = '';
- foreach (preg_split('//u', $utf8String) as $char) {
- // test if $char could be appended to current line
- if (mb_strwidth($line.$char, 'utf8') <= $width) {
- $line .= $char;
- continue;
+
+ $offset = 0;
+ while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) {
+ $offset += \strlen($m[0]);
+
+ foreach (preg_split('//u', $m[0]) as $char) {
+ // test if $char could be appended to current line
+ if (mb_strwidth($line.$char, 'utf8') <= $width) {
+ $line .= $char;
+ continue;
+ }
+ // if not, push current line to array and make new line
+ $lines[] = str_pad($line, $width);
+ $line = $char;
}
- // if not, push current line to array and make new line
- $lines[] = str_pad($line, $width);
- $line = $char;
- }
- if ('' !== $line) {
- $lines[] = count($lines) ? str_pad($line, $width) : $line;
}
+ $lines[] = \count($lines) ? str_pad($line, $width) : $line;
+
mb_convert_variables($encoding, 'utf8', $lines);
return $lines;
@@ -1102,18 +1245,16 @@ class Application
/**
* Returns all namespaces of the command name.
*
- * @param string $name The full name of the command
- *
* @return string[] The namespaces of the command
*/
- private function extractAllNamespaces($name)
+ private function extractAllNamespaces(string $name): array
{
// -1 as third argument is needed to skip the command short name when exploding
$parts = explode(':', $name, -1);
- $namespaces = array();
+ $namespaces = [];
foreach ($parts as $part) {
- if (count($namespaces)) {
+ if (\count($namespaces)) {
$namespaces[] = end($namespaces).':'.$part;
} else {
$namespaces[] = $part;
@@ -1122,4 +1263,16 @@ class Application
return $namespaces;
}
+
+ private function init()
+ {
+ if ($this->initialized) {
+ return;
+ }
+ $this->initialized = true;
+
+ foreach ($this->getDefaultCommands() as $command) {
+ $this->add($command);
+ }
+ }
}
diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md
index df37640..5159244 100644
--- a/vendor/symfony/console/CHANGELOG.md
+++ b/vendor/symfony/console/CHANGELOG.md
@@ -1,11 +1,94 @@
CHANGELOG
=========
+4.4.0
+-----
+
+ * deprecated finding hidden commands using an abbreviation, use the full name instead
+ * added `Question::setTrimmable` default to true to allow the answer to be trimmed
+ * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar`
+ * `Application` implements `ResetInterface`
+ * marked all dispatched event classes as `@final`
+ * added support for displaying table horizontally
+ * deprecated returning `null` from `Command::execute()`, return `0` instead
+ * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods,
+ use `renderThrowable()` and `doRenderThrowable()` instead.
+ * added support for the `NO_COLOR` env var (https://no-color.org/)
+
+4.3.0
+-----
+
+ * added support for hyperlinks
+ * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating
+ * added `Question::setAutocompleterCallback()` to provide a callback function
+ that dynamically generates suggestions as the user types
+
+4.2.0
+-----
+
+ * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to
+ `ProcessHelper::run()` to pass environment variables
+ * deprecated passing a command as a string to `ProcessHelper::run()`,
+ pass it the command as an array of its arguments instead
+ * made the `ProcessHelper` class final
+ * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`)
+ * added `capture_stderr_separately` option to `CommandTester::execute()`
+
+4.1.0
+-----
+
+ * added option to run suggested command if command is not found and only 1 alternative is available
+ * added option to modify console output and print multiple modifiable sections
+ * added support for iterable messages in output `write` and `writeln` methods
+
+4.0.0
+-----
+
+ * `OutputFormatter` throws an exception when unknown options are used
+ * removed `QuestionHelper::setInputStream()/getInputStream()`
+ * removed `Application::getTerminalWidth()/getTerminalHeight()` and
+ `Application::setTerminalDimensions()/getTerminalDimensions()`
+ * removed `ConsoleExceptionEvent`
+ * removed `ConsoleEvents::EXCEPTION`
+
+3.4.0
+-----
+
+ * added `SHELL_VERBOSITY` env var to control verbosity
+ * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11
+ `ContainerCommandLoader` for commands lazy-loading
+ * added a case-insensitive command name matching fallback
+ * added static `Command::$defaultName/getDefaultName()`, allowing for
+ commands to be registered at compile time in the application command loader.
+ Setting the `$defaultName` property avoids the need for filling the `command`
+ attribute on the `console.command` tag when using `AddConsoleCommandPass`.
+
+3.3.0
+-----
+
+ * added `ExceptionListener`
+ * added `AddConsoleCommandPass` (originally in FrameworkBundle)
+ * [BC BREAK] `Input::getOption()` no longer returns the default value for options
+ with value optional explicitly passed empty
+ * added console.error event to catch exceptions thrown by other listeners
+ * deprecated console.exception event in favor of console.error
+ * added ability to handle `CommandNotFoundException` through the
+ `console.error` event
+ * deprecated default validation in `SymfonyQuestionHelper::ask`
+
+3.2.0
+------
+
+ * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs
+ * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface)
+ * added StreamableInputInterface
+ * added LockableTrait
+
3.1.0
-----
* added truncate method to FormatterHelper
- * added setColumnWidth(s) method to Table
+ * added setColumnWidth(s) method to Table
2.8.3
-----
diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php
index 0d5001b..da9b9f6 100644
--- a/vendor/symfony/console/Command/Command.php
+++ b/vendor/symfony/console/Command/Command.php
@@ -11,16 +11,16 @@
namespace Symfony\Component\Console\Command;
+use Symfony\Component\Console\Application;
use Symfony\Component\Console\Exception\ExceptionInterface;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Exception\InvalidArgumentException;
-use Symfony\Component\Console\Exception\LogicException;
/**
* Base class for all commands.
@@ -29,41 +29,52 @@ use Symfony\Component\Console\Exception\LogicException;
*/
class Command
{
+ /**
+ * @var string|null The default command name
+ */
+ protected static $defaultName;
+
private $application;
private $name;
private $processTitle;
- private $aliases = array();
+ private $aliases = [];
private $definition;
- private $help;
- private $description;
+ private $hidden = false;
+ private $help = '';
+ private $description = '';
private $ignoreValidationErrors = false;
private $applicationDefinitionMerged = false;
private $applicationDefinitionMergedWithArgs = false;
private $code;
- private $synopsis = array();
- private $usages = array();
+ private $synopsis = [];
+ private $usages = [];
private $helperSet;
/**
- * Constructor.
- *
+ * @return string|null The default command name or null when no default name is set
+ */
+ public static function getDefaultName()
+ {
+ $class = static::class;
+ $r = new \ReflectionProperty($class, 'defaultName');
+
+ return $class === $r->class ? static::$defaultName : null;
+ }
+
+ /**
* @param string|null $name The name of the command; passing null means it must be set in configure()
*
* @throws LogicException When the command name is empty
*/
- public function __construct($name = null)
+ public function __construct(string $name = null)
{
$this->definition = new InputDefinition();
- if (null !== $name) {
+ if (null !== $name || null !== $name = static::getDefaultName()) {
$this->setName($name);
}
$this->configure();
-
- if (!$this->name) {
- throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_class($this)));
- }
}
/**
@@ -76,11 +87,6 @@ class Command
$this->ignoreValidationErrors = true;
}
- /**
- * Sets the application instance for this command.
- *
- * @param Application $application An Application instance
- */
public function setApplication(Application $application = null)
{
$this->application = $application;
@@ -91,11 +97,6 @@ class Command
}
}
- /**
- * Sets the helper set.
- *
- * @param HelperSet $helperSet A HelperSet instance
- */
public function setHelperSet(HelperSet $helperSet)
{
$this->helperSet = $helperSet;
@@ -104,7 +105,7 @@ class Command
/**
* Gets the helper set.
*
- * @return HelperSet A HelperSet instance
+ * @return HelperSet|null A HelperSet instance
*/
public function getHelperSet()
{
@@ -114,7 +115,7 @@ class Command
/**
* Gets the application instance for this command.
*
- * @return Application An Application instance
+ * @return Application|null An Application instance
*/
public function getApplication()
{
@@ -149,10 +150,7 @@ class Command
* execute() method, you set the code to execute by passing
* a Closure to the setCode() method.
*
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
- *
- * @return null|int null or 0 if everything went fine, or an error code
+ * @return int 0 if everything went fine, or an exit code
*
* @throws LogicException When this abstract method is not implemented
*
@@ -169,22 +167,20 @@ class Command
* This method is executed before the InputDefinition is validated.
* This means that this is the only place where the command can
* interactively ask for values of missing required arguments.
- *
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
}
/**
- * Initializes the command just after the input has been validated.
+ * Initializes the command after the input has been bound and before the input
+ * is validated.
*
* This is mainly useful when a lot of commands extends one main command
* where some things need to be initialized based on the input arguments and options.
*
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
+ * @see InputInterface::bind()
+ * @see InputInterface::validate()
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
@@ -197,12 +193,9 @@ class Command
* setCode() method or by overriding the execute() method
* in a sub-class.
*
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
- *
* @return int The command exit code
*
- * @throws \Exception
+ * @throws \Exception When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}.
*
* @see setCode()
* @see execute()
@@ -228,9 +221,15 @@ class Command
$this->initialize($input, $output);
if (null !== $this->processTitle) {
- if (function_exists('cli_set_process_title')) {
- cli_set_process_title($this->processTitle);
- } elseif (function_exists('setproctitle')) {
+ if (\function_exists('cli_set_process_title')) {
+ if (!@cli_set_process_title($this->processTitle)) {
+ if ('Darwin' === \PHP_OS) {
+ $output->writeln('<comment>Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.</comment>', OutputInterface::VERBOSITY_VERY_VERBOSE);
+ } else {
+ cli_set_process_title($this->processTitle);
+ }
+ }
+ } elseif (\function_exists('setproctitle')) {
setproctitle($this->processTitle);
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
$output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
@@ -251,9 +250,13 @@ class Command
$input->validate();
if ($this->code) {
- $statusCode = call_user_func($this->code, $input, $output);
+ $statusCode = ($this->code)($input, $output);
} else {
$statusCode = $this->execute($input, $output);
+
+ if (!\is_int($statusCode)) {
+ @trigger_error(sprintf('Return value of "%s::execute()" should always be of the type int since Symfony 4.4, %s returned.', static::class, \gettype($statusCode)), \E_USER_DEPRECATED);
+ }
}
return is_numeric($statusCode) ? (int) $statusCode : 0;
@@ -267,7 +270,7 @@ class Command
*
* @param callable $code A callable(InputInterface $input, OutputInterface $output)
*
- * @return Command The current instance
+ * @return $this
*
* @throws InvalidArgumentException
*
@@ -278,7 +281,14 @@ class Command
if ($code instanceof \Closure) {
$r = new \ReflectionFunction($code);
if (null === $r->getClosureThis()) {
- $code = \Closure::bind($code, $this);
+ set_error_handler(static function () {});
+ try {
+ if ($c = \Closure::bind($code, $this)) {
+ $code = $c;
+ }
+ } finally {
+ restore_error_handler();
+ }
}
}
@@ -302,14 +312,13 @@ class Command
$this->definition->addOptions($this->application->getDefinition()->getOptions());
+ $this->applicationDefinitionMerged = true;
+
if ($mergeArgs) {
$currentArguments = $this->definition->getArguments();
$this->definition->setArguments($this->application->getDefinition()->getArguments());
$this->definition->addArguments($currentArguments);
- }
- $this->applicationDefinitionMerged = true;
- if ($mergeArgs) {
$this->applicationDefinitionMergedWithArgs = true;
}
}
@@ -319,7 +328,7 @@ class Command
*
* @param array|InputDefinition $definition An array of argument and option instances or a definition instance
*
- * @return Command The current instance
+ * @return $this
*/
public function setDefinition($definition)
{
@@ -341,6 +350,10 @@ class Command
*/
public function getDefinition()
{
+ if (null === $this->definition) {
+ throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class));
+ }
+
return $this->definition;
}
@@ -362,12 +375,14 @@ class Command
/**
* Adds an argument.
*
- * @param string $name The argument name
- * @param int $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
- * @param string $description A description text
- * @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
+ * @param string $name The argument name
+ * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
+ * @param string $description A description text
+ * @param mixed $default The default value (for InputArgument::OPTIONAL mode only)
*
- * @return Command The current instance
+ * @throws InvalidArgumentException When argument mode is not valid
+ *
+ * @return $this
*/
public function addArgument($name, $mode = null, $description = '', $default = null)
{
@@ -379,13 +394,15 @@ class Command
/**
* Adds an option.
*
- * @param string $name The option name
- * @param string $shortcut The shortcut (can be null)
- * @param int $mode The option mode: One of the InputOption::VALUE_* constants
- * @param string $description A description text
- * @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
+ * @param string $name The option name
+ * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
+ * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants
+ * @param string $description A description text
+ * @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
+ *
+ * @throws InvalidArgumentException If option mode is invalid or incompatible
*
- * @return Command The current instance
+ * @return $this
*/
public function addOption($name, $shortcut = null, $mode = null, $description = '', $default = null)
{
@@ -404,7 +421,7 @@ class Command
*
* @param string $name The command name
*
- * @return Command The current instance
+ * @return $this
*
* @throws InvalidArgumentException When the name is invalid
*/
@@ -423,11 +440,9 @@ class Command
* This feature should be used only when creating a long process command,
* like a daemon.
*
- * PHP 5.5+ or the proctitle PECL library is required
- *
* @param string $title The process title
*
- * @return Command The current instance
+ * @return $this
*/
public function setProcessTitle($title)
{
@@ -439,7 +454,7 @@ class Command
/**
* Returns the command name.
*
- * @return string The command name
+ * @return string|null
*/
public function getName()
{
@@ -447,11 +462,31 @@ class Command
}
/**
+ * @param bool $hidden Whether or not the command should be hidden from the list of commands
+ *
+ * @return $this
+ */
+ public function setHidden($hidden)
+ {
+ $this->hidden = (bool) $hidden;
+
+ return $this;
+ }
+
+ /**
+ * @return bool whether the command should be publicly shown or not
+ */
+ public function isHidden()
+ {
+ return $this->hidden;
+ }
+
+ /**
* Sets the description for the command.
*
* @param string $description The description for the command
*
- * @return Command The current instance
+ * @return $this
*/
public function setDescription($description)
{
@@ -475,7 +510,7 @@ class Command
*
* @param string $help The help for the command
*
- * @return Command The current instance
+ * @return $this
*/
public function setHelp($help)
{
@@ -503,15 +538,16 @@ class Command
public function getProcessedHelp()
{
$name = $this->name;
+ $isSingleCommand = $this->application && $this->application->isSingleCommand();
- $placeholders = array(
+ $placeholders = [
'%command.name%',
'%command.full_name%',
- );
- $replacements = array(
+ ];
+ $replacements = [
$name,
- $_SERVER['PHP_SELF'].' '.$name,
- );
+ $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name,
+ ];
return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription());
}
@@ -521,14 +557,14 @@ class Command
*
* @param string[] $aliases An array of aliases for the command
*
- * @return Command The current instance
+ * @return $this
*
* @throws InvalidArgumentException When an alias is invalid
*/
public function setAliases($aliases)
{
- if (!is_array($aliases) && !$aliases instanceof \Traversable) {
- throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable');
+ if (!\is_array($aliases) && !$aliases instanceof \Traversable) {
+ throw new InvalidArgumentException('$aliases must be an array or an instance of \Traversable.');
}
foreach ($aliases as $alias) {
@@ -573,11 +609,11 @@ class Command
*
* @param string $usage The usage, it'll be prefixed with the command name
*
- * @return Command The current instance
+ * @return $this
*/
public function addUsage($usage)
{
- if (0 !== strpos($usage, $this->name)) {
+ if (!str_starts_with($usage, $this->name)) {
$usage = sprintf('%s %s', $this->name, $usage);
}
@@ -620,11 +656,9 @@ class Command
*
* It must be non-empty and parts can optionally be separated by ":".
*
- * @param string $name
- *
* @throws InvalidArgumentException When the name is invalid
*/
- private function validateName($name)
+ private function validateName(string $name)
{
if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) {
throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name));
diff --git a/vendor/symfony/console/Command/HelpCommand.php b/vendor/symfony/console/Command/HelpCommand.php
index b8fd911..cece782 100644
--- a/vendor/symfony/console/Command/HelpCommand.php
+++ b/vendor/symfony/console/Command/HelpCommand.php
@@ -13,8 +13,8 @@ namespace Symfony\Component\Console\Command;
use Symfony\Component\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**
@@ -35,12 +35,12 @@ class HelpCommand extends Command
$this
->setName('help')
- ->setDefinition(array(
+ ->setDefinition([
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
- ))
- ->setDescription('Displays help for a command')
+ ])
+ ->setDescription('Display help for a command')
->setHelp(<<<'EOF'
The <info>%command.name%</info> command displays help for a given command:
@@ -56,11 +56,6 @@ EOF
;
}
- /**
- * Sets the command.
- *
- * @param Command $command The command to set
- */
public function setCommand(Command $command)
{
$this->command = $command;
@@ -76,11 +71,13 @@ EOF
}
$helper = new DescriptorHelper();
- $helper->describe($output, $this->command, array(
+ $helper->describe($output, $this->command, [
'format' => $input->getOption('format'),
'raw_text' => $input->getOption('raw'),
- ));
+ ]);
$this->command = null;
+
+ return 0;
}
}
diff --git a/vendor/symfony/console/Command/ListCommand.php b/vendor/symfony/console/Command/ListCommand.php
index 179ddea..44324a5 100644
--- a/vendor/symfony/console/Command/ListCommand.php
+++ b/vendor/symfony/console/Command/ListCommand.php
@@ -13,10 +13,10 @@ namespace Symfony\Component\Console\Command;
use Symfony\Component\Console\Helper\DescriptorHelper;
use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Input\InputDefinition;
/**
* ListCommand displays the list of all available commands for the application.
@@ -33,7 +33,7 @@ class ListCommand extends Command
$this
->setName('list')
->setDefinition($this->createDefinition())
- ->setDescription('Lists commands')
+ ->setDescription('List commands')
->setHelp(<<<'EOF'
The <info>%command.name%</info> command lists all commands:
@@ -69,22 +69,21 @@ EOF
protected function execute(InputInterface $input, OutputInterface $output)
{
$helper = new DescriptorHelper();
- $helper->describe($output, $this->getApplication(), array(
+ $helper->describe($output, $this->getApplication(), [
'format' => $input->getOption('format'),
'raw_text' => $input->getOption('raw'),
'namespace' => $input->getArgument('namespace'),
- ));
+ ]);
+
+ return 0;
}
- /**
- * {@inheritdoc}
- */
- private function createDefinition()
+ private function createDefinition(): InputDefinition
{
- return new InputDefinition(array(
+ return new InputDefinition([
new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'),
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'),
- ));
+ ]);
}
}
diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php
new file mode 100644
index 0000000..60cfe36
--- /dev/null
+++ b/vendor/symfony/console/Command/LockableTrait.php
@@ -0,0 +1,69 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Command;
+
+use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Lock\Lock;
+use Symfony\Component\Lock\LockFactory;
+use Symfony\Component\Lock\Store\FlockStore;
+use Symfony\Component\Lock\Store\SemaphoreStore;
+
+/**
+ * Basic lock feature for commands.
+ *
+ * @author Geoffrey Brier <geoffrey.brier@gmail.com>
+ */
+trait LockableTrait
+{
+ /** @var Lock */
+ private $lock;
+
+ /**
+ * Locks a command.
+ */
+ private function lock(string $name = null, bool $blocking = false): bool
+ {
+ if (!class_exists(SemaphoreStore::class)) {
+ throw new LogicException('To enable the locking feature you must install the symfony/lock component.');
+ }
+
+ if (null !== $this->lock) {
+ throw new LogicException('A lock is already in place.');
+ }
+
+ if (SemaphoreStore::isSupported()) {
+ $store = new SemaphoreStore();
+ } else {
+ $store = new FlockStore();
+ }
+
+ $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName());
+ if (!$this->lock->acquire($blocking)) {
+ $this->lock = null;
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Releases the command lock if there is one.
+ */
+ private function release()
+ {
+ if ($this->lock) {
+ $this->lock->release();
+ $this->lock = null;
+ }
+ }
+}
diff --git a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php
new file mode 100644
index 0000000..ca1029c
--- /dev/null
+++ b/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php
@@ -0,0 +1,46 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\CommandLoader;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Exception\CommandNotFoundException;
+
+/**
+ * @author Robin Chalas <robin.chalas@gmail.com>
+ */
+interface CommandLoaderInterface
+{
+ /**
+ * Loads a command.
+ *
+ * @param string $name
+ *
+ * @return Command
+ *
+ * @throws CommandNotFoundException
+ */
+ public function get($name);
+
+ /**
+ * Checks if a command exists.
+ *
+ * @param string $name
+ *
+ * @return bool
+ */
+ public function has($name);
+
+ /**
+ * @return string[] All registered command names
+ */
+ public function getNames();
+}
diff --git a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php
new file mode 100644
index 0000000..50e5950
--- /dev/null
+++ b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php
@@ -0,0 +1,63 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\CommandLoader;
+
+use Psr\Container\ContainerInterface;
+use Symfony\Component\Console\Exception\CommandNotFoundException;
+
+/**
+ * Loads commands from a PSR-11 container.
+ *
+ * @author Robin Chalas <robin.chalas@gmail.com>
+ */
+class ContainerCommandLoader implements CommandLoaderInterface
+{
+ private $container;
+ private $commandMap;
+
+ /**
+ * @param array $commandMap An array with command names as keys and service ids as values
+ */
+ public function __construct(ContainerInterface $container, array $commandMap)
+ {
+ $this->container = $container;
+ $this->commandMap = $commandMap;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get($name)
+ {
+ if (!$this->has($name)) {
+ throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
+ }
+
+ return $this->container->get($this->commandMap[$name]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function has($name)
+ {
+ return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getNames()
+ {
+ return array_keys($this->commandMap);
+ }
+}
diff --git a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php
new file mode 100644
index 0000000..d9c2055
--- /dev/null
+++ b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php
@@ -0,0 +1,62 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\CommandLoader;
+
+use Symfony\Component\Console\Exception\CommandNotFoundException;
+
+/**
+ * A simple command loader using factories to instantiate commands lazily.
+ *
+ * @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
+ */
+class FactoryCommandLoader implements CommandLoaderInterface
+{
+ private $factories;
+
+ /**
+ * @param callable[] $factories Indexed by command names
+ */
+ public function __construct(array $factories)
+ {
+ $this->factories = $factories;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function has($name)
+ {
+ return isset($this->factories[$name]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get($name)
+ {
+ if (!isset($this->factories[$name])) {
+ throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
+ }
+
+ $factory = $this->factories[$name];
+
+ return $factory();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getNames()
+ {
+ return array_keys($this->factories);
+ }
+}
diff --git a/vendor/symfony/console/ConsoleEvents.php b/vendor/symfony/console/ConsoleEvents.php
index b3571e9..99b423c 100644
--- a/vendor/symfony/console/ConsoleEvents.php
+++ b/vendor/symfony/console/ConsoleEvents.php
@@ -21,33 +21,27 @@ final class ConsoleEvents
/**
* The COMMAND event allows you to attach listeners before any command is
* executed by the console. It also allows you to modify the command, input and output
- * before they are handled to the command.
+ * before they are handed to the command.
*
* @Event("Symfony\Component\Console\Event\ConsoleCommandEvent")
- *
- * @var string
*/
- const COMMAND = 'console.command';
+ public const COMMAND = 'console.command';
/**
* The TERMINATE event allows you to attach listeners after a command is
* executed by the console.
*
* @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent")
- *
- * @var string
*/
- const TERMINATE = 'console.terminate';
+ public const TERMINATE = 'console.terminate';
/**
- * The EXCEPTION event occurs when an uncaught exception appears.
+ * The ERROR event occurs when an uncaught exception or error appears.
*
- * This event allows you to deal with the exception or
+ * This event allows you to deal with the exception/error or
* to modify the thrown exception.
*
- * @Event("Symfony\Component\Console\Event\ConsoleExceptionEvent")
- *
- * @var string
+ * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent")
*/
- const EXCEPTION = 'console.exception';
+ public const ERROR = 'console.error';
}
diff --git a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php
new file mode 100644
index 0000000..aff892c
--- /dev/null
+++ b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php
@@ -0,0 +1,98 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\DependencyInjection;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\TypedReference;
+
+/**
+ * Registers console commands.
+ *
+ * @author Grégoire Pineau <lyrixx@lyrixx.info>
+ */
+class AddConsoleCommandPass implements CompilerPassInterface
+{
+ private $commandLoaderServiceId;
+ private $commandTag;
+
+ public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command')
+ {
+ $this->commandLoaderServiceId = $commandLoaderServiceId;
+ $this->commandTag = $commandTag;
+ }
+
+ public function process(ContainerBuilder $container)
+ {
+ $commandServices = $container->findTaggedServiceIds($this->commandTag, true);
+ $lazyCommandMap = [];
+ $lazyCommandRefs = [];
+ $serviceIds = [];
+
+ foreach ($commandServices as $id => $tags) {
+ $definition = $container->getDefinition($id);
+ $class = $container->getParameterBag()->resolveValue($definition->getClass());
+
+ if (isset($tags[0]['command'])) {
+ $commandName = $tags[0]['command'];
+ } else {
+ if (!$r = $container->getReflectionClass($class)) {
+ throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
+ }
+ if (!$r->isSubclassOf(Command::class)) {
+ throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class));
+ }
+ $commandName = $class::getDefaultName() !== null ? str_replace('%', '%%', $class::getDefaultName()) : null;
+ }
+
+ if (null === $commandName) {
+ if (!$definition->isPublic() || $definition->isPrivate()) {
+ $commandId = 'console.command.public_alias.'.$id;
+ $container->setAlias($commandId, $id)->setPublic(true);
+ $id = $commandId;
+ }
+ $serviceIds[] = $id;
+
+ continue;
+ }
+
+ unset($tags[0]);
+ $lazyCommandMap[$commandName] = $id;
+ $lazyCommandRefs[$id] = new TypedReference($id, $class);
+ $aliases = [];
+
+ foreach ($tags as $tag) {
+ if (isset($tag['command'])) {
+ $aliases[] = $tag['command'];
+ $lazyCommandMap[$tag['command']] = $id;
+ }
+ }
+
+ $definition->addMethodCall('setName', [$commandName]);
+
+ if ($aliases) {
+ $definition->addMethodCall('setAliases', [$aliases]);
+ }
+ }
+
+ $container
+ ->register($this->commandLoaderServiceId, ContainerCommandLoader::class)
+ ->setPublic(true)
+ ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]);
+
+ $container->setParameter('console.command.ids', $serviceIds);
+ }
+}
diff --git a/vendor/symfony/console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Descriptor/ApplicationDescription.php
index 89961b9..3970b90 100644
--- a/vendor/symfony/console/Descriptor/ApplicationDescription.php
+++ b/vendor/symfony/console/Descriptor/ApplicationDescription.php
@@ -22,17 +22,11 @@ use Symfony\Component\Console\Exception\CommandNotFoundException;
*/
class ApplicationDescription
{
- const GLOBAL_NAMESPACE = '_global';
+ public const GLOBAL_NAMESPACE = '_global';
- /**
- * @var Application
- */
private $application;
-
- /**
- * @var null|string
- */
private $namespace;
+ private $showHidden;
/**
* @var array
@@ -49,22 +43,14 @@ class ApplicationDescription
*/
private $aliases;
- /**
- * Constructor.
- *
- * @param Application $application
- * @param string|null $namespace
- */
- public function __construct(Application $application, $namespace = null)
+ public function __construct(Application $application, string $namespace = null, bool $showHidden = false)
{
$this->application = $application;
$this->namespace = $namespace;
+ $this->showHidden = $showHidden;
}
- /**
- * @return array
- */
- public function getNamespaces()
+ public function getNamespaces(): array
{
if (null === $this->namespaces) {
$this->inspectApplication();
@@ -76,7 +62,7 @@ class ApplicationDescription
/**
* @return Command[]
*/
- public function getCommands()
+ public function getCommands(): array
{
if (null === $this->commands) {
$this->inspectApplication();
@@ -86,33 +72,29 @@ class ApplicationDescription
}
/**
- * @param string $name
- *
- * @return Command
- *
* @throws CommandNotFoundException
*/
- public function getCommand($name)
+ public function getCommand(string $name): Command
{
if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) {
- throw new CommandNotFoundException(sprintf('Command %s does not exist.', $name));
+ throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
}
- return isset($this->commands[$name]) ? $this->commands[$name] : $this->aliases[$name];
+ return $this->commands[$name] ?? $this->aliases[$name];
}
private function inspectApplication()
{
- $this->commands = array();
- $this->namespaces = array();
+ $this->commands = [];
+ $this->namespaces = [];
$all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null);
foreach ($this->sortCommands($all) as $namespace => $commands) {
- $names = array();
+ $names = [];
/** @var Command $command */
foreach ($commands as $name => $command) {
- if (!$command->getName()) {
+ if (!$command->getName() || (!$this->showHidden && $command->isHidden())) {
continue;
}
@@ -125,36 +107,37 @@ class ApplicationDescription
$names[] = $name;
}
- $this->namespaces[$namespace] = array('id' => $namespace, 'commands' => $names);
+ $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names];
}
}
- /**
- * @param array $commands
- *
- * @return array
- */
- private function sortCommands(array $commands)
+ private function sortCommands(array $commands): array
{
- $namespacedCommands = array();
- $globalCommands = array();
+ $namespacedCommands = [];
+ $globalCommands = [];
+ $sortedCommands = [];
foreach ($commands as $name => $command) {
$key = $this->application->extractNamespace($name, 1);
- if (!$key) {
- $globalCommands['_global'][$name] = $command;
+ if (\in_array($key, ['', self::GLOBAL_NAMESPACE], true)) {
+ $globalCommands[$name] = $command;
} else {
$namespacedCommands[$key][$name] = $command;
}
}
- ksort($namespacedCommands);
- $namespacedCommands = array_merge($globalCommands, $namespacedCommands);
- foreach ($namespacedCommands as &$commandsSet) {
- ksort($commandsSet);
+ if ($globalCommands) {
+ ksort($globalCommands);
+ $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands;
+ }
+
+ if ($namespacedCommands) {
+ ksort($namespacedCommands);
+ foreach ($namespacedCommands as $key => $commandsSet) {
+ ksort($commandsSet);
+ $sortedCommands[$key] = $commandsSet;
+ }
}
- // unset reference to keep scope clear
- unset($commandsSet);
- return $namespacedCommands;
+ return $sortedCommands;
}
}
diff --git a/vendor/symfony/console/Descriptor/Descriptor.php b/vendor/symfony/console/Descriptor/Descriptor.php
index 50dd86c..9c3878d 100644
--- a/vendor/symfony/console/Descriptor/Descriptor.php
+++ b/vendor/symfony/console/Descriptor/Descriptor.php
@@ -13,11 +13,11 @@ namespace Symfony\Component\Console\Descriptor;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Exception\InvalidArgumentException;
/**
* @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
@@ -34,7 +34,7 @@ abstract class Descriptor implements DescriptorInterface
/**
* {@inheritdoc}
*/
- public function describe(OutputInterface $output, $object, array $options = array())
+ public function describe(OutputInterface $output, $object, array $options = [])
{
$this->output = $output;
@@ -55,7 +55,7 @@ abstract class Descriptor implements DescriptorInterface
$this->describeApplication($object, $options);
break;
default:
- throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object)));
+ throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', \get_class($object)));
}
}
@@ -72,51 +72,26 @@ abstract class Descriptor implements DescriptorInterface
/**
* Describes an InputArgument instance.
- *
- * @param InputArgument $argument
- * @param array $options
- *
- * @return string|mixed
*/
- abstract protected function describeInputArgument(InputArgument $argument, array $options = array());
+ abstract protected function describeInputArgument(InputArgument $argument, array $options = []);
/**
* Describes an InputOption instance.
- *
- * @param InputOption $option
- * @param array $options
- *
- * @return string|mixed
*/
- abstract protected function describeInputOption(InputOption $option, array $options = array());
+ abstract protected function describeInputOption(InputOption $option, array $options = []);
/**
* Describes an InputDefinition instance.
- *
- * @param InputDefinition $definition
- * @param array $options
- *
- * @return string|mixed
*/
- abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array());
+ abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []);
/**
* Describes a Command instance.
- *
- * @param Command $command
- * @param array $options
- *
- * @return string|mixed
*/
- abstract protected function describeCommand(Command $command, array $options = array());
+ abstract protected function describeCommand(Command $command, array $options = []);
/**
* Describes an Application instance.
- *
- * @param Application $application
- * @param array $options
- *
- * @return string|mixed
*/
- abstract protected function describeApplication(Application $application, array $options = array());
+ abstract protected function describeApplication(Application $application, array $options = []);
}
diff --git a/vendor/symfony/console/Descriptor/DescriptorInterface.php b/vendor/symfony/console/Descriptor/DescriptorInterface.php
index 3929b6d..e3184a6 100644
--- a/vendor/symfony/console/Descriptor/DescriptorInterface.php
+++ b/vendor/symfony/console/Descriptor/DescriptorInterface.php
@@ -21,11 +21,9 @@ use Symfony\Component\Console\Output\OutputInterface;
interface DescriptorInterface
{
/**
- * Describes an InputArgument instance.
+ * Describes an object if supported.
*
- * @param OutputInterface $output
- * @param object $object
- * @param array $options
+ * @param object $object
*/
- public function describe(OutputInterface $output, $object, array $options = array());
+ public function describe(OutputInterface $output, $object, array $options = []);
}
diff --git a/vendor/symfony/console/Descriptor/JsonDescriptor.php b/vendor/symfony/console/Descriptor/JsonDescriptor.php
index 87e38fd..4c09e12 100644
--- a/vendor/symfony/console/Descriptor/JsonDescriptor.php
+++ b/vendor/symfony/console/Descriptor/JsonDescriptor.php
@@ -29,7 +29,7 @@ class JsonDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputArgument(InputArgument $argument, array $options = array())
+ protected function describeInputArgument(InputArgument $argument, array $options = [])
{
$this->writeData($this->getInputArgumentData($argument), $options);
}
@@ -37,7 +37,7 @@ class JsonDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputOption(InputOption $option, array $options = array())
+ protected function describeInputOption(InputOption $option, array $options = [])
{
$this->writeData($this->getInputOptionData($option), $options);
}
@@ -45,7 +45,7 @@ class JsonDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
+ protected function describeInputDefinition(InputDefinition $definition, array $options = [])
{
$this->writeData($this->getInputDefinitionData($definition), $options);
}
@@ -53,7 +53,7 @@ class JsonDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeCommand(Command $command, array $options = array())
+ protected function describeCommand(Command $command, array $options = [])
{
$this->writeData($this->getCommandData($command), $options);
}
@@ -61,106 +61,96 @@ class JsonDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeApplication(Application $application, array $options = array())
+ protected function describeApplication(Application $application, array $options = [])
{
- $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
- $description = new ApplicationDescription($application, $describedNamespace);
- $commands = array();
+ $describedNamespace = $options['namespace'] ?? null;
+ $description = new ApplicationDescription($application, $describedNamespace, true);
+ $commands = [];
foreach ($description->getCommands() as $command) {
$commands[] = $this->getCommandData($command);
}
- $data = $describedNamespace
- ? array('commands' => $commands, 'namespace' => $describedNamespace)
- : array('commands' => $commands, 'namespaces' => array_values($description->getNamespaces()));
+ $data = [];
+ if ('UNKNOWN' !== $application->getName()) {
+ $data['application']['name'] = $application->getName();
+ if ('UNKNOWN' !== $application->getVersion()) {
+ $data['application']['version'] = $application->getVersion();
+ }
+ }
+
+ $data['commands'] = $commands;
+
+ if ($describedNamespace) {
+ $data['namespace'] = $describedNamespace;
+ } else {
+ $data['namespaces'] = array_values($description->getNamespaces());
+ }
$this->writeData($data, $options);
}
/**
* Writes data as json.
- *
- * @param array $data
- * @param array $options
- *
- * @return array|string
*/
private function writeData(array $data, array $options)
{
- $this->write(json_encode($data, isset($options['json_encoding']) ? $options['json_encoding'] : 0));
+ $flags = $options['json_encoding'] ?? 0;
+
+ $this->write(json_encode($data, $flags));
}
- /**
- * @param InputArgument $argument
- *
- * @return array
- */
- private function getInputArgumentData(InputArgument $argument)
+ private function getInputArgumentData(InputArgument $argument): array
{
- return array(
+ return [
'name' => $argument->getName(),
'is_required' => $argument->isRequired(),
'is_array' => $argument->isArray(),
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()),
- 'default' => $argument->getDefault(),
- );
+ 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(),
+ ];
}
- /**
- * @param InputOption $option
- *
- * @return array
- */
- private function getInputOptionData(InputOption $option)
+ private function getInputOptionData(InputOption $option): array
{
- return array(
+ return [
'name' => '--'.$option->getName(),
- 'shortcut' => $option->getShortcut() ? '-'.implode('|-', explode('|', $option->getShortcut())) : '',
+ 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '',
'accept_value' => $option->acceptValue(),
'is_value_required' => $option->isValueRequired(),
'is_multiple' => $option->isArray(),
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()),
- 'default' => $option->getDefault(),
- );
+ 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(),
+ ];
}
- /**
- * @param InputDefinition $definition
- *
- * @return array
- */
- private function getInputDefinitionData(InputDefinition $definition)
+ private function getInputDefinitionData(InputDefinition $definition): array
{
- $inputArguments = array();
+ $inputArguments = [];
foreach ($definition->getArguments() as $name => $argument) {
$inputArguments[$name] = $this->getInputArgumentData($argument);
}
- $inputOptions = array();
+ $inputOptions = [];
foreach ($definition->getOptions() as $name => $option) {
$inputOptions[$name] = $this->getInputOptionData($option);
}
- return array('arguments' => $inputArguments, 'options' => $inputOptions);
+ return ['arguments' => $inputArguments, 'options' => $inputOptions];
}
- /**
- * @param Command $command
- *
- * @return array
- */
- private function getCommandData(Command $command)
+ private function getCommandData(Command $command): array
{
$command->getSynopsis();
$command->mergeApplicationDefinition(false);
- return array(
+ return [
'name' => $command->getName(),
- 'usage' => array_merge(array($command->getSynopsis()), $command->getUsages(), $command->getAliases()),
+ 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()),
'description' => $command->getDescription(),
'help' => $command->getProcessedHelp(),
'definition' => $this->getInputDefinitionData($command->getNativeDefinition()),
- );
+ 'hidden' => $command->isHidden(),
+ ];
}
}
diff --git a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/vendor/symfony/console/Descriptor/MarkdownDescriptor.php
index 2eb9944..9a9d280 100644
--- a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php
+++ b/vendor/symfony/console/Descriptor/MarkdownDescriptor.php
@@ -13,9 +13,11 @@ namespace Symfony\Component\Console\Descriptor;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
/**
* Markdown descriptor.
@@ -29,14 +31,34 @@ class MarkdownDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputArgument(InputArgument $argument, array $options = array())
+ public function describe(OutputInterface $output, $object, array $options = [])
+ {
+ $decorated = $output->isDecorated();
+ $output->setDecorated(false);
+
+ parent::describe($output, $object, $options);
+
+ $output->setDecorated($decorated);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function write($content, $decorated = true)
+ {
+ parent::write($content, $decorated);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function describeInputArgument(InputArgument $argument, array $options = [])
{
$this->write(
- '**'.$argument->getName().':**'."\n\n"
- .'* Name: '.($argument->getName() ?: '<none>')."\n"
+ '#### `'.($argument->getName() ?: '<none>')."`\n\n"
+ .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '')
.'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n"
.'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n"
- .'* Description: '.preg_replace('/\s*[\r\n]\s*/', "\n ", $argument->getDescription() ?: '<none>')."\n"
.'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`'
);
}
@@ -44,16 +66,19 @@ class MarkdownDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputOption(InputOption $option, array $options = array())
+ protected function describeInputOption(InputOption $option, array $options = [])
{
+ $name = '--'.$option->getName();
+ if ($option->getShortcut()) {
+ $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).'';
+ }
+
$this->write(
- '**'.$option->getName().':**'."\n\n"
- .'* Name: `--'.$option->getName().'`'."\n"
- .'* Shortcut: '.($option->getShortcut() ? '`-'.implode('|-', explode('|', $option->getShortcut())).'`' : '<none>')."\n"
+ '#### `'.$name.'`'."\n\n"
+ .($option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '')
.'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n"
.'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n"
.'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n"
- .'* Description: '.preg_replace('/\s*[\r\n]\s*/', "\n ", $option->getDescription() ?: '<none>')."\n"
.'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`'
);
}
@@ -61,22 +86,22 @@ class MarkdownDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
+ protected function describeInputDefinition(InputDefinition $definition, array $options = [])
{
- if ($showArguments = count($definition->getArguments()) > 0) {
- $this->write('### Arguments:');
+ if ($showArguments = \count($definition->getArguments()) > 0) {
+ $this->write('### Arguments');
foreach ($definition->getArguments() as $argument) {
$this->write("\n\n");
$this->write($this->describeInputArgument($argument));
}
}
- if (count($definition->getOptions()) > 0) {
+ if (\count($definition->getOptions()) > 0) {
if ($showArguments) {
$this->write("\n\n");
}
- $this->write('### Options:');
+ $this->write('### Options');
foreach ($definition->getOptions() as $option) {
$this->write("\n\n");
$this->write($this->describeInputOption($option));
@@ -87,18 +112,18 @@ class MarkdownDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeCommand(Command $command, array $options = array())
+ protected function describeCommand(Command $command, array $options = [])
{
$command->getSynopsis();
$command->mergeApplicationDefinition(false);
$this->write(
- $command->getName()."\n"
- .str_repeat('-', strlen($command->getName()))."\n\n"
- .'* Description: '.($command->getDescription() ?: '<none>')."\n"
- .'* Usage:'."\n\n"
- .array_reduce(array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()), function ($carry, $usage) {
- return $carry.' * `'.$usage.'`'."\n";
+ '`'.$command->getName()."`\n"
+ .str_repeat('-', Helper::strlen($command->getName()) + 2)."\n\n"
+ .($command->getDescription() ? $command->getDescription()."\n\n" : '')
+ .'### Usage'."\n\n"
+ .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) {
+ return $carry.'* `'.$usage.'`'."\n";
})
);
@@ -116,12 +141,13 @@ class MarkdownDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeApplication(Application $application, array $options = array())
+ protected function describeApplication(Application $application, array $options = [])
{
- $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
+ $describedNamespace = $options['namespace'] ?? null;
$description = new ApplicationDescription($application, $describedNamespace);
+ $title = $this->getApplicationTitle($application);
- $this->write($application->getName()."\n".str_repeat('=', strlen($application->getName())));
+ $this->write($title."\n".str_repeat('=', Helper::strlen($title)));
foreach ($description->getNamespaces() as $namespace) {
if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
@@ -130,8 +156,8 @@ class MarkdownDescriptor extends Descriptor
}
$this->write("\n\n");
- $this->write(implode("\n", array_map(function ($commandName) {
- return '* '.$commandName;
+ $this->write(implode("\n", array_map(function ($commandName) use ($description) {
+ return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName()));
}, $namespace['commands'])));
}
@@ -140,4 +166,17 @@ class MarkdownDescriptor extends Descriptor
$this->write($this->describeCommand($command));
}
}
+
+ private function getApplicationTitle(Application $application): string
+ {
+ if ('UNKNOWN' !== $application->getName()) {
+ if ('UNKNOWN' !== $application->getVersion()) {
+ return sprintf('%s %s', $application->getName(), $application->getVersion());
+ }
+
+ return $application->getName();
+ }
+
+ return 'Console Tool';
+ }
}
diff --git a/vendor/symfony/console/Descriptor/TextDescriptor.php b/vendor/symfony/console/Descriptor/TextDescriptor.php
index f7446eb..7d4d5f0 100644
--- a/vendor/symfony/console/Descriptor/TextDescriptor.php
+++ b/vendor/symfony/console/Descriptor/TextDescriptor.php
@@ -13,6 +13,8 @@ namespace Symfony\Component\Console\Descriptor;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
@@ -29,22 +31,22 @@ class TextDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputArgument(InputArgument $argument, array $options = array())
+ protected function describeInputArgument(InputArgument $argument, array $options = [])
{
- if (null !== $argument->getDefault() && (!is_array($argument->getDefault()) || count($argument->getDefault()))) {
+ if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) {
$default = sprintf('<comment> [default: %s]</comment>', $this->formatDefaultValue($argument->getDefault()));
} else {
$default = '';
}
- $totalWidth = isset($options['total_width']) ? $options['total_width'] : strlen($argument->getName());
- $spacingWidth = $totalWidth - strlen($argument->getName()) + 2;
+ $totalWidth = $options['total_width'] ?? Helper::strlen($argument->getName());
+ $spacingWidth = $totalWidth - \strlen($argument->getName());
- $this->writeText(sprintf(' <info>%s</info>%s%s%s',
+ $this->writeText(sprintf(' <info>%s</info> %s%s%s',
$argument->getName(),
str_repeat(' ', $spacingWidth),
- // + 17 = 2 spaces + <info> + </info> + 2 spaces
- preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $argument->getDescription()),
+ // + 4 = 2 spaces before <info>, 2 spaces after </info>
+ preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()),
$default
), $options);
}
@@ -52,9 +54,9 @@ class TextDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputOption(InputOption $option, array $options = array())
+ protected function describeInputOption(InputOption $option, array $options = [])
{
- if ($option->acceptValue() && null !== $option->getDefault() && (!is_array($option->getDefault()) || count($option->getDefault()))) {
+ if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) {
$default = sprintf('<comment> [default: %s]</comment>', $this->formatDefaultValue($option->getDefault()));
} else {
$default = '';
@@ -69,19 +71,19 @@ class TextDescriptor extends Descriptor
}
}
- $totalWidth = isset($options['total_width']) ? $options['total_width'] : $this->calculateTotalWidthForOptions(array($option));
+ $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]);
$synopsis = sprintf('%s%s',
$option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ',
sprintf('--%s%s', $option->getName(), $value)
);
- $spacingWidth = $totalWidth - strlen($synopsis) + 2;
+ $spacingWidth = $totalWidth - Helper::strlen($synopsis);
- $this->writeText(sprintf(' <info>%s</info>%s%s%s%s',
+ $this->writeText(sprintf(' <info>%s</info> %s%s%s%s',
$synopsis,
str_repeat(' ', $spacingWidth),
- // + 17 = 2 spaces + <info> + </info> + 2 spaces
- preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $option->getDescription()),
+ // + 4 = 2 spaces before <info>, 2 spaces after </info>
+ preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()),
$default,
$option->isArray() ? '<comment> (multiple values allowed)</comment>' : ''
), $options);
@@ -90,18 +92,18 @@ class TextDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
+ protected function describeInputDefinition(InputDefinition $definition, array $options = [])
{
$totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions());
foreach ($definition->getArguments() as $argument) {
- $totalWidth = max($totalWidth, strlen($argument->getName()));
+ $totalWidth = max($totalWidth, Helper::strlen($argument->getName()));
}
if ($definition->getArguments()) {
$this->writeText('<comment>Arguments:</comment>', $options);
$this->writeText("\n");
foreach ($definition->getArguments() as $argument) {
- $this->describeInputArgument($argument, array_merge($options, array('total_width' => $totalWidth)));
+ $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth]));
$this->writeText("\n");
}
}
@@ -111,20 +113,20 @@ class TextDescriptor extends Descriptor
}
if ($definition->getOptions()) {
- $laterOptions = array();
+ $laterOptions = [];
$this->writeText('<comment>Options:</comment>', $options);
foreach ($definition->getOptions() as $option) {
- if (strlen($option->getShortcut()) > 1) {
+ if (\strlen($option->getShortcut() ?? '') > 1) {
$laterOptions[] = $option;
continue;
}
$this->writeText("\n");
- $this->describeInputOption($option, array_merge($options, array('total_width' => $totalWidth)));
+ $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth]));
}
foreach ($laterOptions as $option) {
$this->writeText("\n");
- $this->describeInputOption($option, array_merge($options, array('total_width' => $totalWidth)));
+ $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth]));
}
}
}
@@ -132,16 +134,23 @@ class TextDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeCommand(Command $command, array $options = array())
+ protected function describeCommand(Command $command, array $options = [])
{
$command->getSynopsis(true);
$command->getSynopsis(false);
$command->mergeApplicationDefinition(false);
+ if ($description = $command->getDescription()) {
+ $this->writeText('<comment>Description:</comment>', $options);
+ $this->writeText("\n");
+ $this->writeText(' '.$description);
+ $this->writeText("\n\n");
+ }
+
$this->writeText('<comment>Usage:</comment>', $options);
- foreach (array_merge(array($command->getSynopsis(true)), $command->getAliases(), $command->getUsages()) as $usage) {
+ foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) {
$this->writeText("\n");
- $this->writeText(' '.$usage, $options);
+ $this->writeText(' '.OutputFormatter::escape($usage), $options);
}
$this->writeText("\n");
@@ -152,7 +161,8 @@ class TextDescriptor extends Descriptor
$this->writeText("\n");
}
- if ($help = $command->getProcessedHelp()) {
+ $help = $command->getProcessedHelp();
+ if ($help && $help !== $description) {
$this->writeText("\n");
$this->writeText('<comment>Help:</comment>', $options);
$this->writeText("\n");
@@ -164,9 +174,9 @@ class TextDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeApplication(Application $application, array $options = array())
+ protected function describeApplication(Application $application, array $options = [])
{
- $describedNamespace = isset($options['namespace']) ? $options['namespace'] : null;
+ $describedNamespace = $options['namespace'] ?? null;
$description = new ApplicationDescription($application, $describedNamespace);
if (isset($options['raw_text']) && $options['raw_text']) {
@@ -189,7 +199,20 @@ class TextDescriptor extends Descriptor
$this->writeText("\n");
$this->writeText("\n");
- $width = $this->getColumnWidth($description->getCommands());
+ $commands = $description->getCommands();
+ $namespaces = $description->getNamespaces();
+ if ($describedNamespace && $namespaces) {
+ // make sure all alias commands are included when describing a specific namespace
+ $describedNamespaceInfo = reset($namespaces);
+ foreach ($describedNamespaceInfo['commands'] as $name) {
+ $commands[$name] = $description->getCommand($name);
+ }
+ }
+
+ // calculate max. width based on available commands per namespace
+ $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) {
+ return array_intersect($namespace['commands'], array_keys($commands));
+ }, array_values($namespaces)))));
if ($describedNamespace) {
$this->writeText(sprintf('<comment>Available commands for the "%s" namespace:</comment>', $describedNamespace), $options);
@@ -197,8 +220,15 @@ class TextDescriptor extends Descriptor
$this->writeText('<comment>Available commands:</comment>', $options);
}
- // add commands by namespace
- foreach ($description->getNamespaces() as $namespace) {
+ foreach ($namespaces as $namespace) {
+ $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) {
+ return isset($commands[$name]);
+ });
+
+ if (!$namespace['commands']) {
+ continue;
+ }
+
if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) {
$this->writeText("\n");
$this->writeText(' <comment>'.$namespace['id'].'</comment>', $options);
@@ -206,8 +236,10 @@ class TextDescriptor extends Descriptor
foreach ($namespace['commands'] as $name) {
$this->writeText("\n");
- $spacingWidth = $width - strlen($name);
- $this->writeText(sprintf(' <info>%s</info>%s%s', $name, str_repeat(' ', $spacingWidth), $description->getCommand($name)->getDescription()), $options);
+ $spacingWidth = $width - Helper::strlen($name);
+ $command = $commands[$name];
+ $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : '';
+ $this->writeText(sprintf(' <info>%s</info>%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options);
}
}
@@ -218,7 +250,7 @@ class TextDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- private function writeText($content, array $options = array())
+ private function writeText(string $content, array $options = [])
{
$this->write(
isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content,
@@ -227,50 +259,77 @@ class TextDescriptor extends Descriptor
}
/**
+ * Formats command aliases to show them in the command description.
+ */
+ private function getCommandAliasesText(Command $command): string
+ {
+ $text = '';
+ $aliases = $command->getAliases();
+
+ if ($aliases) {
+ $text = '['.implode('|', $aliases).'] ';
+ }
+
+ return $text;
+ }
+
+ /**
* Formats input option/argument default value.
*
* @param mixed $default
- *
- * @return string
*/
- private function formatDefaultValue($default)
+ private function formatDefaultValue($default): string
{
- return str_replace('\\\\', '\\', json_encode($default, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
+ if (\INF === $default) {
+ return 'INF';
+ }
+
+ if (\is_string($default)) {
+ $default = OutputFormatter::escape($default);
+ } elseif (\is_array($default)) {
+ foreach ($default as $key => $value) {
+ if (\is_string($value)) {
+ $default[$key] = OutputFormatter::escape($value);
+ }
+ }
+ }
+
+ return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
}
/**
- * @param Command[] $commands
- *
- * @return int
+ * @param array<Command|string> $commands
*/
- private function getColumnWidth(array $commands)
+ private function getColumnWidth(array $commands): int
{
- $widths = array();
+ $widths = [];
foreach ($commands as $command) {
- $widths[] = strlen($command->getName());
- foreach ($command->getAliases() as $alias) {
- $widths[] = strlen($alias);
+ if ($command instanceof Command) {
+ $widths[] = Helper::strlen($command->getName());
+ foreach ($command->getAliases() as $alias) {
+ $widths[] = Helper::strlen($alias);
+ }
+ } else {
+ $widths[] = Helper::strlen($command);
}
}
- return max($widths) + 2;
+ return $widths ? max($widths) + 2 : 0;
}
/**
* @param InputOption[] $options
- *
- * @return int
*/
- private function calculateTotalWidthForOptions($options)
+ private function calculateTotalWidthForOptions(array $options): int
{
$totalWidth = 0;
foreach ($options as $option) {
// "-" + shortcut + ", --" + name
- $nameLength = 1 + max(strlen($option->getShortcut()), 1) + 4 + strlen($option->getName());
+ $nameLength = 1 + max(Helper::strlen($option->getShortcut()), 1) + 4 + Helper::strlen($option->getName());
if ($option->acceptValue()) {
- $valueLength = 1 + strlen($option->getName()); // = + value
+ $valueLength = 1 + Helper::strlen($option->getName()); // = + value
$valueLength += $option->isValueOptional() ? 2 : 0; // [ + ]
$nameLength += $valueLength;
diff --git a/vendor/symfony/console/Descriptor/XmlDescriptor.php b/vendor/symfony/console/Descriptor/XmlDescriptor.php
index b5676be..e0ed53a 100644
--- a/vendor/symfony/console/Descriptor/XmlDescriptor.php
+++ b/vendor/symfony/console/Descriptor/XmlDescriptor.php
@@ -26,12 +26,7 @@ use Symfony\Component\Console\Input\InputOption;
*/
class XmlDescriptor extends Descriptor
{
- /**
- * @param InputDefinition $definition
- *
- * @return \DOMDocument
- */
- public function getInputDefinitionDocument(InputDefinition $definition)
+ public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($definitionXML = $dom->createElement('definition'));
@@ -49,12 +44,7 @@ class XmlDescriptor extends Descriptor
return $dom;
}
- /**
- * @param Command $command
- *
- * @return \DOMDocument
- */
- public function getCommandDocument(Command $command)
+ public function getCommandDocument(Command $command): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($commandXML = $dom->createElement('command'));
@@ -64,10 +54,11 @@ class XmlDescriptor extends Descriptor
$commandXML->setAttribute('id', $command->getName());
$commandXML->setAttribute('name', $command->getName());
+ $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0);
$commandXML->appendChild($usagesXML = $dom->createElement('usages'));
- foreach (array_merge(array($command->getSynopsis()), $command->getAliases(), $command->getUsages()) as $usage) {
+ foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) {
$usagesXML->appendChild($dom->createElement('usage', $usage));
}
@@ -83,27 +74,21 @@ class XmlDescriptor extends Descriptor
return $dom;
}
- /**
- * @param Application $application
- * @param string|null $namespace
- *
- * @return \DOMDocument
- */
- public function getApplicationDocument(Application $application, $namespace = null)
+ public function getApplicationDocument(Application $application, string $namespace = null): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($rootXml = $dom->createElement('symfony'));
- if ($application->getName() !== 'UNKNOWN') {
+ if ('UNKNOWN' !== $application->getName()) {
$rootXml->setAttribute('name', $application->getName());
- if ($application->getVersion() !== 'UNKNOWN') {
+ if ('UNKNOWN' !== $application->getVersion()) {
$rootXml->setAttribute('version', $application->getVersion());
}
}
$rootXml->appendChild($commandsXML = $dom->createElement('commands'));
- $description = new ApplicationDescription($application, $namespace);
+ $description = new ApplicationDescription($application, $namespace, true);
if ($namespace) {
$commandsXML->setAttribute('namespace', $namespace);
@@ -133,7 +118,7 @@ class XmlDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputArgument(InputArgument $argument, array $options = array())
+ protected function describeInputArgument(InputArgument $argument, array $options = [])
{
$this->writeDocument($this->getInputArgumentDocument($argument));
}
@@ -141,7 +126,7 @@ class XmlDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputOption(InputOption $option, array $options = array())
+ protected function describeInputOption(InputOption $option, array $options = [])
{
$this->writeDocument($this->getInputOptionDocument($option));
}
@@ -149,7 +134,7 @@ class XmlDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeInputDefinition(InputDefinition $definition, array $options = array())
+ protected function describeInputDefinition(InputDefinition $definition, array $options = [])
{
$this->writeDocument($this->getInputDefinitionDocument($definition));
}
@@ -157,7 +142,7 @@ class XmlDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeCommand(Command $command, array $options = array())
+ protected function describeCommand(Command $command, array $options = [])
{
$this->writeDocument($this->getCommandDocument($command));
}
@@ -165,16 +150,13 @@ class XmlDescriptor extends Descriptor
/**
* {@inheritdoc}
*/
- protected function describeApplication(Application $application, array $options = array())
+ protected function describeApplication(Application $application, array $options = [])
{
- $this->writeDocument($this->getApplicationDocument($application, isset($options['namespace']) ? $options['namespace'] : null));
+ $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null));
}
/**
* Appends document children to parent node.
- *
- * @param \DOMNode $parentNode
- * @param \DOMNode $importedParent
*/
private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent)
{
@@ -185,10 +167,6 @@ class XmlDescriptor extends Descriptor
/**
* Writes DOM document.
- *
- * @param \DOMDocument $dom
- *
- * @return \DOMDocument|string
*/
private function writeDocument(\DOMDocument $dom)
{
@@ -196,12 +174,7 @@ class XmlDescriptor extends Descriptor
$this->write($dom->saveXML());
}
- /**
- * @param InputArgument $argument
- *
- * @return \DOMDocument
- */
- private function getInputArgumentDocument(InputArgument $argument)
+ private function getInputArgumentDocument(InputArgument $argument): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
@@ -213,7 +186,7 @@ class XmlDescriptor extends Descriptor
$descriptionXML->appendChild($dom->createTextNode($argument->getDescription()));
$objectXML->appendChild($defaultsXML = $dom->createElement('defaults'));
- $defaults = is_array($argument->getDefault()) ? $argument->getDefault() : (is_bool($argument->getDefault()) ? array(var_export($argument->getDefault(), true)) : ($argument->getDefault() ? array($argument->getDefault()) : array()));
+ $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : []));
foreach ($defaults as $default) {
$defaultsXML->appendChild($defaultXML = $dom->createElement('default'));
$defaultXML->appendChild($dom->createTextNode($default));
@@ -222,21 +195,16 @@ class XmlDescriptor extends Descriptor
return $dom;
}
- /**
- * @param InputOption $option
- *
- * @return \DOMDocument
- */
- private function getInputOptionDocument(InputOption $option)
+ private function getInputOptionDocument(InputOption $option): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($objectXML = $dom->createElement('option'));
$objectXML->setAttribute('name', '--'.$option->getName());
- $pos = strpos($option->getShortcut(), '|');
+ $pos = strpos($option->getShortcut() ?? '', '|');
if (false !== $pos) {
$objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos));
- $objectXML->setAttribute('shortcuts', '-'.implode('|-', explode('|', $option->getShortcut())));
+ $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut()));
} else {
$objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : '');
}
@@ -247,7 +215,7 @@ class XmlDescriptor extends Descriptor
$descriptionXML->appendChild($dom->createTextNode($option->getDescription()));
if ($option->acceptValue()) {
- $defaults = is_array($option->getDefault()) ? $option->getDefault() : (is_bool($option->getDefault()) ? array(var_export($option->getDefault(), true)) : ($option->getDefault() ? array($option->getDefault()) : array()));
+ $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : []));
$objectXML->appendChild($defaultsXML = $dom->createElement('defaults'));
if (!empty($defaults)) {
diff --git a/vendor/symfony/console/Event/ConsoleCommandEvent.php b/vendor/symfony/console/Event/ConsoleCommandEvent.php
index 92adf1e..9691db6 100644
--- a/vendor/symfony/console/Event/ConsoleCommandEvent.php
+++ b/vendor/symfony/console/Event/ConsoleCommandEvent.php
@@ -15,18 +15,18 @@ namespace Symfony\Component\Console\Event;
* Allows to do things before the command is executed, like skipping the command or changing the input.
*
* @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @final since Symfony 4.4
*/
class ConsoleCommandEvent extends ConsoleEvent
{
/**
* The return code for skipped commands, this will also be passed into the terminate event.
*/
- const RETURN_CODE_DISABLED = 113;
+ public const RETURN_CODE_DISABLED = 113;
/**
* Indicates if the command should be run or skipped.
- *
- * @var bool
*/
private $commandShouldRun = true;
diff --git a/vendor/symfony/console/Event/ConsoleErrorEvent.php b/vendor/symfony/console/Event/ConsoleErrorEvent.php
new file mode 100644
index 0000000..57d9b38
--- /dev/null
+++ b/vendor/symfony/console/Event/ConsoleErrorEvent.php
@@ -0,0 +1,58 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Event;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Allows to handle throwables thrown while running a command.
+ *
+ * @author Wouter de Jong <wouter@wouterj.nl>
+ */
+final class ConsoleErrorEvent extends ConsoleEvent
+{
+ private $error;
+ private $exitCode;
+
+ public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null)
+ {
+ parent::__construct($command, $input, $output);
+
+ $this->error = $error;
+ }
+
+ public function getError(): \Throwable
+ {
+ return $this->error;
+ }
+
+ public function setError(\Throwable $error): void
+ {
+ $this->error = $error;
+ }
+
+ public function setExitCode(int $exitCode): void
+ {
+ $this->exitCode = $exitCode;
+
+ $r = new \ReflectionProperty($this->error, 'code');
+ $r->setAccessible(true);
+ $r->setValue($this->error, $this->exitCode);
+ }
+
+ public function getExitCode(): int
+ {
+ return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1);
+ }
+}
diff --git a/vendor/symfony/console/Event/ConsoleEvent.php b/vendor/symfony/console/Event/ConsoleEvent.php
index ab620c4..400eb57 100644
--- a/vendor/symfony/console/Event/ConsoleEvent.php
+++ b/vendor/symfony/console/Event/ConsoleEvent.php
@@ -28,7 +28,7 @@ class ConsoleEvent extends Event
private $input;
private $output;
- public function __construct(Command $command, InputInterface $input, OutputInterface $output)
+ public function __construct(?Command $command, InputInterface $input, OutputInterface $output)
{
$this->command = $command;
$this->input = $input;
@@ -38,7 +38,7 @@ class ConsoleEvent extends Event
/**
* Gets the command that is executed.
*
- * @return Command A Command instance
+ * @return Command|null A Command instance
*/
public function getCommand()
{
diff --git a/vendor/symfony/console/Event/ConsoleExceptionEvent.php b/vendor/symfony/console/Event/ConsoleExceptionEvent.php
deleted file mode 100644
index 603b7ee..0000000
--- a/vendor/symfony/console/Event/ConsoleExceptionEvent.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Event;
-
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
-
-/**
- * Allows to handle exception thrown in a command.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class ConsoleExceptionEvent extends ConsoleEvent
-{
- private $exception;
- private $exitCode;
-
- public function __construct(Command $command, InputInterface $input, OutputInterface $output, \Exception $exception, $exitCode)
- {
- parent::__construct($command, $input, $output);
-
- $this->setException($exception);
- $this->exitCode = (int) $exitCode;
- }
-
- /**
- * Returns the thrown exception.
- *
- * @return \Exception The thrown exception
- */
- public function getException()
- {
- return $this->exception;
- }
-
- /**
- * Replaces the thrown exception.
- *
- * This exception will be thrown if no response is set in the event.
- *
- * @param \Exception $exception The thrown exception
- */
- public function setException(\Exception $exception)
- {
- $this->exception = $exception;
- }
-
- /**
- * Gets the exit code.
- *
- * @return int The command exit code
- */
- public function getExitCode()
- {
- return $this->exitCode;
- }
-}
diff --git a/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/vendor/symfony/console/Event/ConsoleTerminateEvent.php
index b6a5d7c..43d0f8a 100644
--- a/vendor/symfony/console/Event/ConsoleTerminateEvent.php
+++ b/vendor/symfony/console/Event/ConsoleTerminateEvent.php
@@ -19,17 +19,14 @@ use Symfony\Component\Console\Output\OutputInterface;
* Allows to manipulate the exit code of a command after its execution.
*
* @author Francesco Levorato <git@flevour.net>
+ *
+ * @final since Symfony 4.4
*/
class ConsoleTerminateEvent extends ConsoleEvent
{
- /**
- * The exit code of the command.
- *
- * @var int
- */
private $exitCode;
- public function __construct(Command $command, InputInterface $input, OutputInterface $output, $exitCode)
+ public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode)
{
parent::__construct($command, $input, $output);
diff --git a/vendor/symfony/console/EventListener/ErrorListener.php b/vendor/symfony/console/EventListener/ErrorListener.php
new file mode 100644
index 0000000..897d985
--- /dev/null
+++ b/vendor/symfony/console/EventListener/ErrorListener.php
@@ -0,0 +1,95 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\EventListener;
+
+use Psr\Log\LoggerInterface;
+use Symfony\Component\Console\ConsoleEvents;
+use Symfony\Component\Console\Event\ConsoleErrorEvent;
+use Symfony\Component\Console\Event\ConsoleEvent;
+use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * @author James Halsall <james.t.halsall@googlemail.com>
+ * @author Robin Chalas <robin.chalas@gmail.com>
+ */
+class ErrorListener implements EventSubscriberInterface
+{
+ private $logger;
+
+ public function __construct(LoggerInterface $logger = null)
+ {
+ $this->logger = $logger;
+ }
+
+ public function onConsoleError(ConsoleErrorEvent $event)
+ {
+ if (null === $this->logger) {
+ return;
+ }
+
+ $error = $event->getError();
+
+ if (!$inputString = $this->getInputString($event)) {
+ $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]);
+
+ return;
+ }
+
+ $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]);
+ }
+
+ public function onConsoleTerminate(ConsoleTerminateEvent $event)
+ {
+ if (null === $this->logger) {
+ return;
+ }
+
+ $exitCode = $event->getExitCode();
+
+ if (0 === $exitCode) {
+ return;
+ }
+
+ if (!$inputString = $this->getInputString($event)) {
+ $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]);
+
+ return;
+ }
+
+ $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]);
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return [
+ ConsoleEvents::ERROR => ['onConsoleError', -128],
+ ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128],
+ ];
+ }
+
+ private static function getInputString(ConsoleEvent $event): ?string
+ {
+ $commandName = $event->getCommand() ? $event->getCommand()->getName() : null;
+ $input = $event->getInput();
+
+ if (method_exists($input, '__toString')) {
+ if ($commandName) {
+ return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input);
+ }
+
+ return (string) $input;
+ }
+
+ return $commandName;
+ }
+}
diff --git a/vendor/symfony/console/Exception/CommandNotFoundException.php b/vendor/symfony/console/Exception/CommandNotFoundException.php
index 54f1a5b..590a71c 100644
--- a/vendor/symfony/console/Exception/CommandNotFoundException.php
+++ b/vendor/symfony/console/Exception/CommandNotFoundException.php
@@ -21,12 +21,12 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
private $alternatives;
/**
- * @param string $message Exception message to throw
- * @param array $alternatives List of similar defined names
- * @param int $code Exception code
- * @param Exception $previous previous exception used for the exception chaining
+ * @param string $message Exception message to throw
+ * @param string[] $alternatives List of similar defined names
+ * @param int $code Exception code
+ * @param \Throwable|null $previous Previous exception used for the exception chaining
*/
- public function __construct($message, array $alternatives = array(), $code = 0, \Exception $previous = null)
+ public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
@@ -34,7 +34,7 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
}
/**
- * @return array A list of similar defined names
+ * @return string[] A list of similar defined names
*/
public function getAlternatives()
{
diff --git a/vendor/symfony/console/Exception/ExceptionInterface.php b/vendor/symfony/console/Exception/ExceptionInterface.php
index 491cc4c..1624e13 100644
--- a/vendor/symfony/console/Exception/ExceptionInterface.php
+++ b/vendor/symfony/console/Exception/ExceptionInterface.php
@@ -16,6 +16,6 @@ namespace Symfony\Component\Console\Exception;
*
* @author Jérôme Tamarelle <jerome@tamarelle.net>
*/
-interface ExceptionInterface
+interface ExceptionInterface extends \Throwable
{
}
diff --git a/vendor/symfony/console/Exception/MissingInputException.php b/vendor/symfony/console/Exception/MissingInputException.php
new file mode 100644
index 0000000..04f02ad
--- /dev/null
+++ b/vendor/symfony/console/Exception/MissingInputException.php
@@ -0,0 +1,21 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Exception;
+
+/**
+ * Represents failure to read input from stdin.
+ *
+ * @author Gabriel Ostrolucký <gabriel.ostrolucky@gmail.com>
+ */
+class MissingInputException extends RuntimeException implements ExceptionInterface
+{
+}
diff --git a/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/vendor/symfony/console/Exception/NamespaceNotFoundException.php
new file mode 100644
index 0000000..dd16e45
--- /dev/null
+++ b/vendor/symfony/console/Exception/NamespaceNotFoundException.php
@@ -0,0 +1,21 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Exception;
+
+/**
+ * Represents an incorrect namespace typed in the console.
+ *
+ * @author Pierre du Plessis <pdples@gmail.com>
+ */
+class NamespaceNotFoundException extends CommandNotFoundException
+{
+}
diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php
index 56cd5e5..e8c10e7 100644
--- a/vendor/symfony/console/Formatter/OutputFormatter.php
+++ b/vendor/symfony/console/Formatter/OutputFormatter.php
@@ -17,15 +17,24 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
* Formatter class for console output.
*
* @author Konstantin Kudryashov <ever.zet@gmail.com>
+ * @author Roland Franssen <franssen.roland@gmail.com>
*/
-class OutputFormatter implements OutputFormatterInterface
+class OutputFormatter implements WrappableOutputFormatterInterface
{
private $decorated;
- private $styles = array();
+ private $styles = [];
private $styleStack;
+ public function __clone()
+ {
+ $this->styleStack = clone $this->styleStack;
+ foreach ($this->styles as $key => $value) {
+ $this->styles[$key] = clone $value;
+ }
+ }
+
/**
- * Escapes "<" special char in given text.
+ * Escapes "<" and ">" special chars in given text.
*
* @param string $text Text to escape
*
@@ -33,12 +42,23 @@ class OutputFormatter implements OutputFormatterInterface
*/
public static function escape($text)
{
- $text = preg_replace('/([^\\\\]?)</', '$1\\<', $text);
+ $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text);
- if ('\\' === substr($text, -1)) {
- $len = strlen($text);
+ return self::escapeTrailingBackslash($text);
+ }
+
+ /**
+ * Escapes trailing "\" in given text.
+ *
+ * @internal
+ */
+ public static function escapeTrailingBackslash(string $text): string
+ {
+ if (str_ends_with($text, '\\')) {
+ $len = \strlen($text);
$text = rtrim($text, '\\');
- $text .= str_repeat('<<', $len - strlen($text));
+ $text = str_replace("\0", '', $text);
+ $text .= str_repeat("\0", $len - \strlen($text));
}
return $text;
@@ -47,12 +67,11 @@ class OutputFormatter implements OutputFormatterInterface
/**
* Initializes console output formatter.
*
- * @param bool $decorated Whether this formatter should actually decorate strings
- * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
+ * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
*/
- public function __construct($decorated = false, array $styles = array())
+ public function __construct(bool $decorated = false, array $styles = [])
{
- $this->decorated = (bool) $decorated;
+ $this->decorated = $decorated;
$this->setStyle('error', new OutputFormatterStyle('white', 'red'));
$this->setStyle('info', new OutputFormatterStyle('green'));
@@ -67,9 +86,7 @@ class OutputFormatter implements OutputFormatterInterface
}
/**
- * Sets the decorated flag.
- *
- * @param bool $decorated Whether to decorate the messages or not
+ * {@inheritdoc}
*/
public function setDecorated($decorated)
{
@@ -77,9 +94,7 @@ class OutputFormatter implements OutputFormatterInterface
}
/**
- * Gets the decorated flag.
- *
- * @return bool true if the output will decorate messages, false otherwise
+ * {@inheritdoc}
*/
public function isDecorated()
{
@@ -87,10 +102,7 @@ class OutputFormatter implements OutputFormatterInterface
}
/**
- * Sets a new style.
- *
- * @param string $name The style name
- * @param OutputFormatterStyleInterface $style The style instance
+ * {@inheritdoc}
*/
public function setStyle($name, OutputFormatterStyleInterface $style)
{
@@ -98,11 +110,7 @@ class OutputFormatter implements OutputFormatterInterface
}
/**
- * Checks if output formatter has style with specified name.
- *
- * @param string $name
- *
- * @return bool
+ * {@inheritdoc}
*/
public function hasStyle($name)
{
@@ -110,37 +118,36 @@ class OutputFormatter implements OutputFormatterInterface
}
/**
- * Gets style options from style with specified name.
- *
- * @param string $name
- *
- * @return OutputFormatterStyleInterface
- *
- * @throws InvalidArgumentException When style isn't defined
+ * {@inheritdoc}
*/
public function getStyle($name)
{
if (!$this->hasStyle($name)) {
- throw new InvalidArgumentException(sprintf('Undefined style: %s', $name));
+ throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name));
}
return $this->styles[strtolower($name)];
}
/**
- * Formats a message according to the given styles.
- *
- * @param string $message The message to style
- *
- * @return string The styled message
+ * {@inheritdoc}
*/
public function format($message)
{
- $message = (string) $message;
+ return $this->formatAndWrap((string) $message, 0);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function formatAndWrap(string $message, int $width)
+ {
$offset = 0;
$output = '';
- $tagRegex = '[a-z][a-z0-9_=;-]*+';
- preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, PREG_OFFSET_CAPTURE);
+ $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*';
+ $closeTagRegex = '[a-z][^<>]*+';
+ $currentLineLength = 0;
+ preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE);
foreach ($matches[0] as $i => $match) {
$pos = $match[1];
$text = $match[0];
@@ -150,21 +157,21 @@ class OutputFormatter implements OutputFormatterInterface
}
// add the text up to the next tag
- $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset));
- $offset = $pos + strlen($text);
+ $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength);
+ $offset = $pos + \strlen($text);
// opening tag?
if ($open = '/' != $text[1]) {
$tag = $matches[1][$i][0];
} else {
- $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : '';
+ $tag = $matches[3][$i][0] ?? '';
}
if (!$open && !$tag) {
// </>
$this->styleStack->pop();
- } elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
- $output .= $this->applyCurrentStyle($text);
+ } elseif (null === $style = $this->createStyleFromString($tag)) {
+ $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength);
} elseif ($open) {
$this->styleStack->push($style);
} else {
@@ -172,13 +179,9 @@ class OutputFormatter implements OutputFormatterInterface
}
}
- $output .= $this->applyCurrentStyle(substr($message, $offset));
+ $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength);
- if (false !== strpos($output, '<<')) {
- return strtr($output, array('\\<' => '<', '<<' => '\\'));
- }
-
- return str_replace('\\<', '<', $output);
+ return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']);
}
/**
@@ -191,35 +194,37 @@ class OutputFormatter implements OutputFormatterInterface
/**
* Tries to create new style instance from string.
- *
- * @param string $string
- *
- * @return OutputFormatterStyle|bool false if string is not format string
*/
- private function createStyleFromString($string)
+ private function createStyleFromString(string $string): ?OutputFormatterStyleInterface
{
if (isset($this->styles[$string])) {
return $this->styles[$string];
}
- if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) {
- return false;
+ if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) {
+ return null;
}
$style = new OutputFormatterStyle();
foreach ($matches as $match) {
array_shift($match);
+ $match[0] = strtolower($match[0]);
if ('fg' == $match[0]) {
- $style->setForeground($match[1]);
+ $style->setForeground(strtolower($match[1]));
} elseif ('bg' == $match[0]) {
- $style->setBackground($match[1]);
- } else {
- try {
- $style->setOption($match[1]);
- } catch (\InvalidArgumentException $e) {
- return false;
+ $style->setBackground(strtolower($match[1]));
+ } elseif ('href' === $match[0]) {
+ $url = preg_replace('{\\\\([<>])}', '$1', $match[1]);
+ $style->setHref($url);
+ } elseif ('options' === $match[0]) {
+ preg_match_all('([^,;]+)', strtolower($match[1]), $options);
+ $options = array_shift($options);
+ foreach ($options as $option) {
+ $style->setOption($option);
}
+ } else {
+ return null;
}
}
@@ -228,13 +233,51 @@ class OutputFormatter implements OutputFormatterInterface
/**
* Applies current style from stack to text, if must be applied.
- *
- * @param string $text Input text
- *
- * @return string Styled text
*/
- private function applyCurrentStyle($text)
+ private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string
{
- return $this->isDecorated() && strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text;
+ if ('' === $text) {
+ return '';
+ }
+
+ if (!$width) {
+ return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text;
+ }
+
+ if (!$currentLineLength && '' !== $current) {
+ $text = ltrim($text);
+ }
+
+ if ($currentLineLength) {
+ $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n";
+ $text = substr($text, $i);
+ } else {
+ $prefix = '';
+ }
+
+ preg_match('~(\\n)$~', $text, $matches);
+ $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text);
+ $text = rtrim($text, "\n").($matches[1] ?? '');
+
+ if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) {
+ $text = "\n".$text;
+ }
+
+ $lines = explode("\n", $text);
+
+ foreach ($lines as $line) {
+ $currentLineLength += \strlen($line);
+ if ($width <= $currentLineLength) {
+ $currentLineLength = 0;
+ }
+ }
+
+ if ($this->isDecorated()) {
+ foreach ($lines as $i => $line) {
+ $lines[$i] = $this->styleStack->getCurrent()->apply($line);
+ }
+ }
+
+ return implode("\n", $lines);
}
}
diff --git a/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Formatter/OutputFormatterInterface.php
index 5a52ba0..22f40a3 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterInterface.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterInterface.php
@@ -35,8 +35,7 @@ interface OutputFormatterInterface
/**
* Sets a new style.
*
- * @param string $name The style name
- * @param OutputFormatterStyleInterface $style The style instance
+ * @param string $name The style name
*/
public function setStyle($name, OutputFormatterStyleInterface $style);
@@ -55,6 +54,8 @@ interface OutputFormatterInterface
* @param string $name
*
* @return OutputFormatterStyleInterface
+ *
+ * @throws \InvalidArgumentException When style isn't defined
*/
public function getStyle($name);
diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php
index c7c6b4a..7cb6116 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterStyle.php
@@ -20,48 +20,49 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
*/
class OutputFormatterStyle implements OutputFormatterStyleInterface
{
- private static $availableForegroundColors = array(
- 'black' => array('set' => 30, 'unset' => 39),
- 'red' => array('set' => 31, 'unset' => 39),
- 'green' => array('set' => 32, 'unset' => 39),
- 'yellow' => array('set' => 33, 'unset' => 39),
- 'blue' => array('set' => 34, 'unset' => 39),
- 'magenta' => array('set' => 35, 'unset' => 39),
- 'cyan' => array('set' => 36, 'unset' => 39),
- 'white' => array('set' => 37, 'unset' => 39),
- 'default' => array('set' => 39, 'unset' => 39),
- );
- private static $availableBackgroundColors = array(
- 'black' => array('set' => 40, 'unset' => 49),
- 'red' => array('set' => 41, 'unset' => 49),
- 'green' => array('set' => 42, 'unset' => 49),
- 'yellow' => array('set' => 43, 'unset' => 49),
- 'blue' => array('set' => 44, 'unset' => 49),
- 'magenta' => array('set' => 45, 'unset' => 49),
- 'cyan' => array('set' => 46, 'unset' => 49),
- 'white' => array('set' => 47, 'unset' => 49),
- 'default' => array('set' => 49, 'unset' => 49),
- );
- private static $availableOptions = array(
- 'bold' => array('set' => 1, 'unset' => 22),
- 'underscore' => array('set' => 4, 'unset' => 24),
- 'blink' => array('set' => 5, 'unset' => 25),
- 'reverse' => array('set' => 7, 'unset' => 27),
- 'conceal' => array('set' => 8, 'unset' => 28),
- );
+ private static $availableForegroundColors = [
+ 'black' => ['set' => 30, 'unset' => 39],
+ 'red' => ['set' => 31, 'unset' => 39],
+ 'green' => ['set' => 32, 'unset' => 39],
+ 'yellow' => ['set' => 33, 'unset' => 39],
+ 'blue' => ['set' => 34, 'unset' => 39],
+ 'magenta' => ['set' => 35, 'unset' => 39],
+ 'cyan' => ['set' => 36, 'unset' => 39],
+ 'white' => ['set' => 37, 'unset' => 39],
+ 'default' => ['set' => 39, 'unset' => 39],
+ ];
+ private static $availableBackgroundColors = [
+ 'black' => ['set' => 40, 'unset' => 49],
+ 'red' => ['set' => 41, 'unset' => 49],
+ 'green' => ['set' => 42, 'unset' => 49],
+ 'yellow' => ['set' => 43, 'unset' => 49],
+ 'blue' => ['set' => 44, 'unset' => 49],
+ 'magenta' => ['set' => 45, 'unset' => 49],
+ 'cyan' => ['set' => 46, 'unset' => 49],
+ 'white' => ['set' => 47, 'unset' => 49],
+ 'default' => ['set' => 49, 'unset' => 49],
+ ];
+ private static $availableOptions = [
+ 'bold' => ['set' => 1, 'unset' => 22],
+ 'underscore' => ['set' => 4, 'unset' => 24],
+ 'blink' => ['set' => 5, 'unset' => 25],
+ 'reverse' => ['set' => 7, 'unset' => 27],
+ 'conceal' => ['set' => 8, 'unset' => 28],
+ ];
private $foreground;
private $background;
- private $options = array();
+ private $href;
+ private $options = [];
+ private $handlesHrefGracefully;
/**
* Initializes output formatter style.
*
* @param string|null $foreground The style foreground color name
* @param string|null $background The style background color name
- * @param array $options The style options
*/
- public function __construct($foreground = null, $background = null, array $options = array())
+ public function __construct(string $foreground = null, string $background = null, array $options = [])
{
if (null !== $foreground) {
$this->setForeground($foreground);
@@ -69,17 +70,13 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
if (null !== $background) {
$this->setBackground($background);
}
- if (count($options)) {
+ if (\count($options)) {
$this->setOptions($options);
}
}
/**
- * Sets style foreground color.
- *
- * @param string|null $color The color name
- *
- * @throws InvalidArgumentException When the color name isn't defined
+ * {@inheritdoc}
*/
public function setForeground($color = null)
{
@@ -90,22 +87,14 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
if (!isset(static::$availableForegroundColors[$color])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid foreground color specified: "%s". Expected one of (%s)',
- $color,
- implode(', ', array_keys(static::$availableForegroundColors))
- ));
+ throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableForegroundColors))));
}
$this->foreground = static::$availableForegroundColors[$color];
}
/**
- * Sets style background color.
- *
- * @param string|null $color The color name
- *
- * @throws InvalidArgumentException When the color name isn't defined
+ * {@inheritdoc}
*/
public function setBackground($color = null)
{
@@ -116,53 +105,38 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
if (!isset(static::$availableBackgroundColors[$color])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid background color specified: "%s". Expected one of (%s)',
- $color,
- implode(', ', array_keys(static::$availableBackgroundColors))
- ));
+ throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableBackgroundColors))));
}
$this->background = static::$availableBackgroundColors[$color];
}
+ public function setHref(string $url): void
+ {
+ $this->href = $url;
+ }
+
/**
- * Sets some specific style option.
- *
- * @param string $option The option name
- *
- * @throws InvalidArgumentException When the option name isn't defined
+ * {@inheritdoc}
*/
public function setOption($option)
{
if (!isset(static::$availableOptions[$option])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid option specified: "%s". Expected one of (%s)',
- $option,
- implode(', ', array_keys(static::$availableOptions))
- ));
+ throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions))));
}
- if (!in_array(static::$availableOptions[$option], $this->options)) {
+ if (!\in_array(static::$availableOptions[$option], $this->options)) {
$this->options[] = static::$availableOptions[$option];
}
}
/**
- * Unsets some specific style option.
- *
- * @param string $option The option name
- *
- * @throws InvalidArgumentException When the option name isn't defined
+ * {@inheritdoc}
*/
public function unsetOption($option)
{
if (!isset(static::$availableOptions[$option])) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid option specified: "%s". Expected one of (%s)',
- $option,
- implode(', ', array_keys(static::$availableOptions))
- ));
+ throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions))));
}
$pos = array_search(static::$availableOptions[$option], $this->options);
@@ -172,13 +146,11 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
/**
- * Sets multiple style options at once.
- *
- * @param array $options
+ * {@inheritdoc}
*/
public function setOptions(array $options)
{
- $this->options = array();
+ $this->options = [];
foreach ($options as $option) {
$this->setOption($option);
@@ -186,16 +158,17 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
/**
- * Applies the style to a given text.
- *
- * @param string $text The text to style
- *
- * @return string
+ * {@inheritdoc}
*/
public function apply($text)
{
- $setCodes = array();
- $unsetCodes = array();
+ $setCodes = [];
+ $unsetCodes = [];
+
+ if (null === $this->handlesHrefGracefully) {
+ $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR')
+ && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100);
+ }
if (null !== $this->foreground) {
$setCodes[] = $this->foreground['set'];
@@ -205,14 +178,17 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
$setCodes[] = $this->background['set'];
$unsetCodes[] = $this->background['unset'];
}
- if (count($this->options)) {
- foreach ($this->options as $option) {
- $setCodes[] = $option['set'];
- $unsetCodes[] = $option['unset'];
- }
+
+ foreach ($this->options as $option) {
+ $setCodes[] = $option['set'];
+ $unsetCodes[] = $option['unset'];
+ }
+
+ if (null !== $this->href && $this->handlesHrefGracefully) {
+ $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\";
}
- if (0 === count($setCodes)) {
+ if (0 === \count($setCodes)) {
return $text;
}
diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php
index c36fda8..af171c2 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php
@@ -21,7 +21,7 @@ interface OutputFormatterStyleInterface
/**
* Sets style foreground color.
*
- * @param string $color The color name
+ * @param string|null $color The color name
*/
public function setForeground($color = null);
@@ -48,8 +48,6 @@ interface OutputFormatterStyleInterface
/**
* Sets multiple style options at once.
- *
- * @param array $options
*/
public function setOptions(array $options);
diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
index e5d14ea..fc48dc0 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
@@ -12,30 +12,23 @@
namespace Symfony\Component\Console\Formatter;
use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Contracts\Service\ResetInterface;
/**
* @author Jean-François Simon <contact@jfsimon.fr>
*/
-class OutputFormatterStyleStack
+class OutputFormatterStyleStack implements ResetInterface
{
/**
* @var OutputFormatterStyleInterface[]
*/
private $styles;
- /**
- * @var OutputFormatterStyleInterface
- */
private $emptyStyle;
- /**
- * Constructor.
- *
- * @param OutputFormatterStyleInterface|null $emptyStyle
- */
public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
{
- $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle();
+ $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle();
$this->reset();
}
@@ -44,13 +37,11 @@ class OutputFormatterStyleStack
*/
public function reset()
{
- $this->styles = array();
+ $this->styles = [];
}
/**
* Pushes a style in the stack.
- *
- * @param OutputFormatterStyleInterface $style
*/
public function push(OutputFormatterStyleInterface $style)
{
@@ -60,8 +51,6 @@ class OutputFormatterStyleStack
/**
* Pops a style from the stack.
*
- * @param OutputFormatterStyleInterface|null $style
- *
* @return OutputFormatterStyleInterface
*
* @throws InvalidArgumentException When style tags incorrectly nested
@@ -78,7 +67,7 @@ class OutputFormatterStyleStack
foreach (array_reverse($this->styles, true) as $index => $stackedStyle) {
if ($style->apply('') === $stackedStyle->apply('')) {
- $this->styles = array_slice($this->styles, 0, $index);
+ $this->styles = \array_slice($this->styles, 0, $index);
return $stackedStyle;
}
@@ -98,13 +87,11 @@ class OutputFormatterStyleStack
return $this->emptyStyle;
}
- return $this->styles[count($this->styles) - 1];
+ return $this->styles[\count($this->styles) - 1];
}
/**
- * @param OutputFormatterStyleInterface $emptyStyle
- *
- * @return OutputFormatterStyleStack
+ * @return $this
*/
public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle)
{
diff --git a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php
new file mode 100644
index 0000000..6694053
--- /dev/null
+++ b/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php
@@ -0,0 +1,25 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Formatter;
+
+/**
+ * Formatter interface for console output that supports word wrapping.
+ *
+ * @author Roland Franssen <franssen.roland@gmail.com>
+ */
+interface WrappableOutputFormatterInterface extends OutputFormatterInterface
+{
+ /**
+ * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping).
+ */
+ public function formatAndWrap(string $message, int $width);
+}
diff --git a/vendor/symfony/console/Helper/DebugFormatterHelper.php b/vendor/symfony/console/Helper/DebugFormatterHelper.php
index 1119b79..1653ede 100644
--- a/vendor/symfony/console/Helper/DebugFormatterHelper.php
+++ b/vendor/symfony/console/Helper/DebugFormatterHelper.php
@@ -20,8 +20,8 @@ namespace Symfony\Component\Console\Helper;
*/
class DebugFormatterHelper extends Helper
{
- private $colors = array('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default');
- private $started = array();
+ private $colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default'];
+ private $started = [];
private $count = -1;
/**
@@ -35,7 +35,7 @@ class DebugFormatterHelper extends Helper
*/
public function start($id, $message, $prefix = 'RUN')
{
- $this->started[$id] = array('border' => ++$this->count % count($this->colors));
+ $this->started[$id] = ['border' => ++$this->count % \count($this->colors)];
return sprintf("%s<bg=blue;fg=white> %s </> <fg=blue>%s</>\n", $this->getBorder($id), $prefix, $message);
}
@@ -107,12 +107,7 @@ class DebugFormatterHelper extends Helper
return $message;
}
- /**
- * @param string $id The id of the formatting session
- *
- * @return string
- */
- private function getBorder($id)
+ private function getBorder(string $id): string
{
return sprintf('<bg=%s> </>', $this->colors[$this->started[$id]['border']]);
}
diff --git a/vendor/symfony/console/Helper/DescriptorHelper.php b/vendor/symfony/console/Helper/DescriptorHelper.php
index a53b476..3055bae 100644
--- a/vendor/symfony/console/Helper/DescriptorHelper.php
+++ b/vendor/symfony/console/Helper/DescriptorHelper.php
@@ -16,8 +16,8 @@ use Symfony\Component\Console\Descriptor\JsonDescriptor;
use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
use Symfony\Component\Console\Descriptor\TextDescriptor;
use Symfony\Component\Console\Descriptor\XmlDescriptor;
-use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Output\OutputInterface;
/**
* This class adds helper method to describe objects in various formats.
@@ -29,11 +29,8 @@ class DescriptorHelper extends Helper
/**
* @var DescriptorInterface[]
*/
- private $descriptors = array();
+ private $descriptors = [];
- /**
- * Constructor.
- */
public function __construct()
{
$this
@@ -51,18 +48,16 @@ class DescriptorHelper extends Helper
* * format: string, the output format name
* * raw_text: boolean, sets output type as raw
*
- * @param OutputInterface $output
- * @param object $object
- * @param array $options
+ * @param object $object
*
* @throws InvalidArgumentException when the given format is not supported
*/
- public function describe(OutputInterface $output, $object, array $options = array())
+ public function describe(OutputInterface $output, $object, array $options = [])
{
- $options = array_merge(array(
+ $options = array_merge([
'raw_text' => false,
'format' => 'txt',
- ), $options);
+ ], $options);
if (!isset($this->descriptors[$options['format']])) {
throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format']));
@@ -75,10 +70,9 @@ class DescriptorHelper extends Helper
/**
* Registers a descriptor.
*
- * @param string $format
- * @param DescriptorInterface $descriptor
+ * @param string $format
*
- * @return DescriptorHelper
+ * @return $this
*/
public function register($format, DescriptorInterface $descriptor)
{
diff --git a/vendor/symfony/console/Helper/Dumper.php b/vendor/symfony/console/Helper/Dumper.php
new file mode 100644
index 0000000..b013b6c
--- /dev/null
+++ b/vendor/symfony/console/Helper/Dumper.php
@@ -0,0 +1,64 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\VarDumper\Cloner\ClonerInterface;
+use Symfony\Component\VarDumper\Cloner\VarCloner;
+use Symfony\Component\VarDumper\Dumper\CliDumper;
+
+/**
+ * @author Roland Franssen <franssen.roland@gmail.com>
+ */
+final class Dumper
+{
+ private $output;
+ private $dumper;
+ private $cloner;
+ private $handler;
+
+ public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null)
+ {
+ $this->output = $output;
+ $this->dumper = $dumper;
+ $this->cloner = $cloner;
+
+ if (class_exists(CliDumper::class)) {
+ $this->handler = function ($var): string {
+ $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR);
+ $dumper->setColors($this->output->isDecorated());
+
+ return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true));
+ };
+ } else {
+ $this->handler = function ($var): string {
+ switch (true) {
+ case null === $var:
+ return 'null';
+ case true === $var:
+ return 'true';
+ case false === $var:
+ return 'false';
+ case \is_string($var):
+ return '"'.$var.'"';
+ default:
+ return rtrim(print_r($var, true));
+ }
+ };
+ }
+ }
+
+ public function __invoke($var): string
+ {
+ return ($this->handler)($var);
+ }
+}
diff --git a/vendor/symfony/console/Helper/FormatterHelper.php b/vendor/symfony/console/Helper/FormatterHelper.php
index 6a48a77..d6eccee 100644
--- a/vendor/symfony/console/Helper/FormatterHelper.php
+++ b/vendor/symfony/console/Helper/FormatterHelper.php
@@ -45,21 +45,21 @@ class FormatterHelper extends Helper
*/
public function formatBlock($messages, $style, $large = false)
{
- if (!is_array($messages)) {
- $messages = array($messages);
+ if (!\is_array($messages)) {
+ $messages = [$messages];
}
$len = 0;
- $lines = array();
+ $lines = [];
foreach ($messages as $message) {
$message = OutputFormatter::escape($message);
$lines[] = sprintf($large ? ' %s ' : ' %s ', $message);
- $len = max($this->strlen($message) + ($large ? 4 : 2), $len);
+ $len = max(self::strlen($message) + ($large ? 4 : 2), $len);
}
- $messages = $large ? array(str_repeat(' ', $len)) : array();
+ $messages = $large ? [str_repeat(' ', $len)] : [];
for ($i = 0; isset($lines[$i]); ++$i) {
- $messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i]));
+ $messages[] = $lines[$i].str_repeat(' ', $len - self::strlen($lines[$i]));
}
if ($large) {
$messages[] = str_repeat(' ', $len);
@@ -83,17 +83,13 @@ class FormatterHelper extends Helper
*/
public function truncate($message, $length, $suffix = '...')
{
- $computedLength = $length - $this->strlen($suffix);
+ $computedLength = $length - self::strlen($suffix);
- if ($computedLength > $this->strlen($message)) {
+ if ($computedLength > self::strlen($message)) {
return $message;
}
- if (false === $encoding = mb_detect_encoding($message, null, true)) {
- return substr($message, 0, $length).$suffix;
- }
-
- return mb_substr($message, 0, $length, $encoding).$suffix;
+ return self::substr($message, 0, $length).$suffix;
}
/**
diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php
index 43f9a16..0521aaf 100644
--- a/vendor/symfony/console/Helper/Helper.php
+++ b/vendor/symfony/console/Helper/Helper.php
@@ -23,9 +23,7 @@ abstract class Helper implements HelperInterface
protected $helperSet = null;
/**
- * Sets the helper set associated with this helper.
- *
- * @param HelperSet $helperSet A HelperSet instance
+ * {@inheritdoc}
*/
public function setHelperSet(HelperSet $helperSet = null)
{
@@ -33,9 +31,7 @@ abstract class Helper implements HelperInterface
}
/**
- * Gets the helper set associated with this helper.
- *
- * @return HelperSet A HelperSet instance
+ * {@inheritdoc}
*/
public function getHelperSet()
{
@@ -51,33 +47,55 @@ abstract class Helper implements HelperInterface
*/
public static function strlen($string)
{
+ $string = (string) $string;
+
if (false === $encoding = mb_detect_encoding($string, null, true)) {
- return strlen($string);
+ return \strlen($string);
}
return mb_strwidth($string, $encoding);
}
+ /**
+ * Returns the subset of a string, using mb_substr if it is available.
+ *
+ * @param string $string String to subset
+ * @param int $from Start offset
+ * @param int|null $length Length to read
+ *
+ * @return string The string subset
+ */
+ public static function substr($string, $from, $length = null)
+ {
+ $string = (string) $string;
+
+ if (false === $encoding = mb_detect_encoding($string, null, true)) {
+ return substr($string, $from, $length);
+ }
+
+ return mb_substr($string, $from, $length, $encoding);
+ }
+
public static function formatTime($secs)
{
- static $timeFormats = array(
- array(0, '< 1 sec'),
- array(1, '1 sec'),
- array(2, 'secs', 1),
- array(60, '1 min'),
- array(120, 'mins', 60),
- array(3600, '1 hr'),
- array(7200, 'hrs', 3600),
- array(86400, '1 day'),
- array(172800, 'days', 86400),
- );
+ static $timeFormats = [
+ [0, '< 1 sec'],
+ [1, '1 sec'],
+ [2, 'secs', 1],
+ [60, '1 min'],
+ [120, 'mins', 60],
+ [3600, '1 hr'],
+ [7200, 'hrs', 3600],
+ [86400, '1 day'],
+ [172800, 'days', 86400],
+ ];
foreach ($timeFormats as $index => $format) {
if ($secs >= $format[0]) {
if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0])
- || $index == count($timeFormats) - 1
+ || $index == \count($timeFormats) - 1
) {
- if (2 == count($format)) {
+ if (2 == \count($format)) {
return $format[1];
}
@@ -106,6 +124,11 @@ abstract class Helper implements HelperInterface
public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, $string)
{
+ return self::strlen(self::removeDecoration($formatter, $string));
+ }
+
+ public static function removeDecoration(OutputFormatterInterface $formatter, $string)
+ {
$isDecorated = $formatter->isDecorated();
$formatter->setDecorated(false);
// remove <...> formatting
@@ -114,6 +137,6 @@ abstract class Helper implements HelperInterface
$string = preg_replace("/\033\[[^m]*m/", '', $string);
$formatter->setDecorated($isDecorated);
- return self::strlen($string);
+ return $string;
}
}
diff --git a/vendor/symfony/console/Helper/HelperInterface.php b/vendor/symfony/console/Helper/HelperInterface.php
index 5a923e0..1ce8235 100644
--- a/vendor/symfony/console/Helper/HelperInterface.php
+++ b/vendor/symfony/console/Helper/HelperInterface.php
@@ -20,8 +20,6 @@ interface HelperInterface
{
/**
* Sets the helper set associated with this helper.
- *
- * @param HelperSet $helperSet A HelperSet instance
*/
public function setHelperSet(HelperSet $helperSet = null);
diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php
index 6f12b39..9aa1e67 100644
--- a/vendor/symfony/console/Helper/HelperSet.php
+++ b/vendor/symfony/console/Helper/HelperSet.php
@@ -24,26 +24,23 @@ class HelperSet implements \IteratorAggregate
/**
* @var Helper[]
*/
- private $helpers = array();
+ private $helpers = [];
private $command;
/**
- * Constructor.
- *
* @param Helper[] $helpers An array of helper
*/
- public function __construct(array $helpers = array())
+ public function __construct(array $helpers = [])
{
foreach ($helpers as $alias => $helper) {
- $this->set($helper, is_int($alias) ? null : $alias);
+ $this->set($helper, \is_int($alias) ? null : $alias);
}
}
/**
* Sets a helper.
*
- * @param HelperInterface $helper The helper instance
- * @param string $alias An alias
+ * @param string $alias An alias
*/
public function set(HelperInterface $helper, $alias = null)
{
@@ -85,11 +82,6 @@ class HelperSet implements \IteratorAggregate
return $this->helpers[$name];
}
- /**
- * Sets the command associated with this helper set.
- *
- * @param Command $command A Command instance
- */
public function setCommand(Command $command = null)
{
$this->command = $command;
@@ -106,8 +98,9 @@ class HelperSet implements \IteratorAggregate
}
/**
- * @return Helper[]
+ * @return \Traversable<Helper>
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->helpers);
diff --git a/vendor/symfony/console/Helper/InputAwareHelper.php b/vendor/symfony/console/Helper/InputAwareHelper.php
index 4261767..0d0dba2 100644
--- a/vendor/symfony/console/Helper/InputAwareHelper.php
+++ b/vendor/symfony/console/Helper/InputAwareHelper.php
@@ -11,8 +11,8 @@
namespace Symfony\Component\Console\Helper;
-use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputAwareInterface;
+use Symfony\Component\Console\Input\InputInterface;
/**
* An implementation of InputAwareInterface for Helpers.
diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php
index 2c46a2c..862d09f 100644
--- a/vendor/symfony/console/Helper/ProcessHelper.php
+++ b/vendor/symfony/console/Helper/ProcessHelper.php
@@ -15,41 +15,56 @@ use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
-use Symfony\Component\Process\ProcessBuilder;
/**
* The ProcessHelper class provides helpers to run external processes.
*
* @author Fabien Potencier <fabien@symfony.com>
+ *
+ * @final since Symfony 4.2
*/
class ProcessHelper extends Helper
{
/**
* Runs an external process.
*
- * @param OutputInterface $output An OutputInterface instance
- * @param string|array|Process $cmd An instance of Process or an array of arguments to escape and run or a command to run
- * @param string|null $error An error message that must be displayed if something went wrong
- * @param callable|null $callback A PHP callback to run whenever there is some
- * output available on STDOUT or STDERR
- * @param int $verbosity The threshold for verbosity
+ * @param array|Process $cmd An instance of Process or an array of the command and arguments
+ * @param string|null $error An error message that must be displayed if something went wrong
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
+ * @param int $verbosity The threshold for verbosity
*
* @return Process The process that ran
*/
public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
{
+ if (!class_exists(Process::class)) {
+ throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".');
+ }
+
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
$formatter = $this->getHelperSet()->get('debug_formatter');
- if (is_array($cmd)) {
- $process = ProcessBuilder::create($cmd)->getProcess();
- } elseif ($cmd instanceof Process) {
- $process = $cmd;
- } else {
+ if ($cmd instanceof Process) {
+ $cmd = [$cmd];
+ }
+
+ if (!\is_array($cmd)) {
+ @trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), \E_USER_DEPRECATED);
+ $cmd = [method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd)];
+ }
+
+ if (\is_string($cmd[0] ?? null)) {
$process = new Process($cmd);
+ $cmd = [];
+ } elseif (($cmd[0] ?? null) instanceof Process) {
+ $process = $cmd[0];
+ unset($cmd[0]);
+ } else {
+ throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__));
}
if ($verbosity <= $output->getVerbosity()) {
@@ -60,7 +75,7 @@ class ProcessHelper extends Helper
$callback = $this->wrapCallback($output, $process, $callback);
}
- $process->run($callback);
+ $process->run($callback, $cmd);
if ($verbosity <= $output->getVerbosity()) {
$message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode());
@@ -80,11 +95,10 @@ class ProcessHelper extends Helper
* This is identical to run() except that an exception is thrown if the process
* exits with a non-zero exit code.
*
- * @param OutputInterface $output An OutputInterface instance
- * @param string|Process $cmd An instance of Process or a command to run
- * @param string|null $error An error message that must be displayed if something went wrong
- * @param callable|null $callback A PHP callback to run whenever there is some
- * output available on STDOUT or STDERR
+ * @param array|Process $cmd An instance of Process or a command to run
+ * @param string|null $error An error message that must be displayed if something went wrong
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
*
* @return Process The process that ran
*
@@ -106,10 +120,6 @@ class ProcessHelper extends Helper
/**
* Wraps a Process callback to add debugging output.
*
- * @param OutputInterface $output An OutputInterface interface
- * @param Process $process The Process
- * @param callable|null $callback A PHP callable
- *
* @return callable
*/
public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null)
@@ -124,12 +134,12 @@ class ProcessHelper extends Helper
$output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type));
if (null !== $callback) {
- call_user_func($callback, $type, $buffer);
+ $callback($type, $buffer);
}
};
}
- private function escapeString($str)
+ private function escapeString(string $str): string
{
return str_replace('<', '\\<', $str);
}
diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php
index 6aea12e..1de9b7b 100644
--- a/vendor/symfony/console/Helper/ProgressBar.php
+++ b/vendor/symfony/console/Helper/ProgressBar.php
@@ -11,9 +11,11 @@
namespace Symfony\Component\Console\Helper;
+use Symfony\Component\Console\Exception\LogicException;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
+use Symfony\Component\Console\Output\ConsoleSectionOutput;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Exception\LogicException;
+use Symfony\Component\Console\Terminal;
/**
* The ProgressBar provides helpers to display progress output.
@@ -21,9 +23,8 @@ use Symfony\Component\Console\Exception\LogicException;
* @author Fabien Potencier <fabien@symfony.com>
* @author Chris Jones <leeked@gmail.com>
*/
-class ProgressBar
+final class ProgressBar
{
- // options
private $barWidth = 28;
private $barChar;
private $emptyBarChar = '-';
@@ -31,10 +32,10 @@ class ProgressBar
private $format;
private $internalFormat;
private $redrawFreq = 1;
-
- /**
- * @var OutputInterface
- */
+ private $writeCount;
+ private $lastWriteTime;
+ private $minSecondsBetweenRedraws = 0;
+ private $maxSecondsBetweenRedraws = 1;
private $output;
private $step = 0;
private $max;
@@ -42,20 +43,18 @@ class ProgressBar
private $stepWidth;
private $percent = 0.0;
private $formatLineCount;
- private $messages = array();
+ private $messages = [];
private $overwrite = true;
- private $firstRun = true;
+ private $terminal;
+ private $previousMessage;
private static $formatters;
private static $formats;
/**
- * Constructor.
- *
- * @param OutputInterface $output An OutputInterface instance
- * @param int $max Maximum steps (0 if unknown)
+ * @param int $max Maximum steps (0 if unknown)
*/
- public function __construct(OutputInterface $output, $max = 0)
+ public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 0.1)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
@@ -63,13 +62,19 @@ class ProgressBar
$this->output = $output;
$this->setMaxSteps($max);
+ $this->terminal = new Terminal();
+
+ if (0 < $minSecondsBetweenRedraws) {
+ $this->redrawFreq = null;
+ $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws;
+ }
if (!$this->output->isDecorated()) {
// disable overwrite when output does not support ANSI codes.
$this->overwrite = false;
// set a reasonable redraw frequency so output isn't flooded
- $this->setRedrawFrequency($max / 10);
+ $this->redrawFreq = null;
}
$this->startTime = time();
@@ -83,7 +88,7 @@ class ProgressBar
* @param string $name The placeholder name (including the delimiter char like %)
* @param callable $callable A PHP callable
*/
- public static function setPlaceholderFormatterDefinition($name, callable $callable)
+ public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void
{
if (!self::$formatters) {
self::$formatters = self::initPlaceholderFormatters();
@@ -99,13 +104,13 @@ class ProgressBar
*
* @return callable|null A PHP callable
*/
- public static function getPlaceholderFormatterDefinition($name)
+ public static function getPlaceholderFormatterDefinition(string $name): ?callable
{
if (!self::$formatters) {
self::$formatters = self::initPlaceholderFormatters();
}
- return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
+ return self::$formatters[$name] ?? null;
}
/**
@@ -116,7 +121,7 @@ class ProgressBar
* @param string $name The format name
* @param string $format A format string
*/
- public static function setFormatDefinition($name, $format)
+ public static function setFormatDefinition(string $name, string $format): void
{
if (!self::$formats) {
self::$formats = self::initFormats();
@@ -132,13 +137,13 @@ class ProgressBar
*
* @return string|null A format string
*/
- public static function getFormatDefinition($name)
+ public static function getFormatDefinition(string $name): ?string
{
if (!self::$formats) {
self::$formats = self::initFormats();
}
- return isset(self::$formats[$name]) ? self::$formats[$name] : null;
+ return self::$formats[$name] ?? null;
}
/**
@@ -151,102 +156,62 @@ class ProgressBar
* @param string $message The text to associate with the placeholder
* @param string $name The name of the placeholder
*/
- public function setMessage($message, $name = 'message')
+ public function setMessage(string $message, string $name = 'message')
{
$this->messages[$name] = $message;
}
- public function getMessage($name = 'message')
+ public function getMessage(string $name = 'message')
{
return $this->messages[$name];
}
- /**
- * Gets the progress bar start time.
- *
- * @return int The progress bar start time
- */
- public function getStartTime()
+ public function getStartTime(): int
{
return $this->startTime;
}
- /**
- * Gets the progress bar maximal steps.
- *
- * @return int The progress bar max steps
- */
- public function getMaxSteps()
+ public function getMaxSteps(): int
{
return $this->max;
}
- /**
- * Gets the current step position.
- *
- * @return int The progress bar step
- */
- public function getProgress()
+ public function getProgress(): int
{
return $this->step;
}
- /**
- * Gets the progress bar step width.
- *
- * @return int The progress bar step width
- */
- private function getStepWidth()
+ private function getStepWidth(): int
{
return $this->stepWidth;
}
- /**
- * Gets the current progress bar percent.
- *
- * @return float The current progress bar percent
- */
- public function getProgressPercent()
+ public function getProgressPercent(): float
{
return $this->percent;
}
- /**
- * Sets the progress bar width.
- *
- * @param int $size The progress bar size
- */
- public function setBarWidth($size)
+ public function getBarOffset(): int
{
- $this->barWidth = (int) $size;
+ return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth);
}
- /**
- * Gets the progress bar width.
- *
- * @return int The progress bar size
- */
- public function getBarWidth()
+ public function setBarWidth(int $size)
+ {
+ $this->barWidth = max(1, $size);
+ }
+
+ public function getBarWidth(): int
{
return $this->barWidth;
}
- /**
- * Sets the bar character.
- *
- * @param string $char A character
- */
- public function setBarCharacter($char)
+ public function setBarCharacter(string $char)
{
$this->barChar = $char;
}
- /**
- * Gets the bar character.
- *
- * @return string A character
- */
- public function getBarCharacter()
+ public function getBarCharacter(): string
{
if (null === $this->barChar) {
return $this->max ? '=' : $this->emptyBarChar;
@@ -255,52 +220,27 @@ class ProgressBar
return $this->barChar;
}
- /**
- * Sets the empty bar character.
- *
- * @param string $char A character
- */
- public function setEmptyBarCharacter($char)
+ public function setEmptyBarCharacter(string $char)
{
$this->emptyBarChar = $char;
}
- /**
- * Gets the empty bar character.
- *
- * @return string A character
- */
- public function getEmptyBarCharacter()
+ public function getEmptyBarCharacter(): string
{
return $this->emptyBarChar;
}
- /**
- * Sets the progress bar character.
- *
- * @param string $char A character
- */
- public function setProgressCharacter($char)
+ public function setProgressCharacter(string $char)
{
$this->progressChar = $char;
}
- /**
- * Gets the progress bar character.
- *
- * @return string A character
- */
- public function getProgressCharacter()
+ public function getProgressCharacter(): string
{
return $this->progressChar;
}
- /**
- * Sets the progress bar format.
- *
- * @param string $format The format
- */
- public function setFormat($format)
+ public function setFormat(string $format)
{
$this->format = null;
$this->internalFormat = $format;
@@ -309,11 +249,39 @@ class ProgressBar
/**
* Sets the redraw frequency.
*
- * @param int|float $freq The frequency in steps
+ * @param int|null $freq The frequency in steps
*/
- public function setRedrawFrequency($freq)
+ public function setRedrawFrequency(?int $freq)
{
- $this->redrawFreq = max((int) $freq, 1);
+ $this->redrawFreq = null !== $freq ? max(1, $freq) : null;
+ }
+
+ public function minSecondsBetweenRedraws(float $seconds): void
+ {
+ $this->minSecondsBetweenRedraws = $seconds;
+ }
+
+ public function maxSecondsBetweenRedraws(float $seconds): void
+ {
+ $this->maxSecondsBetweenRedraws = $seconds;
+ }
+
+ /**
+ * Returns an iterator that will automatically update the progress bar when iterated.
+ *
+ * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable
+ */
+ public function iterate(iterable $iterable, int $max = null): iterable
+ {
+ $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0));
+
+ foreach ($iterable as $key => $value) {
+ yield $key => $value;
+
+ $this->advance();
+ }
+
+ $this->finish();
}
/**
@@ -321,7 +289,7 @@ class ProgressBar
*
* @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged
*/
- public function start($max = null)
+ public function start(int $max = null)
{
$this->startTime = time();
$this->step = 0;
@@ -338,55 +306,64 @@ class ProgressBar
* Advances the progress output X steps.
*
* @param int $step Number of steps to advance
- *
- * @throws LogicException
*/
- public function advance($step = 1)
+ public function advance(int $step = 1)
{
$this->setProgress($this->step + $step);
}
/**
* Sets whether to overwrite the progressbar, false for new line.
- *
- * @param bool $overwrite
*/
- public function setOverwrite($overwrite)
+ public function setOverwrite(bool $overwrite)
{
- $this->overwrite = (bool) $overwrite;
+ $this->overwrite = $overwrite;
}
- /**
- * Sets the current progress.
- *
- * @param int $step The current progress
- *
- * @throws LogicException
- */
- public function setProgress($step)
+ public function setProgress(int $step)
{
- $step = (int) $step;
- if ($step < $this->step) {
- throw new LogicException('You can\'t regress the progress bar.');
- }
-
if ($this->max && $step > $this->max) {
$this->max = $step;
+ } elseif ($step < 0) {
+ $step = 0;
}
- $prevPeriod = (int) ($this->step / $this->redrawFreq);
- $currPeriod = (int) ($step / $this->redrawFreq);
+ $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10);
+ $prevPeriod = (int) ($this->step / $redrawFreq);
+ $currPeriod = (int) ($step / $redrawFreq);
$this->step = $step;
$this->percent = $this->max ? (float) $this->step / $this->max : 0;
- if ($prevPeriod !== $currPeriod || $this->max === $step) {
+ $timeInterval = microtime(true) - $this->lastWriteTime;
+
+ // Draw regardless of other limits
+ if ($this->max === $step) {
+ $this->display();
+
+ return;
+ }
+
+ // Throttling
+ if ($timeInterval < $this->minSecondsBetweenRedraws) {
+ return;
+ }
+
+ // Draw each step period, but not too late
+ if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) {
$this->display();
}
}
+ public function setMaxSteps(int $max)
+ {
+ $this->format = null;
+ $this->max = max(0, $max);
+ $this->stepWidth = $this->max ? Helper::strlen((string) $this->max) : 4;
+ }
+
/**
* Finishes the progress output.
*/
- public function finish()
+ public function finish(): void
{
if (!$this->max) {
$this->max = $this->step;
@@ -403,7 +380,7 @@ class ProgressBar
/**
* Outputs the current progress string.
*/
- public function display()
+ public function display(): void
{
if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) {
return;
@@ -413,21 +390,7 @@ class ProgressBar
$this->setRealFormat($this->internalFormat ?: $this->determineBestFormat());
}
- $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) {
- if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) {
- $text = call_user_func($formatter, $this, $this->output);
- } elseif (isset($this->messages[$matches[1]])) {
- $text = $this->messages[$matches[1]];
- } else {
- return $matches[0];
- }
-
- if (isset($matches[2])) {
- $text = sprintf('%'.$matches[2], $text);
- }
-
- return $text;
- }, $this->format));
+ $this->overwrite($this->buildLine());
}
/**
@@ -437,7 +400,7 @@ class ProgressBar
* while a progress bar is running.
* Call display() to show the progress bar again.
*/
- public function clear()
+ public function clear(): void
{
if (!$this->overwrite) {
return;
@@ -450,12 +413,7 @@ class ProgressBar
$this->overwrite('');
}
- /**
- * Sets the progress bar format.
- *
- * @param string $format The format
- */
- private function setRealFormat($format)
+ private function setRealFormat(string $format)
{
// try to use the _nomax variant if available
if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) {
@@ -470,46 +428,50 @@ class ProgressBar
}
/**
- * Sets the progress bar maximal steps.
- *
- * @param int $max The progress bar max steps
- */
- private function setMaxSteps($max)
- {
- $this->max = max(0, (int) $max);
- $this->stepWidth = $this->max ? Helper::strlen($this->max) : 4;
- }
-
- /**
* Overwrites a previous message to the output.
- *
- * @param string $message The message
*/
- private function overwrite($message)
+ private function overwrite(string $message): void
{
- if ($this->overwrite) {
- if (!$this->firstRun) {
- // Move the cursor to the beginning of the line
- $this->output->write("\x0D");
+ if ($this->previousMessage === $message) {
+ return;
+ }
+
+ $originalMessage = $message;
- // Erase the line
- $this->output->write("\x1B[2K");
+ if ($this->overwrite) {
+ if (null !== $this->previousMessage) {
+ if ($this->output instanceof ConsoleSectionOutput) {
+ $messageLines = explode("\n", $message);
+ $lineCount = \count($messageLines);
+ foreach ($messageLines as $messageLine) {
+ $messageLineLength = Helper::strlenWithoutDecoration($this->output->getFormatter(), $messageLine);
+ if ($messageLineLength > $this->terminal->getWidth()) {
+ $lineCount += floor($messageLineLength / $this->terminal->getWidth());
+ }
+ }
+ $this->output->clear($lineCount);
+ } else {
+ // Erase previous lines
+ if ($this->formatLineCount > 0) {
+ $message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message;
+ }
- // Erase previous lines
- if ($this->formatLineCount > 0) {
- $this->output->write(str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount));
+ // Move the cursor to the beginning of the line and erase the line
+ $message = "\x0D\x1B[2K$message";
}
}
} elseif ($this->step > 0) {
- $this->output->writeln('');
+ $message = \PHP_EOL.$message;
}
- $this->firstRun = false;
+ $this->previousMessage = $originalMessage;
+ $this->lastWriteTime = microtime(true);
$this->output->write($message);
+ ++$this->writeCount;
}
- private function determineBestFormat()
+ private function determineBestFormat(): string
{
switch ($this->output->getVerbosity()) {
// OutputInterface::VERBOSITY_QUIET: display is disabled anyway
@@ -524,11 +486,11 @@ class ProgressBar
}
}
- private static function initPlaceholderFormatters()
+ private static function initPlaceholderFormatters(): array
{
- return array(
- 'bar' => function (ProgressBar $bar, OutputInterface $output) {
- $completeBars = floor($bar->getMaxSteps() > 0 ? $bar->getProgressPercent() * $bar->getBarWidth() : $bar->getProgress() % $bar->getBarWidth());
+ return [
+ 'bar' => function (self $bar, OutputInterface $output) {
+ $completeBars = $bar->getBarOffset();
$display = str_repeat($bar->getBarCharacter(), $completeBars);
if ($completeBars < $bar->getBarWidth()) {
$emptyBars = $bar->getBarWidth() - $completeBars - Helper::strlenWithoutDecoration($output->getFormatter(), $bar->getProgressCharacter());
@@ -537,10 +499,10 @@ class ProgressBar
return $display;
},
- 'elapsed' => function (ProgressBar $bar) {
+ 'elapsed' => function (self $bar) {
return Helper::formatTime(time() - $bar->getStartTime());
},
- 'remaining' => function (ProgressBar $bar) {
+ 'remaining' => function (self $bar) {
if (!$bar->getMaxSteps()) {
throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.');
}
@@ -553,7 +515,7 @@ class ProgressBar
return Helper::formatTime($remaining);
},
- 'estimated' => function (ProgressBar $bar) {
+ 'estimated' => function (self $bar) {
if (!$bar->getMaxSteps()) {
throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.');
}
@@ -566,24 +528,24 @@ class ProgressBar
return Helper::formatTime($estimated);
},
- 'memory' => function (ProgressBar $bar) {
+ 'memory' => function (self $bar) {
return Helper::formatMemory(memory_get_usage(true));
},
- 'current' => function (ProgressBar $bar) {
- return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', STR_PAD_LEFT);
+ 'current' => function (self $bar) {
+ return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT);
},
- 'max' => function (ProgressBar $bar) {
+ 'max' => function (self $bar) {
return $bar->getMaxSteps();
},
- 'percent' => function (ProgressBar $bar) {
+ 'percent' => function (self $bar) {
return floor($bar->getProgressPercent() * 100);
},
- );
+ ];
}
- private static function initFormats()
+ private static function initFormats(): array
{
- return array(
+ return [
'normal' => ' %current%/%max% [%bar%] %percent:3s%%',
'normal_nomax' => ' %current% [%bar%]',
@@ -595,6 +557,43 @@ class ProgressBar
'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%',
'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%',
- );
+ ];
+ }
+
+ private function buildLine(): string
+ {
+ $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i";
+ $callback = function ($matches) {
+ if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) {
+ $text = $formatter($this, $this->output);
+ } elseif (isset($this->messages[$matches[1]])) {
+ $text = $this->messages[$matches[1]];
+ } else {
+ return $matches[0];
+ }
+
+ if (isset($matches[2])) {
+ $text = sprintf('%'.$matches[2], $text);
+ }
+
+ return $text;
+ };
+ $line = preg_replace_callback($regex, $callback, $this->format);
+
+ // gets string length for each sub line with multiline format
+ $linesLength = array_map(function ($subLine) {
+ return Helper::strlenWithoutDecoration($this->output->getFormatter(), rtrim($subLine, "\r"));
+ }, explode("\n", $line));
+
+ $linesWidth = max($linesLength);
+
+ $terminalWidth = $this->terminal->getWidth();
+ if ($linesWidth <= $terminalWidth) {
+ return $line;
+ }
+
+ $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth);
+
+ return preg_replace_callback($regex, $callback, $this->format);
}
}
diff --git a/vendor/symfony/console/Helper/ProgressIndicator.php b/vendor/symfony/console/Helper/ProgressIndicator.php
index f90a85c..dc37148 100644
--- a/vendor/symfony/console/Helper/ProgressIndicator.php
+++ b/vendor/symfony/console/Helper/ProgressIndicator.php
@@ -28,19 +28,17 @@ class ProgressIndicator
private $indicatorCurrent;
private $indicatorChangeInterval;
private $indicatorUpdateTime;
- private $lastMessagesLength;
private $started = false;
private static $formatters;
private static $formats;
/**
- * @param OutputInterface $output
- * @param string|null $format Indicator format
- * @param int $indicatorChangeInterval Change interval in milliseconds
- * @param array|null $indicatorValues Animated indicator characters
+ * @param string|null $format Indicator format
+ * @param int $indicatorChangeInterval Change interval in milliseconds
+ * @param array|null $indicatorValues Animated indicator characters
*/
- public function __construct(OutputInterface $output, $format = null, $indicatorChangeInterval = 100, $indicatorValues = null)
+ public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null)
{
$this->output = $output;
@@ -49,12 +47,12 @@ class ProgressIndicator
}
if (null === $indicatorValues) {
- $indicatorValues = array('-', '\\', '|', '/');
+ $indicatorValues = ['-', '\\', '|', '/'];
}
$indicatorValues = array_values($indicatorValues);
- if (2 > count($indicatorValues)) {
+ if (2 > \count($indicatorValues)) {
throw new InvalidArgumentException('Must have at least 2 indicator value characters.');
}
@@ -89,7 +87,6 @@ class ProgressIndicator
$this->message = $message;
$this->started = true;
- $this->lastMessagesLength = 0;
$this->startTime = time();
$this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval;
$this->indicatorCurrent = 0;
@@ -152,7 +149,7 @@ class ProgressIndicator
self::$formats = self::initFormats();
}
- return isset(self::$formats[$name]) ? self::$formats[$name] : null;
+ return self::$formats[$name] ?? null;
}
/**
@@ -185,7 +182,7 @@ class ProgressIndicator
self::$formatters = self::initPlaceholderFormatters();
}
- return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
+ return self::$formatters[$name] ?? null;
}
private function display()
@@ -194,18 +191,16 @@ class ProgressIndicator
return;
}
- $self = $this;
-
- $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self) {
- if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) {
- return call_user_func($formatter, $self);
+ $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) {
+ if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) {
+ return $formatter($this);
}
return $matches[0];
- }, $this->format));
+ }, $this->format ?? ''));
}
- private function determineBestFormat()
+ private function determineBestFormat(): string
{
switch ($this->output->getVerbosity()) {
// OutputInterface::VERBOSITY_QUIET: display is disabled anyway
@@ -221,60 +216,43 @@ class ProgressIndicator
/**
* Overwrites a previous message to the output.
- *
- * @param string $message The message
*/
- private function overwrite($message)
+ private function overwrite(string $message)
{
- // append whitespace to match the line's length
- if (null !== $this->lastMessagesLength) {
- if ($this->lastMessagesLength > Helper::strlenWithoutDecoration($this->output->getFormatter(), $message)) {
- $message = str_pad($message, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT);
- }
- }
-
if ($this->output->isDecorated()) {
- $this->output->write("\x0D");
+ $this->output->write("\x0D\x1B[2K");
$this->output->write($message);
} else {
$this->output->writeln($message);
}
-
- $this->lastMessagesLength = 0;
-
- $len = Helper::strlenWithoutDecoration($this->output->getFormatter(), $message);
-
- if ($len > $this->lastMessagesLength) {
- $this->lastMessagesLength = $len;
- }
}
- private function getCurrentTimeInMilliseconds()
+ private function getCurrentTimeInMilliseconds(): float
{
return round(microtime(true) * 1000);
}
- private static function initPlaceholderFormatters()
+ private static function initPlaceholderFormatters(): array
{
- return array(
- 'indicator' => function (ProgressIndicator $indicator) {
- return $indicator->indicatorValues[$indicator->indicatorCurrent % count($indicator->indicatorValues)];
+ return [
+ 'indicator' => function (self $indicator) {
+ return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)];
},
- 'message' => function (ProgressIndicator $indicator) {
+ 'message' => function (self $indicator) {
return $indicator->message;
},
- 'elapsed' => function (ProgressIndicator $indicator) {
+ 'elapsed' => function (self $indicator) {
return Helper::formatTime(time() - $indicator->startTime);
},
'memory' => function () {
return Helper::formatMemory(memory_get_usage(true));
},
- );
+ ];
}
- private static function initFormats()
+ private static function initFormats(): array
{
- return array(
+ return [
'normal' => ' %indicator% %message%',
'normal_no_ansi' => ' %message%',
@@ -283,6 +261,6 @@ class ProgressIndicator
'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)',
'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)',
- );
+ ];
}
}
diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php
index 4012b08..a4754b8 100644
--- a/vendor/symfony/console/Helper/QuestionHelper.php
+++ b/vendor/symfony/console/Helper/QuestionHelper.php
@@ -11,14 +11,18 @@
namespace Symfony\Component\Console\Helper;
-use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\MissingInputException;
use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\StreamableInputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
+use Symfony\Component\Console\Output\ConsoleSectionOutput;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Question\ChoiceQuestion;
+use Symfony\Component\Console\Question\Question;
+use Symfony\Component\Console\Terminal;
/**
* The QuestionHelper class provides helpers to interact with the user.
@@ -29,16 +33,13 @@ class QuestionHelper extends Helper
{
private $inputStream;
private static $shell;
- private static $stty;
+ private static $stty = true;
+ private static $stdinIsInteractive;
/**
* Asks a question to the user.
*
- * @param InputInterface $input An InputInterface instance
- * @param OutputInterface $output An OutputInterface instance
- * @param Question $question The question to ask
- *
- * @return string The user answer
+ * @return mixed The user answer
*
* @throws RuntimeException If there is no data to read in the input stream
*/
@@ -49,80 +50,71 @@ class QuestionHelper extends Helper
}
if (!$input->isInteractive()) {
- return $question->getDefault();
+ return $this->getDefaultAnswer($question);
}
- if (!$question->getValidator()) {
- return $this->doAsk($output, $question);
+ if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) {
+ $this->inputStream = $stream;
}
- $interviewer = function () use ($output, $question) {
- return $this->doAsk($output, $question);
- };
+ try {
+ if (!$question->getValidator()) {
+ return $this->doAsk($output, $question);
+ }
- return $this->validateAttempts($interviewer, $output, $question);
- }
+ $interviewer = function () use ($output, $question) {
+ return $this->doAsk($output, $question);
+ };
- /**
- * Sets the input stream to read from when interacting with the user.
- *
- * This is mainly useful for testing purpose.
- *
- * @param resource $stream The input stream
- *
- * @throws InvalidArgumentException In case the stream is not a resource
- */
- public function setInputStream($stream)
- {
- if (!is_resource($stream)) {
- throw new InvalidArgumentException('Input stream must be a valid resource.');
- }
+ return $this->validateAttempts($interviewer, $output, $question);
+ } catch (MissingInputException $exception) {
+ $input->setInteractive(false);
- $this->inputStream = $stream;
+ if (null === $fallbackOutput = $this->getDefaultAnswer($question)) {
+ throw $exception;
+ }
+
+ return $fallbackOutput;
+ }
}
/**
- * Returns the helper's input stream.
- *
- * @return resource
+ * {@inheritdoc}
*/
- public function getInputStream()
+ public function getName()
{
- return $this->inputStream;
+ return 'question';
}
/**
- * {@inheritdoc}
+ * Prevents usage of stty.
*/
- public function getName()
+ public static function disableStty()
{
- return 'question';
+ self::$stty = false;
}
/**
* Asks the question to the user.
*
- * @param OutputInterface $output
- * @param Question $question
- *
- * @return bool|mixed|null|string
+ * @return mixed
*
- * @throws \Exception
- * @throws \RuntimeException
+ * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
*/
private function doAsk(OutputInterface $output, Question $question)
{
$this->writePrompt($output, $question);
- $inputStream = $this->inputStream ?: STDIN;
- $autocomplete = $question->getAutocompleterValues();
+ $inputStream = $this->inputStream ?: \STDIN;
+ $autocomplete = $question->getAutocompleterCallback();
- if (null === $autocomplete || !$this->hasSttyAvailable()) {
+ if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) {
$ret = false;
if ($question->isHidden()) {
try {
- $ret = trim($this->getHiddenResponse($output, $inputStream));
- } catch (\RuntimeException $e) {
+ $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable());
+ $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse;
+ } catch (RuntimeException $e) {
if (!$question->isHiddenFallback()) {
throw $e;
}
@@ -130,17 +122,26 @@ class QuestionHelper extends Helper
}
if (false === $ret) {
+ $cp = $this->setIOCodepage();
$ret = fgets($inputStream, 4096);
+ $ret = $this->resetIOCodepage($cp, $ret);
if (false === $ret) {
- throw new \RuntimeException('Aborted');
+ throw new MissingInputException('Aborted.');
+ }
+ if ($question->isTrimmable()) {
+ $ret = trim($ret);
}
- $ret = trim($ret);
}
} else {
- $ret = trim($this->autocomplete($output, $question, $inputStream));
+ $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete);
+ $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete;
+ }
+
+ if ($output instanceof ConsoleSectionOutput) {
+ $output->addContent($ret);
}
- $ret = strlen($ret) > 0 ? $ret : $question->getDefault();
+ $ret = \strlen($ret) > 0 ? $ret : $question->getDefault();
if ($normalizer = $question->getNormalizer()) {
return $normalizer($ret);
@@ -150,25 +151,46 @@ class QuestionHelper extends Helper
}
/**
+ * @return mixed
+ */
+ private function getDefaultAnswer(Question $question)
+ {
+ $default = $question->getDefault();
+
+ if (null === $default) {
+ return $default;
+ }
+
+ if ($validator = $question->getValidator()) {
+ return \call_user_func($question->getValidator(), $default);
+ } elseif ($question instanceof ChoiceQuestion) {
+ $choices = $question->getChoices();
+
+ if (!$question->isMultiselect()) {
+ return $choices[$default] ?? $default;
+ }
+
+ $default = explode(',', $default);
+ foreach ($default as $k => $v) {
+ $v = $question->isTrimmable() ? trim($v) : $v;
+ $default[$k] = $choices[$v] ?? $v;
+ }
+ }
+
+ return $default;
+ }
+
+ /**
* Outputs the question prompt.
- *
- * @param OutputInterface $output
- * @param Question $question
*/
protected function writePrompt(OutputInterface $output, Question $question)
{
$message = $question->getQuestion();
if ($question instanceof ChoiceQuestion) {
- $maxWidth = max(array_map(array($this, 'strlen'), array_keys($question->getChoices())));
-
- $messages = (array) $question->getQuestion();
- foreach ($question->getChoices() as $key => $value) {
- $width = $maxWidth - $this->strlen($key);
- $messages[] = ' [<info>'.$key.str_repeat(' ', $width).'</info>] '.$value;
- }
-
- $output->writeln($messages);
+ $output->writeln(array_merge([
+ $question->getQuestion(),
+ ], $this->formatChoiceQuestionChoices($question, 'info')));
$message = $question->getPrompt();
}
@@ -177,10 +199,27 @@ class QuestionHelper extends Helper
}
/**
- * Outputs an error message.
+ * @param string $tag
*
- * @param OutputInterface $output
- * @param \Exception $error
+ * @return string[]
+ */
+ protected function formatChoiceQuestionChoices(ChoiceQuestion $question, $tag)
+ {
+ $messages = [];
+
+ $maxWidth = max(array_map([__CLASS__, 'strlen'], array_keys($choices = $question->getChoices())));
+
+ foreach ($choices as $key => $value) {
+ $padding = str_repeat(' ', $maxWidth - self::strlen($key));
+
+ $messages[] = sprintf(" [<$tag>%s$padding</$tag>] %s", $key, $value);
+ }
+
+ return $messages;
+ }
+
+ /**
+ * Outputs an error message.
*/
protected function writeError(OutputInterface $output, \Exception $error)
{
@@ -196,21 +235,17 @@ class QuestionHelper extends Helper
/**
* Autocompletes a question.
*
- * @param OutputInterface $output
- * @param Question $question
- * @param resource $inputStream
- *
- * @return string
+ * @param resource $inputStream
*/
- private function autocomplete(OutputInterface $output, Question $question, $inputStream)
+ private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string
{
- $autocomplete = $question->getAutocompleterValues();
+ $fullChoice = '';
$ret = '';
$i = 0;
$ofs = -1;
- $matches = $autocomplete;
- $numMatches = count($matches);
+ $matches = $autocomplete($ret);
+ $numMatches = \count($matches);
$sttyMode = shell_exec('stty -g');
@@ -224,24 +259,28 @@ class QuestionHelper extends Helper
while (!feof($inputStream)) {
$c = fread($inputStream, 1);
- // Backspace Character
- if ("\177" === $c) {
+ // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false.
+ if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) {
+ shell_exec(sprintf('stty %s', $sttyMode));
+ throw new MissingInputException('Aborted.');
+ } elseif ("\177" === $c) { // Backspace Character
if (0 === $numMatches && 0 !== $i) {
--$i;
+ $fullChoice = self::substr($fullChoice, 0, $i);
// Move cursor backwards
$output->write("\033[1D");
}
- if ($i === 0) {
+ if (0 === $i) {
$ofs = -1;
- $matches = $autocomplete;
- $numMatches = count($matches);
+ $matches = $autocomplete($ret);
+ $numMatches = \count($matches);
} else {
$numMatches = 0;
}
// Pop the last character off the end of our string
- $ret = substr($ret, 0, $i);
+ $ret = self::substr($ret, 0, $i);
} elseif ("\033" === $c) {
// Did we read an escape sequence?
$c .= fread($inputStream, 2);
@@ -259,13 +298,24 @@ class QuestionHelper extends Helper
$ofs += ('A' === $c[2]) ? -1 : 1;
$ofs = ($numMatches + $ofs) % $numMatches;
}
- } elseif (ord($c) < 32) {
+ } elseif (\ord($c) < 32) {
if ("\t" === $c || "\n" === $c) {
if ($numMatches > 0 && -1 !== $ofs) {
- $ret = $matches[$ofs];
+ $ret = (string) $matches[$ofs];
// Echo out remaining chars for current match
- $output->write(substr($ret, $i));
- $i = strlen($ret);
+ $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))));
+ $output->write($remainingCharacters);
+ $fullChoice .= $remainingCharacters;
+ $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding);
+
+ $matches = array_filter(
+ $autocomplete($ret),
+ function ($match) use ($ret) {
+ return '' === $ret || str_starts_with($match, $ret);
+ }
+ );
+ $numMatches = \count($matches);
+ $ofs = -1;
}
if ("\n" === $c) {
@@ -278,16 +328,27 @@ class QuestionHelper extends Helper
continue;
} else {
+ if ("\x80" <= $c) {
+ $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]);
+ }
+
$output->write($c);
$ret .= $c;
+ $fullChoice .= $c;
++$i;
+ $tempRet = $ret;
+
+ if ($question instanceof ChoiceQuestion && $question->isMultiselect()) {
+ $tempRet = $this->mostRecentlyEnteredValue($fullChoice);
+ }
+
$numMatches = 0;
$ofs = 0;
- foreach ($autocomplete as $value) {
+ foreach ($autocomplete($ret) as $value) {
// If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle)
- if (0 === strpos($value, $ret) && $i !== strlen($value)) {
+ if (str_starts_with($value, $tempRet)) {
$matches[$numMatches++] = $value;
}
}
@@ -299,8 +360,9 @@ class QuestionHelper extends Helper
if ($numMatches > 0 && -1 !== $ofs) {
// Save cursor position
$output->write("\0337");
- // Write highlighted text
- $output->write('<hl>'.substr($matches[$ofs], $i).'</hl>');
+ // Write highlighted text, complete the partially entered response
+ $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)));
+ $output->write('<hl>'.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).'</hl>');
// Restore cursor position
$output->write("\0338");
}
@@ -309,22 +371,35 @@ class QuestionHelper extends Helper
// Reset stty so it behaves normally again
shell_exec(sprintf('stty %s', $sttyMode));
- return $ret;
+ return $fullChoice;
+ }
+
+ private function mostRecentlyEnteredValue(string $entered): string
+ {
+ // Determine the most recent value that the user entered
+ if (!str_contains($entered, ',')) {
+ return $entered;
+ }
+
+ $choices = explode(',', $entered);
+ if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) {
+ return $lastChoice;
+ }
+
+ return $entered;
}
/**
* Gets a hidden response from user.
*
- * @param OutputInterface $output An Output instance
- * @param resource $inputStream The handler resource
- *
- * @return string The answer
+ * @param resource $inputStream The handler resource
+ * @param bool $trimmable Is the answer trimmable
*
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
*/
- private function getHiddenResponse(OutputInterface $output, $inputStream)
+ private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string
{
- if ('\\' === DIRECTORY_SEPARATOR) {
+ if ('\\' === \DIRECTORY_SEPARATOR) {
$exe = __DIR__.'/../Resources/bin/hiddeninput.exe';
// handle code running from a phar
@@ -334,7 +409,8 @@ class QuestionHelper extends Helper
$exe = $tmpExe;
}
- $value = rtrim(shell_exec($exe));
+ $sExec = shell_exec('"'.$exe.'"');
+ $value = $trimmable ? rtrim($sExec) : $sExec;
$output->writeln('');
if (isset($tmpExe)) {
@@ -344,43 +420,36 @@ class QuestionHelper extends Helper
return $value;
}
- if ($this->hasSttyAvailable()) {
+ if (self::$stty && Terminal::hasSttyAvailable()) {
$sttyMode = shell_exec('stty -g');
-
shell_exec('stty -echo');
- $value = fgets($inputStream, 4096);
- shell_exec(sprintf('stty %s', $sttyMode));
-
- if (false === $value) {
- throw new RuntimeException('Aborted');
- }
+ } elseif ($this->isInteractiveInput($inputStream)) {
+ throw new RuntimeException('Unable to hide the response.');
+ }
- $value = trim($value);
- $output->writeln('');
+ $value = fgets($inputStream, 4096);
- return $value;
+ if (self::$stty && Terminal::hasSttyAvailable()) {
+ shell_exec(sprintf('stty %s', $sttyMode));
}
- if (false !== $shell = $this->getShell()) {
- $readCmd = $shell === 'csh' ? 'set mypassword = $<' : 'read -r mypassword';
- $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);
- $value = rtrim(shell_exec($command));
- $output->writeln('');
-
- return $value;
+ if (false === $value) {
+ throw new MissingInputException('Aborted.');
+ }
+ if ($trimmable) {
+ $value = trim($value);
}
+ $output->writeln('');
- throw new RuntimeException('Unable to hide the response.');
+ return $value;
}
/**
* Validates an attempt.
*
- * @param callable $interviewer A callable that will ask for a question and return the result
- * @param OutputInterface $output An Output instance
- * @param Question $question A Question instance
+ * @param callable $interviewer A callable that will ask for a question and return the result
*
- * @return string The validated response
+ * @return mixed The validated response
*
* @throws \Exception In case the max number of attempts has been reached and no valid response has been given
*/
@@ -388,13 +457,16 @@ class QuestionHelper extends Helper
{
$error = null;
$attempts = $question->getMaxAttempts();
+
while (null === $attempts || $attempts--) {
if (null !== $error) {
$this->writeError($output, $error);
}
try {
- return call_user_func($question->getValidator(), $interviewer());
+ return $question->getValidator()($interviewer());
+ } catch (RuntimeException $e) {
+ throw $e;
} catch (\Exception $error) {
}
}
@@ -402,46 +474,67 @@ class QuestionHelper extends Helper
throw $error;
}
- /**
- * Returns a valid unix shell.
- *
- * @return string|bool The valid shell name, false in case no valid shell is found
- */
- private function getShell()
+ private function isInteractiveInput($inputStream): bool
{
- if (null !== self::$shell) {
- return self::$shell;
+ if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) {
+ return false;
}
- self::$shell = false;
+ if (null !== self::$stdinIsInteractive) {
+ return self::$stdinIsInteractive;
+ }
- if (file_exists('/usr/bin/env')) {
- // handle other OSs with bash/zsh/ksh/csh if available to hide the answer
- $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
- foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
- if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
- self::$shell = $sh;
- break;
- }
- }
+ if (\function_exists('stream_isatty')) {
+ return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
}
- return self::$shell;
+ if (\function_exists('posix_isatty')) {
+ return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r'));
+ }
+
+ if (!\function_exists('exec')) {
+ return self::$stdinIsInteractive = true;
+ }
+
+ exec('stty 2> /dev/null', $output, $status);
+
+ return self::$stdinIsInteractive = 1 !== $status;
}
/**
- * Returns whether Stty is available or not.
+ * Sets console I/O to the host code page.
*
- * @return bool
+ * @return int Previous code page in IBM/EBCDIC format
*/
- private function hasSttyAvailable()
+ private function setIOCodepage(): int
{
- if (null !== self::$stty) {
- return self::$stty;
+ if (\function_exists('sapi_windows_cp_set')) {
+ $cp = sapi_windows_cp_get();
+ sapi_windows_cp_set(sapi_windows_cp_get('oem'));
+
+ return $cp;
}
- exec('stty 2>&1', $output, $exitcode);
+ return 0;
+ }
+
+ /**
+ * Sets console I/O to the specified code page and converts the user input.
+ *
+ * @param string|false $input
+ *
+ * @return string|false
+ */
+ private function resetIOCodepage(int $cp, $input)
+ {
+ if (0 !== $cp) {
+ sapi_windows_cp_set($cp);
+
+ if (false !== $input && '' !== $input) {
+ $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input);
+ }
+ }
- return self::$stty = $exitcode === 0;
+ return $input;
}
}
diff --git a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
index 88351d1..ace5e18 100644
--- a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
+++ b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
@@ -11,14 +11,12 @@
namespace Symfony\Component\Console\Helper;
-use Symfony\Component\Console\Exception\LogicException;
-use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Style\SymfonyStyle;
-use Symfony\Component\Console\Formatter\OutputFormatter;
/**
* Symfony Style Guide compliant question helper.
@@ -30,31 +28,9 @@ class SymfonyQuestionHelper extends QuestionHelper
/**
* {@inheritdoc}
*/
- public function ask(InputInterface $input, OutputInterface $output, Question $question)
- {
- $validator = $question->getValidator();
- $question->setValidator(function ($value) use ($validator) {
- if (null !== $validator) {
- $value = $validator($value);
- } else {
- // make required
- if (!is_array($value) && !is_bool($value) && 0 === strlen($value)) {
- throw new LogicException('A value is required.');
- }
- }
-
- return $value;
- });
-
- return parent::ask($input, $output, $question);
- }
-
- /**
- * {@inheritdoc}
- */
protected function writePrompt(OutputInterface $output, Question $question)
{
- $text = OutputFormatter::escape($question->getQuestion());
+ $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion());
$default = $question->getDefault();
switch (true) {
@@ -82,7 +58,7 @@ class SymfonyQuestionHelper extends QuestionHelper
case $question instanceof ChoiceQuestion:
$choices = $question->getChoices();
- $text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape($choices[$default]));
+ $text = sprintf(' <info>%s</info> [<comment>%s</comment>]:', $text, OutputFormatter::escape($choices[$default] ?? $default));
break;
@@ -92,15 +68,15 @@ class SymfonyQuestionHelper extends QuestionHelper
$output->writeln($text);
+ $prompt = ' > ';
+
if ($question instanceof ChoiceQuestion) {
- $width = max(array_map('strlen', array_keys($question->getChoices())));
+ $output->writeln($this->formatChoiceQuestionChoices($question, 'comment'));
- foreach ($question->getChoices() as $key => $value) {
- $output->writeln(sprintf(" [<comment>%-${width}s</comment>] %s", $key, $value));
- }
+ $prompt = $question->getPrompt();
}
- $output->write(' > ');
+ $output->write($prompt);
}
/**
diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php
index 1434562..99496b1 100644
--- a/vendor/symfony/console/Helper/Table.php
+++ b/vendor/symfony/console/Helper/Table.php
@@ -11,8 +11,12 @@
namespace Symfony\Component\Console\Helper;
-use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface;
+use Symfony\Component\Console\Output\ConsoleSectionOutput;
+use Symfony\Component\Console\Output\OutputInterface;
/**
* Provides helpers to display a table.
@@ -21,34 +25,40 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
* @author Саша Стаменковић <umpirsky@gmail.com>
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
* @author Max Grigorian <maxakawizard@gmail.com>
+ * @author Dany Maillard <danymaillard93b@gmail.com>
*/
class Table
{
+ private const SEPARATOR_TOP = 0;
+ private const SEPARATOR_TOP_BOTTOM = 1;
+ private const SEPARATOR_MID = 2;
+ private const SEPARATOR_BOTTOM = 3;
+ private const BORDER_OUTSIDE = 0;
+ private const BORDER_INSIDE = 1;
+
+ private $headerTitle;
+ private $footerTitle;
+
/**
* Table headers.
- *
- * @var array
*/
- private $headers = array();
+ private $headers = [];
/**
* Table rows.
- *
- * @var array
*/
- private $rows = array();
+ private $rows = [];
+ private $horizontal = false;
/**
* Column widths cache.
- *
- * @var array
*/
- private $effectiveColumnWidths = array();
+ private $effectiveColumnWidths = [];
/**
* Number of columns cache.
*
- * @var array
+ * @var int
*/
private $numberOfColumns;
@@ -65,17 +75,20 @@ class Table
/**
* @var array
*/
- private $columnStyles = array();
+ private $columnStyles = [];
/**
* User set column widths.
*
* @var array
*/
- private $columnWidths = array();
+ private $columnWidths = [];
+ private $columnMaxWidths = [];
private static $styles;
+ private $rendered = false;
+
public function __construct(OutputInterface $output)
{
$this->output = $output;
@@ -90,8 +103,7 @@ class Table
/**
* Sets a style definition.
*
- * @param string $name The style name
- * @param TableStyle $style A TableStyle instance
+ * @param string $name The style name
*/
public static function setStyleDefinition($name, TableStyle $style)
{
@@ -107,7 +119,7 @@ class Table
*
* @param string $name The style name
*
- * @return TableStyle A TableStyle instance
+ * @return TableStyle
*/
public static function getStyleDefinition($name)
{
@@ -127,7 +139,7 @@ class Table
*
* @param TableStyle|string $name The style name or a TableStyle instance
*
- * @return Table
+ * @return $this
*/
public function setStyle($name)
{
@@ -152,11 +164,11 @@ class Table
* @param int $columnIndex Column index
* @param TableStyle|string $name The style name or a TableStyle instance
*
- * @return Table
+ * @return $this
*/
public function setColumnStyle($columnIndex, $name)
{
- $columnIndex = intval($columnIndex);
+ $columnIndex = (int) $columnIndex;
$this->columnStyles[$columnIndex] = $this->resolveStyle($name);
@@ -174,11 +186,7 @@ class Table
*/
public function getColumnStyle($columnIndex)
{
- if (isset($this->columnStyles[$columnIndex])) {
- return $this->columnStyles[$columnIndex];
- }
-
- return $this->getStyle();
+ return $this->columnStyles[$columnIndex] ?? $this->getStyle();
}
/**
@@ -187,11 +195,11 @@ class Table
* @param int $columnIndex Column index
* @param int $width Minimum column width in characters
*
- * @return Table
+ * @return $this
*/
public function setColumnWidth($columnIndex, $width)
{
- $this->columnWidths[intval($columnIndex)] = intval($width);
+ $this->columnWidths[(int) $columnIndex] = (int) $width;
return $this;
}
@@ -199,13 +207,11 @@ class Table
/**
* Sets the minimum width of all columns.
*
- * @param array $widths
- *
- * @return Table
+ * @return $this
*/
public function setColumnWidths(array $widths)
{
- $this->columnWidths = array();
+ $this->columnWidths = [];
foreach ($widths as $index => $width) {
$this->setColumnWidth($index, $width);
}
@@ -213,11 +219,30 @@ class Table
return $this;
}
+ /**
+ * Sets the maximum width of a column.
+ *
+ * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while
+ * formatted strings are preserved.
+ *
+ * @return $this
+ */
+ public function setColumnMaxWidth(int $columnIndex, int $width): self
+ {
+ if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) {
+ throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, \get_class($this->output->getFormatter())));
+ }
+
+ $this->columnMaxWidths[$columnIndex] = $width;
+
+ return $this;
+ }
+
public function setHeaders(array $headers)
{
$headers = array_values($headers);
- if (!empty($headers) && !is_array($headers[0])) {
- $headers = array($headers);
+ if (!empty($headers) && !\is_array($headers[0])) {
+ $headers = [$headers];
}
$this->headers = $headers;
@@ -227,7 +252,7 @@ class Table
public function setRows(array $rows)
{
- $this->rows = array();
+ $this->rows = [];
return $this->addRows($rows);
}
@@ -249,7 +274,7 @@ class Table
return $this;
}
- if (!is_array($row)) {
+ if (!\is_array($row)) {
throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.');
}
@@ -258,6 +283,25 @@ class Table
return $this;
}
+ /**
+ * Adds a row to the table, and re-renders the table.
+ */
+ public function appendRow($row): self
+ {
+ if (!$this->output instanceof ConsoleSectionOutput) {
+ throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__));
+ }
+
+ if ($this->rendered) {
+ $this->output->clear($this->calculateRowCount());
+ }
+
+ $this->addRow($row);
+ $this->render();
+
+ return $this;
+ }
+
public function setRow($column, array $row)
{
$this->rows[$column] = $row;
@@ -265,65 +309,177 @@ class Table
return $this;
}
+ public function setHeaderTitle(?string $title): self
+ {
+ $this->headerTitle = $title;
+
+ return $this;
+ }
+
+ public function setFooterTitle(?string $title): self
+ {
+ $this->footerTitle = $title;
+
+ return $this;
+ }
+
+ public function setHorizontal(bool $horizontal = true): self
+ {
+ $this->horizontal = $horizontal;
+
+ return $this;
+ }
+
/**
* Renders table to output.
*
* Example:
- * +---------------+-----------------------+------------------+
- * | ISBN | Title | Author |
- * +---------------+-----------------------+------------------+
- * | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
- * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
- * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
- * +---------------+-----------------------+------------------+
+ *
+ * +---------------+-----------------------+------------------+
+ * | ISBN | Title | Author |
+ * +---------------+-----------------------+------------------+
+ * | 99921-58-10-7 | Divine Comedy | Dante Alighieri |
+ * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
+ * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
+ * +---------------+-----------------------+------------------+
*/
public function render()
{
- $this->calculateNumberOfColumns();
- $rows = $this->buildTableRows($this->rows);
- $headers = $this->buildTableRows($this->headers);
-
- $this->calculateColumnsWidth(array_merge($headers, $rows));
-
- $this->renderRowSeparator();
- if (!empty($headers)) {
- foreach ($headers as $header) {
- $this->renderRow($header, $this->style->getCellHeaderFormat());
- $this->renderRowSeparator();
+ $divider = new TableSeparator();
+ if ($this->horizontal) {
+ $rows = [];
+ foreach ($this->headers[0] ?? [] as $i => $header) {
+ $rows[$i] = [$header];
+ foreach ($this->rows as $row) {
+ if ($row instanceof TableSeparator) {
+ continue;
+ }
+ if (isset($row[$i])) {
+ $rows[$i][] = $row[$i];
+ } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) {
+ // Noop, there is a "title"
+ } else {
+ $rows[$i][] = null;
+ }
+ }
}
+ } else {
+ $rows = array_merge($this->headers, [$divider], $this->rows);
}
- foreach ($rows as $row) {
- if ($row instanceof TableSeparator) {
- $this->renderRowSeparator();
- } else {
- $this->renderRow($row, $this->style->getCellRowFormat());
+
+ $this->calculateNumberOfColumns($rows);
+
+ $rowGroups = $this->buildTableRows($rows);
+ $this->calculateColumnsWidth($rowGroups);
+
+ $isHeader = !$this->horizontal;
+ $isFirstRow = $this->horizontal;
+ $hasTitle = (bool) $this->headerTitle;
+
+ foreach ($rowGroups as $rowGroup) {
+ $isHeaderSeparatorRendered = false;
+
+ foreach ($rowGroup as $row) {
+ if ($divider === $row) {
+ $isHeader = false;
+ $isFirstRow = true;
+
+ continue;
+ }
+
+ if ($row instanceof TableSeparator) {
+ $this->renderRowSeparator();
+
+ continue;
+ }
+
+ if (!$row) {
+ continue;
+ }
+
+ if ($isHeader && !$isHeaderSeparatorRendered) {
+ $this->renderRowSeparator(
+ $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM,
+ $hasTitle ? $this->headerTitle : null,
+ $hasTitle ? $this->style->getHeaderTitleFormat() : null
+ );
+ $hasTitle = false;
+ $isHeaderSeparatorRendered = true;
+ }
+
+ if ($isFirstRow) {
+ $this->renderRowSeparator(
+ $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM,
+ $hasTitle ? $this->headerTitle : null,
+ $hasTitle ? $this->style->getHeaderTitleFormat() : null
+ );
+ $isFirstRow = false;
+ $hasTitle = false;
+ }
+
+ if ($this->horizontal) {
+ $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat());
+ } else {
+ $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat());
+ }
}
}
- if (!empty($rows)) {
- $this->renderRowSeparator();
- }
+ $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat());
$this->cleanup();
+ $this->rendered = true;
}
/**
* Renders horizontal header separator.
*
- * Example: +-----+-----------+-------+
+ * Example:
+ *
+ * +-----+-----------+-------+
*/
- private function renderRowSeparator()
+ private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null)
{
if (0 === $count = $this->numberOfColumns) {
return;
}
- if (!$this->style->getHorizontalBorderChar() && !$this->style->getCrossingChar()) {
+ $borders = $this->style->getBorderChars();
+ if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) {
return;
}
- $markup = $this->style->getCrossingChar();
+ $crossings = $this->style->getCrossingChars();
+ if (self::SEPARATOR_MID === $type) {
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]];
+ } elseif (self::SEPARATOR_TOP === $type) {
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]];
+ } elseif (self::SEPARATOR_TOP_BOTTOM === $type) {
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]];
+ } else {
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]];
+ }
+
+ $markup = $leftChar;
for ($column = 0; $column < $count; ++$column) {
- $markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->effectiveColumnWidths[$column]).$this->style->getCrossingChar();
+ $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]);
+ $markup .= $column === $count - 1 ? $rightChar : $midChar;
+ }
+
+ if (null !== $title) {
+ $titleLength = Helper::strlenWithoutDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title));
+ $markupLength = Helper::strlen($markup);
+ if ($titleLength > $limit = $markupLength - 4) {
+ $titleLength = $limit;
+ $formatLength = Helper::strlenWithoutDecoration($formatter, sprintf($titleFormat, ''));
+ $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...');
+ }
+
+ $titleStart = intdiv($markupLength - $titleLength, 2);
+ if (false === mb_detect_encoding($markup, null, true)) {
+ $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength);
+ } else {
+ $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength);
+ }
}
$this->output->writeln(sprintf($this->style->getBorderFormat(), $markup));
@@ -332,43 +488,42 @@ class Table
/**
* Renders vertical column separator.
*/
- private function renderColumnSeparator()
+ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string
{
- return sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar());
+ $borders = $this->style->getBorderChars();
+
+ return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]);
}
/**
* Renders table row.
*
- * Example: | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
+ * Example:
*
- * @param array $row
- * @param string $cellFormat
+ * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
*/
- private function renderRow(array $row, $cellFormat)
- {
- if (empty($row)) {
- return;
- }
-
- $rowContent = $this->renderColumnSeparator();
- foreach ($this->getRowColumns($row) as $column) {
- $rowContent .= $this->renderCell($row, $column, $cellFormat);
- $rowContent .= $this->renderColumnSeparator();
+ private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null)
+ {
+ $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
+ $columns = $this->getRowColumns($row);
+ $last = \count($columns) - 1;
+ foreach ($columns as $i => $column) {
+ if ($firstCellFormat && 0 === $i) {
+ $rowContent .= $this->renderCell($row, $column, $firstCellFormat);
+ } else {
+ $rowContent .= $this->renderCell($row, $column, $cellFormat);
+ }
+ $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE);
}
$this->output->writeln($rowContent);
}
/**
* Renders table cell with padding.
- *
- * @param array $row
- * @param int $column
- * @param string $cellFormat
*/
- private function renderCell(array $row, $column, $cellFormat)
+ private function renderCell(array $row, int $column, string $cellFormat): string
{
- $cell = isset($row[$column]) ? $row[$column] : '';
+ $cell = $row[$column] ?? '';
$width = $this->effectiveColumnWidths[$column];
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
// add the width of the following columns(numbers of colspan).
@@ -379,13 +534,13 @@ class Table
// str_pad won't work properly with multi-byte strings, we need to fix the padding
if (false !== $encoding = mb_detect_encoding($cell, null, true)) {
- $width += strlen($cell) - mb_strwidth($cell, $encoding);
+ $width += \strlen($cell) - mb_strwidth($cell, $encoding);
}
$style = $this->getColumnStyle($column);
if ($cell instanceof TableSeparator) {
- return sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width));
+ return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width));
}
$width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
@@ -397,14 +552,10 @@ class Table
/**
* Calculate number of columns for this table.
*/
- private function calculateNumberOfColumns()
+ private function calculateNumberOfColumns(array $rows)
{
- if (null !== $this->numberOfColumns) {
- return;
- }
-
- $columns = array(0);
- foreach (array_merge($this->headers, $this->rows) as $row) {
+ $columns = [0];
+ foreach ($rows as $row) {
if ($row instanceof TableSeparator) {
continue;
}
@@ -415,80 +566,113 @@ class Table
$this->numberOfColumns = max($columns);
}
- private function buildTableRows($rows)
+ private function buildTableRows(array $rows): TableRows
{
- $unmergedRows = array();
- for ($rowKey = 0; $rowKey < count($rows); ++$rowKey) {
+ /** @var WrappableOutputFormatterInterface $formatter */
+ $formatter = $this->output->getFormatter();
+ $unmergedRows = [];
+ for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) {
$rows = $this->fillNextRows($rows, $rowKey);
// Remove any new line breaks and replace it with a new line
foreach ($rows[$rowKey] as $column => $cell) {
- if (!strstr($cell, "\n")) {
+ $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1;
+
+ if (isset($this->columnMaxWidths[$column]) && Helper::strlenWithoutDecoration($formatter, $cell) > $this->columnMaxWidths[$column]) {
+ $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan);
+ }
+ if (!strstr($cell ?? '', "\n")) {
continue;
}
- $lines = explode("\n", $cell);
+ $escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell)));
+ $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped;
+ $lines = explode("\n", str_replace("\n", "<fg=default;bg=default></>\n", $cell));
foreach ($lines as $lineKey => $line) {
- if ($cell instanceof TableCell) {
- $line = new TableCell($line, array('colspan' => $cell->getColspan()));
+ if ($colspan > 1) {
+ $line = new TableCell($line, ['colspan' => $colspan]);
}
if (0 === $lineKey) {
$rows[$rowKey][$column] = $line;
} else {
+ if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) {
+ $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey);
+ }
$unmergedRows[$rowKey][$lineKey][$column] = $line;
}
}
}
}
- $tableRows = array();
- foreach ($rows as $rowKey => $row) {
- $tableRows[] = $this->fillCells($row);
- if (isset($unmergedRows[$rowKey])) {
- $tableRows = array_merge($tableRows, $unmergedRows[$rowKey]);
+ return new TableRows(function () use ($rows, $unmergedRows): \Traversable {
+ foreach ($rows as $rowKey => $row) {
+ $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)];
+
+ if (isset($unmergedRows[$rowKey])) {
+ foreach ($unmergedRows[$rowKey] as $row) {
+ $rowGroup[] = $row instanceof TableSeparator ? $row : $this->fillCells($row);
+ }
+ }
+ yield $rowGroup;
}
+ });
+ }
+
+ private function calculateRowCount(): int
+ {
+ $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows))));
+
+ if ($this->headers) {
+ ++$numberOfRows; // Add row for header separator
}
- return $tableRows;
+ if (\count($this->rows) > 0) {
+ ++$numberOfRows; // Add row for footer separator
+ }
+
+ return $numberOfRows;
}
/**
* fill rows that contains rowspan > 1.
*
- * @param array $rows
- * @param int $line
- *
- * @return array
+ * @throws InvalidArgumentException
*/
- private function fillNextRows($rows, $line)
+ private function fillNextRows(array $rows, int $line): array
{
- $unmergedRows = array();
+ $unmergedRows = [];
foreach ($rows[$line] as $column => $cell) {
+ if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) {
+ throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell)));
+ }
if ($cell instanceof TableCell && $cell->getRowspan() > 1) {
$nbLines = $cell->getRowspan() - 1;
- $lines = array($cell);
+ $lines = [$cell];
if (strstr($cell, "\n")) {
- $lines = explode("\n", $cell);
- $nbLines = count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines;
+ $lines = explode("\n", str_replace("\n", "<fg=default;bg=default>\n</>", $cell));
+ $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines;
- $rows[$line][$column] = new TableCell($lines[0], array('colspan' => $cell->getColspan()));
+ $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan()]);
unset($lines[0]);
}
// create a two dimensional array (rowspan x colspan)
- $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, array()), $unmergedRows);
+ $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows);
foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
- $value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : '';
- $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, array('colspan' => $cell->getColspan()));
+ $value = $lines[$unmergedRowKey - $line] ?? '';
+ $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan()]);
+ if ($nbLines === $unmergedRowKey - $line) {
+ break;
+ }
}
}
}
foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
// we need to know if $unmergedRow will be merged or inserted into $rows
- if (isset($rows[$unmergedRowKey]) && is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) {
+ if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) {
foreach ($unmergedRow as $cellKey => $cell) {
// insert cell into row at cellKey position
- array_splice($rows[$unmergedRowKey], $cellKey, 0, array($cell));
+ array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]);
}
} else {
$row = $this->copyRow($rows, $unmergedRowKey - 1);
@@ -497,7 +681,7 @@ class Table
$row[$column] = $unmergedRow[$column];
}
}
- array_splice($rows, $unmergedRowKey, 0, array($row));
+ array_splice($rows, $unmergedRowKey, 0, [$row]);
}
}
@@ -506,14 +690,11 @@ class Table
/**
* fill cells for a row that contains colspan > 1.
- *
- * @param array $row
- *
- * @return array
*/
- private function fillCells($row)
+ private function fillCells(iterable $row)
{
- $newRow = array();
+ $newRow = [];
+
foreach ($row as $column => $cell) {
$newRow[] = $cell;
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
@@ -527,19 +708,13 @@ class Table
return $newRow ?: $row;
}
- /**
- * @param array $rows
- * @param int $line
- *
- * @return array
- */
- private function copyRow($rows, $line)
+ private function copyRow(array $rows, int $line): array
{
$row = $rows[$line];
foreach ($row as $cellKey => $cellValue) {
$row[$cellKey] = '';
if ($cellValue instanceof TableCell) {
- $row[$cellKey] = new TableCell('', array('colspan' => $cellValue->getColspan()));
+ $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]);
}
}
@@ -548,14 +723,10 @@ class Table
/**
* Gets number of columns by row.
- *
- * @param array $row
- *
- * @return int
*/
- private function getNumberOfColumns(array $row)
+ private function getNumberOfColumns(array $row): int
{
- $columns = count($row);
+ $columns = \count($row);
foreach ($row as $column) {
$columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0;
}
@@ -565,12 +736,8 @@ class Table
/**
* Gets list of columns for the given row.
- *
- * @param array $row
- *
- * @return array
*/
- private function getRowColumns($row)
+ private function getRowColumns(array $row): array
{
$columns = range(0, $this->numberOfColumns - 1);
foreach ($row as $cellKey => $cell) {
@@ -585,56 +752,44 @@ class Table
/**
* Calculates columns widths.
- *
- * @param array $rows
*/
- private function calculateColumnsWidth($rows)
+ private function calculateColumnsWidth(iterable $groups)
{
for ($column = 0; $column < $this->numberOfColumns; ++$column) {
- $lengths = array();
- foreach ($rows as $row) {
- if ($row instanceof TableSeparator) {
- continue;
- }
+ $lengths = [];
+ foreach ($groups as $group) {
+ foreach ($group as $row) {
+ if ($row instanceof TableSeparator) {
+ continue;
+ }
- foreach ($row as $i => $cell) {
- if ($cell instanceof TableCell) {
- $textLength = strlen($cell);
- if ($textLength > 0) {
- $contentColumns = str_split($cell, ceil($textLength / $cell->getColspan()));
- foreach ($contentColumns as $position => $content) {
- $row[$i + $position] = $content;
+ foreach ($row as $i => $cell) {
+ if ($cell instanceof TableCell) {
+ $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell);
+ $textLength = Helper::strlen($textContent);
+ if ($textLength > 0) {
+ $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan()));
+ foreach ($contentColumns as $position => $content) {
+ $row[$i + $position] = $content;
+ }
}
}
}
- }
- $lengths[] = $this->getCellWidth($row, $column);
+ $lengths[] = $this->getCellWidth($row, $column);
+ }
}
- $this->effectiveColumnWidths[$column] = max($lengths) + strlen($this->style->getCellRowContentFormat()) - 2;
+ $this->effectiveColumnWidths[$column] = max($lengths) + Helper::strlen($this->style->getCellRowContentFormat()) - 2;
}
}
- /**
- * Gets column width.
- *
- * @return int
- */
- private function getColumnSeparatorWidth()
+ private function getColumnSeparatorWidth(): int
{
- return strlen(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()));
+ return Helper::strlen(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3]));
}
- /**
- * Gets cell width.
- *
- * @param array $row
- * @param int $column
- *
- * @return int
- */
- private function getCellWidth(array $row, $column)
+ private function getCellWidth(array $row, int $column): int
{
$cellWidth = 0;
@@ -643,9 +798,10 @@ class Table
$cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
}
- $columnWidth = isset($this->columnWidths[$column]) ? $this->columnWidths[$column] : 0;
+ $columnWidth = $this->columnWidths[$column] ?? 0;
+ $cellWidth = max($cellWidth, $columnWidth);
- return max($cellWidth, $columnWidth);
+ return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth;
}
/**
@@ -653,44 +809,58 @@ class Table
*/
private function cleanup()
{
- $this->effectiveColumnWidths = array();
+ $this->effectiveColumnWidths = [];
$this->numberOfColumns = null;
}
- private static function initStyles()
+ private static function initStyles(): array
{
$borderless = new TableStyle();
$borderless
- ->setHorizontalBorderChar('=')
- ->setVerticalBorderChar(' ')
- ->setCrossingChar(' ')
+ ->setHorizontalBorderChars('=')
+ ->setVerticalBorderChars(' ')
+ ->setDefaultCrossingChar(' ')
;
$compact = new TableStyle();
$compact
- ->setHorizontalBorderChar('')
- ->setVerticalBorderChar(' ')
- ->setCrossingChar('')
- ->setCellRowContentFormat('%s')
+ ->setHorizontalBorderChars('')
+ ->setVerticalBorderChars('')
+ ->setDefaultCrossingChar('')
+ ->setCellRowContentFormat('%s ')
;
$styleGuide = new TableStyle();
$styleGuide
- ->setHorizontalBorderChar('-')
- ->setVerticalBorderChar(' ')
- ->setCrossingChar(' ')
+ ->setHorizontalBorderChars('-')
+ ->setVerticalBorderChars(' ')
+ ->setDefaultCrossingChar(' ')
->setCellHeaderFormat('%s')
;
- return array(
+ $box = (new TableStyle())
+ ->setHorizontalBorderChars('─')
+ ->setVerticalBorderChars('│')
+ ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├')
+ ;
+
+ $boxDouble = (new TableStyle())
+ ->setHorizontalBorderChars('═', '─')
+ ->setVerticalBorderChars('║', '│')
+ ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣')
+ ;
+
+ return [
'default' => new TableStyle(),
'borderless' => $borderless,
'compact' => $compact,
'symfony-style-guide' => $styleGuide,
- );
+ 'box' => $box,
+ 'box-double' => $boxDouble,
+ ];
}
- private function resolveStyle($name)
+ private function resolveStyle($name): TableStyle
{
if ($name instanceof TableStyle) {
return $name;
diff --git a/vendor/symfony/console/Helper/TableCell.php b/vendor/symfony/console/Helper/TableCell.php
index 69442d4..5b6af4a 100644
--- a/vendor/symfony/console/Helper/TableCell.php
+++ b/vendor/symfony/console/Helper/TableCell.php
@@ -18,24 +18,13 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
*/
class TableCell
{
- /**
- * @var string
- */
private $value;
-
- /**
- * @var array
- */
- private $options = array(
+ private $options = [
'rowspan' => 1,
'colspan' => 1,
- );
+ ];
- /**
- * @param string $value
- * @param array $options
- */
- public function __construct($value = '', array $options = array())
+ public function __construct(string $value = '', array $options = [])
{
$this->value = $value;
diff --git a/vendor/symfony/console/Helper/TableRows.php b/vendor/symfony/console/Helper/TableRows.php
new file mode 100644
index 0000000..16aabb3
--- /dev/null
+++ b/vendor/symfony/console/Helper/TableRows.php
@@ -0,0 +1,32 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+/**
+ * @internal
+ */
+class TableRows implements \IteratorAggregate
+{
+ private $generator;
+
+ public function __construct(callable $generator)
+ {
+ $this->generator = $generator;
+ }
+
+ public function getIterator(): \Traversable
+ {
+ $g = $this->generator;
+
+ return $g();
+ }
+}
diff --git a/vendor/symfony/console/Helper/TableSeparator.php b/vendor/symfony/console/Helper/TableSeparator.php
index 8cc73e6..e541c53 100644
--- a/vendor/symfony/console/Helper/TableSeparator.php
+++ b/vendor/symfony/console/Helper/TableSeparator.php
@@ -18,10 +18,7 @@ namespace Symfony\Component\Console\Helper;
*/
class TableSeparator extends TableCell
{
- /**
- * @param array $options
- */
- public function __construct(array $options = array())
+ public function __construct(array $options = [])
{
parent::__construct('', $options);
}
diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php
index d7e28ff..a8df59b 100644
--- a/vendor/symfony/console/Helper/TableStyle.php
+++ b/vendor/symfony/console/Helper/TableStyle.php
@@ -19,30 +19,46 @@ use Symfony\Component\Console\Exception\LogicException;
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Саша Стаменковић <umpirsky@gmail.com>
+ * @author Dany Maillard <danymaillard93b@gmail.com>
*/
class TableStyle
{
private $paddingChar = ' ';
- private $horizontalBorderChar = '-';
- private $verticalBorderChar = '|';
+ private $horizontalOutsideBorderChar = '-';
+ private $horizontalInsideBorderChar = '-';
+ private $verticalOutsideBorderChar = '|';
+ private $verticalInsideBorderChar = '|';
private $crossingChar = '+';
+ private $crossingTopRightChar = '+';
+ private $crossingTopMidChar = '+';
+ private $crossingTopLeftChar = '+';
+ private $crossingMidRightChar = '+';
+ private $crossingBottomRightChar = '+';
+ private $crossingBottomMidChar = '+';
+ private $crossingBottomLeftChar = '+';
+ private $crossingMidLeftChar = '+';
+ private $crossingTopLeftBottomChar = '+';
+ private $crossingTopMidBottomChar = '+';
+ private $crossingTopRightBottomChar = '+';
+ private $headerTitleFormat = '<fg=black;bg=white;options=bold> %s </>';
+ private $footerTitleFormat = '<fg=black;bg=white;options=bold> %s </>';
private $cellHeaderFormat = '<info>%s</info>';
private $cellRowFormat = '%s';
private $cellRowContentFormat = ' %s ';
private $borderFormat = '%s';
- private $padType = STR_PAD_RIGHT;
+ private $padType = \STR_PAD_RIGHT;
/**
* Sets padding character, used for cell padding.
*
* @param string $paddingChar
*
- * @return TableStyle
+ * @return $this
*/
public function setPaddingChar($paddingChar)
{
if (!$paddingChar) {
- throw new LogicException('The padding char must not be empty');
+ throw new LogicException('The padding char must not be empty.');
}
$this->paddingChar = $paddingChar;
@@ -61,27 +77,84 @@ class TableStyle
}
/**
+ * Sets horizontal border characters.
+ *
+ * <code>
+ * ╔═══════════════╤══════════════════════════╤══════════════════╗
+ * 1 ISBN 2 Title │ Author ║
+ * ╠═══════════════╪══════════════════════════╪══════════════════╣
+ * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║
+ * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║
+ * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║
+ * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║
+ * ╚═══════════════╧══════════════════════════╧══════════════════╝
+ * </code>
+ *
+ * @param string $outside Outside border char (see #1 of example)
+ * @param string|null $inside Inside border char (see #2 of example), equals $outside if null
+ */
+ public function setHorizontalBorderChars(string $outside, string $inside = null): self
+ {
+ $this->horizontalOutsideBorderChar = $outside;
+ $this->horizontalInsideBorderChar = $inside ?? $outside;
+
+ return $this;
+ }
+
+ /**
* Sets horizontal border character.
*
* @param string $horizontalBorderChar
*
- * @return TableStyle
+ * @return $this
+ *
+ * @deprecated since Symfony 4.1, use {@link setHorizontalBorderChars()} instead.
*/
public function setHorizontalBorderChar($horizontalBorderChar)
{
- $this->horizontalBorderChar = $horizontalBorderChar;
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
- return $this;
+ return $this->setHorizontalBorderChars($horizontalBorderChar, $horizontalBorderChar);
}
/**
* Gets horizontal border character.
*
* @return string
+ *
+ * @deprecated since Symfony 4.1, use {@link getBorderChars()} instead.
*/
public function getHorizontalBorderChar()
{
- return $this->horizontalBorderChar;
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
+
+ return $this->horizontalOutsideBorderChar;
+ }
+
+ /**
+ * Sets vertical border characters.
+ *
+ * <code>
+ * ╔═══════════════╤══════════════════════════╤══════════════════╗
+ * ║ ISBN │ Title │ Author ║
+ * ╠═══════1═══════╪══════════════════════════╪══════════════════╣
+ * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║
+ * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║
+ * ╟───────2───────┼──────────────────────────┼──────────────────╢
+ * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║
+ * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║
+ * ╚═══════════════╧══════════════════════════╧══════════════════╝
+ * </code>
+ *
+ * @param string $outside Outside border char (see #1 of example)
+ * @param string|null $inside Inside border char (see #2 of example), equals $outside if null
+ */
+ public function setVerticalBorderChars(string $outside, string $inside = null): self
+ {
+ $this->verticalOutsideBorderChar = $outside;
+ $this->verticalInsideBorderChar = $inside ?? $outside;
+
+ return $this;
}
/**
@@ -89,23 +162,101 @@ class TableStyle
*
* @param string $verticalBorderChar
*
- * @return TableStyle
+ * @return $this
+ *
+ * @deprecated since Symfony 4.1, use {@link setVerticalBorderChars()} instead.
*/
public function setVerticalBorderChar($verticalBorderChar)
{
- $this->verticalBorderChar = $verticalBorderChar;
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
- return $this;
+ return $this->setVerticalBorderChars($verticalBorderChar, $verticalBorderChar);
}
/**
* Gets vertical border character.
*
* @return string
+ *
+ * @deprecated since Symfony 4.1, use {@link getBorderChars()} instead.
*/
public function getVerticalBorderChar()
{
- return $this->verticalBorderChar;
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
+
+ return $this->verticalOutsideBorderChar;
+ }
+
+ /**
+ * Gets border characters.
+ *
+ * @internal
+ */
+ public function getBorderChars(): array
+ {
+ return [
+ $this->horizontalOutsideBorderChar,
+ $this->verticalOutsideBorderChar,
+ $this->horizontalInsideBorderChar,
+ $this->verticalInsideBorderChar,
+ ];
+ }
+
+ /**
+ * Sets crossing characters.
+ *
+ * Example:
+ * <code>
+ * 1═══════════════2══════════════════════════2══════════════════3
+ * ║ ISBN │ Title │ Author ║
+ * 8'══════════════0'═════════════════════════0'═════════════════4'
+ * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║
+ * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║
+ * 8───────────────0──────────────────────────0──────────────────4
+ * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║
+ * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║
+ * 7═══════════════6══════════════════════════6══════════════════5
+ * </code>
+ *
+ * @param string $cross Crossing char (see #0 of example)
+ * @param string $topLeft Top left char (see #1 of example)
+ * @param string $topMid Top mid char (see #2 of example)
+ * @param string $topRight Top right char (see #3 of example)
+ * @param string $midRight Mid right char (see #4 of example)
+ * @param string $bottomRight Bottom right char (see #5 of example)
+ * @param string $bottomMid Bottom mid char (see #6 of example)
+ * @param string $bottomLeft Bottom left char (see #7 of example)
+ * @param string $midLeft Mid left char (see #8 of example)
+ * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null
+ * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null
+ * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null
+ */
+ public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): self
+ {
+ $this->crossingChar = $cross;
+ $this->crossingTopLeftChar = $topLeft;
+ $this->crossingTopMidChar = $topMid;
+ $this->crossingTopRightChar = $topRight;
+ $this->crossingMidRightChar = $midRight;
+ $this->crossingBottomRightChar = $bottomRight;
+ $this->crossingBottomMidChar = $bottomMid;
+ $this->crossingBottomLeftChar = $bottomLeft;
+ $this->crossingMidLeftChar = $midLeft;
+ $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft;
+ $this->crossingTopMidBottomChar = $topMidBottom ?? $cross;
+ $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight;
+
+ return $this;
+ }
+
+ /**
+ * Sets default crossing character used for each cross.
+ *
+ * @see {@link setCrossingChars()} for setting each crossing individually.
+ */
+ public function setDefaultCrossingChar(string $char): self
+ {
+ return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char);
}
/**
@@ -113,19 +264,21 @@ class TableStyle
*
* @param string $crossingChar
*
- * @return TableStyle
+ * @return $this
+ *
+ * @deprecated since Symfony 4.1. Use {@link setDefaultCrossingChar()} instead.
*/
public function setCrossingChar($crossingChar)
{
- $this->crossingChar = $crossingChar;
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), \E_USER_DEPRECATED);
- return $this;
+ return $this->setDefaultCrossingChar($crossingChar);
}
/**
* Gets crossing character.
*
- * @return string $crossingChar
+ * @return string
*/
public function getCrossingChar()
{
@@ -133,11 +286,34 @@ class TableStyle
}
/**
+ * Gets crossing characters.
+ *
+ * @internal
+ */
+ public function getCrossingChars(): array
+ {
+ return [
+ $this->crossingChar,
+ $this->crossingTopLeftChar,
+ $this->crossingTopMidChar,
+ $this->crossingTopRightChar,
+ $this->crossingMidRightChar,
+ $this->crossingBottomRightChar,
+ $this->crossingBottomMidChar,
+ $this->crossingBottomLeftChar,
+ $this->crossingMidLeftChar,
+ $this->crossingTopLeftBottomChar,
+ $this->crossingTopMidBottomChar,
+ $this->crossingTopRightBottomChar,
+ ];
+ }
+
+ /**
* Sets header cell format.
*
* @param string $cellHeaderFormat
*
- * @return TableStyle
+ * @return $this
*/
public function setCellHeaderFormat($cellHeaderFormat)
{
@@ -161,7 +337,7 @@ class TableStyle
*
* @param string $cellRowFormat
*
- * @return TableStyle
+ * @return $this
*/
public function setCellRowFormat($cellRowFormat)
{
@@ -185,7 +361,7 @@ class TableStyle
*
* @param string $cellRowContentFormat
*
- * @return TableStyle
+ * @return $this
*/
public function setCellRowContentFormat($cellRowContentFormat)
{
@@ -209,7 +385,7 @@ class TableStyle
*
* @param string $borderFormat
*
- * @return TableStyle
+ * @return $this
*/
public function setBorderFormat($borderFormat)
{
@@ -233,11 +409,11 @@ class TableStyle
*
* @param int $padType STR_PAD_*
*
- * @return TableStyle
+ * @return $this
*/
public function setPadType($padType)
{
- if (!in_array($padType, array(STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH), true)) {
+ if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) {
throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
}
@@ -255,4 +431,28 @@ class TableStyle
{
return $this->padType;
}
+
+ public function getHeaderTitleFormat(): string
+ {
+ return $this->headerTitleFormat;
+ }
+
+ public function setHeaderTitleFormat(string $format): self
+ {
+ $this->headerTitleFormat = $format;
+
+ return $this;
+ }
+
+ public function getFooterTitleFormat(): string
+ {
+ return $this->footerTitleFormat;
+ }
+
+ public function setFooterTitleFormat(string $format): self
+ {
+ $this->footerTitleFormat = $format;
+
+ return $this;
+ }
}
diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php
index f626c33..63f40f2 100644
--- a/vendor/symfony/console/Input/ArgvInput.php
+++ b/vendor/symfony/console/Input/ArgvInput.php
@@ -44,16 +44,11 @@ class ArgvInput extends Input
private $parsed;
/**
- * Constructor.
- *
- * @param array|null $argv An array of parameters from the CLI (in the argv format)
- * @param InputDefinition|null $definition A InputDefinition instance
+ * @param array|null $argv An array of parameters from the CLI (in the argv format)
*/
public function __construct(array $argv = null, InputDefinition $definition = null)
{
- if (null === $argv) {
- $argv = $_SERVER['argv'];
- }
+ $argv = $argv ?? $_SERVER['argv'] ?? [];
// strip the application name
array_shift($argv);
@@ -80,7 +75,7 @@ class ArgvInput extends Input
$this->parseArgument($token);
} elseif ($parseOptions && '--' == $token) {
$parseOptions = false;
- } elseif ($parseOptions && 0 === strpos($token, '--')) {
+ } elseif ($parseOptions && str_starts_with($token, '--')) {
$this->parseLongOption($token);
} elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
$this->parseShortOption($token);
@@ -92,14 +87,12 @@ class ArgvInput extends Input
/**
* Parses a short option.
- *
- * @param string $token The current token
*/
- private function parseShortOption($token)
+ private function parseShortOption(string $token)
{
$name = substr($token, 1);
- if (strlen($name) > 1) {
+ if (\strlen($name) > 1) {
if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) {
// an option with a value (with no space)
$this->addShortOption($name[0], substr($name, 1));
@@ -114,16 +107,15 @@ class ArgvInput extends Input
/**
* Parses a short option set.
*
- * @param string $name The current token
- *
* @throws RuntimeException When option given doesn't exist
*/
- private function parseShortOptionSet($name)
+ private function parseShortOptionSet(string $name)
{
- $len = strlen($name);
+ $len = \strlen($name);
for ($i = 0; $i < $len; ++$i) {
if (!$this->definition->hasShortcut($name[$i])) {
- throw new RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i]));
+ $encoding = mb_detect_encoding($name, null, true);
+ throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding)));
}
$option = $this->definition->getOptionForShortcut($name[$i]);
@@ -139,16 +131,14 @@ class ArgvInput extends Input
/**
* Parses a long option.
- *
- * @param string $token The current token
*/
- private function parseLongOption($token)
+ private function parseLongOption(string $token)
{
$name = substr($token, 2);
if (false !== $pos = strpos($name, '=')) {
- if (0 === strlen($value = substr($name, $pos + 1))) {
- array_unshift($this->parsed, null);
+ if ('' === $value = substr($name, $pos + 1)) {
+ array_unshift($this->parsed, $value);
}
$this->addLongOption(substr($name, 0, $pos), $value);
} else {
@@ -159,18 +149,16 @@ class ArgvInput extends Input
/**
* Parses an argument.
*
- * @param string $token The current token
- *
* @throws RuntimeException When too many arguments are given
*/
- private function parseArgument($token)
+ private function parseArgument(string $token)
{
- $c = count($this->arguments);
+ $c = \count($this->arguments);
// if input is expecting another argument, add it
if ($this->definition->hasArgument($c)) {
$arg = $this->definition->getArgument($c);
- $this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token;
+ $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token;
// if last argument isArray(), append token to last argument
} elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
@@ -180,7 +168,7 @@ class ArgvInput extends Input
// unexpected argument
} else {
$all = $this->definition->getArguments();
- if (count($all)) {
+ if (\count($all)) {
throw new RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))));
}
@@ -191,12 +179,9 @@ class ArgvInput extends Input
/**
* Adds a short option value.
*
- * @param string $shortcut The short option key
- * @param mixed $value The value for the option
- *
* @throws RuntimeException When option given doesn't exist
*/
- private function addShortOption($shortcut, $value)
+ private function addShortOption(string $shortcut, $value)
{
if (!$this->definition->hasShortcut($shortcut)) {
throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut));
@@ -208,12 +193,9 @@ class ArgvInput extends Input
/**
* Adds a long option value.
*
- * @param string $name The long option key
- * @param mixed $value The value for the option
- *
* @throws RuntimeException When option given doesn't exist
*/
- private function addLongOption($name, $value)
+ private function addLongOption(string $name, $value)
{
if (!$this->definition->hasOption($name)) {
throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name));
@@ -221,23 +203,16 @@ class ArgvInput extends Input
$option = $this->definition->getOption($name);
- // Convert empty values to null
- if (!isset($value[0])) {
- $value = null;
- }
-
if (null !== $value && !$option->acceptValue()) {
throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name));
}
- if (null === $value && $option->acceptValue() && count($this->parsed)) {
+ if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) {
// if option accepts an optional or mandatory argument
// let's see if there is one provided
$next = array_shift($this->parsed);
- if (isset($next[0]) && '-' !== $next[0]) {
+ if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) {
$value = $next;
- } elseif (empty($next)) {
- $value = null;
} else {
array_unshift($this->parsed, $next);
}
@@ -248,8 +223,8 @@ class ArgvInput extends Input
throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name));
}
- if (!$option->isArray()) {
- $value = $option->isValueOptional() ? $option->getDefault() : true;
+ if (!$option->isArray() && !$option->isValueOptional()) {
+ $value = true;
}
}
@@ -265,13 +240,34 @@ class ArgvInput extends Input
*/
public function getFirstArgument()
{
- foreach ($this->tokens as $token) {
+ $isOption = false;
+ foreach ($this->tokens as $i => $token) {
if ($token && '-' === $token[0]) {
+ if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) {
+ continue;
+ }
+
+ // If it's a long option, consider that everything after "--" is the option name.
+ // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator)
+ $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1);
+ if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) {
+ // noop
+ } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) {
+ $isOption = true;
+ }
+
+ continue;
+ }
+
+ if ($isOption) {
+ $isOption = false;
continue;
}
return $token;
}
+
+ return null;
}
/**
@@ -282,11 +278,15 @@ class ArgvInput extends Input
$values = (array) $values;
foreach ($this->tokens as $token) {
- if ($onlyParams && $token === '--') {
+ if ($onlyParams && '--' === $token) {
return false;
}
foreach ($values as $value) {
- if ($token === $value || 0 === strpos($token, $value.'=')) {
+ // Options with values:
+ // For long options, test for '--option=' at beginning
+ // For short options, test for '-o' at beginning
+ $leading = str_starts_with($value, '--') ? $value.'=' : $value;
+ if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) {
return true;
}
}
@@ -303,20 +303,23 @@ class ArgvInput extends Input
$values = (array) $values;
$tokens = $this->tokens;
- while (0 < count($tokens)) {
+ while (0 < \count($tokens)) {
$token = array_shift($tokens);
- if ($onlyParams && $token === '--') {
- return false;
+ if ($onlyParams && '--' === $token) {
+ return $default;
}
foreach ($values as $value) {
- if ($token === $value || 0 === strpos($token, $value.'=')) {
- if (false !== $pos = strpos($token, '=')) {
- return substr($token, $pos + 1);
- }
-
+ if ($token === $value) {
return array_shift($tokens);
}
+ // Options with values:
+ // For long options, test for '--option=' at beginning
+ // For short options, test for '-o' at beginning
+ $leading = str_starts_with($value, '--') ? $value.'=' : $value;
+ if ('' !== $leading && str_starts_with($token, $leading)) {
+ return substr($token, \strlen($leading));
+ }
}
}
@@ -335,7 +338,7 @@ class ArgvInput extends Input
return $match[1].$this->escapeToken($match[2]);
}
- if ($token && $token[0] !== '-') {
+ if ($token && '-' !== $token[0]) {
return $this->escapeToken($token);
}
diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php
index a44b6b2..30bd205 100644
--- a/vendor/symfony/console/Input/ArrayInput.php
+++ b/vendor/symfony/console/Input/ArrayInput.php
@@ -19,7 +19,7 @@ use Symfony\Component\Console\Exception\InvalidOptionException;
*
* Usage:
*
- * $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar'));
+ * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']);
*
* @author Fabien Potencier <fabien@symfony.com>
*/
@@ -27,12 +27,6 @@ class ArrayInput extends Input
{
private $parameters;
- /**
- * Constructor.
- *
- * @param array $parameters An array of parameters
- * @param InputDefinition|null $definition A InputDefinition instance
- */
public function __construct(array $parameters, InputDefinition $definition = null)
{
$this->parameters = $parameters;
@@ -45,13 +39,15 @@ class ArrayInput extends Input
*/
public function getFirstArgument()
{
- foreach ($this->parameters as $key => $value) {
- if ($key && '-' === $key[0]) {
+ foreach ($this->parameters as $param => $value) {
+ if ($param && \is_string($param) && '-' === $param[0]) {
continue;
}
return $value;
}
+
+ return null;
}
/**
@@ -62,15 +58,15 @@ class ArrayInput extends Input
$values = (array) $values;
foreach ($this->parameters as $k => $v) {
- if (!is_int($k)) {
+ if (!\is_int($k)) {
$v = $k;
}
- if ($onlyParams && $v === '--') {
+ if ($onlyParams && '--' === $v) {
return false;
}
- if (in_array($v, $values)) {
+ if (\in_array($v, $values)) {
return true;
}
}
@@ -86,15 +82,15 @@ class ArrayInput extends Input
$values = (array) $values;
foreach ($this->parameters as $k => $v) {
- if ($onlyParams && ($k === '--' || (is_int($k) && $v === '--'))) {
- return false;
+ if ($onlyParams && ('--' === $k || (\is_int($k) && '--' === $v))) {
+ return $default;
}
- if (is_int($k)) {
- if (in_array($v, $values)) {
+ if (\is_int($k)) {
+ if (\in_array($v, $values)) {
return true;
}
- } elseif (in_array($k, $values)) {
+ } elseif (\in_array($k, $values)) {
return $v;
}
}
@@ -109,12 +105,19 @@ class ArrayInput extends Input
*/
public function __toString()
{
- $params = array();
+ $params = [];
foreach ($this->parameters as $param => $val) {
- if ($param && '-' === $param[0]) {
- $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : '');
+ if ($param && \is_string($param) && '-' === $param[0]) {
+ $glue = ('-' === $param[1]) ? '=' : ' ';
+ if (\is_array($val)) {
+ foreach ($val as $v) {
+ $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : '');
+ }
+ } else {
+ $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : '');
+ }
} else {
- $params[] = $this->escapeToken($val);
+ $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val);
}
}
@@ -127,12 +130,12 @@ class ArrayInput extends Input
protected function parse()
{
foreach ($this->parameters as $key => $value) {
- if ($key === '--') {
+ if ('--' === $key) {
return;
}
- if (0 === strpos($key, '--')) {
+ if (str_starts_with($key, '--')) {
$this->addLongOption(substr($key, 2), $value);
- } elseif ('-' === $key[0]) {
+ } elseif (str_starts_with($key, '-')) {
$this->addShortOption(substr($key, 1), $value);
} else {
$this->addArgument($key, $value);
@@ -143,12 +146,9 @@ class ArrayInput extends Input
/**
* Adds a short option value.
*
- * @param string $shortcut The short option key
- * @param mixed $value The value for the option
- *
* @throws InvalidOptionException When option given doesn't exist
*/
- private function addShortOption($shortcut, $value)
+ private function addShortOption(string $shortcut, $value)
{
if (!$this->definition->hasShortcut($shortcut)) {
throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut));
@@ -160,13 +160,10 @@ class ArrayInput extends Input
/**
* Adds a long option value.
*
- * @param string $name The long option key
- * @param mixed $value The value for the option
- *
* @throws InvalidOptionException When option given doesn't exist
* @throws InvalidOptionException When a required value is missing
*/
- private function addLongOption($name, $value)
+ private function addLongOption(string $name, $value)
{
if (!$this->definition->hasOption($name)) {
throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name));
@@ -179,7 +176,9 @@ class ArrayInput extends Input
throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name));
}
- $value = $option->isValueOptional() ? $option->getDefault() : true;
+ if (!$option->isValueOptional()) {
+ $value = true;
+ }
}
$this->options[$name] = $value;
@@ -188,8 +187,8 @@ class ArrayInput extends Input
/**
* Adds an argument value.
*
- * @param string $name The argument name
- * @param mixed $value The value for the argument
+ * @param string|int $name The argument name
+ * @param mixed $value The value for the argument
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
diff --git a/vendor/symfony/console/Input/Input.php b/vendor/symfony/console/Input/Input.php
index 817292e..d7f2907 100644
--- a/vendor/symfony/console/Input/Input.php
+++ b/vendor/symfony/console/Input/Input.php
@@ -25,21 +25,14 @@ use Symfony\Component\Console\Exception\RuntimeException;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
-abstract class Input implements InputInterface
+abstract class Input implements InputInterface, StreamableInputInterface
{
- /**
- * @var InputDefinition
- */
protected $definition;
- protected $options = array();
- protected $arguments = array();
+ protected $stream;
+ protected $options = [];
+ protected $arguments = [];
protected $interactive = true;
- /**
- * Constructor.
- *
- * @param InputDefinition|null $definition A InputDefinition instance
- */
public function __construct(InputDefinition $definition = null)
{
if (null === $definition) {
@@ -55,8 +48,8 @@ abstract class Input implements InputInterface
*/
public function bind(InputDefinition $definition)
{
- $this->arguments = array();
- $this->options = array();
+ $this->arguments = [];
+ $this->options = [];
$this->definition = $definition;
$this->parse();
@@ -76,10 +69,10 @@ abstract class Input implements InputInterface
$givenArguments = $this->arguments;
$missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) {
- return !array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired();
+ return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired();
});
- if (count($missingArguments) > 0) {
+ if (\count($missingArguments) > 0) {
throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments)));
}
}
@@ -113,11 +106,11 @@ abstract class Input implements InputInterface
*/
public function getArgument($name)
{
- if (!$this->definition->hasArgument($name)) {
+ if (!$this->definition->hasArgument((string) $name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
- return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault();
+ return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault();
}
/**
@@ -125,7 +118,7 @@ abstract class Input implements InputInterface
*/
public function setArgument($name, $value)
{
- if (!$this->definition->hasArgument($name)) {
+ if (!$this->definition->hasArgument((string) $name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
@@ -137,7 +130,7 @@ abstract class Input implements InputInterface
*/
public function hasArgument($name)
{
- return $this->definition->hasArgument($name);
+ return $this->definition->hasArgument((string) $name);
}
/**
@@ -157,7 +150,7 @@ abstract class Input implements InputInterface
throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
}
- return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
+ return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
}
/**
@@ -191,4 +184,20 @@ abstract class Input implements InputInterface
{
return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token);
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setStream($stream)
+ {
+ $this->stream = $stream;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getStream()
+ {
+ return $this->stream;
+ }
}
diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php
index 048ee4f..accd4d0 100644
--- a/vendor/symfony/console/Input/InputArgument.php
+++ b/vendor/symfony/console/Input/InputArgument.php
@@ -21,9 +21,9 @@ use Symfony\Component\Console\Exception\LogicException;
*/
class InputArgument
{
- const REQUIRED = 1;
- const OPTIONAL = 2;
- const IS_ARRAY = 4;
+ public const REQUIRED = 1;
+ public const OPTIONAL = 2;
+ public const IS_ARRAY = 4;
private $name;
private $mode;
@@ -31,20 +31,18 @@ class InputArgument
private $description;
/**
- * Constructor.
- *
- * @param string $name The argument name
- * @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
- * @param string $description A description text
- * @param mixed $default The default value (for self::OPTIONAL mode only)
+ * @param string $name The argument name
+ * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
+ * @param string $description A description text
+ * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only)
*
* @throws InvalidArgumentException When argument mode is not valid
*/
- public function __construct($name, $mode = null, $description = '', $default = null)
+ public function __construct(string $name, int $mode = null, string $description = '', $default = null)
{
if (null === $mode) {
$mode = self::OPTIONAL;
- } elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
+ } elseif ($mode > 7 || $mode < 1) {
throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
}
@@ -88,20 +86,20 @@ class InputArgument
/**
* Sets the default value.
*
- * @param mixed $default The default value
+ * @param string|bool|int|float|array|null $default
*
* @throws LogicException When incorrect default value is given
*/
public function setDefault($default = null)
{
- if (self::REQUIRED === $this->mode && null !== $default) {
+ if ($this->isRequired() && null !== $default) {
throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.');
}
if ($this->isArray()) {
if (null === $default) {
- $default = array();
- } elseif (!is_array($default)) {
+ $default = [];
+ } elseif (!\is_array($default)) {
throw new LogicException('A default value for an array argument must be an array.');
}
}
@@ -112,7 +110,7 @@ class InputArgument
/**
* Returns the default value.
*
- * @return mixed The default value
+ * @return string|bool|int|float|array|null
*/
public function getDefault()
{
diff --git a/vendor/symfony/console/Input/InputAwareInterface.php b/vendor/symfony/console/Input/InputAwareInterface.php
index d0f11e9..5a288de 100644
--- a/vendor/symfony/console/Input/InputAwareInterface.php
+++ b/vendor/symfony/console/Input/InputAwareInterface.php
@@ -21,8 +21,6 @@ interface InputAwareInterface
{
/**
* Sets the Console Input.
- *
- * @param InputInterface
*/
public function setInput(InputInterface $input);
}
diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php
index 85b778b..e2cd6d7 100644
--- a/vendor/symfony/console/Input/InputDefinition.php
+++ b/vendor/symfony/console/Input/InputDefinition.php
@@ -19,10 +19,10 @@ use Symfony\Component\Console\Exception\LogicException;
*
* Usage:
*
- * $definition = new InputDefinition(array(
- * new InputArgument('name', InputArgument::REQUIRED),
- * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
- * ));
+ * $definition = new InputDefinition([
+ * new InputArgument('name', InputArgument::REQUIRED),
+ * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
+ * ]);
*
* @author Fabien Potencier <fabien@symfony.com>
*/
@@ -36,24 +36,20 @@ class InputDefinition
private $shortcuts;
/**
- * Constructor.
- *
* @param array $definition An array of InputArgument and InputOption instance
*/
- public function __construct(array $definition = array())
+ public function __construct(array $definition = [])
{
$this->setDefinition($definition);
}
/**
* Sets the definition of the input.
- *
- * @param array $definition The definition array
*/
public function setDefinition(array $definition)
{
- $arguments = array();
- $options = array();
+ $arguments = [];
+ $options = [];
foreach ($definition as $item) {
if ($item instanceof InputOption) {
$options[] = $item;
@@ -71,9 +67,9 @@ class InputDefinition
*
* @param InputArgument[] $arguments An array of InputArgument objects
*/
- public function setArguments($arguments = array())
+ public function setArguments($arguments = [])
{
- $this->arguments = array();
+ $this->arguments = [];
$this->requiredCount = 0;
$this->hasOptional = false;
$this->hasAnArrayArgument = false;
@@ -85,7 +81,7 @@ class InputDefinition
*
* @param InputArgument[] $arguments An array of InputArgument objects
*/
- public function addArguments($arguments = array())
+ public function addArguments($arguments = [])
{
if (null !== $arguments) {
foreach ($arguments as $argument) {
@@ -95,10 +91,6 @@ class InputDefinition
}
/**
- * Adds an InputArgument object.
- *
- * @param InputArgument $argument An InputArgument object
- *
* @throws LogicException When incorrect argument is given
*/
public function addArgument(InputArgument $argument)
@@ -143,7 +135,7 @@ class InputDefinition
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
- $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
+ $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments;
return $arguments[$name];
}
@@ -157,7 +149,7 @@ class InputDefinition
*/
public function hasArgument($name)
{
- $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments;
+ $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments;
return isset($arguments[$name]);
}
@@ -179,7 +171,7 @@ class InputDefinition
*/
public function getArgumentCount()
{
- return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments);
+ return $this->hasAnArrayArgument ? \PHP_INT_MAX : \count($this->arguments);
}
/**
@@ -193,13 +185,11 @@ class InputDefinition
}
/**
- * Gets the default values.
- *
- * @return array An array of default values
+ * @return array<string|bool|int|float|array|null>
*/
public function getArgumentDefaults()
{
- $values = array();
+ $values = [];
foreach ($this->arguments as $argument) {
$values[$argument->getName()] = $argument->getDefault();
}
@@ -212,10 +202,10 @@ class InputDefinition
*
* @param InputOption[] $options An array of InputOption objects
*/
- public function setOptions($options = array())
+ public function setOptions($options = [])
{
- $this->options = array();
- $this->shortcuts = array();
+ $this->options = [];
+ $this->shortcuts = [];
$this->addOptions($options);
}
@@ -224,7 +214,7 @@ class InputDefinition
*
* @param InputOption[] $options An array of InputOption objects
*/
- public function addOptions($options = array())
+ public function addOptions($options = [])
{
foreach ($options as $option) {
$this->addOption($option);
@@ -232,10 +222,6 @@ class InputDefinition
}
/**
- * Adds an InputOption object.
- *
- * @param InputOption $option An InputOption object
- *
* @throws LogicException When option given already exist
*/
public function addOption(InputOption $option)
@@ -318,7 +304,7 @@ class InputDefinition
/**
* Gets an InputOption by shortcut.
*
- * @param string $shortcut the Shortcut name
+ * @param string $shortcut The Shortcut name
*
* @return InputOption An InputOption object
*/
@@ -328,13 +314,11 @@ class InputDefinition
}
/**
- * Gets an array of default values.
- *
- * @return array An array of all default values
+ * @return array<string|bool|int|float|array|null>
*/
public function getOptionDefaults()
{
- $values = array();
+ $values = [];
foreach ($this->options as $option) {
$values[$option->getName()] = $option->getDefault();
}
@@ -345,13 +329,11 @@ class InputDefinition
/**
* Returns the InputOption name given a shortcut.
*
- * @param string $shortcut The shortcut
- *
- * @return string The InputOption name
- *
* @throws InvalidArgumentException When option given does not exist
+ *
+ * @internal
*/
- private function shortcutToName($shortcut)
+ public function shortcutToName(string $shortcut): string
{
if (!isset($this->shortcuts[$shortcut])) {
throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
@@ -369,7 +351,7 @@ class InputDefinition
*/
public function getSynopsis($short = false)
{
- $elements = array();
+ $elements = [];
if ($short && $this->getOptions()) {
$elements[] = '[options]';
@@ -390,25 +372,25 @@ class InputDefinition
}
}
- if (count($elements) && $this->getArguments()) {
+ if (\count($elements) && $this->getArguments()) {
$elements[] = '[--]';
}
+ $tail = '';
foreach ($this->getArguments() as $argument) {
$element = '<'.$argument->getName().'>';
- if (!$argument->isRequired()) {
- $element = '['.$element.']';
- } elseif ($argument->isArray()) {
- $element = $element.' ('.$element.')';
- }
-
if ($argument->isArray()) {
$element .= '...';
}
+ if (!$argument->isRequired()) {
+ $element = '['.$element;
+ $tail .= ']';
+ }
+
$elements[] = $element;
}
- return implode(' ', $elements);
+ return implode(' ', $elements).$tail;
}
}
diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php
index bc66466..8efc623 100644
--- a/vendor/symfony/console/Input/InputInterface.php
+++ b/vendor/symfony/console/Input/InputInterface.php
@@ -24,7 +24,7 @@ interface InputInterface
/**
* Returns the first argument from the raw parameters (not parsed).
*
- * @return string The value of the first argument or null otherwise
+ * @return string|null The value of the first argument or null otherwise
*/
public function getFirstArgument();
@@ -33,6 +33,8 @@ interface InputInterface
*
* This method is to be used to introspect the input parameters
* before they have been validated. It must be used carefully.
+ * Does not necessarily return the correct result for short options
+ * when multiple flags are combined in the same option.
*
* @param string|array $values The values to look for in the raw parameters (can be an array)
* @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
@@ -46,10 +48,12 @@ interface InputInterface
*
* This method is to be used to introspect the input parameters
* before they have been validated. It must be used carefully.
+ * Does not necessarily return the correct result for short options
+ * when multiple flags are combined in the same option.
*
- * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
- * @param mixed $default The default value to return if no result is found
- * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
+ * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
+ * @param string|bool|int|float|array|null $default The default value to return if no result is found
+ * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
*
* @return mixed The option value
*/
@@ -58,7 +62,7 @@ interface InputInterface
/**
* Binds the current Input instance with the given arguments and options.
*
- * @param InputDefinition $definition A InputDefinition instance
+ * @throws RuntimeException
*/
public function bind(InputDefinition $definition);
@@ -72,7 +76,7 @@ interface InputInterface
/**
* Returns all the given arguments merged with the default values.
*
- * @return array
+ * @return array<string|bool|int|float|array|null>
*/
public function getArguments();
@@ -81,7 +85,7 @@ interface InputInterface
*
* @param string $name The argument name
*
- * @return mixed The argument value
+ * @return mixed
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@@ -91,7 +95,7 @@ interface InputInterface
* Sets an argument value by name.
*
* @param string $name The argument name
- * @param string $value The argument value
+ * @param mixed $value The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@@ -100,7 +104,7 @@ interface InputInterface
/**
* Returns true if an InputArgument object exists by name or position.
*
- * @param string|int $name The InputArgument name or position
+ * @param string $name The argument name
*
* @return bool true if the InputArgument object exists, false otherwise
*/
@@ -109,7 +113,7 @@ interface InputInterface
/**
* Returns all the given options merged with the default values.
*
- * @return array
+ * @return array<string|bool|int|float|array|null>
*/
public function getOptions();
@@ -118,7 +122,7 @@ interface InputInterface
*
* @param string $name The option name
*
- * @return mixed The option value
+ * @return mixed
*
* @throws InvalidArgumentException When option given doesn't exist
*/
@@ -127,8 +131,8 @@ interface InputInterface
/**
* Sets an option value by name.
*
- * @param string $name The option name
- * @param string|bool $value The option value
+ * @param string $name The option name
+ * @param mixed $value The option value
*
* @throws InvalidArgumentException When option given doesn't exist
*/
diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php
index f08c5f2..c7729db 100644
--- a/vendor/symfony/console/Input/InputOption.php
+++ b/vendor/symfony/console/Input/InputOption.php
@@ -21,10 +21,25 @@ use Symfony\Component\Console\Exception\LogicException;
*/
class InputOption
{
- const VALUE_NONE = 1;
- const VALUE_REQUIRED = 2;
- const VALUE_OPTIONAL = 4;
- const VALUE_IS_ARRAY = 8;
+ /**
+ * Do not accept input for the option (e.g. --yell). This is the default behavior of options.
+ */
+ public const VALUE_NONE = 1;
+
+ /**
+ * A value must be passed when the option is used (e.g. --iterations=5 or -i5).
+ */
+ public const VALUE_REQUIRED = 2;
+
+ /**
+ * The option may or may not have a value (e.g. --yell or --yell=loud).
+ */
+ public const VALUE_OPTIONAL = 4;
+
+ /**
+ * The option accepts multiple values (e.g. --dir=/foo --dir=/bar).
+ */
+ public const VALUE_IS_ARRAY = 8;
private $name;
private $shortcut;
@@ -33,19 +48,17 @@ class InputOption
private $description;
/**
- * Constructor.
- *
- * @param string $name The option name
- * @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
- * @param int $mode The option mode: One of the VALUE_* constants
- * @param string $description A description text
- * @param mixed $default The default value (must be null for self::VALUE_NONE)
+ * @param string $name The option name
+ * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
+ * @param int|null $mode The option mode: One of the VALUE_* constants
+ * @param string $description A description text
+ * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE)
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
- public function __construct($name, $shortcut = null, $mode = null, $description = '', $default = null)
+ public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
{
- if (0 === strpos($name, '--')) {
+ if (str_starts_with($name, '--')) {
$name = substr($name, 2);
}
@@ -58,7 +71,7 @@ class InputOption
}
if (null !== $shortcut) {
- if (is_array($shortcut)) {
+ if (\is_array($shortcut)) {
$shortcut = implode('|', $shortcut);
}
$shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-'));
@@ -72,7 +85,7 @@ class InputOption
if (null === $mode) {
$mode = self::VALUE_NONE;
- } elseif (!is_int($mode) || $mode > 15 || $mode < 1) {
+ } elseif ($mode > 15 || $mode < 1) {
throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode));
}
@@ -91,7 +104,7 @@ class InputOption
/**
* Returns the option shortcut.
*
- * @return string The shortcut
+ * @return string|null The shortcut
*/
public function getShortcut()
{
@@ -149,11 +162,7 @@ class InputOption
}
/**
- * Sets the default value.
- *
- * @param mixed $default The default value
- *
- * @throws LogicException When incorrect default value is given
+ * @param string|bool|int|float|array|null $default
*/
public function setDefault($default = null)
{
@@ -163,8 +172,8 @@ class InputOption
if ($this->isArray()) {
if (null === $default) {
- $default = array();
- } elseif (!is_array($default)) {
+ $default = [];
+ } elseif (!\is_array($default)) {
throw new LogicException('A default value for an array option must be an array.');
}
}
@@ -175,7 +184,7 @@ class InputOption
/**
* Returns the default value.
*
- * @return mixed The default value
+ * @return string|bool|int|float|array|null
*/
public function getDefault()
{
@@ -195,11 +204,9 @@ class InputOption
/**
* Checks whether the given option equals this one.
*
- * @param InputOption $option option to compare
- *
* @return bool
*/
- public function equals(InputOption $option)
+ public function equals(self $option)
{
return $option->getName() === $this->getName()
&& $option->getShortcut() === $this->getShortcut()
diff --git a/vendor/symfony/console/Input/StreamableInputInterface.php b/vendor/symfony/console/Input/StreamableInputInterface.php
new file mode 100644
index 0000000..d7e462f
--- /dev/null
+++ b/vendor/symfony/console/Input/StreamableInputInterface.php
@@ -0,0 +1,37 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Input;
+
+/**
+ * StreamableInputInterface is the interface implemented by all input classes
+ * that have an input stream.
+ *
+ * @author Robin Chalas <robin.chalas@gmail.com>
+ */
+interface StreamableInputInterface extends InputInterface
+{
+ /**
+ * Sets the input stream to read from when interacting with the user.
+ *
+ * This is mainly useful for testing purpose.
+ *
+ * @param resource $stream The input stream
+ */
+ public function setStream($stream);
+
+ /**
+ * Returns the input stream.
+ *
+ * @return resource|null
+ */
+ public function getStream();
+}
diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php
index 9ce0217..56bb66c 100644
--- a/vendor/symfony/console/Input/StringInput.php
+++ b/vendor/symfony/console/Input/StringInput.php
@@ -24,17 +24,16 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
*/
class StringInput extends ArgvInput
{
- const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
- const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
+ public const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
+ public const REGEX_UNQUOTED_STRING = '([^\s\\\\]+?)';
+ public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
/**
- * Constructor.
- *
- * @param string $input An array of parameters from the CLI (in the argv format)
+ * @param string $input A string representing the parameters from the CLI
*/
- public function __construct($input)
+ public function __construct(string $input)
{
- parent::__construct(array());
+ parent::__construct([]);
$this->setTokens($this->tokenize($input));
}
@@ -42,31 +41,42 @@ class StringInput extends ArgvInput
/**
* Tokenizes a string.
*
- * @param string $input The input to tokenize
- *
- * @return array An array of tokens
- *
* @throws InvalidArgumentException When unable to parse input (should never happen)
*/
- private function tokenize($input)
+ private function tokenize(string $input): array
{
- $tokens = array();
- $length = strlen($input);
+ $tokens = [];
+ $length = \strlen($input);
$cursor = 0;
+ $token = null;
while ($cursor < $length) {
- if (preg_match('/\s+/A', $input, $match, null, $cursor)) {
- } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) {
- $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2)));
- } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) {
- $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2));
- } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) {
- $tokens[] = stripcslashes($match[1]);
+ if ('\\' === $input[$cursor]) {
+ $token .= $input[++$cursor] ?? '';
+ ++$cursor;
+ continue;
+ }
+
+ if (preg_match('/\s+/A', $input, $match, 0, $cursor)) {
+ if (null !== $token) {
+ $tokens[] = $token;
+ $token = null;
+ }
+ } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) {
+ $token .= $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1)));
+ } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) {
+ $token .= stripcslashes(substr($match[0], 1, -1));
+ } elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A', $input, $match, 0, $cursor)) {
+ $token .= $match[1];
} else {
// should never happen
- throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
+ throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10)));
}
- $cursor += strlen($match[0]);
+ $cursor += \strlen($match[0]);
+ }
+
+ if (null !== $token) {
+ $tokens[] = $token;
}
return $tokens;
diff --git a/vendor/symfony/console/LICENSE b/vendor/symfony/console/LICENSE
index 12a7453..88bf75b 100644
--- a/vendor/symfony/console/LICENSE
+++ b/vendor/symfony/console/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+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
diff --git a/vendor/symfony/console/Logger/ConsoleLogger.php b/vendor/symfony/console/Logger/ConsoleLogger.php
index 1f7417e..c9ee035 100644
--- a/vendor/symfony/console/Logger/ConsoleLogger.php
+++ b/vendor/symfony/console/Logger/ConsoleLogger.php
@@ -14,29 +14,23 @@ namespace Symfony\Component\Console\Logger;
use Psr\Log\AbstractLogger;
use Psr\Log\InvalidArgumentException;
use Psr\Log\LogLevel;
-use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
/**
* PSR-3 compliant console logger.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*
- * @link http://www.php-fig.org/psr/psr-3/
+ * @see https://www.php-fig.org/psr/psr-3/
*/
class ConsoleLogger extends AbstractLogger
{
- const INFO = 'info';
- const ERROR = 'error';
+ public const INFO = 'info';
+ public const ERROR = 'error';
- /**
- * @var OutputInterface
- */
private $output;
- /**
- * @var array
- */
- private $verbosityLevelMap = array(
+ private $verbosityLevelMap = [
LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL,
LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL,
LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL,
@@ -45,11 +39,8 @@ class ConsoleLogger extends AbstractLogger
LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE,
LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE,
LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG,
- );
- /**
- * @var array
- */
- private $formatLevelMap = array(
+ ];
+ private $formatLevelMap = [
LogLevel::EMERGENCY => self::ERROR,
LogLevel::ALERT => self::ERROR,
LogLevel::CRITICAL => self::ERROR,
@@ -58,14 +49,10 @@ class ConsoleLogger extends AbstractLogger
LogLevel::NOTICE => self::INFO,
LogLevel::INFO => self::INFO,
LogLevel::DEBUG => self::INFO,
- );
+ ];
+ private $errored = false;
- /**
- * @param OutputInterface $output
- * @param array $verbosityLevelMap
- * @param array $formatLevelMap
- */
- public function __construct(OutputInterface $output, array $verbosityLevelMap = array(), array $formatLevelMap = array())
+ public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = [])
{
$this->output = $output;
$this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap;
@@ -74,46 +61,66 @@ class ConsoleLogger extends AbstractLogger
/**
* {@inheritdoc}
+ *
+ * @return void
*/
- public function log($level, $message, array $context = array())
+ public function log($level, $message, array $context = [])
{
if (!isset($this->verbosityLevelMap[$level])) {
throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level));
}
+ $output = $this->output;
+
// Write to the error output if necessary and available
- if ($this->formatLevelMap[$level] === self::ERROR && $this->output instanceof ConsoleOutputInterface) {
- $output = $this->output->getErrorOutput();
- } else {
- $output = $this->output;
+ if (self::ERROR === $this->formatLevelMap[$level]) {
+ if ($this->output instanceof ConsoleOutputInterface) {
+ $output = $output->getErrorOutput();
+ }
+ $this->errored = true;
}
+ // the if condition check isn't necessary -- it's the same one that $output will do internally anyway.
+ // We only do it for efficiency here as the message formatting is relatively expensive.
if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) {
- $output->writeln(sprintf('<%1$s>[%2$s] %3$s</%1$s>', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)));
+ $output->writeln(sprintf('<%1$s>[%2$s] %3$s</%1$s>', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]);
}
}
/**
+ * Returns true when any messages have been logged at error levels.
+ *
+ * @return bool
+ */
+ public function hasErrored()
+ {
+ return $this->errored;
+ }
+
+ /**
* Interpolates context values into the message placeholders.
*
* @author PHP Framework Interoperability Group
- *
- * @param string $message
- * @param array $context
- *
- * @return string
*/
- private function interpolate($message, array $context)
+ private function interpolate(string $message, array $context): string
{
- // build a replacement array with braces around the context keys
- $replace = array();
+ if (!str_contains($message, '{')) {
+ return $message;
+ }
+
+ $replacements = [];
foreach ($context as $key => $val) {
- if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {
- $replace[sprintf('{%s}', $key)] = $val;
+ if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) {
+ $replacements["{{$key}}"] = $val;
+ } elseif ($val instanceof \DateTimeInterface) {
+ $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339);
+ } elseif (\is_object($val)) {
+ $replacements["{{$key}}"] = '[object '.\get_class($val).']';
+ } else {
+ $replacements["{{$key}}"] = '['.\gettype($val).']';
}
}
- // interpolate replacement values into the message and return
- return strtr($message, $replace);
+ return strtr($message, $replacements);
}
}
diff --git a/vendor/symfony/console/Output/BufferedOutput.php b/vendor/symfony/console/Output/BufferedOutput.php
index 5682fc2..fefaac2 100644
--- a/vendor/symfony/console/Output/BufferedOutput.php
+++ b/vendor/symfony/console/Output/BufferedOutput.php
@@ -16,9 +16,6 @@ namespace Symfony\Component\Console\Output;
*/
class BufferedOutput extends Output
{
- /**
- * @var string
- */
private $buffer = '';
/**
@@ -42,7 +39,7 @@ class BufferedOutput extends Output
$this->buffer .= $message;
if ($newline) {
- $this->buffer .= "\n";
+ $this->buffer .= \PHP_EOL;
}
}
}
diff --git a/vendor/symfony/console/Output/ConsoleOutput.php b/vendor/symfony/console/Output/ConsoleOutput.php
index 007f3f0..484fcbd 100644
--- a/vendor/symfony/console/Output/ConsoleOutput.php
+++ b/vendor/symfony/console/Output/ConsoleOutput.php
@@ -29,22 +29,25 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
*/
class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
{
- /**
- * @var StreamOutput
- */
private $stderr;
+ private $consoleSectionOutputs = [];
/**
- * Constructor.
- *
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
* @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
*/
- public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
+ public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)
{
parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
+ if (null === $formatter) {
+ // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter.
+ $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated);
+
+ return;
+ }
+
$actualDecorated = $this->isDecorated();
$this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
@@ -54,6 +57,14 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
}
/**
+ * Creates a new output section.
+ */
+ public function section(): ConsoleSectionOutput
+ {
+ return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter());
+ }
+
+ /**
* {@inheritdoc}
*/
public function setDecorated($decorated)
@@ -121,16 +132,14 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
/**
* Checks if current executing environment is IBM iSeries (OS400), which
* doesn't properly convert character-encodings between ASCII to EBCDIC.
- *
- * @return bool
*/
- private function isRunningOS400()
+ private function isRunningOS400(): bool
{
- $checks = array(
- function_exists('php_uname') ? php_uname('s') : '',
+ $checks = [
+ \function_exists('php_uname') ? php_uname('s') : '',
getenv('OSTYPE'),
- PHP_OS,
- );
+ \PHP_OS,
+ ];
return false !== stripos(implode(';', $checks), 'OS400');
}
@@ -144,7 +153,8 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
return fopen('php://output', 'w');
}
- return @fopen('php://stdout', 'w') ?: fopen('php://output', 'w');
+ // Use STDOUT when possible to prevent from opening too many file descriptors
+ return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w'));
}
/**
@@ -152,6 +162,11 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
*/
private function openErrorStream()
{
- return fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w');
+ if (!$this->hasStderrSupport()) {
+ return fopen('php://output', 'w');
+ }
+
+ // Use STDERR when possible to prevent from opening too many file descriptors
+ return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w'));
}
}
diff --git a/vendor/symfony/console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Output/ConsoleOutputInterface.php
index 5eb4fc7..f4c2fa6 100644
--- a/vendor/symfony/console/Output/ConsoleOutputInterface.php
+++ b/vendor/symfony/console/Output/ConsoleOutputInterface.php
@@ -13,9 +13,11 @@ namespace Symfony\Component\Console\Output;
/**
* ConsoleOutputInterface is the interface implemented by ConsoleOutput class.
- * This adds information about stderr output stream.
+ * This adds information about stderr and section output stream.
*
* @author Dariusz Górecki <darek.krk@gmail.com>
+ *
+ * @method ConsoleSectionOutput section() Creates a new output section
*/
interface ConsoleOutputInterface extends OutputInterface
{
@@ -26,10 +28,5 @@ interface ConsoleOutputInterface extends OutputInterface
*/
public function getErrorOutput();
- /**
- * Sets the OutputInterface used for errors.
- *
- * @param OutputInterface $error
- */
public function setErrorOutput(OutputInterface $error);
}
diff --git a/vendor/symfony/console/Output/ConsoleSectionOutput.php b/vendor/symfony/console/Output/ConsoleSectionOutput.php
new file mode 100644
index 0000000..c19edbf
--- /dev/null
+++ b/vendor/symfony/console/Output/ConsoleSectionOutput.php
@@ -0,0 +1,143 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+use Symfony\Component\Console\Helper\Helper;
+use Symfony\Component\Console\Terminal;
+
+/**
+ * @author Pierre du Plessis <pdples@gmail.com>
+ * @author Gabriel Ostrolucký <gabriel.ostrolucky@gmail.com>
+ */
+class ConsoleSectionOutput extends StreamOutput
+{
+ private $content = [];
+ private $lines = 0;
+ private $sections;
+ private $terminal;
+
+ /**
+ * @param resource $stream
+ * @param ConsoleSectionOutput[] $sections
+ */
+ public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter)
+ {
+ parent::__construct($stream, $verbosity, $decorated, $formatter);
+ array_unshift($sections, $this);
+ $this->sections = &$sections;
+ $this->terminal = new Terminal();
+ }
+
+ /**
+ * Clears previous output for this section.
+ *
+ * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared
+ */
+ public function clear(int $lines = null)
+ {
+ if (empty($this->content) || !$this->isDecorated()) {
+ return;
+ }
+
+ if ($lines) {
+ array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content
+ } else {
+ $lines = $this->lines;
+ $this->content = [];
+ }
+
+ $this->lines -= $lines;
+
+ parent::doWrite($this->popStreamContentUntilCurrentSection($lines), false);
+ }
+
+ /**
+ * Overwrites the previous output with a new message.
+ *
+ * @param array|string $message
+ */
+ public function overwrite($message)
+ {
+ $this->clear();
+ $this->writeln($message);
+ }
+
+ public function getContent(): string
+ {
+ return implode('', $this->content);
+ }
+
+ /**
+ * @internal
+ */
+ public function addContent(string $input)
+ {
+ foreach (explode(\PHP_EOL, $input) as $lineContent) {
+ $this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1;
+ $this->content[] = $lineContent;
+ $this->content[] = \PHP_EOL;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doWrite($message, $newline)
+ {
+ if (!$this->isDecorated()) {
+ parent::doWrite($message, $newline);
+
+ return;
+ }
+
+ $erasedContent = $this->popStreamContentUntilCurrentSection();
+
+ $this->addContent($message);
+
+ parent::doWrite($message, true);
+ parent::doWrite($erasedContent, false);
+ }
+
+ /**
+ * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits
+ * current section. Then it erases content it crawled through. Optionally, it erases part of current section too.
+ */
+ private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string
+ {
+ $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection;
+ $erasedContent = [];
+
+ foreach ($this->sections as $section) {
+ if ($section === $this) {
+ break;
+ }
+
+ $numberOfLinesToClear += $section->lines;
+ $erasedContent[] = $section->getContent();
+ }
+
+ if ($numberOfLinesToClear > 0) {
+ // move cursor up n lines
+ parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false);
+ // erase to end of screen
+ parent::doWrite("\x1b[0J", false);
+ }
+
+ return implode('', array_reverse($erasedContent));
+ }
+
+ private function getDisplayLength(string $text): string
+ {
+ return Helper::strlenWithoutDecoration($this->getFormatter(), str_replace("\t", ' ', $text));
+ }
+}
diff --git a/vendor/symfony/console/Output/Output.php b/vendor/symfony/console/Output/Output.php
index c12015c..fb838f0 100644
--- a/vendor/symfony/console/Output/Output.php
+++ b/vendor/symfony/console/Output/Output.php
@@ -11,8 +11,8 @@
namespace Symfony\Component\Console\Output;
-use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
/**
* Base class for output classes.
@@ -33,16 +33,14 @@ abstract class Output implements OutputInterface
private $formatter;
/**
- * Constructor.
- *
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
* @param bool $decorated Whether to decorate messages
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
*/
- public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = false, OutputFormatterInterface $formatter = null)
+ public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null)
{
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
- $this->formatter = $formatter ?: new OutputFormatter();
+ $this->formatter = $formatter ?? new OutputFormatter();
$this->formatter->setDecorated($decorated);
}
@@ -139,7 +137,9 @@ abstract class Output implements OutputInterface
*/
public function write($messages, $newline = false, $options = self::OUTPUT_NORMAL)
{
- $messages = (array) $messages;
+ if (!is_iterable($messages)) {
+ $messages = [$messages];
+ }
$types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN;
$type = $types & $options ?: self::OUTPUT_NORMAL;
@@ -163,7 +163,7 @@ abstract class Output implements OutputInterface
break;
}
- $this->doWrite($message, $newline);
+ $this->doWrite($message ?? '', $newline);
}
}
diff --git a/vendor/symfony/console/Output/OutputInterface.php b/vendor/symfony/console/Output/OutputInterface.php
index a291ca7..671d5bd 100644
--- a/vendor/symfony/console/Output/OutputInterface.php
+++ b/vendor/symfony/console/Output/OutputInterface.php
@@ -20,30 +20,30 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
*/
interface OutputInterface
{
- const VERBOSITY_QUIET = 16;
- const VERBOSITY_NORMAL = 32;
- const VERBOSITY_VERBOSE = 64;
- const VERBOSITY_VERY_VERBOSE = 128;
- const VERBOSITY_DEBUG = 256;
+ public const VERBOSITY_QUIET = 16;
+ public const VERBOSITY_NORMAL = 32;
+ public const VERBOSITY_VERBOSE = 64;
+ public const VERBOSITY_VERY_VERBOSE = 128;
+ public const VERBOSITY_DEBUG = 256;
- const OUTPUT_NORMAL = 1;
- const OUTPUT_RAW = 2;
- const OUTPUT_PLAIN = 4;
+ public const OUTPUT_NORMAL = 1;
+ public const OUTPUT_RAW = 2;
+ public const OUTPUT_PLAIN = 4;
/**
* Writes a message to the output.
*
- * @param string|array $messages The message as an array of lines or a single string
- * @param bool $newline Whether to add a newline
- * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
+ * @param string|iterable $messages The message as an iterable of strings or a single string
+ * @param bool $newline Whether to add a newline
+ * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
*/
public function write($messages, $newline = false, $options = 0);
/**
* Writes a message to the output and adds a newline at the end.
*
- * @param string|array $messages The message as an array of lines of a single string
- * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
+ * @param string|iterable $messages The message as an iterable of strings or a single string
+ * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
*/
public function writeln($messages, $options = 0);
@@ -103,11 +103,6 @@ interface OutputInterface
*/
public function isDecorated();
- /**
- * Sets output formatter.
- *
- * @param OutputFormatterInterface $formatter
- */
public function setFormatter(OutputFormatterInterface $formatter);
/**
diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php
index 22b29aa..9c22436 100644
--- a/vendor/symfony/console/Output/StreamOutput.php
+++ b/vendor/symfony/console/Output/StreamOutput.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Console\Output;
use Symfony\Component\Console\Exception\InvalidArgumentException;
-use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
/**
@@ -20,11 +19,11 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
*
* Usage:
*
- * $output = new StreamOutput(fopen('php://stdout', 'w'));
+ * $output = new StreamOutput(fopen('php://stdout', 'w'));
*
* As `StreamOutput` can use any stream, you can also use a file:
*
- * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
+ * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false));
*
* @author Fabien Potencier <fabien@symfony.com>
*/
@@ -33,8 +32,6 @@ class StreamOutput extends Output
private $stream;
/**
- * Constructor.
- *
* @param resource $stream A stream resource
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
* @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
@@ -42,9 +39,9 @@ class StreamOutput extends Output
*
* @throws InvalidArgumentException When first argument is not a real stream
*/
- public function __construct($stream, $verbosity = self::VERBOSITY_NORMAL, $decorated = null, OutputFormatterInterface $formatter = null)
+ public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)
{
- if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
+ if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) {
throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.');
}
@@ -72,11 +69,12 @@ class StreamOutput extends Output
*/
protected function doWrite($message, $newline)
{
- if (false === @fwrite($this->stream, $message) || ($newline && (false === @fwrite($this->stream, PHP_EOL)))) {
- // should never happen
- throw new RuntimeException('Unable to write output.');
+ if ($newline) {
+ $message .= \PHP_EOL;
}
+ @fwrite($this->stream, $message);
+
fflush($this->stream);
}
@@ -85,21 +83,43 @@ class StreamOutput extends Output
*
* Colorization is disabled if not supported by the stream:
*
- * - Windows != 10.0.10586 without Ansicon, ConEmu or Mintty
- * - non tty consoles
+ * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo
+ * terminals via named pipes, so we can only check the environment.
+ *
+ * Reference: Composer\XdebugHandler\Process::supportsColor
+ * https://github.com/composer/xdebug-handler
*
* @return bool true if the stream supports colorization, false otherwise
*/
protected function hasColorSupport()
{
- if (DIRECTORY_SEPARATOR === '\\') {
- return
- '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
+ // Follow https://no-color.org/
+ if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
+ return false;
+ }
+
+ if ('Hyper' === getenv('TERM_PROGRAM')) {
+ return true;
+ }
+
+ if (\DIRECTORY_SEPARATOR === '\\') {
+ return (\function_exists('sapi_windows_vt100_support')
+ && @sapi_windows_vt100_support($this->stream))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
}
- return function_exists('posix_isatty') && @posix_isatty($this->stream);
+ if (\function_exists('stream_isatty')) {
+ return @stream_isatty($this->stream);
+ }
+
+ if (\function_exists('posix_isatty')) {
+ return @posix_isatty($this->stream);
+ }
+
+ $stat = @fstat($this->stream);
+ // Check if formatted mode is S_IFCHR
+ return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
}
}
diff --git a/vendor/symfony/console/Output/TrimmedBufferOutput.php b/vendor/symfony/console/Output/TrimmedBufferOutput.php
new file mode 100644
index 0000000..87c04a8
--- /dev/null
+++ b/vendor/symfony/console/Output/TrimmedBufferOutput.php
@@ -0,0 +1,63 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Output;
+
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * A BufferedOutput that keeps only the last N chars.
+ *
+ * @author Jérémy Derussé <jeremy@derusse.com>
+ */
+class TrimmedBufferOutput extends Output
+{
+ private $maxLength;
+ private $buffer = '';
+
+ public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null)
+ {
+ if ($maxLength <= 0) {
+ throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength));
+ }
+
+ parent::__construct($verbosity, $decorated, $formatter);
+ $this->maxLength = $maxLength;
+ }
+
+ /**
+ * Empties buffer and returns its content.
+ *
+ * @return string
+ */
+ public function fetch()
+ {
+ $content = $this->buffer;
+ $this->buffer = '';
+
+ return $content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doWrite($message, $newline)
+ {
+ $this->buffer .= $message;
+
+ if ($newline) {
+ $this->buffer .= \PHP_EOL;
+ }
+
+ $this->buffer = substr($this->buffer, 0 - $this->maxLength);
+ }
+}
diff --git a/vendor/symfony/console/Question/ChoiceQuestion.php b/vendor/symfony/console/Question/ChoiceQuestion.php
index 39c4a85..6247ca7 100644
--- a/vendor/symfony/console/Question/ChoiceQuestion.php
+++ b/vendor/symfony/console/Question/ChoiceQuestion.php
@@ -26,14 +26,16 @@ class ChoiceQuestion extends Question
private $errorMessage = 'Value "%s" is invalid';
/**
- * Constructor.
- *
* @param string $question The question to ask to the user
* @param array $choices The list of available choices
* @param mixed $default The default answer to return
*/
- public function __construct($question, array $choices, $default = null)
+ public function __construct(string $question, array $choices, $default = null)
{
+ if (!$choices) {
+ throw new \LogicException('Choice question must have at least 1 choice available.');
+ }
+
parent::__construct($question, $default);
$this->choices = $choices;
@@ -58,7 +60,7 @@ class ChoiceQuestion extends Question
*
* @param bool $multiselect
*
- * @return ChoiceQuestion The current instance
+ * @return $this
*/
public function setMultiselect($multiselect)
{
@@ -93,7 +95,7 @@ class ChoiceQuestion extends Question
*
* @param string $prompt
*
- * @return ChoiceQuestion The current instance
+ * @return $this
*/
public function setPrompt($prompt)
{
@@ -109,7 +111,7 @@ class ChoiceQuestion extends Question
*
* @param string $errorMessage
*
- * @return ChoiceQuestion The current instance
+ * @return $this
*/
public function setErrorMessage($errorMessage)
{
@@ -119,12 +121,7 @@ class ChoiceQuestion extends Question
return $this;
}
- /**
- * Returns the default answer validator.
- *
- * @return callable
- */
- private function getDefaultValidator()
+ private function getDefaultValidator(): callable
{
$choices = $this->choices;
$errorMessage = $this->errorMessage;
@@ -132,30 +129,34 @@ class ChoiceQuestion extends Question
$isAssoc = $this->isAssoc($choices);
return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) {
- // Collapse all spaces.
- $selectedChoices = str_replace(' ', '', $selected);
-
if ($multiselect) {
// Check for a separated comma values
- if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) {
+ if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) {
throw new InvalidArgumentException(sprintf($errorMessage, $selected));
}
- $selectedChoices = explode(',', $selectedChoices);
+
+ $selectedChoices = explode(',', (string) $selected);
} else {
- $selectedChoices = array($selected);
+ $selectedChoices = [$selected];
+ }
+
+ if ($this->isTrimmable()) {
+ foreach ($selectedChoices as $k => $v) {
+ $selectedChoices[$k] = trim((string) $v);
+ }
}
- $multiselectChoices = array();
+ $multiselectChoices = [];
foreach ($selectedChoices as $value) {
- $results = array();
+ $results = [];
foreach ($choices as $key => $choice) {
if ($choice === $value) {
$results[] = $key;
}
}
- if (count($results) > 1) {
- throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results)));
+ if (\count($results) > 1) {
+ throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results)));
}
$result = array_search($value, $choices);
diff --git a/vendor/symfony/console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Question/ConfirmationQuestion.php
index 29d9887..4228521 100644
--- a/vendor/symfony/console/Question/ConfirmationQuestion.php
+++ b/vendor/symfony/console/Question/ConfirmationQuestion.php
@@ -21,15 +21,13 @@ class ConfirmationQuestion extends Question
private $trueAnswerRegex;
/**
- * Constructor.
- *
* @param string $question The question to ask to the user
* @param bool $default The default answer to return, true or false
* @param string $trueAnswerRegex A regex to match the "yes" answer
*/
- public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i')
+ public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i')
{
- parent::__construct($question, (bool) $default);
+ parent::__construct($question, $default);
$this->trueAnswerRegex = $trueAnswerRegex;
$this->setNormalizer($this->getDefaultNormalizer());
@@ -37,16 +35,14 @@ class ConfirmationQuestion extends Question
/**
* Returns the default answer normalizer.
- *
- * @return callable
*/
- private function getDefaultNormalizer()
+ private function getDefaultNormalizer(): callable
{
$default = $this->getDefault();
$regex = $this->trueAnswerRegex;
return function ($answer) use ($default, $regex) {
- if (is_bool($answer)) {
+ if (\is_bool($answer)) {
return $answer;
}
@@ -55,7 +51,7 @@ class ConfirmationQuestion extends Question
return $answer && $answerIsTrue;
}
- return !$answer || $answerIsTrue;
+ return '' === $answer || $answerIsTrue;
};
}
}
diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php
index 7a69279..cc10801 100644
--- a/vendor/symfony/console/Question/Question.php
+++ b/vendor/symfony/console/Question/Question.php
@@ -25,18 +25,17 @@ class Question
private $attempts;
private $hidden = false;
private $hiddenFallback = true;
- private $autocompleterValues;
+ private $autocompleterCallback;
private $validator;
private $default;
private $normalizer;
+ private $trimmable = true;
/**
- * Constructor.
- *
- * @param string $question The question to ask to the user
- * @param mixed $default The default answer to return if the user enters nothing
+ * @param string $question The question to ask to the user
+ * @param string|bool|int|float|null $default The default answer to return if the user enters nothing
*/
- public function __construct($question, $default = null)
+ public function __construct(string $question, $default = null)
{
$this->question = $question;
$this->default = $default;
@@ -55,7 +54,7 @@ class Question
/**
* Returns the default answer.
*
- * @return mixed
+ * @return string|bool|int|float|null
*/
public function getDefault()
{
@@ -77,13 +76,13 @@ class Question
*
* @param bool $hidden
*
- * @return Question The current instance
+ * @return $this
*
* @throws LogicException In case the autocompleter is also used
*/
public function setHidden($hidden)
{
- if ($this->autocompleterValues) {
+ if ($this->autocompleterCallback) {
throw new LogicException('A hidden question cannot use the autocompleter.');
}
@@ -107,7 +106,7 @@ class Question
*
* @param bool $fallback
*
- * @return Question The current instance
+ * @return $this
*/
public function setHiddenFallback($fallback)
{
@@ -119,40 +118,69 @@ class Question
/**
* Gets values for the autocompleter.
*
- * @return null|array|\Traversable
+ * @return iterable|null
*/
public function getAutocompleterValues()
{
- return $this->autocompleterValues;
+ $callback = $this->getAutocompleterCallback();
+
+ return $callback ? $callback('') : null;
}
/**
* Sets values for the autocompleter.
*
- * @param null|array|\Traversable $values
+ * @param iterable|null $values
*
- * @return Question The current instance
+ * @return $this
*
* @throws InvalidArgumentException
* @throws LogicException
*/
public function setAutocompleterValues($values)
{
- if (is_array($values)) {
+ if (\is_array($values)) {
$values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values);
- }
- if (null !== $values && !is_array($values)) {
- if (!$values instanceof \Traversable || !$values instanceof \Countable) {
- throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or an object implementing both `Countable` and `Traversable` interfaces.');
- }
+ $callback = static function () use ($values) {
+ return $values;
+ };
+ } elseif ($values instanceof \Traversable) {
+ $valueCache = null;
+ $callback = static function () use ($values, &$valueCache) {
+ return $valueCache ?? $valueCache = iterator_to_array($values, false);
+ };
+ } elseif (null === $values) {
+ $callback = null;
+ } else {
+ throw new InvalidArgumentException('Autocompleter values can be either an array, "null" or a "Traversable" object.');
}
- if ($this->hidden) {
+ return $this->setAutocompleterCallback($callback);
+ }
+
+ /**
+ * Gets the callback function used for the autocompleter.
+ */
+ public function getAutocompleterCallback(): ?callable
+ {
+ return $this->autocompleterCallback;
+ }
+
+ /**
+ * Sets the callback function used for the autocompleter.
+ *
+ * The callback is passed the user input as argument and should return an iterable of corresponding suggestions.
+ *
+ * @return $this
+ */
+ public function setAutocompleterCallback(callable $callback = null): self
+ {
+ if ($this->hidden && null !== $callback) {
throw new LogicException('A hidden question cannot use the autocompleter.');
}
- $this->autocompleterValues = $values;
+ $this->autocompleterCallback = $callback;
return $this;
}
@@ -160,9 +188,7 @@ class Question
/**
* Sets a validator for the question.
*
- * @param null|callable $validator
- *
- * @return Question The current instance
+ * @return $this
*/
public function setValidator(callable $validator = null)
{
@@ -174,7 +200,7 @@ class Question
/**
* Gets the validator for the question.
*
- * @return null|callable
+ * @return callable|null
*/
public function getValidator()
{
@@ -186,16 +212,19 @@ class Question
*
* Null means an unlimited number of attempts.
*
- * @param null|int $attempts
+ * @param int|null $attempts
*
- * @return Question The current instance
+ * @return $this
*
- * @throws InvalidArgumentException In case the number of attempts is invalid.
+ * @throws InvalidArgumentException in case the number of attempts is invalid
*/
public function setMaxAttempts($attempts)
{
- if (null !== $attempts && $attempts < 1) {
- throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
+ if (null !== $attempts) {
+ $attempts = (int) $attempts;
+ if ($attempts < 1) {
+ throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
+ }
}
$this->attempts = $attempts;
@@ -208,7 +237,7 @@ class Question
*
* Null means an unlimited number of attempts.
*
- * @return null|int
+ * @return int|null
*/
public function getMaxAttempts()
{
@@ -220,9 +249,7 @@ class Question
*
* The normalizer can be a callable (a string), a closure or a class implementing __invoke.
*
- * @param callable $normalizer
- *
- * @return Question The current instance
+ * @return $this
*/
public function setNormalizer(callable $normalizer)
{
@@ -236,7 +263,7 @@ class Question
*
* The normalizer can ba a callable (a string), a closure or a class implementing __invoke.
*
- * @return callable
+ * @return callable|null
*/
public function getNormalizer()
{
@@ -245,6 +272,21 @@ class Question
protected function isAssoc($array)
{
- return (bool) count(array_filter(array_keys($array), 'is_string'));
+ return (bool) \count(array_filter(array_keys($array), 'is_string'));
+ }
+
+ public function isTrimmable(): bool
+ {
+ return $this->trimmable;
+ }
+
+ /**
+ * @return $this
+ */
+ public function setTrimmable(bool $trimmable): self
+ {
+ $this->trimmable = $trimmable;
+
+ return $this;
}
}
diff --git a/vendor/symfony/console/README.md b/vendor/symfony/console/README.md
index 664a37c..c89b4a1 100644
--- a/vendor/symfony/console/README.md
+++ b/vendor/symfony/console/README.md
@@ -7,11 +7,11 @@ interfaces.
Resources
---------
- * [Documentation](https://symfony.com/doc/current/components/console/index.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)
+ * [Documentation](https://symfony.com/doc/current/components/console.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)
Credits
-------
diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php
index de7be1e..14d2d60 100644
--- a/vendor/symfony/console/Style/OutputStyle.php
+++ b/vendor/symfony/console/Style/OutputStyle.php
@@ -13,6 +13,7 @@ namespace Symfony\Component\Console\Style;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Helper\ProgressBar;
+use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
@@ -24,9 +25,6 @@ abstract class OutputStyle implements OutputInterface, StyleInterface
{
private $output;
- /**
- * @param OutputInterface $output
- */
public function __construct(OutputInterface $output)
{
$this->output = $output;
@@ -37,7 +35,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface
*/
public function newLine($count = 1)
{
- $this->output->write(str_repeat(PHP_EOL, $count));
+ $this->output->write(str_repeat(\PHP_EOL, $count));
}
/**
@@ -145,4 +143,13 @@ abstract class OutputStyle implements OutputInterface, StyleInterface
{
return $this->output->isDebug();
}
+
+ protected function getErrorOutput()
+ {
+ if (!$this->output instanceof ConsoleOutputInterface) {
+ return $this->output;
+ }
+
+ return $this->output->getErrorOutput();
+ }
}
diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php
index 2448547..3b5b8af 100644
--- a/vendor/symfony/console/Style/StyleInterface.php
+++ b/vendor/symfony/console/Style/StyleInterface.php
@@ -34,8 +34,6 @@ interface StyleInterface
/**
* Formats a list.
- *
- * @param array $elements
*/
public function listing(array $elements);
@@ -83,9 +81,6 @@ interface StyleInterface
/**
* Formats a table.
- *
- * @param array $headers
- * @param array $rows
*/
public function table(array $headers, array $rows);
@@ -96,7 +91,7 @@ interface StyleInterface
* @param string|null $default
* @param callable|null $validator
*
- * @return string
+ * @return mixed
*/
public function ask($question, $default = null, $validator = null);
@@ -106,7 +101,7 @@ interface StyleInterface
* @param string $question
* @param callable|null $validator
*
- * @return string
+ * @return mixed
*/
public function askHidden($question, $validator = null);
@@ -124,10 +119,9 @@ interface StyleInterface
* Asks a choice question.
*
* @param string $question
- * @param array $choices
* @param string|int|null $default
*
- * @return string
+ * @return mixed
*/
public function choice($question, array $choices, $default = null);
diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php
index a9c5744..66db3ad 100644
--- a/vendor/symfony/console/Style/SymfonyStyle.php
+++ b/vendor/symfony/console/Style/SymfonyStyle.php
@@ -11,19 +11,22 @@
namespace Symfony\Component\Console\Style;
-use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Helper\Table;
+use Symfony\Component\Console\Helper\TableCell;
+use Symfony\Component\Console\Helper\TableSeparator;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\TrimmedBufferOutput;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
+use Symfony\Component\Console\Terminal;
/**
* Output decorator helpers for the Symfony Style Guide.
@@ -32,7 +35,7 @@ use Symfony\Component\Console\Question\Question;
*/
class SymfonyStyle extends OutputStyle
{
- const MAX_LINE_LENGTH = 120;
+ public const MAX_LINE_LENGTH = 120;
private $input;
private $questionHelper;
@@ -40,16 +43,13 @@ class SymfonyStyle extends OutputStyle
private $lineLength;
private $bufferedOutput;
- /**
- * @param InputInterface $input
- * @param OutputInterface $output
- */
public function __construct(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
- $this->bufferedOutput = new BufferedOutput($output->getVerbosity(), false, clone $output->getFormatter());
+ $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter());
// Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not.
- $this->lineLength = min($this->getTerminalWidth() - (int) (DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH);
+ $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH;
+ $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH);
parent::__construct($output);
}
@@ -62,13 +62,14 @@ class SymfonyStyle extends OutputStyle
* @param string|null $style The style to apply to the whole block
* @param string $prefix The prefix for the block
* @param bool $padding Whether to add vertical padding
+ * @param bool $escape Whether to escape the message
*/
- public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false)
+ public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true)
{
- $messages = is_array($messages) ? array_values($messages) : array($messages);
+ $messages = \is_array($messages) ? array_values($messages) : [$messages];
$this->autoPrependBlock();
- $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, true));
+ $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape));
$this->newLine();
}
@@ -78,10 +79,10 @@ class SymfonyStyle extends OutputStyle
public function title($message)
{
$this->autoPrependBlock();
- $this->writeln(array(
- sprintf('<comment>%s</>', $message),
+ $this->writeln([
+ sprintf('<comment>%s</>', OutputFormatter::escapeTrailingBackslash($message)),
sprintf('<comment>%s</>', str_repeat('=', Helper::strlenWithoutDecoration($this->getFormatter(), $message))),
- ));
+ ]);
$this->newLine();
}
@@ -91,10 +92,10 @@ class SymfonyStyle extends OutputStyle
public function section($message)
{
$this->autoPrependBlock();
- $this->writeln(array(
- sprintf('<comment>%s</>', $message),
+ $this->writeln([
+ sprintf('<comment>%s</>', OutputFormatter::escapeTrailingBackslash($message)),
sprintf('<comment>%s</>', str_repeat('-', Helper::strlenWithoutDecoration($this->getFormatter(), $message))),
- ));
+ ]);
$this->newLine();
}
@@ -119,7 +120,7 @@ class SymfonyStyle extends OutputStyle
{
$this->autoPrependText();
- $messages = is_array($message) ? array_values($message) : array($message);
+ $messages = \is_array($message) ? array_values($message) : [$message];
foreach ($messages as $message) {
$this->writeln(sprintf(' %s', $message));
}
@@ -132,11 +133,7 @@ class SymfonyStyle extends OutputStyle
*/
public function comment($message)
{
- $messages = is_array($message) ? array_values($message) : array($message);
-
- $this->autoPrependBlock();
- $this->writeln($this->createBlock($messages, null, null, '<fg=default;bg=default> // </>'));
- $this->newLine();
+ $this->block($message, null, null, '<fg=default;bg=default> // </>', false, false);
}
/**
@@ -160,7 +157,7 @@ class SymfonyStyle extends OutputStyle
*/
public function warning($message)
{
- $this->block($message, 'WARNING', 'fg=white;bg=red', ' ', true);
+ $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true);
}
/**
@@ -197,6 +194,69 @@ class SymfonyStyle extends OutputStyle
}
/**
+ * Formats a horizontal table.
+ */
+ public function horizontalTable(array $headers, array $rows)
+ {
+ $style = clone Table::getStyleDefinition('symfony-style-guide');
+ $style->setCellHeaderFormat('<info>%s</info>');
+
+ $table = new Table($this);
+ $table->setHeaders($headers);
+ $table->setRows($rows);
+ $table->setStyle($style);
+ $table->setHorizontal(true);
+
+ $table->render();
+ $this->newLine();
+ }
+
+ /**
+ * Formats a list of key/value horizontally.
+ *
+ * Each row can be one of:
+ * * 'A title'
+ * * ['key' => 'value']
+ * * new TableSeparator()
+ *
+ * @param string|array|TableSeparator ...$list
+ */
+ public function definitionList(...$list)
+ {
+ $style = clone Table::getStyleDefinition('symfony-style-guide');
+ $style->setCellHeaderFormat('<info>%s</info>');
+
+ $table = new Table($this);
+ $headers = [];
+ $row = [];
+ foreach ($list as $value) {
+ if ($value instanceof TableSeparator) {
+ $headers[] = $value;
+ $row[] = $value;
+ continue;
+ }
+ if (\is_string($value)) {
+ $headers[] = new TableCell($value, ['colspan' => 2]);
+ $row[] = null;
+ continue;
+ }
+ if (!\is_array($value)) {
+ throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.');
+ }
+ $headers[] = key($value);
+ $row[] = current($value);
+ }
+
+ $table->setHeaders($headers);
+ $table->setRows([$row]);
+ $table->setHorizontal();
+ $table->setStyle($style);
+
+ $table->render();
+ $this->newLine();
+ }
+
+ /**
* {@inheritdoc}
*/
public function ask($question, $default = null, $validator = null)
@@ -235,7 +295,7 @@ class SymfonyStyle extends OutputStyle
{
if (null !== $default) {
$values = array_flip($choices);
- $default = $values[$default];
+ $default = $values[$default] ?? $default;
}
return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));
@@ -275,7 +335,7 @@ class SymfonyStyle extends OutputStyle
{
$progressBar = parent::createProgressBar($max);
- if ('\\' !== DIRECTORY_SEPARATOR) {
+ if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
$progressBar->setEmptyBarCharacter('░'); // light shade character \u2591
$progressBar->setProgressCharacter('');
$progressBar->setBarCharacter('▓'); // dark shade character \u2593
@@ -285,9 +345,7 @@ class SymfonyStyle extends OutputStyle
}
/**
- * @param Question $question
- *
- * @return string
+ * @return mixed
*/
public function askQuestion(Question $question)
{
@@ -314,8 +372,14 @@ class SymfonyStyle extends OutputStyle
*/
public function writeln($messages, $type = self::OUTPUT_NORMAL)
{
- parent::writeln($messages, $type);
- $this->bufferedOutput->writeln($this->reduceBuffer($messages), $type);
+ if (!is_iterable($messages)) {
+ $messages = [$messages];
+ }
+
+ foreach ($messages as $message) {
+ parent::writeln($message, $type);
+ $this->writeBuffer($message, true, $type);
+ }
}
/**
@@ -323,8 +387,14 @@ class SymfonyStyle extends OutputStyle
*/
public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
{
- parent::write($messages, $newline, $type);
- $this->bufferedOutput->write($this->reduceBuffer($messages), $newline, $type);
+ if (!is_iterable($messages)) {
+ $messages = [$messages];
+ }
+
+ foreach ($messages as $message) {
+ parent::write($message, $newline, $type);
+ $this->writeBuffer($message, $newline, $type);
+ }
}
/**
@@ -337,9 +407,16 @@ class SymfonyStyle extends OutputStyle
}
/**
- * @return ProgressBar
+ * Returns a new instance which makes use of stderr if available.
+ *
+ * @return self
*/
- private function getProgressBar()
+ public function getErrorStyle()
+ {
+ return new self($this->input, $this->getErrorOutput());
+ }
+
+ private function getProgressBar(): ProgressBar
{
if (!$this->progressBar) {
throw new RuntimeException('The ProgressBar is not started.');
@@ -348,52 +425,43 @@ class SymfonyStyle extends OutputStyle
return $this->progressBar;
}
- private function getTerminalWidth()
+ private function autoPrependBlock(): void
{
- $application = new Application();
- $dimensions = $application->getTerminalDimensions();
-
- return $dimensions[0] ?: self::MAX_LINE_LENGTH;
- }
-
- private function autoPrependBlock()
- {
- $chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
+ $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
if (!isset($chars[0])) {
- return $this->newLine(); //empty history, so we should start with a new line.
+ $this->newLine(); //empty history, so we should start with a new line.
+
+ return;
}
//Prepend new line for each non LF chars (This means no blank line was output before)
$this->newLine(2 - substr_count($chars, "\n"));
}
- private function autoPrependText()
+ private function autoPrependText(): void
{
$fetched = $this->bufferedOutput->fetch();
//Prepend new line if last char isn't EOL:
- if ("\n" !== substr($fetched, -1)) {
+ if (!str_ends_with($fetched, "\n")) {
$this->newLine();
}
}
- private function reduceBuffer($messages)
+ private function writeBuffer(string $message, bool $newLine, int $type): void
{
- // We need to know if the two last chars are PHP_EOL
- // Preserve the last 4 chars inserted (PHP_EOL on windows is two chars) in the history buffer
- return array_map(function ($value) {
- return substr($value, -4);
- }, array_merge(array($this->bufferedOutput->fetch()), (array) $messages));
+ // We need to know if the last chars are PHP_EOL
+ $this->bufferedOutput->write($message, $newLine, $type);
}
- private function createBlock($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = false)
+ private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array
{
$indentLength = 0;
$prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
- $lines = array();
+ $lines = [];
if (null !== $type) {
$type = sprintf('[%s] ', $type);
- $indentLength = strlen($type);
+ $indentLength = \strlen($type);
$lineIndentation = str_repeat(' ', $indentLength);
}
@@ -403,9 +471,14 @@ class SymfonyStyle extends OutputStyle
$message = OutputFormatter::escape($message);
}
- $lines = array_merge($lines, explode(PHP_EOL, wordwrap($message, $this->lineLength - $prefixLength - $indentLength, PHP_EOL, true)));
+ $decorationLength = Helper::strlen($message) - Helper::strlenWithoutDecoration($this->getFormatter(), $message);
+ $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength);
+ $messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true));
+ foreach ($messageLines as $messageLine) {
+ $lines[] = $messageLine;
+ }
- if (count($messages) > 1 && $key < count($messages) - 1) {
+ if (\count($messages) > 1 && $key < \count($messages) - 1) {
$lines[] = '';
}
}
@@ -423,7 +496,7 @@ class SymfonyStyle extends OutputStyle
}
$line = $prefix.$line;
- $line .= str_repeat(' ', $this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line));
+ $line .= str_repeat(' ', max($this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line), 0));
if ($style) {
$line = sprintf('<%s>%s</>', $style, $line);
diff --git a/vendor/symfony/console/Terminal.php b/vendor/symfony/console/Terminal.php
new file mode 100644
index 0000000..5e5a3c2
--- /dev/null
+++ b/vendor/symfony/console/Terminal.php
@@ -0,0 +1,174 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console;
+
+class Terminal
+{
+ private static $width;
+ private static $height;
+ private static $stty;
+
+ /**
+ * Gets the terminal width.
+ *
+ * @return int
+ */
+ public function getWidth()
+ {
+ $width = getenv('COLUMNS');
+ if (false !== $width) {
+ return (int) trim($width);
+ }
+
+ if (null === self::$width) {
+ self::initDimensions();
+ }
+
+ return self::$width ?: 80;
+ }
+
+ /**
+ * Gets the terminal height.
+ *
+ * @return int
+ */
+ public function getHeight()
+ {
+ $height = getenv('LINES');
+ if (false !== $height) {
+ return (int) trim($height);
+ }
+
+ if (null === self::$height) {
+ self::initDimensions();
+ }
+
+ return self::$height ?: 50;
+ }
+
+ /**
+ * @internal
+ *
+ * @return bool
+ */
+ public static function hasSttyAvailable()
+ {
+ if (null !== self::$stty) {
+ return self::$stty;
+ }
+
+ // skip check if exec function is disabled
+ if (!\function_exists('exec')) {
+ return false;
+ }
+
+ exec('stty 2>&1', $output, $exitcode);
+
+ return self::$stty = 0 === $exitcode;
+ }
+
+ private static function initDimensions()
+ {
+ if ('\\' === \DIRECTORY_SEPARATOR) {
+ if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
+ // extract [w, H] from "wxh (WxH)"
+ // or [w, h] from "wxh"
+ self::$width = (int) $matches[1];
+ self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];
+ } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) {
+ // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash)
+ // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT
+ self::initDimensionsUsingStty();
+ } elseif (null !== $dimensions = self::getConsoleMode()) {
+ // extract [w, h] from "wxh"
+ self::$width = (int) $dimensions[0];
+ self::$height = (int) $dimensions[1];
+ }
+ } else {
+ self::initDimensionsUsingStty();
+ }
+ }
+
+ /**
+ * Returns whether STDOUT has vt100 support (some Windows 10+ configurations).
+ */
+ private static function hasVt100Support(): bool
+ {
+ return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w'));
+ }
+
+ /**
+ * Initializes dimensions using the output of an stty columns line.
+ */
+ private static function initDimensionsUsingStty()
+ {
+ if ($sttyString = self::getSttyColumns()) {
+ if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) {
+ // extract [w, h] from "rows h; columns w;"
+ self::$width = (int) $matches[2];
+ self::$height = (int) $matches[1];
+ } elseif (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) {
+ // extract [w, h] from "; h rows; w columns"
+ self::$width = (int) $matches[2];
+ self::$height = (int) $matches[1];
+ }
+ }
+ }
+
+ /**
+ * Runs and parses mode CON if it's available, suppressing any error output.
+ *
+ * @return int[]|null An array composed of the width and the height or null if it could not be parsed
+ */
+ private static function getConsoleMode(): ?array
+ {
+ $info = self::readFromProcess('mode CON');
+
+ if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
+ return null;
+ }
+
+ return [(int) $matches[2], (int) $matches[1]];
+ }
+
+ /**
+ * Runs and parses stty -a if it's available, suppressing any error output.
+ */
+ private static function getSttyColumns(): ?string
+ {
+ return self::readFromProcess('stty -a | grep columns');
+ }
+
+ private static function readFromProcess(string $command): ?string
+ {
+ if (!\function_exists('proc_open')) {
+ return null;
+ }
+
+ $descriptorspec = [
+ 1 => ['pipe', 'w'],
+ 2 => ['pipe', 'w'],
+ ];
+
+ $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
+ if (!\is_resource($process)) {
+ return null;
+ }
+
+ $info = stream_get_contents($pipes[1]);
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+ proc_close($process);
+
+ return $info;
+ }
+}
diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php
index c0f8c72..ce4e5c1 100644
--- a/vendor/symfony/console/Tester/ApplicationTester.php
+++ b/vendor/symfony/console/Tester/ApplicationTester.php
@@ -13,10 +13,6 @@ namespace Symfony\Component\Console\Tester;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\ConsoleOutput;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Output\StreamOutput;
/**
* Eases the testing of console applications.
@@ -30,14 +26,11 @@ use Symfony\Component\Console\Output\StreamOutput;
*/
class ApplicationTester
{
+ use TesterTrait;
+
private $application;
private $input;
private $statusCode;
- /**
- * @var OutputInterface
- */
- private $output;
- private $captureStreamsIndependently = false;
public function __construct(Application $application)
{
@@ -59,118 +52,39 @@ class ApplicationTester
*
* @return int The command exit code
*/
- public function run(array $input, $options = array())
+ public function run(array $input, $options = [])
{
- $this->input = new ArrayInput($input);
- if (isset($options['interactive'])) {
- $this->input->setInteractive($options['interactive']);
- }
+ $prevShellVerbosity = getenv('SHELL_VERBOSITY');
- $this->captureStreamsIndependently = array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
- if (!$this->captureStreamsIndependently) {
- $this->output = new StreamOutput(fopen('php://memory', 'w', false));
- if (isset($options['decorated'])) {
- $this->output->setDecorated($options['decorated']);
+ try {
+ $this->input = new ArrayInput($input);
+ if (isset($options['interactive'])) {
+ $this->input->setInteractive($options['interactive']);
}
- if (isset($options['verbosity'])) {
- $this->output->setVerbosity($options['verbosity']);
- }
- } else {
- $this->output = new ConsoleOutput(
- isset($options['verbosity']) ? $options['verbosity'] : ConsoleOutput::VERBOSITY_NORMAL,
- isset($options['decorated']) ? $options['decorated'] : null
- );
-
- $errorOutput = new StreamOutput(fopen('php://memory', 'w', false));
- $errorOutput->setFormatter($this->output->getFormatter());
- $errorOutput->setVerbosity($this->output->getVerbosity());
- $errorOutput->setDecorated($this->output->isDecorated());
-
- $reflectedOutput = new \ReflectionObject($this->output);
- $strErrProperty = $reflectedOutput->getProperty('stderr');
- $strErrProperty->setAccessible(true);
- $strErrProperty->setValue($this->output, $errorOutput);
-
- $reflectedParent = $reflectedOutput->getParentClass();
- $streamProperty = $reflectedParent->getProperty('stream');
- $streamProperty->setAccessible(true);
- $streamProperty->setValue($this->output, fopen('php://memory', 'w', false));
- }
-
- return $this->statusCode = $this->application->run($this->input, $this->output);
- }
-
- /**
- * Gets the display returned by the last execution of the application.
- *
- * @param bool $normalize Whether to normalize end of lines to \n or not
- *
- * @return string The display
- */
- public function getDisplay($normalize = false)
- {
- rewind($this->output->getStream());
-
- $display = stream_get_contents($this->output->getStream());
-
- if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
- }
- return $display;
- }
-
- /**
- * Gets the output written to STDERR by the application.
- *
- * @param bool $normalize Whether to normalize end of lines to \n or not
- *
- * @return string
- */
- public function getErrorOutput($normalize = false)
- {
- if (!$this->captureStreamsIndependently) {
- throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.');
- }
-
- rewind($this->output->getErrorOutput()->getStream());
-
- $display = stream_get_contents($this->output->getErrorOutput()->getStream());
+ if ($this->inputs) {
+ $this->input->setStream(self::createStream($this->inputs));
+ }
- if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
+ $this->initOutput($options);
+
+ return $this->statusCode = $this->application->run($this->input, $this->output);
+ } finally {
+ // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it
+ // to its previous value to avoid one test's verbosity to spread to the following tests
+ if (false === $prevShellVerbosity) {
+ if (\function_exists('putenv')) {
+ @putenv('SHELL_VERBOSITY');
+ }
+ unset($_ENV['SHELL_VERBOSITY']);
+ unset($_SERVER['SHELL_VERBOSITY']);
+ } else {
+ if (\function_exists('putenv')) {
+ @putenv('SHELL_VERBOSITY='.$prevShellVerbosity);
+ }
+ $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity;
+ $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity;
+ }
}
-
- return $display;
- }
-
- /**
- * Gets the input instance used by the last execution of the application.
- *
- * @return InputInterface The current input instance
- */
- public function getInput()
- {
- return $this->input;
- }
-
- /**
- * Gets the output instance used by the last execution of the application.
- *
- * @return OutputInterface The current output instance
- */
- public function getOutput()
- {
- return $this->output;
- }
-
- /**
- * Gets the status code returned by the last execution of the application.
- *
- * @return int The status code
- */
- public function getStatusCode()
- {
- return $this->statusCode;
}
}
diff --git a/vendor/symfony/console/Tester/CommandTester.php b/vendor/symfony/console/Tester/CommandTester.php
index f95298b..57efc9a 100644
--- a/vendor/symfony/console/Tester/CommandTester.php
+++ b/vendor/symfony/console/Tester/CommandTester.php
@@ -13,27 +13,21 @@ namespace Symfony\Component\Console\Tester;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Output\StreamOutput;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
/**
* Eases the testing of console commands.
*
* @author Fabien Potencier <fabien@symfony.com>
+ * @author Robin Chalas <robin.chalas@gmail.com>
*/
class CommandTester
{
+ use TesterTrait;
+
private $command;
private $input;
- private $output;
private $statusCode;
- /**
- * Constructor.
- *
- * @param Command $command A Command instance to test
- */
public function __construct(Command $command)
{
$this->command = $command;
@@ -44,16 +38,17 @@ class CommandTester
*
* Available execution options:
*
- * * interactive: Sets the input interactive flag
- * * decorated: Sets the output decorated flag
- * * verbosity: Sets the output verbosity flag
+ * * interactive: Sets the input interactive flag
+ * * decorated: Sets the output decorated flag
+ * * verbosity: Sets the output verbosity flag
+ * * capture_stderr_separately: Make output of stdOut and stdErr separately available
*
* @param array $input An array of command arguments and options
* @param array $options An array of execution options
*
* @return int The command exit code
*/
- public function execute(array $input, array $options = array())
+ public function execute(array $input, array $options = [])
{
// set the command name automatically if the application requires
// this argument and no command name was passed
@@ -61,72 +56,23 @@ class CommandTester
&& (null !== $application = $this->command->getApplication())
&& $application->getDefinition()->hasArgument('command')
) {
- $input = array_merge(array('command' => $this->command->getName()), $input);
+ $input = array_merge(['command' => $this->command->getName()], $input);
}
$this->input = new ArrayInput($input);
+ // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN.
+ $this->input->setStream(self::createStream($this->inputs));
+
if (isset($options['interactive'])) {
$this->input->setInteractive($options['interactive']);
}
- $this->output = new StreamOutput(fopen('php://memory', 'w', false));
- if (isset($options['decorated'])) {
- $this->output->setDecorated($options['decorated']);
- }
- if (isset($options['verbosity'])) {
- $this->output->setVerbosity($options['verbosity']);
- }
-
- return $this->statusCode = $this->command->run($this->input, $this->output);
- }
-
- /**
- * Gets the display returned by the last execution of the command.
- *
- * @param bool $normalize Whether to normalize end of lines to \n or not
- *
- * @return string The display
- */
- public function getDisplay($normalize = false)
- {
- rewind($this->output->getStream());
-
- $display = stream_get_contents($this->output->getStream());
-
- if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
+ if (!isset($options['decorated'])) {
+ $options['decorated'] = false;
}
- return $display;
- }
-
- /**
- * Gets the input instance used by the last execution of the command.
- *
- * @return InputInterface The current input instance
- */
- public function getInput()
- {
- return $this->input;
- }
-
- /**
- * Gets the output instance used by the last execution of the command.
- *
- * @return OutputInterface The current output instance
- */
- public function getOutput()
- {
- return $this->output;
- }
+ $this->initOutput($options);
- /**
- * Gets the status code returned by the last execution of the application.
- *
- * @return int The status code
- */
- public function getStatusCode()
- {
- return $this->statusCode;
+ return $this->statusCode = $this->command->run($this->input, $this->output);
}
}
diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php
new file mode 100644
index 0000000..27d5985
--- /dev/null
+++ b/vendor/symfony/console/Tester/TesterTrait.php
@@ -0,0 +1,180 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tester;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\StreamOutput;
+
+/**
+ * @author Amrouche Hamza <hamza.simperfit@gmail.com>
+ */
+trait TesterTrait
+{
+ /** @var StreamOutput */
+ private $output;
+ private $inputs = [];
+ private $captureStreamsIndependently = false;
+
+ /**
+ * Gets the display returned by the last execution of the command or application.
+ *
+ * @param bool $normalize Whether to normalize end of lines to \n or not
+ *
+ * @return string The display
+ */
+ public function getDisplay($normalize = false)
+ {
+ if (null === $this->output) {
+ throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?');
+ }
+
+ rewind($this->output->getStream());
+
+ $display = stream_get_contents($this->output->getStream());
+
+ if ($normalize) {
+ $display = str_replace(\PHP_EOL, "\n", $display);
+ }
+
+ return $display;
+ }
+
+ /**
+ * Gets the output written to STDERR by the application.
+ *
+ * @param bool $normalize Whether to normalize end of lines to \n or not
+ *
+ * @return string
+ */
+ public function getErrorOutput($normalize = false)
+ {
+ if (!$this->captureStreamsIndependently) {
+ throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.');
+ }
+
+ rewind($this->output->getErrorOutput()->getStream());
+
+ $display = stream_get_contents($this->output->getErrorOutput()->getStream());
+
+ if ($normalize) {
+ $display = str_replace(\PHP_EOL, "\n", $display);
+ }
+
+ return $display;
+ }
+
+ /**
+ * Gets the input instance used by the last execution of the command or application.
+ *
+ * @return InputInterface The current input instance
+ */
+ public function getInput()
+ {
+ return $this->input;
+ }
+
+ /**
+ * Gets the output instance used by the last execution of the command or application.
+ *
+ * @return OutputInterface The current output instance
+ */
+ public function getOutput()
+ {
+ return $this->output;
+ }
+
+ /**
+ * Gets the status code returned by the last execution of the command or application.
+ *
+ * @return int The status code
+ */
+ public function getStatusCode()
+ {
+ return $this->statusCode;
+ }
+
+ /**
+ * Sets the user inputs.
+ *
+ * @param array $inputs An array of strings representing each input
+ * passed to the command input stream
+ *
+ * @return $this
+ */
+ public function setInputs(array $inputs)
+ {
+ $this->inputs = $inputs;
+
+ return $this;
+ }
+
+ /**
+ * Initializes the output property.
+ *
+ * Available options:
+ *
+ * * decorated: Sets the output decorated flag
+ * * verbosity: Sets the output verbosity flag
+ * * capture_stderr_separately: Make output of stdOut and stdErr separately available
+ */
+ private function initOutput(array $options)
+ {
+ $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
+ if (!$this->captureStreamsIndependently) {
+ $this->output = new StreamOutput(fopen('php://memory', 'w', false));
+ if (isset($options['decorated'])) {
+ $this->output->setDecorated($options['decorated']);
+ }
+ if (isset($options['verbosity'])) {
+ $this->output->setVerbosity($options['verbosity']);
+ }
+ } else {
+ $this->output = new ConsoleOutput(
+ $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL,
+ $options['decorated'] ?? null
+ );
+
+ $errorOutput = new StreamOutput(fopen('php://memory', 'w', false));
+ $errorOutput->setFormatter($this->output->getFormatter());
+ $errorOutput->setVerbosity($this->output->getVerbosity());
+ $errorOutput->setDecorated($this->output->isDecorated());
+
+ $reflectedOutput = new \ReflectionObject($this->output);
+ $strErrProperty = $reflectedOutput->getProperty('stderr');
+ $strErrProperty->setAccessible(true);
+ $strErrProperty->setValue($this->output, $errorOutput);
+
+ $reflectedParent = $reflectedOutput->getParentClass();
+ $streamProperty = $reflectedParent->getProperty('stream');
+ $streamProperty->setAccessible(true);
+ $streamProperty->setValue($this->output, fopen('php://memory', 'w', false));
+ }
+ }
+
+ /**
+ * @return resource
+ */
+ private static function createStream(array $inputs)
+ {
+ $stream = fopen('php://memory', 'r+', false);
+
+ foreach ($inputs as $input) {
+ fwrite($stream, $input.\PHP_EOL);
+ }
+
+ rewind($stream);
+
+ return $stream;
+ }
+}
diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json
index ed02e96..90cbd24 100644
--- a/vendor/symfony/console/composer.json
+++ b/vendor/symfony/console/composer.json
@@ -1,7 +1,7 @@
{
"name": "symfony/console",
"type": "library",
- "description": "Symfony Console Component",
+ "description": "Eases the creation of beautiful and testable command line interfaces",
"keywords": [],
"homepage": "https://symfony.com",
"license": "MIT",
@@ -16,30 +16,42 @@
}
],
"require": {
- "php": ">=5.5.9",
+ "php": ">=7.1.3",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/debug": "~2.8|~3.0"
+ "symfony/polyfill-php73": "^1.8",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2"
},
"require-dev": {
- "symfony/event-dispatcher": "~2.8|~3.0",
- "symfony/process": "~2.8|~3.0",
- "psr/log": "~1.0"
+ "symfony/config": "^3.4|^4.0|^5.0",
+ "symfony/event-dispatcher": "^4.3",
+ "symfony/dependency-injection": "^3.4|^4.0|^5.0",
+ "symfony/lock": "^4.4|^5.0",
+ "symfony/process": "^3.4|^4.0|^5.0",
+ "symfony/var-dumper": "^4.3|^5.0",
+ "psr/log": "^1|^2"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0"
},
"suggest": {
"symfony/event-dispatcher": "",
+ "symfony/lock": "",
"symfony/process": "",
"psr/log": "For using the console logger"
},
+ "conflict": {
+ "psr/log": ">=3",
+ "symfony/dependency-injection": "<3.4",
+ "symfony/event-dispatcher": "<4.3|>=5",
+ "symfony/lock": "<4.4",
+ "symfony/process": "<3.3"
+ },
"autoload": {
"psr-4": { "Symfony\\Component\\Console\\": "" },
"exclude-from-classmap": [
"/Tests/"
]
},
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
- }
+ "minimum-stability": "dev"
}
diff --git a/vendor/symfony/console/phpunit.xml.dist b/vendor/symfony/console/phpunit.xml.dist
deleted file mode 100644
index 8c09554..0000000
--- a/vendor/symfony/console/phpunit.xml.dist
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
- backupGlobals="false"
- colors="true"
- bootstrap="vendor/autoload.php"
->
- <php>
- <ini name="error_reporting" value="-1" />
- </php>
-
- <testsuites>
- <testsuite name="Symfony Console Component Test Suite">
- <directory>./Tests/</directory>
- </testsuite>
- </testsuites>
-
- <filter>
- <whitelist>
- <directory>./</directory>
- <exclude>
- <directory>./Resources</directory>
- <directory>./Tests</directory>
- <directory>./vendor</directory>
- </exclude>
- </whitelist>
- </filter>
-
- <listeners>
- <listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
- <arguments>
- <array>
- <element key="time-sensitive"><string>Symfony\Component\Console</string></element>
- </array>
- </arguments>
- </listener>
- </listeners>
-</phpunit>
diff --git a/vendor/symfony/debug/BufferingLogger.php b/vendor/symfony/debug/BufferingLogger.php
deleted file mode 100644
index a2ed75b..0000000
--- a/vendor/symfony/debug/BufferingLogger.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-use Psr\Log\AbstractLogger;
-
-/**
- * A buffering logger that stacks logs for later.
- *
- * @author Nicolas Grekas <p@tchwork.com>
- */
-class BufferingLogger extends AbstractLogger
-{
- private $logs = array();
-
- public function log($level, $message, array $context = array())
- {
- $this->logs[] = array($level, $message, $context);
- }
-
- public function cleanLogs()
- {
- $logs = $this->logs;
- $this->logs = array();
-
- return $logs;
- }
-}
diff --git a/vendor/symfony/debug/CHANGELOG.md b/vendor/symfony/debug/CHANGELOG.md
deleted file mode 100644
index c81bccf..0000000
--- a/vendor/symfony/debug/CHANGELOG.md
+++ /dev/null
@@ -1,47 +0,0 @@
-CHANGELOG
-=========
-
-3.0.0
------
-
-* removed classes, methods and interfaces deprecated in 2.x
-
-2.8.0
------
-
-* added BufferingLogger for errors that happen before a proper logger is configured
-* allow throwing from `__toString()` with `return trigger_error($e, E_USER_ERROR);`
-* deprecate ExceptionHandler::createResponse
-
-2.7.0
------
-
-* added deprecations checking for parent interfaces/classes to DebugClassLoader
-* added ZTS support to symfony_debug extension
-* added symfony_debug_backtrace() to symfony_debug extension
- to track the backtrace of fatal errors
-
-2.6.0
------
-
-* generalized ErrorHandler and ExceptionHandler,
- with some new methods and others deprecated
-* enhanced error messages for uncaught exceptions
-
-2.5.0
------
-
-* added ExceptionHandler::setHandler()
-* added UndefinedMethodFatalErrorHandler
-* deprecated DummyException
-
-2.4.0
------
-
- * added a DebugClassLoader able to wrap any autoloader providing a findFile method
- * improved error messages for not found classes and functions
-
-2.3.0
------
-
- * added the component
diff --git a/vendor/symfony/debug/Debug.php b/vendor/symfony/debug/Debug.php
deleted file mode 100644
index e3665ae..0000000
--- a/vendor/symfony/debug/Debug.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-/**
- * Registers all the debug tools.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class Debug
-{
- private static $enabled = false;
-
- /**
- * Enables the debug tools.
- *
- * This method registers an error handler and an exception handler.
- *
- * If the Symfony ClassLoader component is available, a special
- * class loader is also registered.
- *
- * @param int $errorReportingLevel The level of error reporting you want
- * @param bool $displayErrors Whether to display errors (for development) or just log them (for production)
- */
- public static function enable($errorReportingLevel = E_ALL, $displayErrors = true)
- {
- if (static::$enabled) {
- return;
- }
-
- static::$enabled = true;
-
- if (null !== $errorReportingLevel) {
- error_reporting($errorReportingLevel);
- } else {
- error_reporting(E_ALL);
- }
-
- if ('cli' !== PHP_SAPI) {
- ini_set('display_errors', 0);
- ExceptionHandler::register();
- } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
- // CLI - display errors only if they're not already logged to STDERR
- ini_set('display_errors', 1);
- }
- if ($displayErrors) {
- ErrorHandler::register(new ErrorHandler(new BufferingLogger()));
- } else {
- ErrorHandler::register()->throwAt(0, true);
- }
-
- DebugClassLoader::enable();
- }
-}
diff --git a/vendor/symfony/debug/DebugClassLoader.php b/vendor/symfony/debug/DebugClassLoader.php
deleted file mode 100644
index 9fd6887..0000000
--- a/vendor/symfony/debug/DebugClassLoader.php
+++ /dev/null
@@ -1,314 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-/**
- * Autoloader checking if the class is really defined in the file found.
- *
- * The ClassLoader will wrap all registered autoloaders
- * and will throw an exception if a file is found but does
- * not declare the class.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Christophe Coevoet <stof@notk.org>
- * @author Nicolas Grekas <p@tchwork.com>
- */
-class DebugClassLoader
-{
- private $classLoader;
- private $isFinder;
- private static $caseCheck;
- private static $deprecated = array();
- private static $php7Reserved = array('int', 'float', 'bool', 'string', 'true', 'false', 'null');
- private static $darwinCache = array('/' => array('/', array()));
-
- /**
- * Constructor.
- *
- * @param callable $classLoader A class loader
- */
- public function __construct(callable $classLoader)
- {
- $this->classLoader = $classLoader;
- $this->isFinder = is_array($classLoader) && method_exists($classLoader[0], 'findFile');
-
- if (!isset(self::$caseCheck)) {
- $file = file_exists(__FILE__) ? __FILE__ : rtrim(realpath('.'), DIRECTORY_SEPARATOR);
- $i = strrpos($file, DIRECTORY_SEPARATOR);
- $dir = substr($file, 0, 1 + $i);
- $file = substr($file, 1 + $i);
- $test = strtoupper($file) === $file ? strtolower($file) : strtoupper($file);
- $test = realpath($dir.$test);
-
- if (false === $test || false === $i) {
- // filesystem is case sensitive
- self::$caseCheck = 0;
- } elseif (substr($test, -strlen($file)) === $file) {
- // filesystem is case insensitive and realpath() normalizes the case of characters
- self::$caseCheck = 1;
- } elseif (false !== stripos(PHP_OS, 'darwin')) {
- // on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters
- self::$caseCheck = 2;
- } else {
- // filesystem case checks failed, fallback to disabling them
- self::$caseCheck = 0;
- }
- }
- }
-
- /**
- * Gets the wrapped class loader.
- *
- * @return callable The wrapped class loader
- */
- public function getClassLoader()
- {
- return $this->classLoader;
- }
-
- /**
- * Wraps all autoloaders.
- */
- public static function enable()
- {
- // Ensures we don't hit https://bugs.php.net/42098
- class_exists('Symfony\Component\Debug\ErrorHandler');
- class_exists('Psr\Log\LogLevel');
-
- if (!is_array($functions = spl_autoload_functions())) {
- return;
- }
-
- foreach ($functions as $function) {
- spl_autoload_unregister($function);
- }
-
- foreach ($functions as $function) {
- if (!is_array($function) || !$function[0] instanceof self) {
- $function = array(new static($function), 'loadClass');
- }
-
- spl_autoload_register($function);
- }
- }
-
- /**
- * Disables the wrapping.
- */
- public static function disable()
- {
- if (!is_array($functions = spl_autoload_functions())) {
- return;
- }
-
- foreach ($functions as $function) {
- spl_autoload_unregister($function);
- }
-
- foreach ($functions as $function) {
- if (is_array($function) && $function[0] instanceof self) {
- $function = $function[0]->getClassLoader();
- }
-
- spl_autoload_register($function);
- }
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- *
- * @throws \RuntimeException
- */
- public function loadClass($class)
- {
- ErrorHandler::stackErrors();
-
- try {
- if ($this->isFinder) {
- if ($file = $this->classLoader[0]->findFile($class)) {
- require_once $file;
- }
- } else {
- call_user_func($this->classLoader, $class);
- $file = false;
- }
- } finally {
- ErrorHandler::unstackErrors();
- }
-
- $exists = class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
-
- if ('\\' === $class[0]) {
- $class = substr($class, 1);
- }
-
- if ($exists) {
- $refl = new \ReflectionClass($class);
- $name = $refl->getName();
-
- if ($name !== $class && 0 === strcasecmp($name, $class)) {
- throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: %s vs %s', $class, $name));
- }
-
- if (in_array(strtolower($refl->getShortName()), self::$php7Reserved)) {
- @trigger_error(sprintf('%s uses a reserved class name (%s) that will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED);
- } elseif (preg_match('#\n \* @deprecated (.*?)\r?\n \*(?: @|/$)#s', $refl->getDocComment(), $notice)) {
- self::$deprecated[$name] = preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]);
- } else {
- if (2 > $len = 1 + (strpos($name, '\\', 1 + strpos($name, '\\')) ?: strpos($name, '_'))) {
- $len = 0;
- $ns = '';
- } else {
- switch ($ns = substr($name, 0, $len)) {
- case 'Symfony\Bridge\\':
- case 'Symfony\Bundle\\':
- case 'Symfony\Component\\':
- $ns = 'Symfony\\';
- $len = strlen($ns);
- break;
- }
- }
- $parent = get_parent_class($class);
-
- if (!$parent || strncmp($ns, $parent, $len)) {
- if ($parent && isset(self::$deprecated[$parent]) && strncmp($ns, $parent, $len)) {
- @trigger_error(sprintf('The %s class extends %s that is deprecated %s', $name, $parent, self::$deprecated[$parent]), E_USER_DEPRECATED);
- }
-
- $parentInterfaces = array();
- $deprecatedInterfaces = array();
- if ($parent) {
- foreach (class_implements($parent) as $interface) {
- $parentInterfaces[$interface] = 1;
- }
- }
-
- foreach ($refl->getInterfaceNames() as $interface) {
- if (isset(self::$deprecated[$interface]) && strncmp($ns, $interface, $len)) {
- $deprecatedInterfaces[] = $interface;
- }
- foreach (class_implements($interface) as $interface) {
- $parentInterfaces[$interface] = 1;
- }
- }
-
- foreach ($deprecatedInterfaces as $interface) {
- if (!isset($parentInterfaces[$interface])) {
- @trigger_error(sprintf('The %s %s %s that is deprecated %s', $name, $refl->isInterface() ? 'interface extends' : 'class implements', $interface, self::$deprecated[$interface]), E_USER_DEPRECATED);
- }
- }
- }
- }
- }
-
- if ($file) {
- if (!$exists) {
- if (false !== strpos($class, '/')) {
- throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
- }
-
- throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
- }
- if (self::$caseCheck) {
- $real = explode('\\', $class.strrchr($file, '.'));
- $tail = explode(DIRECTORY_SEPARATOR, str_replace('/', DIRECTORY_SEPARATOR, $file));
-
- $i = count($tail) - 1;
- $j = count($real) - 1;
-
- while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
- --$i;
- --$j;
- }
-
- array_splice($tail, 0, $i + 1);
- }
- if (self::$caseCheck && $tail) {
- $tail = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $tail);
- $tailLen = strlen($tail);
- $real = $refl->getFileName();
-
- if (2 === self::$caseCheck) {
- // realpath() on MacOSX doesn't normalize the case of characters
-
- $i = 1 + strrpos($real, '/');
- $file = substr($real, $i);
- $real = substr($real, 0, $i);
-
- if (isset(self::$darwinCache[$real])) {
- $kDir = $real;
- } else {
- $kDir = strtolower($real);
-
- if (isset(self::$darwinCache[$kDir])) {
- $real = self::$darwinCache[$kDir][0];
- } else {
- $dir = getcwd();
- chdir($real);
- $real = getcwd().'/';
- chdir($dir);
-
- $dir = $real;
- $k = $kDir;
- $i = strlen($dir) - 1;
- while (!isset(self::$darwinCache[$k])) {
- self::$darwinCache[$k] = array($dir, array());
- self::$darwinCache[$dir] = &self::$darwinCache[$k];
-
- while ('/' !== $dir[--$i]) {
- }
- $k = substr($k, 0, ++$i);
- $dir = substr($dir, 0, $i--);
- }
- }
- }
-
- $dirFiles = self::$darwinCache[$kDir][1];
-
- if (isset($dirFiles[$file])) {
- $kFile = $file;
- } else {
- $kFile = strtolower($file);
-
- if (!isset($dirFiles[$kFile])) {
- foreach (scandir($real, 2) as $f) {
- if ('.' !== $f[0]) {
- $dirFiles[$f] = $f;
- if ($f === $file) {
- $kFile = $k = $file;
- } elseif ($f !== $k = strtolower($f)) {
- $dirFiles[$k] = $f;
- }
- }
- }
- self::$darwinCache[$kDir][1] = $dirFiles;
- }
- }
-
- $real .= $dirFiles[$kFile];
- }
-
- if (0 === substr_compare($real, $tail, -$tailLen, $tailLen, true)
- && 0 !== substr_compare($real, $tail, -$tailLen, $tailLen, false)
- ) {
- throw new \RuntimeException(sprintf('Case mismatch between class and real file names: %s vs %s in %s', substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1)));
- }
- }
-
- return true;
- }
- }
-}
diff --git a/vendor/symfony/debug/ErrorHandler.php b/vendor/symfony/debug/ErrorHandler.php
deleted file mode 100644
index b089737..0000000
--- a/vendor/symfony/debug/ErrorHandler.php
+++ /dev/null
@@ -1,666 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-use Psr\Log\LogLevel;
-use Psr\Log\LoggerInterface;
-use Symfony\Component\Debug\Exception\ContextErrorException;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\Exception\FatalThrowableError;
-use Symfony\Component\Debug\Exception\OutOfMemoryException;
-use Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
-use Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
-use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
-use Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface;
-
-/**
- * A generic ErrorHandler for the PHP engine.
- *
- * Provides five bit fields that control how errors are handled:
- * - thrownErrors: errors thrown as \ErrorException
- * - loggedErrors: logged errors, when not @-silenced
- * - scopedErrors: errors thrown or logged with their local context
- * - tracedErrors: errors logged with their stack trace, only once for repeated errors
- * - screamedErrors: never @-silenced errors
- *
- * Each error level can be logged by a dedicated PSR-3 logger object.
- * Screaming only applies to logging.
- * Throwing takes precedence over logging.
- * Uncaught exceptions are logged as E_ERROR.
- * E_DEPRECATED and E_USER_DEPRECATED levels never throw.
- * E_RECOVERABLE_ERROR and E_USER_ERROR levels always throw.
- * Non catchable errors that can be detected at shutdown time are logged when the scream bit field allows so.
- * As errors have a performance cost, repeated errors are all logged, so that the developer
- * can see them and weight them as more important to fix than others of the same level.
- *
- * @author Nicolas Grekas <p@tchwork.com>
- */
-class ErrorHandler
-{
- private $levels = array(
- E_DEPRECATED => 'Deprecated',
- E_USER_DEPRECATED => 'User Deprecated',
- E_NOTICE => 'Notice',
- E_USER_NOTICE => 'User Notice',
- E_STRICT => 'Runtime Notice',
- E_WARNING => 'Warning',
- E_USER_WARNING => 'User Warning',
- E_COMPILE_WARNING => 'Compile Warning',
- E_CORE_WARNING => 'Core Warning',
- E_USER_ERROR => 'User Error',
- E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
- E_COMPILE_ERROR => 'Compile Error',
- E_PARSE => 'Parse Error',
- E_ERROR => 'Error',
- E_CORE_ERROR => 'Core Error',
- );
-
- private $loggers = array(
- E_DEPRECATED => array(null, LogLevel::INFO),
- E_USER_DEPRECATED => array(null, LogLevel::INFO),
- E_NOTICE => array(null, LogLevel::WARNING),
- E_USER_NOTICE => array(null, LogLevel::WARNING),
- E_STRICT => array(null, LogLevel::WARNING),
- E_WARNING => array(null, LogLevel::WARNING),
- E_USER_WARNING => array(null, LogLevel::WARNING),
- E_COMPILE_WARNING => array(null, LogLevel::WARNING),
- E_CORE_WARNING => array(null, LogLevel::WARNING),
- E_USER_ERROR => array(null, LogLevel::CRITICAL),
- E_RECOVERABLE_ERROR => array(null, LogLevel::CRITICAL),
- E_COMPILE_ERROR => array(null, LogLevel::CRITICAL),
- E_PARSE => array(null, LogLevel::CRITICAL),
- E_ERROR => array(null, LogLevel::CRITICAL),
- E_CORE_ERROR => array(null, LogLevel::CRITICAL),
- );
-
- private $thrownErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED
- private $scopedErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED
- private $tracedErrors = 0x77FB; // E_ALL - E_STRICT - E_PARSE
- private $screamedErrors = 0x55; // E_ERROR + E_CORE_ERROR + E_COMPILE_ERROR + E_PARSE
- private $loggedErrors = 0;
-
- private $loggedTraces = array();
- private $isRecursive = 0;
- private $isRoot = false;
- private $exceptionHandler;
- private $bootstrappingLogger;
-
- private static $reservedMemory;
- private static $stackedErrors = array();
- private static $stackedErrorLevels = array();
- private static $toStringException = null;
-
- /**
- * Registers the error handler.
- *
- * @param self|null $handler The handler to register
- * @param bool $replace Whether to replace or not any existing handler
- *
- * @return self The registered error handler
- */
- public static function register(self $handler = null, $replace = true)
- {
- if (null === self::$reservedMemory) {
- self::$reservedMemory = str_repeat('x', 10240);
- register_shutdown_function(__CLASS__.'::handleFatalError');
- }
-
- if ($handlerIsNew = null === $handler) {
- $handler = new static();
- }
-
- if (null === $prev = set_error_handler(array($handler, 'handleError'))) {
- restore_error_handler();
- // Specifying the error types earlier would expose us to https://bugs.php.net/63206
- set_error_handler(array($handler, 'handleError'), $handler->thrownErrors | $handler->loggedErrors);
- $handler->isRoot = true;
- }
-
- if ($handlerIsNew && is_array($prev) && $prev[0] instanceof self) {
- $handler = $prev[0];
- $replace = false;
- }
- if ($replace || !$prev) {
- $handler->setExceptionHandler(set_exception_handler(array($handler, 'handleException')));
- } else {
- restore_error_handler();
- }
-
- $handler->throwAt(E_ALL & $handler->thrownErrors, true);
-
- return $handler;
- }
-
- public function __construct(BufferingLogger $bootstrappingLogger = null)
- {
- if ($bootstrappingLogger) {
- $this->bootstrappingLogger = $bootstrappingLogger;
- $this->setDefaultLogger($bootstrappingLogger);
- }
- }
-
- /**
- * Sets a logger to non assigned errors levels.
- *
- * @param LoggerInterface $logger A PSR-3 logger to put as default for the given levels
- * @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
- * @param bool $replace Whether to replace or not any existing logger
- */
- public function setDefaultLogger(LoggerInterface $logger, $levels = E_ALL, $replace = false)
- {
- $loggers = array();
-
- if (is_array($levels)) {
- foreach ($levels as $type => $logLevel) {
- if (empty($this->loggers[$type][0]) || $replace || $this->loggers[$type][0] === $this->bootstrappingLogger) {
- $loggers[$type] = array($logger, $logLevel);
- }
- }
- } else {
- if (null === $levels) {
- $levels = E_ALL;
- }
- foreach ($this->loggers as $type => $log) {
- if (($type & $levels) && (empty($log[0]) || $replace || $log[0] === $this->bootstrappingLogger)) {
- $log[0] = $logger;
- $loggers[$type] = $log;
- }
- }
- }
-
- $this->setLoggers($loggers);
- }
-
- /**
- * Sets a logger for each error level.
- *
- * @param array $loggers Error levels to [LoggerInterface|null, LogLevel::*] map
- *
- * @return array The previous map
- *
- * @throws \InvalidArgumentException
- */
- public function setLoggers(array $loggers)
- {
- $prevLogged = $this->loggedErrors;
- $prev = $this->loggers;
- $flush = array();
-
- foreach ($loggers as $type => $log) {
- if (!isset($prev[$type])) {
- throw new \InvalidArgumentException('Unknown error type: '.$type);
- }
- if (!is_array($log)) {
- $log = array($log);
- } elseif (!array_key_exists(0, $log)) {
- throw new \InvalidArgumentException('No logger provided');
- }
- if (null === $log[0]) {
- $this->loggedErrors &= ~$type;
- } elseif ($log[0] instanceof LoggerInterface) {
- $this->loggedErrors |= $type;
- } else {
- throw new \InvalidArgumentException('Invalid logger provided');
- }
- $this->loggers[$type] = $log + $prev[$type];
-
- if ($this->bootstrappingLogger && $prev[$type][0] === $this->bootstrappingLogger) {
- $flush[$type] = $type;
- }
- }
- $this->reRegister($prevLogged | $this->thrownErrors);
-
- if ($flush) {
- foreach ($this->bootstrappingLogger->cleanLogs() as $log) {
- $type = $log[2]['type'];
- if (!isset($flush[$type])) {
- $this->bootstrappingLogger->log($log[0], $log[1], $log[2]);
- } elseif ($this->loggers[$type][0]) {
- $this->loggers[$type][0]->log($this->loggers[$type][1], $log[1], $log[2]);
- }
- }
- }
-
- return $prev;
- }
-
- /**
- * Sets a user exception handler.
- *
- * @param callable $handler A handler that will be called on Exception
- *
- * @return callable|null The previous exception handler
- */
- public function setExceptionHandler(callable $handler = null)
- {
- $prev = $this->exceptionHandler;
- $this->exceptionHandler = $handler;
-
- return $prev;
- }
-
- /**
- * Sets the PHP error levels that throw an exception when a PHP error occurs.
- *
- * @param int $levels A bit field of E_* constants for thrown errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function throwAt($levels, $replace = false)
- {
- $prev = $this->thrownErrors;
- $this->thrownErrors = ($levels | E_RECOVERABLE_ERROR | E_USER_ERROR) & ~E_USER_DEPRECATED & ~E_DEPRECATED;
- if (!$replace) {
- $this->thrownErrors |= $prev;
- }
- $this->reRegister($prev | $this->loggedErrors);
-
- return $prev;
- }
-
- /**
- * Sets the PHP error levels for which local variables are preserved.
- *
- * @param int $levels A bit field of E_* constants for scoped errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function scopeAt($levels, $replace = false)
- {
- $prev = $this->scopedErrors;
- $this->scopedErrors = (int) $levels;
- if (!$replace) {
- $this->scopedErrors |= $prev;
- }
-
- return $prev;
- }
-
- /**
- * Sets the PHP error levels for which the stack trace is preserved.
- *
- * @param int $levels A bit field of E_* constants for traced errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function traceAt($levels, $replace = false)
- {
- $prev = $this->tracedErrors;
- $this->tracedErrors = (int) $levels;
- if (!$replace) {
- $this->tracedErrors |= $prev;
- }
-
- return $prev;
- }
-
- /**
- * Sets the error levels where the @-operator is ignored.
- *
- * @param int $levels A bit field of E_* constants for screamed errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function screamAt($levels, $replace = false)
- {
- $prev = $this->screamedErrors;
- $this->screamedErrors = (int) $levels;
- if (!$replace) {
- $this->screamedErrors |= $prev;
- }
-
- return $prev;
- }
-
- /**
- * Re-registers as a PHP error handler if levels changed.
- */
- private function reRegister($prev)
- {
- if ($prev !== $this->thrownErrors | $this->loggedErrors) {
- $handler = set_error_handler('var_dump');
- $handler = is_array($handler) ? $handler[0] : null;
- restore_error_handler();
- if ($handler === $this) {
- restore_error_handler();
- if ($this->isRoot) {
- set_error_handler(array($this, 'handleError'), $this->thrownErrors | $this->loggedErrors);
- } else {
- set_error_handler(array($this, 'handleError'));
- }
- }
- }
- }
-
- /**
- * Handles errors by filtering then logging them according to the configured bit fields.
- *
- * @param int $type One of the E_* constants
- * @param string $message
- * @param string $file
- * @param int $line
- * @param array $context
- * @param array $backtrace
- *
- * @return bool Returns false when no handling happens so that the PHP engine can handle the error itself
- *
- * @throws \ErrorException When $this->thrownErrors requests so
- *
- * @internal
- */
- public function handleError($type, $message, $file, $line, array $context, array $backtrace = null)
- {
- $level = error_reporting() | E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED;
- $log = $this->loggedErrors & $type;
- $throw = $this->thrownErrors & $type & $level;
- $type &= $level | $this->screamedErrors;
-
- if (!$type || (!$log && !$throw)) {
- return $type && $log;
- }
-
- if (null !== $backtrace && $type & E_ERROR) {
- // E_ERROR fatal errors are triggered on HHVM when
- // hhvm.error_handling.call_user_handler_on_fatals=1
- // which is the way to get their backtrace.
- $this->handleFatalError(compact('type', 'message', 'file', 'line', 'backtrace'));
-
- return true;
- }
-
- if ($throw) {
- if (null !== self::$toStringException) {
- $throw = self::$toStringException;
- self::$toStringException = null;
- } elseif (($this->scopedErrors & $type) && class_exists(ContextErrorException::class)) {
- $throw = new ContextErrorException($this->levels[$type].': '.$message, 0, $type, $file, $line, $context);
- } else {
- $throw = new \ErrorException($this->levels[$type].': '.$message, 0, $type, $file, $line);
- }
-
- if (E_USER_ERROR & $type) {
- $backtrace = $backtrace ?: $throw->getTrace();
-
- for ($i = 1; isset($backtrace[$i]); ++$i) {
- if (isset($backtrace[$i]['function'], $backtrace[$i]['type'], $backtrace[$i - 1]['function'])
- && '__toString' === $backtrace[$i]['function']
- && '->' === $backtrace[$i]['type']
- && !isset($backtrace[$i - 1]['class'])
- && ('trigger_error' === $backtrace[$i - 1]['function'] || 'user_error' === $backtrace[$i - 1]['function'])
- ) {
- // Here, we know trigger_error() has been called from __toString().
- // HHVM is fine with throwing from __toString() but PHP triggers a fatal error instead.
- // A small convention allows working around the limitation:
- // given a caught $e exception in __toString(), quitting the method with
- // `return trigger_error($e, E_USER_ERROR);` allows this error handler
- // to make $e get through the __toString() barrier.
-
- foreach ($context as $e) {
- if (($e instanceof \Exception || $e instanceof \Throwable) && $e->__toString() === $message) {
- if (1 === $i) {
- // On HHVM
- $throw = $e;
- break;
- }
- self::$toStringException = $e;
-
- return true;
- }
- }
-
- if (1 < $i) {
- // On PHP (not on HHVM), display the original error message instead of the default one.
- $this->handleException($throw);
-
- // Stop the process by giving back the error to the native handler.
- return false;
- }
- }
- }
- }
-
- throw $throw;
- }
-
- // For duplicated errors, log the trace only once
- $e = md5("{$type}/{$line}/{$file}\x00{$message}", true);
- $trace = true;
-
- if (!($this->tracedErrors & $type) || isset($this->loggedTraces[$e])) {
- $trace = false;
- } else {
- $this->loggedTraces[$e] = 1;
- }
-
- $e = compact('type', 'file', 'line', 'level');
-
- if ($type & $level) {
- if ($this->scopedErrors & $type) {
- $e['scope_vars'] = $context;
- if ($trace) {
- $e['stack'] = $backtrace ?: debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT);
- }
- } elseif ($trace) {
- if (null === $backtrace) {
- $e['stack'] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
- } else {
- foreach ($backtrace as &$frame) {
- unset($frame['args'], $frame);
- }
- $e['stack'] = $backtrace;
- }
- }
- }
-
- if ($this->isRecursive) {
- $log = 0;
- } elseif (self::$stackedErrorLevels) {
- self::$stackedErrors[] = array($this->loggers[$type][0], ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG, $message, $e);
- } else {
- try {
- $this->isRecursive = true;
- $this->loggers[$type][0]->log(($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG, $message, $e);
- } finally {
- $this->isRecursive = false;
- }
- }
-
- return $type && $log;
- }
-
- /**
- * Handles an exception by logging then forwarding it to another handler.
- *
- * @param \Exception|\Throwable $exception An exception to handle
- * @param array $error An array as returned by error_get_last()
- *
- * @internal
- */
- public function handleException($exception, array $error = null)
- {
- if (!$exception instanceof \Exception) {
- $exception = new FatalThrowableError($exception);
- }
- $type = $exception instanceof FatalErrorException ? $exception->getSeverity() : E_ERROR;
-
- if (($this->loggedErrors & $type) || $exception instanceof FatalThrowableError) {
- $e = array(
- 'type' => $type,
- 'file' => $exception->getFile(),
- 'line' => $exception->getLine(),
- 'level' => error_reporting(),
- 'stack' => $exception->getTrace(),
- );
- if ($exception instanceof FatalErrorException) {
- if ($exception instanceof FatalThrowableError) {
- $error = array(
- 'type' => $type,
- 'message' => $message = $exception->getMessage(),
- 'file' => $e['file'],
- 'line' => $e['line'],
- );
- } else {
- $message = 'Fatal '.$exception->getMessage();
- }
- } elseif ($exception instanceof \ErrorException) {
- $message = 'Uncaught '.$exception->getMessage();
- if ($exception instanceof ContextErrorException) {
- $e['context'] = $exception->getContext();
- }
- } else {
- $message = 'Uncaught Exception: '.$exception->getMessage();
- }
- }
- if ($this->loggedErrors & $type) {
- $this->loggers[$type][0]->log($this->loggers[$type][1], $message, $e);
- }
- if ($exception instanceof FatalErrorException && !$exception instanceof OutOfMemoryException && $error) {
- foreach ($this->getFatalErrorHandlers() as $handler) {
- if ($e = $handler->handleError($error, $exception)) {
- $exception = $e;
- break;
- }
- }
- }
- if (empty($this->exceptionHandler)) {
- throw $exception; // Give back $exception to the native handler
- }
- try {
- call_user_func($this->exceptionHandler, $exception);
- } catch (\Exception $handlerException) {
- } catch (\Throwable $handlerException) {
- }
- if (isset($handlerException)) {
- $this->exceptionHandler = null;
- $this->handleException($handlerException);
- }
- }
-
- /**
- * Shutdown registered function for handling PHP fatal errors.
- *
- * @param array $error An array as returned by error_get_last()
- *
- * @internal
- */
- public static function handleFatalError(array $error = null)
- {
- if (null === self::$reservedMemory) {
- return;
- }
-
- self::$reservedMemory = null;
-
- $handler = set_error_handler('var_dump');
- $handler = is_array($handler) ? $handler[0] : null;
- restore_error_handler();
-
- if (!$handler instanceof self) {
- return;
- }
-
- if (null === $error) {
- $error = error_get_last();
- }
-
- try {
- while (self::$stackedErrorLevels) {
- static::unstackErrors();
- }
- } catch (\Exception $exception) {
- // Handled below
- } catch (\Throwable $exception) {
- // Handled below
- }
-
- if ($error && $error['type'] &= E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR) {
- // Let's not throw anymore but keep logging
- $handler->throwAt(0, true);
- $trace = isset($error['backtrace']) ? $error['backtrace'] : null;
-
- if (0 === strpos($error['message'], 'Allowed memory') || 0 === strpos($error['message'], 'Out of memory')) {
- $exception = new OutOfMemoryException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, false, $trace);
- } else {
- $exception = new FatalErrorException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, true, $trace);
- }
- } elseif (!isset($exception)) {
- return;
- }
-
- try {
- $handler->handleException($exception, $error);
- } catch (FatalErrorException $e) {
- // Ignore this re-throw
- }
- }
-
- /**
- * Configures the error handler for delayed handling.
- * Ensures also that non-catchable fatal errors are never silenced.
- *
- * As shown by http://bugs.php.net/42098 and http://bugs.php.net/60724
- * PHP has a compile stage where it behaves unusually. To workaround it,
- * we plug an error handler that only stacks errors for later.
- *
- * The most important feature of this is to prevent
- * autoloading until unstackErrors() is called.
- */
- public static function stackErrors()
- {
- self::$stackedErrorLevels[] = error_reporting(error_reporting() | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR);
- }
-
- /**
- * Unstacks stacked errors and forwards to the logger.
- */
- public static function unstackErrors()
- {
- $level = array_pop(self::$stackedErrorLevels);
-
- if (null !== $level) {
- $e = error_reporting($level);
- if ($e !== ($level | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR)) {
- // If the user changed the error level, do not overwrite it
- error_reporting($e);
- }
- }
-
- if (empty(self::$stackedErrorLevels)) {
- $errors = self::$stackedErrors;
- self::$stackedErrors = array();
-
- foreach ($errors as $e) {
- $e[0]->log($e[1], $e[2], $e[3]);
- }
- }
- }
-
- /**
- * Gets the fatal error handlers.
- *
- * Override this method if you want to define more fatal error handlers.
- *
- * @return FatalErrorHandlerInterface[] An array of FatalErrorHandlerInterface
- */
- protected function getFatalErrorHandlers()
- {
- return array(
- new UndefinedFunctionFatalErrorHandler(),
- new UndefinedMethodFatalErrorHandler(),
- new ClassNotFoundFatalErrorHandler(),
- );
- }
-}
diff --git a/vendor/symfony/debug/Exception/ClassNotFoundException.php b/vendor/symfony/debug/Exception/ClassNotFoundException.php
deleted file mode 100644
index b91bf46..0000000
--- a/vendor/symfony/debug/Exception/ClassNotFoundException.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Class (or Trait or Interface) Not Found Exception.
- *
- * @author Konstanton Myakshin <koc-dp@yandex.ru>
- */
-class ClassNotFoundException extends FatalErrorException
-{
- public function __construct($message, \ErrorException $previous)
- {
- parent::__construct(
- $message,
- $previous->getCode(),
- $previous->getSeverity(),
- $previous->getFile(),
- $previous->getLine(),
- $previous->getPrevious()
- );
- $this->setTrace($previous->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/Exception/ContextErrorException.php b/vendor/symfony/debug/Exception/ContextErrorException.php
deleted file mode 100644
index 54f0198..0000000
--- a/vendor/symfony/debug/Exception/ContextErrorException.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Error Exception with Variable Context.
- *
- * @author Christian Sciberras <uuf6429@gmail.com>
- */
-class ContextErrorException extends \ErrorException
-{
- private $context = array();
-
- public function __construct($message, $code, $severity, $filename, $lineno, $context = array())
- {
- parent::__construct($message, $code, $severity, $filename, $lineno);
- $this->context = $context;
- }
-
- /**
- * @return array Array of variables that existed when the exception occurred
- */
- public function getContext()
- {
- return $this->context;
- }
-}
diff --git a/vendor/symfony/debug/Exception/FatalErrorException.php b/vendor/symfony/debug/Exception/FatalErrorException.php
deleted file mode 100644
index f24a54e..0000000
--- a/vendor/symfony/debug/Exception/FatalErrorException.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Fatal Error Exception.
- *
- * @author Konstanton Myakshin <koc-dp@yandex.ru>
- */
-class FatalErrorException extends \ErrorException
-{
- public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true, array $trace = null)
- {
- parent::__construct($message, $code, $severity, $filename, $lineno);
-
- if (null !== $trace) {
- if (!$traceArgs) {
- foreach ($trace as &$frame) {
- unset($frame['args'], $frame['this'], $frame);
- }
- }
-
- $this->setTrace($trace);
- } elseif (null !== $traceOffset) {
- if (function_exists('xdebug_get_function_stack')) {
- $trace = xdebug_get_function_stack();
- if (0 < $traceOffset) {
- array_splice($trace, -$traceOffset);
- }
-
- foreach ($trace as &$frame) {
- if (!isset($frame['type'])) {
- // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695
- if (isset($frame['class'])) {
- $frame['type'] = '::';
- }
- } elseif ('dynamic' === $frame['type']) {
- $frame['type'] = '->';
- } elseif ('static' === $frame['type']) {
- $frame['type'] = '::';
- }
-
- // XDebug also has a different name for the parameters array
- if (!$traceArgs) {
- unset($frame['params'], $frame['args']);
- } elseif (isset($frame['params']) && !isset($frame['args'])) {
- $frame['args'] = $frame['params'];
- unset($frame['params']);
- }
- }
-
- unset($frame);
- $trace = array_reverse($trace);
- } elseif (function_exists('symfony_debug_backtrace')) {
- $trace = symfony_debug_backtrace();
- if (0 < $traceOffset) {
- array_splice($trace, 0, $traceOffset);
- }
- } else {
- $trace = array();
- }
-
- $this->setTrace($trace);
- }
- }
-
- protected function setTrace($trace)
- {
- $traceReflector = new \ReflectionProperty('Exception', 'trace');
- $traceReflector->setAccessible(true);
- $traceReflector->setValue($this, $trace);
- }
-}
diff --git a/vendor/symfony/debug/Exception/FatalThrowableError.php b/vendor/symfony/debug/Exception/FatalThrowableError.php
deleted file mode 100644
index 34f43b1..0000000
--- a/vendor/symfony/debug/Exception/FatalThrowableError.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Fatal Throwable Error.
- *
- * @author Nicolas Grekas <p@tchwork.com>
- */
-class FatalThrowableError extends FatalErrorException
-{
- public function __construct(\Throwable $e)
- {
- if ($e instanceof \ParseError) {
- $message = 'Parse error: '.$e->getMessage();
- $severity = E_PARSE;
- } elseif ($e instanceof \TypeError) {
- $message = 'Type error: '.$e->getMessage();
- $severity = E_RECOVERABLE_ERROR;
- } else {
- $message = $e->getMessage();
- $severity = E_ERROR;
- }
-
- \ErrorException::__construct(
- $message,
- $e->getCode(),
- $severity,
- $e->getFile(),
- $e->getLine()
- );
-
- $this->setTrace($e->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/Exception/FlattenException.php b/vendor/symfony/debug/Exception/FlattenException.php
deleted file mode 100644
index 7466631..0000000
--- a/vendor/symfony/debug/Exception/FlattenException.php
+++ /dev/null
@@ -1,256 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
-
-/**
- * FlattenException wraps a PHP Exception to be able to serialize it.
- *
- * Basically, this class removes all objects from the trace.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class FlattenException
-{
- private $message;
- private $code;
- private $previous;
- private $trace;
- private $class;
- private $statusCode;
- private $headers;
- private $file;
- private $line;
-
- public static function create(\Exception $exception, $statusCode = null, array $headers = array())
- {
- $e = new static();
- $e->setMessage($exception->getMessage());
- $e->setCode($exception->getCode());
-
- if ($exception instanceof HttpExceptionInterface) {
- $statusCode = $exception->getStatusCode();
- $headers = array_merge($headers, $exception->getHeaders());
- }
-
- if (null === $statusCode) {
- $statusCode = 500;
- }
-
- $e->setStatusCode($statusCode);
- $e->setHeaders($headers);
- $e->setTraceFromException($exception);
- $e->setClass(get_class($exception));
- $e->setFile($exception->getFile());
- $e->setLine($exception->getLine());
-
- $previous = $exception->getPrevious();
-
- if ($previous instanceof \Exception) {
- $e->setPrevious(static::create($previous));
- } elseif ($previous instanceof \Throwable) {
- $e->setPrevious(static::create(new FatalThrowableError($previous)));
- }
-
- return $e;
- }
-
- public function toArray()
- {
- $exceptions = array();
- foreach (array_merge(array($this), $this->getAllPrevious()) as $exception) {
- $exceptions[] = array(
- 'message' => $exception->getMessage(),
- 'class' => $exception->getClass(),
- 'trace' => $exception->getTrace(),
- );
- }
-
- return $exceptions;
- }
-
- public function getStatusCode()
- {
- return $this->statusCode;
- }
-
- public function setStatusCode($code)
- {
- $this->statusCode = $code;
- }
-
- public function getHeaders()
- {
- return $this->headers;
- }
-
- public function setHeaders(array $headers)
- {
- $this->headers = $headers;
- }
-
- public function getClass()
- {
- return $this->class;
- }
-
- public function setClass($class)
- {
- $this->class = $class;
- }
-
- public function getFile()
- {
- return $this->file;
- }
-
- public function setFile($file)
- {
- $this->file = $file;
- }
-
- public function getLine()
- {
- return $this->line;
- }
-
- public function setLine($line)
- {
- $this->line = $line;
- }
-
- public function getMessage()
- {
- return $this->message;
- }
-
- public function setMessage($message)
- {
- $this->message = $message;
- }
-
- public function getCode()
- {
- return $this->code;
- }
-
- public function setCode($code)
- {
- $this->code = $code;
- }
-
- public function getPrevious()
- {
- return $this->previous;
- }
-
- public function setPrevious(FlattenException $previous)
- {
- $this->previous = $previous;
- }
-
- public function getAllPrevious()
- {
- $exceptions = array();
- $e = $this;
- while ($e = $e->getPrevious()) {
- $exceptions[] = $e;
- }
-
- return $exceptions;
- }
-
- public function getTrace()
- {
- return $this->trace;
- }
-
- public function setTraceFromException(\Exception $exception)
- {
- $this->setTrace($exception->getTrace(), $exception->getFile(), $exception->getLine());
- }
-
- public function setTrace($trace, $file, $line)
- {
- $this->trace = array();
- $this->trace[] = array(
- 'namespace' => '',
- 'short_class' => '',
- 'class' => '',
- 'type' => '',
- 'function' => '',
- 'file' => $file,
- 'line' => $line,
- 'args' => array(),
- );
- foreach ($trace as $entry) {
- $class = '';
- $namespace = '';
- if (isset($entry['class'])) {
- $parts = explode('\\', $entry['class']);
- $class = array_pop($parts);
- $namespace = implode('\\', $parts);
- }
-
- $this->trace[] = array(
- 'namespace' => $namespace,
- 'short_class' => $class,
- 'class' => isset($entry['class']) ? $entry['class'] : '',
- 'type' => isset($entry['type']) ? $entry['type'] : '',
- 'function' => isset($entry['function']) ? $entry['function'] : null,
- 'file' => isset($entry['file']) ? $entry['file'] : null,
- 'line' => isset($entry['line']) ? $entry['line'] : null,
- 'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
- );
- }
- }
-
- private function flattenArgs($args, $level = 0, &$count = 0)
- {
- $result = array();
- foreach ($args as $key => $value) {
- if (++$count > 1e4) {
- return array('array', '*SKIPPED over 10000 entries*');
- }
- if ($value instanceof \__PHP_Incomplete_Class) {
- // is_object() returns false on PHP<=7.1
- $result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value));
- } elseif (is_object($value)) {
- $result[$key] = array('object', get_class($value));
- } elseif (is_array($value)) {
- if ($level > 10) {
- $result[$key] = array('array', '*DEEP NESTED ARRAY*');
- } else {
- $result[$key] = array('array', $this->flattenArgs($value, $level + 1, $count));
- }
- } elseif (null === $value) {
- $result[$key] = array('null', null);
- } elseif (is_bool($value)) {
- $result[$key] = array('boolean', $value);
- } elseif (is_resource($value)) {
- $result[$key] = array('resource', get_resource_type($value));
- } else {
- $result[$key] = array('string', (string) $value);
- }
- }
-
- return $result;
- }
-
- private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value)
- {
- $array = new \ArrayObject($value);
-
- return $array['__PHP_Incomplete_Class_Name'];
- }
-}
diff --git a/vendor/symfony/debug/Exception/UndefinedFunctionException.php b/vendor/symfony/debug/Exception/UndefinedFunctionException.php
deleted file mode 100644
index a66ae2a..0000000
--- a/vendor/symfony/debug/Exception/UndefinedFunctionException.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Undefined Function Exception.
- *
- * @author Konstanton Myakshin <koc-dp@yandex.ru>
- */
-class UndefinedFunctionException extends FatalErrorException
-{
- public function __construct($message, \ErrorException $previous)
- {
- parent::__construct(
- $message,
- $previous->getCode(),
- $previous->getSeverity(),
- $previous->getFile(),
- $previous->getLine(),
- $previous->getPrevious()
- );
- $this->setTrace($previous->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/Exception/UndefinedMethodException.php b/vendor/symfony/debug/Exception/UndefinedMethodException.php
deleted file mode 100644
index 350dc31..0000000
--- a/vendor/symfony/debug/Exception/UndefinedMethodException.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Undefined Method Exception.
- *
- * @author Grégoire Pineau <lyrixx@lyrixx.info>
- */
-class UndefinedMethodException extends FatalErrorException
-{
- public function __construct($message, \ErrorException $previous)
- {
- parent::__construct(
- $message,
- $previous->getCode(),
- $previous->getSeverity(),
- $previous->getFile(),
- $previous->getLine(),
- $previous->getPrevious()
- );
- $this->setTrace($previous->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/ExceptionHandler.php b/vendor/symfony/debug/ExceptionHandler.php
deleted file mode 100644
index 0e80f2a..0000000
--- a/vendor/symfony/debug/ExceptionHandler.php
+++ /dev/null
@@ -1,415 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-use Symfony\Component\Debug\Exception\FlattenException;
-use Symfony\Component\Debug\Exception\OutOfMemoryException;
-
-/**
- * ExceptionHandler converts an exception to a Response object.
- *
- * It is mostly useful in debug mode to replace the default PHP/XDebug
- * output with something prettier and more useful.
- *
- * As this class is mainly used during Kernel boot, where nothing is yet
- * available, the Response content is always HTML.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- * @author Nicolas Grekas <p@tchwork.com>
- */
-class ExceptionHandler
-{
- private $debug;
- private $charset;
- private $handler;
- private $caughtBuffer;
- private $caughtLength;
- private $fileLinkFormat;
-
- public function __construct($debug = true, $charset = null, $fileLinkFormat = null)
- {
- $this->debug = $debug;
- $this->charset = $charset ?: ini_get('default_charset') ?: 'UTF-8';
- $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
- }
-
- /**
- * Registers the exception handler.
- *
- * @param bool $debug Enable/disable debug mode, where the stack trace is displayed
- * @param string|null $charset The charset used by exception messages
- * @param string|null $fileLinkFormat The IDE link template
- *
- * @return ExceptionHandler The registered exception handler
- */
- public static function register($debug = true, $charset = null, $fileLinkFormat = null)
- {
- $handler = new static($debug, $charset, $fileLinkFormat);
-
- $prev = set_exception_handler(array($handler, 'handle'));
- if (is_array($prev) && $prev[0] instanceof ErrorHandler) {
- restore_exception_handler();
- $prev[0]->setExceptionHandler(array($handler, 'handle'));
- }
-
- return $handler;
- }
-
- /**
- * Sets a user exception handler.
- *
- * @param callable $handler An handler that will be called on Exception
- *
- * @return callable|null The previous exception handler if any
- */
- public function setHandler(callable $handler = null)
- {
- $old = $this->handler;
- $this->handler = $handler;
-
- return $old;
- }
-
- /**
- * Sets the format for links to source files.
- *
- * @param string $format The format for links to source files
- *
- * @return string The previous file link format
- */
- public function setFileLinkFormat($format)
- {
- $old = $this->fileLinkFormat;
- $this->fileLinkFormat = $format;
-
- return $old;
- }
-
- /**
- * Sends a response for the given Exception.
- *
- * To be as fail-safe as possible, the exception is first handled
- * by our simple exception handler, then by the user exception handler.
- * The latter takes precedence and any output from the former is cancelled,
- * if and only if nothing bad happens in this handling path.
- */
- public function handle(\Exception $exception)
- {
- if (null === $this->handler || $exception instanceof OutOfMemoryException) {
- $this->sendPhpResponse($exception);
-
- return;
- }
-
- $caughtLength = $this->caughtLength = 0;
-
- ob_start(function ($buffer) {
- $this->caughtBuffer = $buffer;
-
- return '';
- });
-
- $this->sendPhpResponse($exception);
- while (null === $this->caughtBuffer && ob_end_flush()) {
- // Empty loop, everything is in the condition
- }
- if (isset($this->caughtBuffer[0])) {
- ob_start(function ($buffer) {
- if ($this->caughtLength) {
- // use substr_replace() instead of substr() for mbstring overloading resistance
- $cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength);
- if (isset($cleanBuffer[0])) {
- $buffer = $cleanBuffer;
- }
- }
-
- return $buffer;
- });
-
- echo $this->caughtBuffer;
- $caughtLength = ob_get_length();
- }
- $this->caughtBuffer = null;
-
- try {
- call_user_func($this->handler, $exception);
- $this->caughtLength = $caughtLength;
- } catch (\Exception $e) {
- if (!$caughtLength) {
- // All handlers failed. Let PHP handle that now.
- throw $exception;
- }
- }
- }
-
- /**
- * Sends the error associated with the given Exception as a plain PHP response.
- *
- * This method uses plain PHP functions like header() and echo to output
- * the response.
- *
- * @param \Exception|FlattenException $exception An \Exception or FlattenException instance
- */
- public function sendPhpResponse($exception)
- {
- if (!$exception instanceof FlattenException) {
- $exception = FlattenException::create($exception);
- }
-
- if (!headers_sent()) {
- header(sprintf('HTTP/1.0 %s', $exception->getStatusCode()));
- foreach ($exception->getHeaders() as $name => $value) {
- header($name.': '.$value, false);
- }
- header('Content-Type: text/html; charset='.$this->charset);
- }
-
- echo $this->decorate($this->getContent($exception), $this->getStylesheet($exception));
- }
-
- /**
- * Gets the full HTML content associated with the given exception.
- *
- * @param \Exception|FlattenException $exception An \Exception or FlattenException instance
- *
- * @return string The HTML content as a string
- */
- public function getHtml($exception)
- {
- if (!$exception instanceof FlattenException) {
- $exception = FlattenException::create($exception);
- }
-
- return $this->decorate($this->getContent($exception), $this->getStylesheet($exception));
- }
-
- /**
- * Gets the HTML content associated with the given exception.
- *
- * @param FlattenException $exception A FlattenException instance
- *
- * @return string The content as a string
- */
- public function getContent(FlattenException $exception)
- {
- switch ($exception->getStatusCode()) {
- case 404:
- $title = 'Sorry, the page you are looking for could not be found.';
- break;
- default:
- $title = 'Whoops, looks like something went wrong.';
- }
-
- $content = '';
- if ($this->debug) {
- try {
- $count = count($exception->getAllPrevious());
- $total = $count + 1;
- foreach ($exception->toArray() as $position => $e) {
- $ind = $count - $position + 1;
- $class = $this->formatClass($e['class']);
- $message = nl2br($this->escapeHtml($e['message']));
- $content .= sprintf(<<<'EOF'
- <h2 class="block_exception clear_fix">
- <span class="exception_counter">%d/%d</span>
- <span class="exception_title">%s%s:</span>
- <span class="exception_message">%s</span>
- </h2>
- <div class="block">
- <ol class="traces list_exception">
-
-EOF
- , $ind, $total, $class, $this->formatPath($e['trace'][0]['file'], $e['trace'][0]['line']), $message);
- foreach ($e['trace'] as $trace) {
- $content .= ' <li>';
- if ($trace['function']) {
- $content .= sprintf('at %s%s%s(%s)', $this->formatClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args']));
- }
- if (isset($trace['file']) && isset($trace['line'])) {
- $content .= $this->formatPath($trace['file'], $trace['line']);
- }
- $content .= "</li>\n";
- }
-
- $content .= " </ol>\n</div>\n";
- }
- } catch (\Exception $e) {
- // something nasty happened and we cannot throw an exception anymore
- if ($this->debug) {
- $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $this->escapeHtml($e->getMessage()));
- } else {
- $title = 'Whoops, looks like something went wrong.';
- }
- }
- }
-
- return <<<EOF
- <div id="sf-resetcontent" class="sf-reset">
- <h1>$title</h1>
- $content
- </div>
-EOF;
- }
-
- /**
- * Gets the stylesheet associated with the given exception.
- *
- * @param FlattenException $exception A FlattenException instance
- *
- * @return string The stylesheet as a string
- */
- public function getStylesheet(FlattenException $exception)
- {
- return <<<'EOF'
- .sf-reset { font: 11px Verdana, Arial, sans-serif; color: #333 }
- .sf-reset .clear { clear:both; height:0; font-size:0; line-height:0; }
- .sf-reset .clear_fix:after { display:block; height:0; clear:both; visibility:hidden; }
- .sf-reset .clear_fix { display:inline-block; }
- .sf-reset * html .clear_fix { height:1%; }
- .sf-reset .clear_fix { display:block; }
- .sf-reset, .sf-reset .block { margin: auto }
- .sf-reset abbr { border-bottom: 1px dotted #000; cursor: help; }
- .sf-reset p { font-size:14px; line-height:20px; color:#868686; padding-bottom:20px }
- .sf-reset strong { font-weight:bold; }
- .sf-reset a { color:#6c6159; cursor: default; }
- .sf-reset a img { border:none; }
- .sf-reset a:hover { text-decoration:underline; }
- .sf-reset em { font-style:italic; }
- .sf-reset h1, .sf-reset h2 { font: 20px Georgia, "Times New Roman", Times, serif }
- .sf-reset .exception_counter { background-color: #fff; color: #333; padding: 6px; float: left; margin-right: 10px; float: left; display: block; }
- .sf-reset .exception_title { margin-left: 3em; margin-bottom: 0.7em; display: block; }
- .sf-reset .exception_message { margin-left: 3em; display: block; }
- .sf-reset .traces li { font-size:12px; padding: 2px 4px; list-style-type:decimal; margin-left:20px; }
- .sf-reset .block { background-color:#FFFFFF; padding:10px 28px; margin-bottom:20px;
- -webkit-border-bottom-right-radius: 16px;
- -webkit-border-bottom-left-radius: 16px;
- -moz-border-radius-bottomright: 16px;
- -moz-border-radius-bottomleft: 16px;
- border-bottom-right-radius: 16px;
- border-bottom-left-radius: 16px;
- border-bottom:1px solid #ccc;
- border-right:1px solid #ccc;
- border-left:1px solid #ccc;
- word-wrap: break-word;
- }
- .sf-reset .block_exception { background-color:#ddd; color: #333; padding:20px;
- -webkit-border-top-left-radius: 16px;
- -webkit-border-top-right-radius: 16px;
- -moz-border-radius-topleft: 16px;
- -moz-border-radius-topright: 16px;
- border-top-left-radius: 16px;
- border-top-right-radius: 16px;
- border-top:1px solid #ccc;
- border-right:1px solid #ccc;
- border-left:1px solid #ccc;
- overflow: hidden;
- word-wrap: break-word;
- }
- .sf-reset a { background:none; color:#868686; text-decoration:none; }
- .sf-reset a:hover { background:none; color:#313131; text-decoration:underline; }
- .sf-reset ol { padding: 10px 0; }
- .sf-reset h1 { background-color:#FFFFFF; padding: 15px 28px; margin-bottom: 20px;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- border-radius: 10px;
- border: 1px solid #ccc;
- }
-EOF;
- }
-
- private function decorate($content, $css)
- {
- return <<<EOF
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="{$this->charset}" />
- <meta name="robots" content="noindex,nofollow" />
- <style>
- /* Copyright (c) 2010, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.html */
- html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
-
- html { background: #eee; padding: 10px }
- img { border: 0; }
- #sf-resetcontent { width:970px; margin:0 auto; }
- $css
- </style>
- </head>
- <body>
- $content
- </body>
-</html>
-EOF;
- }
-
- private function formatClass($class)
- {
- $parts = explode('\\', $class);
-
- return sprintf('<abbr title="%s">%s</abbr>', $class, array_pop($parts));
- }
-
- private function formatPath($path, $line)
- {
- $path = $this->escapeHtml($path);
- $file = preg_match('#[^/\\\\]*$#', $path, $file) ? $file[0] : $path;
-
- if ($linkFormat = $this->fileLinkFormat) {
- $link = strtr($this->escapeHtml($linkFormat), array('%f' => $path, '%l' => (int) $line));
-
- return sprintf(' in <a href="%s" title="Go to source">%s line %d</a>', $link, $file, $line);
- }
-
- return sprintf(' in <a title="%s line %3$d" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">%s line %d</a>', $path, $file, $line);
- }
-
- /**
- * Formats an array as a string.
- *
- * @param array $args The argument array
- *
- * @return string
- */
- private function formatArgs(array $args)
- {
- $result = array();
- foreach ($args as $key => $item) {
- if ('object' === $item[0]) {
- $formattedValue = sprintf('<em>object</em>(%s)', $this->formatClass($item[1]));
- } elseif ('array' === $item[0]) {
- $formattedValue = sprintf('<em>array</em>(%s)', is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
- } elseif ('string' === $item[0]) {
- $formattedValue = sprintf("'%s'", $this->escapeHtml($item[1]));
- } elseif ('null' === $item[0]) {
- $formattedValue = '<em>null</em>';
- } elseif ('boolean' === $item[0]) {
- $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
- } elseif ('resource' === $item[0]) {
- $formattedValue = '<em>resource</em>';
- } else {
- $formattedValue = str_replace("\n", '', var_export($this->escapeHtml((string) $item[1]), true));
- }
-
- $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $key, $formattedValue);
- }
-
- return implode(', ', $result);
- }
-
- /**
- * HTML-encodes a string.
- */
- private function escapeHtml($str)
- {
- return htmlspecialchars($str, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset);
- }
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php b/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php
deleted file mode 100644
index c48d0d3..0000000
--- a/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php
+++ /dev/null
@@ -1,206 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\ClassNotFoundException;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\DebugClassLoader;
-use Composer\Autoload\ClassLoader as ComposerClassLoader;
-use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader;
-
-/**
- * ErrorHandler for classes that do not exist.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface
-{
- /**
- * {@inheritdoc}
- */
- public function handleError(array $error, FatalErrorException $exception)
- {
- $messageLen = strlen($error['message']);
- $notFoundSuffix = '\' not found';
- $notFoundSuffixLen = strlen($notFoundSuffix);
- if ($notFoundSuffixLen > $messageLen) {
- return;
- }
-
- if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundSuffixLen)) {
- return;
- }
-
- foreach (array('class', 'interface', 'trait') as $typeName) {
- $prefix = ucfirst($typeName).' \'';
- $prefixLen = strlen($prefix);
- if (0 !== strpos($error['message'], $prefix)) {
- continue;
- }
-
- $fullyQualifiedClassName = substr($error['message'], $prefixLen, -$notFoundSuffixLen);
- if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedClassName, '\\')) {
- $className = substr($fullyQualifiedClassName, $namespaceSeparatorIndex + 1);
- $namespacePrefix = substr($fullyQualifiedClassName, 0, $namespaceSeparatorIndex);
- $message = sprintf('Attempted to load %s "%s" from namespace "%s".', $typeName, $className, $namespacePrefix);
- $tail = ' for another namespace?';
- } else {
- $className = $fullyQualifiedClassName;
- $message = sprintf('Attempted to load %s "%s" from the global namespace.', $typeName, $className);
- $tail = '?';
- }
-
- if ($candidates = $this->getClassCandidates($className)) {
- $tail = array_pop($candidates).'"?';
- if ($candidates) {
- $tail = ' for e.g. "'.implode('", "', $candidates).'" or "'.$tail;
- } else {
- $tail = ' for "'.$tail;
- }
- }
- $message .= "\nDid you forget a \"use\" statement".$tail;
-
- return new ClassNotFoundException($message, $exception);
- }
- }
-
- /**
- * Tries to guess the full namespace for a given class name.
- *
- * By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer
- * autoloader (that should cover all common cases).
- *
- * @param string $class A class name (without its namespace)
- *
- * @return array An array of possible fully qualified class names
- */
- private function getClassCandidates($class)
- {
- if (!is_array($functions = spl_autoload_functions())) {
- return array();
- }
-
- // find Symfony and Composer autoloaders
- $classes = array();
-
- foreach ($functions as $function) {
- if (!is_array($function)) {
- continue;
- }
- // get class loaders wrapped by DebugClassLoader
- if ($function[0] instanceof DebugClassLoader) {
- $function = $function[0]->getClassLoader();
-
- if (!is_array($function)) {
- continue;
- }
- }
-
- if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) {
- foreach ($function[0]->getPrefixes() as $prefix => $paths) {
- foreach ($paths as $path) {
- $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
- }
- }
- }
- if ($function[0] instanceof ComposerClassLoader) {
- foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) {
- foreach ($paths as $path) {
- $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
- }
- }
- }
- }
-
- return array_unique($classes);
- }
-
- /**
- * @param string $path
- * @param string $class
- * @param string $prefix
- *
- * @return array
- */
- private function findClassInPath($path, $class, $prefix)
- {
- if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {
- return array();
- }
-
- $classes = array();
- $filename = $class.'.php';
- foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
- if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {
- $classes[] = $class;
- }
- }
-
- return $classes;
- }
-
- /**
- * @param string $path
- * @param string $file
- * @param string $prefix
- *
- * @return string|null
- */
- private function convertFileToClass($path, $file, $prefix)
- {
- $candidates = array(
- // namespaced class
- $namespacedClass = str_replace(array($path.DIRECTORY_SEPARATOR, '.php', '/'), array('', '', '\\'), $file),
- // namespaced class (with target dir)
- $prefix.$namespacedClass,
- // namespaced class (with target dir and separator)
- $prefix.'\\'.$namespacedClass,
- // PEAR class
- str_replace('\\', '_', $namespacedClass),
- // PEAR class (with target dir)
- str_replace('\\', '_', $prefix.$namespacedClass),
- // PEAR class (with target dir and separator)
- str_replace('\\', '_', $prefix.'\\'.$namespacedClass),
- );
-
- if ($prefix) {
- $candidates = array_filter($candidates, function ($candidate) use ($prefix) {return 0 === strpos($candidate, $prefix);});
- }
-
- // We cannot use the autoloader here as most of them use require; but if the class
- // is not found, the new autoloader call will require the file again leading to a
- // "cannot redeclare class" error.
- foreach ($candidates as $candidate) {
- if ($this->classExists($candidate)) {
- return $candidate;
- }
- }
-
- require_once $file;
-
- foreach ($candidates as $candidate) {
- if ($this->classExists($candidate)) {
- return $candidate;
- }
- }
- }
-
- /**
- * @param string $class
- *
- * @return bool
- */
- private function classExists($class)
- {
- return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
- }
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php b/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php
deleted file mode 100644
index 6b87eb3..0000000
--- a/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\FatalErrorException;
-
-/**
- * Attempts to convert fatal errors to exceptions.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-interface FatalErrorHandlerInterface
-{
- /**
- * Attempts to convert an error into an exception.
- *
- * @param array $error An array as returned by error_get_last()
- * @param FatalErrorException $exception A FatalErrorException instance
- *
- * @return FatalErrorException|null A FatalErrorException instance if the class is able to convert the error, null otherwise
- */
- public function handleError(array $error, FatalErrorException $exception);
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php b/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php
deleted file mode 100644
index c6f391a..0000000
--- a/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\UndefinedFunctionException;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-
-/**
- * ErrorHandler for undefined functions.
- *
- * @author Fabien Potencier <fabien@symfony.com>
- */
-class UndefinedFunctionFatalErrorHandler implements FatalErrorHandlerInterface
-{
- /**
- * {@inheritdoc}
- */
- public function handleError(array $error, FatalErrorException $exception)
- {
- $messageLen = strlen($error['message']);
- $notFoundSuffix = '()';
- $notFoundSuffixLen = strlen($notFoundSuffix);
- if ($notFoundSuffixLen > $messageLen) {
- return;
- }
-
- if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundSuffixLen)) {
- return;
- }
-
- $prefix = 'Call to undefined function ';
- $prefixLen = strlen($prefix);
- if (0 !== strpos($error['message'], $prefix)) {
- return;
- }
-
- $fullyQualifiedFunctionName = substr($error['message'], $prefixLen, -$notFoundSuffixLen);
- if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedFunctionName, '\\')) {
- $functionName = substr($fullyQualifiedFunctionName, $namespaceSeparatorIndex + 1);
- $namespacePrefix = substr($fullyQualifiedFunctionName, 0, $namespaceSeparatorIndex);
- $message = sprintf('Attempted to call function "%s" from namespace "%s".', $functionName, $namespacePrefix);
- } else {
- $functionName = $fullyQualifiedFunctionName;
- $message = sprintf('Attempted to call function "%s" from the global namespace.', $functionName);
- }
-
- $candidates = array();
- foreach (get_defined_functions() as $type => $definedFunctionNames) {
- foreach ($definedFunctionNames as $definedFunctionName) {
- if (false !== $namespaceSeparatorIndex = strrpos($definedFunctionName, '\\')) {
- $definedFunctionNameBasename = substr($definedFunctionName, $namespaceSeparatorIndex + 1);
- } else {
- $definedFunctionNameBasename = $definedFunctionName;
- }
-
- if ($definedFunctionNameBasename === $functionName) {
- $candidates[] = '\\'.$definedFunctionName;
- }
- }
- }
-
- if ($candidates) {
- sort($candidates);
- $last = array_pop($candidates).'"?';
- if ($candidates) {
- $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last;
- } else {
- $candidates = '"'.$last;
- }
- $message .= "\nDid you mean to call ".$candidates;
- }
-
- return new UndefinedFunctionException($message, $exception);
- }
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php b/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
deleted file mode 100644
index f734d6b..0000000
--- a/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\Exception\UndefinedMethodException;
-
-/**
- * ErrorHandler for undefined methods.
- *
- * @author Grégoire Pineau <lyrixx@lyrixx.info>
- */
-class UndefinedMethodFatalErrorHandler implements FatalErrorHandlerInterface
-{
- /**
- * {@inheritdoc}
- */
- public function handleError(array $error, FatalErrorException $exception)
- {
- preg_match('/^Call to undefined method (.*)::(.*)\(\)$/', $error['message'], $matches);
- if (!$matches) {
- return;
- }
-
- $className = $matches[1];
- $methodName = $matches[2];
-
- $message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className);
-
- $candidates = array();
- foreach (get_class_methods($className) as $definedMethodName) {
- $lev = levenshtein($methodName, $definedMethodName);
- if ($lev <= strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) {
- $candidates[] = $definedMethodName;
- }
- }
-
- if ($candidates) {
- sort($candidates);
- $last = array_pop($candidates).'"?';
- if ($candidates) {
- $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last;
- } else {
- $candidates = '"'.$last;
- }
- $message .= "\nDid you mean to call ".$candidates;
- }
-
- return new UndefinedMethodException($message, $exception);
- }
-}
diff --git a/vendor/symfony/debug/README.md b/vendor/symfony/debug/README.md
deleted file mode 100644
index a1d1617..0000000
--- a/vendor/symfony/debug/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-Debug Component
-===============
-
-The Debug component provides tools to ease debugging PHP code.
-
-Resources
----------
-
- * [Documentation](https://symfony.com/doc/current/components/debug/index.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/debug/Resources/ext/README.md b/vendor/symfony/debug/Resources/ext/README.md
deleted file mode 100644
index 25dccf0..0000000
--- a/vendor/symfony/debug/Resources/ext/README.md
+++ /dev/null
@@ -1,134 +0,0 @@
-Symfony Debug Extension for PHP 5
-=================================
-
-This extension publishes several functions to help building powerful debugging tools.
-It is compatible with PHP 5.3, 5.4, 5.5 and 5.6; with ZTS and non-ZTS modes.
-It is not required thus not provided for PHP 7.
-
-symfony_zval_info()
--------------------
-
-- exposes zval_hash/refcounts, allowing e.g. efficient exploration of arbitrary structures in PHP,
-- does work with references, preventing memory copying.
-
-Its behavior is about the same as:
-
-```php
-<?php
-
-function symfony_zval_info($key, $array, $options = 0)
-{
-
- // $options is currently not used, but could be in future version.
-
- if (!array_key_exists($key, $array)) {
- return null;
- }
-
- $info = array(
- 'type' => gettype($array[$key]),
- 'zval_hash' => /* hashed memory address of $array[$key] */,
- 'zval_refcount' => /* internal zval refcount of $array[$key] */,
- 'zval_isref' => /* is_ref status of $array[$key] */,
- );
-
- switch ($info['type']) {
- case 'object':
- $info += array(
- 'object_class' => get_class($array[$key]),
- 'object_refcount' => /* internal object refcount of $array[$key] */,
- 'object_hash' => spl_object_hash($array[$key]),
- 'object_handle' => /* internal object handle $array[$key] */,
- );
- break;
-
- case 'resource':
- $info += array(
- 'resource_handle' => (int) $array[$key],
- 'resource_type' => get_resource_type($array[$key]),
- 'resource_refcount' => /* internal resource refcount of $array[$key] */,
- );
- break;
-
- case 'array':
- $info += array(
- 'array_count' => count($array[$key]),
- );
- break;
-
- case 'string':
- $info += array(
- 'strlen' => strlen($array[$key]),
- );
- break;
- }
-
- return $info;
-}
-```
-
-symfony_debug_backtrace()
--------------------------
-
-This function works like debug_backtrace(), except that it can fetch the full backtrace in case of fatal errors:
-
-```php
-function foo() { fatal(); }
-function bar() { foo(); }
-
-function sd() { var_dump(symfony_debug_backtrace()); }
-
-register_shutdown_function('sd');
-
-bar();
-
-/* Will output
-Fatal error: Call to undefined function fatal() in foo.php on line 42
-array(3) {
- [0]=>
- array(2) {
- ["function"]=>
- string(2) "sd"
- ["args"]=>
- array(0) {
- }
- }
- [1]=>
- array(4) {
- ["file"]=>
- string(7) "foo.php"
- ["line"]=>
- int(1)
- ["function"]=>
- string(3) "foo"
- ["args"]=>
- array(0) {
- }
- }
- [2]=>
- array(4) {
- ["file"]=>
- string(102) "foo.php"
- ["line"]=>
- int(2)
- ["function"]=>
- string(3) "bar"
- ["args"]=>
- array(0) {
- }
- }
-}
-*/
-```
-
-Usage
------
-
-To enable the extension from source, run:
-
-```
- phpize
- ./configure
- make
- sudo make install
-```
diff --git a/vendor/symfony/debug/Resources/ext/config.m4 b/vendor/symfony/debug/Resources/ext/config.m4
deleted file mode 100644
index 3c56047..0000000
--- a/vendor/symfony/debug/Resources/ext/config.m4
+++ /dev/null
@@ -1,63 +0,0 @@
-dnl $Id$
-dnl config.m4 for extension symfony_debug
-
-dnl Comments in this file start with the string 'dnl'.
-dnl Remove where necessary. This file will not work
-dnl without editing.
-
-dnl If your extension references something external, use with:
-
-dnl PHP_ARG_WITH(symfony_debug, for symfony_debug support,
-dnl Make sure that the comment is aligned:
-dnl [ --with-symfony_debug Include symfony_debug support])
-
-dnl Otherwise use enable:
-
-PHP_ARG_ENABLE(symfony_debug, whether to enable symfony_debug support,
-dnl Make sure that the comment is aligned:
-[ --enable-symfony_debug Enable symfony_debug support])
-
-if test "$PHP_SYMFONY_DEBUG" != "no"; then
- dnl Write more examples of tests here...
-
- dnl # --with-symfony_debug -> check with-path
- dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
- dnl SEARCH_FOR="/include/symfony_debug.h" # you most likely want to change this
- dnl if test -r $PHP_SYMFONY_DEBUG/$SEARCH_FOR; then # path given as parameter
- dnl SYMFONY_DEBUG_DIR=$PHP_SYMFONY_DEBUG
- dnl else # search default path list
- dnl AC_MSG_CHECKING([for symfony_debug files in default path])
- dnl for i in $SEARCH_PATH ; do
- dnl if test -r $i/$SEARCH_FOR; then
- dnl SYMFONY_DEBUG_DIR=$i
- dnl AC_MSG_RESULT(found in $i)
- dnl fi
- dnl done
- dnl fi
- dnl
- dnl if test -z "$SYMFONY_DEBUG_DIR"; then
- dnl AC_MSG_RESULT([not found])
- dnl AC_MSG_ERROR([Please reinstall the symfony_debug distribution])
- dnl fi
-
- dnl # --with-symfony_debug -> add include path
- dnl PHP_ADD_INCLUDE($SYMFONY_DEBUG_DIR/include)
-
- dnl # --with-symfony_debug -> check for lib and symbol presence
- dnl LIBNAME=symfony_debug # you may want to change this
- dnl LIBSYMBOL=symfony_debug # you most likely want to change this
-
- dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- dnl [
- dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SYMFONY_DEBUG_DIR/lib, SYMFONY_DEBUG_SHARED_LIBADD)
- dnl AC_DEFINE(HAVE_SYMFONY_DEBUGLIB,1,[ ])
- dnl ],[
- dnl AC_MSG_ERROR([wrong symfony_debug lib version or lib not found])
- dnl ],[
- dnl -L$SYMFONY_DEBUG_DIR/lib -lm
- dnl ])
- dnl
- dnl PHP_SUBST(SYMFONY_DEBUG_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION(symfony_debug, symfony_debug.c, $ext_shared)
-fi
diff --git a/vendor/symfony/debug/Resources/ext/config.w32 b/vendor/symfony/debug/Resources/ext/config.w32
deleted file mode 100644
index 487e691..0000000
--- a/vendor/symfony/debug/Resources/ext/config.w32
+++ /dev/null
@@ -1,13 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-// If your extension references something external, use ARG_WITH
-// ARG_WITH("symfony_debug", "for symfony_debug support", "no");
-
-// Otherwise, use ARG_ENABLE
-// ARG_ENABLE("symfony_debug", "enable symfony_debug support", "no");
-
-if (PHP_SYMFONY_DEBUG != "no") {
- EXTENSION("symfony_debug", "symfony_debug.c");
-}
-
diff --git a/vendor/symfony/debug/Resources/ext/php_symfony_debug.h b/vendor/symfony/debug/Resources/ext/php_symfony_debug.h
deleted file mode 100644
index 26d0e8c..0000000
--- a/vendor/symfony/debug/Resources/ext/php_symfony_debug.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-#ifndef PHP_SYMFONY_DEBUG_H
-#define PHP_SYMFONY_DEBUG_H
-
-extern zend_module_entry symfony_debug_module_entry;
-#define phpext_symfony_debug_ptr &symfony_debug_module_entry
-
-#define PHP_SYMFONY_DEBUG_VERSION "2.7"
-
-#ifdef PHP_WIN32
-# define PHP_SYMFONY_DEBUG_API __declspec(dllexport)
-#elif defined(__GNUC__) && __GNUC__ >= 4
-# define PHP_SYMFONY_DEBUG_API __attribute__ ((visibility("default")))
-#else
-# define PHP_SYMFONY_DEBUG_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-ZEND_BEGIN_MODULE_GLOBALS(symfony_debug)
- intptr_t req_rand_init;
- void (*old_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
- zval *debug_bt;
-ZEND_END_MODULE_GLOBALS(symfony_debug)
-
-PHP_MINIT_FUNCTION(symfony_debug);
-PHP_MSHUTDOWN_FUNCTION(symfony_debug);
-PHP_RINIT_FUNCTION(symfony_debug);
-PHP_RSHUTDOWN_FUNCTION(symfony_debug);
-PHP_MINFO_FUNCTION(symfony_debug);
-PHP_GINIT_FUNCTION(symfony_debug);
-PHP_GSHUTDOWN_FUNCTION(symfony_debug);
-
-PHP_FUNCTION(symfony_zval_info);
-PHP_FUNCTION(symfony_debug_backtrace);
-
-static char *_symfony_debug_memory_address_hash(void * TSRMLS_DC);
-static const char *_symfony_debug_zval_type(zval *);
-static const char* _symfony_debug_get_resource_type(long TSRMLS_DC);
-static int _symfony_debug_get_resource_refcount(long TSRMLS_DC);
-
-void symfony_debug_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
-
-#ifdef ZTS
-#define SYMFONY_DEBUG_G(v) TSRMG(symfony_debug_globals_id, zend_symfony_debug_globals *, v)
-#else
-#define SYMFONY_DEBUG_G(v) (symfony_debug_globals.v)
-#endif
-
-#endif /* PHP_SYMFONY_DEBUG_H */
diff --git a/vendor/symfony/debug/Resources/ext/symfony_debug.c b/vendor/symfony/debug/Resources/ext/symfony_debug.c
deleted file mode 100644
index 0d7cb60..0000000
--- a/vendor/symfony/debug/Resources/ext/symfony_debug.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_symfony_debug.h"
-#include "ext/standard/php_rand.h"
-#include "ext/standard/php_lcg.h"
-#include "ext/spl/php_spl.h"
-#include "Zend/zend_gc.h"
-#include "Zend/zend_builtin_functions.h"
-#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
-#include "ext/standard/php_array.h"
-#include "Zend/zend_interfaces.h"
-#include "SAPI.h"
-
-#define IS_PHP_53 ZEND_EXTENSION_API_NO == 220090626
-
-ZEND_DECLARE_MODULE_GLOBALS(symfony_debug)
-
-ZEND_BEGIN_ARG_INFO_EX(symfony_zval_arginfo, 0, 0, 2)
- ZEND_ARG_INFO(0, key)
- ZEND_ARG_ARRAY_INFO(0, array, 0)
- ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-const zend_function_entry symfony_debug_functions[] = {
- PHP_FE(symfony_zval_info, symfony_zval_arginfo)
- PHP_FE(symfony_debug_backtrace, NULL)
- PHP_FE_END
-};
-
-PHP_FUNCTION(symfony_debug_backtrace)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- return;
- }
-#if IS_PHP_53
- zend_fetch_debug_backtrace(return_value, 1, 0 TSRMLS_CC);
-#else
- zend_fetch_debug_backtrace(return_value, 1, 0, 0 TSRMLS_CC);
-#endif
-
- if (!SYMFONY_DEBUG_G(debug_bt)) {
- return;
- }
-
- php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(SYMFONY_DEBUG_G(debug_bt)), 0 TSRMLS_CC);
-}
-
-PHP_FUNCTION(symfony_zval_info)
-{
- zval *key = NULL, *arg = NULL;
- zval **data = NULL;
- HashTable *array = NULL;
- long options = 0;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zh|l", &key, &array, &options) == FAILURE) {
- return;
- }
-
- switch (Z_TYPE_P(key)) {
- case IS_STRING:
- if (zend_symtable_find(array, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&data) == FAILURE) {
- return;
- }
- break;
- case IS_LONG:
- if (zend_hash_index_find(array, Z_LVAL_P(key), (void **)&data)) {
- return;
- }
- break;
- }
-
- arg = *data;
-
- array_init(return_value);
-
- add_assoc_string(return_value, "type", (char *)_symfony_debug_zval_type(arg), 1);
- add_assoc_stringl(return_value, "zval_hash", _symfony_debug_memory_address_hash((void *)arg TSRMLS_CC), 16, 0);
- add_assoc_long(return_value, "zval_refcount", Z_REFCOUNT_P(arg));
- add_assoc_bool(return_value, "zval_isref", (zend_bool)Z_ISREF_P(arg));
-
- if (Z_TYPE_P(arg) == IS_OBJECT) {
- char hash[33] = {0};
-
- php_spl_object_hash(arg, (char *)hash TSRMLS_CC);
- add_assoc_stringl(return_value, "object_class", (char *)Z_OBJCE_P(arg)->name, Z_OBJCE_P(arg)->name_length, 1);
- add_assoc_long(return_value, "object_refcount", EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(arg)].bucket.obj.refcount);
- add_assoc_string(return_value, "object_hash", hash, 1);
- add_assoc_long(return_value, "object_handle", Z_OBJ_HANDLE_P(arg));
- } else if (Z_TYPE_P(arg) == IS_ARRAY) {
- add_assoc_long(return_value, "array_count", zend_hash_num_elements(Z_ARRVAL_P(arg)));
- } else if(Z_TYPE_P(arg) == IS_RESOURCE) {
- add_assoc_long(return_value, "resource_handle", Z_LVAL_P(arg));
- add_assoc_string(return_value, "resource_type", (char *)_symfony_debug_get_resource_type(Z_LVAL_P(arg) TSRMLS_CC), 1);
- add_assoc_long(return_value, "resource_refcount", _symfony_debug_get_resource_refcount(Z_LVAL_P(arg) TSRMLS_CC));
- } else if (Z_TYPE_P(arg) == IS_STRING) {
- add_assoc_long(return_value, "strlen", Z_STRLEN_P(arg));
- }
-}
-
-void symfony_debug_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
-{
- TSRMLS_FETCH();
- zval *retval;
-
- switch (type) {
- case E_ERROR:
- case E_PARSE:
- case E_CORE_ERROR:
- case E_CORE_WARNING:
- case E_COMPILE_ERROR:
- case E_COMPILE_WARNING:
- ALLOC_INIT_ZVAL(retval);
-#if IS_PHP_53
- zend_fetch_debug_backtrace(retval, 1, 0 TSRMLS_CC);
-#else
- zend_fetch_debug_backtrace(retval, 1, 0, 0 TSRMLS_CC);
-#endif
- SYMFONY_DEBUG_G(debug_bt) = retval;
- }
-
- SYMFONY_DEBUG_G(old_error_cb)(type, error_filename, error_lineno, format, args);
-}
-
-static const char* _symfony_debug_get_resource_type(long rsid TSRMLS_DC)
-{
- const char *res_type;
- res_type = zend_rsrc_list_get_rsrc_type(rsid TSRMLS_CC);
-
- if (!res_type) {
- return "Unknown";
- }
-
- return res_type;
-}
-
-static int _symfony_debug_get_resource_refcount(long rsid TSRMLS_DC)
-{
- zend_rsrc_list_entry *le;
-
- if (zend_hash_index_find(&EG(regular_list), rsid, (void **) &le)==SUCCESS) {
- return le->refcount;
- }
-
- return 0;
-}
-
-static char *_symfony_debug_memory_address_hash(void *address TSRMLS_DC)
-{
- char *result = NULL;
- intptr_t address_rand;
-
- if (!SYMFONY_DEBUG_G(req_rand_init)) {
- if (!BG(mt_rand_is_seeded)) {
- php_mt_srand(GENERATE_SEED() TSRMLS_CC);
- }
- SYMFONY_DEBUG_G(req_rand_init) = (intptr_t)php_mt_rand(TSRMLS_C);
- }
-
- address_rand = (intptr_t)address ^ SYMFONY_DEBUG_G(req_rand_init);
-
- spprintf(&result, 17, "%016zx", address_rand);
-
- return result;
-}
-
-static const char *_symfony_debug_zval_type(zval *zv)
-{
- switch (Z_TYPE_P(zv)) {
- case IS_NULL:
- return "NULL";
- break;
-
- case IS_BOOL:
- return "boolean";
- break;
-
- case IS_LONG:
- return "integer";
- break;
-
- case IS_DOUBLE:
- return "double";
- break;
-
- case IS_STRING:
- return "string";
- break;
-
- case IS_ARRAY:
- return "array";
- break;
-
- case IS_OBJECT:
- return "object";
-
- case IS_RESOURCE:
- return "resource";
-
- default:
- return "unknown type";
- }
-}
-
-zend_module_entry symfony_debug_module_entry = {
- STANDARD_MODULE_HEADER,
- "symfony_debug",
- symfony_debug_functions,
- PHP_MINIT(symfony_debug),
- PHP_MSHUTDOWN(symfony_debug),
- PHP_RINIT(symfony_debug),
- PHP_RSHUTDOWN(symfony_debug),
- PHP_MINFO(symfony_debug),
- PHP_SYMFONY_DEBUG_VERSION,
- PHP_MODULE_GLOBALS(symfony_debug),
- PHP_GINIT(symfony_debug),
- PHP_GSHUTDOWN(symfony_debug),
- NULL,
- STANDARD_MODULE_PROPERTIES_EX
-};
-
-#ifdef COMPILE_DL_SYMFONY_DEBUG
-ZEND_GET_MODULE(symfony_debug)
-#endif
-
-PHP_GINIT_FUNCTION(symfony_debug)
-{
- memset(symfony_debug_globals, 0 , sizeof(*symfony_debug_globals));
-}
-
-PHP_GSHUTDOWN_FUNCTION(symfony_debug)
-{
-
-}
-
-PHP_MINIT_FUNCTION(symfony_debug)
-{
- SYMFONY_DEBUG_G(old_error_cb) = zend_error_cb;
- zend_error_cb = symfony_debug_error_cb;
-
- return SUCCESS;
-}
-
-PHP_MSHUTDOWN_FUNCTION(symfony_debug)
-{
- zend_error_cb = SYMFONY_DEBUG_G(old_error_cb);
-
- return SUCCESS;
-}
-
-PHP_RINIT_FUNCTION(symfony_debug)
-{
- return SUCCESS;
-}
-
-PHP_RSHUTDOWN_FUNCTION(symfony_debug)
-{
- return SUCCESS;
-}
-
-PHP_MINFO_FUNCTION(symfony_debug)
-{
- php_info_print_table_start();
- php_info_print_table_header(2, "Symfony Debug support", "enabled");
- php_info_print_table_header(2, "Symfony Debug version", PHP_SYMFONY_DEBUG_VERSION);
- php_info_print_table_end();
-}
diff --git a/vendor/symfony/debug/Resources/ext/tests/001.phpt b/vendor/symfony/debug/Resources/ext/tests/001.phpt
deleted file mode 100644
index 4d41417..0000000
--- a/vendor/symfony/debug/Resources/ext/tests/001.phpt
+++ /dev/null
@@ -1,151 +0,0 @@
---TEST--
-Test symfony_zval_info API
---SKIPIF--
-<?php if (!extension_loaded("symfony_debug")) print "skip"; ?>
---FILE--
-<?php
-
-$int = 42;
-$float = 42.42;
-$str = "foobar";
-$object = new StdClass;
-$array = array('foo', 'bar');
-$resource = tmpfile();
-$null = null;
-$bool = true;
-
-$anotherint = 42;
-$refcount2 = &$anotherint;
-
-$var = array('int' => $int,
- 'float' => $float,
- 'str' => $str,
- 'object' => $object,
- 'array' => $array,
- 'resource' => $resource,
- 'null' => $null,
- 'bool' => $bool,
- 'refcount' => &$refcount2);
-
-var_dump(symfony_zval_info('int', $var));
-var_dump(symfony_zval_info('float', $var));
-var_dump(symfony_zval_info('str', $var));
-var_dump(symfony_zval_info('object', $var));
-var_dump(symfony_zval_info('array', $var));
-var_dump(symfony_zval_info('resource', $var));
-var_dump(symfony_zval_info('null', $var));
-var_dump(symfony_zval_info('bool', $var));
-
-var_dump(symfony_zval_info('refcount', $var));
-var_dump(symfony_zval_info('not-exist', $var));
-?>
---EXPECTF--
-array(4) {
- ["type"]=>
- string(7) "integer"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(4) {
- ["type"]=>
- string(6) "double"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(5) {
- ["type"]=>
- string(6) "string"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["strlen"]=>
- int(6)
-}
-array(8) {
- ["type"]=>
- string(6) "object"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["object_class"]=>
- string(8) "stdClass"
- ["object_refcount"]=>
- int(1)
- ["object_hash"]=>
- string(32) "%s"
- ["object_handle"]=>
- int(%d)
-}
-array(5) {
- ["type"]=>
- string(5) "array"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["array_count"]=>
- int(2)
-}
-array(7) {
- ["type"]=>
- string(8) "resource"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["resource_handle"]=>
- int(%d)
- ["resource_type"]=>
- string(6) "stream"
- ["resource_refcount"]=>
- int(1)
-}
-array(4) {
- ["type"]=>
- string(4) "NULL"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(4) {
- ["type"]=>
- string(7) "boolean"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(4) {
- ["type"]=>
- string(7) "integer"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(3)
- ["zval_isref"]=>
- bool(true)
-}
-NULL
diff --git a/vendor/symfony/debug/Resources/ext/tests/002.phpt b/vendor/symfony/debug/Resources/ext/tests/002.phpt
deleted file mode 100644
index ebe2f32..0000000
--- a/vendor/symfony/debug/Resources/ext/tests/002.phpt
+++ /dev/null
@@ -1,64 +0,0 @@
---TEST--
-Test symfony_debug_backtrace in case of fatal error
---SKIPIF--
-<?php if (!extension_loaded("symfony_debug")) print "skip"; ?>
---FILE--
-<?php
-
-function bar()
-{
- foo();
-}
-
-function foo()
-{
- notexist();
-}
-
-function bt()
-{
- print_r(symfony_debug_backtrace());
-
-}
-
-register_shutdown_function('bt');
-
-bar();
-
-?>
---EXPECTF--
-Fatal error: Call to undefined function notexist() in %s on line %d
-Array
-(
- [0] => Array
- (
- [function] => bt
- [args] => Array
- (
- )
-
- )
-
- [1] => Array
- (
- [file] => %s
- [line] => %d
- [function] => foo
- [args] => Array
- (
- )
-
- )
-
- [2] => Array
- (
- [file] => %s
- [line] => %d
- [function] => bar
- [args] => Array
- (
- )
-
- )
-
-)
diff --git a/vendor/symfony/debug/Resources/ext/tests/002_1.phpt b/vendor/symfony/debug/Resources/ext/tests/002_1.phpt
deleted file mode 100644
index 4d52dbf..0000000
--- a/vendor/symfony/debug/Resources/ext/tests/002_1.phpt
+++ /dev/null
@@ -1,47 +0,0 @@
---TEST--
-Test symfony_debug_backtrace in case of non fatal error
---SKIPIF--
-<?php if (!extension_loaded("symfony_debug")) print "skip"; ?>
---FILE--
-<?php
-
-function bar()
-{
- bt();
-}
-
-function bt()
-{
- print_r(symfony_debug_backtrace());
-
-}
-
-bar();
-
-?>
---EXPECTF--
-Array
-(
- [0] => Array
- (
- [file] => %s
- [line] => %d
- [function] => bt
- [args] => Array
- (
- )
-
- )
-
- [1] => Array
- (
- [file] => %s
- [line] => %d
- [function] => bar
- [args] => Array
- (
- )
-
- )
-
-)
diff --git a/vendor/symfony/debug/Resources/ext/tests/003.phpt b/vendor/symfony/debug/Resources/ext/tests/003.phpt
deleted file mode 100644
index a363333..0000000
--- a/vendor/symfony/debug/Resources/ext/tests/003.phpt
+++ /dev/null
@@ -1,85 +0,0 @@
---TEST--
-Test ErrorHandler in case of fatal error
---SKIPIF--
-<?php if (!extension_loaded("symfony_debug")) print "skip"; ?>
---FILE--
-<?php
-
-namespace Psr\Log;
-
-class LogLevel
-{
- const EMERGENCY = 'emergency';
- const ALERT = 'alert';
- const CRITICAL = 'critical';
- const ERROR = 'error';
- const WARNING = 'warning';
- const NOTICE = 'notice';
- const INFO = 'info';
- const DEBUG = 'debug';
-}
-
-namespace Symfony\Component\Debug;
-
-$dir = __DIR__.'/../../../';
-require $dir.'ErrorHandler.php';
-require $dir.'Exception/FatalErrorException.php';
-require $dir.'Exception/UndefinedFunctionException.php';
-require $dir.'FatalErrorHandler/FatalErrorHandlerInterface.php';
-require $dir.'FatalErrorHandler/ClassNotFoundFatalErrorHandler.php';
-require $dir.'FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php';
-require $dir.'FatalErrorHandler/UndefinedMethodFatalErrorHandler.php';
-
-function bar()
-{
- foo();
-}
-
-function foo()
-{
- notexist();
-}
-
-$handler = ErrorHandler::register();
-$handler->setExceptionHandler('print_r');
-
-if (function_exists('xdebug_disable')) {
- xdebug_disable();
-}
-
-bar();
-?>
---EXPECTF--
-Fatal error: Call to undefined function Symfony\Component\Debug\notexist() in %s on line %d
-Symfony\Component\Debug\Exception\UndefinedFunctionException Object
-(
- [message:protected] => Attempted to call function "notexist" from namespace "Symfony\Component\Debug".
- [string:Exception:private] =>
- [code:protected] => 0
- [file:protected] => %s
- [line:protected] => %d
- [trace:Exception:private] => Array
- (
- [0] => Array
- (
-%A [function] => Symfony\Component\Debug\foo
-%A [args] => Array
- (
- )
-
- )
-
- [1] => Array
- (
-%A [function] => Symfony\Component\Debug\bar
-%A [args] => Array
- (
- )
-
- )
-%A
- )
-
- [previous:Exception:private] =>
- [severity:protected] => 1
-)
diff --git a/vendor/symfony/debug/composer.json b/vendor/symfony/debug/composer.json
deleted file mode 100644
index 1f3de3e..0000000
--- a/vendor/symfony/debug/composer.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "name": "symfony/debug",
- "type": "library",
- "description": "Symfony Debug Component",
- "keywords": [],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": ">=5.5.9",
- "psr/log": "~1.0"
- },
- "conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
- },
- "require-dev": {
- "symfony/class-loader": "~2.8|~3.0",
- "symfony/http-kernel": "~2.8|~3.0"
- },
- "autoload": {
- "psr-4": { "Symfony\\Component\\Debug\\": "" },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
- }
-}
diff --git a/vendor/symfony/debug/phpunit.xml.dist b/vendor/symfony/debug/phpunit.xml.dist
deleted file mode 100644
index e99c4dd..0000000
--- a/vendor/symfony/debug/phpunit.xml.dist
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
- backupGlobals="false"
- colors="true"
- bootstrap="vendor/autoload.php"
->
- <php>
- <ini name="error_reporting" value="-1" />
- </php>
-
- <testsuites>
- <testsuite name="Symfony Debug Component Test Suite">
- <directory>./Tests/</directory>
- </testsuite>
- <testsuite name="Symfony Debug Extension Test Suite">
- <directory suffix=".phpt">./Resources/ext/tests/</directory>
- </testsuite>
- </testsuites>
-
- <filter>
- <whitelist>
- <directory>./</directory>
- <exclude>
- <directory>./Tests</directory>
- <directory>./vendor</directory>
- </exclude>
- </whitelist>
- </filter>
-</phpunit>
diff --git a/vendor/symfony/console/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore
index c49a5d8..c49a5d8 100644
--- a/vendor/symfony/console/.gitignore
+++ b/vendor/symfony/deprecation-contracts/.gitignore
diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md
new file mode 100644
index 0000000..7932e26
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/CHANGELOG.md
@@ -0,0 +1,5 @@
+CHANGELOG
+=========
+
+The changelog is maintained for all Symfony contracts at the following URL:
+https://github.com/symfony/contracts/blob/main/CHANGELOG.md
diff --git a/vendor/psr/log/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE
index 474c952..406242f 100644
--- a/vendor/psr/log/LICENSE
+++ b/vendor/symfony/deprecation-contracts/LICENSE
@@ -1,14 +1,14 @@
-Copyright (c) 2012 PHP Framework Interoperability Group
+Copyright (c) 2020-2022 Fabien Potencier
-Permission is hereby granted, free of charge, to any person obtaining a copy
+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:
+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 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,
diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md
new file mode 100644
index 0000000..4957933
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/README.md
@@ -0,0 +1,26 @@
+Symfony Deprecation Contracts
+=============================
+
+A generic function and convention to trigger deprecation notices.
+
+This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.
+
+By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component,
+the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.
+
+The function requires at least 3 arguments:
+ - the name of the Composer package that is triggering the deprecation
+ - the version of the package that introduced the deprecation
+ - the message of the deprecation
+ - more arguments can be provided: they will be inserted in the message using `printf()` formatting
+
+Example:
+```php
+trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
+```
+
+This will generate the following message:
+`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
+
+While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty
+`function trigger_deprecation() {}` in your application.
diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json
new file mode 100644
index 0000000..cc7cc12
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/composer.json
@@ -0,0 +1,35 @@
+{
+ "name": "symfony/deprecation-contracts",
+ "type": "library",
+ "description": "A generic function and convention to trigger deprecation notices",
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=7.1"
+ },
+ "autoload": {
+ "files": [
+ "function.php"
+ ]
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ }
+}
diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php
new file mode 100644
index 0000000..d437150
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/function.php
@@ -0,0 +1,27 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+if (!function_exists('trigger_deprecation')) {
+ /**
+ * Triggers a silenced deprecation notice.
+ *
+ * @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 $message The message of the deprecation
+ * @param mixed ...$args Values to insert in the message using printf() formatting
+ *
+ * @author Nicolas Grekas <p@tchwork.com>
+ */
+ function trigger_deprecation(string $package, string $version, string $message, ...$args): void
+ {
+ @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
+ }
+}
diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE
index 39fa189..4cd8bdd 100644
--- a/vendor/symfony/polyfill-mbstring/LICENSE
+++ b/vendor/symfony/polyfill-mbstring/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2016 Fabien Potencier
+Copyright (c) 2015-2019 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
diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php
index 85a0668..693749f 100644
--- a/vendor/symfony/polyfill-mbstring/Mbstring.php
+++ b/vendor/symfony/polyfill-mbstring/Mbstring.php
@@ -15,20 +15,27 @@ namespace Symfony\Polyfill\Mbstring;
* Partial mbstring implementation in PHP, iconv based, UTF-8 centric.
*
* Implemented:
+ * - mb_chr - Returns a specific character from its Unicode code point
* - mb_convert_encoding - Convert character encoding
* - mb_convert_variables - Convert character code in variable(s)
* - mb_decode_mimeheader - Decode string in MIME header field
* - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED
+ * - mb_decode_numericentity - Decode HTML numeric string reference to character
+ * - mb_encode_numericentity - Encode character to HTML numeric string reference
* - mb_convert_case - Perform case folding on a string
+ * - mb_detect_encoding - Detect character encoding
* - mb_get_info - Get internal settings of mbstring
* - mb_http_input - Detect HTTP input character encoding
* - mb_http_output - Set/Get HTTP output character encoding
* - mb_internal_encoding - Set/Get internal character encoding
* - mb_list_encodings - Returns an array of all supported encodings
+ * - mb_ord - Returns the Unicode code point of a character
* - mb_output_handler - Callback function converts character encoding in output buffer
+ * - mb_scrub - Replaces ill-formed byte sequences with substitute characters
* - mb_strlen - Get string length
* - mb_strpos - Find position of first occurrence of string in a string
* - mb_strrpos - Find position of last occurrence of a string in a string
+ * - mb_str_split - Convert a string to an array
* - mb_strtolower - Make a string lowercase
* - mb_strtoupper - Make a string uppercase
* - mb_substitute_character - Set/Get substitution character
@@ -38,14 +45,12 @@ namespace Symfony\Polyfill\Mbstring;
* - mb_strrchr - Finds the last occurrence of a character in a string within another
* - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive
* - mb_strripos - Finds position of last occurrence of a string within another, case insensitive
- * - mb_strstr - Finds first occurrence of a string within anothers
+ * - mb_strstr - Finds first occurrence of a string within another
* - mb_strwidth - Return width of string
* - mb_substr_count - Count the number of substring occurrences
*
* Not implemented:
* - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more)
- * - mb_decode_numericentity - Decode HTML numeric string reference to character
- * - mb_encode_numericentity - Encode character to HTML numeric string reference
* - mb_ereg_* - Regular expression with multibyte support
* - mb_parse_str - Parse GET/POST/COOKIE data and set global variable
* - mb_preferred_mime_name - Get MIME charset string
@@ -62,19 +67,20 @@ namespace Symfony\Polyfill\Mbstring;
*/
final class Mbstring
{
- const MB_CASE_FOLD = PHP_INT_MAX;
+ public const MB_CASE_FOLD = \PHP_INT_MAX;
+
+ private const CASE_FOLD = [
+ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"],
+ ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'],
+ ];
- private static $encodingList = array('ASCII', 'UTF-8');
+ private static $encodingList = ['ASCII', 'UTF-8'];
private static $language = 'neutral';
private static $internalEncoding = 'UTF-8';
- private static $caseFold = array(
- array('µ','ſ',"\xCD\x85",'ς',"\xCF\x90","\xCF\x91","\xCF\x95","\xCF\x96","\xCF\xB0","\xCF\xB1","\xCF\xB5","\xE1\xBA\x9B","\xE1\xBE\xBE"),
- array('μ','s','ι', 'σ','β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1",'ι'),
- );
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
{
- if (is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) {
+ if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) {
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
} else {
$fromEncoding = self::getEncoding($fromEncoding);
@@ -96,27 +102,25 @@ final class Mbstring
$fromEncoding = 'Windows-1252';
}
if ('UTF-8' !== $fromEncoding) {
- $s = iconv($fromEncoding, 'UTF-8', $s);
+ $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s);
}
- return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
+ return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s);
}
if ('HTML-ENTITIES' === $fromEncoding) {
- $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
+ $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8');
$fromEncoding = 'UTF-8';
}
- return iconv($fromEncoding, $toEncoding, $s);
+ return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
}
- public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
+ public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars)
{
- $vars = array(&$a, &$b, &$c, &$d, &$e, &$f);
-
$ok = true;
array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) {
- if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) {
+ if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) {
$ok = false;
}
});
@@ -126,17 +130,148 @@ final class Mbstring
public static function mb_decode_mimeheader($s)
{
- return iconv_mime_decode($s, 2, self::$internalEncoding);
+ return \iconv_mime_decode($s, 2, self::$internalEncoding);
}
public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
{
- trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING);
+ trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING);
+ }
+
+ public static function mb_decode_numericentity($s, $convmap, $encoding = null)
+ {
+ if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
+ trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
+
+ return null;
+ }
+
+ if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) {
+ return false;
+ }
+
+ if (null !== $encoding && !is_scalar($encoding)) {
+ trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
+
+ return ''; // Instead of null (cf. mb_encode_numericentity).
+ }
+
+ $s = (string) $s;
+ if ('' === $s) {
+ return '';
+ }
+
+ $encoding = self::getEncoding($encoding);
+
+ if ('UTF-8' === $encoding) {
+ $encoding = null;
+ if (!preg_match('//u', $s)) {
+ $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
+ }
+ } else {
+ $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
+ }
+
+ $cnt = floor(\count($convmap) / 4) * 4;
+
+ for ($i = 0; $i < $cnt; $i += 4) {
+ // collector_decode_htmlnumericentity ignores $convmap[$i + 3]
+ $convmap[$i] += $convmap[$i + 2];
+ $convmap[$i + 1] += $convmap[$i + 2];
+ }
+
+ $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) {
+ $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1];
+ for ($i = 0; $i < $cnt; $i += 4) {
+ if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) {
+ return self::mb_chr($c - $convmap[$i + 2]);
+ }
+ }
+
+ return $m[0];
+ }, $s);
+
+ if (null === $encoding) {
+ return $s;
+ }
+
+ return \iconv('UTF-8', $encoding.'//IGNORE', $s);
+ }
+
+ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false)
+ {
+ if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
+ trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
+
+ return null;
+ }
+
+ if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) {
+ return false;
+ }
+
+ if (null !== $encoding && !is_scalar($encoding)) {
+ trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
+
+ return null; // Instead of '' (cf. mb_decode_numericentity).
+ }
+
+ if (null !== $is_hex && !is_scalar($is_hex)) {
+ trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING);
+
+ return null;
+ }
+
+ $s = (string) $s;
+ if ('' === $s) {
+ return '';
+ }
+
+ $encoding = self::getEncoding($encoding);
+
+ if ('UTF-8' === $encoding) {
+ $encoding = null;
+ if (!preg_match('//u', $s)) {
+ $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
+ }
+ } else {
+ $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
+ }
+
+ static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
+
+ $cnt = floor(\count($convmap) / 4) * 4;
+ $i = 0;
+ $len = \strlen($s);
+ $result = '';
+
+ while ($i < $len) {
+ $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
+ $uchr = substr($s, $i, $ulen);
+ $i += $ulen;
+ $c = self::mb_ord($uchr);
+
+ for ($j = 0; $j < $cnt; $j += 4) {
+ if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) {
+ $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3];
+ $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';';
+ continue 2;
+ }
+ }
+ $result .= $uchr;
+ }
+
+ if (null === $encoding) {
+ return $result;
+ }
+
+ return \iconv('UTF-8', $encoding.'//IGNORE', $result);
}
public static function mb_convert_case($s, $mode, $encoding = null)
{
- if ('' === $s .= '') {
+ $s = (string) $s;
+ if ('' === $s) {
return '';
}
@@ -144,15 +279,21 @@ final class Mbstring
if ('UTF-8' === $encoding) {
$encoding = null;
+ if (!preg_match('//u', $s)) {
+ $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
+ }
} else {
- $s = iconv($encoding, 'UTF-8', $s);
+ $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
}
- if (MB_CASE_TITLE == $mode) {
- $s = preg_replace_callback('/\b\p{Ll}/u', array(__CLASS__, 'title_case_upper'), $s);
- $s = preg_replace_callback('/\B[\p{Lu}\p{Lt}]+/u', array(__CLASS__, 'title_case_lower'), $s);
+ if (\MB_CASE_TITLE == $mode) {
+ static $titleRegexp = null;
+ if (null === $titleRegexp) {
+ $titleRegexp = self::getData('titleCaseRegexp');
+ }
+ $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s);
} else {
- if (MB_CASE_UPPER == $mode) {
+ if (\MB_CASE_UPPER == $mode) {
static $upper = null;
if (null === $upper) {
$upper = self::getData('upperCase');
@@ -160,7 +301,7 @@ final class Mbstring
$map = $upper;
} else {
if (self::MB_CASE_FOLD === $mode) {
- $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s);
+ $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s);
}
static $lower = null;
@@ -170,10 +311,10 @@ final class Mbstring
$map = $lower;
}
- static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
+ static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
$i = 0;
- $len = strlen($s);
+ $len = \strlen($s);
while ($i < $len) {
$ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
@@ -182,7 +323,7 @@ final class Mbstring
if (isset($map[$uchr])) {
$uchr = $map[$uchr];
- $nlen = strlen($uchr);
+ $nlen = \strlen($uchr);
if ($nlen == $ulen) {
$nlen = $i;
@@ -192,7 +333,7 @@ final class Mbstring
} else {
$s = substr_replace($s, $uchr, $i - $ulen, $ulen);
$len += $nlen - $ulen;
- $i += $nlen - $ulen;
+ $i += $nlen - $ulen;
}
}
}
@@ -202,7 +343,7 @@ final class Mbstring
return $s;
}
- return iconv('UTF-8', $encoding, $s);
+ return \iconv('UTF-8', $encoding.'//IGNORE', $s);
}
public static function mb_internal_encoding($encoding = null)
@@ -211,15 +352,19 @@ final class Mbstring
return self::$internalEncoding;
}
- $encoding = self::getEncoding($encoding);
+ $normalizedEncoding = self::getEncoding($encoding);
- if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) {
- self::$internalEncoding = $encoding;
+ if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) {
+ self::$internalEncoding = $normalizedEncoding;
return true;
}
- return false;
+ if (80000 > \PHP_VERSION_ID) {
+ return false;
+ }
+
+ throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding));
}
public static function mb_language($lang = null)
@@ -228,20 +373,24 @@ final class Mbstring
return self::$language;
}
- switch ($lang = strtolower($lang)) {
+ switch ($normalizedLang = strtolower($lang)) {
case 'uni':
case 'neutral':
- self::$language = $lang;
+ self::$language = $normalizedLang;
return true;
}
- return false;
+ if (80000 > \PHP_VERSION_ID) {
+ return false;
+ }
+
+ throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang));
}
public static function mb_list_encodings()
{
- return array('UTF-8');
+ return ['UTF-8'];
}
public static function mb_encoding_aliases($encoding)
@@ -249,7 +398,7 @@ final class Mbstring
switch (strtoupper($encoding)) {
case 'UTF8':
case 'UTF-8':
- return array('utf8');
+ return ['utf8'];
}
return false;
@@ -264,7 +413,7 @@ final class Mbstring
$encoding = self::$internalEncoding;
}
- return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var);
+ return self::mb_detect_encoding($var, [$encoding]) || false !== @\iconv($encoding, $encoding, $var);
}
public static function mb_detect_encoding($str, $encodingList = null, $strict = false)
@@ -272,7 +421,7 @@ final class Mbstring
if (null === $encodingList) {
$encodingList = self::$encodingList;
} else {
- if (!is_array($encodingList)) {
+ if (!\is_array($encodingList)) {
$encodingList = array_map('trim', explode(',', $encodingList));
}
$encodingList = array_map('strtoupper', $encodingList);
@@ -309,7 +458,7 @@ final class Mbstring
return self::$encodingList;
}
- if (!is_array($encodingList)) {
+ if (!\is_array($encodingList)) {
$encodingList = array_map('trim', explode(',', $encodingList));
}
$encodingList = array_map('strtoupper', $encodingList);
@@ -320,6 +469,7 @@ final class Mbstring
if (strncmp($enc, 'ISO-8859-', 9)) {
return false;
}
+ // no break
case 'ASCII':
case 'UTF8':
case 'UTF-8':
@@ -334,68 +484,140 @@ final class Mbstring
public static function mb_strlen($s, $encoding = null)
{
$encoding = self::getEncoding($encoding);
+ if ('CP850' === $encoding || 'ASCII' === $encoding) {
+ return \strlen($s);
+ }
- return iconv_strlen($s, $encoding);
+ return @\iconv_strlen($s, $encoding);
}
public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
{
$encoding = self::getEncoding($encoding);
+ if ('CP850' === $encoding || 'ASCII' === $encoding) {
+ return strpos($haystack, $needle, $offset);
+ }
- if ('' === $needle .= '') {
- trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING);
+ $needle = (string) $needle;
+ if ('' === $needle) {
+ if (80000 > \PHP_VERSION_ID) {
+ trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING);
- return false;
+ return false;
+ }
+
+ return 0;
}
- return iconv_strpos($haystack, $needle, $offset, $encoding);
+ return \iconv_strpos($haystack, $needle, $offset, $encoding);
}
public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
{
$encoding = self::getEncoding($encoding);
+ if ('CP850' === $encoding || 'ASCII' === $encoding) {
+ return strrpos($haystack, $needle, $offset);
+ }
if ($offset != (int) $offset) {
$offset = 0;
} elseif ($offset = (int) $offset) {
if ($offset < 0) {
- $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
+ if (0 > $offset += self::mb_strlen($needle)) {
+ $haystack = self::mb_substr($haystack, 0, $offset, $encoding);
+ }
$offset = 0;
} else {
$haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding);
}
}
- $pos = iconv_strrpos($haystack, $needle, $encoding);
+ $pos = '' !== $needle || 80000 > \PHP_VERSION_ID
+ ? \iconv_strrpos($haystack, $needle, $encoding)
+ : self::mb_strlen($haystack, $encoding);
return false !== $pos ? $offset + $pos : false;
}
+ public static function mb_str_split($string, $split_length = 1, $encoding = null)
+ {
+ if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) {
+ trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING);
+
+ return null;
+ }
+
+ if (1 > $split_length = (int) $split_length) {
+ if (80000 > \PHP_VERSION_ID) {
+ trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING);
+ return false;
+ }
+
+ throw new \ValueError('Argument #2 ($length) must be greater than 0');
+ }
+
+ if (null === $encoding) {
+ $encoding = mb_internal_encoding();
+ }
+
+ if ('UTF-8' === $encoding = self::getEncoding($encoding)) {
+ $rx = '/(';
+ while (65535 < $split_length) {
+ $rx .= '.{65535}';
+ $split_length -= 65535;
+ }
+ $rx .= '.{'.$split_length.'})/us';
+
+ return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
+ }
+
+ $result = [];
+ $length = mb_strlen($string, $encoding);
+
+ for ($i = 0; $i < $length; $i += $split_length) {
+ $result[] = mb_substr($string, $i, $split_length, $encoding);
+ }
+
+ return $result;
+ }
+
public static function mb_strtolower($s, $encoding = null)
{
- return self::mb_convert_case($s, MB_CASE_LOWER, $encoding);
+ return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
}
public static function mb_strtoupper($s, $encoding = null)
{
- return self::mb_convert_case($s, MB_CASE_UPPER, $encoding);
+ return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
}
public static function mb_substitute_character($c = null)
{
+ if (null === $c) {
+ return 'none';
+ }
if (0 === strcasecmp($c, 'none')) {
return true;
}
+ if (80000 > \PHP_VERSION_ID) {
+ return false;
+ }
+ if (\is_int($c) || 'long' === $c || 'entity' === $c) {
+ return false;
+ }
- return null !== $c ? false : 'none';
+ throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint');
}
public static function mb_substr($s, $start, $length = null, $encoding = null)
{
$encoding = self::getEncoding($encoding);
+ if ('CP850' === $encoding || 'ASCII' === $encoding) {
+ return (string) substr($s, $start, null === $length ? 2147483647 : $length);
+ }
if ($start < 0) {
- $start = iconv_strlen($s, $encoding) + $start;
+ $start = \iconv_strlen($s, $encoding) + $start;
if ($start < 0) {
$start = 0;
}
@@ -404,13 +626,13 @@ final class Mbstring
if (null === $length) {
$length = 2147483647;
} elseif ($length < 0) {
- $length = iconv_strlen($s, $encoding) + $length - $start;
+ $length = \iconv_strlen($s, $encoding) + $length - $start;
if ($length < 0) {
return '';
}
}
- return iconv_substr($s, $start, $length, $encoding).'';
+ return (string) \iconv_substr($s, $start, $length, $encoding);
}
public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
@@ -431,8 +653,12 @@ final class Mbstring
public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null)
{
$encoding = self::getEncoding($encoding);
- $needle = self::mb_substr($needle, 0, 1, $encoding);
- $pos = iconv_strrpos($haystack, $needle, $encoding);
+ if ('CP850' === $encoding || 'ASCII' === $encoding) {
+ $pos = strrpos($haystack, $needle);
+ } else {
+ $needle = self::mb_substr($needle, 0, 1, $encoding);
+ $pos = \iconv_strrpos($haystack, $needle, $encoding);
+ }
return self::getSubpart($pos, $part, $haystack, $encoding);
}
@@ -468,7 +694,7 @@ final class Mbstring
public static function mb_get_info($type = 'all')
{
- $info = array(
+ $info = [
'internal_encoding' => self::$internalEncoding,
'http_output' => 'pass',
'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)',
@@ -483,7 +709,7 @@ final class Mbstring
'detect_order' => self::$encodingList,
'substitute_character' => 'none',
'strict_detection' => 'Off',
- );
+ ];
if ('all' === $type) {
return $info;
@@ -510,12 +736,12 @@ final class Mbstring
$encoding = self::getEncoding($encoding);
if ('UTF-8' !== $encoding) {
- $s = iconv($encoding, 'UTF-8', $s);
+ $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
}
$s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
- return ($wide << 1) + iconv_strlen($s, 'UTF-8');
+ return ($wide << 1) + \iconv_strlen($s, 'UTF-8');
}
public static function mb_substr_count($haystack, $needle, $encoding = null)
@@ -528,6 +754,49 @@ final class Mbstring
return $contents;
}
+ public static function mb_chr($code, $encoding = null)
+ {
+ if (0x80 > $code %= 0x200000) {
+ $s = \chr($code);
+ } elseif (0x800 > $code) {
+ $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F);
+ } elseif (0x10000 > $code) {
+ $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
+ } else {
+ $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
+ }
+
+ if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
+ $s = mb_convert_encoding($s, $encoding, 'UTF-8');
+ }
+
+ return $s;
+ }
+
+ public static function mb_ord($s, $encoding = null)
+ {
+ if ('UTF-8' !== $encoding = self::getEncoding($encoding)) {
+ $s = mb_convert_encoding($s, 'UTF-8', $encoding);
+ }
+
+ if (1 === \strlen($s)) {
+ return \ord($s);
+ }
+
+ $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
+ if (0xF0 <= $code) {
+ return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
+ }
+ if (0xE0 <= $code) {
+ return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
+ }
+ if (0xC0 <= $code) {
+ return (($code - 0xC0) << 6) + $s[2] - 0x80;
+ }
+
+ return $code;
+ }
+
private static function getSubpart($pos, $part, $haystack, $encoding)
{
if (false === $pos) {
@@ -540,15 +809,15 @@ final class Mbstring
return self::mb_substr($haystack, $pos, null, $encoding);
}
- private static function html_encoding_callback($m)
+ private static function html_encoding_callback(array $m)
{
$i = 1;
$entities = '';
- $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8'));
+ $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8'));
while (isset($m[$i])) {
if (0x80 > $m[$i]) {
- $entities .= chr($m[$i++]);
+ $entities .= \chr($m[$i++]);
continue;
}
if (0xF0 <= $m[$i]) {
@@ -565,14 +834,9 @@ final class Mbstring
return $entities;
}
- private static function title_case_lower($s)
+ private static function title_case(array $s)
{
- return self::mb_convert_case($s[0], MB_CASE_LOWER, 'UTF-8');
- }
-
- private static function title_case_upper($s)
- {
- return self::mb_convert_case($s[0], MB_CASE_UPPER, 'UTF-8');
+ return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8');
}
private static function getData($file)
@@ -590,11 +854,16 @@ final class Mbstring
return self::$internalEncoding;
}
+ if ('UTF-8' === $encoding) {
+ return 'UTF-8';
+ }
+
$encoding = strtoupper($encoding);
if ('8BIT' === $encoding || 'BINARY' === $encoding) {
return 'CP850';
}
+
if ('UTF8' === $encoding) {
return 'UTF-8';
}
diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md
index 342e828..478b40d 100644
--- a/vendor/symfony/polyfill-mbstring/README.md
+++ b/vendor/symfony/polyfill-mbstring/README.md
@@ -2,10 +2,10 @@ Symfony Polyfill / Mbstring
===========================
This component provides a partial, native PHP implementation for the
-[Mbstring](http://php.net/mbstring) extension.
+[Mbstring](https://php.net/mbstring) extension.
More information can be found in the
-[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
+[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
License
=======
diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php
index 3ca1641..fac60b0 100644
--- a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php
+++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php
@@ -1,6 +1,6 @@
<?php
-static $data = array (
+return array (
'A' => 'a',
'B' => 'b',
'C' => 'c',
@@ -81,7 +81,7 @@ static $data = array (
'Ī' => 'ī',
'Ĭ' => 'ĭ',
'Į' => 'į',
- 'İ' => 'i',
+ 'İ' => 'i̇',
'IJ' => 'ij',
'Ĵ' => 'ĵ',
'Ķ' => 'ķ',
@@ -510,6 +510,138 @@ static $data = array (
'Ⴥ' => 'ⴥ',
'Ⴧ' => 'ⴧ',
'Ⴭ' => 'ⴭ',
+ 'Ꭰ' => 'ꭰ',
+ 'Ꭱ' => 'ꭱ',
+ 'Ꭲ' => 'ꭲ',
+ 'Ꭳ' => 'ꭳ',
+ 'Ꭴ' => 'ꭴ',
+ 'Ꭵ' => 'ꭵ',
+ 'Ꭶ' => 'ꭶ',
+ 'Ꭷ' => 'ꭷ',
+ 'Ꭸ' => 'ꭸ',
+ 'Ꭹ' => 'ꭹ',
+ 'Ꭺ' => 'ꭺ',
+ 'Ꭻ' => 'ꭻ',
+ 'Ꭼ' => 'ꭼ',
+ 'Ꭽ' => 'ꭽ',
+ 'Ꭾ' => 'ꭾ',
+ 'Ꭿ' => 'ꭿ',
+ 'Ꮀ' => 'ꮀ',
+ 'Ꮁ' => 'ꮁ',
+ 'Ꮂ' => 'ꮂ',
+ 'Ꮃ' => 'ꮃ',
+ 'Ꮄ' => 'ꮄ',
+ 'Ꮅ' => 'ꮅ',
+ 'Ꮆ' => 'ꮆ',
+ 'Ꮇ' => 'ꮇ',
+ 'Ꮈ' => 'ꮈ',
+ 'Ꮉ' => 'ꮉ',
+ 'Ꮊ' => 'ꮊ',
+ 'Ꮋ' => 'ꮋ',
+ 'Ꮌ' => 'ꮌ',
+ 'Ꮍ' => 'ꮍ',
+ 'Ꮎ' => 'ꮎ',
+ 'Ꮏ' => 'ꮏ',
+ 'Ꮐ' => 'ꮐ',
+ 'Ꮑ' => 'ꮑ',
+ 'Ꮒ' => 'ꮒ',
+ 'Ꮓ' => 'ꮓ',
+ 'Ꮔ' => 'ꮔ',
+ 'Ꮕ' => 'ꮕ',
+ 'Ꮖ' => 'ꮖ',
+ 'Ꮗ' => 'ꮗ',
+ 'Ꮘ' => 'ꮘ',
+ 'Ꮙ' => 'ꮙ',
+ 'Ꮚ' => 'ꮚ',
+ 'Ꮛ' => 'ꮛ',
+ 'Ꮜ' => 'ꮜ',
+ 'Ꮝ' => 'ꮝ',
+ 'Ꮞ' => 'ꮞ',
+ 'Ꮟ' => 'ꮟ',
+ 'Ꮠ' => 'ꮠ',
+ 'Ꮡ' => 'ꮡ',
+ 'Ꮢ' => 'ꮢ',
+ 'Ꮣ' => 'ꮣ',
+ 'Ꮤ' => 'ꮤ',
+ 'Ꮥ' => 'ꮥ',
+ 'Ꮦ' => 'ꮦ',
+ 'Ꮧ' => 'ꮧ',
+ 'Ꮨ' => 'ꮨ',
+ 'Ꮩ' => 'ꮩ',
+ 'Ꮪ' => 'ꮪ',
+ 'Ꮫ' => 'ꮫ',
+ 'Ꮬ' => 'ꮬ',
+ 'Ꮭ' => 'ꮭ',
+ 'Ꮮ' => 'ꮮ',
+ 'Ꮯ' => 'ꮯ',
+ 'Ꮰ' => 'ꮰ',
+ 'Ꮱ' => 'ꮱ',
+ 'Ꮲ' => 'ꮲ',
+ 'Ꮳ' => 'ꮳ',
+ 'Ꮴ' => 'ꮴ',
+ 'Ꮵ' => 'ꮵ',
+ 'Ꮶ' => 'ꮶ',
+ 'Ꮷ' => 'ꮷ',
+ 'Ꮸ' => 'ꮸ',
+ 'Ꮹ' => 'ꮹ',
+ 'Ꮺ' => 'ꮺ',
+ 'Ꮻ' => 'ꮻ',
+ 'Ꮼ' => 'ꮼ',
+ 'Ꮽ' => 'ꮽ',
+ 'Ꮾ' => 'ꮾ',
+ 'Ꮿ' => 'ꮿ',
+ 'Ᏸ' => 'ᏸ',
+ 'Ᏹ' => 'ᏹ',
+ 'Ᏺ' => 'ᏺ',
+ 'Ᏻ' => 'ᏻ',
+ 'Ᏼ' => 'ᏼ',
+ 'Ᏽ' => 'ᏽ',
+ 'Ა' => 'ა',
+ 'Ბ' => 'ბ',
+ 'Გ' => 'გ',
+ 'Დ' => 'დ',
+ 'Ე' => 'ე',
+ 'Ვ' => 'ვ',
+ 'Ზ' => 'ზ',
+ 'Თ' => 'თ',
+ 'Ი' => 'ი',
+ 'Კ' => 'კ',
+ 'Ლ' => 'ლ',
+ 'Მ' => 'მ',
+ 'Ნ' => 'ნ',
+ 'Ო' => 'ო',
+ 'Პ' => 'პ',
+ 'Ჟ' => 'ჟ',
+ 'Რ' => 'რ',
+ 'Ს' => 'ს',
+ 'Ტ' => 'ტ',
+ 'Უ' => 'უ',
+ 'Ფ' => 'ფ',
+ 'Ქ' => 'ქ',
+ 'Ღ' => 'ღ',
+ 'Ყ' => 'ყ',
+ 'Შ' => 'შ',
+ 'Ჩ' => 'ჩ',
+ 'Ც' => 'ც',
+ 'Ძ' => 'ძ',
+ 'Წ' => 'წ',
+ 'Ჭ' => 'ჭ',
+ 'Ხ' => 'ხ',
+ 'Ჯ' => 'ჯ',
+ 'Ჰ' => 'ჰ',
+ 'Ჱ' => 'ჱ',
+ 'Ჲ' => 'ჲ',
+ 'Ჳ' => 'ჳ',
+ 'Ჴ' => 'ჴ',
+ 'Ჵ' => 'ჵ',
+ 'Ჶ' => 'ჶ',
+ 'Ჷ' => 'ჷ',
+ 'Ჸ' => 'ჸ',
+ 'Ჹ' => 'ჹ',
+ 'Ჺ' => 'ჺ',
+ 'Ჽ' => 'ჽ',
+ 'Ჾ' => 'ჾ',
+ 'Ჿ' => 'ჿ',
'Ḁ' => 'ḁ',
'Ḃ' => 'ḃ',
'Ḅ' => 'ḅ',
@@ -993,8 +1125,24 @@ static $data = array (
'Ɜ' => 'ɜ',
'Ɡ' => 'ɡ',
'Ɬ' => 'ɬ',
+ 'Ɪ' => 'ɪ',
'Ʞ' => 'ʞ',
'Ʇ' => 'ʇ',
+ 'Ʝ' => 'ʝ',
+ 'Ꭓ' => 'ꭓ',
+ 'Ꞵ' => 'ꞵ',
+ 'Ꞷ' => 'ꞷ',
+ 'Ꞹ' => 'ꞹ',
+ 'Ꞻ' => 'ꞻ',
+ 'Ꞽ' => 'ꞽ',
+ 'Ꞿ' => 'ꞿ',
+ 'Ꟃ' => 'ꟃ',
+ 'Ꞔ' => 'ꞔ',
+ 'Ʂ' => 'ʂ',
+ 'Ᶎ' => 'ᶎ',
+ 'Ꟈ' => 'ꟈ',
+ 'Ꟊ' => 'ꟊ',
+ 'Ꟶ' => 'ꟶ',
'A' => 'a',
'B' => 'b',
'C' => 'c',
@@ -1061,6 +1209,93 @@ static $data = array (
'𐐥' => '𐑍',
'𐐦' => '𐑎',
'𐐧' => '𐑏',
+ '𐒰' => '𐓘',
+ '𐒱' => '𐓙',
+ '𐒲' => '𐓚',
+ '𐒳' => '𐓛',
+ '𐒴' => '𐓜',
+ '𐒵' => '𐓝',
+ '𐒶' => '𐓞',
+ '𐒷' => '𐓟',
+ '𐒸' => '𐓠',
+ '𐒹' => '𐓡',
+ '𐒺' => '𐓢',
+ '𐒻' => '𐓣',
+ '𐒼' => '𐓤',
+ '𐒽' => '𐓥',
+ '𐒾' => '𐓦',
+ '𐒿' => '𐓧',
+ '𐓀' => '𐓨',
+ '𐓁' => '𐓩',
+ '𐓂' => '𐓪',
+ '𐓃' => '𐓫',
+ '𐓄' => '𐓬',
+ '𐓅' => '𐓭',
+ '𐓆' => '𐓮',
+ '𐓇' => '𐓯',
+ '𐓈' => '𐓰',
+ '𐓉' => '𐓱',
+ '𐓊' => '𐓲',
+ '𐓋' => '𐓳',
+ '𐓌' => '𐓴',
+ '𐓍' => '𐓵',
+ '𐓎' => '𐓶',
+ '𐓏' => '𐓷',
+ '𐓐' => '𐓸',
+ '𐓑' => '𐓹',
+ '𐓒' => '𐓺',
+ '𐓓' => '𐓻',
+ '𐲀' => '𐳀',
+ '𐲁' => '𐳁',
+ '𐲂' => '𐳂',
+ '𐲃' => '𐳃',
+ '𐲄' => '𐳄',
+ '𐲅' => '𐳅',
+ '𐲆' => '𐳆',
+ '𐲇' => '𐳇',
+ '𐲈' => '𐳈',
+ '𐲉' => '𐳉',
+ '𐲊' => '𐳊',
+ '𐲋' => '𐳋',
+ '𐲌' => '𐳌',
+ '𐲍' => '𐳍',
+ '𐲎' => '𐳎',
+ '𐲏' => '𐳏',
+ '𐲐' => '𐳐',
+ '𐲑' => '𐳑',
+ '𐲒' => '𐳒',
+ '𐲓' => '𐳓',
+ '𐲔' => '𐳔',
+ '𐲕' => '𐳕',
+ '𐲖' => '𐳖',
+ '𐲗' => '𐳗',
+ '𐲘' => '𐳘',
+ '𐲙' => '𐳙',
+ '𐲚' => '𐳚',
+ '𐲛' => '𐳛',
+ '𐲜' => '𐳜',
+ '𐲝' => '𐳝',
+ '𐲞' => '𐳞',
+ '𐲟' => '𐳟',
+ '𐲠' => '𐳠',
+ '𐲡' => '𐳡',
+ '𐲢' => '𐳢',
+ '𐲣' => '𐳣',
+ '𐲤' => '𐳤',
+ '𐲥' => '𐳥',
+ '𐲦' => '𐳦',
+ '𐲧' => '𐳧',
+ '𐲨' => '𐳨',
+ '𐲩' => '𐳩',
+ '𐲪' => '𐳪',
+ '𐲫' => '𐳫',
+ '𐲬' => '𐳬',
+ '𐲭' => '𐳭',
+ '𐲮' => '𐳮',
+ '𐲯' => '𐳯',
+ '𐲰' => '𐳰',
+ '𐲱' => '𐳱',
+ '𐲲' => '𐳲',
'𑢠' => '𑣀',
'𑢡' => '𑣁',
'𑢢' => '𑣂',
@@ -1093,9 +1328,70 @@ static $data = array (
'𑢽' => '𑣝',
'𑢾' => '𑣞',
'𑢿' => '𑣟',
+ '𖹀' => '𖹠',
+ '𖹁' => '𖹡',
+ '𖹂' => '𖹢',
+ '𖹃' => '𖹣',
+ '𖹄' => '𖹤',
+ '𖹅' => '𖹥',
+ '𖹆' => '𖹦',
+ '𖹇' => '𖹧',
+ '𖹈' => '𖹨',
+ '𖹉' => '𖹩',
+ '𖹊' => '𖹪',
+ '𖹋' => '𖹫',
+ '𖹌' => '𖹬',
+ '𖹍' => '𖹭',
+ '𖹎' => '𖹮',
+ '𖹏' => '𖹯',
+ '𖹐' => '𖹰',
+ '𖹑' => '𖹱',
+ '𖹒' => '𖹲',
+ '𖹓' => '𖹳',
+ '𖹔' => '𖹴',
+ '𖹕' => '𖹵',
+ '𖹖' => '𖹶',
+ '𖹗' => '𖹷',
+ '𖹘' => '𖹸',
+ '𖹙' => '𖹹',
+ '𖹚' => '𖹺',
+ '𖹛' => '𖹻',
+ '𖹜' => '𖹼',
+ '𖹝' => '𖹽',
+ '𖹞' => '𖹾',
+ '𖹟' => '𖹿',
+ '𞤀' => '𞤢',
+ '𞤁' => '𞤣',
+ '𞤂' => '𞤤',
+ '𞤃' => '𞤥',
+ '𞤄' => '𞤦',
+ '𞤅' => '𞤧',
+ '𞤆' => '𞤨',
+ '𞤇' => '𞤩',
+ '𞤈' => '𞤪',
+ '𞤉' => '𞤫',
+ '𞤊' => '𞤬',
+ '𞤋' => '𞤭',
+ '𞤌' => '𞤮',
+ '𞤍' => '𞤯',
+ '𞤎' => '𞤰',
+ '𞤏' => '𞤱',
+ '𞤐' => '𞤲',
+ '𞤑' => '𞤳',
+ '𞤒' => '𞤴',
+ '𞤓' => '𞤵',
+ '𞤔' => '𞤶',
+ '𞤕' => '𞤷',
+ '𞤖' => '𞤸',
+ '𞤗' => '𞤹',
+ '𞤘' => '𞤺',
+ '𞤙' => '𞤻',
+ '𞤚' => '𞤼',
+ '𞤛' => '𞤽',
+ '𞤜' => '𞤾',
+ '𞤝' => '𞤿',
+ '𞤞' => '𞥀',
+ '𞤟' => '𞥁',
+ '𞤠' => '𞥂',
+ '𞤡' => '𞥃',
);
-
-$result =& $data;
-unset($data);
-
-return $result;
diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php
new file mode 100644
index 0000000..2a8f6e7
--- /dev/null
+++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php
@@ -0,0 +1,5 @@
+<?php
+
+// from Case_Ignorable in https://unicode.org/Public/UNIDATA/DerivedCoreProperties.txt
+
+return '/(?<![\x{0027}\x{002E}\x{003A}\x{005E}\x{0060}\x{00A8}\x{00AD}\x{00AF}\x{00B4}\x{00B7}\x{00B8}\x{02B0}-\x{02C1}\x{02C2}-\x{02C5}\x{02C6}-\x{02D1}\x{02D2}-\x{02DF}\x{02E0}-\x{02E4}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EE}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037A}\x{0384}-\x{0385}\x{0387}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0559}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{05F4}\x{0600}-\x{0605}\x{0610}-\x{061A}\x{061C}\x{0640}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DD}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07FA}\x{07FD}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0971}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E46}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EB9}\x{0EBB}-\x{0EBC}\x{0EC6}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{10FC}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17D7}\x{17DD}\x{180B}-\x{180D}\x{180E}\x{1843}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AA7}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1C78}-\x{1C7D}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1D2C}-\x{1D6A}\x{1D78}\x{1D9B}-\x{1DBF}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{200B}-\x{200F}\x{2018}\x{2019}\x{2024}\x{2027}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{2066}-\x{206F}\x{2071}\x{207F}\x{2090}-\x{209C}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2C7C}-\x{2C7D}\x{2CEF}-\x{2CF1}\x{2D6F}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E2F}\x{3005}\x{302A}-\x{302D}\x{3031}-\x{3035}\x{303B}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{309D}-\x{309E}\x{30FC}-\x{30FE}\x{A015}\x{A4F8}-\x{A4FD}\x{A60C}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A67F}\x{A69C}-\x{A69D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A770}\x{A788}\x{A789}-\x{A78A}\x{A7F8}-\x{A7F9}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}\x{A9CF}\x{A9E5}\x{A9E6}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA70}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AADD}\x{AAEC}-\x{AAED}\x{AAF3}-\x{AAF4}\x{AAF6}\x{AB5B}\x{AB5C}-\x{AB5F}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FBB2}-\x{FBC1}\x{FE00}-\x{FE0F}\x{FE13}\x{FE20}-\x{FE2F}\x{FE52}\x{FE55}\x{FEFF}\x{FF07}\x{FF0E}\x{FF1A}\x{FF3E}\x{FF40}\x{FF70}\x{FF9E}-\x{FF9F}\x{FFE3}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110BD}\x{110CD}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16B40}-\x{16B43}\x{16F8F}-\x{16F92}\x{16F93}-\x{16F9F}\x{16FE0}-\x{16FE1}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1F3FB}-\x{1F3FF}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}])(\pL)(\pL*+)/u';
diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php
index ec94221..56b9cb8 100644
--- a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php
+++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php
@@ -1,6 +1,6 @@
<?php
-static $data = array (
+return array (
'a' => 'A',
'b' => 'B',
'c' => 'C',
@@ -225,6 +225,7 @@ static $data = array (
'ɦ' => 'Ɦ',
'ɨ' => 'Ɨ',
'ɩ' => 'Ɩ',
+ 'ɪ' => 'Ɪ',
'ɫ' => 'Ɫ',
'ɬ' => 'Ɬ',
'ɯ' => 'Ɯ',
@@ -233,6 +234,7 @@ static $data = array (
'ɵ' => 'Ɵ',
'ɽ' => 'Ɽ',
'ʀ' => 'Ʀ',
+ 'ʂ' => 'Ʂ',
'ʃ' => 'Ʃ',
'ʇ' => 'Ʇ',
'ʈ' => 'Ʈ',
@@ -241,6 +243,7 @@ static $data = array (
'ʋ' => 'Ʋ',
'ʌ' => 'Ʌ',
'ʒ' => 'Ʒ',
+ 'ʝ' => 'Ʝ',
'ʞ' => 'Ʞ',
'ͅ' => 'Ι',
'ͱ' => 'Ͱ',
@@ -493,8 +496,70 @@ static $data = array (
'ք' => 'Ք',
'օ' => 'Օ',
'ֆ' => 'Ֆ',
+ 'ა' => 'Ა',
+ 'ბ' => 'Ბ',
+ 'გ' => 'Გ',
+ 'დ' => 'Დ',
+ 'ე' => 'Ე',
+ 'ვ' => 'Ვ',
+ 'ზ' => 'Ზ',
+ 'თ' => 'Თ',
+ 'ი' => 'Ი',
+ 'კ' => 'Კ',
+ 'ლ' => 'Ლ',
+ 'მ' => 'Მ',
+ 'ნ' => 'Ნ',
+ 'ო' => 'Ო',
+ 'პ' => 'Პ',
+ 'ჟ' => 'Ჟ',
+ 'რ' => 'Რ',
+ 'ს' => 'Ს',
+ 'ტ' => 'Ტ',
+ 'უ' => 'Უ',
+ 'ფ' => 'Ფ',
+ 'ქ' => 'Ქ',
+ 'ღ' => 'Ღ',
+ 'ყ' => 'Ყ',
+ 'შ' => 'Შ',
+ 'ჩ' => 'Ჩ',
+ 'ც' => 'Ც',
+ 'ძ' => 'Ძ',
+ 'წ' => 'Წ',
+ 'ჭ' => 'Ჭ',
+ 'ხ' => 'Ხ',
+ 'ჯ' => 'Ჯ',
+ 'ჰ' => 'Ჰ',
+ 'ჱ' => 'Ჱ',
+ 'ჲ' => 'Ჲ',
+ 'ჳ' => 'Ჳ',
+ 'ჴ' => 'Ჴ',
+ 'ჵ' => 'Ჵ',
+ 'ჶ' => 'Ჶ',
+ 'ჷ' => 'Ჷ',
+ 'ჸ' => 'Ჸ',
+ 'ჹ' => 'Ჹ',
+ 'ჺ' => 'Ჺ',
+ 'ჽ' => 'Ჽ',
+ 'ჾ' => 'Ჾ',
+ 'ჿ' => 'Ჿ',
+ 'ᏸ' => 'Ᏸ',
+ 'ᏹ' => 'Ᏹ',
+ 'ᏺ' => 'Ᏺ',
+ 'ᏻ' => 'Ᏻ',
+ 'ᏼ' => 'Ᏼ',
+ 'ᏽ' => 'Ᏽ',
+ 'ᲀ' => 'В',
+ 'ᲁ' => 'Д',
+ 'ᲂ' => 'О',
+ 'ᲃ' => 'С',
+ 'ᲄ' => 'Т',
+ 'ᲅ' => 'Т',
+ 'ᲆ' => 'Ъ',
+ 'ᲇ' => 'Ѣ',
+ 'ᲈ' => 'Ꙋ',
'ᵹ' => 'Ᵹ',
'ᵽ' => 'Ᵽ',
+ 'ᶎ' => 'Ᶎ',
'ḁ' => 'Ḁ',
'ḃ' => 'Ḃ',
'ḅ' => 'Ḅ',
@@ -681,41 +746,41 @@ static $data = array (
'ύ' => 'Ύ',
'ὼ' => 'Ὼ',
'ώ' => 'Ώ',
- 'ᾀ' => 'ᾈ',
- 'ᾁ' => 'ᾉ',
- 'ᾂ' => 'ᾊ',
- 'ᾃ' => 'ᾋ',
- 'ᾄ' => 'ᾌ',
- 'ᾅ' => 'ᾍ',
- 'ᾆ' => 'ᾎ',
- 'ᾇ' => 'ᾏ',
- 'ᾐ' => 'ᾘ',
- 'ᾑ' => 'ᾙ',
- 'ᾒ' => 'ᾚ',
- 'ᾓ' => 'ᾛ',
- 'ᾔ' => 'ᾜ',
- 'ᾕ' => 'ᾝ',
- 'ᾖ' => 'ᾞ',
- 'ᾗ' => 'ᾟ',
- 'ᾠ' => 'ᾨ',
- 'ᾡ' => 'ᾩ',
- 'ᾢ' => 'ᾪ',
- 'ᾣ' => 'ᾫ',
- 'ᾤ' => 'ᾬ',
- 'ᾥ' => 'ᾭ',
- 'ᾦ' => 'ᾮ',
- 'ᾧ' => 'ᾯ',
+ 'ᾀ' => 'ἈΙ',
+ 'ᾁ' => 'ἉΙ',
+ 'ᾂ' => 'ἊΙ',
+ 'ᾃ' => 'ἋΙ',
+ 'ᾄ' => 'ἌΙ',
+ 'ᾅ' => 'ἍΙ',
+ 'ᾆ' => 'ἎΙ',
+ 'ᾇ' => 'ἏΙ',
+ 'ᾐ' => 'ἨΙ',
+ 'ᾑ' => 'ἩΙ',
+ 'ᾒ' => 'ἪΙ',
+ 'ᾓ' => 'ἫΙ',
+ 'ᾔ' => 'ἬΙ',
+ 'ᾕ' => 'ἭΙ',
+ 'ᾖ' => 'ἮΙ',
+ 'ᾗ' => 'ἯΙ',
+ 'ᾠ' => 'ὨΙ',
+ 'ᾡ' => 'ὩΙ',
+ 'ᾢ' => 'ὪΙ',
+ 'ᾣ' => 'ὫΙ',
+ 'ᾤ' => 'ὬΙ',
+ 'ᾥ' => 'ὭΙ',
+ 'ᾦ' => 'ὮΙ',
+ 'ᾧ' => 'ὯΙ',
'ᾰ' => 'Ᾰ',
'ᾱ' => 'Ᾱ',
- 'ᾳ' => 'ᾼ',
+ 'ᾳ' => 'ΑΙ',
'ι' => 'Ι',
- 'ῃ' => 'ῌ',
+ 'ῃ' => 'ΗΙ',
'ῐ' => 'Ῐ',
'ῑ' => 'Ῑ',
'ῠ' => 'Ῠ',
'ῡ' => 'Ῡ',
'ῥ' => 'Ῥ',
- 'ῳ' => 'ῼ',
+ 'ῳ' => 'ΩΙ',
'ⅎ' => 'Ⅎ',
'ⅰ' => 'Ⅰ',
'ⅱ' => 'Ⅱ',
@@ -993,6 +1058,7 @@ static $data = array (
'ꞌ' => 'Ꞌ',
'ꞑ' => 'Ꞑ',
'ꞓ' => 'Ꞓ',
+ 'ꞔ' => 'Ꞔ',
'ꞗ' => 'Ꞗ',
'ꞙ' => 'Ꞙ',
'ꞛ' => 'Ꞛ',
@@ -1003,6 +1069,97 @@ static $data = array (
'ꞥ' => 'Ꞥ',
'ꞧ' => 'Ꞧ',
'ꞩ' => 'Ꞩ',
+ 'ꞵ' => 'Ꞵ',
+ 'ꞷ' => 'Ꞷ',
+ 'ꞹ' => 'Ꞹ',
+ 'ꞻ' => 'Ꞻ',
+ 'ꞽ' => 'Ꞽ',
+ 'ꞿ' => 'Ꞿ',
+ 'ꟃ' => 'Ꟃ',
+ 'ꟈ' => 'Ꟈ',
+ 'ꟊ' => 'Ꟊ',
+ 'ꟶ' => 'Ꟶ',
+ 'ꭓ' => 'Ꭓ',
+ 'ꭰ' => 'Ꭰ',
+ 'ꭱ' => 'Ꭱ',
+ 'ꭲ' => 'Ꭲ',
+ 'ꭳ' => 'Ꭳ',
+ 'ꭴ' => 'Ꭴ',
+ 'ꭵ' => 'Ꭵ',
+ 'ꭶ' => 'Ꭶ',
+ 'ꭷ' => 'Ꭷ',
+ 'ꭸ' => 'Ꭸ',
+ 'ꭹ' => 'Ꭹ',
+ 'ꭺ' => 'Ꭺ',
+ 'ꭻ' => 'Ꭻ',
+ 'ꭼ' => 'Ꭼ',
+ 'ꭽ' => 'Ꭽ',
+ 'ꭾ' => 'Ꭾ',
+ 'ꭿ' => 'Ꭿ',
+ 'ꮀ' => 'Ꮀ',
+ 'ꮁ' => 'Ꮁ',
+ 'ꮂ' => 'Ꮂ',
+ 'ꮃ' => 'Ꮃ',
+ 'ꮄ' => 'Ꮄ',
+ 'ꮅ' => 'Ꮅ',
+ 'ꮆ' => 'Ꮆ',
+ 'ꮇ' => 'Ꮇ',
+ 'ꮈ' => 'Ꮈ',
+ 'ꮉ' => 'Ꮉ',
+ 'ꮊ' => 'Ꮊ',
+ 'ꮋ' => 'Ꮋ',
+ 'ꮌ' => 'Ꮌ',
+ 'ꮍ' => 'Ꮍ',
+ 'ꮎ' => 'Ꮎ',
+ 'ꮏ' => 'Ꮏ',
+ 'ꮐ' => 'Ꮐ',
+ 'ꮑ' => 'Ꮑ',
+ 'ꮒ' => 'Ꮒ',
+ 'ꮓ' => 'Ꮓ',
+ 'ꮔ' => 'Ꮔ',
+ 'ꮕ' => 'Ꮕ',
+ 'ꮖ' => 'Ꮖ',
+ 'ꮗ' => 'Ꮗ',
+ 'ꮘ' => 'Ꮘ',
+ 'ꮙ' => 'Ꮙ',
+ 'ꮚ' => 'Ꮚ',
+ 'ꮛ' => 'Ꮛ',
+ 'ꮜ' => 'Ꮜ',
+ 'ꮝ' => 'Ꮝ',
+ 'ꮞ' => 'Ꮞ',
+ 'ꮟ' => 'Ꮟ',
+ 'ꮠ' => 'Ꮠ',
+ 'ꮡ' => 'Ꮡ',
+ 'ꮢ' => 'Ꮢ',
+ 'ꮣ' => 'Ꮣ',
+ 'ꮤ' => 'Ꮤ',
+ 'ꮥ' => 'Ꮥ',
+ 'ꮦ' => 'Ꮦ',
+ 'ꮧ' => 'Ꮧ',
+ 'ꮨ' => 'Ꮨ',
+ 'ꮩ' => 'Ꮩ',
+ 'ꮪ' => 'Ꮪ',
+ 'ꮫ' => 'Ꮫ',
+ 'ꮬ' => 'Ꮬ',
+ 'ꮭ' => 'Ꮭ',
+ 'ꮮ' => 'Ꮮ',
+ 'ꮯ' => 'Ꮯ',
+ 'ꮰ' => 'Ꮰ',
+ 'ꮱ' => 'Ꮱ',
+ 'ꮲ' => 'Ꮲ',
+ 'ꮳ' => 'Ꮳ',
+ 'ꮴ' => 'Ꮴ',
+ 'ꮵ' => 'Ꮵ',
+ 'ꮶ' => 'Ꮶ',
+ 'ꮷ' => 'Ꮷ',
+ 'ꮸ' => 'Ꮸ',
+ 'ꮹ' => 'Ꮹ',
+ 'ꮺ' => 'Ꮺ',
+ 'ꮻ' => 'Ꮻ',
+ 'ꮼ' => 'Ꮼ',
+ 'ꮽ' => 'Ꮽ',
+ 'ꮾ' => 'Ꮾ',
+ 'ꮿ' => 'Ꮿ',
'a' => 'A',
'b' => 'B',
'c' => 'C',
@@ -1069,6 +1226,93 @@ static $data = array (
'𐑍' => '𐐥',
'𐑎' => '𐐦',
'𐑏' => '𐐧',
+ '𐓘' => '𐒰',
+ '𐓙' => '𐒱',
+ '𐓚' => '𐒲',
+ '𐓛' => '𐒳',
+ '𐓜' => '𐒴',
+ '𐓝' => '𐒵',
+ '𐓞' => '𐒶',
+ '𐓟' => '𐒷',
+ '𐓠' => '𐒸',
+ '𐓡' => '𐒹',
+ '𐓢' => '𐒺',
+ '𐓣' => '𐒻',
+ '𐓤' => '𐒼',
+ '𐓥' => '𐒽',
+ '𐓦' => '𐒾',
+ '𐓧' => '𐒿',
+ '𐓨' => '𐓀',
+ '𐓩' => '𐓁',
+ '𐓪' => '𐓂',
+ '𐓫' => '𐓃',
+ '𐓬' => '𐓄',
+ '𐓭' => '𐓅',
+ '𐓮' => '𐓆',
+ '𐓯' => '𐓇',
+ '𐓰' => '𐓈',
+ '𐓱' => '𐓉',
+ '𐓲' => '𐓊',
+ '𐓳' => '𐓋',
+ '𐓴' => '𐓌',
+ '𐓵' => '𐓍',
+ '𐓶' => '𐓎',
+ '𐓷' => '𐓏',
+ '𐓸' => '𐓐',
+ '𐓹' => '𐓑',
+ '𐓺' => '𐓒',
+ '𐓻' => '𐓓',
+ '𐳀' => '𐲀',
+ '𐳁' => '𐲁',
+ '𐳂' => '𐲂',
+ '𐳃' => '𐲃',
+ '𐳄' => '𐲄',
+ '𐳅' => '𐲅',
+ '𐳆' => '𐲆',
+ '𐳇' => '𐲇',
+ '𐳈' => '𐲈',
+ '𐳉' => '𐲉',
+ '𐳊' => '𐲊',
+ '𐳋' => '𐲋',
+ '𐳌' => '𐲌',
+ '𐳍' => '𐲍',
+ '𐳎' => '𐲎',
+ '𐳏' => '𐲏',
+ '𐳐' => '𐲐',
+ '𐳑' => '𐲑',
+ '𐳒' => '𐲒',
+ '𐳓' => '𐲓',
+ '𐳔' => '𐲔',
+ '𐳕' => '𐲕',
+ '𐳖' => '𐲖',
+ '𐳗' => '𐲗',
+ '𐳘' => '𐲘',
+ '𐳙' => '𐲙',
+ '𐳚' => '𐲚',
+ '𐳛' => '𐲛',
+ '𐳜' => '𐲜',
+ '𐳝' => '𐲝',
+ '𐳞' => '𐲞',
+ '𐳟' => '𐲟',
+ '𐳠' => '𐲠',
+ '𐳡' => '𐲡',
+ '𐳢' => '𐲢',
+ '𐳣' => '𐲣',
+ '𐳤' => '𐲤',
+ '𐳥' => '𐲥',
+ '𐳦' => '𐲦',
+ '𐳧' => '𐲧',
+ '𐳨' => '𐲨',
+ '𐳩' => '𐲩',
+ '𐳪' => '𐲪',
+ '𐳫' => '𐲫',
+ '𐳬' => '𐲬',
+ '𐳭' => '𐲭',
+ '𐳮' => '𐲮',
+ '𐳯' => '𐲯',
+ '𐳰' => '𐲰',
+ '𐳱' => '𐲱',
+ '𐳲' => '𐲲',
'𑣀' => '𑢠',
'𑣁' => '𑢡',
'𑣂' => '𑢢',
@@ -1101,9 +1345,145 @@ static $data = array (
'𑣝' => '𑢽',
'𑣞' => '𑢾',
'𑣟' => '𑢿',
+ '𖹠' => '𖹀',
+ '𖹡' => '𖹁',
+ '𖹢' => '𖹂',
+ '𖹣' => '𖹃',
+ '𖹤' => '𖹄',
+ '𖹥' => '𖹅',
+ '𖹦' => '𖹆',
+ '𖹧' => '𖹇',
+ '𖹨' => '𖹈',
+ '𖹩' => '𖹉',
+ '𖹪' => '𖹊',
+ '𖹫' => '𖹋',
+ '𖹬' => '𖹌',
+ '𖹭' => '𖹍',
+ '𖹮' => '𖹎',
+ '𖹯' => '𖹏',
+ '𖹰' => '𖹐',
+ '𖹱' => '𖹑',
+ '𖹲' => '𖹒',
+ '𖹳' => '𖹓',
+ '𖹴' => '𖹔',
+ '𖹵' => '𖹕',
+ '𖹶' => '𖹖',
+ '𖹷' => '𖹗',
+ '𖹸' => '𖹘',
+ '𖹹' => '𖹙',
+ '𖹺' => '𖹚',
+ '𖹻' => '𖹛',
+ '𖹼' => '𖹜',
+ '𖹽' => '𖹝',
+ '𖹾' => '𖹞',
+ '𖹿' => '𖹟',
+ '𞤢' => '𞤀',
+ '𞤣' => '𞤁',
+ '𞤤' => '𞤂',
+ '𞤥' => '𞤃',
+ '𞤦' => '𞤄',
+ '𞤧' => '𞤅',
+ '𞤨' => '𞤆',
+ '𞤩' => '𞤇',
+ '𞤪' => '𞤈',
+ '𞤫' => '𞤉',
+ '𞤬' => '𞤊',
+ '𞤭' => '𞤋',
+ '𞤮' => '𞤌',
+ '𞤯' => '𞤍',
+ '𞤰' => '𞤎',
+ '𞤱' => '𞤏',
+ '𞤲' => '𞤐',
+ '𞤳' => '𞤑',
+ '𞤴' => '𞤒',
+ '𞤵' => '𞤓',
+ '𞤶' => '𞤔',
+ '𞤷' => '𞤕',
+ '𞤸' => '𞤖',
+ '𞤹' => '𞤗',
+ '𞤺' => '𞤘',
+ '𞤻' => '𞤙',
+ '𞤼' => '𞤚',
+ '𞤽' => '𞤛',
+ '𞤾' => '𞤜',
+ '𞤿' => '𞤝',
+ '𞥀' => '𞤞',
+ '𞥁' => '𞤟',
+ '𞥂' => '𞤠',
+ '𞥃' => '𞤡',
+ 'ß' => 'SS',
+ 'ff' => 'FF',
+ 'fi' => 'FI',
+ 'fl' => 'FL',
+ 'ffi' => 'FFI',
+ 'ffl' => 'FFL',
+ 'ſt' => 'ST',
+ 'st' => 'ST',
+ 'և' => 'ԵՒ',
+ 'ﬓ' => 'ՄՆ',
+ 'ﬔ' => 'ՄԵ',
+ 'ﬕ' => 'ՄԻ',
+ 'ﬖ' => 'ՎՆ',
+ 'ﬗ' => 'ՄԽ',
+ 'ʼn' => 'ʼN',
+ 'ΐ' => 'Ϊ́',
+ 'ΰ' => 'Ϋ́',
+ 'ǰ' => 'J̌',
+ 'ẖ' => 'H̱',
+ 'ẗ' => 'T̈',
+ 'ẘ' => 'W̊',
+ 'ẙ' => 'Y̊',
+ 'ẚ' => 'Aʾ',
+ 'ὐ' => 'Υ̓',
+ 'ὒ' => 'Υ̓̀',
+ 'ὔ' => 'Υ̓́',
+ 'ὖ' => 'Υ̓͂',
+ 'ᾶ' => 'Α͂',
+ 'ῆ' => 'Η͂',
+ 'ῒ' => 'Ϊ̀',
+ 'ΐ' => 'Ϊ́',
+ 'ῖ' => 'Ι͂',
+ 'ῗ' => 'Ϊ͂',
+ 'ῢ' => 'Ϋ̀',
+ 'ΰ' => 'Ϋ́',
+ 'ῤ' => 'Ρ̓',
+ 'ῦ' => 'Υ͂',
+ 'ῧ' => 'Ϋ͂',
+ 'ῶ' => 'Ω͂',
+ 'ᾈ' => 'ἈΙ',
+ 'ᾉ' => 'ἉΙ',
+ 'ᾊ' => 'ἊΙ',
+ 'ᾋ' => 'ἋΙ',
+ 'ᾌ' => 'ἌΙ',
+ 'ᾍ' => 'ἍΙ',
+ 'ᾎ' => 'ἎΙ',
+ 'ᾏ' => 'ἏΙ',
+ 'ᾘ' => 'ἨΙ',
+ 'ᾙ' => 'ἩΙ',
+ 'ᾚ' => 'ἪΙ',
+ 'ᾛ' => 'ἫΙ',
+ 'ᾜ' => 'ἬΙ',
+ 'ᾝ' => 'ἭΙ',
+ 'ᾞ' => 'ἮΙ',
+ 'ᾟ' => 'ἯΙ',
+ 'ᾨ' => 'ὨΙ',
+ 'ᾩ' => 'ὩΙ',
+ 'ᾪ' => 'ὪΙ',
+ 'ᾫ' => 'ὫΙ',
+ 'ᾬ' => 'ὬΙ',
+ 'ᾭ' => 'ὭΙ',
+ 'ᾮ' => 'ὮΙ',
+ 'ᾯ' => 'ὯΙ',
+ 'ᾼ' => 'ΑΙ',
+ 'ῌ' => 'ΗΙ',
+ 'ῼ' => 'ΩΙ',
+ 'ᾲ' => 'ᾺΙ',
+ 'ᾴ' => 'ΆΙ',
+ 'ῂ' => 'ῊΙ',
+ 'ῄ' => 'ΉΙ',
+ 'ῲ' => 'ῺΙ',
+ 'ῴ' => 'ΏΙ',
+ 'ᾷ' => 'Α͂Ι',
+ 'ῇ' => 'Η͂Ι',
+ 'ῷ' => 'Ω͂Ι',
);
-
-$result =& $data;
-unset($data);
-
-return $result;
diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php
index 4b01b61..1fedd1f 100644
--- a/vendor/symfony/polyfill-mbstring/bootstrap.php
+++ b/vendor/symfony/polyfill-mbstring/bootstrap.php
@@ -11,41 +11,137 @@
use Symfony\Polyfill\Mbstring as p;
-if (!function_exists('mb_strlen')) {
- define('MB_CASE_UPPER', 0);
- define('MB_CASE_LOWER', 1);
- define('MB_CASE_TITLE', 2);
+if (\PHP_VERSION_ID >= 80000) {
+ return require __DIR__.'/bootstrap80.php';
+}
- function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); }
- function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); }
- function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); }
- function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); }
- function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); }
- function mb_language($lang = null) { return p\Mbstring::mb_language($lang); }
+if (!function_exists('mb_convert_encoding')) {
+ function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
+}
+if (!function_exists('mb_decode_mimeheader')) {
+ function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
+}
+if (!function_exists('mb_encode_mimeheader')) {
+ function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
+}
+if (!function_exists('mb_decode_numericentity')) {
+ function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
+}
+if (!function_exists('mb_encode_numericentity')) {
+ function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
+}
+if (!function_exists('mb_convert_case')) {
+ function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
+}
+if (!function_exists('mb_internal_encoding')) {
+ function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
+}
+if (!function_exists('mb_language')) {
+ function mb_language($language = null) { return p\Mbstring::mb_language($language); }
+}
+if (!function_exists('mb_list_encodings')) {
function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
+}
+if (!function_exists('mb_encoding_aliases')) {
function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
- function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); }
- function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); }
- function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); }
- function mb_parse_str($s, &$result = array()) { parse_str($s, $result); }
- function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); }
- function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); }
- function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); }
- function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); }
- function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); }
- function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); }
- function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); }
- function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); }
- function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); }
- function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); }
- function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); }
- function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); }
- function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); }
+}
+if (!function_exists('mb_check_encoding')) {
+ function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
+}
+if (!function_exists('mb_detect_encoding')) {
+ function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
+}
+if (!function_exists('mb_detect_order')) {
+ function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
+}
+if (!function_exists('mb_parse_str')) {
+ function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
+}
+if (!function_exists('mb_strlen')) {
+ function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
+}
+if (!function_exists('mb_strpos')) {
+ function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
+}
+if (!function_exists('mb_strtolower')) {
+ function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
+}
+if (!function_exists('mb_strtoupper')) {
+ function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
+}
+if (!function_exists('mb_substitute_character')) {
+ function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
+}
+if (!function_exists('mb_substr')) {
+ function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
+}
+if (!function_exists('mb_stripos')) {
+ function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
+}
+if (!function_exists('mb_stristr')) {
+ function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
+}
+if (!function_exists('mb_strrchr')) {
+ function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
+}
+if (!function_exists('mb_strrichr')) {
+ function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
+}
+if (!function_exists('mb_strripos')) {
+ function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
+}
+if (!function_exists('mb_strrpos')) {
+ function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
+}
+if (!function_exists('mb_strstr')) {
+ function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
+}
+if (!function_exists('mb_get_info')) {
function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
- function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); }
- function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); }
- function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); }
- function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); }
- function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
- function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $v0, $a, $b, $c, $d, $e, $f); }
+}
+if (!function_exists('mb_http_output')) {
+ function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
+}
+if (!function_exists('mb_strwidth')) {
+ function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
+}
+if (!function_exists('mb_substr_count')) {
+ function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
+}
+if (!function_exists('mb_output_handler')) {
+ function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
+}
+if (!function_exists('mb_http_input')) {
+ function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
+}
+
+if (!function_exists('mb_convert_variables')) {
+ function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
+}
+
+if (!function_exists('mb_ord')) {
+ function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
+}
+if (!function_exists('mb_chr')) {
+ function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
+}
+if (!function_exists('mb_scrub')) {
+ function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
+}
+if (!function_exists('mb_str_split')) {
+ function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
+}
+
+if (extension_loaded('mbstring')) {
+ return;
+}
+
+if (!defined('MB_CASE_UPPER')) {
+ define('MB_CASE_UPPER', 0);
+}
+if (!defined('MB_CASE_LOWER')) {
+ define('MB_CASE_LOWER', 1);
+}
+if (!defined('MB_CASE_TITLE')) {
+ define('MB_CASE_TITLE', 2);
}
diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php
new file mode 100644
index 0000000..82f5ac4
--- /dev/null
+++ b/vendor/symfony/polyfill-mbstring/bootstrap80.php
@@ -0,0 +1,143 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+use Symfony\Polyfill\Mbstring as p;
+
+if (!function_exists('mb_convert_encoding')) {
+ function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); }
+}
+if (!function_exists('mb_decode_mimeheader')) {
+ function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); }
+}
+if (!function_exists('mb_encode_mimeheader')) {
+ function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); }
+}
+if (!function_exists('mb_decode_numericentity')) {
+ function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); }
+}
+if (!function_exists('mb_encode_numericentity')) {
+ function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); }
+}
+if (!function_exists('mb_convert_case')) {
+ function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); }
+}
+if (!function_exists('mb_internal_encoding')) {
+ function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); }
+}
+if (!function_exists('mb_language')) {
+ function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); }
+}
+if (!function_exists('mb_list_encodings')) {
+ function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); }
+}
+if (!function_exists('mb_encoding_aliases')) {
+ function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); }
+}
+if (!function_exists('mb_check_encoding')) {
+ function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); }
+}
+if (!function_exists('mb_detect_encoding')) {
+ function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); }
+}
+if (!function_exists('mb_detect_order')) {
+ function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); }
+}
+if (!function_exists('mb_parse_str')) {
+ function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; }
+}
+if (!function_exists('mb_strlen')) {
+ function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); }
+}
+if (!function_exists('mb_strpos')) {
+ function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
+}
+if (!function_exists('mb_strtolower')) {
+ function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); }
+}
+if (!function_exists('mb_strtoupper')) {
+ function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); }
+}
+if (!function_exists('mb_substitute_character')) {
+ function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); }
+}
+if (!function_exists('mb_substr')) {
+ function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); }
+}
+if (!function_exists('mb_stripos')) {
+ function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
+}
+if (!function_exists('mb_stristr')) {
+ function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
+}
+if (!function_exists('mb_strrchr')) {
+ function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
+}
+if (!function_exists('mb_strrichr')) {
+ function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
+}
+if (!function_exists('mb_strripos')) {
+ function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
+}
+if (!function_exists('mb_strrpos')) {
+ function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
+}
+if (!function_exists('mb_strstr')) {
+ function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
+}
+if (!function_exists('mb_get_info')) {
+ function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); }
+}
+if (!function_exists('mb_http_output')) {
+ function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }
+}
+if (!function_exists('mb_strwidth')) {
+ function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); }
+}
+if (!function_exists('mb_substr_count')) {
+ function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); }
+}
+if (!function_exists('mb_output_handler')) {
+ function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); }
+}
+if (!function_exists('mb_http_input')) {
+ function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); }
+}
+
+if (!function_exists('mb_convert_variables')) {
+ function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); }
+}
+
+if (!function_exists('mb_ord')) {
+ function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); }
+}
+if (!function_exists('mb_chr')) {
+ function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); }
+}
+if (!function_exists('mb_scrub')) {
+ function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); }
+}
+if (!function_exists('mb_str_split')) {
+ function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); }
+}
+
+if (extension_loaded('mbstring')) {
+ return;
+}
+
+if (!defined('MB_CASE_UPPER')) {
+ define('MB_CASE_UPPER', 0);
+}
+if (!defined('MB_CASE_LOWER')) {
+ define('MB_CASE_LOWER', 1);
+}
+if (!defined('MB_CASE_TITLE')) {
+ define('MB_CASE_TITLE', 2);
+}
diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json
index 355a0f8..9cd2e92 100644
--- a/vendor/symfony/polyfill-mbstring/composer.json
+++ b/vendor/symfony/polyfill-mbstring/composer.json
@@ -16,7 +16,10 @@
}
],
"require": {
- "php": ">=5.3.3"
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-mbstring": "*"
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" },
@@ -28,7 +31,11 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "1.2-dev"
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
}
}
}
diff --git a/vendor/symfony/polyfill-php73/LICENSE b/vendor/symfony/polyfill-php73/LICENSE
new file mode 100644
index 0000000..3f853aa
--- /dev/null
+++ b/vendor/symfony/polyfill-php73/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2018-2019 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/polyfill-php73/Php73.php b/vendor/symfony/polyfill-php73/Php73.php
new file mode 100644
index 0000000..65c35a6
--- /dev/null
+++ b/vendor/symfony/polyfill-php73/Php73.php
@@ -0,0 +1,43 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Polyfill\Php73;
+
+/**
+ * @author Gabriel Caruso <carusogabriel34@gmail.com>
+ * @author Ion Bazan <ion.bazan@gmail.com>
+ *
+ * @internal
+ */
+final class Php73
+{
+ public static $startAt = 1533462603;
+
+ /**
+ * @param bool $asNum
+ *
+ * @return array|float|int
+ */
+ public static function hrtime($asNum = false)
+ {
+ $ns = microtime(false);
+ $s = substr($ns, 11) - self::$startAt;
+ $ns = 1E9 * (float) $ns;
+
+ if ($asNum) {
+ $ns += $s * 1E9;
+
+ return \PHP_INT_SIZE === 4 ? $ns : (int) $ns;
+ }
+
+ return [$s, (int) $ns];
+ }
+}
diff --git a/vendor/symfony/polyfill-php73/README.md b/vendor/symfony/polyfill-php73/README.md
new file mode 100644
index 0000000..032fafb
--- /dev/null
+++ b/vendor/symfony/polyfill-php73/README.md
@@ -0,0 +1,18 @@
+Symfony Polyfill / Php73
+========================
+
+This component provides functions added to PHP 7.3 core:
+
+- [`array_key_first`](https://php.net/array_key_first)
+- [`array_key_last`](https://php.net/array_key_last)
+- [`hrtime`](https://php.net/function.hrtime)
+- [`is_countable`](https://php.net/is_countable)
+- [`JsonException`](https://php.net/JsonException)
+
+More information can be found in the
+[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
+
+License
+=======
+
+This library is released under the [MIT license](LICENSE).
diff --git a/vendor/symfony/debug/Exception/OutOfMemoryException.php b/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php
index fec1979..f06d6c2 100644
--- a/vendor/symfony/debug/Exception/OutOfMemoryException.php
+++ b/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php
@@ -9,13 +9,8 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Out of memory exception.
- *
- * @author Nicolas Grekas <p@tchwork.com>
- */
-class OutOfMemoryException extends FatalErrorException
-{
+if (\PHP_VERSION_ID < 70300) {
+ class JsonException extends Exception
+ {
+ }
}
diff --git a/vendor/symfony/polyfill-php73/bootstrap.php b/vendor/symfony/polyfill-php73/bootstrap.php
new file mode 100644
index 0000000..d6b2153
--- /dev/null
+++ b/vendor/symfony/polyfill-php73/bootstrap.php
@@ -0,0 +1,31 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+use Symfony\Polyfill\Php73 as p;
+
+if (\PHP_VERSION_ID >= 70300) {
+ return;
+}
+
+if (!function_exists('is_countable')) {
+ function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; }
+}
+if (!function_exists('hrtime')) {
+ require_once __DIR__.'/Php73.php';
+ p\Php73::$startAt = (int) microtime(true);
+ function hrtime($as_number = false) { return p\Php73::hrtime($as_number); }
+}
+if (!function_exists('array_key_first')) {
+ function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } }
+}
+if (!function_exists('array_key_last')) {
+ function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); }
+}
diff --git a/vendor/symfony/polyfill-php73/composer.json b/vendor/symfony/polyfill-php73/composer.json
new file mode 100644
index 0000000..af0cf42
--- /dev/null
+++ b/vendor/symfony/polyfill-php73/composer.json
@@ -0,0 +1,36 @@
+{
+ "name": "symfony/polyfill-php73",
+ "type": "library",
+ "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+ "keywords": ["polyfill", "shim", "compatibility", "portable"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=7.1"
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Polyfill\\Php73\\": "" },
+ "files": [ "bootstrap.php" ],
+ "classmap": [ "Resources/stubs" ]
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE
new file mode 100644
index 0000000..5593b1d
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2020 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/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php
new file mode 100644
index 0000000..362dd1a
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/Php80.php
@@ -0,0 +1,115 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Polyfill\Php80;
+
+/**
+ * @author Ion Bazan <ion.bazan@gmail.com>
+ * @author Nico Oelgart <nicoswd@gmail.com>
+ * @author Nicolas Grekas <p@tchwork.com>
+ *
+ * @internal
+ */
+final class Php80
+{
+ public static function fdiv(float $dividend, float $divisor): float
+ {
+ return @($dividend / $divisor);
+ }
+
+ public static function get_debug_type($value): string
+ {
+ switch (true) {
+ case null === $value: return 'null';
+ case \is_bool($value): return 'bool';
+ case \is_string($value): return 'string';
+ case \is_array($value): return 'array';
+ case \is_int($value): return 'int';
+ case \is_float($value): return 'float';
+ case \is_object($value): break;
+ case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class';
+ default:
+ if (null === $type = @get_resource_type($value)) {
+ return 'unknown';
+ }
+
+ if ('Unknown' === $type) {
+ $type = 'closed';
+ }
+
+ return "resource ($type)";
+ }
+
+ $class = \get_class($value);
+
+ if (false === strpos($class, '@')) {
+ return $class;
+ }
+
+ return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous';
+ }
+
+ public static function get_resource_id($res): int
+ {
+ if (!\is_resource($res) && null === @get_resource_type($res)) {
+ throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res)));
+ }
+
+ return (int) $res;
+ }
+
+ public static function preg_last_error_msg(): string
+ {
+ switch (preg_last_error()) {
+ case \PREG_INTERNAL_ERROR:
+ return 'Internal error';
+ case \PREG_BAD_UTF8_ERROR:
+ return 'Malformed UTF-8 characters, possibly incorrectly encoded';
+ case \PREG_BAD_UTF8_OFFSET_ERROR:
+ return 'The offset did not correspond to the beginning of a valid UTF-8 code point';
+ case \PREG_BACKTRACK_LIMIT_ERROR:
+ return 'Backtrack limit exhausted';
+ case \PREG_RECURSION_LIMIT_ERROR:
+ return 'Recursion limit exhausted';
+ case \PREG_JIT_STACKLIMIT_ERROR:
+ return 'JIT stack limit exhausted';
+ case \PREG_NO_ERROR:
+ return 'No error';
+ default:
+ return 'Unknown error';
+ }
+ }
+
+ public static function str_contains(string $haystack, string $needle): bool
+ {
+ return '' === $needle || false !== strpos($haystack, $needle);
+ }
+
+ public static function str_starts_with(string $haystack, string $needle): bool
+ {
+ return 0 === strncmp($haystack, $needle, \strlen($needle));
+ }
+
+ public static function str_ends_with(string $haystack, string $needle): bool
+ {
+ if ('' === $needle || $needle === $haystack) {
+ return true;
+ }
+
+ if ('' === $haystack) {
+ return false;
+ }
+
+ $needleLength = \strlen($needle);
+
+ return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php
new file mode 100644
index 0000000..fe6e691
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/PhpToken.php
@@ -0,0 +1,103 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Polyfill\Php80;
+
+/**
+ * @author Fedonyuk Anton <info@ensostudio.ru>
+ *
+ * @internal
+ */
+class PhpToken implements \Stringable
+{
+ /**
+ * @var int
+ */
+ public $id;
+
+ /**
+ * @var string
+ */
+ public $text;
+
+ /**
+ * @var int
+ */
+ public $line;
+
+ /**
+ * @var int
+ */
+ public $pos;
+
+ public function __construct(int $id, string $text, int $line = -1, int $position = -1)
+ {
+ $this->id = $id;
+ $this->text = $text;
+ $this->line = $line;
+ $this->pos = $position;
+ }
+
+ public function getTokenName(): ?string
+ {
+ if ('UNKNOWN' === $name = token_name($this->id)) {
+ $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text;
+ }
+
+ return $name;
+ }
+
+ /**
+ * @param int|string|array $kind
+ */
+ public function is($kind): bool
+ {
+ foreach ((array) $kind as $value) {
+ if (\in_array($value, [$this->id, $this->text], true)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public function isIgnorable(): bool
+ {
+ return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true);
+ }
+
+ public function __toString(): string
+ {
+ return (string) $this->text;
+ }
+
+ /**
+ * @return static[]
+ */
+ public static function tokenize(string $code, int $flags = 0): array
+ {
+ $line = 1;
+ $position = 0;
+ $tokens = token_get_all($code, $flags);
+ foreach ($tokens as $index => $token) {
+ if (\is_string($token)) {
+ $id = \ord($token);
+ $text = $token;
+ } else {
+ [$id, $text, $line] = $token;
+ }
+ $tokens[$index] = new static($id, $text, $line, $position);
+ $position += \strlen($text);
+ }
+
+ return $tokens;
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md
new file mode 100644
index 0000000..3816c55
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/README.md
@@ -0,0 +1,25 @@
+Symfony Polyfill / Php80
+========================
+
+This component provides features added to PHP 8.0 core:
+
+- [`Stringable`](https://php.net/stringable) interface
+- [`fdiv`](https://php.net/fdiv)
+- [`ValueError`](https://php.net/valueerror) class
+- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class
+- `FILTER_VALIDATE_BOOL` constant
+- [`get_debug_type`](https://php.net/get_debug_type)
+- [`PhpToken`](https://php.net/phptoken) class
+- [`preg_last_error_msg`](https://php.net/preg_last_error_msg)
+- [`str_contains`](https://php.net/str_contains)
+- [`str_starts_with`](https://php.net/str_starts_with)
+- [`str_ends_with`](https://php.net/str_ends_with)
+- [`get_resource_id`](https://php.net/get_resource_id)
+
+More information can be found in the
+[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
+
+License
+=======
+
+This library is released under the [MIT license](LICENSE).
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
new file mode 100644
index 0000000..7ea6d27
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
@@ -0,0 +1,22 @@
+<?php
+
+#[Attribute(Attribute::TARGET_CLASS)]
+final class Attribute
+{
+ public const TARGET_CLASS = 1;
+ public const TARGET_FUNCTION = 2;
+ public const TARGET_METHOD = 4;
+ public const TARGET_PROPERTY = 8;
+ public const TARGET_CLASS_CONSTANT = 16;
+ public const TARGET_PARAMETER = 32;
+ public const TARGET_ALL = 63;
+ public const IS_REPEATABLE = 64;
+
+ /** @var int */
+ public $flags;
+
+ public function __construct(int $flags = self::TARGET_ALL)
+ {
+ $this->flags = $flags;
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
new file mode 100644
index 0000000..72f1081
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
@@ -0,0 +1,7 @@
+<?php
+
+if (\PHP_VERSION_ID < 80000 && \extension_loaded('tokenizer')) {
+ class PhpToken extends Symfony\Polyfill\Php80\PhpToken
+ {
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
new file mode 100644
index 0000000..77e037c
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
@@ -0,0 +1,11 @@
+<?php
+
+if (\PHP_VERSION_ID < 80000) {
+ interface Stringable
+ {
+ /**
+ * @return string
+ */
+ public function __toString();
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
new file mode 100644
index 0000000..37937cb
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
@@ -0,0 +1,7 @@
+<?php
+
+if (\PHP_VERSION_ID < 80000) {
+ class UnhandledMatchError extends Error
+ {
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
new file mode 100644
index 0000000..a3a9b88
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
@@ -0,0 +1,7 @@
+<?php
+
+if (\PHP_VERSION_ID < 80000) {
+ class ValueError extends Error
+ {
+ }
+}
diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php
new file mode 100644
index 0000000..e5f7dbc
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/bootstrap.php
@@ -0,0 +1,42 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+use Symfony\Polyfill\Php80 as p;
+
+if (\PHP_VERSION_ID >= 80000) {
+ return;
+}
+
+if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) {
+ define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN);
+}
+
+if (!function_exists('fdiv')) {
+ function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); }
+}
+if (!function_exists('preg_last_error_msg')) {
+ function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); }
+}
+if (!function_exists('str_contains')) {
+ function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); }
+}
+if (!function_exists('str_starts_with')) {
+ function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); }
+}
+if (!function_exists('str_ends_with')) {
+ function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); }
+}
+if (!function_exists('get_debug_type')) {
+ function get_debug_type($value): string { return p\Php80::get_debug_type($value); }
+}
+if (!function_exists('get_resource_id')) {
+ function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); }
+}
diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json
new file mode 100644
index 0000000..cd3e9b6
--- /dev/null
+++ b/vendor/symfony/polyfill-php80/composer.json
@@ -0,0 +1,40 @@
+{
+ "name": "symfony/polyfill-php80",
+ "type": "library",
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "keywords": ["polyfill", "shim", "compatibility", "portable"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=7.1"
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Polyfill\\Php80\\": "" },
+ "files": [ "bootstrap.php" ],
+ "classmap": [ "Resources/stubs" ]
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.26-dev"
+ },
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ }
+}
diff --git a/vendor/symfony/debug/.gitignore b/vendor/symfony/service-contracts/.gitignore
index c49a5d8..c49a5d8 100644
--- a/vendor/symfony/debug/.gitignore
+++ b/vendor/symfony/service-contracts/.gitignore
diff --git a/vendor/symfony/service-contracts/Attribute/Required.php b/vendor/symfony/service-contracts/Attribute/Required.php
new file mode 100644
index 0000000..9df8511
--- /dev/null
+++ b/vendor/symfony/service-contracts/Attribute/Required.php
@@ -0,0 +1,25 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service\Attribute;
+
+/**
+ * A required dependency.
+ *
+ * This attribute indicates that a property holds a required dependency. The annotated property or method should be
+ * considered during the instantiation process of the containing class.
+ *
+ * @author Alexander M. Turek <me@derrabus.de>
+ */
+#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
+final class Required
+{
+}
diff --git a/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/vendor/symfony/service-contracts/Attribute/SubscribedService.php
new file mode 100644
index 0000000..10d1bc3
--- /dev/null
+++ b/vendor/symfony/service-contracts/Attribute/SubscribedService.php
@@ -0,0 +1,33 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service\Attribute;
+
+use Symfony\Contracts\Service\ServiceSubscriberTrait;
+
+/**
+ * Use with {@see ServiceSubscriberTrait} to mark a method's return type
+ * as a subscribed service.
+ *
+ * @author Kevin Bond <kevinbond@gmail.com>
+ */
+#[\Attribute(\Attribute::TARGET_METHOD)]
+final class SubscribedService
+{
+ /**
+ * @param string|null $key The key to use for the service
+ * If null, use "ClassName::methodName"
+ */
+ public function __construct(
+ public ?string $key = null
+ ) {
+ }
+}
diff --git a/vendor/symfony/service-contracts/CHANGELOG.md b/vendor/symfony/service-contracts/CHANGELOG.md
new file mode 100644
index 0000000..7932e26
--- /dev/null
+++ b/vendor/symfony/service-contracts/CHANGELOG.md
@@ -0,0 +1,5 @@
+CHANGELOG
+=========
+
+The changelog is maintained for all Symfony contracts at the following URL:
+https://github.com/symfony/contracts/blob/main/CHANGELOG.md
diff --git a/vendor/symfony/service-contracts/LICENSE b/vendor/symfony/service-contracts/LICENSE
new file mode 100644
index 0000000..74cdc2d
--- /dev/null
+++ b/vendor/symfony/service-contracts/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2018-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/service-contracts/README.md b/vendor/symfony/service-contracts/README.md
new file mode 100644
index 0000000..41e054a
--- /dev/null
+++ b/vendor/symfony/service-contracts/README.md
@@ -0,0 +1,9 @@
+Symfony Service Contracts
+=========================
+
+A set of abstractions extracted out of the Symfony components.
+
+Can be used to build on semantics that the Symfony components proved useful - and
+that already have battle tested implementations.
+
+See https://github.com/symfony/contracts/blob/main/README.md for more information.
diff --git a/vendor/symfony/service-contracts/ResetInterface.php b/vendor/symfony/service-contracts/ResetInterface.php
new file mode 100644
index 0000000..1af1075
--- /dev/null
+++ b/vendor/symfony/service-contracts/ResetInterface.php
@@ -0,0 +1,30 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+/**
+ * Provides a way to reset an object to its initial state.
+ *
+ * When calling the "reset()" method on an object, it should be put back to its
+ * initial state. This usually means clearing any internal buffers and forwarding
+ * the call to internal dependencies. All properties of the object should be put
+ * back to the same state it had when it was first ready to use.
+ *
+ * This method could be called, for example, to recycle objects that are used as
+ * services, so that they can be used to handle several requests in the same
+ * process loop (note that we advise making your services stateless instead of
+ * implementing this interface when possible.)
+ */
+interface ResetInterface
+{
+ public function reset();
+}
diff --git a/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/vendor/symfony/service-contracts/ServiceLocatorTrait.php
new file mode 100644
index 0000000..74dfa43
--- /dev/null
+++ b/vendor/symfony/service-contracts/ServiceLocatorTrait.php
@@ -0,0 +1,128 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
+
+// Help opcache.preload discover always-needed symbols
+class_exists(ContainerExceptionInterface::class);
+class_exists(NotFoundExceptionInterface::class);
+
+/**
+ * A trait to help implement ServiceProviderInterface.
+ *
+ * @author Robin Chalas <robin.chalas@gmail.com>
+ * @author Nicolas Grekas <p@tchwork.com>
+ */
+trait ServiceLocatorTrait
+{
+ private $factories;
+ private $loading = [];
+ private $providedTypes;
+
+ /**
+ * @param callable[] $factories
+ */
+ public function __construct(array $factories)
+ {
+ $this->factories = $factories;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return bool
+ */
+ public function has(string $id)
+ {
+ return isset($this->factories[$id]);
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return mixed
+ */
+ public function get(string $id)
+ {
+ if (!isset($this->factories[$id])) {
+ throw $this->createNotFoundException($id);
+ }
+
+ if (isset($this->loading[$id])) {
+ $ids = array_values($this->loading);
+ $ids = \array_slice($this->loading, array_search($id, $ids));
+ $ids[] = $id;
+
+ throw $this->createCircularReferenceException($id, $ids);
+ }
+
+ $this->loading[$id] = $id;
+ try {
+ return $this->factories[$id]($this);
+ } finally {
+ unset($this->loading[$id]);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getProvidedServices(): array
+ {
+ if (null === $this->providedTypes) {
+ $this->providedTypes = [];
+
+ foreach ($this->factories as $name => $factory) {
+ if (!\is_callable($factory)) {
+ $this->providedTypes[$name] = '?';
+ } else {
+ $type = (new \ReflectionFunction($factory))->getReturnType();
+
+ $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?';
+ }
+ }
+ }
+
+ return $this->providedTypes;
+ }
+
+ private function createNotFoundException(string $id): NotFoundExceptionInterface
+ {
+ if (!$alternatives = array_keys($this->factories)) {
+ $message = 'is empty...';
+ } else {
+ $last = array_pop($alternatives);
+ if ($alternatives) {
+ $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last);
+ } else {
+ $message = sprintf('only knows about the "%s" service.', $last);
+ }
+ }
+
+ if ($this->loading) {
+ $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message);
+ } else {
+ $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message);
+ }
+
+ return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface {
+ };
+ }
+
+ private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface
+ {
+ return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface {
+ };
+ }
+}
diff --git a/vendor/symfony/service-contracts/ServiceProviderInterface.php b/vendor/symfony/service-contracts/ServiceProviderInterface.php
new file mode 100644
index 0000000..c60ad0b
--- /dev/null
+++ b/vendor/symfony/service-contracts/ServiceProviderInterface.php
@@ -0,0 +1,36 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+use Psr\Container\ContainerInterface;
+
+/**
+ * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container.
+ *
+ * @author Nicolas Grekas <p@tchwork.com>
+ * @author Mateusz Sip <mateusz.sip@gmail.com>
+ */
+interface ServiceProviderInterface extends ContainerInterface
+{
+ /**
+ * Returns an associative array of service types keyed by the identifiers provided by the current container.
+ *
+ * Examples:
+ *
+ * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface
+ * * ['foo' => '?'] means the container provides service name "foo" of unspecified type
+ * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null
+ *
+ * @return string[] The provided service types, keyed by service names
+ */
+ public function getProvidedServices(): array;
+}
diff --git a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
new file mode 100644
index 0000000..098ab90
--- /dev/null
+++ b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php
@@ -0,0 +1,53 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+/**
+ * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
+ *
+ * The getSubscribedServices method returns an array of service types required by such instances,
+ * optionally keyed by the service names used internally. Service types that start with an interrogation
+ * mark "?" are optional, while the other ones are mandatory service dependencies.
+ *
+ * The injected service locators SHOULD NOT allow access to any other services not specified by the method.
+ *
+ * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally.
+ * This interface does not dictate any injection method for these service locators, although constructor
+ * injection is recommended.
+ *
+ * @author Nicolas Grekas <p@tchwork.com>
+ */
+interface ServiceSubscriberInterface
+{
+ /**
+ * Returns an array of service types required by such instances, optionally keyed by the service names used internally.
+ *
+ * For mandatory dependencies:
+ *
+ * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name
+ * internally to fetch a service which must implement Psr\Log\LoggerInterface.
+ * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name
+ * internally to fetch an iterable of Psr\Log\LoggerInterface instances.
+ * * ['Psr\Log\LoggerInterface'] is a shortcut for
+ * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface']
+ *
+ * otherwise:
+ *
+ * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency
+ * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency
+ * * ['?Psr\Log\LoggerInterface'] is a shortcut for
+ * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface']
+ *
+ * @return string[] The required service types, optionally keyed by service names
+ */
+ public static function getSubscribedServices();
+}
diff --git a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php
new file mode 100644
index 0000000..16e3eb2
--- /dev/null
+++ b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php
@@ -0,0 +1,109 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+use Psr\Container\ContainerInterface;
+use Symfony\Contracts\Service\Attribute\SubscribedService;
+
+/**
+ * Implementation of ServiceSubscriberInterface that determines subscribed services from
+ * method return types. Service ids are available as "ClassName::methodName".
+ *
+ * @author Kevin Bond <kevinbond@gmail.com>
+ */
+trait ServiceSubscriberTrait
+{
+ /** @var ContainerInterface */
+ protected $container;
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function getSubscribedServices(): array
+ {
+ $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : [];
+ $attributeOptIn = false;
+
+ if (\PHP_VERSION_ID >= 80000) {
+ foreach ((new \ReflectionClass(self::class))->getMethods() as $method) {
+ if (self::class !== $method->getDeclaringClass()->name) {
+ continue;
+ }
+
+ if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) {
+ continue;
+ }
+
+ if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) {
+ throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name));
+ }
+
+ if (!$returnType = $method->getReturnType()) {
+ throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class));
+ }
+
+ $serviceId = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType;
+
+ if ($returnType->allowsNull()) {
+ $serviceId = '?'.$serviceId;
+ }
+
+ $services[$attribute->newInstance()->key ?? self::class.'::'.$method->name] = $serviceId;
+ $attributeOptIn = true;
+ }
+ }
+
+ if (!$attributeOptIn) {
+ foreach ((new \ReflectionClass(self::class))->getMethods() as $method) {
+ if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) {
+ continue;
+ }
+
+ if (self::class !== $method->getDeclaringClass()->name) {
+ continue;
+ }
+
+ if (!($returnType = $method->getReturnType()) instanceof \ReflectionNamedType) {
+ continue;
+ }
+
+ if ($returnType->isBuiltin()) {
+ continue;
+ }
+
+ if (\PHP_VERSION_ID >= 80000) {
+ trigger_deprecation('symfony/service-contracts', '2.5', 'Using "%s" in "%s" without using the "%s" attribute on any method is deprecated.', ServiceSubscriberTrait::class, self::class, SubscribedService::class);
+ }
+
+ $services[self::class.'::'.$method->name] = '?'.($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType);
+ }
+ }
+
+ return $services;
+ }
+
+ /**
+ * @required
+ *
+ * @return ContainerInterface|null
+ */
+ public function setContainer(ContainerInterface $container)
+ {
+ $this->container = $container;
+
+ if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) {
+ return parent::setContainer($container);
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php
new file mode 100644
index 0000000..2a1b565
--- /dev/null
+++ b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php
@@ -0,0 +1,95 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service\Test;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Container\ContainerInterface;
+use Symfony\Contracts\Service\ServiceLocatorTrait;
+
+abstract class ServiceLocatorTest extends TestCase
+{
+ /**
+ * @return ContainerInterface
+ */
+ protected function getServiceLocator(array $factories)
+ {
+ return new class($factories) implements ContainerInterface {
+ use ServiceLocatorTrait;
+ };
+ }
+
+ public function testHas()
+ {
+ $locator = $this->getServiceLocator([
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ function () { return 'dummy'; },
+ ]);
+
+ $this->assertTrue($locator->has('foo'));
+ $this->assertTrue($locator->has('bar'));
+ $this->assertFalse($locator->has('dummy'));
+ }
+
+ public function testGet()
+ {
+ $locator = $this->getServiceLocator([
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ ]);
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('baz', $locator->get('bar'));
+ }
+
+ public function testGetDoesNotMemoize()
+ {
+ $i = 0;
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$i) {
+ ++$i;
+
+ return 'bar';
+ },
+ ]);
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame(2, $i);
+ }
+
+ public function testThrowsOnUndefinedInternalService()
+ {
+ if (!$this->getExpectedException()) {
+ $this->expectException(\Psr\Container\NotFoundExceptionInterface::class);
+ $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');
+ }
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ ]);
+
+ $locator->get('foo');
+ }
+
+ public function testThrowsOnCircularReference()
+ {
+ $this->expectException(\Psr\Container\ContainerExceptionInterface::class);
+ $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".');
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ 'bar' => function () use (&$locator) { return $locator->get('baz'); },
+ 'baz' => function () use (&$locator) { return $locator->get('bar'); },
+ ]);
+
+ $locator->get('foo');
+ }
+}
diff --git a/vendor/symfony/service-contracts/composer.json b/vendor/symfony/service-contracts/composer.json
new file mode 100644
index 0000000..f058637
--- /dev/null
+++ b/vendor/symfony/service-contracts/composer.json
@@ -0,0 +1,42 @@
+{
+ "name": "symfony/service-contracts",
+ "type": "library",
+ "description": "Generic abstractions related to writing services",
+ "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=7.2.5",
+ "psr/container": "^1.1",
+ "symfony/deprecation-contracts": "^2.1|^3"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
+ },
+ "suggest": {
+ "symfony/service-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\Service\\": "" }
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ }
+}