From acd0a32f9133c2b9035eb999135bbec8b090cc75 Mon Sep 17 00:00:00 2001 From: Katie Pearson Date: Thu, 12 Dec 2024 09:32:41 -0800 Subject: [PATCH] Update to 3.1.5 (#42) * 3.1.1 Release: Merge Hotfix branch into Master (#1747) * Occurrence Mapping: Adjust SQL to relax enforcement of link to taxon thesaurus, thus to include records with coordinates but lacking thesaurus relationship * Styling: Various styling, spacing, and display adjustments * Occurrence search: add type attribute to buttons to avoid defaulting as submit buttons * Occurrence Profile: Fix error triggered when otherCatalogNumbers are used to create backlink to original snapshot record within external institution web resource * Occurrence editing functions -- Fix fatal error triggered by cloning an occurrence record with the create association option selected -- Fix fatal error triggered when quick association feature is activated within occurrence editor -- Fix fatal error when deleting an occurrence when the occurrence was previously deleted (e.g. record already in omoccurarchive) -- Adjust occurrence restore option to dynamically determine associationType when restoring a record that was deleted prior to this field being added as a required input -- If resource association does not have an objectID, use url as the display text * Taxonomy editor: bug fix triggered by adding a child directly to the root node of the thesaurus (e.g. kingdom) * Scientific name parsing utility functions: Integrate cleanInfra function directly into code. It served no purpose being separate, and was also causing a bug where parent authors were being incorrectly merged with insfraspecific authors --------- Co-authored-by: Katie Pearson Co-authored-by: Mark Co-authored-by: MuchQuak Co-authored-by: Logan Wilt <91149982+MuchQuak@users.noreply.github.com> * 3.1.2 Release: Merge Hotfix branch into Master (#1770) * Hotfix v.3.1.3 (#1821) * Hotfix v3.1.3 - Adjusted hotfix merge instructions - Inventory Management: Bug fix interfering with adding new editors to an inventory project - Image migration modifications -- Add option to copy over existing target files -- Add checks and error handling for non-existent source files and already existing target files -- Direct log files to be written to /content/logs/ - fix misspelled log directory name, with support still maintained for portals that already have the misspelled directory - Fix jquery selector to be correct so button is enabled when trait is changed - Misc language file and wording adjustments * Hotfix 3.1.4 (#1858) - Checklist voucher link bug -- Resolves issue where checklist link PK is not passed to link function. -- Resolves issue: https://github.com/BioKIC/Symbiota/issues/1828 - Specimen upload bug -- Add IGNORE to avoid complete failure of insert statement -- Capture and display warnings to user -- Fix display of final record process count - Occurrence Search breadcrumb bug fix -- Add comingFrom variable to pagination links within the list and tablelist pages -- If comingFrom variable is not set, or set to anything other than "newsearch" or "harvestparams", set the variable to what is defined as the default within the symbini file. If default action is not defined within symbini, default to new search form. -- Add comingFrom variable to harvestparams.php form -- Resolves issue: https://github.com/BioKIC/Symbiota/issues/1840 - Occurrence Association Form Validation bug -- Fix issue with internal association form validation failing and allowing for creation of an association without an internal occurrence being defined -- Add form validation for external resource and general observation -- Addresses issue: https://github.com/BioKIC/Symbiota/issues/1852 -- Add guid omoassociations RecordID on insert within occurrence editor - Vendor library updates via composer -- update phpoffice/phpspreadsheet to v3.3.0 -- updated phpseclib/phpseclib explicitly to v3.0.42 -- update phpoffice/phpword to v1.3.0 - Fix data binding bug associated with searching occurrence via GUID within Occurrence Profile pages - Misc language translation issues * Hotfix 3.1.5 (#1956) * Add login form button to prevent circular links * Bump symfony/process from 5.4.19 to 5.4.46 in /api * Bump symfony/http-foundation from 5.4.20 to 5.4.46 in /api * Remove non-template contacts and aboutproject files (#1864) * Add condition for elevation type number in searchform.js, fixed typo for maximum elevation * Fix typos * Unify top/northern, bottom/southern usage * Fix image alignment and button names in flashcards (#1881) * Fix image alignment and button names * Add stylesheet, removed in-line styling, added flex classes for games in main.css * Fix over-translated lang tags (#1911) * closes #1916 by removing union return type * Fix parsing issue * Fix (#1920) * Resolve editor lock bug * Resolves issue: https://github.com/BioKIC/Symbiota/issues/1923 * Collection Profile issue * Add form value interpolation for EW NS and units values so sessions is loaded correctly * Update API Vendor Libraries * Closes #1942 Adjust Language Tags of Cross Portal Results * Improve Sign-in and Contact Us button layout on <768px wide devices. --------- Co-authored-by: Edward Gilbert Co-authored-by: Katie Pearson Co-authored-by: Nikita Salikov Co-authored-by: MuchQuak --------- Co-authored-by: Edward Gilbert Co-authored-by: Mark Co-authored-by: MuchQuak Co-authored-by: Logan Wilt <91149982+MuchQuak@users.noreply.github.com> Co-authored-by: Greg Post Co-authored-by: Greg Post --- api/composer.lock | 1290 +++-- api/vendor/autoload.php | 18 + api/vendor/bin/carbon | 121 +- api/vendor/bin/carbon.bat | 3 +- api/vendor/bin/patch-type-declarations | 121 +- api/vendor/bin/patch-type-declarations.bat | 3 +- api/vendor/bin/php-parse | 121 +- api/vendor/bin/php-parse.bat | 3 +- api/vendor/bin/phpunit | 124 +- api/vendor/bin/phpunit.bat | 3 +- api/vendor/bin/var-dump-server | 121 +- api/vendor/bin/var-dump-server.bat | 3 +- api/vendor/bin/yaml-lint | 121 +- api/vendor/bin/yaml-lint.bat | 3 +- api/vendor/brick/math/CHANGELOG.md | 36 +- api/vendor/brick/math/composer.json | 14 +- api/vendor/brick/math/src/BigDecimal.php | 187 +- api/vendor/brick/math/src/BigInteger.php | 208 +- api/vendor/brick/math/src/BigNumber.php | 331 +- api/vendor/brick/math/src/BigRational.php | 139 +- .../src/Exception/DivisionByZeroException.php | 6 - .../Exception/IntegerOverflowException.php | 4 - .../math/src/Exception/MathException.php | 4 +- .../src/Exception/NumberFormatException.php | 12 +- .../Exception/RoundingNecessaryException.php | 2 - .../brick/math/src/Internal/Calculator.php | 117 +- .../Internal/Calculator/BcMathCalculator.php | 49 +- .../src/Internal/Calculator/GmpCalculator.php | 48 - .../Internal/Calculator/NativeCalculator.php | 80 +- api/vendor/brick/math/src/RoundingMode.php | 31 +- .../carbon-doctrine-types}/LICENSE | 12 +- .../carbonphp/carbon-doctrine-types/README.md | 14 + .../carbon-doctrine-types/composer.json | 36 + .../Carbon/Doctrine/CarbonDoctrineType.php | 16 + .../Carbon/Doctrine/CarbonImmutableType.php | 9 + .../src/Carbon/Doctrine/CarbonType.php | 9 + .../Carbon/Doctrine/CarbonTypeConverter.php | 92 +- .../Doctrine/DateTimeDefaultPrecision.php | 9 +- .../Carbon/Doctrine/DateTimeImmutableType.php | 16 +- .../src/Carbon/Doctrine/DateTimeType.php | 24 + api/vendor/composer/ClassLoader.php | 164 +- api/vendor/composer/InstalledVersions.php | 44 +- api/vendor/composer/autoload_classmap.php | 93 +- api/vendor/composer/autoload_files.php | 24 +- api/vendor/composer/autoload_namespaces.php | 3 +- api/vendor/composer/autoload_psr4.php | 7 +- api/vendor/composer/autoload_real.php | 49 +- api/vendor/composer/autoload_static.php | 149 +- api/vendor/composer/installed.json | 1402 +++--- api/vendor/composer/installed.php | 464 +- api/vendor/doctrine/annotations/README.md | 7 + api/vendor/doctrine/annotations/composer.json | 8 +- .../doctrine/annotations/docs/en/index.rst | 9 +- .../Common/Annotations/AnnotationReader.php | 13 +- .../Common/Annotations/CachedReader.php | 5 +- .../Doctrine/Common/Annotations/DocLexer.php | 6 +- .../Doctrine/Common/Annotations/DocParser.php | 8 +- .../Common/Annotations/PsrCachedReader.php | 5 +- api/vendor/doctrine/annotations/psalm.xml | 11 + api/vendor/doctrine/inflector/composer.json | 4 +- .../Inflector/Rules/English/Inflectible.php | 6 +- .../doctrine/instantiator/composer.json | 14 +- .../Exception/ExceptionInterface.php | 2 + .../Exception/InvalidArgumentException.php | 6 +- .../Exception/UnexpectedValueException.php | 14 +- .../Doctrine/Instantiator/Instantiator.php | 31 +- .../Instantiator/InstantiatorInterface.php | 6 +- .../cron-expression/CHANGELOG.md | 12 + .../dragonmantank/cron-expression/README.md | 80 +- .../cron-expression/composer.json | 6 +- .../cron-expression/phpstan.neon | 15 - .../src/Cron/CronExpression.php | 41 +- .../cron-expression/src/Cron/MinutesField.php | 1 + api/vendor/fakerphp/faker/CHANGELOG.md | 30 +- api/vendor/fakerphp/faker/README.md | 13 +- api/vendor/fakerphp/faker/composer.json | 5 - api/vendor/fakerphp/faker/psalm.baseline.xml | 247 - .../faker/src/Faker/Calculator/Ean.php | 6 +- .../faker/src/Faker/Calculator/Iban.php | 14 +- .../faker/src/Faker/Calculator/Luhn.php | 18 +- .../faker/src/Faker/Container/Container.php | 18 +- .../src/Faker/Container/ContainerBuilder.php | 60 +- .../Faker/Container/ContainerInterface.php | 4 - .../fakerphp/faker/src/Faker/Core/Barcode.php | 9 +- .../fakerphp/faker/src/Faker/Core/Blood.php | 4 +- .../fakerphp/faker/src/Faker/Core/Color.php | 39 +- .../faker/src/Faker/Core/Coordinates.php | 20 +- .../faker/src/Faker/Core/DateTime.php | 47 +- .../fakerphp/faker/src/Faker/Core/File.php | 2 +- .../fakerphp/faker/src/Faker/Core/Number.php | 14 +- .../fakerphp/faker/src/Faker/Core/Uuid.php | 19 +- .../fakerphp/faker/src/Faker/Core/Version.php | 37 +- .../src/Faker/Extension/DateTimeExtension.php | 20 +- .../faker/src/Faker/Extension/Helper.php | 4 +- .../fakerphp/faker/src/Faker/Factory.php | 2 + .../fakerphp/faker/src/Faker/Generator.php | 24 +- .../fakerphp/faker/src/Faker/Guesser/Name.php | 50 +- .../Faker/ORM/Doctrine/ColumnTypeGuesser.php | 6 +- .../src/Faker/ORM/Doctrine/Populator.php | 2 +- .../faker/src/Faker/ORM/Spot/Populator.php | 2 +- .../faker/src/Faker/Provider/Base.php | 105 +- .../faker/src/Faker/Provider/DateTime.php | 10 +- .../faker/src/Faker/Provider/Image.php | 1 + .../faker/src/Faker/Provider/Lorem.php | 10 +- .../src/Faker/Provider/Miscellaneous.php | 25 +- .../src/Faker/Provider/ar_EG/Address.php | 64 +- .../faker/src/Faker/Provider/ar_EG/Person.php | 28 +- .../faker/src/Faker/Provider/ar_SA/Person.php | 2 +- .../faker/src/Faker/Provider/cs_CZ/Person.php | 7 +- .../faker/src/Faker/Provider/da_DK/Person.php | 2 +- .../faker/src/Faker/Provider/de_AT/Person.php | 2 +- .../faker/src/Faker/Provider/de_CH/Person.php | 2 +- .../faker/src/Faker/Provider/de_DE/Person.php | 2 +- .../src/Faker/Provider/en_AU/Internet.php | 2 +- .../src/Faker/Provider/en_GB/Company.php | 2 +- .../src/Faker/Provider/en_US/Company.php | 2 +- .../faker/src/Faker/Provider/en_US/Person.php | 2 +- .../faker/src/Faker/Provider/en_ZA/Person.php | 7 +- .../src/Faker/Provider/es_AR/Company.php | 2 +- .../src/Faker/Provider/es_ES/Company.php | 2 +- .../src/Faker/Provider/es_PE/Company.php | 2 +- .../faker/src/Faker/Provider/fi_FI/Person.php | 5 +- .../src/Faker/Provider/fr_FR/Address.php | 6 +- .../src/Faker/Provider/fr_FR/PhoneNumber.php | 50 +- .../src/Faker/Provider/it_IT/Address.php | 54 +- .../faker/src/Faker/Provider/it_IT/Person.php | 79 +- .../faker/src/Faker/Provider/ja_JP/Text.php | 2 + .../src/Faker/Provider/kk_KZ/Company.php | 4 +- .../faker/src/Faker/Provider/kk_KZ/Person.php | 5 +- .../faker/src/Faker/Provider/lt_LT/Person.php | 7 +- .../src/Faker/Provider/lv_LV/Address.php | 2 +- .../faker/src/Faker/Provider/lv_LV/Person.php | 32 +- .../faker/src/Faker/Provider/ms_MY/Person.php | 1 + .../faker/src/Faker/Provider/nb_NO/Person.php | 7 +- .../faker/src/Faker/Provider/nl_BE/Person.php | 14 +- .../src/Faker/Provider/pl_PL/Address.php | 174 +- .../faker/src/Faker/Provider/pl_PL/Color.php | 40 + .../src/Faker/Provider/pl_PL/Internet.php | 2 +- .../src/Faker/Provider/pl_PL/LicensePlate.php | 103 +- .../src/Faker/Provider/pt_BR/PhoneNumber.php | 6 +- .../faker/src/Faker/Provider/pt_BR/Text.php | 56 +- .../faker/src/Faker/Provider/ro_RO/Person.php | 1 + .../faker/src/Faker/Provider/ru_RU/Person.php | 26 +- .../faker/src/Faker/Provider/sk_SK/Person.php | 2 +- .../faker/src/Faker/Provider/sl_SI/Person.php | 2 +- .../faker/src/Faker/Provider/sv_SE/Person.php | 7 +- .../src/Faker/Provider/zh_CN/Address.php | 2 +- .../graham-campbell/result-type/LICENSE | 2 +- .../graham-campbell/result-type/composer.json | 4 +- .../graham-campbell/result-type/src/Error.php | 1 + .../result-type/src/Success.php | 1 + .../laravel/serializable-closure/README.md | 7 +- .../serializable-closure/composer.json | 5 +- .../src/Serializers/Native.php | 8 + .../src/Support/ReflectionClosure.php | 21 +- api/vendor/mockery/mockery/.readthedocs.yml | 24 + api/vendor/mockery/mockery/CHANGELOG.md | 460 +- api/vendor/mockery/mockery/CONTRIBUTING.md | 22 +- api/vendor/mockery/mockery/COPYRIGHT.md | 7 + api/vendor/mockery/mockery/LICENSE | 44 +- api/vendor/mockery/mockery/README.md | 5 +- api/vendor/mockery/mockery/SECURITY.md | 14 + api/vendor/mockery/mockery/composer.json | 93 +- api/vendor/mockery/mockery/composer.lock | 1867 ++++++++ api/vendor/mockery/mockery/docs/.gitignore | 1 + api/vendor/mockery/mockery/docs/Makefile | 177 + .../mockery/mockery/docs/_static/.gitkeep | 0 api/vendor/mockery/mockery/docs/conf.py | 9 +- .../docs/getting_started/upgrading.rst | 2 +- .../docs/reference/creating_test_doubles.rst | 2 +- .../mockery/docs/reference/expectations.rst | 2 +- .../mockery/mockery/docs/reference/index.rst | 1 + .../mockery/mockery/docs/reference/spies.rst | 2 +- .../mockery/mockery/docs/requirements.txt | 25 + .../mockery/mockery/library/Mockery.php | 1157 ++--- .../Phpunit/MockeryPHPUnitIntegration.php | 62 +- ...PHPUnitIntegrationAssertPostConditions.php | 20 +- .../Adapter/Phpunit/MockeryTestCase.php | 24 +- .../Adapter/Phpunit/MockeryTestCaseSetUp.php | 20 +- .../Mockery/Adapter/Phpunit/TestListener.php | 22 +- .../Adapter/Phpunit/TestListenerTrait.php | 43 +- .../library/Mockery/ClosureWrapper.php | 30 +- .../library/Mockery/CompositeExpectation.php | 130 +- .../mockery/library/Mockery/Configuration.php | 387 +- .../mockery/library/Mockery/Container.php | 657 ++- .../Mockery/CountValidator/AtLeast.php | 30 +- .../library/Mockery/CountValidator/AtMost.php | 28 +- .../CountValidator/CountValidatorAbstract.php | 33 +- .../CountValidatorInterface.php | 24 + .../library/Mockery/CountValidator/Exact.php | 28 +- .../Mockery/CountValidator/Exception.php | 25 +- .../mockery/library/Mockery/Exception.php | 25 +- .../Exception/BadMethodCallException.php | 24 +- .../Exception/InvalidArgumentException.php | 22 +- .../Exception/InvalidCountException.php | 154 +- .../Exception/InvalidOrderException.php | 124 +- .../Exception/MockeryExceptionInterface.php | 19 + .../NoMatchingExpectationException.php | 104 +- .../Mockery/Exception/RuntimeException.php | 24 +- .../mockery/library/Mockery/Expectation.php | 1123 +++-- .../library/Mockery/ExpectationDirector.php | 240 +- .../library/Mockery/ExpectationInterface.php | 40 +- .../Mockery/ExpectsHigherOrderMessage.php | 28 +- .../Mockery/Generator/CachingGenerator.php | 40 +- .../Mockery/Generator/DefinedTargetClass.php | 176 +- .../library/Mockery/Generator/Generator.php | 24 +- .../library/Mockery/Generator/Method.php | 51 +- .../Mockery/Generator/MockConfiguration.php | 675 +-- .../Generator/MockConfigurationBuilder.php | 246 +- .../Mockery/Generator/MockDefinition.php | 59 +- .../Mockery/Generator/MockNameBuilder.php | 37 +- .../library/Mockery/Generator/Parameter.php | 91 +- .../Pass/AvoidMethodClashPass.php | 45 +- .../Pass/CallTypeHintPass.php | 27 +- .../Pass/ClassAttributesPass.php | 40 + .../StringManipulation/Pass/ClassNamePass.php | 42 +- .../StringManipulation/Pass/ClassPass.php | 44 +- .../StringManipulation/Pass/ConstantsPass.php | 36 +- .../Pass/InstanceMockPass.php | 39 +- .../StringManipulation/Pass/InterfacePass.php | 49 +- .../Pass/MagicMethodTypeHintsPass.php | 167 +- .../Pass/MethodDefinitionPass.php | 102 +- .../StringManipulation/Pass/Pass.php | 24 +- .../RemoveBuiltinMethodsThatAreFinalPass.php | 44 +- .../Pass/RemoveDestructorPass.php | 34 +- ...lizeForInternalSerializableClassesPass.php | 50 +- .../StringManipulation/Pass/TraitPass.php | 42 +- .../Generator/StringManipulationGenerator.php | 95 +- .../Generator/TargetClassInterface.php | 81 +- .../Generator/UndefinedTargetClass.php | 119 +- .../library/Mockery/HigherOrderMessage.php | 39 +- .../mockery/library/Mockery/Instantiator.php | 179 +- .../library/Mockery/LegacyMockInterface.php | 262 +- .../library/Mockery/Loader/EvalLoader.php | 30 +- .../mockery/library/Mockery/Loader/Loader.php | 25 +- .../library/Mockery/Loader/RequireLoader.php | 74 +- .../Mockery/Matcher/AndAnyOtherArgs.php | 41 +- .../mockery/library/Mockery/Matcher/Any.php | 41 +- .../library/Mockery/Matcher/AnyArgs.php | 37 +- .../mockery/library/Mockery/Matcher/AnyOf.php | 45 +- .../Mockery/Matcher/ArgumentListMatcher.php | 20 +- .../library/Mockery/Matcher/Closure.php | 43 +- .../library/Mockery/Matcher/Contains.php | 61 +- .../library/Mockery/Matcher/Ducktype.php | 55 +- .../library/Mockery/Matcher/HasKey.php | 51 +- .../library/Mockery/Matcher/HasValue.php | 51 +- .../library/Mockery/Matcher/IsEqual.php | 38 + .../library/Mockery/Matcher/IsSame.php | 38 + .../Mockery/Matcher/MatcherAbstract.php | 51 +- .../Mockery/Matcher/MatcherInterface.php | 36 + .../Mockery/Matcher/MultiArgumentClosure.php | 46 +- .../library/Mockery/Matcher/MustBe.php | 51 +- .../library/Mockery/Matcher/NoArgs.php | 39 +- .../mockery/library/Mockery/Matcher/Not.php | 43 +- .../library/Mockery/Matcher/NotAnyOf.php | 46 +- .../library/Mockery/Matcher/Pattern.php | 43 +- .../library/Mockery/Matcher/Subset.php | 67 +- .../mockery/library/Mockery/Matcher/Type.php | 69 +- .../mockery/library/Mockery/MethodCall.php | 47 +- .../mockery/mockery/library/Mockery/Mock.php | 289 +- .../mockery/library/Mockery/MockInterface.php | 32 +- .../Mockery/QuickDefinitionsConfiguration.php | 23 +- .../library/Mockery/ReceivedMethodCalls.php | 24 +- .../mockery/library/Mockery/Reflector.php | 260 +- .../mockery/library/Mockery/Undefined.php | 29 +- .../library/Mockery/VerificationDirector.php | 163 +- .../Mockery/VerificationExpectation.php | 34 +- .../mockery/mockery/library/helpers.php | 66 +- api/vendor/monolog/monolog/CHANGELOG.md | 33 + api/vendor/monolog/monolog/composer.json | 6 +- .../monolog/src/Monolog/DateTimeImmutable.php | 2 + .../monolog/src/Monolog/ErrorHandler.php | 2 +- .../Monolog/Formatter/FlowdockFormatter.php | 1 + .../Formatter/GelfMessageFormatter.php | 45 +- .../Formatter/GoogleCloudLoggingFormatter.php | 3 +- .../src/Monolog/Formatter/JsonFormatter.php | 4 + .../src/Monolog/Formatter/LineFormatter.php | 2 +- .../Monolog/Formatter/NormalizerFormatter.php | 3 + .../src/Monolog/Handler/AmqpHandler.php | 15 +- .../Monolog/Handler/BrowserConsoleHandler.php | 17 +- .../Monolog/Handler/ElasticsearchHandler.php | 1 + .../src/Monolog/Handler/FilterHandler.php | 2 +- .../Monolog/Handler/FingersCrossedHandler.php | 2 +- .../src/Monolog/Handler/FlowdockHandler.php | 1 + .../Monolog/Handler/RotatingFileHandler.php | 13 +- .../src/Monolog/Handler/SamplingHandler.php | 2 +- .../src/Monolog/Handler/Slack/SlackRecord.php | 2 +- .../src/Monolog/Handler/StreamHandler.php | 53 +- .../Monolog/Handler/TelegramBotHandler.php | 12 +- .../Handler/WhatFailureGroupHandler.php | 14 + .../monolog/monolog/src/Monolog/Logger.php | 71 +- .../Processor/PsrLogMessageProcessor.php | 2 + .../src/Monolog/Processor/WebProcessor.php | 2 +- .../monolog/monolog/src/Monolog/Utils.php | 2 +- .../myclabs/deep-copy/.github/FUNDING.yml | 12 - .../deep-copy/.github/workflows/ci.yaml | 101 - api/vendor/myclabs/deep-copy/README.md | 37 +- api/vendor/myclabs/deep-copy/composer.json | 7 +- .../deep-copy/src/DeepCopy/DeepCopy.php | 13 + .../src/DeepCopy/Filter/ChainableFilter.php | 24 + .../TypeFilter/Date/DatePeriodFilter.php | 42 + api/vendor/nesbot/carbon/composer.json | 16 +- api/vendor/nesbot/carbon/readme.md | 62 +- api/vendor/nesbot/carbon/sponsors.php | 129 + .../nesbot/carbon/src/Carbon/Carbon.php | 934 ++-- .../carbon/src/Carbon/CarbonImmutable.php | 934 ++-- .../carbon/src/Carbon/CarbonInterface.php | 69 +- .../carbon/src/Carbon/CarbonInterval.php | 249 +- .../nesbot/carbon/src/Carbon/CarbonPeriod.php | 126 +- .../src/Carbon/CarbonPeriodImmutable.php | 7 + .../Carbon/Doctrine/CarbonDoctrineType.php | 23 - .../Carbon/Doctrine/CarbonImmutableType.php | 37 - .../carbon/src/Carbon/Doctrine/CarbonType.php | 37 - .../src/Carbon/Doctrine/DateTimeType.php | 16 - .../nesbot/carbon/src/Carbon/Factory.php | 2 +- .../carbon/src/Carbon/FactoryImmutable.php | 22 +- .../nesbot/carbon/src/Carbon/Lang/en_CH.php | 8 + .../nesbot/carbon/src/Carbon/Lang/hu.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/ms.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/sk.php | 110 +- .../nesbot/carbon/src/Carbon/Lang/sl.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/uk.php | 2 +- .../MessageFormatterMapper.php | 2 + .../src/Carbon/PHPStan/AbstractMacro.php | 8 +- .../src/Carbon/PHPStan/MacroScanner.php | 12 +- .../carbon/src/Carbon/Traits/Comparison.php | 4 + .../carbon/src/Carbon/Traits/Creator.php | 24 +- .../nesbot/carbon/src/Carbon/Traits/Date.php | 1 + .../carbon/src/Carbon/Traits/Difference.php | 8 +- .../src/Carbon/Traits/IntervalRounding.php | 2 +- .../carbon/src/Carbon/Traits/Localization.php | 2 + .../nesbot/carbon/src/Carbon/Traits/Mixin.php | 51 +- .../carbon/src/Carbon/Traits/Options.php | 12 +- .../carbon/src/Carbon/Traits/Rounding.php | 8 +- .../src/Carbon/Traits/Serialization.php | 2 +- .../nesbot/carbon/src/Carbon/Traits/Test.php | 8 +- .../nesbot/carbon/src/Carbon/Traits/Units.php | 22 +- .../carbon/src/Carbon/TranslatorImmutable.php | 2 +- api/vendor/nikic/php-parser/README.md | 32 +- api/vendor/nikic/php-parser/bin/php-parse | 21 +- api/vendor/nikic/php-parser/composer.json | 10 +- api/vendor/nikic/php-parser/grammar/README.md | 30 - .../nikic/php-parser/grammar/parser.template | 106 - api/vendor/nikic/php-parser/grammar/php5.y | 1046 ----- api/vendor/nikic/php-parser/grammar/php7.y | 1235 ----- .../nikic/php-parser/grammar/phpyLang.php | 184 - .../php-parser/grammar/rebuildParsers.php | 81 - .../nikic/php-parser/grammar/tokens.template | 17 - api/vendor/nikic/php-parser/grammar/tokens.y | 115 - .../php-parser/lib/PhpParser/Builder.php | 5 +- .../lib/PhpParser/Builder/ClassConst.php | 50 +- .../lib/PhpParser/Builder/Class_.php | 65 +- .../lib/PhpParser/Builder/Declaration.php | 15 +- .../lib/PhpParser/Builder/EnumCase.php | 15 +- .../lib/PhpParser/Builder/Enum_.php | 53 +- .../lib/PhpParser/Builder/FunctionLike.php | 14 +- .../lib/PhpParser/Builder/Function_.php | 14 +- .../lib/PhpParser/Builder/Interface_.php | 21 +- .../lib/PhpParser/Builder/Method.php | 31 +- .../lib/PhpParser/Builder/Namespace_.php | 10 +- .../lib/PhpParser/Builder/Param.php | 105 +- .../lib/PhpParser/Builder/Property.php | 102 +- .../lib/PhpParser/Builder/TraitUse.php | 11 +- .../PhpParser/Builder/TraitUseAdaptation.php | 53 +- .../lib/PhpParser/Builder/Trait_.php | 27 +- .../php-parser/lib/PhpParser/Builder/Use_.php | 16 +- .../lib/PhpParser/BuilderFactory.php | 120 +- .../lib/PhpParser/BuilderHelpers.php | 43 +- .../php-parser/lib/PhpParser/Comment.php | 104 +- .../php-parser/lib/PhpParser/Comment/Doc.php | 3 +- .../ConstExprEvaluationException.php | 6 +- .../lib/PhpParser/ConstExprEvaluator.php | 25 +- .../nikic/php-parser/lib/PhpParser/Error.php | 59 +- .../php-parser/lib/PhpParser/ErrorHandler.php | 5 +- .../lib/PhpParser/ErrorHandler/Collecting.php | 15 +- .../lib/PhpParser/ErrorHandler/Throwing.php | 5 +- .../lib/PhpParser/Internal/DiffElem.php | 18 +- .../lib/PhpParser/Internal/Differ.php | 58 +- .../Internal/PrintableNewAnonClassNode.php | 38 +- .../lib/PhpParser/Internal/TokenPolyfill.php | 237 + .../lib/PhpParser/Internal/TokenStream.php | 144 +- .../php-parser/lib/PhpParser/JsonDecoder.php | 25 +- .../nikic/php-parser/lib/PhpParser/Lexer.php | 582 +-- .../lib/PhpParser/Lexer/Emulative.php | 169 +- .../AsymmetricVisibilityTokenEmulator.php | 93 + .../Lexer/TokenEmulator/AttributeEmulator.php | 29 +- .../CoaleseEqualTokenEmulator.php | 47 - .../Lexer/TokenEmulator/EnumTokenEmulator.php | 25 +- .../TokenEmulator/ExplicitOctalEmulator.php | 23 +- .../FlexibleDocStringEmulator.php | 76 - .../Lexer/TokenEmulator/FnTokenEmulator.php | 23 - .../Lexer/TokenEmulator/KeywordEmulator.php | 50 +- .../TokenEmulator/MatchTokenEmulator.php | 16 +- .../TokenEmulator/NullsafeTokenEmulator.php | 51 +- .../NumericLiteralSeparatorEmulator.php | 105 - .../TokenEmulator/PropertyTokenEmulator.php | 19 + .../ReadonlyFunctionTokenEmulator.php | 6 +- .../TokenEmulator/ReadonlyTokenEmulator.php | 25 +- .../Lexer/TokenEmulator/ReverseEmulator.php | 11 +- .../Lexer/TokenEmulator/TokenEmulator.php | 15 +- .../php-parser/lib/PhpParser/Modifiers.php | 85 + .../php-parser/lib/PhpParser/NameContext.php | 49 +- .../nikic/php-parser/lib/PhpParser/Node.php | 57 +- .../php-parser/lib/PhpParser/Node/Arg.php | 28 +- .../lib/PhpParser/Node/ArrayItem.php | 43 + .../lib/PhpParser/Node/Attribute.php | 19 +- .../lib/PhpParser/Node/AttributeGroup.php | 12 +- .../lib/PhpParser/Node/ClosureUse.php | 36 + .../lib/PhpParser/Node/ComplexType.php | 3 +- .../php-parser/lib/PhpParser/Node/Const_.php | 19 +- .../lib/PhpParser/Node/DeclareItem.php | 37 + .../php-parser/lib/PhpParser/Node/Expr.php | 3 +- .../lib/PhpParser/Node/Expr/ArrayDimFetch.php | 21 +- .../lib/PhpParser/Node/Expr/ArrayItem.php | 40 +- .../lib/PhpParser/Node/Expr/Array_.php | 22 +- .../lib/PhpParser/Node/Expr/ArrowFunction.php | 61 +- .../lib/PhpParser/Node/Expr/Assign.php | 19 +- .../lib/PhpParser/Node/Expr/AssignOp.php | 15 +- .../Node/Expr/AssignOp/BitwiseAnd.php | 5 +- .../Node/Expr/AssignOp/BitwiseOr.php | 5 +- .../Node/Expr/AssignOp/BitwiseXor.php | 5 +- .../PhpParser/Node/Expr/AssignOp/Coalesce.php | 5 +- .../PhpParser/Node/Expr/AssignOp/Concat.php | 5 +- .../lib/PhpParser/Node/Expr/AssignOp/Div.php | 5 +- .../PhpParser/Node/Expr/AssignOp/Minus.php | 5 +- .../lib/PhpParser/Node/Expr/AssignOp/Mod.php | 5 +- .../lib/PhpParser/Node/Expr/AssignOp/Mul.php | 5 +- .../lib/PhpParser/Node/Expr/AssignOp/Plus.php | 5 +- .../lib/PhpParser/Node/Expr/AssignOp/Pow.php | 5 +- .../Node/Expr/AssignOp/ShiftLeft.php | 5 +- .../Node/Expr/AssignOp/ShiftRight.php | 5 +- .../lib/PhpParser/Node/Expr/AssignRef.php | 19 +- .../lib/PhpParser/Node/Expr/BinaryOp.php | 19 +- .../Node/Expr/BinaryOp/BitwiseAnd.php | 9 +- .../Node/Expr/BinaryOp/BitwiseOr.php | 9 +- .../Node/Expr/BinaryOp/BitwiseXor.php | 9 +- .../Node/Expr/BinaryOp/BooleanAnd.php | 9 +- .../Node/Expr/BinaryOp/BooleanOr.php | 9 +- .../PhpParser/Node/Expr/BinaryOp/Coalesce.php | 9 +- .../PhpParser/Node/Expr/BinaryOp/Concat.php | 9 +- .../lib/PhpParser/Node/Expr/BinaryOp/Div.php | 9 +- .../PhpParser/Node/Expr/BinaryOp/Equal.php | 9 +- .../PhpParser/Node/Expr/BinaryOp/Greater.php | 9 +- .../Node/Expr/BinaryOp/GreaterOrEqual.php | 9 +- .../Node/Expr/BinaryOp/Identical.php | 9 +- .../Node/Expr/BinaryOp/LogicalAnd.php | 9 +- .../Node/Expr/BinaryOp/LogicalOr.php | 9 +- .../Node/Expr/BinaryOp/LogicalXor.php | 9 +- .../PhpParser/Node/Expr/BinaryOp/Minus.php | 9 +- .../lib/PhpParser/Node/Expr/BinaryOp/Mod.php | 9 +- .../lib/PhpParser/Node/Expr/BinaryOp/Mul.php | 9 +- .../PhpParser/Node/Expr/BinaryOp/NotEqual.php | 9 +- .../Node/Expr/BinaryOp/NotIdentical.php | 9 +- .../lib/PhpParser/Node/Expr/BinaryOp/Plus.php | 9 +- .../lib/PhpParser/Node/Expr/BinaryOp/Pow.php | 9 +- .../Node/Expr/BinaryOp/ShiftLeft.php | 9 +- .../Node/Expr/BinaryOp/ShiftRight.php | 9 +- .../PhpParser/Node/Expr/BinaryOp/Smaller.php | 9 +- .../Node/Expr/BinaryOp/SmallerOrEqual.php | 9 +- .../Node/Expr/BinaryOp/Spaceship.php | 9 +- .../lib/PhpParser/Node/Expr/BitwiseNot.php | 15 +- .../lib/PhpParser/Node/Expr/BooleanNot.php | 15 +- .../lib/PhpParser/Node/Expr/CallLike.php | 10 +- .../lib/PhpParser/Node/Expr/Cast.php | 11 +- .../lib/PhpParser/Node/Expr/Cast/Array_.php | 5 +- .../lib/PhpParser/Node/Expr/Cast/Bool_.php | 5 +- .../lib/PhpParser/Node/Expr/Cast/Double.php | 11 +- .../lib/PhpParser/Node/Expr/Cast/Int_.php | 5 +- .../lib/PhpParser/Node/Expr/Cast/Object_.php | 5 +- .../lib/PhpParser/Node/Expr/Cast/String_.php | 5 +- .../lib/PhpParser/Node/Expr/Cast/Unset_.php | 5 +- .../PhpParser/Node/Expr/ClassConstFetch.php | 24 +- .../lib/PhpParser/Node/Expr/Clone_.php | 15 +- .../lib/PhpParser/Node/Expr/Closure.php | 59 +- .../lib/PhpParser/Node/Expr/ClosureUse.php | 33 +- .../lib/PhpParser/Node/Expr/ConstFetch.php | 15 +- .../lib/PhpParser/Node/Expr/Empty_.php | 15 +- .../lib/PhpParser/Node/Expr/Error.php | 11 +- .../lib/PhpParser/Node/Expr/ErrorSuppress.php | 15 +- .../lib/PhpParser/Node/Expr/Eval_.php | 15 +- .../lib/PhpParser/Node/Expr/Exit_.php | 21 +- .../lib/PhpParser/Node/Expr/FuncCall.php | 21 +- .../lib/PhpParser/Node/Expr/Include_.php | 27 +- .../lib/PhpParser/Node/Expr/Instanceof_.php | 22 +- .../lib/PhpParser/Node/Expr/Isset_.php | 15 +- .../lib/PhpParser/Node/Expr/List_.php | 20 +- .../lib/PhpParser/Node/Expr/Match_.php | 15 +- .../lib/PhpParser/Node/Expr/MethodCall.php | 24 +- .../lib/PhpParser/Node/Expr/New_.php | 21 +- .../Node/Expr/NullsafeMethodCall.php | 24 +- .../Node/Expr/NullsafePropertyFetch.php | 20 +- .../lib/PhpParser/Node/Expr/PostDec.php | 15 +- .../lib/PhpParser/Node/Expr/PostInc.php | 15 +- .../lib/PhpParser/Node/Expr/PreDec.php | 13 +- .../lib/PhpParser/Node/Expr/PreInc.php | 15 +- .../lib/PhpParser/Node/Expr/Print_.php | 15 +- .../lib/PhpParser/Node/Expr/PropertyFetch.php | 20 +- .../lib/PhpParser/Node/Expr/ShellExec.php | 18 +- .../lib/PhpParser/Node/Expr/StaticCall.php | 25 +- .../Node/Expr/StaticPropertyFetch.php | 22 +- .../lib/PhpParser/Node/Expr/Ternary.php | 25 +- .../lib/PhpParser/Node/Expr/Throw_.php | 13 +- .../lib/PhpParser/Node/Expr/UnaryMinus.php | 15 +- .../lib/PhpParser/Node/Expr/UnaryPlus.php | 15 +- .../lib/PhpParser/Node/Expr/Variable.php | 13 +- .../lib/PhpParser/Node/Expr/YieldFrom.php | 15 +- .../lib/PhpParser/Node/Expr/Yield_.php | 21 +- .../lib/PhpParser/Node/FunctionLike.php | 13 +- .../lib/PhpParser/Node/Identifier.php | 38 +- .../PhpParser/Node/InterpolatedStringPart.php | 32 + .../lib/PhpParser/Node/IntersectionType.php | 15 +- .../lib/PhpParser/Node/MatchArm.php | 17 +- .../php-parser/lib/PhpParser/Node/Name.php | 140 +- .../PhpParser/Node/Name/FullyQualified.php | 17 +- .../lib/PhpParser/Node/Name/Relative.php | 17 +- .../lib/PhpParser/Node/NullableType.php | 21 +- .../php-parser/lib/PhpParser/Node/Param.php | 98 +- .../lib/PhpParser/Node/PropertyHook.php | 78 + .../lib/PhpParser/Node/PropertyItem.php | 37 + .../php-parser/lib/PhpParser/Node/Scalar.php | 3 +- .../lib/PhpParser/Node/Scalar/DNumber.php | 76 +- .../lib/PhpParser/Node/Scalar/Encapsed.php | 30 +- .../Node/Scalar/EncapsedStringPart.php | 29 +- .../lib/PhpParser/Node/Scalar/Float_.php | 78 + .../lib/PhpParser/Node/Scalar/Int_.php | 82 + .../Node/Scalar/InterpolatedString.php | 34 + .../lib/PhpParser/Node/Scalar/LNumber.php | 79 +- .../lib/PhpParser/Node/Scalar/MagicConst.php | 9 +- .../Node/Scalar/MagicConst/Class_.php | 9 +- .../PhpParser/Node/Scalar/MagicConst/Dir.php | 9 +- .../PhpParser/Node/Scalar/MagicConst/File.php | 9 +- .../Node/Scalar/MagicConst/Function_.php | 9 +- .../PhpParser/Node/Scalar/MagicConst/Line.php | 9 +- .../Node/Scalar/MagicConst/Method.php | 9 +- .../Node/Scalar/MagicConst/Namespace_.php | 9 +- .../Node/Scalar/MagicConst/Property.php | 15 + .../Node/Scalar/MagicConst/Trait_.php | 9 +- .../lib/PhpParser/Node/Scalar/String_.php | 56 +- .../lib/PhpParser/Node/StaticVar.php | 39 + .../php-parser/lib/PhpParser/Node/Stmt.php | 3 +- .../lib/PhpParser/Node/Stmt/Block.php | 29 + .../lib/PhpParser/Node/Stmt/Break_.php | 17 +- .../lib/PhpParser/Node/Stmt/Case_.php | 21 +- .../lib/PhpParser/Node/Stmt/Catch_.php | 23 +- .../lib/PhpParser/Node/Stmt/ClassConst.php | 59 +- .../lib/PhpParser/Node/Stmt/ClassLike.php | 26 +- .../lib/PhpParser/Node/Stmt/ClassMethod.php | 101 +- .../lib/PhpParser/Node/Stmt/Class_.php | 135 +- .../lib/PhpParser/Node/Stmt/Const_.php | 15 +- .../lib/PhpParser/Node/Stmt/Continue_.php | 17 +- .../PhpParser/Node/Stmt/DeclareDeclare.php | 33 +- .../lib/PhpParser/Node/Stmt/Declare_.php | 24 +- .../lib/PhpParser/Node/Stmt/Do_.php | 19 +- .../lib/PhpParser/Node/Stmt/Echo_.php | 15 +- .../lib/PhpParser/Node/Stmt/ElseIf_.php | 19 +- .../lib/PhpParser/Node/Stmt/Else_.php | 15 +- .../lib/PhpParser/Node/Stmt/EnumCase.php | 23 +- .../lib/PhpParser/Node/Stmt/Enum_.php | 30 +- .../lib/PhpParser/Node/Stmt/Expression.php | 15 +- .../lib/PhpParser/Node/Stmt/Finally_.php | 15 +- .../lib/PhpParser/Node/Stmt/For_.php | 34 +- .../lib/PhpParser/Node/Stmt/Foreach_.php | 37 +- .../lib/PhpParser/Node/Stmt/Function_.php | 52 +- .../lib/PhpParser/Node/Stmt/Global_.php | 15 +- .../lib/PhpParser/Node/Stmt/Goto_.php | 15 +- .../lib/PhpParser/Node/Stmt/GroupUse.php | 30 +- .../lib/PhpParser/Node/Stmt/HaltCompiler.php | 15 +- .../lib/PhpParser/Node/Stmt/If_.php | 33 +- .../lib/PhpParser/Node/Stmt/InlineHTML.php | 15 +- .../lib/PhpParser/Node/Stmt/Interface_.php | 23 +- .../lib/PhpParser/Node/Stmt/Label.php | 15 +- .../lib/PhpParser/Node/Stmt/Namespace_.php | 23 +- .../lib/PhpParser/Node/Stmt/Nop.php | 9 +- .../lib/PhpParser/Node/Stmt/Property.php | 92 +- .../PhpParser/Node/Stmt/PropertyProperty.php | 33 +- .../lib/PhpParser/Node/Stmt/Return_.php | 17 +- .../lib/PhpParser/Node/Stmt/StaticVar.php | 36 +- .../lib/PhpParser/Node/Stmt/Static_.php | 16 +- .../lib/PhpParser/Node/Stmt/Switch_.php | 19 +- .../lib/PhpParser/Node/Stmt/Throw_.php | 30 - .../lib/PhpParser/Node/Stmt/TraitUse.php | 17 +- .../Node/Stmt/TraitUseAdaptation.php | 7 +- .../Node/Stmt/TraitUseAdaptation/Alias.php | 25 +- .../Stmt/TraitUseAdaptation/Precedence.php | 19 +- .../lib/PhpParser/Node/Stmt/Trait_.php | 18 +- .../lib/PhpParser/Node/Stmt/TryCatch.php | 23 +- .../lib/PhpParser/Node/Stmt/Unset_.php | 15 +- .../lib/PhpParser/Node/Stmt/UseUse.php | 51 +- .../lib/PhpParser/Node/Stmt/Use_.php | 32 +- .../lib/PhpParser/Node/Stmt/While_.php | 19 +- .../lib/PhpParser/Node/UnionType.php | 15 +- .../php-parser/lib/PhpParser/Node/UseItem.php | 55 + .../lib/PhpParser/Node/VarLikeIdentifier.php | 5 +- .../PhpParser/Node/VariadicPlaceholder.php | 4 +- .../php-parser/lib/PhpParser/NodeAbstract.php | 43 +- .../php-parser/lib/PhpParser/NodeDumper.php | 261 +- .../php-parser/lib/PhpParser/NodeFinder.php | 47 +- .../lib/PhpParser/NodeTraverser.php | 155 +- .../lib/PhpParser/NodeTraverserInterface.php | 11 +- .../php-parser/lib/PhpParser/NodeVisitor.php | 66 +- .../PhpParser/NodeVisitor/CloningVisitor.php | 3 +- .../NodeVisitor/CommentAnnotatingVisitor.php | 82 + .../PhpParser/NodeVisitor/FindingVisitor.php | 9 +- .../NodeVisitor/FirstFindingVisitor.php | 13 +- .../PhpParser/NodeVisitor/NameResolver.php | 67 +- .../NodeVisitor/NodeConnectingVisitor.php | 5 +- .../NodeVisitor/ParentConnectingVisitor.php | 19 +- .../lib/PhpParser/NodeVisitorAbstract.php | 3 +- .../nikic/php-parser/lib/PhpParser/Parser.php | 12 +- .../lib/PhpParser/Parser/Multiple.php | 55 - .../php-parser/lib/PhpParser/Parser/Php5.php | 2682 ----------- .../php-parser/lib/PhpParser/Parser/Php7.php | 4150 ++++++++--------- .../php-parser/lib/PhpParser/Parser/Php8.php | 2786 +++++++++++ .../lib/PhpParser/Parser/Tokens.php | 148 - .../lib/PhpParser/ParserAbstract.php | 763 +-- .../lib/PhpParser/ParserFactory.php | 64 +- .../php-parser/lib/PhpParser/PhpVersion.php | 164 + .../lib/PhpParser/PrettyPrinter.php | 51 + .../lib/PhpParser/PrettyPrinter/Standard.php | 763 +-- .../lib/PhpParser/PrettyPrinterAbstract.php | 1070 +++-- .../nikic/php-parser/lib/PhpParser/Token.php | 18 + .../lib/PhpParser/compatibility_tokens.php | 68 + .../phar-io/manifest/.github/FUNDING.yml | 3 + .../phar-io/manifest/.github/workflows/ci.yml | 86 + .../manifest/.php-cs-fixer.dist.php} | 36 +- api/vendor/phar-io/manifest/CHANGELOG.md | 11 +- api/vendor/phar-io/manifest/README.md | 158 +- api/vendor/phar-io/manifest/composer.json | 1 + api/vendor/phar-io/manifest/composer.lock | 24 +- api/vendor/phar-io/manifest/manifest.xsd | 116 + .../manifest/src/ManifestDocumentMapper.php | 17 +- .../phar-io/manifest/src/ManifestLoader.php | 7 +- .../manifest/src/ManifestSerializer.php | 12 +- .../exceptions/ElementCollectionException.php | 7 +- .../manifest/src/exceptions/Exception.php | 7 +- .../InvalidApplicationNameException.php | 7 +- .../src/exceptions/InvalidEmailException.php | 7 +- .../src/exceptions/InvalidUrlException.php | 7 +- .../exceptions/ManifestDocumentException.php | 13 +- .../ManifestDocumentLoadingException.php | 6 +- .../ManifestDocumentMapperException.php | 13 +- .../exceptions/ManifestElementException.php | 13 +- .../exceptions/ManifestLoaderException.php | 9 + .../exceptions/NoEmailAddressException.php | 16 + .../manifest/src/values/Application.php | 3 +- .../manifest/src/values/ApplicationName.php | 10 +- .../phar-io/manifest/src/values/Author.php | 26 +- .../manifest/src/values/AuthorCollection.php | 12 +- .../src/values/AuthorCollectionIterator.php | 11 +- .../manifest/src/values/BundledComponent.php | 3 +- .../src/values/BundledComponentCollection.php | 12 +- .../BundledComponentCollectionIterator.php | 11 +- .../src/values/CopyrightInformation.php | 3 +- .../phar-io/manifest/src/values/Email.php | 8 +- .../phar-io/manifest/src/values/Extension.php | 3 +- .../phar-io/manifest/src/values/Library.php | 3 +- .../phar-io/manifest/src/values/License.php | 3 +- .../phar-io/manifest/src/values/Manifest.php | 5 +- .../src/values/PhpExtensionRequirement.php | 3 +- .../src/values/PhpVersionRequirement.php | 3 +- .../manifest/src/values/Requirement.php | 3 +- .../src/values/RequirementCollection.php | 12 +- .../values/RequirementCollectionIterator.php | 11 +- .../phar-io/manifest/src/values/Type.php | 3 +- .../phar-io/manifest/src/values/Url.php | 12 +- .../manifest/src/xml/AuthorElement.php | 7 +- .../src/xml/AuthorElementCollection.php | 3 +- .../manifest/src/xml/BundlesElement.php | 3 +- .../manifest/src/xml/ComponentElement.php | 3 +- .../src/xml/ComponentElementCollection.php | 3 +- .../manifest/src/xml/ContainsElement.php | 3 +- .../manifest/src/xml/CopyrightElement.php | 3 +- .../manifest/src/xml/ElementCollection.php | 17 +- .../phar-io/manifest/src/xml/ExtElement.php | 3 +- .../manifest/src/xml/ExtElementCollection.php | 3 +- .../manifest/src/xml/ExtensionElement.php | 3 +- .../manifest/src/xml/LicenseElement.php | 3 +- .../manifest/src/xml/ManifestDocument.php | 40 +- .../manifest/src/xml/ManifestElement.php | 14 +- .../phar-io/manifest/src/xml/PhpElement.php | 3 +- .../manifest/src/xml/RequiresElement.php | 3 +- .../PhpdocSingleLineVarFixer.php | 72 + .../manifest/tools/php-cs-fixer.d/header.txt | 6 + api/vendor/phpoption/phpoption/composer.json | 10 +- .../phpoption/src/PhpOption/Option.php | 4 +- .../{ChangeLog.md => ChangeLog-9.2.md} | 61 + .../build/scripts/extract-release-notes.php | 47 + .../phpunit/php-code-coverage/composer.json | 29 +- .../php-code-coverage/src/CodeCoverage.php | 39 +- .../Exception/Xdebug2NotEnabledException.php | 2 +- .../Exception/Xdebug3NotEnabledException.php | 2 +- .../src/Node/AbstractNode.php | 2 +- .../php-code-coverage/src/Report/Clover.php | 5 +- .../src/Report/Cobertura.php | 9 +- .../php-code-coverage/src/Report/Crap4j.php | 5 +- .../src/Report/Html/Facade.php | 2 +- .../src/Report/Html/Renderer/Dashboard.php | 2 +- .../src/Report/Html/Renderer/File.php | 40 +- .../Html/Renderer/Template/css/style.css | 30 +- .../php-code-coverage/src/Report/PHP.php | 7 +- .../src/Report/Xml/Tests.php | 1 - .../src/StaticAnalysis/CacheWarmer.php | 4 +- .../StaticAnalysis/CachingFileAnalyser.php | 41 +- .../StaticAnalysis/CodeUnitFindingVisitor.php | 55 +- .../ExecutableLinesFindingVisitor.php | 26 +- .../StaticAnalysis/ParsingFileAnalyser.php | 6 +- .../phpunit/php-code-coverage/src/Version.php | 2 +- api/vendor/phpunit/phpunit/.phpstorm.meta.php | 33 - api/vendor/phpunit/phpunit/ChangeLog-8.5.md | 297 -- api/vendor/phpunit/phpunit/ChangeLog-9.6.md | 173 + api/vendor/phpunit/phpunit/DEPRECATIONS.md | 89 + api/vendor/phpunit/phpunit/LICENSE | 2 +- api/vendor/phpunit/phpunit/README.md | 9 +- api/vendor/phpunit/phpunit/SECURITY.md | 30 +- api/vendor/phpunit/phpunit/composer.json | 41 +- api/vendor/phpunit/phpunit/composer.lock | 1666 +++++++ api/vendor/phpunit/phpunit/phpunit | 19 +- api/vendor/phpunit/phpunit/phpunit.xsd | 2 +- api/vendor/phpunit/phpunit/schema/8.5.xsd | 8 +- api/vendor/phpunit/phpunit/schema/9.0.xsd | 315 ++ api/vendor/phpunit/phpunit/schema/9.1.xsd | 317 ++ api/vendor/phpunit/phpunit/schema/9.2.xsd | 8 +- api/vendor/phpunit/phpunit/schema/9.3.xsd | 327 ++ api/vendor/phpunit/phpunit/schema/9.4.xsd | 328 ++ api/vendor/phpunit/phpunit/schema/9.5.xsd | 330 ++ .../phpunit/phpunit/src/Framework/Assert.php | 315 +- .../src/Framework/Assert/Functions.php | 309 +- .../Constraint/Cardinality/Count.php | 6 +- .../Constraint/Cardinality/GreaterThan.php | 4 +- .../Constraint/Cardinality/IsEmpty.php | 2 +- .../Constraint/Cardinality/LessThan.php | 4 +- .../src/Framework/Constraint/Constraint.php | 18 +- .../Framework/Constraint/Equality/IsEqual.php | 17 +- .../Equality/IsEqualCanonicalizing.php | 13 +- .../Equality/IsEqualIgnoringCase.php | 13 +- .../Constraint/Equality/IsEqualWithDelta.php | 13 +- .../Constraint/Exception/Exception.php | 6 +- .../Constraint/Exception/ExceptionCode.php | 5 +- .../Constraint/Exception/ExceptionMessage.php | 4 +- .../ExceptionMessageRegularExpression.php | 4 +- .../Constraint/Filesystem/DirectoryExists.php | 2 +- .../Constraint/Filesystem/FileExists.php | 2 +- .../Constraint/Filesystem/IsReadable.php | 2 +- .../Constraint/Filesystem/IsWritable.php | 2 +- .../src/Framework/Constraint/IsIdentical.php | 11 +- .../src/Framework/Constraint/JsonMatches.php | 17 +- .../Constraint/Object/ClassHasAttribute.php | 8 +- .../Object/ClassHasStaticAttribute.php | 6 +- .../Constraint/Object/ObjectEquals.php | 18 +- .../Constraint/Object/ObjectHasAttribute.php | 2 + .../Constraint/Object/ObjectHasProperty.php | 84 + .../Constraint/Operator/LogicalNot.php | 21 +- .../Constraint/Operator/LogicalXor.php | 2 +- .../Constraint/Operator/UnaryOperator.php | 5 +- .../Framework/Constraint/String/IsJson.php | 7 +- .../Constraint/String/RegularExpression.php | 2 +- .../Constraint/String/StringContains.php | 2 +- .../String/StringMatchesFormatDescription.php | 8 +- .../Constraint/String/StringStartsWith.php | 3 +- .../Constraint/Traversable/ArrayHasKey.php | 5 +- .../Traversable/TraversableContains.php | 7 +- .../Traversable/TraversableContainsOnly.php | 8 +- .../Constraint/Type/IsInstanceOf.php | 7 +- .../src/Framework/Constraint/Type/IsType.php | 11 +- .../src/Framework/DataProviderTestSuite.php | 3 +- .../phpunit/src/Framework/Error/Error.php | 2 +- .../phpunit/src/Framework/ErrorTestCase.php | 6 +- .../ActualValueIsNotAnObjectException.php | 2 +- ...hodDoesNotAcceptParameterTypeException.php | 4 +- ...dDoesNotDeclareBoolReturnTypeException.php | 4 +- ...NotDeclareExactlyOneParameterException.php | 4 +- ...odDoesNotDeclareParameterTypeException.php | 4 +- .../ComparisonMethodDoesNotExistException.php | 4 +- .../src/Framework/Exception/Exception.php | 2 +- .../Exception/ExpectationFailedException.php | 2 +- .../Exception/InvalidArgumentException.php | 6 +- .../src/Framework/ExceptionWrapper.php | 2 +- .../Framework/ExecutionOrderDependency.php | 8 +- .../src/Framework/IncompleteTestCase.php | 10 +- .../src/Framework/MockObject/Api/Api.php | 4 +- .../src/Framework/MockObject/Api/Method.php | 2 +- .../MockObject/Builder/InvocationMocker.php | 7 +- .../MockObject/Builder/InvocationStubber.php | 16 +- .../MockObject/Builder/MethodNameMatch.php | 4 +- .../CannotUseAddMethodsException.php | 4 +- .../CannotUseOnlyMethodsException.php | 4 +- .../Exception/ClassAlreadyExistsException.php | 4 +- .../Exception/ClassIsFinalException.php | 4 +- .../Exception/ClassIsReadonlyException.php | 4 +- .../Exception/DuplicateMethodException.php | 4 +- .../IncompatibleReturnValueException.php | 4 +- .../Exception/InvalidMethodNameException.php | 4 +- .../MatchBuilderNotFoundException.php | 4 +- .../MatcherAlreadyRegisteredException.php | 4 +- .../MethodCannotBeConfiguredException.php | 4 +- .../ReturnValueNotConfiguredException.php | 4 +- .../SoapExtensionNotAvailableException.php | 2 +- .../Exception/UnknownClassException.php | 4 +- .../Exception/UnknownTraitException.php | 4 +- .../Exception/UnknownTypeException.php | 4 +- .../src/Framework/MockObject/Generator.php | 111 +- .../src/Framework/MockObject/Invocation.php | 14 +- .../MockObject/InvocationHandler.php | 2 +- .../src/Framework/MockObject/Matcher.php | 25 +- .../MockObject/MethodNameConstraint.php | 2 +- .../src/Framework/MockObject/MockBuilder.php | 22 +- .../src/Framework/MockObject/MockClass.php | 2 +- .../src/Framework/MockObject/MockMethod.php | 22 +- .../MockObject/Rule/ConsecutiveParameters.php | 24 +- .../MockObject/Rule/InvokedAtIndex.php | 4 +- .../MockObject/Rule/InvokedAtLeastCount.php | 2 +- .../MockObject/Rule/InvokedAtLeastOnce.php | 2 +- .../MockObject/Rule/InvokedAtMostCount.php | 2 +- .../MockObject/Rule/InvokedCount.php | 6 +- .../Framework/MockObject/Rule/MethodName.php | 5 +- .../Framework/MockObject/Rule/Parameters.php | 13 +- .../MockObject/Stub/ConsecutiveCalls.php | 2 +- .../Framework/MockObject/Stub/Exception.php | 2 +- .../MockObject/Stub/ReturnCallback.php | 2 +- .../MockObject/Stub/ReturnReference.php | 2 +- .../Framework/MockObject/Stub/ReturnStub.php | 2 +- .../phpunit/src/Framework/SkippedTestCase.php | 10 +- .../phpunit/phpunit/src/Framework/Test.php | 2 +- .../phpunit/src/Framework/TestBuilder.php | 32 +- .../phpunit/src/Framework/TestCase.php | 215 +- .../phpunit/src/Framework/TestFailure.php | 2 +- .../phpunit/src/Framework/TestResult.php | 74 +- .../phpunit/src/Framework/TestSuite.php | 69 +- .../src/Framework/TestSuiteIterator.php | 2 +- .../phpunit/src/Framework/WarningTestCase.php | 6 +- .../phpunit/src/Runner/BaseTestRunner.php | 6 +- .../src/Runner/DefaultTestResultCache.php | 10 +- .../src/Runner/Extension/ExtensionHandler.php | 14 +- .../src/Runner/Extension/PharLoader.php | 23 +- .../phpunit/src/Runner/Filter/Factory.php | 6 +- .../src/Runner/Filter/GroupFilterIterator.php | 2 +- .../src/Runner/Filter/NameFilterIterator.php | 16 +- .../phpunit/src/Runner/PhptTestCase.php | 34 +- .../src/Runner/StandardTestSuiteLoader.php | 28 +- .../phpunit/src/Runner/TestSuiteSorter.php | 27 +- .../phpunit/phpunit/src/Runner/Version.php | 13 +- .../src/TextUI/CliArguments/Builder.php | 7 +- .../phpunit/phpunit/src/TextUI/Command.php | 142 +- .../src/TextUI/DefaultResultPrinter.php | 64 +- .../TestDirectoryNotFoundException.php | 4 +- .../Exception/TestFileNotFoundException.php | 4 +- .../phpunit/phpunit/src/TextUI/Help.php | 262 +- .../phpunit/phpunit/src/TextUI/TestRunner.php | 138 +- .../phpunit/src/TextUI/TestSuiteMapper.php | 4 +- .../CodeCoverage/CodeCoverage.php | 16 +- .../CodeCoverage/FilterMapper.php | 4 +- .../src/TextUI/XmlConfiguration/Generator.php | 2 +- .../src/TextUI/XmlConfiguration/Loader.php | 172 +- .../Migration/MigrationBuilder.php | 13 +- .../Migration/MigrationBuilderException.php | 3 +- .../Migration/MigrationException.php | 3 +- .../Migrations/IntroduceCoverageElement.php | 2 +- .../Migrations/LogToReportMigration.php | 2 +- .../MoveWhitelistExcludesToCoverage.php | 2 +- ...hp => MoveWhitelistIncludesToCoverage.php} | 8 +- .../Migrations/UpdateSchemaLocationTo93.php | 2 +- .../XmlConfiguration/Migration/Migrator.php | 4 +- .../XmlConfiguration/PHP/PhpHandler.php | 2 +- .../phpunit/src/Util/Annotation/DocBlock.php | 45 +- .../phpunit/src/Util/Annotation/Registry.php | 4 +- api/vendor/phpunit/phpunit/src/Util/Color.php | 2 +- .../phpunit/phpunit/src/Util/ErrorHandler.php | 13 +- .../phpunit/phpunit/src/Util/ExcludeList.php | 8 +- .../phpunit/phpunit/src/Util/FileLoader.php | 2 +- .../phpunit/phpunit/src/Util/Filesystem.php | 2 +- .../phpunit/phpunit/src/Util/Filter.php | 4 +- .../phpunit/phpunit/src/Util/GlobalState.php | 92 +- .../src/Util/InvalidDataSetException.php | 3 +- api/vendor/phpunit/phpunit/src/Util/Json.php | 4 +- .../phpunit/phpunit/src/Util/Log/JUnit.php | 30 +- .../phpunit/phpunit/src/Util/Log/TeamCity.php | 13 +- .../src/Util/PHP/AbstractPhpProcess.php | 59 +- .../src/Util/PHP/DefaultPhpProcess.php | 10 +- .../src/Util/PHP/Template/TestCaseClass.tpl | 20 +- .../src/Util/PHP/Template/TestCaseMethod.tpl | 18 +- .../src/Util/PHP/WindowsPhpProcess.php | 4 +- .../phpunit/phpunit/src/Util/Printer.php | 8 +- .../phpunit/src/Util/RegularExpression.php | 2 +- api/vendor/phpunit/phpunit/src/Util/Test.php | 59 +- .../src/Util/TestDox/CliTestDoxPrinter.php | 17 +- .../src/Util/TestDox/HtmlResultPrinter.php | 55 +- .../src/Util/TestDox/NamePrettifier.php | 11 +- .../src/Util/TestDox/ResultPrinter.php | 6 +- .../src/Util/TestDox/TestDoxPrinter.php | 30 +- .../src/Util/TestDox/XmlResultPrinter.php | 11 +- .../phpunit/src/Util/TextTestListRenderer.php | 7 +- .../src/Util/VersionComparisonOperator.php | 4 +- .../src/Util/XdebugFilterScriptGenerator.php | 6 +- api/vendor/phpunit/phpunit/src/Util/Xml.php | 6 +- .../phpunit/phpunit/src/Util/Xml/Loader.php | 8 +- .../src/Util/Xml/SchemaDetectionResult.php | 3 + .../phpunit/src/Util/Xml/SchemaDetector.php | 6 +- .../phpunit/src/Util/Xml/SchemaFinder.php | 31 +- .../Xml/SuccessfulSchemaDetectionResult.php | 11 +- .../phpunit/src/Util/Xml/ValidationResult.php | 1 + .../phpunit/src/Util/XmlTestListRenderer.php | 7 +- api/vendor/psr/clock/CHANGELOG.md | 11 + .../polyfill-php72 => psr/clock}/LICENSE | 10 +- api/vendor/psr/clock/README.md | 61 + api/vendor/psr/clock/composer.json | 21 + api/vendor/psr/clock/src/ClockInterface.php | 13 + api/vendor/ramsey/collection/composer.json | 3 +- .../ramsey/collection/src/AbstractArray.php | 55 +- .../collection/src/AbstractCollection.php | 206 +- .../ramsey/collection/src/AbstractSet.php | 10 +- .../ramsey/collection/src/ArrayInterface.php | 4 +- .../ramsey/collection/src/Collection.php | 13 +- .../collection/src/CollectionInterface.php | 113 +- .../collection/src/DoubleEndedQueue.php | 127 +- .../src/DoubleEndedQueueInterface.php | 36 +- ...rException.php => CollectionException.php} | 7 +- .../Exception/CollectionMismatchException.php | 2 +- .../Exception/InvalidArgumentException.php | 4 +- ...eption.php => InvalidPropertyOrMethod.php} | 6 +- .../src/Exception/NoSuchElementException.php | 2 +- .../src/Exception/OutOfBoundsException.php | 4 +- .../UnsupportedOperationException.php | 2 +- .../ramsey/collection/src/Map/AbstractMap.php | 106 +- .../collection/src/Map/AbstractTypedMap.php | 18 +- .../src/Map/AssociativeArrayMap.php | 3 +- .../collection/src/Map/MapInterface.php | 57 +- .../collection/src/Map/NamedParameterMap.php | 21 +- .../ramsey/collection/src/Map/TypedMap.php | 30 +- .../collection/src/Map/TypedMapInterface.php | 3 +- api/vendor/ramsey/collection/src/Queue.php | 97 +- .../ramsey/collection/src/QueueInterface.php | 18 +- api/vendor/ramsey/collection/src/Set.php | 14 +- api/vendor/ramsey/collection/src/Sort.php | 31 + .../ramsey/collection/src/Tool/TypeTrait.php | 49 +- .../src/Tool/ValueExtractorTrait.php | 58 +- .../src/Tool/ValueToStringTrait.php | 15 +- api/vendor/ramsey/uuid/composer.json | 2 +- .../uuid/src/Generator/UnixTimeGenerator.php | 2 +- .../uuid/src/Math/BrickMathCalculator.php | 6 +- .../ramsey/uuid/src/Nonstandard/UuidV6.php | 4 +- api/vendor/ramsey/uuid/src/Uuid.php | 22 +- api/vendor/ramsey/uuid/src/UuidInterface.php | 6 +- api/vendor/ramsey/uuid/src/functions.php | 2 +- api/vendor/sebastian/cli-parser/ChangeLog.md | 8 + .../sebastian/cli-parser/src/Parser.php | 2 +- api/vendor/sebastian/complexity/ChangeLog.md | 7 + api/vendor/sebastian/complexity/composer.json | 3 +- .../sebastian/complexity/src/Calculator.php | 9 +- api/vendor/sebastian/diff/ChangeLog.md | 15 + api/vendor/sebastian/diff/src/Differ.php | 4 +- .../src/Exception/ConfigurationException.php | 2 +- ...ientLongestCommonSubsequenceCalculator.php | 7 +- ...ientLongestCommonSubsequenceCalculator.php | 24 +- api/vendor/sebastian/exporter/ChangeLog.md | 7 + .../sebastian/exporter/src/Exporter.php | 2 +- .../sebastian/global-state/ChangeLog.md | 14 + .../sebastian/global-state/src/Restorer.php | 4 +- .../sebastian/global-state/src/Snapshot.php | 2 +- .../sebastian/lines-of-code/ChangeLog.md | 7 + .../sebastian/lines-of-code/composer.json | 2 +- .../sebastian/lines-of-code/src/Counter.php | 9 +- .../resource-operations/.gitattributes | 7 - .../sebastian/resource-operations/.gitignore | 6 - .../resource-operations/ChangeLog.md | 5 + .../sebastian/resource-operations/SECURITY.md | 30 + .../resource-operations/composer.json | 5 +- api/vendor/symfony/console/Application.php | 12 +- .../console/CI/GithubActionReporter.php | 8 +- .../symfony/console/Command/Command.php | 16 +- .../console/Command/CompleteCommand.php | 4 +- .../console/Command/DumpCompletionCommand.php | 18 +- .../symfony/console/Command/LazyCommand.php | 6 +- .../symfony/console/Command/LockableTrait.php | 2 +- .../console/Completion/CompletionInput.php | 2 +- .../Descriptor/ApplicationDescription.php | 2 +- .../console/Descriptor/XmlDescriptor.php | 2 +- .../console/Event/ConsoleCommandEvent.php | 5 +- .../console/Event/ConsoleErrorEvent.php | 2 +- .../console/EventListener/ErrorListener.php | 2 +- .../Exception/CommandNotFoundException.php | 2 +- .../Formatter/NullOutputFormatterStyle.php | 4 +- .../console/Formatter/OutputFormatter.php | 11 +- .../Formatter/OutputFormatterStyle.php | 9 +- .../OutputFormatterStyleInterface.php | 4 +- .../Formatter/OutputFormatterStyleStack.php | 4 +- api/vendor/symfony/console/Helper/Dumper.php | 2 +- api/vendor/symfony/console/Helper/Helper.php | 4 +- .../console/Helper/HelperInterface.php | 2 +- .../symfony/console/Helper/HelperSet.php | 4 +- .../symfony/console/Helper/ProcessHelper.php | 6 +- .../symfony/console/Helper/ProgressBar.php | 9 +- .../console/Helper/ProgressIndicator.php | 4 +- .../symfony/console/Helper/QuestionHelper.php | 27 +- api/vendor/symfony/console/Helper/Table.php | 16 +- .../symfony/console/Helper/TableStyle.php | 6 +- .../symfony/console/Input/ArgvInput.php | 2 +- .../symfony/console/Input/ArrayInput.php | 2 +- api/vendor/symfony/console/Input/Input.php | 2 +- .../symfony/console/Input/InputArgument.php | 4 +- .../symfony/console/Input/InputOption.php | 8 +- api/vendor/symfony/console/LICENSE | 2 +- .../symfony/console/Output/ConsoleOutput.php | 2 +- .../console/Output/ConsoleSectionOutput.php | 2 +- api/vendor/symfony/console/Output/Output.php | 2 +- .../symfony/console/Output/StreamOutput.php | 34 +- .../console/Output/TrimmedBufferOutput.php | 2 +- .../symfony/console/Question/Question.php | 4 +- .../symfony/console/Resources/completion.bash | 2 +- .../console/SingleCommandApplication.php | 2 +- .../symfony/console/Style/StyleInterface.php | 4 +- .../symfony/console/Style/SymfonyStyle.php | 10 +- api/vendor/symfony/console/Terminal.php | 20 +- .../symfony/console/Tester/TesterTrait.php | 8 +- api/vendor/symfony/console/composer.json | 2 +- .../symfony/deprecation-contracts/.gitignore | 3 - .../symfony/deprecation-contracts/LICENSE | 2 +- .../symfony/deprecation-contracts/README.md | 2 +- .../deprecation-contracts/composer.json | 4 +- api/vendor/symfony/error-handler/Debug.php | 1 - .../error-handler/DebugClassLoader.php | 22 +- .../error-handler/Error/FatalError.php | 4 +- .../ClassNotFoundErrorEnhancer.php | 6 +- .../symfony/error-handler/ErrorHandler.php | 39 +- .../ErrorRenderer/HtmlErrorRenderer.php | 34 +- .../ErrorRenderer/SerializerErrorRenderer.php | 20 +- .../Exception/FlattenException.php | 6 +- api/vendor/symfony/error-handler/LICENSE | 2 +- .../Resources/assets/css/exception.css | 2 +- .../Resources/assets/js/exception.js | 494 +- .../Resources/views/error.html.php | 2 +- .../event-dispatcher-contracts/.gitignore | 3 - .../event-dispatcher-contracts/Event.php | 3 - .../EventDispatcherInterface.php | 8 +- .../event-dispatcher-contracts/LICENSE | 2 +- .../event-dispatcher-contracts/README.md | 2 +- .../event-dispatcher-contracts/composer.json | 7 +- .../Debug/TraceableEventDispatcher.php | 109 +- .../Debug/WrappedListener.php | 51 +- .../RegisterListenersPass.php | 19 +- .../event-dispatcher/EventDispatcher.php | 50 +- .../EventDispatcherInterface.php | 13 +- .../symfony/event-dispatcher/GenericEvent.php | 2 +- .../ImmutableEventDispatcher.php | 28 +- api/vendor/symfony/event-dispatcher/LICENSE | 2 +- .../symfony/event-dispatcher/composer.json | 25 +- .../symfony/finder/Comparator/Comparator.php | 2 +- .../finder/Comparator/NumberComparator.php | 2 +- api/vendor/symfony/finder/Finder.php | 4 +- .../ExcludeDirectoryFilterIterator.php | 1 + .../Iterator/RecursiveDirectoryIterator.php | 40 +- api/vendor/symfony/finder/LICENSE | 2 +- .../http-foundation/BinaryFileResponse.php | 35 +- api/vendor/symfony/http-foundation/Cookie.php | 6 +- .../Exception/SessionNotFoundException.php | 2 +- .../symfony/http-foundation/File/File.php | 4 +- .../http-foundation/File/UploadedFile.php | 8 +- .../symfony/http-foundation/HeaderBag.php | 6 +- .../symfony/http-foundation/HeaderUtils.php | 67 +- .../symfony/http-foundation/InputBag.php | 2 +- .../symfony/http-foundation/IpUtils.php | 4 +- .../symfony/http-foundation/JsonResponse.php | 2 +- api/vendor/symfony/http-foundation/LICENSE | 2 +- .../symfony/http-foundation/ParameterBag.php | 2 +- .../http-foundation/RedirectResponse.php | 1 + .../symfony/http-foundation/Request.php | 76 +- .../http-foundation/RequestMatcher.php | 4 +- .../symfony/http-foundation/Response.php | 22 +- .../http-foundation/ResponseHeaderBag.php | 6 +- .../symfony/http-foundation/ServerBag.php | 4 +- .../http-foundation/Session/Session.php | 6 +- .../Session/SessionFactory.php | 2 +- .../Session/SessionInterface.php | 22 +- .../Handler/NativeFileSessionHandler.php | 16 +- .../Storage/Handler/PdoSessionHandler.php | 16 +- .../Storage/Handler/SessionHandlerFactory.php | 18 +- .../Session/Storage/MetadataBag.php | 12 +- .../Storage/MockArraySessionStorage.php | 11 +- .../Storage/MockFileSessionStorage.php | 4 +- .../Storage/MockFileSessionStorageFactory.php | 2 +- .../Session/Storage/NativeSessionStorage.php | 15 +- .../Storage/NativeSessionStorageFactory.php | 2 +- .../Storage/PhpBridgeSessionStorage.php | 2 +- .../PhpBridgeSessionStorageFactory.php | 2 +- .../Storage/SessionStorageInterface.php | 12 +- .../http-foundation/StreamedResponse.php | 6 +- .../Constraint/ResponseCookieValueSame.php | 2 +- .../Test/Constraint/ResponseHasCookie.php | 2 +- .../symfony/http-foundation/UrlHelper.php | 38 +- .../symfony/http-foundation/composer.json | 2 +- .../symfony/mime/Crypto/SMimeEncrypter.php | 2 +- .../symfony/mime/Crypto/SMimeSigner.php | 2 +- api/vendor/symfony/mime/Email.php | 12 +- .../symfony/mime/FileinfoMimeTypeGuesser.php | 4 +- .../symfony/mime/Header/AbstractHeader.php | 16 +- api/vendor/symfony/mime/Header/Headers.php | 2 +- .../symfony/mime/Header/MailboxListHeader.php | 8 +- .../mime/Header/ParameterizedHeader.php | 2 +- api/vendor/symfony/mime/LICENSE | 2 +- api/vendor/symfony/mime/Message.php | 20 +- api/vendor/symfony/mime/Part/DataPart.php | 4 +- .../mime/Part/Multipart/FormDataPart.php | 2 +- api/vendor/symfony/mime/Part/TextPart.php | 2 +- api/vendor/symfony/mime/RawMessage.php | 3 + .../Test/Constraint/EmailAttachmentCount.php | 2 +- api/vendor/symfony/mime/composer.json | 5 +- api/vendor/symfony/polyfill-ctype/LICENSE | 2 +- .../symfony/polyfill-ctype/composer.json | 5 +- .../symfony/polyfill-intl-grapheme/LICENSE | 2 +- .../polyfill-intl-grapheme/composer.json | 5 +- api/vendor/symfony/polyfill-intl-idn/Idn.php | 52 +- api/vendor/symfony/polyfill-intl-idn/LICENSE | 2 +- .../Resources/unidata/DisallowedRanges.php | 9 + .../Resources/unidata/Regex.php | 9 + .../symfony/polyfill-intl-idn/composer.json | 8 +- .../symfony/polyfill-intl-normalizer/LICENSE | 2 +- .../polyfill-intl-normalizer/composer.json | 5 +- api/vendor/symfony/polyfill-mbstring/LICENSE | 2 +- .../symfony/polyfill-mbstring/Mbstring.php | 185 +- .../Resources/unidata/caseFolding.php | 119 + .../symfony/polyfill-mbstring/bootstrap.php | 25 + .../symfony/polyfill-mbstring/bootstrap80.php | 26 +- .../symfony/polyfill-mbstring/composer.json | 5 +- api/vendor/symfony/polyfill-php72/Php72.php | 217 - api/vendor/symfony/polyfill-php72/README.md | 35 - .../symfony/polyfill-php72/bootstrap.php | 57 - .../symfony/polyfill-php72/composer.json | 35 - api/vendor/symfony/polyfill-php73/LICENSE | 2 +- .../symfony/polyfill-php73/composer.json | 5 +- api/vendor/symfony/polyfill-php80/LICENSE | 2 +- .../symfony/polyfill-php80/composer.json | 5 +- api/vendor/symfony/polyfill-php81/Php81.php | 37 - api/vendor/symfony/polyfill-php81/README.md | 17 - .../Resources/stubs/ReturnTypeWillChange.php | 20 - .../symfony/polyfill-php81/bootstrap.php | 28 - .../symfony/polyfill-php81/composer.json | 36 - .../symfony/process/ExecutableFinder.php | 61 +- api/vendor/symfony/process/InputStream.php | 2 +- api/vendor/symfony/process/LICENSE | 2 +- .../symfony/process/PhpExecutableFinder.php | 13 +- api/vendor/symfony/process/PhpProcess.php | 6 +- .../symfony/process/Pipes/WindowsPipes.php | 2 +- api/vendor/symfony/process/Process.php | 58 +- .../symfony/service-contracts/.gitignore | 3 - .../Attribute/SubscribedService.php | 24 +- api/vendor/symfony/service-contracts/LICENSE | 2 +- .../symfony/service-contracts/README.md | 2 +- .../service-contracts/ResetInterface.php | 3 + .../ServiceCollectionInterface.php | 26 + .../service-contracts/ServiceLocatorTrait.php | 27 +- .../ServiceMethodsSubscriberTrait.php | 80 + .../ServiceProviderInterface.php | 11 +- .../ServiceSubscriberInterface.php | 15 +- .../ServiceSubscriberTrait.php | 105 +- .../Test/ServiceLocatorTest.php | 80 +- .../Test/ServiceLocatorTestCase.php | 96 + .../symfony/service-contracts/composer.json | 16 +- api/vendor/symfony/string/AbstractString.php | 46 +- .../symfony/string/AbstractUnicodeString.php | 56 +- api/vendor/symfony/string/ByteString.php | 36 +- api/vendor/symfony/string/CHANGELOG.md | 5 + api/vendor/symfony/string/CodePointString.php | 8 +- .../string/Inflector/EnglishInflector.php | 143 +- .../string/Inflector/FrenchInflector.php | 6 - api/vendor/symfony/string/LICENSE | 2 +- api/vendor/symfony/string/LazyString.php | 14 +- .../Resources/data/wcswidth_table_wide.php | 60 +- .../Resources/data/wcswidth_table_zero.php | 52 +- .../symfony/string/Resources/functions.php | 2 +- .../symfony/string/Slugger/AsciiSlugger.php | 58 +- .../string/Slugger/SluggerInterface.php | 2 +- api/vendor/symfony/string/UnicodeString.php | 59 +- api/vendor/symfony/string/composer.json | 13 +- .../symfony/translation-contracts/.gitignore | 3 - .../symfony/translation-contracts/LICENSE | 2 +- .../LocaleAwareInterface.php | 2 + .../symfony/translation-contracts/README.md | 2 +- .../Test/TranslatorTest.php | 29 +- .../TranslatableInterface.php | 2 +- .../TranslatorInterface.php | 2 +- .../translation-contracts/TranslatorTrait.php | 213 +- .../translation-contracts/composer.json | 12 +- api/vendor/symfony/translation/CHANGELOG.md | 29 + .../Catalogue/AbstractOperation.php | 38 +- .../translation/Catalogue/MergeOperation.php | 14 +- .../translation/Catalogue/TargetOperation.php | 14 +- .../CatalogueMetadataAwareInterface.php | 48 + .../Command/TranslationPullCommand.php | 23 +- .../Command/TranslationPushCommand.php | 14 +- .../translation/Command/XliffLintCommand.php | 71 +- .../TranslationDataCollector.php | 30 +- .../translation/DataCollectorTranslator.php | 37 +- .../DataCollectorTranslatorPass.php | 36 + .../LoggingTranslatorPass.php | 59 + .../TranslationDumperPass.php | 3 + .../TranslationExtractorPass.php | 3 + .../DependencyInjection/TranslatorPass.php | 20 + .../TranslatorPathsPass.php | 34 +- .../translation/Dumper/CsvFileDumper.php | 10 +- .../translation/Dumper/DumperInterface.php | 2 + .../symfony/translation/Dumper/FileDumper.php | 4 +- .../translation/Dumper/IcuResFileDumper.php | 11 +- .../translation/Dumper/IniFileDumper.php | 6 - .../translation/Dumper/JsonFileDumper.php | 6 - .../translation/Dumper/MoFileDumper.php | 8 +- .../translation/Dumper/PhpFileDumper.php | 6 - .../translation/Dumper/PoFileDumper.php | 8 +- .../translation/Dumper/QtFileDumper.php | 6 - .../translation/Dumper/XliffFileDumper.php | 38 +- .../translation/Dumper/YamlFileDumper.php | 6 - .../Exception/IncompleteDsnException.php | 2 +- .../MissingRequiredOptionException.php | 2 +- .../Exception/ProviderException.php | 4 +- .../Exception/UnsupportedSchemeException.php | 8 +- .../translation/Extractor/ChainExtractor.php | 6 +- .../Extractor/ExtractorInterface.php | 4 + .../translation/Extractor/PhpAstExtractor.php | 85 + .../translation/Extractor/PhpExtractor.php | 19 +- .../Extractor/PhpStringTokenParser.php | 7 +- .../Extractor/Visitor/AbstractVisitor.php | 135 + .../Extractor/Visitor/ConstraintVisitor.php | 112 + .../Extractor/Visitor/TransMethodVisitor.php | 65 + .../Visitor/TranslatableMessageVisitor.php | 65 + .../translation/Formatter/IntlFormatter.php | 9 +- .../Formatter/MessageFormatter.php | 18 +- api/vendor/symfony/translation/LICENSE | 2 +- .../translation/Loader/ArrayLoader.php | 9 +- .../translation/Loader/CsvFileLoader.php | 11 +- .../symfony/translation/Loader/FileLoader.php | 7 +- .../translation/Loader/IcuDatFileLoader.php | 5 +- .../translation/Loader/IcuResFileLoader.php | 9 +- .../translation/Loader/IniFileLoader.php | 3 - .../translation/Loader/JsonFileLoader.php | 25 +- .../translation/Loader/MoFileLoader.php | 2 - .../translation/Loader/PhpFileLoader.php | 11 +- .../translation/Loader/PoFileLoader.php | 14 +- .../translation/Loader/QtFileLoader.php | 4 - .../translation/Loader/XliffFileLoader.php | 33 +- .../translation/Loader/YamlFileLoader.php | 7 +- .../symfony/translation/LocaleSwitcher.php | 83 + .../symfony/translation/LoggingTranslator.php | 30 +- .../symfony/translation/MessageCatalogue.php | 107 +- .../translation/MessageCatalogueInterface.php | 16 +- .../translation/MetadataAwareInterface.php | 6 +- .../Provider/AbstractProviderFactory.php | 12 +- .../symfony/translation/Provider/Dsn.php | 34 +- .../Provider/FilteringProvider.php | 5 +- .../Provider/ProviderInterface.php | 4 +- .../TranslationProviderCollection.php | 2 +- .../PseudoLocalizationTranslator.php | 9 +- api/vendor/symfony/translation/README.md | 12 +- .../translation/Reader/TranslationReader.php | 4 +- .../Reader/TranslationReaderInterface.php | 2 + .../Resources/bin/translation-status.php | 18 +- .../translation/Resources/data/parents.json | 1 + .../translation/Resources/functions.php | 2 +- ...ct.xsd => xliff-core-1.2-transitional.xsd} | 84 +- .../Test/ProviderFactoryTestCase.php | 32 +- .../translation/Test/ProviderTestCase.php | 24 +- .../translation/TranslatableMessage.php | 8 +- api/vendor/symfony/translation/Translator.php | 63 +- .../symfony/translation/TranslatorBag.php | 10 +- .../translation/TranslatorBagInterface.php | 2 +- .../translation/Util/ArrayConverter.php | 51 +- .../symfony/translation/Util/XliffUtils.php | 2 +- .../translation/Writer/TranslationWriter.php | 4 + .../Writer/TranslationWriterInterface.php | 2 + api/vendor/symfony/translation/composer.json | 32 +- .../symfony/var-dumper/Caster/Caster.php | 4 +- .../symfony/var-dumper/Caster/ClassStub.php | 2 +- .../symfony/var-dumper/Caster/DOMCaster.php | 9 +- .../symfony/var-dumper/Caster/DateCaster.php | 2 +- .../var-dumper/Caster/ExceptionCaster.php | 4 +- .../symfony/var-dumper/Caster/LinkStub.php | 2 +- .../var-dumper/Caster/ReflectionCaster.php | 20 +- .../symfony/var-dumper/Caster/SplCaster.php | 7 +- .../symfony/var-dumper/Caster/TraceStub.php | 2 +- .../var-dumper/Cloner/AbstractCloner.php | 2 +- .../var-dumper/Dumper/AbstractDumper.php | 2 +- .../symfony/var-dumper/Dumper/CliDumper.php | 44 +- .../ContextProvider/SourceContextProvider.php | 4 +- .../symfony/var-dumper/Dumper/HtmlDumper.php | 2 +- .../var-dumper/Dumper/ServerDumper.php | 2 +- api/vendor/symfony/var-dumper/LICENSE | 2 +- .../symfony/var-dumper/Server/Connection.php | 2 +- .../symfony/var-dumper/Server/DumpServer.php | 2 +- .../var-dumper/Test/VarDumperTestTrait.php | 2 +- api/vendor/symfony/var-dumper/VarDumper.php | 2 +- api/vendor/symfony/var-dumper/composer.json | 2 +- api/vendor/symfony/yaml/CHANGELOG.md | 16 + .../symfony/yaml/Command/LintCommand.php | 59 +- api/vendor/symfony/yaml/Dumper.php | 38 +- .../symfony/yaml/Exception/ParseException.php | 12 +- api/vendor/symfony/yaml/Inline.php | 133 +- api/vendor/symfony/yaml/LICENSE | 2 +- api/vendor/symfony/yaml/Parser.php | 79 +- api/vendor/symfony/yaml/Tag/TaggedValue.php | 2 +- api/vendor/symfony/yaml/Unescaper.php | 82 +- api/vendor/symfony/yaml/Yaml.php | 1 + api/vendor/symfony/yaml/composer.json | 8 +- api/vendor/theseer/tokenizer/CHANGELOG.md | 16 + api/vendor/theseer/tokenizer/README.md | 3 - .../theseer/tokenizer/src/Tokenizer.php | 19 +- .../theseer/tokenizer/src/XMLSerializer.php | 2 +- api/vendor/vlucas/phpdotenv/composer.json | 20 +- api/vendor/vlucas/phpdotenv/src/Dotenv.php | 12 +- .../vlucas/phpdotenv/src/Parser/Entry.php | 2 +- .../src/Repository/RepositoryBuilder.php | 4 +- .../phpdotenv/src/Store/File/Reader.php | 4 +- .../vlucas/phpdotenv/src/Store/FileStore.php | 2 +- .../phpdotenv/src/Store/StoreBuilder.php | 4 +- .../vlucas/phpdotenv/src/Util/Regex.php | 2 +- api/vendor/vlucas/phpdotenv/src/Util/Str.php | 4 +- classes/OccurrenceEditorManager.php | 26 +- collections/map/index.php | 22 +- collections/map/occurrencelist.php | 5 + collections/misc/collprofiles.php | 22 +- collections/search/index.php | 8 +- collections/search/js/searchform.js | 18 +- config/symbbase.php | 2 +- content/lang/collections/map/index.en.php | 1 + content/lang/collections/map/index.es.php | 3 +- content/lang/collections/map/index.fr.php | 2 +- content/lang/collections/map/index.pt.php | 1 + content/lang/taxa/index.es.php | 2 +- content/lang/taxa/index.fr.php | 2 +- content/lang/taxa/index.pt.php | 2 +- css/symbiota/header.css | 12 + css/symbiota/main.css | 18 + games/flashcards.php | 81 +- includes/header_template.php | 11 +- misc/aboutproject.php | 44 - misc/contacts.php | 35 - utilities/SymbUtil.php | 2 +- 1333 files changed, 36794 insertions(+), 28332 deletions(-) rename api/vendor/{symfony/polyfill-php81 => carbonphp/carbon-doctrine-types}/LICENSE (88%) create mode 100644 api/vendor/carbonphp/carbon-doctrine-types/README.md create mode 100644 api/vendor/carbonphp/carbon-doctrine-types/composer.json create mode 100644 api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php create mode 100644 api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonImmutableType.php create mode 100644 api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonType.php rename api/vendor/{nesbot/carbon => carbonphp/carbon-doctrine-types}/src/Carbon/Doctrine/CarbonTypeConverter.php (59%) rename api/vendor/{nesbot/carbon => carbonphp/carbon-doctrine-types}/src/Carbon/Doctrine/DateTimeDefaultPrecision.php (70%) rename api/vendor/{nesbot/carbon => carbonphp/carbon-doctrine-types}/src/Carbon/Doctrine/DateTimeImmutableType.php (58%) create mode 100644 api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php delete mode 100644 api/vendor/dragonmantank/cron-expression/phpstan.neon delete mode 100644 api/vendor/fakerphp/faker/psalm.baseline.xml create mode 100644 api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Color.php create mode 100644 api/vendor/mockery/mockery/.readthedocs.yml create mode 100644 api/vendor/mockery/mockery/COPYRIGHT.md create mode 100644 api/vendor/mockery/mockery/SECURITY.md create mode 100644 api/vendor/mockery/mockery/composer.lock create mode 100644 api/vendor/mockery/mockery/docs/.gitignore create mode 100644 api/vendor/mockery/mockery/docs/Makefile create mode 100644 api/vendor/mockery/mockery/docs/_static/.gitkeep create mode 100644 api/vendor/mockery/mockery/docs/requirements.txt create mode 100644 api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorInterface.php create mode 100644 api/vendor/mockery/mockery/library/Mockery/Exception/MockeryExceptionInterface.php create mode 100644 api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassAttributesPass.php create mode 100644 api/vendor/mockery/mockery/library/Mockery/Matcher/IsEqual.php create mode 100644 api/vendor/mockery/mockery/library/Mockery/Matcher/IsSame.php create mode 100644 api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherInterface.php delete mode 100644 api/vendor/myclabs/deep-copy/.github/FUNDING.yml delete mode 100644 api/vendor/myclabs/deep-copy/.github/workflows/ci.yaml create mode 100644 api/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php create mode 100644 api/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php create mode 100644 api/vendor/nesbot/carbon/sponsors.php delete mode 100644 api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php delete mode 100644 api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php delete mode 100644 api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php delete mode 100644 api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php delete mode 100644 api/vendor/nikic/php-parser/grammar/README.md delete mode 100644 api/vendor/nikic/php-parser/grammar/parser.template delete mode 100644 api/vendor/nikic/php-parser/grammar/php5.y delete mode 100644 api/vendor/nikic/php-parser/grammar/php7.y delete mode 100644 api/vendor/nikic/php-parser/grammar/phpyLang.php delete mode 100644 api/vendor/nikic/php-parser/grammar/rebuildParsers.php delete mode 100644 api/vendor/nikic/php-parser/grammar/tokens.template delete mode 100644 api/vendor/nikic/php-parser/grammar/tokens.y create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Property.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php delete mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/Token.php create mode 100644 api/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php create mode 100644 api/vendor/phar-io/manifest/.github/FUNDING.yml create mode 100644 api/vendor/phar-io/manifest/.github/workflows/ci.yml rename api/vendor/{theseer/tokenizer/.php_cs.dist => phar-io/manifest/.php-cs-fixer.dist.php} (90%) create mode 100644 api/vendor/phar-io/manifest/manifest.xsd create mode 100644 api/vendor/phar-io/manifest/src/exceptions/NoEmailAddressException.php create mode 100644 api/vendor/phar-io/manifest/tools/php-cs-fixer.d/PhpdocSingleLineVarFixer.php create mode 100644 api/vendor/phar-io/manifest/tools/php-cs-fixer.d/header.txt rename api/vendor/phpunit/php-code-coverage/{ChangeLog.md => ChangeLog-9.2.md} (92%) create mode 100644 api/vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php delete mode 100644 api/vendor/phpunit/phpunit/.phpstorm.meta.php delete mode 100644 api/vendor/phpunit/phpunit/ChangeLog-8.5.md create mode 100644 api/vendor/phpunit/phpunit/DEPRECATIONS.md create mode 100644 api/vendor/phpunit/phpunit/composer.lock create mode 100644 api/vendor/phpunit/phpunit/schema/9.0.xsd create mode 100644 api/vendor/phpunit/phpunit/schema/9.1.xsd create mode 100644 api/vendor/phpunit/phpunit/schema/9.3.xsd create mode 100644 api/vendor/phpunit/phpunit/schema/9.4.xsd create mode 100644 api/vendor/phpunit/phpunit/schema/9.5.xsd create mode 100644 api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php rename api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/{MoveWhitelistDirectoriesToCoverage.php => MoveWhitelistIncludesToCoverage.php} (83%) create mode 100644 api/vendor/psr/clock/CHANGELOG.md rename api/vendor/{symfony/polyfill-php72 => psr/clock}/LICENSE (83%) create mode 100644 api/vendor/psr/clock/README.md create mode 100644 api/vendor/psr/clock/composer.json create mode 100644 api/vendor/psr/clock/src/ClockInterface.php rename api/vendor/ramsey/collection/src/Exception/{InvalidSortOrderException.php => CollectionException.php} (70%) rename api/vendor/ramsey/collection/src/Exception/{ValueExtractionException.php => InvalidPropertyOrMethod.php} (62%) create mode 100644 api/vendor/ramsey/collection/src/Sort.php delete mode 100644 api/vendor/sebastian/resource-operations/.gitattributes delete mode 100644 api/vendor/sebastian/resource-operations/.gitignore create mode 100644 api/vendor/sebastian/resource-operations/SECURITY.md delete mode 100644 api/vendor/symfony/deprecation-contracts/.gitignore delete mode 100644 api/vendor/symfony/event-dispatcher-contracts/.gitignore create mode 100644 api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php delete mode 100644 api/vendor/symfony/polyfill-php72/Php72.php delete mode 100644 api/vendor/symfony/polyfill-php72/README.md delete mode 100644 api/vendor/symfony/polyfill-php72/bootstrap.php delete mode 100644 api/vendor/symfony/polyfill-php72/composer.json delete mode 100644 api/vendor/symfony/polyfill-php81/Php81.php delete mode 100644 api/vendor/symfony/polyfill-php81/README.md delete mode 100644 api/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php delete mode 100644 api/vendor/symfony/polyfill-php81/bootstrap.php delete mode 100644 api/vendor/symfony/polyfill-php81/composer.json delete mode 100644 api/vendor/symfony/service-contracts/.gitignore create mode 100644 api/vendor/symfony/service-contracts/ServiceCollectionInterface.php create mode 100644 api/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php create mode 100644 api/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php delete mode 100644 api/vendor/symfony/translation-contracts/.gitignore create mode 100644 api/vendor/symfony/translation/CatalogueMetadataAwareInterface.php create mode 100644 api/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php create mode 100644 api/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php create mode 100644 api/vendor/symfony/translation/Extractor/PhpAstExtractor.php create mode 100644 api/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php create mode 100644 api/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php create mode 100644 api/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php create mode 100644 api/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php create mode 100644 api/vendor/symfony/translation/LocaleSwitcher.php rename api/vendor/symfony/translation/Resources/schemas/{xliff-core-1.2-strict.xsd => xliff-core-1.2-transitional.xsd} (96%) delete mode 100644 misc/aboutproject.php delete mode 100644 misc/contacts.php diff --git a/api/composer.lock b/api/composer.lock index c0a86f8c9a..b96c25ca34 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -8,26 +8,25 @@ "packages": [ { "name": "brick/math", - "version": "0.10.2", + "version": "0.12.1", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f" + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/459f2781e1a08d52ee56b0b1444086e038561e3f", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.4 || ^8.0" + "php": "^8.1" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "4.25.0" + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" }, "type": "library", "autoload": { @@ -47,12 +46,17 @@ "arithmetic", "bigdecimal", "bignum", + "bignumber", "brick", - "math" + "decimal", + "integer", + "math", + "mathematics", + "rational" ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.10.2" + "source": "https://github.com/brick/math/tree/0.12.1" }, "funding": [ { @@ -60,7 +64,76 @@ "type": "github" } ], - "time": "2022-08-10T22:54:19+00:00" + "time": "2023-11-29T23:19:16+00:00" + }, + { + "name": "carbonphp/carbon-doctrine-types", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2024-02-09T16:56:22+00:00" }, { "name": "darkaonline/swagger-lume", @@ -128,16 +201,16 @@ }, { "name": "doctrine/annotations", - "version": "1.14.3", + "version": "1.14.4", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/253dca476f70808a5aeed3a47cc2cc88c5cab915", + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915", "shasum": "" }, "require": { @@ -148,11 +221,11 @@ }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "~1.4.10 || ^1.10.28", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7", + "vimeo/psalm": "^4.30 || ^5.14" }, "suggest": { "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" @@ -198,34 +271,34 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.3" + "source": "https://github.com/doctrine/annotations/tree/1.14.4" }, - "time": "2023-02-01T09:20:38+00:00" + "time": "2024-09-05T10:15:52+00:00" }, { "name": "doctrine/inflector", - "version": "2.0.6", + "version": "2.0.10", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^11.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", "autoload": { @@ -275,7 +348,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.6" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -291,7 +364,7 @@ "type": "tidelift" } ], - "time": "2022-10-20T09:10:12+00:00" + "time": "2024-02-18T20:23:39+00:00" }, { "name": "doctrine/lexer", @@ -371,16 +444,16 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "8c784d071debd117328803d86b2097615b457500" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500", + "reference": "8c784d071debd117328803d86b2097615b457500", "shasum": "" }, "require": { @@ -393,10 +466,14 @@ "require-dev": { "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.0", - "phpstan/phpstan-webmozart-assert": "^1.0", "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, "autoload": { "psr-4": { "Cron\\": "src/Cron/" @@ -420,7 +497,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0" }, "funding": [ { @@ -428,7 +505,7 @@ "type": "github" } ], - "time": "2022-09-10T18:51:20+00:00" + "time": "2024-10-09T13:47:03+00:00" }, { "name": "egulias/email-validator", @@ -500,24 +577,24 @@ }, { "name": "graham-campbell/result-type", - "version": "v1.1.0", + "version": "v1.1.3", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" + "phpoption/phpoption": "^1.9.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "autoload": { @@ -546,7 +623,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" }, "funding": [ { @@ -558,7 +635,7 @@ "type": "tidelift" } ], - "time": "2022-07-30T15:56:11+00:00" + "time": "2024-07-20T21:45:45+00:00" }, { "name": "illuminate/auth", @@ -2096,26 +2173,27 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.3.0", + "version": "v1.3.7", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" + "reference": "4f48ade902b94323ca3be7646db16209ec76be3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/4f48ade902b94323ca3be7646db16209ec76be3d", + "reference": "4f48ade902b94323ca3be7646db16209ec76be3d", "shasum": "" }, "require": { "php": "^7.3|^8.0" }, "require-dev": { - "nesbot/carbon": "^2.61", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", + "nesbot/carbon": "^2.61|^3.0", "pestphp/pest": "^1.21.3", "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11" + "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" }, "type": "library", "extra": { @@ -2152,20 +2230,20 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2023-01-30T18:31:20+00:00" + "time": "2024-11-14T18:34:49+00:00" }, { "name": "monolog/monolog", - "version": "2.8.0", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50" + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/720488632c590286b88b80e62aa3d3d551ad4a50", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", "shasum": "" }, "require": { @@ -2180,14 +2258,14 @@ "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2", + "graylog2/gelf-php": "^1.4.2 || ^2@dev", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.38 || ^9.6.19", "predis/predis": "^1.1 || ^2.0", "rollbar/rollbar": "^1.3 || ^2 || ^3", "ruflin/elastica": "^7", @@ -2242,7 +2320,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.8.0" + "source": "https://github.com/Seldaek/monolog/tree/2.10.0" }, "funding": [ { @@ -2254,32 +2332,37 @@ "type": "tidelift" } ], - "time": "2022-07-24T11:55:47+00:00" + "time": "2024-11-12T12:43:37+00:00" }, { "name": "nesbot/carbon", - "version": "2.66.0", + "version": "2.72.5", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "496712849902241f04902033b0441b269effe001" + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/496712849902241f04902033b0441b269effe001", - "reference": "496712849902241f04902033b0441b269effe001", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed", + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed", "shasum": "" }, "require": { + "carbonphp/carbon-doctrine-types": "*", "ext-json": "*", "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, + "provide": { + "psr/clock-implementation": "1.0" + }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4", - "doctrine/orm": "^2.7", + "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", + "doctrine/orm": "^2.7 || ^3.0", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "ondrejmirtes/better-reflection": "*", @@ -2296,8 +2379,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev" }, "laravel": { "providers": [ @@ -2356,7 +2439,7 @@ "type": "tidelift" } ], - "time": "2023-01-29T18:53:47+00:00" + "time": "2024-06-03T19:18:41+00:00" }, { "name": "nikic/fast-route", @@ -2475,30 +2558,30 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.0", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { "dev-master": "1.9-dev" @@ -2534,7 +2617,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.0" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" }, "funding": [ { @@ -2546,7 +2629,7 @@ "type": "tidelift" } ], - "time": "2022-07-30T15:51:26+00:00" + "time": "2024-07-20T21:41:07+00:00" }, { "name": "psr/cache", @@ -2597,6 +2680,54 @@ }, "time": "2021-02-03T23:26:27+00:00" }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, { "name": "psr/container", "version": "1.1.2", @@ -2798,21 +2929,20 @@ }, { "name": "ramsey/collection", - "version": "1.3.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", - "symfony/polyfill-php81": "^1.23" + "php": "^8.1" }, "require-dev": { "captainhook/plugin-composer": "^5.3", @@ -2872,7 +3002,7 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.3.0" + "source": "https://github.com/ramsey/collection/tree/2.0.0" }, "funding": [ { @@ -2884,24 +3014,24 @@ "type": "tidelift" } ], - "time": "2022-12-27T19:12:24+00:00" + "time": "2022-12-31T21:50:55+00:00" }, { "name": "ramsey/uuid", - "version": "4.7.3", + "version": "4.7.6", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "433b2014e3979047db08a17a205f410ba3869cf2" + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/433b2014e3979047db08a17a205f410ba3869cf2", - "reference": "433b2014e3979047db08a17a205f410ba3869cf2", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", "ext-json": "*", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" @@ -2964,7 +3094,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.3" + "source": "https://github.com/ramsey/uuid/tree/4.7.6" }, "funding": [ { @@ -2976,7 +3106,7 @@ "type": "tidelift" } ], - "time": "2023-01-12T18:13:24+00:00" + "time": "2024-04-27T21:32:50+00:00" }, { "name": "swagger-api/swagger-ui", @@ -3041,16 +3171,16 @@ }, { "name": "symfony/console", - "version": "v5.4.19", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dccb8d251a9017d5994c988b034d3e18aaabf740", - "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -3115,12 +3245,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.19" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -3136,29 +3266,29 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:32:19+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3187,7 +3317,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -3203,20 +3333,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/error-handler", - "version": "v5.4.19", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "438ef3e5e6481244785da3ce8cf8f4e74e7f2822" + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/438ef3e5e6481244785da3ce8cf8f4e74e7f2822", - "reference": "438ef3e5e6481244785da3ce8cf8f4e74e7f2822", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/d19ede7a2cafb386be9486c580649d0f9e3d0363", + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363", "shasum": "" }, "require": { @@ -3258,7 +3388,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.19" + "source": "https://github.com/symfony/error-handler/tree/v5.4.46" }, "funding": [ { @@ -3274,28 +3404,29 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:32:19+00:00" + "time": "2024-11-05T14:17:06+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.0.19", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a" + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", - "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", "shasum": "" }, "require": { - "php": ">=8.0.2", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -3303,17 +3434,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -3341,7 +3468,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.13" }, "funding": [ { @@ -3357,33 +3484,30 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.0.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3420,7 +3544,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -3436,20 +3560,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/finder", - "version": "v5.4.19", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "6071aebf810ad13fe8200c224f36103abb37cf1f" + "reference": "63741784cd7b9967975eec610b256eed3ede022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/6071aebf810ad13fe8200c224f36103abb37cf1f", - "reference": "6071aebf810ad13fe8200c224f36103abb37cf1f", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", "shasum": "" }, "require": { @@ -3483,7 +3607,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.19" + "source": "https://github.com/symfony/finder/tree/v5.4.45" }, "funding": [ { @@ -3499,20 +3623,20 @@ "type": "tidelift" } ], - "time": "2023-01-14T19:14:44+00:00" + "time": "2024-09-28T13:32:08+00:00" }, { "name": "symfony/http-foundation", - "version": "v5.4.20", + "version": "v5.4.48", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "d0435363362a47c14e9cf50663cb8ffbf491875a" + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0435363362a47c14e9cf50663cb8ffbf491875a", - "reference": "d0435363362a47c14e9cf50663cb8ffbf491875a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3f38b8af283b830e1363acd79e5bc3412d055341", + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341", "shasum": "" }, "require": { @@ -3522,7 +3646,7 @@ "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "predis/predis": "~1.0", + "predis/predis": "^1.0|^2.0", "symfony/cache": "^4.4|^5.0|^6.0", "symfony/dependency-injection": "^5.4|^6.0", "symfony/expression-language": "^4.4|^5.0|^6.0", @@ -3559,7 +3683,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.20" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.48" }, "funding": [ { @@ -3575,7 +3699,7 @@ "type": "tidelift" } ], - "time": "2023-01-29T11:11:52+00:00" + "time": "2024-11-13T18:58:02+00:00" }, { "name": "symfony/http-kernel", @@ -3691,16 +3815,16 @@ }, { "name": "symfony/mime", - "version": "v5.4.19", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "a858429a9c704edc53fe057228cf9ca282ba48eb" + "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/a858429a9c704edc53fe057228cf9ca282ba48eb", - "reference": "a858429a9c704edc53fe057228cf9ca282ba48eb", + "url": "https://api.github.com/repos/symfony/mime/zipball/8c1b9b3e5b52981551fc6044539af1d974e39064", + "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064", "shasum": "" }, "require": { @@ -3715,15 +3839,16 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<4.4", - "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6" + "symfony/serializer": "<5.4.35|>=6,<6.3.12|>=6.4,<6.4.3" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/process": "^5.4|^6.4", "symfony/property-access": "^4.4|^5.1|^6.0", "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6" + "symfony/serializer": "^5.4.35|~6.3.12|^6.4.3" }, "type": "library", "autoload": { @@ -3755,7 +3880,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.19" + "source": "https://github.com/symfony/mime/tree/v5.4.45" }, "funding": [ { @@ -3771,24 +3896,24 @@ "type": "tidelift" } ], - "time": "2023-01-09T05:43:46+00:00" + "time": "2024-10-23T20:18:32+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -3798,12 +3923,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3837,7 +3959,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -3853,36 +3975,33 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3918,7 +4037,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -3934,35 +4053,31 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4005,7 +4120,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -4021,36 +4136,33 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4089,7 +4201,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -4105,24 +4217,24 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -4132,9 +4244,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4172,83 +4281,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.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-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "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.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -4264,33 +4297,30 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4327,7 +4357,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -4343,33 +4373,30 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4410,86 +4437,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.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-11-03T14:55:06+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-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.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -4505,20 +4453,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v5.4.19", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c5ba874c9b636dbccf761e22ce750e88ec3f55e1", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { @@ -4551,7 +4499,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.19" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -4567,37 +4515,34 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:32:19+00:00" + "time": "2024-11-06T11:36:42+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4607,7 +4552,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4634,7 +4582,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -4650,37 +4598,38 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/string", - "version": "v6.0.19", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4719,7 +4668,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.19" + "source": "https://github.com/symfony/string/tree/v6.4.15" }, "funding": [ { @@ -4735,32 +4684,35 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2024-11-13T13:31:12+00:00" }, { "name": "symfony/translation", - "version": "v6.0.19", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f" + "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", - "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", + "url": "https://api.github.com/repos/symfony/translation/zipball/bee9bfabfa8b4045a66bf82520e492cddbaffa66", + "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" + "symfony/translation-contracts": "^2.5|^3.0" }, "conflict": { "symfony/config": "<5.4", "symfony/console": "<5.4", "symfony/dependency-injection": "<5.4", + "symfony/http-client-contracts": "<2.5", "symfony/http-kernel": "<5.4", + "symfony/service-contracts": "<2.5", "symfony/twig-bundle": "<5.4", "symfony/yaml": "<5.4" }, @@ -4768,22 +4720,19 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { + "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -4814,7 +4763,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.19" + "source": "https://github.com/symfony/translation/tree/v6.4.13" }, "funding": [ { @@ -4830,32 +4779,29 @@ "type": "tidelift" } ], - "time": "2023-01-01T08:36:10+00:00" + "time": "2024-09-27T18:14:25+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.0.2", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282" + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/4667ff3bd513750603a09c8dedbea942487fb07c", + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c", "shasum": "" }, "require": { - "php": ">=8.0.2" - }, - "suggest": { - "symfony/translation-implementation": "" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -4865,7 +4811,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4892,7 +4841,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.1" }, "funding": [ { @@ -4908,20 +4857,20 @@ "type": "tidelift" } ], - "time": "2022-06-27T17:10:44+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.19", + "version": "v5.4.48", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b" + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b", - "reference": "2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/42f18f170aa86d612c3559cfb3bd11a375df32c8", + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8", "shasum": "" }, "require": { @@ -4930,12 +4879,12 @@ "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<4.4" }, "require-dev": { "ext-iconv": "*", "symfony/console": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", "symfony/process": "^4.4|^5.0|^6.0", "symfony/uid": "^5.1|^6.0", "twig/twig": "^2.13|^3.0.4" @@ -4981,7 +4930,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.19" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.48" }, "funding": [ { @@ -4997,34 +4946,32 @@ "type": "tidelift" } ], - "time": "2023-01-16T10:52:33+00:00" + "time": "2024-11-08T15:21:10+00:00" }, { "name": "symfony/yaml", - "version": "v6.0.19", + "version": "v6.4.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884" + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/deec3a812a0305a50db8ae689b183f43d915c884", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "symfony/console": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "symfony/console": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -5055,7 +5002,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.0.19" + "source": "https://github.com/symfony/yaml/tree/v6.4.13" }, "funding": [ { @@ -5071,35 +5018,35 @@ "type": "tidelift" } ], - "time": "2023-01-11T11:50:03+00:00" + "time": "2024-09-25T14:18:03+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v5.5.0", + "version": "v5.6.1", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" + "graham-campbell/result-type": "^1.1.3", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.3", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "suggest": { "ext-filter": "Required to use the boolean validator." @@ -5108,10 +5055,10 @@ "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "autoload": { @@ -5143,7 +5090,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" }, "funding": [ { @@ -5155,7 +5102,7 @@ "type": "tidelift" } ], - "time": "2022-10-16T01:01:54+00:00" + "time": "2024-07-20T21:52:34+00:00" }, { "name": "voku/portable-ascii", @@ -5366,30 +5313,30 @@ "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -5416,7 +5363,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -5432,20 +5379,20 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "fakerphp/faker", - "version": "v1.21.0", + "version": "v1.24.1", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d" + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/92efad6a967f0b79c499705c69b662f738cc9e4d", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", "shasum": "" }, "require": { @@ -5471,11 +5418,6 @@ "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" @@ -5498,9 +5440,9 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.21.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" }, - "time": "2022-12-13T13:54:32+00:00" + "time": "2024-11-21T13:46:39+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -5555,38 +5497,38 @@ }, { "name": "mockery/mockery", - "version": "1.5.1", + "version": "1.6.12", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e" + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "autoload": { - "psr-0": { - "Mockery": "library/" + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" } }, "notification-url": "https://packagist.org/downloads/", @@ -5597,12 +5539,20 @@ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], "description": "Mockery is a simple yet flexible PHP mock object framework", @@ -5620,23 +5570,26 @@ "testing" ], "support": { + "docs": "https://docs.mockery.io/", "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.1" + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2022-09-07T15:32:08+00:00" + "time": "2024-05-16T03:13:13+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -5644,11 +5597,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -5674,7 +5628,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -5682,29 +5636,31 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v5.3.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -5712,7 +5668,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -5736,26 +5692,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2024-10-08T18:51:32+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -5796,9 +5753,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -5853,44 +5816,44 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.24", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -5918,7 +5881,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -5926,7 +5890,7 @@ "type": "github" } ], - "time": "2023-01-26T08:26:55+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -6171,50 +6135,50 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.0", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "70fc8be1d0b9fad56a199a4df5f9cfabfc246f84" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/70fc8be1d0b9fad56a199a4df5f9cfabfc246f84", - "reference": "70fc8be1d0b9fad56a199a4df5f9cfabfc246f84", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" @@ -6253,7 +6217,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.0" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -6269,20 +6234,20 @@ "type": "tidelift" } ], - "time": "2023-02-03T07:32:24+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -6317,7 +6282,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -6325,7 +6290,7 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2024-03-02T06:27:43+00:00" }, { "name": "sebastian/code-unit", @@ -6514,20 +6479,20 @@ }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -6559,7 +6524,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -6567,20 +6532,20 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-12-22T06:19:30+00:00" }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -6625,7 +6590,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -6633,7 +6598,7 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2024-03-02T06:30:58+00:00" }, { "name": "sebastian/environment", @@ -6700,16 +6665,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -6765,7 +6730,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -6773,20 +6738,20 @@ "type": "github" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2024-03-02T06:33:00+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -6829,7 +6794,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -6837,24 +6802,24 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2024-03-02T06:35:11+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { @@ -6886,7 +6851,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -6894,7 +6859,7 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-12-22T06:20:34+00:00" }, { "name": "sebastian/object-enumerator", @@ -7073,16 +7038,16 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -7094,7 +7059,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -7115,8 +7080,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -7124,7 +7088,7 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", @@ -7237,16 +7201,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -7275,7 +7239,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -7283,7 +7247,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], @@ -7295,5 +7259,5 @@ "php": "^7.3|^8.0" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.6.0" } diff --git a/api/vendor/autoload.php b/api/vendor/autoload.php index 2d652533b6..4be02de9f9 100644 --- a/api/vendor/autoload.php +++ b/api/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInite18bd6b57182fc88f4b9d0452696caaa::getLoader(); diff --git a/api/vendor/bin/carbon b/api/vendor/bin/carbon index 9a39ae30b2..86fbfdfd88 100644 --- a/api/vendor/bin/carbon +++ b/api/vendor/bin/carbon @@ -4,21 +4,116 @@ /** * Proxy PHP file generated by Composer * - * This file includes the referenced bin path (../nesbot/carbon/bin/carbon) using eval to remove the shebang if present + * This file includes the referenced bin path (../nesbot/carbon/bin/carbon) + * using a stream wrapper to prevent the shebang from being output on PHP<8 * * @generated */ -$binPath = realpath(__DIR__ . "/" . '../nesbot/carbon/bin/carbon'); -$contents = file_get_contents($binPath); -$contents = preg_replace('{^#!/.+\r?\n<\?(php)?}', '', $contents, 1, $replaced); -if ($replaced) { - $contents = strtr($contents, array( - '__FILE__' => var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); +namespace Composer; + +$GLOBALS['_composer_bin_dir'] = __DIR__; +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + private $realpath; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 17); + $this->realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'); + } } -include $binPath; + +return include __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'; diff --git a/api/vendor/bin/carbon.bat b/api/vendor/bin/carbon.bat index 3cf1f282d5..806cf153b7 100644 --- a/api/vendor/bin/carbon.bat +++ b/api/vendor/bin/carbon.bat @@ -1,4 +1,5 @@ @ECHO OFF setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../nesbot/carbon/bin/carbon +SET BIN_TARGET=%~dp0/carbon +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 php "%BIN_TARGET%" %* diff --git a/api/vendor/bin/patch-type-declarations b/api/vendor/bin/patch-type-declarations index a3f0912000..4e63fefc42 100644 --- a/api/vendor/bin/patch-type-declarations +++ b/api/vendor/bin/patch-type-declarations @@ -4,21 +4,116 @@ /** * Proxy PHP file generated by Composer * - * This file includes the referenced bin path (../symfony/error-handler/Resources/bin/patch-type-declarations) using eval to remove the shebang if present + * This file includes the referenced bin path (../symfony/error-handler/Resources/bin/patch-type-declarations) + * using a stream wrapper to prevent the shebang from being output on PHP<8 * * @generated */ -$binPath = realpath(__DIR__ . "/" . '../symfony/error-handler/Resources/bin/patch-type-declarations'); -$contents = file_get_contents($binPath); -$contents = preg_replace('{^#!/.+\r?\n<\?(php)?}', '', $contents, 1, $replaced); -if ($replaced) { - $contents = strtr($contents, array( - '__FILE__' => var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); +namespace Composer; + +$GLOBALS['_composer_bin_dir'] = __DIR__; +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + private $realpath; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 17); + $this->realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/error-handler/Resources/bin/patch-type-declarations'); + } } -include $binPath; + +return include __DIR__ . '/..'.'/symfony/error-handler/Resources/bin/patch-type-declarations'; diff --git a/api/vendor/bin/patch-type-declarations.bat b/api/vendor/bin/patch-type-declarations.bat index b92a2da31b..2b0707968a 100644 --- a/api/vendor/bin/patch-type-declarations.bat +++ b/api/vendor/bin/patch-type-declarations.bat @@ -1,4 +1,5 @@ @ECHO OFF setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../symfony/error-handler/Resources/bin/patch-type-declarations +SET BIN_TARGET=%~dp0/patch-type-declarations +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 php "%BIN_TARGET%" %* diff --git a/api/vendor/bin/php-parse b/api/vendor/bin/php-parse index e2e4c58a1b..61566e60c8 100644 --- a/api/vendor/bin/php-parse +++ b/api/vendor/bin/php-parse @@ -4,21 +4,116 @@ /** * Proxy PHP file generated by Composer * - * This file includes the referenced bin path (../nikic/php-parser/bin/php-parse) using eval to remove the shebang if present + * This file includes the referenced bin path (../nikic/php-parser/bin/php-parse) + * using a stream wrapper to prevent the shebang from being output on PHP<8 * * @generated */ -$binPath = realpath(__DIR__ . "/" . '../nikic/php-parser/bin/php-parse'); -$contents = file_get_contents($binPath); -$contents = preg_replace('{^#!/.+\r?\n<\?(php)?}', '', $contents, 1, $replaced); -if ($replaced) { - $contents = strtr($contents, array( - '__FILE__' => var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); +namespace Composer; + +$GLOBALS['_composer_bin_dir'] = __DIR__; +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + private $realpath; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 17); + $this->realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'); + } } -include $binPath; + +return include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse'; diff --git a/api/vendor/bin/php-parse.bat b/api/vendor/bin/php-parse.bat index a5baa4eda1..2c5096dc39 100644 --- a/api/vendor/bin/php-parse.bat +++ b/api/vendor/bin/php-parse.bat @@ -1,4 +1,5 @@ @ECHO OFF setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../nikic/php-parser/bin/php-parse +SET BIN_TARGET=%~dp0/php-parse +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 php "%BIN_TARGET%" %* diff --git a/api/vendor/bin/phpunit b/api/vendor/bin/phpunit index dba519bc99..b5b530a8fe 100644 --- a/api/vendor/bin/phpunit +++ b/api/vendor/bin/phpunit @@ -4,21 +4,119 @@ /** * Proxy PHP file generated by Composer * - * This file includes the referenced bin path (../phpunit/phpunit/phpunit) using eval to remove the shebang if present + * This file includes the referenced bin path (../phpunit/phpunit/phpunit) + * using a stream wrapper to prevent the shebang from being output on PHP<8 * * @generated */ -$binPath = realpath(__DIR__ . "/" . '../phpunit/phpunit/phpunit'); -$contents = file_get_contents($binPath); -$contents = preg_replace('{^#!/.+\r?\n<\?(php)?}', '', $contents, 1, $replaced); -if ($replaced) { - $contents = strtr($contents, array( - '__FILE__' => var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); +namespace Composer; + +$GLOBALS['_composer_bin_dir'] = __DIR__; +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; +$GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'] = $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'] = array(realpath(__DIR__ . '/..'.'/phpunit/phpunit/phpunit')); + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + private $realpath; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 17); + $this->realpath = realpath($opened_path) ?: $opened_path; + $opened_path = 'phpvfscomposer://'.$this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + $data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data); + $data = str_replace('__FILE__', var_export($this->realpath, true), $data); + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit'); + } } -include $binPath; + +return include __DIR__ . '/..'.'/phpunit/phpunit/phpunit'; diff --git a/api/vendor/bin/phpunit.bat b/api/vendor/bin/phpunit.bat index b17792348c..2a070cd443 100644 --- a/api/vendor/bin/phpunit.bat +++ b/api/vendor/bin/phpunit.bat @@ -1,4 +1,5 @@ @ECHO OFF setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../phpunit/phpunit/phpunit +SET BIN_TARGET=%~dp0/phpunit +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 php "%BIN_TARGET%" %* diff --git a/api/vendor/bin/var-dump-server b/api/vendor/bin/var-dump-server index 4b749cce6c..18db1c1eb2 100644 --- a/api/vendor/bin/var-dump-server +++ b/api/vendor/bin/var-dump-server @@ -4,21 +4,116 @@ /** * Proxy PHP file generated by Composer * - * This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server) using eval to remove the shebang if present + * This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server) + * using a stream wrapper to prevent the shebang from being output on PHP<8 * * @generated */ -$binPath = realpath(__DIR__ . "/" . '../symfony/var-dumper/Resources/bin/var-dump-server'); -$contents = file_get_contents($binPath); -$contents = preg_replace('{^#!/.+\r?\n<\?(php)?}', '', $contents, 1, $replaced); -if ($replaced) { - $contents = strtr($contents, array( - '__FILE__' => var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); +namespace Composer; + +$GLOBALS['_composer_bin_dir'] = __DIR__; +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + private $realpath; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 17); + $this->realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'); + } } -include $binPath; + +return include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server'; diff --git a/api/vendor/bin/var-dump-server.bat b/api/vendor/bin/var-dump-server.bat index 46836b50cd..94333da54c 100644 --- a/api/vendor/bin/var-dump-server.bat +++ b/api/vendor/bin/var-dump-server.bat @@ -1,4 +1,5 @@ @ECHO OFF setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../symfony/var-dumper/Resources/bin/var-dump-server +SET BIN_TARGET=%~dp0/var-dump-server +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 php "%BIN_TARGET%" %* diff --git a/api/vendor/bin/yaml-lint b/api/vendor/bin/yaml-lint index 9bcc2adc99..388092f5b4 100644 --- a/api/vendor/bin/yaml-lint +++ b/api/vendor/bin/yaml-lint @@ -4,21 +4,116 @@ /** * Proxy PHP file generated by Composer * - * This file includes the referenced bin path (../symfony/yaml/Resources/bin/yaml-lint) using eval to remove the shebang if present + * This file includes the referenced bin path (../symfony/yaml/Resources/bin/yaml-lint) + * using a stream wrapper to prevent the shebang from being output on PHP<8 * * @generated */ -$binPath = realpath(__DIR__ . "/" . '../symfony/yaml/Resources/bin/yaml-lint'); -$contents = file_get_contents($binPath); -$contents = preg_replace('{^#!/.+\r?\n<\?(php)?}', '', $contents, 1, $replaced); -if ($replaced) { - $contents = strtr($contents, array( - '__FILE__' => var_export($binPath, true), - '__DIR__' => var_export(dirname($binPath), true), - )); - - eval($contents); - exit(0); +namespace Composer; + +$GLOBALS['_composer_bin_dir'] = __DIR__; +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; + +if (PHP_VERSION_ID < 80000) { + if (!class_exists('Composer\BinProxyWrapper')) { + /** + * @internal + */ + final class BinProxyWrapper + { + private $handle; + private $position; + private $realpath; + + public function stream_open($path, $mode, $options, &$opened_path) + { + // get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution + $opened_path = substr($path, 17); + $this->realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'); + } } -include $binPath; + +return include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'; diff --git a/api/vendor/bin/yaml-lint.bat b/api/vendor/bin/yaml-lint.bat index 0474134c60..fa76637484 100644 --- a/api/vendor/bin/yaml-lint.bat +++ b/api/vendor/bin/yaml-lint.bat @@ -1,4 +1,5 @@ @ECHO OFF setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../symfony/yaml/Resources/bin/yaml-lint +SET BIN_TARGET=%~dp0/yaml-lint +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 php "%BIN_TARGET%" %* diff --git a/api/vendor/brick/math/CHANGELOG.md b/api/vendor/brick/math/CHANGELOG.md index c5c5893b93..680fa9ba29 100644 --- a/api/vendor/brick/math/CHANGELOG.md +++ b/api/vendor/brick/math/CHANGELOG.md @@ -2,6 +2,36 @@ All notable changes to this project will be documented in this file. +## [0.12.1](https://github.com/brick/math/releases/tag/0.12.1) - 2023-11-29 + +⚡️ **Performance improvements** + +- `BigNumber::of()` is now faster, thanks to [@SebastienDug](https://github.com/SebastienDug) in [#77](https://github.com/brick/math/pull/77). + +## [0.12.0](https://github.com/brick/math/releases/tag/0.12.0) - 2023-11-26 + +💥 **Breaking changes** + +- Minimum PHP version is now 8.1 +- `RoundingMode` is now an `enum`; if you're type-hinting rounding modes, you need to type-hint against `RoundingMode` instead of `int` now +- `BigNumber` classes do not implement the `Serializable` interface anymore (they use the [new custom object serialization mechanism](https://wiki.php.net/rfc/custom_object_serialization)) +- The following breaking changes only affect you if you're creating your own `BigNumber` subclasses: + - the return type of `BigNumber::of()` is now `static` + - `BigNumber` has a new abstract method `from()` + - all `public` and `protected` functions of `BigNumber` are now `final` + +## [0.11.0](https://github.com/brick/math/releases/tag/0.11.0) - 2023-01-16 + +💥 **Breaking changes** + +- Minimum PHP version is now 8.0 +- Methods accepting a union of types are now strongly typed* +- `MathException` now extends `Exception` instead of `RuntimeException` + +* You may now run into type errors if you were passing `Stringable` objects to `of()` or any of the methods +internally calling `of()`, with `strict_types` enabled. You can fix this by casting `Stringable` objects to `string` +first. + ## [0.10.2](https://github.com/brick/math/releases/tag/0.10.2) - 2022-08-11 👌 **Improvements** @@ -343,8 +373,8 @@ This release also comes with many performance improvements. - `getFraction()` is renamed to `fraction()` - `divideAndRemainder()` is renamed to `quotientAndRemainder()` - `dividedBy()` now takes a **mandatory** `$scale` parameter **before** the rounding mode - - `toBigInteger()` does not accept a `$roundingMode` parameter any more - - `toBigRational()` does not simplify the fraction any more; explicitly add `->simplified()` to get the previous behaviour + - `toBigInteger()` does not accept a `$roundingMode` parameter anymore + - `toBigRational()` does not simplify the fraction anymore; explicitly add `->simplified()` to get the previous behaviour - `BigRational`: - `getSign()` is renamed to `sign()` - `getNumerator()` is renamed to `numerator()` @@ -418,7 +448,7 @@ Added `BigDecimal::divideAndRemainder()` ## [0.2.0](https://github.com/brick/math/releases/tag/0.2.0) - 2015-05-22 -- `min()` and `max()` do not accept an `array` any more, but a variable number of parameters +- `min()` and `max()` do not accept an `array` anymore, but a variable number of parameters - **minimum PHP version is now 5.6** - continuous integration with PHP 7 diff --git a/api/vendor/brick/math/composer.json b/api/vendor/brick/math/composer.json index a8124e9215..bd67343add 100644 --- a/api/vendor/brick/math/composer.json +++ b/api/vendor/brick/math/composer.json @@ -5,22 +5,26 @@ "keywords": [ "Brick", "Math", + "Mathematics", "Arbitrary-precision", "Arithmetic", "BigInteger", "BigDecimal", "BigRational", - "Bignum" + "BigNumber", + "Bignum", + "Decimal", + "Rational", + "Integer" ], "license": "MIT", "require": { - "php": "^7.4 || ^8.0", - "ext-json": "*" + "php": "^8.1" }, "require-dev": { - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^10.1", "php-coveralls/php-coveralls": "^2.2", - "vimeo/psalm": "4.25.0" + "vimeo/psalm": "5.16.0" }, "autoload": { "psr-4": { diff --git a/api/vendor/brick/math/src/BigDecimal.php b/api/vendor/brick/math/src/BigDecimal.php index fd2babb86b..31d22ab30c 100644 --- a/api/vendor/brick/math/src/BigDecimal.php +++ b/api/vendor/brick/math/src/BigDecimal.php @@ -23,14 +23,14 @@ final class BigDecimal extends BigNumber * No leading zero must be present. * No leading minus sign must be present if the value is 0. */ - private string $value; + private readonly string $value; /** * The scale (number of digits after the decimal point) of this decimal number. * * This must be zero or more. */ - private int $scale; + private readonly int $scale; /** * Protected constructor. Use a factory method to obtain an instance. @@ -45,19 +45,11 @@ protected function __construct(string $value, int $scale = 0) } /** - * Creates a BigDecimal of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigDecimal - * - * @throws MathException If the value cannot be converted to a BigDecimal. - * * @psalm-pure */ - public static function of($value) : BigNumber + protected static function from(BigNumber $number): static { - return parent::of($value)->toBigDecimal(); + return $number->toBigDecimal(); } /** @@ -68,13 +60,11 @@ public static function of($value) : BigNumber * @param BigNumber|int|float|string $value The unscaled value. Must be convertible to a BigInteger. * @param int $scale The scale of the number, positive or zero. * - * @return BigDecimal - * * @throws \InvalidArgumentException If the scale is negative. * * @psalm-pure */ - public static function ofUnscaledValue($value, int $scale = 0) : BigDecimal + public static function ofUnscaledValue(BigNumber|int|float|string $value, int $scale = 0) : BigDecimal { if ($scale < 0) { throw new \InvalidArgumentException('The scale cannot be negative.'); @@ -86,8 +76,6 @@ public static function ofUnscaledValue($value, int $scale = 0) : BigDecimal /** * Returns a BigDecimal representing zero, with a scale of zero. * - * @return BigDecimal - * * @psalm-pure */ public static function zero() : BigDecimal @@ -108,8 +96,6 @@ public static function zero() : BigDecimal /** * Returns a BigDecimal representing one, with a scale of zero. * - * @return BigDecimal - * * @psalm-pure */ public static function one() : BigDecimal @@ -130,8 +116,6 @@ public static function one() : BigDecimal /** * Returns a BigDecimal representing ten, with a scale of zero. * - * @return BigDecimal - * * @psalm-pure */ public static function ten() : BigDecimal @@ -156,11 +140,9 @@ public static function ten() : BigDecimal * * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigDecimal. * - * @return BigDecimal The result. - * * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. */ - public function plus($that) : BigDecimal + public function plus(BigNumber|int|float|string $that) : BigDecimal { $that = BigDecimal::of($that); @@ -187,11 +169,9 @@ public function plus($that) : BigDecimal * * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigDecimal. * - * @return BigDecimal The result. - * * @throws MathException If the number is not valid, or is not convertible to a BigDecimal. */ - public function minus($that) : BigDecimal + public function minus(BigNumber|int|float|string $that) : BigDecimal { $that = BigDecimal::of($that); @@ -214,11 +194,9 @@ public function minus($that) : BigDecimal * * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigDecimal. * - * @return BigDecimal The result. - * * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigDecimal. */ - public function multipliedBy($that) : BigDecimal + public function multipliedBy(BigNumber|int|float|string $that) : BigDecimal { $that = BigDecimal::of($that); @@ -241,14 +219,12 @@ public function multipliedBy($that) : BigDecimal * * @param BigNumber|int|float|string $that The divisor. * @param int|null $scale The desired scale, or null to use the scale of this number. - * @param int $roundingMode An optional rounding mode. - * - * @return BigDecimal + * @param RoundingMode $roundingMode An optional rounding mode, defaults to UNNECESSARY. * * @throws \InvalidArgumentException If the scale or rounding mode is invalid. * @throws MathException If the number is invalid, is zero, or rounding was necessary. */ - public function dividedBy($that, ?int $scale = null, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + public function dividedBy(BigNumber|int|float|string $that, ?int $scale = null, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal { $that = BigDecimal::of($that); @@ -281,12 +257,10 @@ public function dividedBy($that, ?int $scale = null, int $roundingMode = Roundin * * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. * - * @return BigDecimal The result. - * * @throws MathException If the divisor is not a valid number, is not convertible to a BigDecimal, is zero, * or the result yields an infinite number of digits. */ - public function exactlyDividedBy($that) : BigDecimal + public function exactlyDividedBy(BigNumber|int|float|string $that) : BigDecimal { $that = BigDecimal::of($that); @@ -322,10 +296,6 @@ public function exactlyDividedBy($that) : BigDecimal * * The result has a scale of `$this->scale * $exponent`. * - * @param int $exponent The exponent. - * - * @return BigDecimal The result. - * * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. */ public function power(int $exponent) : BigDecimal @@ -350,17 +320,15 @@ public function power(int $exponent) : BigDecimal } /** - * Returns the quotient of the division of this number by this given one. + * Returns the quotient of the division of this number by the given one. * * The quotient has a scale of `0`. * * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. * - * @return BigDecimal The quotient. - * * @throws MathException If the divisor is not a valid decimal number, or is zero. */ - public function quotient($that) : BigDecimal + public function quotient(BigNumber|int|float|string $that) : BigDecimal { $that = BigDecimal::of($that); @@ -377,17 +345,15 @@ public function quotient($that) : BigDecimal } /** - * Returns the remainder of the division of this number by this given one. + * Returns the remainder of the division of this number by the given one. * * The remainder has a scale of `max($this->scale, $that->scale)`. * * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigDecimal. * - * @return BigDecimal The remainder. - * * @throws MathException If the divisor is not a valid decimal number, or is zero. */ - public function remainder($that) : BigDecimal + public function remainder(BigNumber|int|float|string $that) : BigDecimal { $that = BigDecimal::of($that); @@ -414,9 +380,11 @@ public function remainder($that) : BigDecimal * * @return BigDecimal[] An array containing the quotient and the remainder. * + * @psalm-return array{BigDecimal, BigDecimal} + * * @throws MathException If the divisor is not a valid decimal number, or is zero. */ - public function quotientAndRemainder($that) : array + public function quotientAndRemainder(BigNumber|int|float|string $that) : array { $that = BigDecimal::of($that); @@ -440,10 +408,6 @@ public function quotientAndRemainder($that) : array /** * Returns the square root of this number, rounded down to the given number of decimals. * - * @param int $scale - * - * @return BigDecimal - * * @throws \InvalidArgumentException If the scale is negative. * @throws NegativeNumberException If this number is negative. */ @@ -484,10 +448,6 @@ public function sqrt(int $scale) : BigDecimal /** * Returns a copy of this BigDecimal with the decimal point moved $n places to the left. - * - * @param int $n - * - * @return BigDecimal */ public function withPointMovedLeft(int $n) : BigDecimal { @@ -504,10 +464,6 @@ public function withPointMovedLeft(int $n) : BigDecimal /** * Returns a copy of this BigDecimal with the decimal point moved $n places to the right. - * - * @param int $n - * - * @return BigDecimal */ public function withPointMovedRight(int $n) : BigDecimal { @@ -534,8 +490,6 @@ public function withPointMovedRight(int $n) : BigDecimal /** * Returns a copy of this BigDecimal with any trailing zeros removed from the fractional part. - * - * @return BigDecimal */ public function stripTrailingZeros() : BigDecimal { @@ -567,8 +521,6 @@ public function stripTrailingZeros() : BigDecimal /** * Returns the absolute value of this number. - * - * @return BigDecimal */ public function abs() : BigDecimal { @@ -577,18 +529,13 @@ public function abs() : BigDecimal /** * Returns the negated value of this number. - * - * @return BigDecimal */ public function negated() : BigDecimal { return new BigDecimal(Calculator::get()->neg($this->value), $this->scale); } - /** - * {@inheritdoc} - */ - public function compareTo($that) : int + public function compareTo(BigNumber|int|float|string $that) : int { $that = BigNumber::of($that); @@ -605,25 +552,16 @@ public function compareTo($that) : int return - $that->compareTo($this); } - /** - * {@inheritdoc} - */ public function getSign() : int { return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); } - /** - * @return BigInteger - */ public function getUnscaledValue() : BigInteger { - return BigInteger::create($this->value); + return self::newBigInteger($this->value); } - /** - * @return int - */ public function getScale() : int { return $this->scale; @@ -633,8 +571,6 @@ public function getScale() : int * Returns a string representing the integral part of this decimal number. * * Example: `-123.456` => `-123`. - * - * @return string */ public function getIntegralPart() : string { @@ -653,8 +589,6 @@ public function getIntegralPart() : string * If the scale is zero, an empty string is returned. * * Examples: `-123.456` => '456', `123` => ''. - * - * @return string */ public function getFractionalPart() : string { @@ -669,47 +603,33 @@ public function getFractionalPart() : string /** * Returns whether this decimal number has a non-zero fractional part. - * - * @return bool */ public function hasNonZeroFractionalPart() : bool { return $this->getFractionalPart() !== \str_repeat('0', $this->scale); } - /** - * {@inheritdoc} - */ public function toBigInteger() : BigInteger { $zeroScaleDecimal = $this->scale === 0 ? $this : $this->dividedBy(1, 0); - return BigInteger::create($zeroScaleDecimal->value); + return self::newBigInteger($zeroScaleDecimal->value); } - /** - * {@inheritdoc} - */ public function toBigDecimal() : BigDecimal { return $this; } - /** - * {@inheritdoc} - */ public function toBigRational() : BigRational { - $numerator = BigInteger::create($this->value); - $denominator = BigInteger::create('1' . \str_repeat('0', $this->scale)); + $numerator = self::newBigInteger($this->value); + $denominator = self::newBigInteger('1' . \str_repeat('0', $this->scale)); - return BigRational::create($numerator, $denominator, false); + return self::newBigRational($numerator, $denominator, false); } - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal { if ($scale === $this->scale) { return $this; @@ -718,25 +638,16 @@ public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSAR return $this->dividedBy(BigDecimal::one(), $scale, $roundingMode); } - /** - * {@inheritdoc} - */ public function toInt() : int { return $this->toBigInteger()->toInt(); } - /** - * {@inheritdoc} - */ public function toFloat() : float { return (float) (string) $this; } - /** - * {@inheritdoc} - */ public function __toString() : string { if ($this->scale === 0) { @@ -768,8 +679,6 @@ public function __serialize(): array * * @param array{value: string, scale: int} $data * - * @return void - * * @throws \LogicException */ public function __unserialize(array $data): void @@ -782,48 +691,9 @@ public function __unserialize(array $data): void $this->scale = $data['scale']; } - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->value . ':' . $this->scale; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->value)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - [$value, $scale] = \explode(':', $value); - - $this->value = $value; - $this->scale = (int) $scale; - } - /** * Puts the internal values of the given decimal numbers on the same scale. * - * @param BigDecimal $x The first decimal number. - * @param BigDecimal $y The second decimal number. - * * @return array{string, string} The scaled integer values of $x and $y. */ private function scaleValues(BigDecimal $x, BigDecimal $y) : array @@ -840,11 +710,6 @@ private function scaleValues(BigDecimal $x, BigDecimal $y) : array return [$a, $b]; } - /** - * @param int $scale - * - * @return string - */ private function valueWithMinScale(int $scale) : string { $value = $this->value; @@ -858,8 +723,6 @@ private function valueWithMinScale(int $scale) : string /** * Adds leading zeros if necessary to the unscaled value to represent the full decimal number. - * - * @return string */ private function getUnscaledValueWithLeadingZeros() : string { diff --git a/api/vendor/brick/math/src/BigInteger.php b/api/vendor/brick/math/src/BigInteger.php index f58e1c5953..73dcc89a20 100644 --- a/api/vendor/brick/math/src/BigInteger.php +++ b/api/vendor/brick/math/src/BigInteger.php @@ -27,7 +27,7 @@ final class BigInteger extends BigNumber * No leading zeros must be present. * No leading minus sign must be present if the number is zero. */ - private string $value; + private readonly string $value; /** * Protected constructor. Use a factory method to obtain an instance. @@ -40,19 +40,11 @@ protected function __construct(string $value) } /** - * Creates a BigInteger of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigInteger - * - * @throws MathException If the value cannot be converted to a BigInteger. - * * @psalm-pure */ - public static function of($value) : BigNumber + protected static function from(BigNumber $number): static { - return parent::of($value)->toBigInteger(); + return $number->toBigInteger(); } /** @@ -69,8 +61,6 @@ public static function of($value) : BigNumber * @param string $number The number to convert, in the given base. * @param int $base The base of the number, between 2 and 36. * - * @return BigInteger - * * @throws NumberFormatException If the number is empty, or contains invalid chars for the given base. * @throws \InvalidArgumentException If the base is out of range. * @@ -136,8 +126,6 @@ public static function fromBase(string $number, int $base) : BigInteger * @param string $number The number to parse. * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. * - * @return BigInteger - * * @throws NumberFormatException If the given number is empty or contains invalid chars for the given alphabet. * @throws \InvalidArgumentException If the alphabet does not contain at least 2 chars. * @@ -181,8 +169,6 @@ public static function fromArbitraryBase(string $number, string $alphabet) : Big * @param bool $signed Whether to interpret as a signed number in two's-complement representation with a leading * sign bit. * - * @return BigInteger - * * @throws NumberFormatException If the string is empty. */ public static function fromBytes(string $value, bool $signed = true) : BigInteger @@ -215,15 +201,13 @@ public static function fromBytes(string $value, bool $signed = true) : BigIntege * * Using the default random bytes generator, this method is suitable for cryptographic use. * - * @psalm-param callable(int): string $randomBytesGenerator + * @psalm-param (callable(int): string)|null $randomBytesGenerator * * @param int $numBits The number of bits. * @param callable|null $randomBytesGenerator A function that accepts a number of bytes as an integer, and returns a * string of random bytes of the given length. Defaults to the * `random_bytes()` function. * - * @return BigInteger - * * @throws \InvalidArgumentException If $numBits is negative. */ public static function randomBits(int $numBits, ?callable $randomBytesGenerator = null) : BigInteger @@ -237,9 +221,10 @@ public static function randomBits(int $numBits, ?callable $randomBytesGenerator } if ($randomBytesGenerator === null) { - $randomBytesGenerator = 'random_bytes'; + $randomBytesGenerator = random_bytes(...); } + /** @var int<1, max> $byteLength */ $byteLength = \intdiv($numBits - 1, 8) + 1; $extraBits = ($byteLength * 8 - $numBits); @@ -264,13 +249,14 @@ public static function randomBits(int $numBits, ?callable $randomBytesGenerator * and returns a string of random bytes of the given length. * Defaults to the `random_bytes()` function. * - * @return BigInteger - * * @throws MathException If one of the parameters cannot be converted to a BigInteger, * or `$min` is greater than `$max`. */ - public static function randomRange($min, $max, ?callable $randomBytesGenerator = null) : BigInteger - { + public static function randomRange( + BigNumber|int|float|string $min, + BigNumber|int|float|string $max, + ?callable $randomBytesGenerator = null + ) : BigInteger { $min = BigInteger::of($min); $max = BigInteger::of($max); @@ -296,8 +282,6 @@ public static function randomRange($min, $max, ?callable $randomBytesGenerator = /** * Returns a BigInteger representing zero. * - * @return BigInteger - * * @psalm-pure */ public static function zero() : BigInteger @@ -318,8 +302,6 @@ public static function zero() : BigInteger /** * Returns a BigInteger representing one. * - * @return BigInteger - * * @psalm-pure */ public static function one() : BigInteger @@ -340,8 +322,6 @@ public static function one() : BigInteger /** * Returns a BigInteger representing ten. * - * @return BigInteger - * * @psalm-pure */ public static function ten() : BigInteger @@ -379,11 +359,9 @@ public static function gcdMultiple(BigInteger $a, BigInteger ...$n): BigInteger * * @param BigNumber|int|float|string $that The number to add. Must be convertible to a BigInteger. * - * @return BigInteger The result. - * * @throws MathException If the number is not valid, or is not convertible to a BigInteger. */ - public function plus($that) : BigInteger + public function plus(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -405,11 +383,9 @@ public function plus($that) : BigInteger * * @param BigNumber|int|float|string $that The number to subtract. Must be convertible to a BigInteger. * - * @return BigInteger The result. - * * @throws MathException If the number is not valid, or is not convertible to a BigInteger. */ - public function minus($that) : BigInteger + public function minus(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -427,11 +403,9 @@ public function minus($that) : BigInteger * * @param BigNumber|int|float|string $that The multiplier. Must be convertible to a BigInteger. * - * @return BigInteger The result. - * * @throws MathException If the multiplier is not a valid number, or is not convertible to a BigInteger. */ - public function multipliedBy($that) : BigInteger + public function multipliedBy(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -452,14 +426,12 @@ public function multipliedBy($that) : BigInteger * Returns the result of the division of this number by the given one. * * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. - * @param int $roundingMode An optional rounding mode. - * - * @return BigInteger The result. + * @param RoundingMode $roundingMode An optional rounding mode, defaults to UNNECESSARY. * * @throws MathException If the divisor is not a valid number, is not convertible to a BigInteger, is zero, * or RoundingMode::UNNECESSARY is used and the remainder is not zero. */ - public function dividedBy($that, int $roundingMode = RoundingMode::UNNECESSARY) : BigInteger + public function dividedBy(BigNumber|int|float|string $that, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigInteger { $that = BigInteger::of($that); @@ -479,10 +451,6 @@ public function dividedBy($that, int $roundingMode = RoundingMode::UNNECESSARY) /** * Returns this number exponentiated to the given value. * - * @param int $exponent The exponent. - * - * @return BigInteger The result. - * * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. */ public function power(int $exponent) : BigInteger @@ -511,11 +479,9 @@ public function power(int $exponent) : BigInteger * * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. * - * @return BigInteger - * * @throws DivisionByZeroException If the divisor is zero. */ - public function quotient($that) : BigInteger + public function quotient(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -539,11 +505,9 @@ public function quotient($that) : BigInteger * * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. * - * @return BigInteger - * * @throws DivisionByZeroException If the divisor is zero. */ - public function remainder($that) : BigInteger + public function remainder(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -567,9 +531,11 @@ public function remainder($that) : BigInteger * * @return BigInteger[] An array containing the quotient and the remainder. * + * @psalm-return array{BigInteger, BigInteger} + * * @throws DivisionByZeroException If the divisor is zero. */ - public function quotientAndRemainder($that) : array + public function quotientAndRemainder(BigNumber|int|float|string $that) : array { $that = BigInteger::of($that); @@ -595,11 +561,9 @@ public function quotientAndRemainder($that) : array * * @param BigNumber|int|float|string $that The divisor. Must be convertible to a BigInteger. * - * @return BigInteger - * * @throws DivisionByZeroException If the divisor is zero. */ - public function mod($that) : BigInteger + public function mod(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -615,10 +579,6 @@ public function mod($that) : BigInteger /** * Returns the modular multiplicative inverse of this BigInteger modulo $m. * - * @param BigInteger $m - * - * @return BigInteger - * * @throws DivisionByZeroException If $m is zero. * @throws NegativeNumberException If $m is negative. * @throws MathException If this BigInteger has no multiplicative inverse mod m (that is, this BigInteger @@ -655,12 +615,10 @@ public function modInverse(BigInteger $m) : BigInteger * @param BigNumber|int|float|string $exp The exponent. Must be positive or zero. * @param BigNumber|int|float|string $mod The modulus. Must be strictly positive. * - * @return BigInteger - * * @throws NegativeNumberException If any of the operands is negative. * @throws DivisionByZeroException If the modulus is zero. */ - public function modPow($exp, $mod) : BigInteger + public function modPow(BigNumber|int|float|string $exp, BigNumber|int|float|string $mod) : BigInteger { $exp = BigInteger::of($exp); $mod = BigInteger::of($mod); @@ -684,10 +642,8 @@ public function modPow($exp, $mod) : BigInteger * The GCD is always positive, unless both operands are zero, in which case it is zero. * * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger */ - public function gcd($that) : BigInteger + public function gcd(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -709,8 +665,6 @@ public function gcd($that) : BigInteger * * The result is the largest x such that x² ≤ n. * - * @return BigInteger - * * @throws NegativeNumberException If this number is negative. */ public function sqrt() : BigInteger @@ -726,8 +680,6 @@ public function sqrt() : BigInteger /** * Returns the absolute value of this number. - * - * @return BigInteger */ public function abs() : BigInteger { @@ -736,8 +688,6 @@ public function abs() : BigInteger /** * Returns the inverse of this number. - * - * @return BigInteger */ public function negated() : BigInteger { @@ -750,10 +700,8 @@ public function negated() : BigInteger * This method returns a negative BigInteger if and only if both operands are negative. * * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger */ - public function and($that) : BigInteger + public function and(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -766,10 +714,8 @@ public function and($that) : BigInteger * This method returns a negative BigInteger if and only if either of the operands is negative. * * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger */ - public function or($that) : BigInteger + public function or(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -782,10 +728,8 @@ public function or($that) : BigInteger * This method returns a negative BigInteger if and only if exactly one of the operands is negative. * * @param BigNumber|int|float|string $that The operand. Must be convertible to an integer number. - * - * @return BigInteger */ - public function xor($that) : BigInteger + public function xor(BigNumber|int|float|string $that) : BigInteger { $that = BigInteger::of($that); @@ -794,8 +738,6 @@ public function xor($that) : BigInteger /** * Returns the bitwise-not of this BigInteger. - * - * @return BigInteger */ public function not() : BigInteger { @@ -804,10 +746,6 @@ public function not() : BigInteger /** * Returns the integer left shifted by a given number of bits. - * - * @param int $distance The distance to shift. - * - * @return BigInteger */ public function shiftedLeft(int $distance) : BigInteger { @@ -824,10 +762,6 @@ public function shiftedLeft(int $distance) : BigInteger /** * Returns the integer right shifted by a given number of bits. - * - * @param int $distance The distance to shift. - * - * @return BigInteger */ public function shiftedRight(int $distance) : BigInteger { @@ -853,8 +787,6 @@ public function shiftedRight(int $distance) : BigInteger * * For positive BigIntegers, this is equivalent to the number of bits in the ordinary binary representation. * Computes (ceil(log2(this < 0 ? -this : this+1))). - * - * @return int */ public function getBitLength() : int { @@ -873,8 +805,6 @@ public function getBitLength() : int * Returns the index of the rightmost (lowest-order) one bit in this BigInteger. * * Returns -1 if this BigInteger contains no one bits. - * - * @return int */ public function getLowestSetBit() : int { @@ -894,8 +824,6 @@ public function getLowestSetBit() : int /** * Returns whether this number is even. - * - * @return bool */ public function isEven() : bool { @@ -904,8 +832,6 @@ public function isEven() : bool /** * Returns whether this number is odd. - * - * @return bool */ public function isOdd() : bool { @@ -919,8 +845,6 @@ public function isOdd() : bool * * @param int $n The bit to test, 0-based. * - * @return bool - * * @throws \InvalidArgumentException If the bit to test is negative. */ public function testBit(int $n) : bool @@ -932,10 +856,7 @@ public function testBit(int $n) : bool return $this->shiftedRight($n)->isOdd(); } - /** - * {@inheritdoc} - */ - public function compareTo($that) : int + public function compareTo(BigNumber|int|float|string $that) : int { $that = BigNumber::of($that); @@ -946,49 +867,31 @@ public function compareTo($that) : int return - $that->compareTo($this); } - /** - * {@inheritdoc} - */ public function getSign() : int { return ($this->value === '0') ? 0 : (($this->value[0] === '-') ? -1 : 1); } - /** - * {@inheritdoc} - */ public function toBigInteger() : BigInteger { return $this; } - /** - * {@inheritdoc} - */ public function toBigDecimal() : BigDecimal { - return BigDecimal::create($this->value); + return self::newBigDecimal($this->value); } - /** - * {@inheritdoc} - */ public function toBigRational() : BigRational { - return BigRational::create($this, BigInteger::one(), false); + return self::newBigRational($this, BigInteger::one(), false); } - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal { return $this->toBigDecimal()->toScale($scale, $roundingMode); } - /** - * {@inheritdoc} - */ public function toInt() : int { $intValue = (int) $this->value; @@ -1000,9 +903,6 @@ public function toInt() : int return $intValue; } - /** - * {@inheritdoc} - */ public function toFloat() : float { return (float) $this->value; @@ -1013,10 +913,6 @@ public function toFloat() : float * * The output will always be lowercase for bases greater than 10. * - * @param int $base - * - * @return string - * * @throws \InvalidArgumentException If the base is out of range. */ public function toBase(int $base) : string @@ -1040,8 +936,6 @@ public function toBase(int $base) : string * * @param string $alphabet The alphabet, for example '01' for base 2, or '01234567' for base 8. * - * @return string - * * @throws NegativeNumberException If this number is negative. * @throws \InvalidArgumentException If the given alphabet does not contain at least 2 chars. */ @@ -1076,8 +970,6 @@ public function toArbitraryBase(string $alphabet) : string * * @param bool $signed Whether to output a signed number in two's-complement representation with a leading sign bit. * - * @return string - * * @throws NegativeNumberException If $signed is false, and the number is negative. */ public function toBytes(bool $signed = true) : string @@ -1121,9 +1013,6 @@ public function toBytes(bool $signed = true) : string return \hex2bin($hex); } - /** - * {@inheritdoc} - */ public function __toString() : string { return $this->value; @@ -1149,8 +1038,6 @@ public function __serialize(): array * * @param array{value: string} $data * - * @return void - * * @throws \LogicException */ public function __unserialize(array $data): void @@ -1161,37 +1048,4 @@ public function __unserialize(array $data): void $this->value = $data['value']; } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->value; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->value)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - $this->value = $value; - } } diff --git a/api/vendor/brick/math/src/BigNumber.php b/api/vendor/brick/math/src/BigNumber.php index 44f26e35ae..5a0df78378 100644 --- a/api/vendor/brick/math/src/BigNumber.php +++ b/api/vendor/brick/math/src/BigNumber.php @@ -14,26 +14,29 @@ * * @psalm-immutable */ -abstract class BigNumber implements \Serializable, \JsonSerializable +abstract class BigNumber implements \JsonSerializable { /** - * The regular expression used to parse integer, decimal and rational numbers. + * The regular expression used to parse integer or decimal numbers. */ - private const PARSE_REGEXP = + private const PARSE_REGEXP_NUMERICAL = '/^' . '(?[\-\+])?' . - '(?:' . - '(?:' . - '(?[0-9]+)?' . - '(?\.)?' . - '(?[0-9]+)?' . - '(?:[eE](?[\-\+]?[0-9]+))?' . - ')|(?:' . - '(?[0-9]+)' . - '\/?' . - '(?[0-9]+)' . - ')' . - ')' . + '(?[0-9]+)?' . + '(?\.)?' . + '(?[0-9]+)?' . + '(?:[eE](?[\-\+]?[0-9]+))?' . + '$/'; + + /** + * The regular expression used to parse rational numbers. + */ + private const PARSE_REGEXP_RATIONAL = + '/^' . + '(?[\-\+])?' . + '(?[0-9]+)' . + '\/?' . + '(?[0-9]+)' . '$/'; /** @@ -48,16 +51,29 @@ abstract class BigNumber implements \Serializable, \JsonSerializable * - strings containing a `.` character or using an exponential notation are returned as BigDecimal * - strings containing only digits with an optional leading `+` or `-` sign are returned as BigInteger * - * @param BigNumber|int|float|string $value - * - * @return BigNumber - * * @throws NumberFormatException If the format of the number is not valid. * @throws DivisionByZeroException If the value represents a rational number with a denominator of zero. * * @psalm-pure */ - public static function of($value) : BigNumber + final public static function of(BigNumber|int|float|string $value) : static + { + $value = self::_of($value); + + if (static::class === BigNumber::class) { + // https://github.com/vimeo/psalm/issues/10309 + assert($value instanceof static); + + return $value; + } + + return static::from($value); + } + + /** + * @psalm-pure + */ + private static function _of(BigNumber|int|float|string $value) : BigNumber { if ($value instanceof BigNumber) { return $value; @@ -67,35 +83,25 @@ public static function of($value) : BigNumber return new BigInteger((string) $value); } - /** @psalm-suppress RedundantCastGivenDocblockType We cannot trust the untyped $value here! */ - $value = \is_float($value) ? self::floatToString($value) : (string) $value; - - $throw = static function() use ($value) : void { - throw new NumberFormatException(\sprintf( - 'The given value "%s" does not represent a valid number.', - $value - )); - }; - - if (\preg_match(self::PARSE_REGEXP, $value, $matches) !== 1) { - $throw(); + if (is_float($value)) { + $value = (string) $value; } - $getMatch = static fn(string $value): ?string => (($matches[$value] ?? '') !== '') ? $matches[$value] : null; + if (str_contains($value, '/')) { + // Rational number + if (\preg_match(self::PARSE_REGEXP_RATIONAL, $value, $matches, PREG_UNMATCHED_AS_NULL) !== 1) { + throw NumberFormatException::invalidFormat($value); + } - $sign = $getMatch('sign'); - $numerator = $getMatch('numerator'); - $denominator = $getMatch('denominator'); + $sign = $matches['sign']; + $numerator = $matches['numerator']; + $denominator = $matches['denominator']; - if ($numerator !== null) { + assert($numerator !== null); assert($denominator !== null); - if ($sign !== null) { - $numerator = $sign . $numerator; - } - - $numerator = self::cleanUp($numerator); - $denominator = self::cleanUp($denominator); + $numerator = self::cleanUp($sign, $numerator); + $denominator = self::cleanUp(null, $denominator); if ($denominator === '0') { throw DivisionByZeroException::denominatorMustNotBeZero(); @@ -106,88 +112,94 @@ public static function of($value) : BigNumber new BigInteger($denominator), false ); - } + } else { + // Integer or decimal number + if (\preg_match(self::PARSE_REGEXP_NUMERICAL, $value, $matches, PREG_UNMATCHED_AS_NULL) !== 1) { + throw NumberFormatException::invalidFormat($value); + } - $point = $getMatch('point'); - $integral = $getMatch('integral'); - $fractional = $getMatch('fractional'); - $exponent = $getMatch('exponent'); + $sign = $matches['sign']; + $point = $matches['point']; + $integral = $matches['integral']; + $fractional = $matches['fractional']; + $exponent = $matches['exponent']; - if ($integral === null && $fractional === null) { - $throw(); - } + if ($integral === null && $fractional === null) { + throw NumberFormatException::invalidFormat($value); + } - if ($integral === null) { - $integral = '0'; - } + if ($integral === null) { + $integral = '0'; + } - if ($point !== null || $exponent !== null) { - $fractional = ($fractional ?? ''); - $exponent = ($exponent !== null) ? (int) $exponent : 0; + if ($point !== null || $exponent !== null) { + $fractional = ($fractional ?? ''); + $exponent = ($exponent !== null) ? (int)$exponent : 0; - if ($exponent === PHP_INT_MIN || $exponent === PHP_INT_MAX) { - throw new NumberFormatException('Exponent too large.'); - } + if ($exponent === PHP_INT_MIN || $exponent === PHP_INT_MAX) { + throw new NumberFormatException('Exponent too large.'); + } - $unscaledValue = self::cleanUp(($sign ?? ''). $integral . $fractional); + $unscaledValue = self::cleanUp($sign, $integral . $fractional); - $scale = \strlen($fractional) - $exponent; + $scale = \strlen($fractional) - $exponent; - if ($scale < 0) { - if ($unscaledValue !== '0') { - $unscaledValue .= \str_repeat('0', - $scale); + if ($scale < 0) { + if ($unscaledValue !== '0') { + $unscaledValue .= \str_repeat('0', -$scale); + } + $scale = 0; } - $scale = 0; - } - return new BigDecimal($unscaledValue, $scale); - } + return new BigDecimal($unscaledValue, $scale); + } - $integral = self::cleanUp(($sign ?? '') . $integral); + $integral = self::cleanUp($sign, $integral); - return new BigInteger($integral); + return new BigInteger($integral); + } } /** - * Safely converts float to string, avoiding locale-dependent issues. - * - * @see https://github.com/brick/math/pull/20 + * Overridden by subclasses to convert a BigNumber to an instance of the subclass. * - * @param float $float + * @throws MathException If the value cannot be converted. * - * @return string + * @psalm-pure + */ + abstract protected static function from(BigNumber $number): static; + + /** + * Proxy method to access BigInteger's protected constructor from sibling classes. * + * @internal * @psalm-pure - * @psalm-suppress ImpureFunctionCall */ - private static function floatToString(float $float) : string + final protected function newBigInteger(string $value) : BigInteger { - $currentLocale = \setlocale(LC_NUMERIC, '0'); - \setlocale(LC_NUMERIC, 'C'); - - $result = (string) $float; - - \setlocale(LC_NUMERIC, $currentLocale); - - return $result; + return new BigInteger($value); } /** - * Proxy method to access protected constructors from sibling classes. + * Proxy method to access BigDecimal's protected constructor from sibling classes. * * @internal + * @psalm-pure + */ + final protected function newBigDecimal(string $value, int $scale = 0) : BigDecimal + { + return new BigDecimal($value, $scale); + } + + /** + * Proxy method to access BigRational's protected constructor from sibling classes. * - * @param mixed ...$args The arguments to the constructor. - * - * @return static - * + * @internal * @psalm-pure - * @psalm-suppress TooManyArguments - * @psalm-suppress UnsafeInstantiation */ - protected static function create(... $args) : BigNumber + final protected function newBigRational(BigInteger $numerator, BigInteger $denominator, bool $checkDenominator) : BigRational { - return new static(... $args); + return new BigRational($numerator, $denominator, $checkDenominator); } /** @@ -196,16 +208,12 @@ protected static function create(... $args) : BigNumber * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible * to an instance of the class this method is called on. * - * @return static The minimum value. - * * @throws \InvalidArgumentException If no values are given. * @throws MathException If an argument is not valid. * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType * @psalm-pure */ - public static function min(...$values) : BigNumber + final public static function min(BigNumber|int|float|string ...$values) : static { $min = null; @@ -230,16 +238,12 @@ public static function min(...$values) : BigNumber * @param BigNumber|int|float|string ...$values The numbers to compare. All the numbers need to be convertible * to an instance of the class this method is called on. * - * @return static The maximum value. - * * @throws \InvalidArgumentException If no values are given. * @throws MathException If an argument is not valid. * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType * @psalm-pure */ - public static function max(...$values) : BigNumber + final public static function max(BigNumber|int|float|string ...$values) : static { $max = null; @@ -264,18 +268,14 @@ public static function max(...$values) : BigNumber * @param BigNumber|int|float|string ...$values The numbers to add. All the numbers need to be convertible * to an instance of the class this method is called on. * - * @return static The sum. - * * @throws \InvalidArgumentException If no values are given. * @throws MathException If an argument is not valid. * - * @psalm-suppress LessSpecificReturnStatement - * @psalm-suppress MoreSpecificReturnType * @psalm-pure */ - public static function sum(...$values) : BigNumber + final public static function sum(BigNumber|int|float|string ...$values) : static { - /** @var BigNumber|null $sum */ + /** @var static|null $sum */ $sum = null; foreach ($values as $value) { @@ -299,11 +299,6 @@ public static function sum(...$values) : BigNumber * depending on their ability to perform the operation. This will also require a version bump because we're * potentially breaking custom BigNumber implementations (if any...) * - * @param BigNumber $a - * @param BigNumber $b - * - * @return BigNumber - * * @psalm-pure */ private static function add(BigNumber $a, BigNumber $b) : BigNumber @@ -330,141 +325,100 @@ private static function add(BigNumber $a, BigNumber $b) : BigNumber } /** - * Removes optional leading zeros and + sign from the given number. - * - * @param string $number The number, validated as a non-empty string of digits with optional leading sign. + * Removes optional leading zeros and applies sign. * - * @return string + * @param string|null $sign The sign, '+' or '-', optional. Null is allowed for convenience and treated as '+'. + * @param string $number The number, validated as a non-empty string of digits. * * @psalm-pure */ - private static function cleanUp(string $number) : string + private static function cleanUp(string|null $sign, string $number) : string { - $firstChar = $number[0]; - - if ($firstChar === '+' || $firstChar === '-') { - $number = \substr($number, 1); - } - $number = \ltrim($number, '0'); if ($number === '') { return '0'; } - if ($firstChar === '-') { - return '-' . $number; - } - - return $number; + return $sign === '-' ? '-' . $number : $number; } /** * Checks if this number is equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool */ - public function isEqualTo($that) : bool + final public function isEqualTo(BigNumber|int|float|string $that) : bool { return $this->compareTo($that) === 0; } /** * Checks if this number is strictly lower than the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool */ - public function isLessThan($that) : bool + final public function isLessThan(BigNumber|int|float|string $that) : bool { return $this->compareTo($that) < 0; } /** * Checks if this number is lower than or equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool */ - public function isLessThanOrEqualTo($that) : bool + final public function isLessThanOrEqualTo(BigNumber|int|float|string $that) : bool { return $this->compareTo($that) <= 0; } /** * Checks if this number is strictly greater than the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool */ - public function isGreaterThan($that) : bool + final public function isGreaterThan(BigNumber|int|float|string $that) : bool { return $this->compareTo($that) > 0; } /** * Checks if this number is greater than or equal to the given one. - * - * @param BigNumber|int|float|string $that - * - * @return bool */ - public function isGreaterThanOrEqualTo($that) : bool + final public function isGreaterThanOrEqualTo(BigNumber|int|float|string $that) : bool { return $this->compareTo($that) >= 0; } /** * Checks if this number equals zero. - * - * @return bool */ - public function isZero() : bool + final public function isZero() : bool { return $this->getSign() === 0; } /** * Checks if this number is strictly negative. - * - * @return bool */ - public function isNegative() : bool + final public function isNegative() : bool { return $this->getSign() < 0; } /** * Checks if this number is negative or zero. - * - * @return bool */ - public function isNegativeOrZero() : bool + final public function isNegativeOrZero() : bool { return $this->getSign() <= 0; } /** * Checks if this number is strictly positive. - * - * @return bool */ - public function isPositive() : bool + final public function isPositive() : bool { return $this->getSign() > 0; } /** * Checks if this number is positive or zero. - * - * @return bool */ - public function isPositiveOrZero() : bool + final public function isPositiveOrZero() : bool { return $this->getSign() >= 0; } @@ -472,6 +426,8 @@ public function isPositiveOrZero() : bool /** * Returns the sign of this number. * + * @psalm-return -1|0|1 + * * @return int -1 if the number is negative, 0 if zero, 1 if positive. */ abstract public function getSign() : int; @@ -479,19 +435,17 @@ abstract public function getSign() : int; /** * Compares this number to the given one. * - * @param BigNumber|int|float|string $that + * @psalm-return -1|0|1 * - * @return int [-1,0,1] If `$this` is lower than, equal to, or greater than `$that`. + * @return int -1 if `$this` is lower than, 0 if equal to, 1 if greater than `$that`. * * @throws MathException If the number is not valid. */ - abstract public function compareTo($that) : int; + abstract public function compareTo(BigNumber|int|float|string $that) : int; /** * Converts this number to a BigInteger. * - * @return BigInteger The converted number. - * * @throws RoundingNecessaryException If this number cannot be converted to a BigInteger without rounding. */ abstract public function toBigInteger() : BigInteger; @@ -499,31 +453,25 @@ abstract public function toBigInteger() : BigInteger; /** * Converts this number to a BigDecimal. * - * @return BigDecimal The converted number. - * * @throws RoundingNecessaryException If this number cannot be converted to a BigDecimal without rounding. */ abstract public function toBigDecimal() : BigDecimal; /** * Converts this number to a BigRational. - * - * @return BigRational The converted number. */ abstract public function toBigRational() : BigRational; /** * Converts this number to a BigDecimal with the given scale, using rounding if necessary. * - * @param int $scale The scale of the resulting `BigDecimal`. - * @param int $roundingMode A `RoundingMode` constant. - * - * @return BigDecimal + * @param int $scale The scale of the resulting `BigDecimal`. + * @param RoundingMode $roundingMode An optional rounding mode, defaults to UNNECESSARY. * * @throws RoundingNecessaryException If this number cannot be converted to the given scale without rounding. * This only applies when RoundingMode::UNNECESSARY is used. */ - abstract public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal; + abstract public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal; /** * Returns the exact value of this number as a native integer. @@ -531,8 +479,6 @@ abstract public function toScale(int $scale, int $roundingMode = RoundingMode::U * If this number cannot be converted to a native integer without losing precision, an exception is thrown. * Note that the acceptable range for an integer depends on the platform and differs for 32-bit and 64-bit. * - * @return int The converted value. - * * @throws MathException If this number cannot be exactly converted to a native integer. */ abstract public function toInt() : int; @@ -545,8 +491,6 @@ abstract public function toInt() : int; * * If the number is greater than the largest representable floating point number, positive infinity is returned. * If the number is less than the smallest representable floating point number, negative infinity is returned. - * - * @return float The converted value. */ abstract public function toFloat() : float; @@ -555,15 +499,10 @@ abstract public function toFloat() : float; * * The output of this method can be parsed by the `of()` factory method; * this will yield an object equal to this one, without any information loss. - * - * @return string */ abstract public function __toString() : string; - /** - * {@inheritdoc} - */ - public function jsonSerialize() : string + final public function jsonSerialize() : string { return $this->__toString(); } diff --git a/api/vendor/brick/math/src/BigRational.php b/api/vendor/brick/math/src/BigRational.php index 46257814d0..fc3060ede5 100644 --- a/api/vendor/brick/math/src/BigRational.php +++ b/api/vendor/brick/math/src/BigRational.php @@ -21,12 +21,12 @@ final class BigRational extends BigNumber /** * The numerator. */ - private BigInteger $numerator; + private readonly BigInteger $numerator; /** * The denominator. Always strictly positive. */ - private BigInteger $denominator; + private readonly BigInteger $denominator; /** * Protected constructor. Use a factory method to obtain an instance. @@ -55,19 +55,11 @@ protected function __construct(BigInteger $numerator, BigInteger $denominator, b } /** - * Creates a BigRational of the given value. - * - * @param BigNumber|int|float|string $value - * - * @return BigRational - * - * @throws MathException If the value cannot be converted to a BigRational. - * * @psalm-pure */ - public static function of($value) : BigNumber + protected static function from(BigNumber $number): static { - return parent::of($value)->toBigRational(); + return $number->toBigRational(); } /** @@ -79,16 +71,16 @@ public static function of($value) : BigNumber * @param BigNumber|int|float|string $numerator The numerator. Must be convertible to a BigInteger. * @param BigNumber|int|float|string $denominator The denominator. Must be convertible to a BigInteger. * - * @return BigRational - * * @throws NumberFormatException If an argument does not represent a valid number. * @throws RoundingNecessaryException If an argument represents a non-integer number. * @throws DivisionByZeroException If the denominator is zero. * * @psalm-pure */ - public static function nd($numerator, $denominator) : BigRational - { + public static function nd( + BigNumber|int|float|string $numerator, + BigNumber|int|float|string $denominator, + ) : BigRational { $numerator = BigInteger::of($numerator); $denominator = BigInteger::of($denominator); @@ -98,8 +90,6 @@ public static function nd($numerator, $denominator) : BigRational /** * Returns a BigRational representing zero. * - * @return BigRational - * * @psalm-pure */ public static function zero() : BigRational @@ -120,8 +110,6 @@ public static function zero() : BigRational /** * Returns a BigRational representing one. * - * @return BigRational - * * @psalm-pure */ public static function one() : BigRational @@ -142,8 +130,6 @@ public static function one() : BigRational /** * Returns a BigRational representing ten. * - * @return BigRational - * * @psalm-pure */ public static function ten() : BigRational @@ -161,17 +147,11 @@ public static function ten() : BigRational return $ten; } - /** - * @return BigInteger - */ public function getNumerator() : BigInteger { return $this->numerator; } - /** - * @return BigInteger - */ public function getDenominator() : BigInteger { return $this->denominator; @@ -179,8 +159,6 @@ public function getDenominator() : BigInteger /** * Returns the quotient of the division of the numerator by the denominator. - * - * @return BigInteger */ public function quotient() : BigInteger { @@ -189,8 +167,6 @@ public function quotient() : BigInteger /** * Returns the remainder of the division of the numerator by the denominator. - * - * @return BigInteger */ public function remainder() : BigInteger { @@ -201,6 +177,8 @@ public function remainder() : BigInteger * Returns the quotient and remainder of the division of the numerator by the denominator. * * @return BigInteger[] + * + * @psalm-return array{BigInteger, BigInteger} */ public function quotientAndRemainder() : array { @@ -212,11 +190,9 @@ public function quotientAndRemainder() : array * * @param BigNumber|int|float|string $that The number to add. * - * @return BigRational The result. - * * @throws MathException If the number is not valid. */ - public function plus($that) : BigRational + public function plus(BigNumber|int|float|string $that) : BigRational { $that = BigRational::of($that); @@ -232,11 +208,9 @@ public function plus($that) : BigRational * * @param BigNumber|int|float|string $that The number to subtract. * - * @return BigRational The result. - * * @throws MathException If the number is not valid. */ - public function minus($that) : BigRational + public function minus(BigNumber|int|float|string $that) : BigRational { $that = BigRational::of($that); @@ -252,11 +226,9 @@ public function minus($that) : BigRational * * @param BigNumber|int|float|string $that The multiplier. * - * @return BigRational The result. - * * @throws MathException If the multiplier is not a valid number. */ - public function multipliedBy($that) : BigRational + public function multipliedBy(BigNumber|int|float|string $that) : BigRational { $that = BigRational::of($that); @@ -271,11 +243,9 @@ public function multipliedBy($that) : BigRational * * @param BigNumber|int|float|string $that The divisor. * - * @return BigRational The result. - * * @throws MathException If the divisor is not a valid number, or is zero. */ - public function dividedBy($that) : BigRational + public function dividedBy(BigNumber|int|float|string $that) : BigRational { $that = BigRational::of($that); @@ -288,10 +258,6 @@ public function dividedBy($that) : BigRational /** * Returns this number exponentiated to the given value. * - * @param int $exponent The exponent. - * - * @return BigRational The result. - * * @throws \InvalidArgumentException If the exponent is not in the range 0 to 1,000,000. */ public function power(int $exponent) : BigRational @@ -318,8 +284,6 @@ public function power(int $exponent) : BigRational * * The reciprocal has the numerator and denominator swapped. * - * @return BigRational - * * @throws DivisionByZeroException If the numerator is zero. */ public function reciprocal() : BigRational @@ -329,8 +293,6 @@ public function reciprocal() : BigRational /** * Returns the absolute value of this BigRational. - * - * @return BigRational */ public function abs() : BigRational { @@ -339,8 +301,6 @@ public function abs() : BigRational /** * Returns the negated value of this BigRational. - * - * @return BigRational */ public function negated() : BigRational { @@ -349,8 +309,6 @@ public function negated() : BigRational /** * Returns the simplified value of this BigRational. - * - * @return BigRational */ public function simplified() : BigRational { @@ -362,25 +320,16 @@ public function simplified() : BigRational return new BigRational($numerator, $denominator, false); } - /** - * {@inheritdoc} - */ - public function compareTo($that) : int + public function compareTo(BigNumber|int|float|string $that) : int { return $this->minus($that)->getSign(); } - /** - * {@inheritdoc} - */ public function getSign() : int { return $this->numerator->getSign(); } - /** - * {@inheritdoc} - */ public function toBigInteger() : BigInteger { $simplified = $this->simplified(); @@ -392,50 +341,32 @@ public function toBigInteger() : BigInteger return $simplified->numerator; } - /** - * {@inheritdoc} - */ public function toBigDecimal() : BigDecimal { return $this->numerator->toBigDecimal()->exactlyDividedBy($this->denominator); } - /** - * {@inheritdoc} - */ public function toBigRational() : BigRational { return $this; } - /** - * {@inheritdoc} - */ - public function toScale(int $scale, int $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal + public function toScale(int $scale, RoundingMode $roundingMode = RoundingMode::UNNECESSARY) : BigDecimal { return $this->numerator->toBigDecimal()->dividedBy($this->denominator, $scale, $roundingMode); } - /** - * {@inheritdoc} - */ public function toInt() : int { return $this->toBigInteger()->toInt(); } - /** - * {@inheritdoc} - */ public function toFloat() : float { $simplified = $this->simplified(); return $simplified->numerator->toFloat() / $simplified->denominator->toFloat(); } - /** - * {@inheritdoc} - */ public function __toString() : string { $numerator = (string) $this->numerator; @@ -468,8 +399,6 @@ public function __serialize(): array * * @param array{numerator: BigInteger, denominator: BigInteger} $data * - * @return void - * * @throws \LogicException */ public function __unserialize(array $data): void @@ -481,40 +410,4 @@ public function __unserialize(array $data): void $this->numerator = $data['numerator']; $this->denominator = $data['denominator']; } - - /** - * This method is required by interface Serializable and SHOULD NOT be accessed directly. - * - * @internal - * - * @return string - */ - public function serialize() : string - { - return $this->numerator . '/' . $this->denominator; - } - - /** - * This method is only here to implement interface Serializable and cannot be accessed directly. - * - * @internal - * @psalm-suppress RedundantPropertyInitializationCheck - * - * @param string $value - * - * @return void - * - * @throws \LogicException - */ - public function unserialize($value) : void - { - if (isset($this->numerator)) { - throw new \LogicException('unserialize() is an internal function, it must not be called directly.'); - } - - [$numerator, $denominator] = \explode('/', $value); - - $this->numerator = BigInteger::of($numerator); - $this->denominator = BigInteger::of($denominator); - } } diff --git a/api/vendor/brick/math/src/Exception/DivisionByZeroException.php b/api/vendor/brick/math/src/Exception/DivisionByZeroException.php index a4e4431765..ce7769ac2e 100644 --- a/api/vendor/brick/math/src/Exception/DivisionByZeroException.php +++ b/api/vendor/brick/math/src/Exception/DivisionByZeroException.php @@ -10,8 +10,6 @@ class DivisionByZeroException extends MathException { /** - * @return DivisionByZeroException - * * @psalm-pure */ public static function divisionByZero() : DivisionByZeroException @@ -20,8 +18,6 @@ public static function divisionByZero() : DivisionByZeroException } /** - * @return DivisionByZeroException - * * @psalm-pure */ public static function modulusMustNotBeZero() : DivisionByZeroException @@ -30,8 +26,6 @@ public static function modulusMustNotBeZero() : DivisionByZeroException } /** - * @return DivisionByZeroException - * * @psalm-pure */ public static function denominatorMustNotBeZero() : DivisionByZeroException diff --git a/api/vendor/brick/math/src/Exception/IntegerOverflowException.php b/api/vendor/brick/math/src/Exception/IntegerOverflowException.php index e0b07d3c73..c73b49097b 100644 --- a/api/vendor/brick/math/src/Exception/IntegerOverflowException.php +++ b/api/vendor/brick/math/src/Exception/IntegerOverflowException.php @@ -12,10 +12,6 @@ class IntegerOverflowException extends MathException { /** - * @param BigInteger $value - * - * @return IntegerOverflowException - * * @psalm-pure */ public static function toIntOverflow(BigInteger $value) : IntegerOverflowException diff --git a/api/vendor/brick/math/src/Exception/MathException.php b/api/vendor/brick/math/src/Exception/MathException.php index 21fda90e18..46e9c3fe4d 100644 --- a/api/vendor/brick/math/src/Exception/MathException.php +++ b/api/vendor/brick/math/src/Exception/MathException.php @@ -6,9 +6,7 @@ /** * Base class for all math exceptions. - * - * This class is abstract to ensure that only fine-grained exceptions are thrown throughout the code. */ -class MathException extends \RuntimeException +class MathException extends \Exception { } diff --git a/api/vendor/brick/math/src/Exception/NumberFormatException.php b/api/vendor/brick/math/src/Exception/NumberFormatException.php index 2fd0be73a6..119cadbb43 100644 --- a/api/vendor/brick/math/src/Exception/NumberFormatException.php +++ b/api/vendor/brick/math/src/Exception/NumberFormatException.php @@ -9,11 +9,17 @@ */ class NumberFormatException extends MathException { + public static function invalidFormat(string $value) : self + { + return new self(\sprintf( + 'The given value "%s" does not represent a valid number.', + $value, + )); + } + /** * @param string $char The failing character. * - * @return NumberFormatException - * * @psalm-pure */ public static function charNotInAlphabet(string $char) : self @@ -30,6 +36,6 @@ public static function charNotInAlphabet(string $char) : self $char = '"' . $char . '"'; } - return new self(sprintf('Char %s is not a valid character in the given alphabet.', $char)); + return new self(\sprintf('Char %s is not a valid character in the given alphabet.', $char)); } } diff --git a/api/vendor/brick/math/src/Exception/RoundingNecessaryException.php b/api/vendor/brick/math/src/Exception/RoundingNecessaryException.php index 1c61005637..57bfcd8448 100644 --- a/api/vendor/brick/math/src/Exception/RoundingNecessaryException.php +++ b/api/vendor/brick/math/src/Exception/RoundingNecessaryException.php @@ -10,8 +10,6 @@ class RoundingNecessaryException extends MathException { /** - * @return RoundingNecessaryException - * * @psalm-pure */ public static function roundingNecessary() : RoundingNecessaryException diff --git a/api/vendor/brick/math/src/Internal/Calculator.php b/api/vendor/brick/math/src/Internal/Calculator.php index 99bebbe5d8..44dd66924f 100644 --- a/api/vendor/brick/math/src/Internal/Calculator.php +++ b/api/vendor/brick/math/src/Internal/Calculator.php @@ -25,7 +25,7 @@ abstract class Calculator /** * The maximum exponent value allowed for the pow() method. */ - public const MAX_POWER = 1000000; + public const MAX_POWER = 1_000_000; /** * The alphabet for converting from and to base 2 to 36, lowercase. @@ -43,8 +43,6 @@ abstract class Calculator * An instance is typically set only in unit tests: the autodetect is usually the best option. * * @param Calculator|null $calculator The calculator instance, or NULL to revert to autodetect. - * - * @return void */ final public static function set(?Calculator $calculator) : void { @@ -56,8 +54,6 @@ final public static function set(?Calculator $calculator) : void * * If none has been explicitly set, the fastest available implementation will be returned. * - * @return Calculator - * * @psalm-pure * @psalm-suppress ImpureStaticProperty */ @@ -75,8 +71,6 @@ final public static function get() : Calculator * Returns the fastest available Calculator implementation. * * @codeCoverageIgnore - * - * @return Calculator */ private static function detect() : Calculator { @@ -94,9 +88,6 @@ private static function detect() : Calculator /** * Extracts the sign & digits of the operands. * - * @param string $a The first operand. - * @param string $b The second operand. - * * @return array{bool, bool, string, string} Whether $a and $b are negative, followed by their digits. */ final protected function init(string $a, string $b) : array @@ -112,10 +103,6 @@ final protected function init(string $a, string $b) : array /** * Returns the absolute value of a number. - * - * @param string $n The number. - * - * @return string The absolute value. */ final public function abs(string $n) : string { @@ -124,10 +111,6 @@ final public function abs(string $n) : string /** * Negates a number. - * - * @param string $n The number. - * - * @return string The negated value. */ final public function neg(string $n) : string { @@ -145,10 +128,9 @@ final public function neg(string $n) : string /** * Compares two numbers. * - * @param string $a The first number. - * @param string $b The second number. + * @psalm-return -1|0|1 * - * @return int [-1, 0, 1] If the first number is less than, equal to, or greater than the second number. + * @return int -1 if the first number is less than, 0 if equal to, 1 if greater than the second number. */ final public function cmp(string $a, string $b) : int { @@ -178,31 +160,16 @@ final public function cmp(string $a, string $b) : int /** * Adds two numbers. - * - * @param string $a The augend. - * @param string $b The addend. - * - * @return string The sum. */ abstract public function add(string $a, string $b) : string; /** * Subtracts two numbers. - * - * @param string $a The minuend. - * @param string $b The subtrahend. - * - * @return string The difference. */ abstract public function sub(string $a, string $b) : string; /** * Multiplies two numbers. - * - * @param string $a The multiplicand. - * @param string $b The multiplier. - * - * @return string The product. */ abstract public function mul(string $a, string $b) : string; @@ -247,10 +214,7 @@ abstract public function divQR(string $a, string $b) : array; abstract public function pow(string $a, int $e) : string; /** - * @param string $a * @param string $b The modulus; must not be zero. - * - * @return string */ public function mod(string $a, string $b) : string { @@ -264,10 +228,7 @@ public function mod(string $a, string $b) : string * * This method can be overridden by the concrete implementation if the underlying library has built-in support. * - * @param string $x * @param string $m The modulus; must not be negative or zero. - * - * @return string|null */ public function modInverse(string $x, string $m) : ?string { @@ -296,8 +257,6 @@ public function modInverse(string $x, string $m) : ?string * @param string $base The base number; must be positive or zero. * @param string $exp The exponent; must be positive or zero. * @param string $mod The modulus; must be strictly positive. - * - * @return string The power. */ abstract public function modPow(string $base, string $exp, string $mod) : string; @@ -307,9 +266,6 @@ abstract public function modPow(string $base, string $exp, string $mod) : string * This method can be overridden by the concrete implementation if the underlying library * has built-in support for GCD calculations. * - * @param string $a The first number. - * @param string $b The second number. - * * @return string The GCD, always positive, or zero if both arguments are zero. */ public function gcd(string $a, string $b) : string @@ -347,10 +303,6 @@ private function gcdExtended(string $a, string $b) : array * * The result is the largest x such that x² ≤ n. * The input MUST NOT be negative. - * - * @param string $n The number. - * - * @return string The square root. */ abstract public function sqrt(string $n) : string; @@ -478,18 +430,16 @@ final public function toArbitraryBase(string $number, string $alphabet, int $bas * * Rounding is performed when the remainder of the division is not zero. * - * @param string $a The dividend. - * @param string $b The divisor, must not be zero. - * @param int $roundingMode The rounding mode. - * - * @return string + * @param string $a The dividend. + * @param string $b The divisor, must not be zero. + * @param RoundingMode $roundingMode The rounding mode. * * @throws \InvalidArgumentException If the rounding mode is invalid. * @throws RoundingNecessaryException If RoundingMode::UNNECESSARY is provided but rounding is necessary. * * @psalm-suppress ImpureFunctionCall */ - final public function divRound(string $a, string $b, int $roundingMode) : string + final public function divRound(string $a, string $b, RoundingMode $roundingMode) : string { [$quotient, $remainder] = $this->divQR($a, $b); @@ -565,11 +515,6 @@ final public function divRound(string $a, string $b, int $roundingMode) : string * * This method can be overridden by the concrete implementation if the underlying library * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string */ public function and(string $a, string $b) : string { @@ -581,11 +526,6 @@ public function and(string $a, string $b) : string * * This method can be overridden by the concrete implementation if the underlying library * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string */ public function or(string $a, string $b) : string { @@ -597,11 +537,6 @@ public function or(string $a, string $b) : string * * This method can be overridden by the concrete implementation if the underlying library * has built-in support for bitwise operations. - * - * @param string $a - * @param string $b - * - * @return string */ public function xor(string $a, string $b) : string { @@ -614,8 +549,6 @@ public function xor(string $a, string $b) : string * @param 'and'|'or'|'xor' $operator The operator to use. * @param string $a The left operand. * @param string $b The right operand. - * - * @return string */ private function bitwise(string $operator, string $a, string $b) : string { @@ -640,27 +573,17 @@ private function bitwise(string $operator, string $a, string $b) : string $bBin = $this->twosComplement($bBin); } - switch ($operator) { - case 'and': - $value = $aBin & $bBin; - $negative = ($aNeg and $bNeg); - break; - - case 'or': - $value = $aBin | $bBin; - $negative = ($aNeg or $bNeg); - break; - - case 'xor': - $value = $aBin ^ $bBin; - $negative = ($aNeg xor $bNeg); - break; + $value = match ($operator) { + 'and' => $aBin & $bBin, + 'or' => $aBin | $bBin, + 'xor' => $aBin ^ $bBin, + }; - // @codeCoverageIgnoreStart - default: - throw new \InvalidArgumentException('Invalid bitwise operator.'); - // @codeCoverageIgnoreEnd - } + $negative = match ($operator) { + 'and' => $aNeg and $bNeg, + 'or' => $aNeg or $bNeg, + 'xor' => $aNeg xor $bNeg, + }; if ($negative) { $value = $this->twosComplement($value); @@ -673,8 +596,6 @@ private function bitwise(string $operator, string $a, string $b) : string /** * @param string $number A positive, binary number. - * - * @return string */ private function twosComplement(string $number) : string { @@ -704,8 +625,6 @@ private function twosComplement(string $number) : string * Converts a decimal number to a binary string. * * @param string $number The number to convert, positive or zero, only digits. - * - * @return string */ private function toBinary(string $number) : string { @@ -723,8 +642,6 @@ private function toBinary(string $number) : string * Returns the positive decimal representation of a binary number. * * @param string $bytes The bytes representing the number. - * - * @return string */ private function toDecimal(string $bytes) : string { diff --git a/api/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php b/api/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php index 34078687d2..067085e21a 100644 --- a/api/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php +++ b/api/vendor/brick/math/src/Internal/Calculator/BcMathCalculator.php @@ -15,94 +15,49 @@ */ class BcMathCalculator extends Calculator { - /** - * {@inheritdoc} - */ public function add(string $a, string $b) : string { return \bcadd($a, $b, 0); } - /** - * {@inheritdoc} - */ public function sub(string $a, string $b) : string { return \bcsub($a, $b, 0); } - /** - * {@inheritdoc} - */ public function mul(string $a, string $b) : string { return \bcmul($a, $b, 0); } - /** - * {@inheritdoc} - * - * @psalm-suppress InvalidNullableReturnType - * @psalm-suppress NullableReturnStatement - */ public function divQ(string $a, string $b) : string { return \bcdiv($a, $b, 0); } - /** - * {@inheritdoc} - * - * @psalm-suppress InvalidNullableReturnType - * @psalm-suppress NullableReturnStatement - */ public function divR(string $a, string $b) : string { - if (version_compare(PHP_VERSION, '7.2') >= 0) { - return \bcmod($a, $b, 0); - } - - return \bcmod($a, $b); + return \bcmod($a, $b, 0); } - /** - * {@inheritdoc} - */ public function divQR(string $a, string $b) : array { $q = \bcdiv($a, $b, 0); - - if (version_compare(PHP_VERSION, '7.2') >= 0) { - $r = \bcmod($a, $b, 0); - } else { - $r = \bcmod($a, $b); - } - - assert($q !== null); - assert($r !== null); + $r = \bcmod($a, $b, 0); return [$q, $r]; } - /** - * {@inheritdoc} - */ public function pow(string $a, int $e) : string { return \bcpow($a, (string) $e, 0); } - /** - * {@inheritdoc} - */ public function modPow(string $base, string $exp, string $mod) : string { return \bcpowmod($base, $exp, $mod, 0); } - /** - * {@inheritDoc} - */ public function sqrt(string $n) : string { return \bcsqrt($n, 0); diff --git a/api/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php b/api/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php index 52d18800a6..42d4c69274 100644 --- a/api/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php +++ b/api/vendor/brick/math/src/Internal/Calculator/GmpCalculator.php @@ -15,49 +15,31 @@ */ class GmpCalculator extends Calculator { - /** - * {@inheritdoc} - */ public function add(string $a, string $b) : string { return \gmp_strval(\gmp_add($a, $b)); } - /** - * {@inheritdoc} - */ public function sub(string $a, string $b) : string { return \gmp_strval(\gmp_sub($a, $b)); } - /** - * {@inheritdoc} - */ public function mul(string $a, string $b) : string { return \gmp_strval(\gmp_mul($a, $b)); } - /** - * {@inheritdoc} - */ public function divQ(string $a, string $b) : string { return \gmp_strval(\gmp_div_q($a, $b)); } - /** - * {@inheritdoc} - */ public function divR(string $a, string $b) : string { return \gmp_strval(\gmp_div_r($a, $b)); } - /** - * {@inheritdoc} - */ public function divQR(string $a, string $b) : array { [$q, $r] = \gmp_div_qr($a, $b); @@ -68,17 +50,11 @@ public function divQR(string $a, string $b) : array ]; } - /** - * {@inheritdoc} - */ public function pow(string $a, int $e) : string { return \gmp_strval(\gmp_pow($a, $e)); } - /** - * {@inheritdoc} - */ public function modInverse(string $x, string $m) : ?string { $result = \gmp_invert($x, $m); @@ -90,65 +66,41 @@ public function modInverse(string $x, string $m) : ?string return \gmp_strval($result); } - /** - * {@inheritdoc} - */ public function modPow(string $base, string $exp, string $mod) : string { return \gmp_strval(\gmp_powm($base, $exp, $mod)); } - /** - * {@inheritdoc} - */ public function gcd(string $a, string $b) : string { return \gmp_strval(\gmp_gcd($a, $b)); } - /** - * {@inheritdoc} - */ public function fromBase(string $number, int $base) : string { return \gmp_strval(\gmp_init($number, $base)); } - /** - * {@inheritdoc} - */ public function toBase(string $number, int $base) : string { return \gmp_strval($number, $base); } - /** - * {@inheritdoc} - */ public function and(string $a, string $b) : string { return \gmp_strval(\gmp_and($a, $b)); } - /** - * {@inheritdoc} - */ public function or(string $a, string $b) : string { return \gmp_strval(\gmp_or($a, $b)); } - /** - * {@inheritdoc} - */ public function xor(string $a, string $b) : string { return \gmp_strval(\gmp_xor($a, $b)); } - /** - * {@inheritDoc} - */ public function sqrt(string $n) : string { return \gmp_strval(\gmp_sqrt($n)); diff --git a/api/vendor/brick/math/src/Internal/Calculator/NativeCalculator.php b/api/vendor/brick/math/src/Internal/Calculator/NativeCalculator.php index a7eb23b90b..6acd063828 100644 --- a/api/vendor/brick/math/src/Internal/Calculator/NativeCalculator.php +++ b/api/vendor/brick/math/src/Internal/Calculator/NativeCalculator.php @@ -19,36 +19,24 @@ class NativeCalculator extends Calculator * The max number of digits the platform can natively add, subtract, multiply or divide without overflow. * For multiplication, this represents the max sum of the lengths of both operands. * - * For addition, it is assumed that an extra digit can hold a carry (1) without overflowing. + * In addition, it is assumed that an extra digit can hold a carry (1) without overflowing. * Example: 32-bit: max number 1,999,999,999 (9 digits + carry) * 64-bit: max number 1,999,999,999,999,999,999 (18 digits + carry) */ - private int $maxDigits; + private readonly int $maxDigits; /** - * Class constructor. - * * @codeCoverageIgnore */ public function __construct() { - switch (PHP_INT_SIZE) { - case 4: - $this->maxDigits = 9; - break; - - case 8: - $this->maxDigits = 18; - break; - - default: - throw new \RuntimeException('The platform is not 32-bit or 64-bit as expected.'); - } + $this->maxDigits = match (PHP_INT_SIZE) { + 4 => 9, + 8 => 18, + default => throw new \RuntimeException('The platform is not 32-bit or 64-bit as expected.') + }; } - /** - * {@inheritdoc} - */ public function add(string $a, string $b) : string { /** @@ -80,17 +68,11 @@ public function add(string $a, string $b) : string return $result; } - /** - * {@inheritdoc} - */ public function sub(string $a, string $b) : string { return $this->add($a, $this->neg($b)); } - /** - * {@inheritdoc} - */ public function mul(string $a, string $b) : string { /** @@ -134,25 +116,16 @@ public function mul(string $a, string $b) : string return $result; } - /** - * {@inheritdoc} - */ public function divQ(string $a, string $b) : string { return $this->divQR($a, $b)[0]; } - /** - * {@inheritdoc} - */ public function divR(string $a, string $b): string { return $this->divQR($a, $b)[1]; } - /** - * {@inheritdoc} - */ public function divQR(string $a, string $b) : array { if ($a === '0') { @@ -181,10 +154,8 @@ public function divQR(string $a, string $b) : array if (is_int($nb)) { // the only division that may overflow is PHP_INT_MIN / -1, // which cannot happen here as we've already handled a divisor of -1 above. + $q = intdiv($na, $nb); $r = $na % $nb; - $q = ($na - $r) / $nb; - - assert(is_int($q)); return [ (string) $q, @@ -208,9 +179,6 @@ public function divQR(string $a, string $b) : array return [$q, $r]; } - /** - * {@inheritdoc} - */ public function pow(string $a, int $e) : string { if ($e === 0) { @@ -238,8 +206,6 @@ public function pow(string $a, int $e) : string /** * Algorithm from: https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/ - * - * {@inheritdoc} */ public function modPow(string $base, string $exp, string $mod) : string { @@ -274,8 +240,6 @@ public function modPow(string $base, string $exp, string $mod) : string /** * Adapted from https://cp-algorithms.com/num_methods/roots_newton.html - * - * {@inheritDoc} */ public function sqrt(string $n) : string { @@ -304,11 +268,6 @@ public function sqrt(string $n) : string /** * Performs the addition of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string */ private function doAdd(string $a, string $b) : string { @@ -361,11 +320,6 @@ private function doAdd(string $a, string $b) : string /** * Performs the subtraction of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string */ private function doSub(string $a, string $b) : string { @@ -443,11 +397,6 @@ private function doSub(string $a, string $b) : string /** * Performs the multiplication of two non-signed large integers. - * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return string */ private function doMul(string $a, string $b) : string { @@ -520,9 +469,6 @@ private function doMul(string $a, string $b) : string /** * Performs the division of two non-signed large integers. * - * @param string $a The first operand. - * @param string $b The second operand. - * * @return string[] The quotient and remainder. */ private function doDiv(string $a, string $b) : array @@ -581,10 +527,7 @@ private function doDiv(string $a, string $b) : array /** * Compares two non-signed large numbers. * - * @param string $a The first operand. - * @param string $b The second operand. - * - * @return int [-1, 0, 1] + * @psalm-return -1|0|1 */ private function doCmp(string $a, string $b) : int { @@ -597,7 +540,7 @@ private function doCmp(string $a, string $b) : int return $cmp; } - return \strcmp($a, $b) <=> 0; // enforce [-1, 0, 1] + return \strcmp($a, $b) <=> 0; // enforce -1|0|1 } /** @@ -605,9 +548,6 @@ private function doCmp(string $a, string $b) : int * * The numbers must only consist of digits, without leading minus sign. * - * @param string $a The first operand. - * @param string $b The second operand. - * * @return array{string, string, int} */ private function pad(string $a, string $b) : array diff --git a/api/vendor/brick/math/src/RoundingMode.php b/api/vendor/brick/math/src/RoundingMode.php index 06936d8db3..e8ee6a8b41 100644 --- a/api/vendor/brick/math/src/RoundingMode.php +++ b/api/vendor/brick/math/src/RoundingMode.php @@ -13,24 +13,15 @@ * regardless the digits' contribution to the value of the number. In other words, considered * as a numerical value, the discarded fraction could have an absolute value greater than one. */ -final class RoundingMode +enum RoundingMode { - /** - * Private constructor. This class is not instantiable. - * - * @codeCoverageIgnore - */ - private function __construct() - { - } - /** * Asserts that the requested operation has an exact result, hence no rounding is necessary. * * If this rounding mode is specified on an operation that yields a result that * cannot be represented at the requested scale, a RoundingNecessaryException is thrown. */ - public const UNNECESSARY = 0; + case UNNECESSARY; /** * Rounds away from zero. @@ -38,7 +29,7 @@ private function __construct() * Always increments the digit prior to a nonzero discarded fraction. * Note that this rounding mode never decreases the magnitude of the calculated value. */ - public const UP = 1; + case UP; /** * Rounds towards zero. @@ -46,7 +37,7 @@ private function __construct() * Never increments the digit prior to a discarded fraction (i.e., truncates). * Note that this rounding mode never increases the magnitude of the calculated value. */ - public const DOWN = 2; + case DOWN; /** * Rounds towards positive infinity. @@ -54,7 +45,7 @@ private function __construct() * If the result is positive, behaves as for UP; if negative, behaves as for DOWN. * Note that this rounding mode never decreases the calculated value. */ - public const CEILING = 3; + case CEILING; /** * Rounds towards negative infinity. @@ -62,7 +53,7 @@ private function __construct() * If the result is positive, behave as for DOWN; if negative, behave as for UP. * Note that this rounding mode never increases the calculated value. */ - public const FLOOR = 4; + case FLOOR; /** * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round up. @@ -70,28 +61,28 @@ private function __construct() * Behaves as for UP if the discarded fraction is >= 0.5; otherwise, behaves as for DOWN. * Note that this is the rounding mode commonly taught at school. */ - public const HALF_UP = 5; + case HALF_UP; /** * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round down. * * Behaves as for UP if the discarded fraction is > 0.5; otherwise, behaves as for DOWN. */ - public const HALF_DOWN = 6; + case HALF_DOWN; /** * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards positive infinity. * * If the result is positive, behaves as for HALF_UP; if negative, behaves as for HALF_DOWN. */ - public const HALF_CEILING = 7; + case HALF_CEILING; /** * Rounds towards "nearest neighbor" unless both neighbors are equidistant, in which case round towards negative infinity. * * If the result is positive, behaves as for HALF_DOWN; if negative, behaves as for HALF_UP. */ - public const HALF_FLOOR = 8; + case HALF_FLOOR; /** * Rounds towards the "nearest neighbor" unless both neighbors are equidistant, in which case rounds towards the even neighbor. @@ -103,5 +94,5 @@ private function __construct() * cumulative error when applied repeatedly over a sequence of calculations. * It is sometimes known as "Banker's rounding", and is chiefly used in the USA. */ - public const HALF_EVEN = 9; + case HALF_EVEN; } diff --git a/api/vendor/symfony/polyfill-php81/LICENSE b/api/vendor/carbonphp/carbon-doctrine-types/LICENSE similarity index 88% rename from api/vendor/symfony/polyfill-php81/LICENSE rename to api/vendor/carbonphp/carbon-doctrine-types/LICENSE index efb17f98e7..2ee1671db1 100644 --- a/api/vendor/symfony/polyfill-php81/LICENSE +++ b/api/vendor/carbonphp/carbon-doctrine-types/LICENSE @@ -1,11 +1,13 @@ -Copyright (c) 2021 Fabien Potencier +MIT License + +Copyright (c) 2023 Carbon 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: +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. @@ -15,5 +17,5 @@ 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/api/vendor/carbonphp/carbon-doctrine-types/README.md b/api/vendor/carbonphp/carbon-doctrine-types/README.md new file mode 100644 index 0000000000..5a18121b6c --- /dev/null +++ b/api/vendor/carbonphp/carbon-doctrine-types/README.md @@ -0,0 +1,14 @@ +# carbonphp/carbon-doctrine-types + +Types to use Carbon in Doctrine + +## Documentation + +[Check how to use in the official Carbon documentation](https://carbon.nesbot.com/symfony/) + +This package is an externalization of [src/Carbon/Doctrine](https://github.com/briannesbitt/Carbon/tree/2.71.0/src/Carbon/Doctrine) +from `nestbot/carbon` package. + +Externalization allows to better deal with different versions of dbal. With +version 4.0 of dbal, it no longer sustainable to be compatible with all version +using a single code. diff --git a/api/vendor/carbonphp/carbon-doctrine-types/composer.json b/api/vendor/carbonphp/carbon-doctrine-types/composer.json new file mode 100644 index 0000000000..abf45c5fb5 --- /dev/null +++ b/api/vendor/carbonphp/carbon-doctrine-types/composer.json @@ -0,0 +1,36 @@ +{ + "name": "carbonphp/carbon-doctrine-types", + "description": "Types to use Carbon in Doctrine", + "type": "library", + "keywords": [ + "date", + "time", + "DateTime", + "Carbon", + "Doctrine" + ], + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "license": "MIT", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "minimum-stability": "dev" +} diff --git a/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php new file mode 100644 index 0000000000..a63a9b8d27 --- /dev/null +++ b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php @@ -0,0 +1,16 @@ + - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ +declare(strict_types=1); namespace Carbon\Doctrine; @@ -15,7 +8,12 @@ use Carbon\CarbonInterface; use DateTimeInterface; use Doctrine\DBAL\Platforms\AbstractPlatform; -use Doctrine\DBAL\Types\ConversionException; +use Doctrine\DBAL\Platforms\DB2Platform; +use Doctrine\DBAL\Platforms\OraclePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; +use Doctrine\DBAL\Platforms\SQLServerPlatform; +use Doctrine\DBAL\Types\Exception\InvalidType; +use Doctrine\DBAL\Types\Exception\ValueNotConvertible; use Exception; /** @@ -23,6 +21,14 @@ */ trait CarbonTypeConverter { + /** + * This property differentiates types installed by carbonphp/carbon-doctrine-types + * from the ones embedded previously in nesbot/carbon source directly. + * + * @readonly + */ + public bool $external = true; + /** * @return class-string */ @@ -31,20 +37,12 @@ protected function getCarbonClassName(): string return Carbon::class; } - /** - * @return string - */ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) + public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string { - $precision = $fieldDeclaration['precision'] ?: 10; - - if ($fieldDeclaration['secondPrecision'] ?? false) { - $precision = 0; - } - - if ($precision === 10) { - $precision = DateTimeDefaultPrecision::get(); - } + $precision = min( + $fieldDeclaration['precision'] ?? DateTimeDefaultPrecision::get(), + $this->getMaximumPrecision($platform), + ); $type = parent::getSQLDeclaration($fieldDeclaration, $platform); @@ -63,10 +61,25 @@ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $pla /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @return T|null */ - public function convertToPHPValue($value, AbstractPlatform $platform) + public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format('Y-m-d H:i:s.u'); + } + + throw InvalidType::new( + $value, + static::class, + ['null', 'DateTime', 'Carbon'] + ); + } + + private function doConvertToPHPValue(mixed $value) { $class = $this->getCarbonClassName(); @@ -88,9 +101,9 @@ public function convertToPHPValue($value, AbstractPlatform $platform) } if (!$date) { - throw ConversionException::conversionFailedFormat( + throw ValueNotConvertible::new( $value, - $this->getName(), + static::class, 'Y-m-d H:i:s.u or any format supported by '.$class.'::parse()', $error ); @@ -99,25 +112,20 @@ public function convertToPHPValue($value, AbstractPlatform $platform) return $date; } - /** - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - * - * @return string|null - */ - public function convertToDatabaseValue($value, AbstractPlatform $platform) + private function getMaximumPrecision(AbstractPlatform $platform): int { - if ($value === null) { - return $value; + if ($platform instanceof DB2Platform) { + return 12; } - if ($value instanceof DateTimeInterface) { - return $value->format('Y-m-d H:i:s.u'); + if ($platform instanceof OraclePlatform) { + return 9; } - throw ConversionException::conversionFailedInvalidType( - $value, - $this->getName(), - ['null', 'DateTime', 'Carbon'] - ); + if ($platform instanceof SQLServerPlatform || $platform instanceof SQLitePlatform) { + return 3; + } + + return 6; } } diff --git a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php similarity index 70% rename from api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php rename to api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php index 642fd41354..cd9896f9ca 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php +++ b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php @@ -1,13 +1,6 @@ - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ +declare(strict_types=1); namespace Carbon\Doctrine; diff --git a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php similarity index 58% rename from api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php rename to api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php index 499271031e..fd6467e3dc 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php +++ b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php @@ -1,12 +1,12 @@ */ use CarbonTypeConverter; + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?CarbonImmutable + { + return $this->doConvertToPHPValue($value); + } + /** * @return class-string */ diff --git a/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php new file mode 100644 index 0000000000..89e4b7903a --- /dev/null +++ b/api/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php @@ -0,0 +1,24 @@ + */ + use CarbonTypeConverter; + + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Carbon + { + return $this->doConvertToPHPValue($value); + } +} diff --git a/api/vendor/composer/ClassLoader.php b/api/vendor/composer/ClassLoader.php index 6d0c3f2d00..7824d8f7ea 100644 --- a/api/vendor/composer/ClassLoader.php +++ b/api/vendor/composer/ClassLoader.php @@ -42,30 +42,76 @@ */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 + /** + * @var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var list + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ private $prefixesPsr0 = array(); + /** + * @var list + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var array + */ private $missingClasses = array(); + + /** @var string|null */ private $apcuPrefix; + /** + * @var array + */ private static $registeredLoaders = array(); + /** + * @param string|null $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } + /** + * @return array> + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +121,42 @@ public function getPrefixes() return array(); } + /** + * @return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return list + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return list + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return array Array of classname => path + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param array $classMap Class to filename map + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,22 +171,25 @@ public function addClassMap(array $classMap) * 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 array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -135,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -156,25 +219,28 @@ public function add($prefix, $paths, $prepend = false) * 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 array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|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) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -184,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -204,8 +270,10 @@ public function addPsr4($prefix, $paths, $prepend = false) * 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 array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +288,12 @@ public function set($prefix, $paths) * 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 array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +313,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +337,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +359,8 @@ public function isClassMapAuthoritative() * 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) { @@ -305,6 +381,8 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { @@ -324,6 +402,8 @@ public function register($prepend = false) /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -343,7 +423,8 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -394,15 +475,20 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -468,14 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/api/vendor/composer/InstalledVersions.php b/api/vendor/composer/InstalledVersions.php index b3a4e1611e..51e734a774 100644 --- a/api/vendor/composer/InstalledVersions.php +++ b/api/vendor/composer/InstalledVersions.php @@ -20,12 +20,27 @@ * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * - * To require it's presence, you can require `composer-runtime-api ^2.0` + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ private static $installed; + + /** + * @var bool|null + */ private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ private static $installedByVendor = array(); /** @@ -83,7 +98,7 @@ 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 $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -104,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -228,7 +243,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -242,7 +257,7 @@ public static function getRootPackage() * * @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} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -265,7 +280,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -288,7 +303,7 @@ public static function getAllRawData() * @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} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -298,7 +313,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { @@ -313,7 +328,9 @@ private static function getInstalled() 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'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -325,12 +342,17 @@ private static function getInstalled() // 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'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/api/vendor/composer/autoload_classmap.php b/api/vendor/composer/autoload_classmap.php index 5799e1349d..09b0c03786 100644 --- a/api/vendor/composer/autoload_classmap.php +++ b/api/vendor/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( @@ -77,13 +77,13 @@ 'Carbon\\CarbonPeriodImmutable' => $vendorDir . '/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php', 'Carbon\\CarbonTimeZone' => $vendorDir . '/nesbot/carbon/src/Carbon/CarbonTimeZone.php', 'Carbon\\Cli\\Invoker' => $vendorDir . '/nesbot/carbon/src/Carbon/Cli/Invoker.php', - 'Carbon\\Doctrine\\CarbonDoctrineType' => $vendorDir . '/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php', - 'Carbon\\Doctrine\\CarbonImmutableType' => $vendorDir . '/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php', - 'Carbon\\Doctrine\\CarbonType' => $vendorDir . '/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php', - 'Carbon\\Doctrine\\CarbonTypeConverter' => $vendorDir . '/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php', - 'Carbon\\Doctrine\\DateTimeDefaultPrecision' => $vendorDir . '/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php', - 'Carbon\\Doctrine\\DateTimeImmutableType' => $vendorDir . '/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php', - 'Carbon\\Doctrine\\DateTimeType' => $vendorDir . '/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php', + 'Carbon\\Doctrine\\CarbonDoctrineType' => $vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php', + 'Carbon\\Doctrine\\CarbonImmutableType' => $vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonImmutableType.php', + 'Carbon\\Doctrine\\CarbonType' => $vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonType.php', + 'Carbon\\Doctrine\\CarbonTypeConverter' => $vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php', + 'Carbon\\Doctrine\\DateTimeDefaultPrecision' => $vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php', + 'Carbon\\Doctrine\\DateTimeImmutableType' => $vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php', + 'Carbon\\Doctrine\\DateTimeType' => $vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php', 'Carbon\\Exceptions\\BadComparisonUnitException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php', 'Carbon\\Exceptions\\BadFluentConstructorException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php', 'Carbon\\Exceptions\\BadFluentSetterException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php', @@ -166,6 +166,7 @@ 'DeepCopy\\DeepCopy' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/DeepCopy.php', 'DeepCopy\\Exception\\CloneException' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php', 'DeepCopy\\Exception\\PropertyException' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php', + 'DeepCopy\\Filter\\ChainableFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php', 'DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php', 'DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php', 'DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php', @@ -180,6 +181,7 @@ 'DeepCopy\\Matcher\\PropertyTypeMatcher' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php', 'DeepCopy\\Reflection\\ReflectionHelper' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php', 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', + 'DeepCopy\\TypeFilter\\Date\\DatePeriodFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php', 'DeepCopy\\TypeFilter\\ReplaceFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', 'DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php', @@ -747,6 +749,7 @@ 'Faker\\Provider\\nl_BE\\Payment' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_BE/Payment.php', 'Faker\\Provider\\nl_BE\\Person' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_BE/Person.php', 'Faker\\Provider\\nl_BE\\PhoneNumber' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_BE/PhoneNumber.php', + 'Faker\\Provider\\nl_BE\\Text' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_BE/Text.php', 'Faker\\Provider\\nl_NL\\Address' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_NL/Address.php', 'Faker\\Provider\\nl_NL\\Color' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_NL/Color.php', 'Faker\\Provider\\nl_NL\\Company' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_NL/Company.php', @@ -756,6 +759,7 @@ 'Faker\\Provider\\nl_NL\\PhoneNumber' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_NL/PhoneNumber.php', 'Faker\\Provider\\nl_NL\\Text' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/nl_NL/Text.php', 'Faker\\Provider\\pl_PL\\Address' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/pl_PL/Address.php', + 'Faker\\Provider\\pl_PL\\Color' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/pl_PL/Color.php', 'Faker\\Provider\\pl_PL\\Company' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/pl_PL/Company.php', 'Faker\\Provider\\pl_PL\\Internet' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/pl_PL/Internet.php', 'Faker\\Provider\\pl_PL\\LicensePlate' => $vendorDir . '/fakerphp/faker/src/Faker/Provider/pl_PL/LicensePlate.php', @@ -1814,7 +1818,6 @@ 'Laravel\\SerializableClosure\\Support\\ReflectionClosure' => $vendorDir . '/laravel/serializable-closure/src/Support/ReflectionClosure.php', 'Laravel\\SerializableClosure\\Support\\SelfReference' => $vendorDir . '/laravel/serializable-closure/src/Support/SelfReference.php', 'Laravel\\SerializableClosure\\UnsignedSerializableClosure' => $vendorDir . '/laravel/serializable-closure/src/UnsignedSerializableClosure.php', - 'Mockery' => $vendorDir . '/mockery/mockery/library/Mockery.php', 'Mockery\\Adapter\\Phpunit\\MockeryPHPUnitIntegration' => $vendorDir . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php', 'Mockery\\Adapter\\Phpunit\\MockeryPHPUnitIntegrationAssertPostConditions' => $vendorDir . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php', 'Mockery\\Adapter\\Phpunit\\MockeryTestCase' => $vendorDir . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php', @@ -1828,6 +1831,7 @@ 'Mockery\\CountValidator\\AtLeast' => $vendorDir . '/mockery/mockery/library/Mockery/CountValidator/AtLeast.php', 'Mockery\\CountValidator\\AtMost' => $vendorDir . '/mockery/mockery/library/Mockery/CountValidator/AtMost.php', 'Mockery\\CountValidator\\CountValidatorAbstract' => $vendorDir . '/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php', + 'Mockery\\CountValidator\\CountValidatorInterface' => $vendorDir . '/mockery/mockery/library/Mockery/CountValidator/CountValidatorInterface.php', 'Mockery\\CountValidator\\Exact' => $vendorDir . '/mockery/mockery/library/Mockery/CountValidator/Exact.php', 'Mockery\\CountValidator\\Exception' => $vendorDir . '/mockery/mockery/library/Mockery/CountValidator/Exception.php', 'Mockery\\Exception' => $vendorDir . '/mockery/mockery/library/Mockery/Exception.php', @@ -1835,6 +1839,7 @@ 'Mockery\\Exception\\InvalidArgumentException' => $vendorDir . '/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php', 'Mockery\\Exception\\InvalidCountException' => $vendorDir . '/mockery/mockery/library/Mockery/Exception/InvalidCountException.php', 'Mockery\\Exception\\InvalidOrderException' => $vendorDir . '/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php', + 'Mockery\\Exception\\MockeryExceptionInterface' => $vendorDir . '/mockery/mockery/library/Mockery/Exception/MockeryExceptionInterface.php', 'Mockery\\Exception\\NoMatchingExpectationException' => $vendorDir . '/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php', 'Mockery\\Exception\\RuntimeException' => $vendorDir . '/mockery/mockery/library/Mockery/Exception/RuntimeException.php', 'Mockery\\Expectation' => $vendorDir . '/mockery/mockery/library/Mockery/Expectation.php', @@ -1853,6 +1858,7 @@ 'Mockery\\Generator\\StringManipulationGenerator' => $vendorDir . '/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php', 'Mockery\\Generator\\StringManipulation\\Pass\\AvoidMethodClashPass' => $vendorDir . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\CallTypeHintPass' => $vendorDir . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php', + 'Mockery\\Generator\\StringManipulation\\Pass\\ClassAttributesPass' => $vendorDir . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassAttributesPass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\ClassNamePass' => $vendorDir . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\ClassPass' => $vendorDir . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\ConstantsPass' => $vendorDir . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php', @@ -1883,7 +1889,10 @@ 'Mockery\\Matcher\\Ducktype' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/Ducktype.php', 'Mockery\\Matcher\\HasKey' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/HasKey.php', 'Mockery\\Matcher\\HasValue' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/HasValue.php', + 'Mockery\\Matcher\\IsEqual' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/IsEqual.php', + 'Mockery\\Matcher\\IsSame' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/IsSame.php', 'Mockery\\Matcher\\MatcherAbstract' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php', + 'Mockery\\Matcher\\MatcherInterface' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/MatcherInterface.php', 'Mockery\\Matcher\\MultiArgumentClosure' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php', 'Mockery\\Matcher\\MustBe' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/MustBe.php', 'Mockery\\Matcher\\NoArgs' => $vendorDir . '/mockery/mockery/library/Mockery/Matcher/NoArgs.php', @@ -2144,6 +2153,7 @@ 'PHPUnit\\Framework\\Constraint\\LogicalXor' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php', 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php', 'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php', + 'PHPUnit\\Framework\\Constraint\\ObjectHasProperty' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php', 'PHPUnit\\Framework\\Constraint\\Operator' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php', 'PHPUnit\\Framework\\Constraint\\RegularExpression' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php', 'PHPUnit\\Framework\\Constraint\\SameSize' => $vendorDir . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php', @@ -2374,8 +2384,8 @@ 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistIncludesToCoverage' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Php' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => $vendorDir . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php', @@ -2482,6 +2492,7 @@ 'PharIo\\Manifest\\ManifestLoader' => $vendorDir . '/phar-io/manifest/src/ManifestLoader.php', 'PharIo\\Manifest\\ManifestLoaderException' => $vendorDir . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', 'PharIo\\Manifest\\ManifestSerializer' => $vendorDir . '/phar-io/manifest/src/ManifestSerializer.php', + 'PharIo\\Manifest\\NoEmailAddressException' => $vendorDir . '/phar-io/manifest/src/exceptions/NoEmailAddressException.php', 'PharIo\\Manifest\\PhpElement' => $vendorDir . '/phar-io/manifest/src/xml/PhpElement.php', 'PharIo\\Manifest\\PhpExtensionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', 'PharIo\\Manifest\\PhpVersionRequirement' => $vendorDir . '/phar-io/manifest/src/values/PhpVersionRequirement.php', @@ -2546,24 +2557,24 @@ 'PhpParser\\Internal\\DiffElem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php', 'PhpParser\\Internal\\Differ' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/Differ.php', 'PhpParser\\Internal\\PrintableNewAnonClassNode' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php', + 'PhpParser\\Internal\\TokenPolyfill' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php', 'PhpParser\\Internal\\TokenStream' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php', 'PhpParser\\JsonDecoder' => $vendorDir . '/nikic/php-parser/lib/PhpParser/JsonDecoder.php', 'PhpParser\\Lexer' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer.php', 'PhpParser\\Lexer\\Emulative' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php', + 'PhpParser\\Lexer\\TokenEmulator\\AsymmetricVisibilityTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\AttributeEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\CoaleseEqualTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\EnumTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ExplicitOctalEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\FlexibleDocStringEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\FnTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\KeywordEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\MatchTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\NullsafeTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\NumericLiteralSeparatorEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php', + 'PhpParser\\Lexer\\TokenEmulator\\PropertyTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ReadonlyFunctionTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ReadonlyTokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ReverseEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\TokenEmulator' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php', + 'PhpParser\\Modifiers' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Modifiers.php', 'PhpParser\\NameContext' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NameContext.php', 'PhpParser\\Node' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node.php', 'PhpParser\\NodeAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeAbstract.php', @@ -2574,19 +2585,22 @@ 'PhpParser\\NodeVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor.php', 'PhpParser\\NodeVisitorAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php', 'PhpParser\\NodeVisitor\\CloningVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php', + 'PhpParser\\NodeVisitor\\CommentAnnotatingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php', 'PhpParser\\NodeVisitor\\FindingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php', 'PhpParser\\NodeVisitor\\FirstFindingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php', 'PhpParser\\NodeVisitor\\NameResolver' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php', 'PhpParser\\NodeVisitor\\NodeConnectingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php', 'PhpParser\\NodeVisitor\\ParentConnectingVisitor' => $vendorDir . '/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php', 'PhpParser\\Node\\Arg' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Arg.php', + 'PhpParser\\Node\\ArrayItem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php', 'PhpParser\\Node\\Attribute' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Attribute.php', 'PhpParser\\Node\\AttributeGroup' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php', + 'PhpParser\\Node\\ClosureUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php', 'PhpParser\\Node\\ComplexType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/ComplexType.php', 'PhpParser\\Node\\Const_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Const_.php', + 'PhpParser\\Node\\DeclareItem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php', 'PhpParser\\Node\\Expr' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr.php', 'PhpParser\\Node\\Expr\\ArrayDimFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php', - 'PhpParser\\Node\\Expr\\ArrayItem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php', 'PhpParser\\Node\\Expr\\Array_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php', 'PhpParser\\Node\\Expr\\ArrowFunction' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php', 'PhpParser\\Node\\Expr\\Assign' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php', @@ -2647,7 +2661,6 @@ 'PhpParser\\Node\\Expr\\ClassConstFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php', 'PhpParser\\Node\\Expr\\Clone_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php', 'PhpParser\\Node\\Expr\\Closure' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php', - 'PhpParser\\Node\\Expr\\ClosureUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php', 'PhpParser\\Node\\Expr\\ConstFetch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php', 'PhpParser\\Node\\Expr\\Empty_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php', 'PhpParser\\Node\\Expr\\Error' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php', @@ -2682,6 +2695,7 @@ 'PhpParser\\Node\\Expr\\Yield_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php', 'PhpParser\\Node\\FunctionLike' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php', 'PhpParser\\Node\\Identifier' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Identifier.php', + 'PhpParser\\Node\\InterpolatedStringPart' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php', 'PhpParser\\Node\\IntersectionType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php', 'PhpParser\\Node\\MatchArm' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/MatchArm.php', 'PhpParser\\Node\\Name' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Name.php', @@ -2689,11 +2703,12 @@ 'PhpParser\\Node\\Name\\Relative' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php', 'PhpParser\\Node\\NullableType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/NullableType.php', 'PhpParser\\Node\\Param' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Param.php', + 'PhpParser\\Node\\PropertyHook' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php', + 'PhpParser\\Node\\PropertyItem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php', 'PhpParser\\Node\\Scalar' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar.php', - 'PhpParser\\Node\\Scalar\\DNumber' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php', - 'PhpParser\\Node\\Scalar\\Encapsed' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php', - 'PhpParser\\Node\\Scalar\\EncapsedStringPart' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php', - 'PhpParser\\Node\\Scalar\\LNumber' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php', + 'PhpParser\\Node\\Scalar\\Float_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php', + 'PhpParser\\Node\\Scalar\\Int_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php', + 'PhpParser\\Node\\Scalar\\InterpolatedString' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php', 'PhpParser\\Node\\Scalar\\MagicConst' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Class_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Dir' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php', @@ -2702,9 +2717,12 @@ 'PhpParser\\Node\\Scalar\\MagicConst\\Line' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Method' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Namespace_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php', + 'PhpParser\\Node\\Scalar\\MagicConst\\Property' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Property.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Trait_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php', 'PhpParser\\Node\\Scalar\\String_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php', + 'PhpParser\\Node\\StaticVar' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/StaticVar.php', 'PhpParser\\Node\\Stmt' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt.php', + 'PhpParser\\Node\\Stmt\\Block' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php', 'PhpParser\\Node\\Stmt\\Break_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php', 'PhpParser\\Node\\Stmt\\Case_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php', 'PhpParser\\Node\\Stmt\\Catch_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php', @@ -2714,7 +2732,6 @@ 'PhpParser\\Node\\Stmt\\Class_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php', 'PhpParser\\Node\\Stmt\\Const_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php', 'PhpParser\\Node\\Stmt\\Continue_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php', - 'PhpParser\\Node\\Stmt\\DeclareDeclare' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php', 'PhpParser\\Node\\Stmt\\Declare_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php', 'PhpParser\\Node\\Stmt\\Do_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php', 'PhpParser\\Node\\Stmt\\Echo_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php', @@ -2738,12 +2755,9 @@ 'PhpParser\\Node\\Stmt\\Namespace_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php', 'PhpParser\\Node\\Stmt\\Nop' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php', 'PhpParser\\Node\\Stmt\\Property' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php', - 'PhpParser\\Node\\Stmt\\PropertyProperty' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php', 'PhpParser\\Node\\Stmt\\Return_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php', - 'PhpParser\\Node\\Stmt\\StaticVar' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php', 'PhpParser\\Node\\Stmt\\Static_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php', 'PhpParser\\Node\\Stmt\\Switch_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php', - 'PhpParser\\Node\\Stmt\\Throw_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php', 'PhpParser\\Node\\Stmt\\TraitUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php', 'PhpParser\\Node\\Stmt\\TraitUseAdaptation' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php', 'PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Alias' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php', @@ -2751,26 +2765,28 @@ 'PhpParser\\Node\\Stmt\\Trait_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php', 'PhpParser\\Node\\Stmt\\TryCatch' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php', 'PhpParser\\Node\\Stmt\\Unset_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php', - 'PhpParser\\Node\\Stmt\\UseUse' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php', 'PhpParser\\Node\\Stmt\\Use_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php', 'PhpParser\\Node\\Stmt\\While_' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php', 'PhpParser\\Node\\UnionType' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/UnionType.php', + 'PhpParser\\Node\\UseItem' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/UseItem.php', 'PhpParser\\Node\\VarLikeIdentifier' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php', 'PhpParser\\Node\\VariadicPlaceholder' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php', 'PhpParser\\Parser' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser.php', 'PhpParser\\ParserAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ParserAbstract.php', 'PhpParser\\ParserFactory' => $vendorDir . '/nikic/php-parser/lib/PhpParser/ParserFactory.php', - 'PhpParser\\Parser\\Multiple' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Multiple.php', - 'PhpParser\\Parser\\Php5' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Php5.php', 'PhpParser\\Parser\\Php7' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Php7.php', - 'PhpParser\\Parser\\Tokens' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Tokens.php', + 'PhpParser\\Parser\\Php8' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Parser/Php8.php', + 'PhpParser\\PhpVersion' => $vendorDir . '/nikic/php-parser/lib/PhpParser/PhpVersion.php', + 'PhpParser\\PrettyPrinter' => $vendorDir . '/nikic/php-parser/lib/PhpParser/PrettyPrinter.php', 'PhpParser\\PrettyPrinterAbstract' => $vendorDir . '/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php', 'PhpParser\\PrettyPrinter\\Standard' => $vendorDir . '/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php', + 'PhpParser\\Token' => $vendorDir . '/nikic/php-parser/lib/PhpParser/Token.php', 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Psr\\Cache\\CacheException' => $vendorDir . '/psr/cache/src/CacheException.php', 'Psr\\Cache\\CacheItemInterface' => $vendorDir . '/psr/cache/src/CacheItemInterface.php', 'Psr\\Cache\\CacheItemPoolInterface' => $vendorDir . '/psr/cache/src/CacheItemPoolInterface.php', 'Psr\\Cache\\InvalidArgumentException' => $vendorDir . '/psr/cache/src/InvalidArgumentException.php', + 'Psr\\Clock\\ClockInterface' => $vendorDir . '/psr/clock/src/ClockInterface.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', @@ -2796,13 +2812,13 @@ 'Ramsey\\Collection\\CollectionInterface' => $vendorDir . '/ramsey/collection/src/CollectionInterface.php', 'Ramsey\\Collection\\DoubleEndedQueue' => $vendorDir . '/ramsey/collection/src/DoubleEndedQueue.php', 'Ramsey\\Collection\\DoubleEndedQueueInterface' => $vendorDir . '/ramsey/collection/src/DoubleEndedQueueInterface.php', + 'Ramsey\\Collection\\Exception\\CollectionException' => $vendorDir . '/ramsey/collection/src/Exception/CollectionException.php', 'Ramsey\\Collection\\Exception\\CollectionMismatchException' => $vendorDir . '/ramsey/collection/src/Exception/CollectionMismatchException.php', 'Ramsey\\Collection\\Exception\\InvalidArgumentException' => $vendorDir . '/ramsey/collection/src/Exception/InvalidArgumentException.php', - 'Ramsey\\Collection\\Exception\\InvalidSortOrderException' => $vendorDir . '/ramsey/collection/src/Exception/InvalidSortOrderException.php', + 'Ramsey\\Collection\\Exception\\InvalidPropertyOrMethod' => $vendorDir . '/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php', 'Ramsey\\Collection\\Exception\\NoSuchElementException' => $vendorDir . '/ramsey/collection/src/Exception/NoSuchElementException.php', 'Ramsey\\Collection\\Exception\\OutOfBoundsException' => $vendorDir . '/ramsey/collection/src/Exception/OutOfBoundsException.php', 'Ramsey\\Collection\\Exception\\UnsupportedOperationException' => $vendorDir . '/ramsey/collection/src/Exception/UnsupportedOperationException.php', - 'Ramsey\\Collection\\Exception\\ValueExtractionException' => $vendorDir . '/ramsey/collection/src/Exception/ValueExtractionException.php', 'Ramsey\\Collection\\GenericArray' => $vendorDir . '/ramsey/collection/src/GenericArray.php', 'Ramsey\\Collection\\Map\\AbstractMap' => $vendorDir . '/ramsey/collection/src/Map/AbstractMap.php', 'Ramsey\\Collection\\Map\\AbstractTypedMap' => $vendorDir . '/ramsey/collection/src/Map/AbstractTypedMap.php', @@ -2814,6 +2830,7 @@ 'Ramsey\\Collection\\Queue' => $vendorDir . '/ramsey/collection/src/Queue.php', 'Ramsey\\Collection\\QueueInterface' => $vendorDir . '/ramsey/collection/src/QueueInterface.php', 'Ramsey\\Collection\\Set' => $vendorDir . '/ramsey/collection/src/Set.php', + 'Ramsey\\Collection\\Sort' => $vendorDir . '/ramsey/collection/src/Sort.php', 'Ramsey\\Collection\\Tool\\TypeTrait' => $vendorDir . '/ramsey/collection/src/Tool/TypeTrait.php', 'Ramsey\\Collection\\Tool\\ValueExtractorTrait' => $vendorDir . '/ramsey/collection/src/Tool/ValueExtractorTrait.php', 'Ramsey\\Collection\\Tool\\ValueToStringTrait' => $vendorDir . '/ramsey/collection/src/Tool/ValueToStringTrait.php', @@ -2929,7 +2946,6 @@ 'Ramsey\\Uuid\\UuidInterface' => $vendorDir . '/ramsey/uuid/src/UuidInterface.php', 'Ramsey\\Uuid\\Validator\\GenericValidator' => $vendorDir . '/ramsey/uuid/src/Validator/GenericValidator.php', 'Ramsey\\Uuid\\Validator\\ValidatorInterface' => $vendorDir . '/ramsey/uuid/src/Validator/ValidatorInterface.php', - 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', 'SebastianBergmann\\CliParser\\AmbiguousOptionException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php', 'SebastianBergmann\\CliParser\\Exception' => $vendorDir . '/sebastian/cli-parser/src/exceptions/Exception.php', 'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => $vendorDir . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php', @@ -3633,6 +3649,7 @@ 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => $vendorDir . '/symfony/string/Slugger/AsciiSlugger.php', 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => $vendorDir . '/symfony/string/Slugger/SluggerInterface.php', 'Symfony\\Component\\String\\UnicodeString' => $vendorDir . '/symfony/string/UnicodeString.php', + 'Symfony\\Component\\Translation\\CatalogueMetadataAwareInterface' => $vendorDir . '/symfony/translation/CatalogueMetadataAwareInterface.php', 'Symfony\\Component\\Translation\\Catalogue\\AbstractOperation' => $vendorDir . '/symfony/translation/Catalogue/AbstractOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\MergeOperation' => $vendorDir . '/symfony/translation/Catalogue/MergeOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\OperationInterface' => $vendorDir . '/symfony/translation/Catalogue/OperationInterface.php', @@ -3643,6 +3660,8 @@ 'Symfony\\Component\\Translation\\Command\\XliffLintCommand' => $vendorDir . '/symfony/translation/Command/XliffLintCommand.php', 'Symfony\\Component\\Translation\\DataCollectorTranslator' => $vendorDir . '/symfony/translation/DataCollectorTranslator.php', 'Symfony\\Component\\Translation\\DataCollector\\TranslationDataCollector' => $vendorDir . '/symfony/translation/DataCollector/TranslationDataCollector.php', + 'Symfony\\Component\\Translation\\DependencyInjection\\DataCollectorTranslatorPass' => $vendorDir . '/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php', + 'Symfony\\Component\\Translation\\DependencyInjection\\LoggingTranslatorPass' => $vendorDir . '/symfony/translation/DependencyInjection/LoggingTranslatorPass.php', 'Symfony\\Component\\Translation\\DependencyInjection\\TranslationDumperPass' => $vendorDir . '/symfony/translation/DependencyInjection/TranslationDumperPass.php', 'Symfony\\Component\\Translation\\DependencyInjection\\TranslationExtractorPass' => $vendorDir . '/symfony/translation/DependencyInjection/TranslationExtractorPass.php', 'Symfony\\Component\\Translation\\DependencyInjection\\TranslatorPass' => $vendorDir . '/symfony/translation/DependencyInjection/TranslatorPass.php', @@ -3673,8 +3692,13 @@ 'Symfony\\Component\\Translation\\Extractor\\AbstractFileExtractor' => $vendorDir . '/symfony/translation/Extractor/AbstractFileExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\ChainExtractor' => $vendorDir . '/symfony/translation/Extractor/ChainExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\ExtractorInterface' => $vendorDir . '/symfony/translation/Extractor/ExtractorInterface.php', + 'Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor' => $vendorDir . '/symfony/translation/Extractor/PhpAstExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\PhpExtractor' => $vendorDir . '/symfony/translation/Extractor/PhpExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\PhpStringTokenParser' => $vendorDir . '/symfony/translation/Extractor/PhpStringTokenParser.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\AbstractVisitor' => $vendorDir . '/symfony/translation/Extractor/Visitor/AbstractVisitor.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\ConstraintVisitor' => $vendorDir . '/symfony/translation/Extractor/Visitor/ConstraintVisitor.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\TransMethodVisitor' => $vendorDir . '/symfony/translation/Extractor/Visitor/TransMethodVisitor.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\TranslatableMessageVisitor' => $vendorDir . '/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php', 'Symfony\\Component\\Translation\\Formatter\\IntlFormatter' => $vendorDir . '/symfony/translation/Formatter/IntlFormatter.php', 'Symfony\\Component\\Translation\\Formatter\\IntlFormatterInterface' => $vendorDir . '/symfony/translation/Formatter/IntlFormatterInterface.php', 'Symfony\\Component\\Translation\\Formatter\\MessageFormatter' => $vendorDir . '/symfony/translation/Formatter/MessageFormatter.php', @@ -3694,6 +3718,7 @@ 'Symfony\\Component\\Translation\\Loader\\QtFileLoader' => $vendorDir . '/symfony/translation/Loader/QtFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\XliffFileLoader' => $vendorDir . '/symfony/translation/Loader/XliffFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\YamlFileLoader' => $vendorDir . '/symfony/translation/Loader/YamlFileLoader.php', + 'Symfony\\Component\\Translation\\LocaleSwitcher' => $vendorDir . '/symfony/translation/LocaleSwitcher.php', 'Symfony\\Component\\Translation\\LoggingTranslator' => $vendorDir . '/symfony/translation/LoggingTranslator.php', 'Symfony\\Component\\Translation\\MessageCatalogue' => $vendorDir . '/symfony/translation/MessageCatalogue.php', 'Symfony\\Component\\Translation\\MessageCatalogueInterface' => $vendorDir . '/symfony/translation/MessageCatalogueInterface.php', @@ -3800,13 +3825,13 @@ '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\\ServiceCollectionInterface' => $vendorDir . '/symfony/service-contracts/ServiceCollectionInterface.php', 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => $vendorDir . '/symfony/service-contracts/ServiceLocatorTrait.php', + 'Symfony\\Contracts\\Service\\ServiceMethodsSubscriberTrait' => $vendorDir . '/symfony/service-contracts/ServiceMethodsSubscriberTrait.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\\Contracts\\Translation\\LocaleAwareInterface' => $vendorDir . '/symfony/translation-contracts/LocaleAwareInterface.php', - 'Symfony\\Contracts\\Translation\\Test\\TranslatorTest' => $vendorDir . '/symfony/translation-contracts/Test/TranslatorTest.php', 'Symfony\\Contracts\\Translation\\TranslatableInterface' => $vendorDir . '/symfony/translation-contracts/TranslatableInterface.php', 'Symfony\\Contracts\\Translation\\TranslatorInterface' => $vendorDir . '/symfony/translation-contracts/TranslatorInterface.php', 'Symfony\\Contracts\\Translation\\TranslatorTrait' => $vendorDir . '/symfony/translation-contracts/TranslatorTrait.php', @@ -3818,11 +3843,9 @@ 'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\Regex' => $vendorDir . '/symfony/polyfill-intl-idn/Resources/unidata/Regex.php', 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Normalizer.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php', - 'Symfony\\Polyfill\\Php72\\Php72' => $vendorDir . '/symfony/polyfill-php72/Php72.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', - 'Symfony\\Polyfill\\Php81\\Php81' => $vendorDir . '/symfony/polyfill-php81/Php81.php', 'TestCase' => $baseDir . '/tests/TestCase.php', 'TheSeer\\Tokenizer\\Exception' => $vendorDir . '/theseer/tokenizer/src/Exception.php', 'TheSeer\\Tokenizer\\NamespaceUri' => $vendorDir . '/theseer/tokenizer/src/NamespaceUri.php', diff --git a/api/vendor/composer/autoload_files.php b/api/vendor/composer/autoload_files.php index 30d4dd6853..4a98d3ec3a 100644 --- a/api/vendor/composer/autoload_files.php +++ b/api/vendor/composer/autoload_files.php @@ -2,33 +2,33 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', - 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php', 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', + 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', '538ca81a9a966a6716601ecf48f4eaef' => $vendorDir . '/opis/closure/functions.php', 'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php', 'ef65a1626449d89d0811cf9befce46f0' => $vendorDir . '/illuminate/events/functions.php', '253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', 'bee9632da3ca00a99623b9c35d0c4f8b' => $vendorDir . '/laravel/lumen-framework/src/helpers.php', '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', '0ccdf99b8f62f02c52cba55802e0c2e7' => $vendorDir . '/zircote/swagger-php/src/functions.php', '3585c46f9622c6b622ab0011d4d72b3a' => $vendorDir . '/darkaonline/swagger-lume/src/helpers.php', + 'c72349b1fe8d0deeedd3a52e8aa814d8' => $vendorDir . '/mockery/mockery/library/helpers.php', + 'ce9671a430e4846b44e1c68c7611f9f5' => $vendorDir . '/mockery/mockery/library/Mockery.php', + 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', 'e54f50f1f018f3f5bdd79170d9f301b2' => $baseDir . '/app/Helpers/OccurrenceHelper.php', ); diff --git a/api/vendor/composer/autoload_namespaces.php b/api/vendor/composer/autoload_namespaces.php index 631bf71bfe..15a2ff3ad6 100644 --- a/api/vendor/composer/autoload_namespaces.php +++ b/api/vendor/composer/autoload_namespaces.php @@ -2,9 +2,8 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - 'Mockery' => array($vendorDir . '/mockery/mockery/library'), ); diff --git a/api/vendor/composer/autoload_psr4.php b/api/vendor/composer/autoload_psr4.php index db0d5537da..1b6979a852 100644 --- a/api/vendor/composer/autoload_psr4.php +++ b/api/vendor/composer/autoload_psr4.php @@ -2,16 +2,14 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), - 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), - 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), 'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'), @@ -39,12 +37,14 @@ 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'), 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), 'Opis\\Closure\\' => array($vendorDir . '/opis/closure/src'), 'OpenApi\\' => array($vendorDir . '/zircote/swagger-php/src'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), + 'Mockery\\' => array($vendorDir . '/mockery/mockery/library/Mockery'), 'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'), 'Laravel\\Lumen\\' => array($vendorDir . '/laravel/lumen-framework/src'), 'Illuminate\\View\\' => array($vendorDir . '/illuminate/view'), @@ -84,6 +84,7 @@ 'Database\\Seeders\\' => array($baseDir . '/database/seeders'), 'Database\\Factories\\' => array($baseDir . '/database/factories'), 'Cron\\' => array($vendorDir . '/dragonmantank/cron-expression/src/Cron'), + 'Carbon\\Doctrine\\' => array($vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine'), 'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'), 'Brick\\Math\\' => array($vendorDir . '/brick/math/src'), 'App\\' => array($baseDir . '/app'), diff --git a/api/vendor/composer/autoload_real.php b/api/vendor/composer/autoload_real.php index 878970f9f8..d9e1707c03 100644 --- a/api/vendor/composer/autoload_real.php +++ b/api/vendor/composer/autoload_real.php @@ -23,51 +23,26 @@ public static function getLoader() } spl_autoload_register(array('ComposerAutoloaderInite18bd6b57182fc88f4b9d0452696caaa', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInite18bd6b57182fc88f4b9d0452696caaa', '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 __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::getInitializer($loader)); - call_user_func(\Composer\Autoload\ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $loader->register(true); - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + $filesToLoad = \Composer\Autoload\ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + require $file; } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequiree18bd6b57182fc88f4b9d0452696caaa($fileIdentifier, $file); + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -function composerRequiree18bd6b57182fc88f4b9d0452696caaa($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/api/vendor/composer/autoload_static.php b/api/vendor/composer/autoload_static.php index a86a2ece57..c8f9247ef8 100644 --- a/api/vendor/composer/autoload_static.php +++ b/api/vendor/composer/autoload_static.php @@ -7,30 +7,30 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa { public static $files = array ( - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', - 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', + 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', + 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', '538ca81a9a966a6716601ecf48f4eaef' => __DIR__ . '/..' . '/opis/closure/functions.php', 'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php', 'ef65a1626449d89d0811cf9befce46f0' => __DIR__ . '/..' . '/illuminate/events/functions.php', '253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', 'bee9632da3ca00a99623b9c35d0c4f8b' => __DIR__ . '/..' . '/laravel/lumen-framework/src/helpers.php', '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', '0ccdf99b8f62f02c52cba55802e0c2e7' => __DIR__ . '/..' . '/zircote/swagger-php/src/functions.php', '3585c46f9622c6b622ab0011d4d72b3a' => __DIR__ . '/..' . '/darkaonline/swagger-lume/src/helpers.php', + 'c72349b1fe8d0deeedd3a52e8aa814d8' => __DIR__ . '/..' . '/mockery/mockery/library/helpers.php', + 'ce9671a430e4846b44e1c68c7611f9f5' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery.php', + 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', 'e54f50f1f018f3f5bdd79170d9f301b2' => __DIR__ . '/../..' . '/app/Helpers/OccurrenceHelper.php', ); @@ -45,10 +45,8 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa ), 'S' => array ( - 'Symfony\\Polyfill\\Php81\\' => 23, 'Symfony\\Polyfill\\Php80\\' => 23, 'Symfony\\Polyfill\\Php73\\' => 23, - 'Symfony\\Polyfill\\Php72\\' => 23, 'Symfony\\Polyfill\\Mbstring\\' => 26, 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, 'Symfony\\Polyfill\\Intl\\Idn\\' => 26, @@ -82,6 +80,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Psr\\Log\\' => 8, 'Psr\\EventDispatcher\\' => 20, 'Psr\\Container\\' => 14, + 'Psr\\Clock\\' => 10, 'Psr\\Cache\\' => 10, 'PhpParser\\' => 10, 'PhpOption\\' => 10, @@ -94,6 +93,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'M' => array ( 'Monolog\\' => 8, + 'Mockery\\' => 8, ), 'L' => array ( @@ -154,6 +154,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'C' => array ( 'Cron\\' => 5, + 'Carbon\\Doctrine\\' => 16, 'Carbon\\' => 7, ), 'B' => @@ -175,10 +176,6 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa array ( 0 => __DIR__ . '/..' . '/webmozart/assert/src', ), - 'Symfony\\Polyfill\\Php81\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', - ), 'Symfony\\Polyfill\\Php80\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', @@ -187,10 +184,6 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', ), - 'Symfony\\Polyfill\\Php72\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php72', - ), 'Symfony\\Polyfill\\Mbstring\\' => array ( 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', @@ -299,6 +292,10 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa array ( 0 => __DIR__ . '/..' . '/psr/container/src', ), + 'Psr\\Clock\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/clock/src', + ), 'Psr\\Cache\\' => array ( 0 => __DIR__ . '/..' . '/psr/cache/src', @@ -323,6 +320,10 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa array ( 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', ), + 'Mockery\\' => + array ( + 0 => __DIR__ . '/..' . '/mockery/mockery/library/Mockery', + ), 'Laravel\\SerializableClosure\\' => array ( 0 => __DIR__ . '/..' . '/laravel/serializable-closure/src', @@ -481,6 +482,10 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa array ( 0 => __DIR__ . '/..' . '/dragonmantank/cron-expression/src/Cron', ), + 'Carbon\\Doctrine\\' => + array ( + 0 => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine', + ), 'Carbon\\' => array ( 0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon', @@ -495,16 +500,6 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa ), ); - public static $prefixesPsr0 = array ( - 'M' => - array ( - 'Mockery' => - array ( - 0 => __DIR__ . '/..' . '/mockery/mockery/library', - ), - ), - ); - public static $classMap = array ( 'App\\Console\\Kernel' => __DIR__ . '/../..' . '/app/Console/Kernel.php', 'App\\Events\\Event' => __DIR__ . '/../..' . '/app/Events/Event.php', @@ -577,13 +572,13 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Carbon\\CarbonPeriodImmutable' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php', 'Carbon\\CarbonTimeZone' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/CarbonTimeZone.php', 'Carbon\\Cli\\Invoker' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Cli/Invoker.php', - 'Carbon\\Doctrine\\CarbonDoctrineType' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php', - 'Carbon\\Doctrine\\CarbonImmutableType' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php', - 'Carbon\\Doctrine\\CarbonType' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php', - 'Carbon\\Doctrine\\CarbonTypeConverter' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php', - 'Carbon\\Doctrine\\DateTimeDefaultPrecision' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php', - 'Carbon\\Doctrine\\DateTimeImmutableType' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php', - 'Carbon\\Doctrine\\DateTimeType' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php', + 'Carbon\\Doctrine\\CarbonDoctrineType' => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php', + 'Carbon\\Doctrine\\CarbonImmutableType' => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonImmutableType.php', + 'Carbon\\Doctrine\\CarbonType' => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonType.php', + 'Carbon\\Doctrine\\CarbonTypeConverter' => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php', + 'Carbon\\Doctrine\\DateTimeDefaultPrecision' => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php', + 'Carbon\\Doctrine\\DateTimeImmutableType' => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php', + 'Carbon\\Doctrine\\DateTimeType' => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php', 'Carbon\\Exceptions\\BadComparisonUnitException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php', 'Carbon\\Exceptions\\BadFluentConstructorException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php', 'Carbon\\Exceptions\\BadFluentSetterException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php', @@ -666,6 +661,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'DeepCopy\\DeepCopy' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/DeepCopy.php', 'DeepCopy\\Exception\\CloneException' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Exception/CloneException.php', 'DeepCopy\\Exception\\PropertyException' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Exception/PropertyException.php', + 'DeepCopy\\Filter\\ChainableFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php', 'DeepCopy\\Filter\\Doctrine\\DoctrineCollectionFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineCollectionFilter.php', 'DeepCopy\\Filter\\Doctrine\\DoctrineEmptyCollectionFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineEmptyCollectionFilter.php', 'DeepCopy\\Filter\\Doctrine\\DoctrineProxyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Filter/Doctrine/DoctrineProxyFilter.php', @@ -680,6 +676,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'DeepCopy\\Matcher\\PropertyTypeMatcher' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyTypeMatcher.php', 'DeepCopy\\Reflection\\ReflectionHelper' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/Reflection/ReflectionHelper.php', 'DeepCopy\\TypeFilter\\Date\\DateIntervalFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DateIntervalFilter.php', + 'DeepCopy\\TypeFilter\\Date\\DatePeriodFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php', 'DeepCopy\\TypeFilter\\ReplaceFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ReplaceFilter.php', 'DeepCopy\\TypeFilter\\ShallowCopyFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php', 'DeepCopy\\TypeFilter\\Spl\\ArrayObjectFilter' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/TypeFilter/Spl/ArrayObjectFilter.php', @@ -1247,6 +1244,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Faker\\Provider\\nl_BE\\Payment' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_BE/Payment.php', 'Faker\\Provider\\nl_BE\\Person' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_BE/Person.php', 'Faker\\Provider\\nl_BE\\PhoneNumber' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_BE/PhoneNumber.php', + 'Faker\\Provider\\nl_BE\\Text' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_BE/Text.php', 'Faker\\Provider\\nl_NL\\Address' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_NL/Address.php', 'Faker\\Provider\\nl_NL\\Color' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_NL/Color.php', 'Faker\\Provider\\nl_NL\\Company' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_NL/Company.php', @@ -1256,6 +1254,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Faker\\Provider\\nl_NL\\PhoneNumber' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_NL/PhoneNumber.php', 'Faker\\Provider\\nl_NL\\Text' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/nl_NL/Text.php', 'Faker\\Provider\\pl_PL\\Address' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/pl_PL/Address.php', + 'Faker\\Provider\\pl_PL\\Color' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/pl_PL/Color.php', 'Faker\\Provider\\pl_PL\\Company' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/pl_PL/Company.php', 'Faker\\Provider\\pl_PL\\Internet' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/pl_PL/Internet.php', 'Faker\\Provider\\pl_PL\\LicensePlate' => __DIR__ . '/..' . '/fakerphp/faker/src/Faker/Provider/pl_PL/LicensePlate.php', @@ -2314,7 +2313,6 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Laravel\\SerializableClosure\\Support\\ReflectionClosure' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Support/ReflectionClosure.php', 'Laravel\\SerializableClosure\\Support\\SelfReference' => __DIR__ . '/..' . '/laravel/serializable-closure/src/Support/SelfReference.php', 'Laravel\\SerializableClosure\\UnsignedSerializableClosure' => __DIR__ . '/..' . '/laravel/serializable-closure/src/UnsignedSerializableClosure.php', - 'Mockery' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery.php', 'Mockery\\Adapter\\Phpunit\\MockeryPHPUnitIntegration' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php', 'Mockery\\Adapter\\Phpunit\\MockeryPHPUnitIntegrationAssertPostConditions' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php', 'Mockery\\Adapter\\Phpunit\\MockeryTestCase' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryTestCase.php', @@ -2328,6 +2326,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Mockery\\CountValidator\\AtLeast' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/CountValidator/AtLeast.php', 'Mockery\\CountValidator\\AtMost' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/CountValidator/AtMost.php', 'Mockery\\CountValidator\\CountValidatorAbstract' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php', + 'Mockery\\CountValidator\\CountValidatorInterface' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/CountValidator/CountValidatorInterface.php', 'Mockery\\CountValidator\\Exact' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/CountValidator/Exact.php', 'Mockery\\CountValidator\\Exception' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/CountValidator/Exception.php', 'Mockery\\Exception' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Exception.php', @@ -2335,6 +2334,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Mockery\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php', 'Mockery\\Exception\\InvalidCountException' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Exception/InvalidCountException.php', 'Mockery\\Exception\\InvalidOrderException' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php', + 'Mockery\\Exception\\MockeryExceptionInterface' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Exception/MockeryExceptionInterface.php', 'Mockery\\Exception\\NoMatchingExpectationException' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Exception/NoMatchingExpectationException.php', 'Mockery\\Exception\\RuntimeException' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Exception/RuntimeException.php', 'Mockery\\Expectation' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Expectation.php', @@ -2353,6 +2353,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Mockery\\Generator\\StringManipulationGenerator' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php', 'Mockery\\Generator\\StringManipulation\\Pass\\AvoidMethodClashPass' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\CallTypeHintPass' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php', + 'Mockery\\Generator\\StringManipulation\\Pass\\ClassAttributesPass' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassAttributesPass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\ClassNamePass' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\ClassPass' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php', 'Mockery\\Generator\\StringManipulation\\Pass\\ConstantsPass' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php', @@ -2383,7 +2384,10 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Mockery\\Matcher\\Ducktype' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/Ducktype.php', 'Mockery\\Matcher\\HasKey' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/HasKey.php', 'Mockery\\Matcher\\HasValue' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/HasValue.php', + 'Mockery\\Matcher\\IsEqual' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/IsEqual.php', + 'Mockery\\Matcher\\IsSame' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/IsSame.php', 'Mockery\\Matcher\\MatcherAbstract' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php', + 'Mockery\\Matcher\\MatcherInterface' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/MatcherInterface.php', 'Mockery\\Matcher\\MultiArgumentClosure' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/MultiArgumentClosure.php', 'Mockery\\Matcher\\MustBe' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/MustBe.php', 'Mockery\\Matcher\\NoArgs' => __DIR__ . '/..' . '/mockery/mockery/library/Mockery/Matcher/NoArgs.php', @@ -2644,6 +2648,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PHPUnit\\Framework\\Constraint\\LogicalXor' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php', 'PHPUnit\\Framework\\Constraint\\ObjectEquals' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php', 'PHPUnit\\Framework\\Constraint\\ObjectHasAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php', + 'PHPUnit\\Framework\\Constraint\\ObjectHasProperty' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php', 'PHPUnit\\Framework\\Constraint\\Operator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Operator/Operator.php', 'PHPUnit\\Framework\\Constraint\\RegularExpression' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php', 'PHPUnit\\Framework\\Constraint\\SameSize' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Cardinality/SameSize.php', @@ -2874,8 +2879,8 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PHPUnit\\TextUI\\XmlConfiguration\\Migrator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromFilterWhitelistToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromFilterWhitelistToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveAttributesFromRootToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveAttributesFromRootToCoverage.php', - 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistDirectoriesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistExcludesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php', + 'PHPUnit\\TextUI\\XmlConfiguration\\MoveWhitelistIncludesToCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PHPUnit' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHPUnit/PHPUnit.php', 'PHPUnit\\TextUI\\XmlConfiguration\\Php' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/Php.php', 'PHPUnit\\TextUI\\XmlConfiguration\\PhpHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php', @@ -2982,6 +2987,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PharIo\\Manifest\\ManifestLoader' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestLoader.php', 'PharIo\\Manifest\\ManifestLoaderException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/ManifestLoaderException.php', 'PharIo\\Manifest\\ManifestSerializer' => __DIR__ . '/..' . '/phar-io/manifest/src/ManifestSerializer.php', + 'PharIo\\Manifest\\NoEmailAddressException' => __DIR__ . '/..' . '/phar-io/manifest/src/exceptions/NoEmailAddressException.php', 'PharIo\\Manifest\\PhpElement' => __DIR__ . '/..' . '/phar-io/manifest/src/xml/PhpElement.php', 'PharIo\\Manifest\\PhpExtensionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpExtensionRequirement.php', 'PharIo\\Manifest\\PhpVersionRequirement' => __DIR__ . '/..' . '/phar-io/manifest/src/values/PhpVersionRequirement.php', @@ -3046,24 +3052,24 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Internal\\DiffElem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php', 'PhpParser\\Internal\\Differ' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/Differ.php', 'PhpParser\\Internal\\PrintableNewAnonClassNode' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php', + 'PhpParser\\Internal\\TokenPolyfill' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php', 'PhpParser\\Internal\\TokenStream' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php', 'PhpParser\\JsonDecoder' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/JsonDecoder.php', 'PhpParser\\Lexer' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer.php', 'PhpParser\\Lexer\\Emulative' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php', + 'PhpParser\\Lexer\\TokenEmulator\\AsymmetricVisibilityTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\AttributeEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\CoaleseEqualTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\EnumTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ExplicitOctalEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\FlexibleDocStringEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\FnTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\KeywordEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\MatchTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\NullsafeTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php', - 'PhpParser\\Lexer\\TokenEmulator\\NumericLiteralSeparatorEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php', + 'PhpParser\\Lexer\\TokenEmulator\\PropertyTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ReadonlyFunctionTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ReadonlyTokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\ReverseEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php', 'PhpParser\\Lexer\\TokenEmulator\\TokenEmulator' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php', + 'PhpParser\\Modifiers' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Modifiers.php', 'PhpParser\\NameContext' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NameContext.php', 'PhpParser\\Node' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node.php', 'PhpParser\\NodeAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeAbstract.php', @@ -3074,19 +3080,22 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\NodeVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor.php', 'PhpParser\\NodeVisitorAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php', 'PhpParser\\NodeVisitor\\CloningVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php', + 'PhpParser\\NodeVisitor\\CommentAnnotatingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php', 'PhpParser\\NodeVisitor\\FindingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php', 'PhpParser\\NodeVisitor\\FirstFindingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php', 'PhpParser\\NodeVisitor\\NameResolver' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php', 'PhpParser\\NodeVisitor\\NodeConnectingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php', 'PhpParser\\NodeVisitor\\ParentConnectingVisitor' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php', 'PhpParser\\Node\\Arg' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Arg.php', + 'PhpParser\\Node\\ArrayItem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php', 'PhpParser\\Node\\Attribute' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Attribute.php', 'PhpParser\\Node\\AttributeGroup' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php', + 'PhpParser\\Node\\ClosureUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php', 'PhpParser\\Node\\ComplexType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/ComplexType.php', 'PhpParser\\Node\\Const_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Const_.php', + 'PhpParser\\Node\\DeclareItem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php', 'PhpParser\\Node\\Expr' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr.php', 'PhpParser\\Node\\Expr\\ArrayDimFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php', - 'PhpParser\\Node\\Expr\\ArrayItem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php', 'PhpParser\\Node\\Expr\\Array_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php', 'PhpParser\\Node\\Expr\\ArrowFunction' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php', 'PhpParser\\Node\\Expr\\Assign' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php', @@ -3147,7 +3156,6 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Node\\Expr\\ClassConstFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php', 'PhpParser\\Node\\Expr\\Clone_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php', 'PhpParser\\Node\\Expr\\Closure' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php', - 'PhpParser\\Node\\Expr\\ClosureUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php', 'PhpParser\\Node\\Expr\\ConstFetch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php', 'PhpParser\\Node\\Expr\\Empty_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php', 'PhpParser\\Node\\Expr\\Error' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php', @@ -3182,6 +3190,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Node\\Expr\\Yield_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php', 'PhpParser\\Node\\FunctionLike' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php', 'PhpParser\\Node\\Identifier' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Identifier.php', + 'PhpParser\\Node\\InterpolatedStringPart' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php', 'PhpParser\\Node\\IntersectionType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php', 'PhpParser\\Node\\MatchArm' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/MatchArm.php', 'PhpParser\\Node\\Name' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Name.php', @@ -3189,11 +3198,12 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Node\\Name\\Relative' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php', 'PhpParser\\Node\\NullableType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/NullableType.php', 'PhpParser\\Node\\Param' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Param.php', + 'PhpParser\\Node\\PropertyHook' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php', + 'PhpParser\\Node\\PropertyItem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php', 'PhpParser\\Node\\Scalar' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar.php', - 'PhpParser\\Node\\Scalar\\DNumber' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php', - 'PhpParser\\Node\\Scalar\\Encapsed' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php', - 'PhpParser\\Node\\Scalar\\EncapsedStringPart' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php', - 'PhpParser\\Node\\Scalar\\LNumber' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php', + 'PhpParser\\Node\\Scalar\\Float_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php', + 'PhpParser\\Node\\Scalar\\Int_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php', + 'PhpParser\\Node\\Scalar\\InterpolatedString' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php', 'PhpParser\\Node\\Scalar\\MagicConst' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Class_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Dir' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php', @@ -3202,9 +3212,12 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Node\\Scalar\\MagicConst\\Line' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Method' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Namespace_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php', + 'PhpParser\\Node\\Scalar\\MagicConst\\Property' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Property.php', 'PhpParser\\Node\\Scalar\\MagicConst\\Trait_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Trait_.php', 'PhpParser\\Node\\Scalar\\String_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Scalar/String_.php', + 'PhpParser\\Node\\StaticVar' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/StaticVar.php', 'PhpParser\\Node\\Stmt' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt.php', + 'PhpParser\\Node\\Stmt\\Block' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php', 'PhpParser\\Node\\Stmt\\Break_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php', 'PhpParser\\Node\\Stmt\\Case_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php', 'PhpParser\\Node\\Stmt\\Catch_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php', @@ -3214,7 +3227,6 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Node\\Stmt\\Class_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php', 'PhpParser\\Node\\Stmt\\Const_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php', 'PhpParser\\Node\\Stmt\\Continue_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php', - 'PhpParser\\Node\\Stmt\\DeclareDeclare' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php', 'PhpParser\\Node\\Stmt\\Declare_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php', 'PhpParser\\Node\\Stmt\\Do_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php', 'PhpParser\\Node\\Stmt\\Echo_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php', @@ -3238,12 +3250,9 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Node\\Stmt\\Namespace_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php', 'PhpParser\\Node\\Stmt\\Nop' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php', 'PhpParser\\Node\\Stmt\\Property' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php', - 'PhpParser\\Node\\Stmt\\PropertyProperty' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php', 'PhpParser\\Node\\Stmt\\Return_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php', - 'PhpParser\\Node\\Stmt\\StaticVar' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php', 'PhpParser\\Node\\Stmt\\Static_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php', 'PhpParser\\Node\\Stmt\\Switch_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php', - 'PhpParser\\Node\\Stmt\\Throw_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php', 'PhpParser\\Node\\Stmt\\TraitUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php', 'PhpParser\\Node\\Stmt\\TraitUseAdaptation' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php', 'PhpParser\\Node\\Stmt\\TraitUseAdaptation\\Alias' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php', @@ -3251,26 +3260,28 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'PhpParser\\Node\\Stmt\\Trait_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php', 'PhpParser\\Node\\Stmt\\TryCatch' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php', 'PhpParser\\Node\\Stmt\\Unset_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php', - 'PhpParser\\Node\\Stmt\\UseUse' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php', 'PhpParser\\Node\\Stmt\\Use_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php', 'PhpParser\\Node\\Stmt\\While_' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php', 'PhpParser\\Node\\UnionType' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/UnionType.php', + 'PhpParser\\Node\\UseItem' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/UseItem.php', 'PhpParser\\Node\\VarLikeIdentifier' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php', 'PhpParser\\Node\\VariadicPlaceholder' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php', 'PhpParser\\Parser' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser.php', 'PhpParser\\ParserAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ParserAbstract.php', 'PhpParser\\ParserFactory' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/ParserFactory.php', - 'PhpParser\\Parser\\Multiple' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Multiple.php', - 'PhpParser\\Parser\\Php5' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Php5.php', 'PhpParser\\Parser\\Php7' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Php7.php', - 'PhpParser\\Parser\\Tokens' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Tokens.php', + 'PhpParser\\Parser\\Php8' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Parser/Php8.php', + 'PhpParser\\PhpVersion' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/PhpVersion.php', + 'PhpParser\\PrettyPrinter' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/PrettyPrinter.php', 'PhpParser\\PrettyPrinterAbstract' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php', 'PhpParser\\PrettyPrinter\\Standard' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php', + 'PhpParser\\Token' => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser/Token.php', 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Psr\\Cache\\CacheException' => __DIR__ . '/..' . '/psr/cache/src/CacheException.php', 'Psr\\Cache\\CacheItemInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemInterface.php', 'Psr\\Cache\\CacheItemPoolInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemPoolInterface.php', 'Psr\\Cache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/cache/src/InvalidArgumentException.php', + 'Psr\\Clock\\ClockInterface' => __DIR__ . '/..' . '/psr/clock/src/ClockInterface.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', @@ -3296,13 +3307,13 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Ramsey\\Collection\\CollectionInterface' => __DIR__ . '/..' . '/ramsey/collection/src/CollectionInterface.php', 'Ramsey\\Collection\\DoubleEndedQueue' => __DIR__ . '/..' . '/ramsey/collection/src/DoubleEndedQueue.php', 'Ramsey\\Collection\\DoubleEndedQueueInterface' => __DIR__ . '/..' . '/ramsey/collection/src/DoubleEndedQueueInterface.php', + 'Ramsey\\Collection\\Exception\\CollectionException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/CollectionException.php', 'Ramsey\\Collection\\Exception\\CollectionMismatchException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/CollectionMismatchException.php', 'Ramsey\\Collection\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/InvalidArgumentException.php', - 'Ramsey\\Collection\\Exception\\InvalidSortOrderException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/InvalidSortOrderException.php', + 'Ramsey\\Collection\\Exception\\InvalidPropertyOrMethod' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php', 'Ramsey\\Collection\\Exception\\NoSuchElementException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/NoSuchElementException.php', 'Ramsey\\Collection\\Exception\\OutOfBoundsException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/OutOfBoundsException.php', 'Ramsey\\Collection\\Exception\\UnsupportedOperationException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/UnsupportedOperationException.php', - 'Ramsey\\Collection\\Exception\\ValueExtractionException' => __DIR__ . '/..' . '/ramsey/collection/src/Exception/ValueExtractionException.php', 'Ramsey\\Collection\\GenericArray' => __DIR__ . '/..' . '/ramsey/collection/src/GenericArray.php', 'Ramsey\\Collection\\Map\\AbstractMap' => __DIR__ . '/..' . '/ramsey/collection/src/Map/AbstractMap.php', 'Ramsey\\Collection\\Map\\AbstractTypedMap' => __DIR__ . '/..' . '/ramsey/collection/src/Map/AbstractTypedMap.php', @@ -3314,6 +3325,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Ramsey\\Collection\\Queue' => __DIR__ . '/..' . '/ramsey/collection/src/Queue.php', 'Ramsey\\Collection\\QueueInterface' => __DIR__ . '/..' . '/ramsey/collection/src/QueueInterface.php', 'Ramsey\\Collection\\Set' => __DIR__ . '/..' . '/ramsey/collection/src/Set.php', + 'Ramsey\\Collection\\Sort' => __DIR__ . '/..' . '/ramsey/collection/src/Sort.php', 'Ramsey\\Collection\\Tool\\TypeTrait' => __DIR__ . '/..' . '/ramsey/collection/src/Tool/TypeTrait.php', 'Ramsey\\Collection\\Tool\\ValueExtractorTrait' => __DIR__ . '/..' . '/ramsey/collection/src/Tool/ValueExtractorTrait.php', 'Ramsey\\Collection\\Tool\\ValueToStringTrait' => __DIR__ . '/..' . '/ramsey/collection/src/Tool/ValueToStringTrait.php', @@ -3429,7 +3441,6 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Ramsey\\Uuid\\UuidInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/UuidInterface.php', 'Ramsey\\Uuid\\Validator\\GenericValidator' => __DIR__ . '/..' . '/ramsey/uuid/src/Validator/GenericValidator.php', 'Ramsey\\Uuid\\Validator\\ValidatorInterface' => __DIR__ . '/..' . '/ramsey/uuid/src/Validator/ValidatorInterface.php', - 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', 'SebastianBergmann\\CliParser\\AmbiguousOptionException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/AmbiguousOptionException.php', 'SebastianBergmann\\CliParser\\Exception' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/Exception.php', 'SebastianBergmann\\CliParser\\OptionDoesNotAllowArgumentException' => __DIR__ . '/..' . '/sebastian/cli-parser/src/exceptions/OptionDoesNotAllowArgumentException.php', @@ -4133,6 +4144,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Symfony\\Component\\String\\Slugger\\AsciiSlugger' => __DIR__ . '/..' . '/symfony/string/Slugger/AsciiSlugger.php', 'Symfony\\Component\\String\\Slugger\\SluggerInterface' => __DIR__ . '/..' . '/symfony/string/Slugger/SluggerInterface.php', 'Symfony\\Component\\String\\UnicodeString' => __DIR__ . '/..' . '/symfony/string/UnicodeString.php', + 'Symfony\\Component\\Translation\\CatalogueMetadataAwareInterface' => __DIR__ . '/..' . '/symfony/translation/CatalogueMetadataAwareInterface.php', 'Symfony\\Component\\Translation\\Catalogue\\AbstractOperation' => __DIR__ . '/..' . '/symfony/translation/Catalogue/AbstractOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\MergeOperation' => __DIR__ . '/..' . '/symfony/translation/Catalogue/MergeOperation.php', 'Symfony\\Component\\Translation\\Catalogue\\OperationInterface' => __DIR__ . '/..' . '/symfony/translation/Catalogue/OperationInterface.php', @@ -4143,6 +4155,8 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Symfony\\Component\\Translation\\Command\\XliffLintCommand' => __DIR__ . '/..' . '/symfony/translation/Command/XliffLintCommand.php', 'Symfony\\Component\\Translation\\DataCollectorTranslator' => __DIR__ . '/..' . '/symfony/translation/DataCollectorTranslator.php', 'Symfony\\Component\\Translation\\DataCollector\\TranslationDataCollector' => __DIR__ . '/..' . '/symfony/translation/DataCollector/TranslationDataCollector.php', + 'Symfony\\Component\\Translation\\DependencyInjection\\DataCollectorTranslatorPass' => __DIR__ . '/..' . '/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php', + 'Symfony\\Component\\Translation\\DependencyInjection\\LoggingTranslatorPass' => __DIR__ . '/..' . '/symfony/translation/DependencyInjection/LoggingTranslatorPass.php', 'Symfony\\Component\\Translation\\DependencyInjection\\TranslationDumperPass' => __DIR__ . '/..' . '/symfony/translation/DependencyInjection/TranslationDumperPass.php', 'Symfony\\Component\\Translation\\DependencyInjection\\TranslationExtractorPass' => __DIR__ . '/..' . '/symfony/translation/DependencyInjection/TranslationExtractorPass.php', 'Symfony\\Component\\Translation\\DependencyInjection\\TranslatorPass' => __DIR__ . '/..' . '/symfony/translation/DependencyInjection/TranslatorPass.php', @@ -4173,8 +4187,13 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Symfony\\Component\\Translation\\Extractor\\AbstractFileExtractor' => __DIR__ . '/..' . '/symfony/translation/Extractor/AbstractFileExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\ChainExtractor' => __DIR__ . '/..' . '/symfony/translation/Extractor/ChainExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\ExtractorInterface' => __DIR__ . '/..' . '/symfony/translation/Extractor/ExtractorInterface.php', + 'Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor' => __DIR__ . '/..' . '/symfony/translation/Extractor/PhpAstExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\PhpExtractor' => __DIR__ . '/..' . '/symfony/translation/Extractor/PhpExtractor.php', 'Symfony\\Component\\Translation\\Extractor\\PhpStringTokenParser' => __DIR__ . '/..' . '/symfony/translation/Extractor/PhpStringTokenParser.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\AbstractVisitor' => __DIR__ . '/..' . '/symfony/translation/Extractor/Visitor/AbstractVisitor.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\ConstraintVisitor' => __DIR__ . '/..' . '/symfony/translation/Extractor/Visitor/ConstraintVisitor.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\TransMethodVisitor' => __DIR__ . '/..' . '/symfony/translation/Extractor/Visitor/TransMethodVisitor.php', + 'Symfony\\Component\\Translation\\Extractor\\Visitor\\TranslatableMessageVisitor' => __DIR__ . '/..' . '/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php', 'Symfony\\Component\\Translation\\Formatter\\IntlFormatter' => __DIR__ . '/..' . '/symfony/translation/Formatter/IntlFormatter.php', 'Symfony\\Component\\Translation\\Formatter\\IntlFormatterInterface' => __DIR__ . '/..' . '/symfony/translation/Formatter/IntlFormatterInterface.php', 'Symfony\\Component\\Translation\\Formatter\\MessageFormatter' => __DIR__ . '/..' . '/symfony/translation/Formatter/MessageFormatter.php', @@ -4194,6 +4213,7 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Symfony\\Component\\Translation\\Loader\\QtFileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/QtFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\XliffFileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/XliffFileLoader.php', 'Symfony\\Component\\Translation\\Loader\\YamlFileLoader' => __DIR__ . '/..' . '/symfony/translation/Loader/YamlFileLoader.php', + 'Symfony\\Component\\Translation\\LocaleSwitcher' => __DIR__ . '/..' . '/symfony/translation/LocaleSwitcher.php', 'Symfony\\Component\\Translation\\LoggingTranslator' => __DIR__ . '/..' . '/symfony/translation/LoggingTranslator.php', 'Symfony\\Component\\Translation\\MessageCatalogue' => __DIR__ . '/..' . '/symfony/translation/MessageCatalogue.php', 'Symfony\\Component\\Translation\\MessageCatalogueInterface' => __DIR__ . '/..' . '/symfony/translation/MessageCatalogueInterface.php', @@ -4300,13 +4320,13 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa '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\\ServiceCollectionInterface' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceCollectionInterface.php', 'Symfony\\Contracts\\Service\\ServiceLocatorTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceLocatorTrait.php', + 'Symfony\\Contracts\\Service\\ServiceMethodsSubscriberTrait' => __DIR__ . '/..' . '/symfony/service-contracts/ServiceMethodsSubscriberTrait.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\\Contracts\\Translation\\LocaleAwareInterface' => __DIR__ . '/..' . '/symfony/translation-contracts/LocaleAwareInterface.php', - 'Symfony\\Contracts\\Translation\\Test\\TranslatorTest' => __DIR__ . '/..' . '/symfony/translation-contracts/Test/TranslatorTest.php', 'Symfony\\Contracts\\Translation\\TranslatableInterface' => __DIR__ . '/..' . '/symfony/translation-contracts/TranslatableInterface.php', 'Symfony\\Contracts\\Translation\\TranslatorInterface' => __DIR__ . '/..' . '/symfony/translation-contracts/TranslatorInterface.php', 'Symfony\\Contracts\\Translation\\TranslatorTrait' => __DIR__ . '/..' . '/symfony/translation-contracts/TranslatorTrait.php', @@ -4318,11 +4338,9 @@ class ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa 'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\Regex' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Resources/unidata/Regex.php', 'Symfony\\Polyfill\\Intl\\Normalizer\\Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Normalizer.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php', - 'Symfony\\Polyfill\\Php72\\Php72' => __DIR__ . '/..' . '/symfony/polyfill-php72/Php72.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', - 'Symfony\\Polyfill\\Php81\\Php81' => __DIR__ . '/..' . '/symfony/polyfill-php81/Php81.php', 'TestCase' => __DIR__ . '/../..' . '/tests/TestCase.php', 'TheSeer\\Tokenizer\\Exception' => __DIR__ . '/..' . '/theseer/tokenizer/src/Exception.php', 'TheSeer\\Tokenizer\\NamespaceUri' => __DIR__ . '/..' . '/theseer/tokenizer/src/NamespaceUri.php', @@ -4345,7 +4363,6 @@ public static function getInitializer(ClassLoader $loader) return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::$prefixesPsr0; $loader->classMap = ComposerStaticInite18bd6b57182fc88f4b9d0452696caaa::$classMap; }, null, ClassLoader::class); diff --git a/api/vendor/composer/installed.json b/api/vendor/composer/installed.json index 76ddf7ad72..9c7a0b6bbf 100644 --- a/api/vendor/composer/installed.json +++ b/api/vendor/composer/installed.json @@ -2,29 +2,28 @@ "packages": [ { "name": "brick/math", - "version": "0.10.2", - "version_normalized": "0.10.2.0", + "version": "0.12.1", + "version_normalized": "0.12.1.0", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f" + "reference": "f510c0a40911935b77b86859eb5223d58d660df1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/459f2781e1a08d52ee56b0b1444086e038561e3f", - "reference": "459f2781e1a08d52ee56b0b1444086e038561e3f", + "url": "https://api.github.com/repos/brick/math/zipball/f510c0a40911935b77b86859eb5223d58d660df1", + "reference": "f510c0a40911935b77b86859eb5223d58d660df1", "shasum": "" }, "require": { - "ext-json": "*", - "php": "^7.4 || ^8.0" + "php": "^8.1" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "4.25.0" + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "5.16.0" }, - "time": "2022-08-10T22:54:19+00:00", + "time": "2023-11-29T23:19:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -44,12 +43,17 @@ "arithmetic", "bigdecimal", "bignum", + "bignumber", "brick", - "math" + "decimal", + "integer", + "math", + "mathematics", + "rational" ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.10.2" + "source": "https://github.com/brick/math/tree/0.12.1" }, "funding": [ { @@ -59,6 +63,78 @@ ], "install-path": "../brick/math" }, + { + "name": "carbonphp/carbon-doctrine-types", + "version": "3.2.0", + "version_normalized": "3.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "time": "2024-02-09T16:56:22+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "install-path": "../carbonphp/carbon-doctrine-types" + }, { "name": "darkaonline/swagger-lume", "version": "8.0", @@ -128,17 +204,17 @@ }, { "name": "doctrine/annotations", - "version": "1.14.3", - "version_normalized": "1.14.3.0", + "version": "1.14.4", + "version_normalized": "1.14.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/253dca476f70808a5aeed3a47cc2cc88c5cab915", + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915", "shasum": "" }, "require": { @@ -149,16 +225,16 @@ }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "~1.4.10 || ^1.10.28", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7", + "vimeo/psalm": "^4.30 || ^5.14" }, "suggest": { "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" }, - "time": "2023-02-01T09:20:38+00:00", + "time": "2024-09-05T10:15:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -201,37 +277,37 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.3" + "source": "https://github.com/doctrine/annotations/tree/1.14.4" }, "install-path": "../doctrine/annotations" }, { "name": "doctrine/inflector", - "version": "2.0.6", - "version_normalized": "2.0.6.0", + "version": "2.0.10", + "version_normalized": "2.0.10.0", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024" + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", - "reference": "d9d313a36c872fd6ee06d9a6cbcf713eaa40f024", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^11.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "vimeo/psalm": "^4.25 || ^5.4" }, - "time": "2022-10-20T09:10:12+00:00", + "time": "2024-02-18T20:23:39+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -281,7 +357,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.6" + "source": "https://github.com/doctrine/inflector/tree/2.0.10" }, "funding": [ { @@ -301,33 +377,33 @@ }, { "name": "doctrine/instantiator", - "version": "1.5.0", - "version_normalized": "1.5.0.0", + "version": "2.0.0", + "version_normalized": "2.0.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, - "time": "2022-12-30T00:15:36+00:00", + "time": "2022-12-30T00:23:10+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -354,7 +430,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -453,17 +529,17 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v3.3.2", - "version_normalized": "3.3.2.0", + "version": "v3.4.0", + "version_normalized": "3.4.0.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8" + "reference": "8c784d071debd117328803d86b2097615b457500" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/782ca5968ab8b954773518e9e49a6f892a34b2a8", - "reference": "782ca5968ab8b954773518e9e49a6f892a34b2a8", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8c784d071debd117328803d86b2097615b457500", + "reference": "8c784d071debd117328803d86b2097615b457500", "shasum": "" }, "require": { @@ -476,11 +552,15 @@ "require-dev": { "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.0", - "phpstan/phpstan-webmozart-assert": "^1.0", "phpunit/phpunit": "^7.0|^8.0|^9.0" }, - "time": "2022-09-10T18:51:20+00:00", + "time": "2024-10-09T13:47:03+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-4": { @@ -505,7 +585,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v3.3.2" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.4.0" }, "funding": [ { @@ -588,17 +668,17 @@ }, { "name": "fakerphp/faker", - "version": "v1.21.0", - "version_normalized": "1.21.0.0", + "version": "v1.24.1", + "version_normalized": "1.24.1.0", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d" + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/92efad6a967f0b79c499705c69b662f738cc9e4d", - "reference": "92efad6a967f0b79c499705c69b662f738cc9e4d", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", "shasum": "" }, "require": { @@ -623,13 +703,8 @@ "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", "ext-mbstring": "Required for multibyte Unicode string functionality." }, - "time": "2022-12-13T13:54:32+00:00", + "time": "2024-11-21T13:46:39+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } - }, "installation-source": "dist", "autoload": { "psr-4": { @@ -653,33 +728,33 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.21.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" }, "install-path": "../fakerphp/faker" }, { "name": "graham-campbell/result-type", - "version": "v1.1.0", - "version_normalized": "1.1.0.0", + "version": "v1.1.3", + "version_normalized": "1.1.3.0", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8" + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/a878d45c1914464426dc94da61c9e1d36ae262a8", - "reference": "a878d45c1914464426dc94da61c9e1d36ae262a8", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" + "phpoption/phpoption": "^1.9.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, - "time": "2022-07-30T15:56:11+00:00", + "time": "2024-07-20T21:45:45+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -708,7 +783,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.0" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" }, "funding": [ { @@ -2393,29 +2468,30 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "version": "v1.3.7", + "version_normalized": "1.3.7.0", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37" + "reference": "4f48ade902b94323ca3be7646db16209ec76be3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", - "reference": "f23fe9d4e95255dacee1bf3525e0810d1a1b0f37", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/4f48ade902b94323ca3be7646db16209ec76be3d", + "reference": "4f48ade902b94323ca3be7646db16209ec76be3d", "shasum": "" }, "require": { "php": "^7.3|^8.0" }, "require-dev": { - "nesbot/carbon": "^2.61", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", + "nesbot/carbon": "^2.61|^3.0", "pestphp/pest": "^1.21.3", "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11" + "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" }, - "time": "2023-01-30T18:31:20+00:00", + "time": "2024-11-14T18:34:49+00:00", "type": "library", "extra": { "branch-alias": { @@ -2456,41 +2532,41 @@ }, { "name": "mockery/mockery", - "version": "1.5.1", - "version_normalized": "1.5.1.0", + "version": "1.6.12", + "version_normalized": "1.6.12.0", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e" + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/e92dcc83d5a51851baf5f5591d32cb2b16e3684e", - "reference": "e92dcc83d5a51851baf5f5591d32cb2b16e3684e", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", "shasum": "" }, "require": { "hamcrest/hamcrest-php": "^2.0.1", "lib-pcre": ">=7.0", - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "conflict": { "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" }, - "time": "2022-09-07T15:32:08+00:00", + "time": "2024-05-16T03:13:13+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "installation-source": "dist", "autoload": { - "psr-0": { - "Mockery": "library/" + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" } }, "notification-url": "https://packagist.org/downloads/", @@ -2501,12 +2577,20 @@ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], "description": "Mockery is a simple yet flexible PHP mock object framework", @@ -2524,24 +2608,27 @@ "testing" ], "support": { + "docs": "https://docs.mockery.io/", "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.5.1" + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, "install-path": "../mockery/mockery" }, { "name": "monolog/monolog", - "version": "2.8.0", - "version_normalized": "2.8.0.0", + "version": "2.10.0", + "version_normalized": "2.10.0.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50" + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/720488632c590286b88b80e62aa3d3d551ad4a50", - "reference": "720488632c590286b88b80e62aa3d3d551ad4a50", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5cf826f2991858b54d5c3809bee745560a1042a7", + "reference": "5cf826f2991858b54d5c3809bee745560a1042a7", "shasum": "" }, "require": { @@ -2556,14 +2643,14 @@ "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", "ext-json": "*", - "graylog2/gelf-php": "^1.4.2", + "graylog2/gelf-php": "^1.4.2 || ^2@dev", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.38 || ^9.6.19", "predis/predis": "^1.1 || ^2.0", "rollbar/rollbar": "^1.3 || ^2 || ^3", "ruflin/elastica": "^7", @@ -2587,7 +2674,7 @@ "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, - "time": "2022-07-24T11:55:47+00:00", + "time": "2024-11-12T12:43:37+00:00", "type": "library", "extra": { "branch-alias": { @@ -2620,7 +2707,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.8.0" + "source": "https://github.com/Seldaek/monolog/tree/2.10.0" }, "funding": [ { @@ -2636,17 +2723,17 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.0", - "version_normalized": "1.11.0.0", + "version": "1.12.1", + "version_normalized": "1.12.1.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -2654,14 +2741,15 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, - "time": "2022-03-03T13:19:32+00:00", + "time": "2024-11-08T17:47:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2686,7 +2774,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -2698,29 +2786,34 @@ }, { "name": "nesbot/carbon", - "version": "2.66.0", - "version_normalized": "2.66.0.0", + "version": "2.72.5", + "version_normalized": "2.72.5.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "496712849902241f04902033b0441b269effe001" + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/496712849902241f04902033b0441b269effe001", - "reference": "496712849902241f04902033b0441b269effe001", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/afd46589c216118ecd48ff2b95d77596af1e57ed", + "reference": "afd46589c216118ecd48ff2b95d77596af1e57ed", "shasum": "" }, "require": { + "carbonphp/carbon-doctrine-types": "*", "ext-json": "*", "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, + "provide": { + "psr/clock-implementation": "1.0" + }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4", - "doctrine/orm": "^2.7", + "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", + "doctrine/orm": "^2.7 || ^3.0", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "ondrejmirtes/better-reflection": "*", @@ -2731,15 +2824,15 @@ "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", "squizlabs/php_codesniffer": "^3.4" }, - "time": "2023-01-29T18:53:47+00:00", + "time": "2024-06-03T19:18:41+00:00", "bin": [ "bin/carbon" ], "type": "library", "extra": { "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev" }, "laravel": { "providers": [ @@ -2856,35 +2949,37 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.3", - "version_normalized": "4.15.3.0", + "version": "v5.3.1", + "version_normalized": "5.3.1.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", + "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, - "time": "2023-01-16T22:05:37+00:00", + "time": "2024-10-08T18:51:32+00:00", "bin": [ "bin/php-parse" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "installation-source": "dist", @@ -2909,7 +3004,7 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" }, "install-path": "../nikic/php-parser" }, @@ -2983,27 +3078,28 @@ }, { "name": "phar-io/manifest", - "version": "2.0.3", - "version_normalized": "2.0.3.0", + "version": "2.0.4", + "version_normalized": "2.0.4.0", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", "php": "^7.2 || ^8.0" }, - "time": "2021-07-20T11:28:43+00:00", + "time": "2024-03-03T12:33:53+00:00", "type": "library", "extra": { "branch-alias": { @@ -3040,8 +3136,14 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], "install-path": "../phar-io/manifest" }, { @@ -3100,32 +3202,32 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.0", - "version_normalized": "1.9.0.0", + "version": "1.9.3", + "version_normalized": "1.9.3.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab" + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", - "reference": "dc5ff11e274a90cc1c743f66c9ad700ce50db9ab", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, - "time": "2022-07-30T15:51:26+00:00", + "time": "2024-07-20T21:41:07+00:00", "type": "library", "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { "dev-master": "1.9-dev" @@ -3162,7 +3264,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.0" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" }, "funding": [ { @@ -3178,46 +3280,46 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.24", - "version_normalized": "9.2.24.0", + "version": "9.2.32", + "version_normalized": "9.2.32.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, - "time": "2023-01-26T08:26:55+00:00", + "time": "2024-08-22T04:23:01+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "installation-source": "dist", @@ -3246,7 +3348,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -3511,53 +3614,53 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.0", - "version_normalized": "9.6.0.0", + "version": "9.6.22", + "version_normalized": "9.6.22.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "70fc8be1d0b9fad56a199a4df5f9cfabfc246f84" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/70fc8be1d0b9fad56a199a4df5f9cfabfc246f84", - "reference": "70fc8be1d0b9fad56a199a4df5f9cfabfc246f84", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, - "time": "2023-02-03T07:32:24+00:00", + "time": "2024-12-05T13:48:26+00:00", "bin": [ "phpunit" ], @@ -3596,7 +3699,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.0" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -3666,6 +3770,57 @@ }, "install-path": "../psr/cache" }, + { + "name": "psr/clock", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "time": "2022-11-25T14:36:26+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "install-path": "../psr/clock" + }, { "name": "psr/container", "version": "1.1.2", @@ -3879,22 +4034,21 @@ }, { "name": "ramsey/collection", - "version": "1.3.0", - "version_normalized": "1.3.0.0", + "version": "2.0.0", + "version_normalized": "2.0.0.0", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", + "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", - "symfony/polyfill-php81": "^1.23" + "php": "^8.1" }, "require-dev": { "captainhook/plugin-composer": "^5.3", @@ -3918,7 +4072,7 @@ "ramsey/conventional-commits": "^1.3", "vimeo/psalm": "^5.4" }, - "time": "2022-12-27T19:12:24+00:00", + "time": "2022-12-31T21:50:55+00:00", "type": "library", "extra": { "captainhook": { @@ -3956,7 +4110,7 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.3.0" + "source": "https://github.com/ramsey/collection/tree/2.0.0" }, "funding": [ { @@ -3972,21 +4126,21 @@ }, { "name": "ramsey/uuid", - "version": "4.7.3", - "version_normalized": "4.7.3.0", + "version": "4.7.6", + "version_normalized": "4.7.6.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "433b2014e3979047db08a17a205f410ba3869cf2" + "reference": "91039bc1faa45ba123c4328958e620d382ec7088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/433b2014e3979047db08a17a205f410ba3869cf2", - "reference": "433b2014e3979047db08a17a205f410ba3869cf2", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/91039bc1faa45ba123c4328958e620d382ec7088", + "reference": "91039bc1faa45ba123c4328958e620d382ec7088", "shasum": "" }, "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", "ext-json": "*", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" @@ -4023,7 +4177,7 @@ "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." }, - "time": "2023-01-12T18:13:24+00:00", + "time": "2024-04-27T21:32:50+00:00", "type": "library", "extra": { "captainhook": { @@ -4051,7 +4205,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.7.3" + "source": "https://github.com/ramsey/uuid/tree/4.7.6" }, "funding": [ { @@ -4067,17 +4221,17 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", "shasum": "" }, "require": { @@ -4086,7 +4240,7 @@ "require-dev": { "phpunit/phpunit": "^9.3" }, - "time": "2020-09-28T06:08:49+00:00", + "time": "2024-03-02T06:27:43+00:00", "type": "library", "extra": { "branch-alias": { @@ -4114,7 +4268,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" }, "funding": [ { @@ -4320,27 +4474,27 @@ }, { "name": "sebastian/complexity", - "version": "2.0.2", - "version_normalized": "2.0.2.0", + "version": "2.0.3", + "version_normalized": "2.0.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, - "time": "2020-10-26T15:52:27+00:00", + "time": "2023-12-22T06:19:30+00:00", "type": "library", "extra": { "branch-alias": { @@ -4368,7 +4522,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" }, "funding": [ { @@ -4380,17 +4534,17 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", - "version_normalized": "4.0.4.0", + "version": "4.0.6", + "version_normalized": "4.0.6.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", "shasum": "" }, "require": { @@ -4400,7 +4554,7 @@ "phpunit/phpunit": "^9.3", "symfony/process": "^4.2 || ^5" }, - "time": "2020-10-26T13:10:38+00:00", + "time": "2024-03-02T06:30:58+00:00", "type": "library", "extra": { "branch-alias": { @@ -4437,7 +4591,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" }, "funding": [ { @@ -4515,17 +4669,17 @@ }, { "name": "sebastian/exporter", - "version": "4.0.5", - "version_normalized": "4.0.5.0", + "version": "4.0.6", + "version_normalized": "4.0.6.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", "shasum": "" }, "require": { @@ -4536,7 +4690,7 @@ "ext-mbstring": "*", "phpunit/phpunit": "^9.3" }, - "time": "2022-09-14T06:03:37+00:00", + "time": "2024-03-02T06:33:00+00:00", "type": "library", "extra": { "branch-alias": { @@ -4583,7 +4737,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" }, "funding": [ { @@ -4595,17 +4749,17 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", - "version_normalized": "5.0.5.0", + "version": "5.0.7", + "version_normalized": "5.0.7.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", "shasum": "" }, "require": { @@ -4620,7 +4774,7 @@ "suggest": { "ext-uopz": "*" }, - "time": "2022-02-14T08:28:10+00:00", + "time": "2024-03-02T06:35:11+00:00", "type": "library", "extra": { "branch-alias": { @@ -4650,7 +4804,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" }, "funding": [ { @@ -4662,27 +4816,27 @@ }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", - "version_normalized": "1.0.3.0", + "version": "1.0.4", + "version_normalized": "1.0.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", + "nikic/php-parser": "^4.18 || ^5.0", "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.3" }, - "time": "2020-11-28T06:42:11+00:00", + "time": "2023-12-22T06:20:34+00:00", "type": "library", "extra": { "branch-alias": { @@ -4710,7 +4864,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" }, "funding": [ { @@ -4906,17 +5060,17 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", - "version_normalized": "3.0.3.0", + "version": "3.0.4", + "version_normalized": "3.0.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -4925,11 +5079,11 @@ "require-dev": { "phpunit/phpunit": "^9.0" }, - "time": "2020-09-28T06:45:17+00:00", + "time": "2024-03-14T16:00:52+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "installation-source": "dist", @@ -4951,8 +5105,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -5143,17 +5296,17 @@ }, { "name": "symfony/console", - "version": "v5.4.19", - "version_normalized": "5.4.19.0", + "version": "v5.4.47", + "version_normalized": "5.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dccb8d251a9017d5994c988b034d3e18aaabf740", - "reference": "dccb8d251a9017d5994c988b034d3e18aaabf740", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -5191,7 +5344,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2023-01-01T08:32:19+00:00", + "time": "2024-11-06T11:30:55+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5220,12 +5373,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.19" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -5245,27 +5398,27 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", + "version": "v3.5.1", + "version_normalized": "3.5.1.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, - "time": "2022-01-02T09:55:41+00:00", + "time": "2024-09-25T14:20:29+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -5295,7 +5448,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -5315,17 +5468,17 @@ }, { "name": "symfony/error-handler", - "version": "v5.4.19", - "version_normalized": "5.4.19.0", + "version": "v5.4.46", + "version_normalized": "5.4.46.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "438ef3e5e6481244785da3ce8cf8f4e74e7f2822" + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/438ef3e5e6481244785da3ce8cf8f4e74e7f2822", - "reference": "438ef3e5e6481244785da3ce8cf8f4e74e7f2822", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/d19ede7a2cafb386be9486c580649d0f9e3d0363", + "reference": "d19ede7a2cafb386be9486c580649d0f9e3d0363", "shasum": "" }, "require": { @@ -5338,7 +5491,7 @@ "symfony/http-kernel": "^4.4|^5.0|^6.0", "symfony/serializer": "^4.4|^5.0|^6.0" }, - "time": "2023-01-01T08:32:19+00:00", + "time": "2024-11-05T14:17:06+00:00", "bin": [ "Resources/bin/patch-type-declarations" ], @@ -5369,7 +5522,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.19" + "source": "https://github.com/symfony/error-handler/tree/v5.4.46" }, "funding": [ { @@ -5389,25 +5542,26 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.0.19", - "version_normalized": "6.0.19.0", + "version": "v6.4.13", + "version_normalized": "6.4.13.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a" + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", - "reference": "2eaf8e63bc5b8cefabd4a800157f0d0c094f677a", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", + "reference": "0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e", "shasum": "" }, "require": { - "php": ">=8.0.2", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -5415,19 +5569,15 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "time": "2023-01-01T08:36:10+00:00", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0|^7.0" + }, + "time": "2024-09-25T14:18:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5455,7 +5605,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.0.19" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.13" }, "funding": [ { @@ -5475,31 +5625,28 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", + "version": "v3.5.1", + "version_normalized": "3.5.1.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", - "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "time": "2022-01-02T09:55:41+00:00", + "time": "2024-09-25T14:20:29+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -5537,7 +5684,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -5557,17 +5704,17 @@ }, { "name": "symfony/finder", - "version": "v5.4.19", - "version_normalized": "5.4.19.0", + "version": "v5.4.45", + "version_normalized": "5.4.45.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "6071aebf810ad13fe8200c224f36103abb37cf1f" + "reference": "63741784cd7b9967975eec610b256eed3ede022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/6071aebf810ad13fe8200c224f36103abb37cf1f", - "reference": "6071aebf810ad13fe8200c224f36103abb37cf1f", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", "shasum": "" }, "require": { @@ -5575,7 +5722,7 @@ "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-php80": "^1.16" }, - "time": "2023-01-14T19:14:44+00:00", + "time": "2024-09-28T13:32:08+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5603,7 +5750,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.19" + "source": "https://github.com/symfony/finder/tree/v5.4.45" }, "funding": [ { @@ -5623,17 +5770,17 @@ }, { "name": "symfony/http-foundation", - "version": "v5.4.20", - "version_normalized": "5.4.20.0", + "version": "v5.4.48", + "version_normalized": "5.4.48.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "d0435363362a47c14e9cf50663cb8ffbf491875a" + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d0435363362a47c14e9cf50663cb8ffbf491875a", - "reference": "d0435363362a47c14e9cf50663cb8ffbf491875a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3f38b8af283b830e1363acd79e5bc3412d055341", + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341", "shasum": "" }, "require": { @@ -5643,7 +5790,7 @@ "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "predis/predis": "~1.0", + "predis/predis": "^1.0|^2.0", "symfony/cache": "^4.4|^5.0|^6.0", "symfony/dependency-injection": "^5.4|^6.0", "symfony/expression-language": "^4.4|^5.0|^6.0", @@ -5654,7 +5801,7 @@ "suggest": { "symfony/mime": "To use the file extension guesser" }, - "time": "2023-01-29T11:11:52+00:00", + "time": "2024-11-13T18:58:02+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5682,7 +5829,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.20" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.48" }, "funding": [ { @@ -5817,17 +5964,17 @@ }, { "name": "symfony/mime", - "version": "v5.4.19", - "version_normalized": "5.4.19.0", + "version": "v5.4.45", + "version_normalized": "5.4.45.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "a858429a9c704edc53fe057228cf9ca282ba48eb" + "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/a858429a9c704edc53fe057228cf9ca282ba48eb", - "reference": "a858429a9c704edc53fe057228cf9ca282ba48eb", + "url": "https://api.github.com/repos/symfony/mime/zipball/8c1b9b3e5b52981551fc6044539af1d974e39064", + "reference": "8c1b9b3e5b52981551fc6044539af1d974e39064", "shasum": "" }, "require": { @@ -5842,17 +5989,18 @@ "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<4.4", - "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6" + "symfony/serializer": "<5.4.35|>=6,<6.3.12|>=6.4,<6.4.3" }, "require-dev": { "egulias/email-validator": "^2.1.10|^3.1|^4", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/process": "^5.4|^6.4", "symfony/property-access": "^4.4|^5.1|^6.0", "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6" + "symfony/serializer": "^5.4.35|~6.3.12|^6.4.3" }, - "time": "2023-01-09T05:43:46+00:00", + "time": "2024-10-23T20:18:32+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5884,7 +6032,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.19" + "source": "https://github.com/symfony/mime/tree/v5.4.45" }, "funding": [ { @@ -5904,21 +6052,21 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -5926,15 +6074,12 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -5969,7 +6114,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -5989,34 +6134,31 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -6053,7 +6195,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -6073,33 +6215,29 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da" + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", - "reference": "639084e360537a19f9ee352433b84ce831f3d2da", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", + "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", "shasum": "" }, "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -6143,7 +6281,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" }, "funding": [ { @@ -6163,34 +6301,31 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -6230,7 +6365,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -6250,21 +6385,21 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -6272,12 +6407,9 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -6316,7 +6448,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -6334,112 +6466,30 @@ ], "install-path": "../symfony/polyfill-mbstring" }, - { - "name": "symfony/polyfill-php72", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", - "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "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.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.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" - } - ], - "install-path": "../symfony/polyfill-php72" - }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -6477,7 +6527,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -6497,31 +6547,28 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", + "version": "v1.31.0", + "version_normalized": "1.31.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "time": "2022-11-03T14:55:06+00:00", + "time": "2024-09-09T11:45:10+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "installation-source": "dist", @@ -6563,7 +6610,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -6581,108 +6628,26 @@ ], "install-path": "../symfony/polyfill-php80" }, - { - "name": "symfony/polyfill-php81", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "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.27.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" - } - ], - "install-path": "../symfony/polyfill-php81" - }, { "name": "symfony/process", - "version": "v5.4.19", - "version_normalized": "5.4.19.0", + "version": "v5.4.47", + "version_normalized": "5.4.47.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1" + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c5ba874c9b636dbccf761e22ce750e88ec3f55e1", - "reference": "c5ba874c9b636dbccf761e22ce750e88ec3f55e1", + "url": "https://api.github.com/repos/symfony/process/zipball/5d1662fb32ebc94f17ddb8d635454a776066733d", + "reference": "5d1662fb32ebc94f17ddb8d635454a776066733d", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-php80": "^1.16" }, - "time": "2023-01-01T08:32:19+00:00", + "time": "2024-11-06T11:36:42+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6710,7 +6675,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.19" + "source": "https://github.com/symfony/process/tree/v5.4.47" }, "funding": [ { @@ -6730,35 +6695,32 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.2", - "version_normalized": "2.5.2.0", + "version": "v3.5.1", + "version_normalized": "3.5.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, - "time": "2022-05-30T19:17:29+00:00", + "time": "2024-09-25T14:20:29+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -6769,7 +6731,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6796,7 +6761,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -6816,36 +6781,37 @@ }, { "name": "symfony/string", - "version": "v6.0.19", - "version_normalized": "6.0.19.0", + "version": "v6.4.15", + "version_normalized": "6.4.15.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", - "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", + "url": "https://api.github.com/repos/symfony/string/zipball/73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", + "reference": "73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, - "time": "2023-01-01T08:36:10+00:00", + "time": "2024-11-13T13:31:12+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6884,7 +6850,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.19" + "source": "https://github.com/symfony/string/tree/v6.4.15" }, "funding": [ { @@ -6904,29 +6870,32 @@ }, { "name": "symfony/translation", - "version": "v6.0.19", - "version_normalized": "6.0.19.0", + "version": "v6.4.13", + "version_normalized": "6.4.13.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f" + "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", - "reference": "9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f", + "url": "https://api.github.com/repos/symfony/translation/zipball/bee9bfabfa8b4045a66bf82520e492cddbaffa66", + "reference": "bee9bfabfa8b4045a66bf82520e492cddbaffa66", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" + "symfony/translation-contracts": "^2.5|^3.0" }, "conflict": { "symfony/config": "<5.4", "symfony/console": "<5.4", "symfony/dependency-injection": "<5.4", + "symfony/http-client-contracts": "<2.5", "symfony/http-kernel": "<5.4", + "symfony/service-contracts": "<2.5", "symfony/twig-bundle": "<5.4", "symfony/yaml": "<5.4" }, @@ -6934,24 +6903,21 @@ "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { + "nikic/php-parser": "^4.18|^5.0", "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0|^7.0" }, - "time": "2023-01-01T08:36:10+00:00", + "time": "2024-09-27T18:14:25+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6982,7 +6948,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.19" + "source": "https://github.com/symfony/translation/tree/v6.4.13" }, "funding": [ { @@ -7002,30 +6968,27 @@ }, { "name": "symfony/translation-contracts", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", + "version": "v3.5.1", + "version_normalized": "3.5.1.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282" + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282", - "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/4667ff3bd513750603a09c8dedbea942487fb07c", + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c", "shasum": "" }, "require": { - "php": ">=8.0.2" - }, - "suggest": { - "symfony/translation-implementation": "" + "php": ">=8.1" }, - "time": "2022-06-27T17:10:44+00:00", + "time": "2024-09-25T14:20:29+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -7036,7 +6999,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Translation\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -7063,7 +7029,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.1" }, "funding": [ { @@ -7083,17 +7049,17 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.19", - "version_normalized": "5.4.19.0", + "version": "v5.4.48", + "version_normalized": "5.4.48.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b" + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b", - "reference": "2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/42f18f170aa86d612c3559cfb3bd11a375df32c8", + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8", "shasum": "" }, "require": { @@ -7102,12 +7068,12 @@ "symfony/polyfill-php80": "^1.16" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<4.4" }, "require-dev": { "ext-iconv": "*", "symfony/console": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", "symfony/process": "^4.4|^5.0|^6.0", "symfony/uid": "^5.1|^6.0", "twig/twig": "^2.13|^3.0.4" @@ -7117,7 +7083,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2023-01-16T10:52:33+00:00", + "time": "2024-11-08T15:21:10+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -7155,7 +7121,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.19" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.48" }, "funding": [ { @@ -7175,33 +7141,31 @@ }, { "name": "symfony/yaml", - "version": "v6.0.19", - "version_normalized": "6.0.19.0", + "version": "v6.4.13", + "version_normalized": "6.4.13.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884" + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/deec3a812a0305a50db8ae689b183f43d915c884", - "reference": "deec3a812a0305a50db8ae689b183f43d915c884", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", + "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "symfony/console": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "symfony/console": "^5.4|^6.0|^7.0" }, - "time": "2023-01-11T11:50:03+00:00", + "time": "2024-09-25T14:18:03+00:00", "bin": [ "Resources/bin/yaml-lint" ], @@ -7232,7 +7196,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.0.19" + "source": "https://github.com/symfony/yaml/tree/v6.4.13" }, "funding": [ { @@ -7252,17 +7216,17 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", - "version_normalized": "1.2.1.0", + "version": "1.2.3", + "version_normalized": "1.2.3.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -7271,7 +7235,7 @@ "ext-xmlwriter": "*", "php": "^7.2 || ^8.0" }, - "time": "2021-07-28T10:34:58+00:00", + "time": "2024-03-03T12:36:25+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -7293,7 +7257,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -7305,45 +7269,45 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.5.0", - "version_normalized": "5.5.0.0", + "version": "v5.6.1", + "version_normalized": "5.6.1.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7" + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", - "reference": "1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "php": "^7.1.3 || ^8.0", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" + "graham-campbell/result-type": "^1.1.3", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.3", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.2", "ext-filter": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" }, "suggest": { "ext-filter": "Required to use the boolean validator." }, - "time": "2022-10-16T01:01:54+00:00", + "time": "2024-07-20T21:52:34+00:00", "type": "library", "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } }, "installation-source": "dist", @@ -7376,7 +7340,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.5.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" }, "funding": [ { diff --git a/api/vendor/composer/installed.php b/api/vendor/composer/installed.php index ac3bdb454e..880cc19201 100644 --- a/api/vendor/composer/installed.php +++ b/api/vendor/composer/installed.php @@ -1,22 +1,31 @@ array( + 'name' => 'laravel/lumen', 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '5ddef81ff28df2f72c63cd255cc90a2e525050ad', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '89e2a7edceda6e092a6ec77af3b8232232b0b462', - 'name' => 'laravel/lumen', 'dev' => true, ), 'versions' => array( 'brick/math' => array( - 'pretty_version' => '0.10.2', - 'version' => '0.10.2.0', + 'pretty_version' => '0.12.1', + 'version' => '0.12.1.0', + 'reference' => 'f510c0a40911935b77b86859eb5223d58d660df1', 'type' => 'library', 'install_path' => __DIR__ . '/../brick/math', 'aliases' => array(), - 'reference' => '459f2781e1a08d52ee56b0b1444086e038561e3f', + 'dev_requirement' => false, + ), + 'carbonphp/carbon-doctrine-types' => array( + 'pretty_version' => '3.2.0', + 'version' => '3.2.0.0', + 'reference' => '18ba5ddfec8976260ead6e866180bd5d2f71aa1d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../carbonphp/carbon-doctrine-types', + 'aliases' => array(), 'dev_requirement' => false, ), 'cordoval/hamcrest-php' => array( @@ -28,10 +37,10 @@ 'darkaonline/swagger-lume' => array( 'pretty_version' => '8.0', 'version' => '8.0.0.0', + 'reference' => '5ee548ccaf487b4561880eb9741975dad3c3dd1a', 'type' => 'library', 'install_path' => __DIR__ . '/../darkaonline/swagger-lume', 'aliases' => array(), - 'reference' => '5ee548ccaf487b4561880eb9741975dad3c3dd1a', 'dev_requirement' => false, ), 'davedevelopment/hamcrest-php' => array( @@ -41,318 +50,318 @@ ), ), 'doctrine/annotations' => array( - 'pretty_version' => '1.14.3', - 'version' => '1.14.3.0', + 'pretty_version' => '1.14.4', + 'version' => '1.14.4.0', + 'reference' => '253dca476f70808a5aeed3a47cc2cc88c5cab915', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/annotations', 'aliases' => array(), - 'reference' => 'fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af', 'dev_requirement' => false, ), 'doctrine/inflector' => array( - 'pretty_version' => '2.0.6', - 'version' => '2.0.6.0', + 'pretty_version' => '2.0.10', + 'version' => '2.0.10.0', + 'reference' => '5817d0659c5b50c9b950feb9af7b9668e2c436bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), - 'reference' => 'd9d313a36c872fd6ee06d9a6cbcf713eaa40f024', 'dev_requirement' => false, ), 'doctrine/instantiator' => array( - 'pretty_version' => '1.5.0', - 'version' => '1.5.0.0', + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'reference' => 'c6222283fa3f4ac679f8b9ced9a4e23f163e80d0', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/instantiator', 'aliases' => array(), - 'reference' => '0a0fa9780f5d4e507415a065172d26a98d02047b', 'dev_requirement' => true, ), 'doctrine/lexer' => array( 'pretty_version' => '1.2.3', 'version' => '1.2.3.0', + 'reference' => 'c268e882d4dbdd85e36e4ad69e02dc284f89d229', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/lexer', 'aliases' => array(), - 'reference' => 'c268e882d4dbdd85e36e4ad69e02dc284f89d229', 'dev_requirement' => false, ), 'dragonmantank/cron-expression' => array( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', + 'pretty_version' => 'v3.4.0', + 'version' => '3.4.0.0', + 'reference' => '8c784d071debd117328803d86b2097615b457500', 'type' => 'library', 'install_path' => __DIR__ . '/../dragonmantank/cron-expression', 'aliases' => array(), - 'reference' => '782ca5968ab8b954773518e9e49a6f892a34b2a8', 'dev_requirement' => false, ), 'egulias/email-validator' => array( 'pretty_version' => '2.1.25', 'version' => '2.1.25.0', + 'reference' => '0dbf5d78455d4d6a41d186da50adc1122ec066f4', 'type' => 'library', 'install_path' => __DIR__ . '/../egulias/email-validator', 'aliases' => array(), - 'reference' => '0dbf5d78455d4d6a41d186da50adc1122ec066f4', 'dev_requirement' => false, ), 'fakerphp/faker' => array( - 'pretty_version' => 'v1.21.0', - 'version' => '1.21.0.0', + 'pretty_version' => 'v1.24.1', + 'version' => '1.24.1.0', + 'reference' => 'e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5', 'type' => 'library', 'install_path' => __DIR__ . '/../fakerphp/faker', 'aliases' => array(), - 'reference' => '92efad6a967f0b79c499705c69b662f738cc9e4d', 'dev_requirement' => true, ), 'graham-campbell/result-type' => array( - 'pretty_version' => 'v1.1.0', - 'version' => '1.1.0.0', + 'pretty_version' => 'v1.1.3', + 'version' => '1.1.3.0', + 'reference' => '3ba905c11371512af9d9bdd27d99b782216b6945', 'type' => 'library', 'install_path' => __DIR__ . '/../graham-campbell/result-type', 'aliases' => array(), - 'reference' => 'a878d45c1914464426dc94da61c9e1d36ae262a8', 'dev_requirement' => false, ), 'hamcrest/hamcrest-php' => array( 'pretty_version' => 'v2.0.1', 'version' => '2.0.1.0', + 'reference' => '8c3d0a3f6af734494ad8f6fbbee0ba92422859f3', 'type' => 'library', 'install_path' => __DIR__ . '/../hamcrest/hamcrest-php', 'aliases' => array(), - 'reference' => '8c3d0a3f6af734494ad8f6fbbee0ba92422859f3', 'dev_requirement' => true, ), 'illuminate/auth' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '28e3e57f777685018374bb59bbaa54598dbdf441', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/auth', 'aliases' => array(), - 'reference' => '28e3e57f777685018374bb59bbaa54598dbdf441', 'dev_requirement' => false, ), 'illuminate/broadcasting' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => 'd7c0c81bcc679c294746b161f4b834997e904cf4', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/broadcasting', 'aliases' => array(), - 'reference' => 'd7c0c81bcc679c294746b161f4b834997e904cf4', 'dev_requirement' => false, ), 'illuminate/bus' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => 'd2a8ae4bfd881086e55455e470776358eab27eae', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/bus', 'aliases' => array(), - 'reference' => 'd2a8ae4bfd881086e55455e470776358eab27eae', 'dev_requirement' => false, ), 'illuminate/cache' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '7ae5b3661413dad7264b5c69037190d766bae50f', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/cache', 'aliases' => array(), - 'reference' => '7ae5b3661413dad7264b5c69037190d766bae50f', 'dev_requirement' => false, ), 'illuminate/collections' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '705a4e1ef93cd492c45b9b3e7911cccc990a07f4', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', 'aliases' => array(), - 'reference' => '705a4e1ef93cd492c45b9b3e7911cccc990a07f4', 'dev_requirement' => false, ), 'illuminate/config' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => 'feac56ab7a5c70cf2dc60dffe4323eb9851f51a8', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/config', 'aliases' => array(), - 'reference' => 'feac56ab7a5c70cf2dc60dffe4323eb9851f51a8', 'dev_requirement' => false, ), 'illuminate/console' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '4aaa93223eb3bd8119157c95f58c022967826035', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/console', 'aliases' => array(), - 'reference' => '4aaa93223eb3bd8119157c95f58c022967826035', 'dev_requirement' => false, ), 'illuminate/container' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '14062628d05f75047c5a1360b9350028427d568e', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), - 'reference' => '14062628d05f75047c5a1360b9350028427d568e', 'dev_requirement' => false, ), 'illuminate/contracts' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '5e0fd287a1b22a6b346a9f7cd484d8cf0234585d', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), - 'reference' => '5e0fd287a1b22a6b346a9f7cd484d8cf0234585d', 'dev_requirement' => false, ), 'illuminate/database' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '1a5b0e4e6913415464fa2aab554a38b9e6fa44b1', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/database', 'aliases' => array(), - 'reference' => '1a5b0e4e6913415464fa2aab554a38b9e6fa44b1', 'dev_requirement' => false, ), 'illuminate/encryption' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '00280dc6aa204b1b6c6d4bf75936d122bd856c15', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/encryption', 'aliases' => array(), - 'reference' => '00280dc6aa204b1b6c6d4bf75936d122bd856c15', 'dev_requirement' => false, ), 'illuminate/events' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => 'b7f06cafb6c09581617f2ca05d69e9b159e5a35d', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/events', 'aliases' => array(), - 'reference' => 'b7f06cafb6c09581617f2ca05d69e9b159e5a35d', 'dev_requirement' => false, ), 'illuminate/filesystem' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '73db3e9a233ed587ba54f52ab8580f3c7bc872b2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/filesystem', 'aliases' => array(), - 'reference' => '73db3e9a233ed587ba54f52ab8580f3c7bc872b2', 'dev_requirement' => false, ), 'illuminate/hashing' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '2617f4de8d0150a3f8641b086fafac8c1e0cdbf2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/hashing', 'aliases' => array(), - 'reference' => '2617f4de8d0150a3f8641b086fafac8c1e0cdbf2', 'dev_requirement' => false, ), 'illuminate/http' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '38b8b0c8ca5d5231df9c515f3a3e7aac5f0da9f4', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/http', 'aliases' => array(), - 'reference' => '38b8b0c8ca5d5231df9c515f3a3e7aac5f0da9f4', 'dev_requirement' => false, ), 'illuminate/log' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '1dbdc6aca24d1d2b5903f865bb206039d4b800b2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/log', 'aliases' => array(), - 'reference' => '1dbdc6aca24d1d2b5903f865bb206039d4b800b2', 'dev_requirement' => false, ), 'illuminate/macroable' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => 'aed81891a6e046fdee72edd497f822190f61c162', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', 'aliases' => array(), - 'reference' => 'aed81891a6e046fdee72edd497f822190f61c162', 'dev_requirement' => false, ), 'illuminate/pagination' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '16fe8dc35f9d18c58a3471469af656a02e9ab692', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pagination', 'aliases' => array(), - 'reference' => '16fe8dc35f9d18c58a3471469af656a02e9ab692', 'dev_requirement' => false, ), 'illuminate/pipeline' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '23aeff5b26ae4aee3f370835c76bd0f4e93f71d2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pipeline', 'aliases' => array(), - 'reference' => '23aeff5b26ae4aee3f370835c76bd0f4e93f71d2', 'dev_requirement' => false, ), 'illuminate/queue' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '0023daabf67743f7a2bd8328ca2b5537d93e4ae7', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/queue', 'aliases' => array(), - 'reference' => '0023daabf67743f7a2bd8328ca2b5537d93e4ae7', 'dev_requirement' => false, ), 'illuminate/session' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '9c9988d7229d888c098eebbbb9fcb8c68580411c', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/session', 'aliases' => array(), - 'reference' => '9c9988d7229d888c098eebbbb9fcb8c68580411c', 'dev_requirement' => false, ), 'illuminate/support' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '1c79242468d3bbd9a0f7477df34f9647dde2a09b', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', 'aliases' => array(), - 'reference' => '1c79242468d3bbd9a0f7477df34f9647dde2a09b', 'dev_requirement' => false, ), 'illuminate/testing' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '1c9ec9902df3b7a38b983bbf2242ce3c088de400', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/testing', 'aliases' => array(), - 'reference' => '1c9ec9902df3b7a38b983bbf2242ce3c088de400', 'dev_requirement' => false, ), 'illuminate/translation' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => 'e119d1e55351bd846579c333dd24f9a042b724b2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/translation', 'aliases' => array(), - 'reference' => 'e119d1e55351bd846579c333dd24f9a042b724b2', 'dev_requirement' => false, ), 'illuminate/validation' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => 'bb104f15545a55664755f58a278c7013f835918a', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/validation', 'aliases' => array(), - 'reference' => 'bb104f15545a55664755f58a278c7013f835918a', 'dev_requirement' => false, ), 'illuminate/view' => array( 'pretty_version' => 'v8.83.27', 'version' => '8.83.27.0', + 'reference' => '5e73eef48d9242532f81fadc14c816a01bfb1388', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/view', 'aliases' => array(), - 'reference' => '5e73eef48d9242532f81fadc14c816a01bfb1388', 'dev_requirement' => false, ), 'kodova/hamcrest-php' => array( @@ -364,46 +373,46 @@ 'laravel/lumen' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '5ddef81ff28df2f72c63cd255cc90a2e525050ad', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '89e2a7edceda6e092a6ec77af3b8232232b0b462', 'dev_requirement' => false, ), 'laravel/lumen-framework' => array( 'pretty_version' => 'v8.3.4', 'version' => '8.3.4.0', + 'reference' => '733d1199d3344be337743f11df31b4048ec7fd1c', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/lumen-framework', 'aliases' => array(), - 'reference' => '733d1199d3344be337743f11df31b4048ec7fd1c', 'dev_requirement' => false, ), 'laravel/serializable-closure' => array( - 'pretty_version' => 'v1.3.0', - 'version' => '1.3.0.0', + 'pretty_version' => 'v1.3.7', + 'version' => '1.3.7.0', + 'reference' => '4f48ade902b94323ca3be7646db16209ec76be3d', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/serializable-closure', 'aliases' => array(), - 'reference' => 'f23fe9d4e95255dacee1bf3525e0810d1a1b0f37', 'dev_requirement' => false, ), 'mockery/mockery' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', + 'pretty_version' => '1.6.12', + 'version' => '1.6.12.0', + 'reference' => '1f4efdd7d3beafe9807b08156dfcb176d18f1699', 'type' => 'library', 'install_path' => __DIR__ . '/../mockery/mockery', 'aliases' => array(), - 'reference' => 'e92dcc83d5a51851baf5f5591d32cb2b16e3684e', 'dev_requirement' => true, ), 'monolog/monolog' => array( - 'pretty_version' => '2.8.0', - 'version' => '2.8.0.0', + 'pretty_version' => '2.10.0', + 'version' => '2.10.0.0', + 'reference' => '5cf826f2991858b54d5c3809bee745560a1042a7', 'type' => 'library', 'install_path' => __DIR__ . '/../monolog/monolog', 'aliases' => array(), - 'reference' => '720488632c590286b88b80e62aa3d3d551ad4a50', 'dev_requirement' => false, ), 'mtdowling/cron-expression' => array( @@ -413,147 +422,162 @@ ), ), 'myclabs/deep-copy' => array( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', + 'pretty_version' => '1.12.1', + 'version' => '1.12.1.0', + 'reference' => '123267b2c49fbf30d78a7b2d333f6be754b94845', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/deep-copy', 'aliases' => array(), - 'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614', 'dev_requirement' => true, ), 'nesbot/carbon' => array( - 'pretty_version' => '2.66.0', - 'version' => '2.66.0.0', + 'pretty_version' => '2.72.5', + 'version' => '2.72.5.0', + 'reference' => 'afd46589c216118ecd48ff2b95d77596af1e57ed', 'type' => 'library', 'install_path' => __DIR__ . '/../nesbot/carbon', 'aliases' => array(), - 'reference' => '496712849902241f04902033b0441b269effe001', 'dev_requirement' => false, ), 'nikic/fast-route' => array( 'pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', + 'reference' => '181d480e08d9476e61381e04a71b34dc0432e812', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/fast-route', 'aliases' => array(), - 'reference' => '181d480e08d9476e61381e04a71b34dc0432e812', 'dev_requirement' => false, ), 'nikic/php-parser' => array( - 'pretty_version' => 'v4.15.3', - 'version' => '4.15.3.0', + 'pretty_version' => 'v5.3.1', + 'version' => '5.3.1.0', + 'reference' => '8eea230464783aa9671db8eea6f8c6ac5285794b', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), - 'reference' => '570e980a201d8ed0236b0a62ddf2c9cbb2034039', 'dev_requirement' => true, ), 'opis/closure' => array( 'pretty_version' => '3.6.3', 'version' => '3.6.3.0', + 'reference' => '3d81e4309d2a927abbe66df935f4bb60082805ad', 'type' => 'library', 'install_path' => __DIR__ . '/../opis/closure', 'aliases' => array(), - 'reference' => '3d81e4309d2a927abbe66df935f4bb60082805ad', 'dev_requirement' => false, ), 'phar-io/manifest' => array( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'reference' => '54750ef60c58e43759730615a392c31c80e23176', 'type' => 'library', 'install_path' => __DIR__ . '/../phar-io/manifest', 'aliases' => array(), - 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', 'dev_requirement' => true, ), 'phar-io/version' => array( 'pretty_version' => '3.2.1', 'version' => '3.2.1.0', + 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', 'type' => 'library', 'install_path' => __DIR__ . '/../phar-io/version', 'aliases' => array(), - 'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74', 'dev_requirement' => true, ), 'phpoption/phpoption' => array( - 'pretty_version' => '1.9.0', - 'version' => '1.9.0.0', + 'pretty_version' => '1.9.3', + 'version' => '1.9.3.0', + 'reference' => 'e3fac8b24f56113f7cb96af14958c0dd16330f54', 'type' => 'library', 'install_path' => __DIR__ . '/../phpoption/phpoption', 'aliases' => array(), - 'reference' => 'dc5ff11e274a90cc1c743f66c9ad700ce50db9ab', 'dev_requirement' => false, ), 'phpunit/php-code-coverage' => array( - 'pretty_version' => '9.2.24', - 'version' => '9.2.24.0', + 'pretty_version' => '9.2.32', + 'version' => '9.2.32.0', + 'reference' => '85402a822d1ecf1db1096959413d35e1c37cf1a5', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', 'aliases' => array(), - 'reference' => '2cf940ebc6355a9d430462811b5aaa308b174bed', 'dev_requirement' => true, ), 'phpunit/php-file-iterator' => array( 'pretty_version' => '3.0.6', 'version' => '3.0.6.0', + 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', 'aliases' => array(), - 'reference' => 'cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf', 'dev_requirement' => true, ), 'phpunit/php-invoker' => array( 'pretty_version' => '3.1.1', 'version' => '3.1.1.0', + 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-invoker', 'aliases' => array(), - 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', 'dev_requirement' => true, ), 'phpunit/php-text-template' => array( 'pretty_version' => '2.0.4', 'version' => '2.0.4.0', + 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-text-template', 'aliases' => array(), - 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', 'dev_requirement' => true, ), 'phpunit/php-timer' => array( 'pretty_version' => '5.0.3', 'version' => '5.0.3.0', + 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/php-timer', 'aliases' => array(), - 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', 'dev_requirement' => true, ), 'phpunit/phpunit' => array( - 'pretty_version' => '9.6.0', - 'version' => '9.6.0.0', + 'pretty_version' => '9.6.22', + 'version' => '9.6.22.0', + 'reference' => 'f80235cb4d3caa59ae09be3adf1ded27521d1a9c', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/phpunit', 'aliases' => array(), - 'reference' => '70fc8be1d0b9fad56a199a4df5f9cfabfc246f84', 'dev_requirement' => true, ), 'psr/cache' => array( 'pretty_version' => '3.0.0', 'version' => '3.0.0.0', + 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', 'aliases' => array(), - 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'dev_requirement' => false, ), + 'psr/clock' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => 'e41a24703d4560fd0acb709162f73b8adfc3aa0d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/clock', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/clock-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), 'psr/container' => array( 'pretty_version' => '1.1.2', 'version' => '1.1.2.0', + 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', 'dev_requirement' => false, ), 'psr/container-implementation' => array( @@ -565,10 +589,10 @@ 'psr/event-dispatcher' => array( 'pretty_version' => '1.0.0', 'version' => '1.0.0.0', + 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), - 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'dev_requirement' => false, ), 'psr/event-dispatcher-implementation' => array( @@ -580,10 +604,10 @@ 'psr/log' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', + 'reference' => 'ef29f6d262798707a9edd554e2b82517ef3a9376', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), - 'reference' => 'ef29f6d262798707a9edd554e2b82517ef3a9376', 'dev_requirement' => false, ), 'psr/log-implementation' => array( @@ -596,10 +620,10 @@ 'psr/simple-cache' => array( 'pretty_version' => '1.0.1', 'version' => '1.0.1.0', + 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), - 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', 'dev_requirement' => false, ), 'psr/simple-cache-implementation' => array( @@ -609,225 +633,225 @@ ), ), 'ramsey/collection' => array( - 'pretty_version' => '1.3.0', - 'version' => '1.3.0.0', + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'reference' => 'a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5', 'type' => 'library', 'install_path' => __DIR__ . '/../ramsey/collection', 'aliases' => array(), - 'reference' => 'ad7475d1c9e70b190ecffc58f2d989416af339b4', 'dev_requirement' => false, ), 'ramsey/uuid' => array( - 'pretty_version' => '4.7.3', - 'version' => '4.7.3.0', + 'pretty_version' => '4.7.6', + 'version' => '4.7.6.0', + 'reference' => '91039bc1faa45ba123c4328958e620d382ec7088', 'type' => 'library', 'install_path' => __DIR__ . '/../ramsey/uuid', 'aliases' => array(), - 'reference' => '433b2014e3979047db08a17a205f410ba3869cf2', 'dev_requirement' => false, ), 'rhumsaa/uuid' => array( 'dev_requirement' => false, 'replaced' => array( - 0 => '4.7.3', + 0 => '4.7.6', ), ), 'sebastian/cli-parser' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => '2b56bea83a09de3ac06bb18b92f068e60cc6f50b', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/cli-parser', 'aliases' => array(), - 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', 'dev_requirement' => true, ), 'sebastian/code-unit' => array( 'pretty_version' => '1.0.8', 'version' => '1.0.8.0', + 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/code-unit', 'aliases' => array(), - 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', 'dev_requirement' => true, ), 'sebastian/code-unit-reverse-lookup' => array( 'pretty_version' => '2.0.3', 'version' => '2.0.3.0', + 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup', 'aliases' => array(), - 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', 'dev_requirement' => true, ), 'sebastian/comparator' => array( 'pretty_version' => '4.0.8', 'version' => '4.0.8.0', + 'reference' => 'fa0f136dd2334583309d32b62544682ee972b51a', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/comparator', 'aliases' => array(), - 'reference' => 'fa0f136dd2334583309d32b62544682ee972b51a', 'dev_requirement' => true, ), 'sebastian/complexity' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'reference' => '25f207c40d62b8b7aa32f5ab026c53561964053a', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/complexity', 'aliases' => array(), - 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', 'dev_requirement' => true, ), 'sebastian/diff' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', + 'pretty_version' => '4.0.6', + 'version' => '4.0.6.0', + 'reference' => 'ba01945089c3a293b01ba9badc29ad55b106b0bc', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), - 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', 'dev_requirement' => true, ), 'sebastian/environment' => array( 'pretty_version' => '5.1.5', 'version' => '5.1.5.0', + 'reference' => '830c43a844f1f8d5b7a1f6d6076b784454d8b7ed', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/environment', 'aliases' => array(), - 'reference' => '830c43a844f1f8d5b7a1f6d6076b784454d8b7ed', 'dev_requirement' => true, ), 'sebastian/exporter' => array( - 'pretty_version' => '4.0.5', - 'version' => '4.0.5.0', + 'pretty_version' => '4.0.6', + 'version' => '4.0.6.0', + 'reference' => '78c00df8f170e02473b682df15bfcdacc3d32d72', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/exporter', 'aliases' => array(), - 'reference' => 'ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d', 'dev_requirement' => true, ), 'sebastian/global-state' => array( - 'pretty_version' => '5.0.5', - 'version' => '5.0.5.0', + 'pretty_version' => '5.0.7', + 'version' => '5.0.7.0', + 'reference' => 'bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/global-state', 'aliases' => array(), - 'reference' => '0ca8db5a5fc9c8646244e629625ac486fa286bf2', 'dev_requirement' => true, ), 'sebastian/lines-of-code' => array( - 'pretty_version' => '1.0.3', - 'version' => '1.0.3.0', + 'pretty_version' => '1.0.4', + 'version' => '1.0.4.0', + 'reference' => 'e1e4a170560925c26d424b6a03aed157e7dcc5c5', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/lines-of-code', 'aliases' => array(), - 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', 'dev_requirement' => true, ), 'sebastian/object-enumerator' => array( 'pretty_version' => '4.0.4', 'version' => '4.0.4.0', + 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/object-enumerator', 'aliases' => array(), - 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', 'dev_requirement' => true, ), 'sebastian/object-reflector' => array( 'pretty_version' => '2.0.4', 'version' => '2.0.4.0', + 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/object-reflector', 'aliases' => array(), - 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', 'dev_requirement' => true, ), 'sebastian/recursion-context' => array( 'pretty_version' => '4.0.5', 'version' => '4.0.5.0', + 'reference' => 'e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/recursion-context', 'aliases' => array(), - 'reference' => 'e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1', 'dev_requirement' => true, ), 'sebastian/resource-operations' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', + 'pretty_version' => '3.0.4', + 'version' => '3.0.4.0', + 'reference' => '05d5692a7993ecccd56a03e40cd7e5b09b1d404e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/resource-operations', 'aliases' => array(), - 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', 'dev_requirement' => true, ), 'sebastian/type' => array( 'pretty_version' => '3.2.1', 'version' => '3.2.1.0', + 'reference' => '75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/type', 'aliases' => array(), - 'reference' => '75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7', 'dev_requirement' => true, ), 'sebastian/version' => array( 'pretty_version' => '3.0.2', 'version' => '3.0.2.0', + 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/version', 'aliases' => array(), - 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', 'dev_requirement' => true, ), 'swagger-api/swagger-ui' => array( 'pretty_version' => 'v3.52.5', 'version' => '3.52.5.0', + 'reference' => 'f1ad60dc92e7edb0898583e16c3e66fe3e9eada2', 'type' => 'library', 'install_path' => __DIR__ . '/../swagger-api/swagger-ui', 'aliases' => array(), - 'reference' => 'f1ad60dc92e7edb0898583e16c3e66fe3e9eada2', 'dev_requirement' => false, ), 'symfony/console' => array( - 'pretty_version' => 'v5.4.19', - 'version' => '5.4.19.0', + 'pretty_version' => 'v5.4.47', + 'version' => '5.4.47.0', + 'reference' => 'c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), - 'reference' => 'dccb8d251a9017d5994c988b034d3e18aaabf740', 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', + 'pretty_version' => 'v3.5.1', + 'version' => '3.5.1.0', + 'reference' => '74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), - 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', 'dev_requirement' => false, ), 'symfony/error-handler' => array( - 'pretty_version' => 'v5.4.19', - 'version' => '5.4.19.0', + 'pretty_version' => 'v5.4.46', + 'version' => '5.4.46.0', + 'reference' => 'd19ede7a2cafb386be9486c580649d0f9e3d0363', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/error-handler', 'aliases' => array(), - 'reference' => '438ef3e5e6481244785da3ce8cf8f4e74e7f2822', 'dev_requirement' => false, ), 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v6.0.19', - 'version' => '6.0.19.0', + 'pretty_version' => 'v6.4.13', + 'version' => '6.4.13.0', + 'reference' => '0ffc48080ab3e9132ea74ef4e09d8dcf26bf897e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher', 'aliases' => array(), - 'reference' => '2eaf8e63bc5b8cefabd4a800157f0d0c094f677a', 'dev_requirement' => false, ), 'symfony/event-dispatcher-contracts' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', + 'pretty_version' => 'v3.5.1', + 'version' => '3.5.1.0', + 'reference' => '7642f5e970b672283b7823222ae8ef8bbc160b9f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', 'aliases' => array(), - 'reference' => '7bc61cc2db649b4637d331240c5346dcc7708051', 'dev_requirement' => false, ), 'symfony/event-dispatcher-implementation' => array( @@ -837,165 +861,147 @@ ), ), 'symfony/finder' => array( - 'pretty_version' => 'v5.4.19', - 'version' => '5.4.19.0', + 'pretty_version' => 'v5.4.45', + 'version' => '5.4.45.0', + 'reference' => '63741784cd7b9967975eec610b256eed3ede022b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), - 'reference' => '6071aebf810ad13fe8200c224f36103abb37cf1f', 'dev_requirement' => false, ), 'symfony/http-foundation' => array( - 'pretty_version' => 'v5.4.20', - 'version' => '5.4.20.0', + 'pretty_version' => 'v5.4.48', + 'version' => '5.4.48.0', + 'reference' => '3f38b8af283b830e1363acd79e5bc3412d055341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-foundation', 'aliases' => array(), - 'reference' => 'd0435363362a47c14e9cf50663cb8ffbf491875a', 'dev_requirement' => false, ), 'symfony/http-kernel' => array( 'pretty_version' => 'v5.4.20', 'version' => '5.4.20.0', + 'reference' => 'aaeec341582d3c160cc9ecfa8b2419ba6c69954e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/http-kernel', 'aliases' => array(), - 'reference' => 'aaeec341582d3c160cc9ecfa8b2419ba6c69954e', 'dev_requirement' => false, ), 'symfony/mime' => array( - 'pretty_version' => 'v5.4.19', - 'version' => '5.4.19.0', + 'pretty_version' => 'v5.4.45', + 'version' => '5.4.45.0', + 'reference' => '8c1b9b3e5b52981551fc6044539af1d974e39064', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/mime', 'aliases' => array(), - 'reference' => 'a858429a9c704edc53fe057228cf9ca282ba48eb', 'dev_requirement' => false, ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', 'dev_requirement' => false, ), 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => 'b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', 'aliases' => array(), - 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => 'c36586dcf89a12315939e00ec9b4474adcb1d773', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), - 'reference' => '639084e360537a19f9ee352433b84ce831f3d2da', 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '3833d7255cc303546435cb650316bff708a1c75c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), - 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '85181ba99b2345b0ef10ce42ecac37612d9fd341', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php72' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php72', - 'aliases' => array(), - 'reference' => '869329b1e9894268a8a61dabb69153029b7a8c97', 'dev_requirement' => false, ), 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '0f68c03565dcaaf25a890667542e8bd75fe7e5bb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php73', 'aliases' => array(), - 'reference' => '9e8ecb5f92152187c4799efd3c96b78ccab18ff9', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', + 'pretty_version' => 'v1.31.0', + 'version' => '1.31.0.0', + 'reference' => '60328e362d4c2c802a54fcbf04f9d3fb892b4cf8', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php81', - 'aliases' => array(), - 'reference' => '707403074c8ea6e2edaf8794b0157a0bfa52157a', 'dev_requirement' => false, ), 'symfony/process' => array( - 'pretty_version' => 'v5.4.19', - 'version' => '5.4.19.0', + 'pretty_version' => 'v5.4.47', + 'version' => '5.4.47.0', + 'reference' => '5d1662fb32ebc94f17ddb8d635454a776066733d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), - 'reference' => 'c5ba874c9b636dbccf761e22ce750e88ec3f55e1', 'dev_requirement' => false, ), 'symfony/service-contracts' => array( - 'pretty_version' => 'v2.5.2', - 'version' => '2.5.2.0', + 'pretty_version' => 'v3.5.1', + 'version' => '3.5.1.0', + 'reference' => 'e53260aabf78fb3d63f8d79d69ece59f80d5eda0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), - 'reference' => '4b426aac47d6427cc1a1d0f7e2ac724627f5966c', 'dev_requirement' => false, ), 'symfony/string' => array( - 'pretty_version' => 'v6.0.19', - 'version' => '6.0.19.0', + 'pretty_version' => 'v6.4.15', + 'version' => '6.4.15.0', + 'reference' => '73a5e66ea2e1677c98d4449177c5a9cf9d8b4c6f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), - 'reference' => 'd9e72497367c23e08bf94176d2be45b00a9d232a', 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v6.0.19', - 'version' => '6.0.19.0', + 'pretty_version' => 'v6.4.13', + 'version' => '6.4.13.0', + 'reference' => 'bee9bfabfa8b4045a66bf82520e492cddbaffa66', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), - 'reference' => '9c24b3fdbbe9fb2ef3a6afd8bbaadfd72dad681f', 'dev_requirement' => false, ), 'symfony/translation-contracts' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', + 'pretty_version' => 'v3.5.1', + 'version' => '3.5.1.0', + 'reference' => '4667ff3bd513750603a09c8dedbea942487fb07c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation-contracts', 'aliases' => array(), - 'reference' => 'acbfbb274e730e5a0236f619b6168d9dedb3e282', 'dev_requirement' => false, ), 'symfony/translation-implementation' => array( @@ -1005,66 +1011,66 @@ ), ), 'symfony/var-dumper' => array( - 'pretty_version' => 'v5.4.19', - 'version' => '5.4.19.0', + 'pretty_version' => 'v5.4.48', + 'version' => '5.4.48.0', + 'reference' => '42f18f170aa86d612c3559cfb3bd11a375df32c8', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), - 'reference' => '2944bbc23f5f8da2b962fbcbf7c4a6109b2f4b7b', 'dev_requirement' => false, ), 'symfony/yaml' => array( - 'pretty_version' => 'v6.0.19', - 'version' => '6.0.19.0', + 'pretty_version' => 'v6.4.13', + 'version' => '6.4.13.0', + 'reference' => 'e99b4e94d124b29ee4cf3140e1b537d2dad8cec9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), - 'reference' => 'deec3a812a0305a50db8ae689b183f43d915c884', 'dev_requirement' => false, ), 'theseer/tokenizer' => array( - 'pretty_version' => '1.2.1', - 'version' => '1.2.1.0', + 'pretty_version' => '1.2.3', + 'version' => '1.2.3.0', + 'reference' => '737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2', 'type' => 'library', 'install_path' => __DIR__ . '/../theseer/tokenizer', 'aliases' => array(), - 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', 'dev_requirement' => true, ), 'vlucas/phpdotenv' => array( - 'pretty_version' => 'v5.5.0', - 'version' => '5.5.0.0', + 'pretty_version' => 'v5.6.1', + 'version' => '5.6.1.0', + 'reference' => 'a59a13791077fe3d44f90e7133eb68e7d22eaff2', 'type' => 'library', 'install_path' => __DIR__ . '/../vlucas/phpdotenv', 'aliases' => array(), - 'reference' => '1a7ea2afc49c3ee6d87061f5a233e3a035d0eae7', 'dev_requirement' => false, ), 'voku/portable-ascii' => array( 'pretty_version' => '1.6.1', 'version' => '1.6.1.0', + 'reference' => '87337c91b9dfacee02452244ee14ab3c43bc485a', 'type' => 'library', 'install_path' => __DIR__ . '/../voku/portable-ascii', 'aliases' => array(), - 'reference' => '87337c91b9dfacee02452244ee14ab3c43bc485a', 'dev_requirement' => false, ), 'webmozart/assert' => array( 'pretty_version' => '1.11.0', 'version' => '1.11.0.0', + 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), - 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'dev_requirement' => false, ), 'zircote/swagger-php' => array( 'pretty_version' => '3.3.7', 'version' => '3.3.7.0', + 'reference' => 'e8c3bb316e385e93a0c7e8b2aa0681079244c381', 'type' => 'library', 'install_path' => __DIR__ . '/../zircote/swagger-php', 'aliases' => array(), - 'reference' => 'e8c3bb316e385e93a0c7e8b2aa0681079244c381', 'dev_requirement' => false, ), ), diff --git a/api/vendor/doctrine/annotations/README.md b/api/vendor/doctrine/annotations/README.md index 6b8c0359be..f1b53b5733 100644 --- a/api/vendor/doctrine/annotations/README.md +++ b/api/vendor/doctrine/annotations/README.md @@ -4,6 +4,13 @@ which are a native replacement for annotations. As such, this library is considered feature complete, and should receive exclusively bugfixes and security fixes. +We do not recommend using this library in new projects and encourage authors +of downstream libraries to offer support for attributes as an alternative to +Doctrine Annotations. + +Have a look at [our blog](https://www.doctrine-project.org/2022/11/04/annotations-to-attributes.html) +to learn more. + # Doctrine Annotations [![Build Status](https://github.com/doctrine/annotations/workflows/Continuous%20Integration/badge.svg?label=build)](https://github.com/doctrine/persistence/actions) diff --git a/api/vendor/doctrine/annotations/composer.json b/api/vendor/doctrine/annotations/composer.json index e322d82fcf..a1ed4760e1 100644 --- a/api/vendor/doctrine/annotations/composer.json +++ b/api/vendor/doctrine/annotations/composer.json @@ -39,11 +39,11 @@ }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "~1.4.10 || ^1.10.28", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7", + "vimeo/psalm": "^4.30 || ^5.14" }, "suggest": { "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" diff --git a/api/vendor/doctrine/annotations/docs/en/index.rst b/api/vendor/doctrine/annotations/docs/en/index.rst index 7caffb50ae..ef173ffa9e 100644 --- a/api/vendor/doctrine/annotations/docs/en/index.rst +++ b/api/vendor/doctrine/annotations/docs/en/index.rst @@ -7,6 +7,13 @@ which are a native replacement for annotations. As such, this library is considered feature complete, and should receive exclusively bugfixes and security fixes. +We do not recommend using this library in new projects and encourage authors +of downstream libraries to offer support for attributes as an alternative to +Doctrine Annotations. + +Have a look at [our blog](https://www.doctrine-project.org/2022/11/04/annotations-to-attributes.html) +to learn more. + Introduction ============ @@ -38,7 +45,7 @@ You can install the Annotation component with composer: .. code-block:: -   $ composer require doctrine/annotations + $ composer require doctrine/annotations Create an annotation class ========================== diff --git a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php index 1f538ee534..566fcd42f5 100644 --- a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php +++ b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php @@ -12,8 +12,11 @@ use function array_merge; use function class_exists; use function extension_loaded; +use function filter_var; use function ini_get; +use const FILTER_VALIDATE_BOOLEAN; + /** * A reader for docblock annotations. */ @@ -109,13 +112,17 @@ public static function addGlobalIgnoredNamespace($namespace) public function __construct(?DocParser $parser = null) { if ( - extension_loaded('Zend Optimizer+') && (ini_get('zend_optimizerplus.save_comments') === '0' || - ini_get('opcache.save_comments') === '0') + extension_loaded('Zend Optimizer+') && + (filter_var(ini_get('zend_optimizerplus.save_comments'), FILTER_VALIDATE_BOOLEAN) === false || + filter_var(ini_get('opcache.save_comments'), FILTER_VALIDATE_BOOLEAN) === false) ) { throw AnnotationException::optimizerPlusSaveComments(); } - if (extension_loaded('Zend OPcache') && ini_get('opcache.save_comments') === 0) { + if ( + extension_loaded('Zend OPcache') && + filter_var(ini_get('opcache.save_comments'), FILTER_VALIDATE_BOOLEAN) === false + ) { throw AnnotationException::optimizerPlusSaveComments(); } diff --git a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php index 85dbefab5a..6bd6be3a9c 100644 --- a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php +++ b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php @@ -11,6 +11,7 @@ use function array_merge; use function assert; use function filemtime; +use function is_file; use function max; use function time; @@ -229,7 +230,7 @@ private function getLastModification(ReflectionClass $class): int $parent = $class->getParentClass(); $lastModification = max(array_merge( - [$filename ? filemtime($filename) : 0], + [$filename !== false && is_file($filename) ? filemtime($filename) : 0], array_map(function (ReflectionClass $reflectionTrait): int { return $this->getTraitLastModificationTime($reflectionTrait); }, $class->getTraits()), @@ -253,7 +254,7 @@ private function getTraitLastModificationTime(ReflectionClass $reflectionTrait): } $lastModificationTime = max(array_merge( - [$fileName ? filemtime($fileName) : 0], + [$fileName !== false && is_file($fileName) ? filemtime($fileName) : 0], array_map(function (ReflectionClass $reflectionTrait): int { return $this->getTraitLastModificationTime($reflectionTrait); }, $reflectionTrait->getTraits()) diff --git a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php index dbba52522e..3aa4c7aa40 100644 --- a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php +++ b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocLexer.php @@ -74,7 +74,7 @@ public function nextTokenIsAdjacent(): bool } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getCatchablePatterns() { @@ -86,7 +86,7 @@ protected function getCatchablePatterns() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getNonCatchablePatterns() { @@ -94,7 +94,7 @@ protected function getNonCatchablePatterns() } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function getType(&$value) { diff --git a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php index 5ec150d3e1..fbbde94ae4 100644 --- a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php +++ b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php @@ -49,6 +49,8 @@ * A parser for docblock annotations. * * It is strongly discouraged to change the default annotation parsing process. + * + * @psalm-type Arguments = array{positional_arguments?: array, named_arguments?: array} */ final class DocParser { @@ -1038,7 +1040,7 @@ private function Annotation() /** * MethodCall ::= ["(" [Values] ")"] * - * @return mixed[] + * @psalm-return Arguments * * @throws AnnotationException * @throws ReflectionException @@ -1065,7 +1067,7 @@ private function MethodCall(): array /** * Values ::= Array | Value {"," Value}* [","] * - * @return mixed[] + * @psalm-return Arguments * * @throws AnnotationException * @throws ReflectionException @@ -1427,7 +1429,7 @@ private function isIgnoredAnnotation(string $name): bool /** * Resolve positional arguments (without name) to named ones * - * @param array $arguments + * @psalm-param Arguments $arguments * * @return array */ diff --git a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php index a7099d5790..b42da39a72 100644 --- a/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php +++ b/api/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php @@ -12,6 +12,7 @@ use function array_merge; use function assert; use function filemtime; +use function is_file; use function max; use function rawurlencode; use function time; @@ -195,7 +196,7 @@ private function getLastModification(ReflectionClass $class): int $parent = $class->getParentClass(); $lastModification = max(array_merge( - [$filename ? filemtime($filename) : 0], + [$filename !== false && is_file($filename) ? filemtime($filename) : 0], array_map(function (ReflectionClass $reflectionTrait): int { return $this->getTraitLastModificationTime($reflectionTrait); }, $class->getTraits()), @@ -219,7 +220,7 @@ private function getTraitLastModificationTime(ReflectionClass $reflectionTrait): } $lastModificationTime = max(array_merge( - [$fileName ? filemtime($fileName) : 0], + [$fileName !== false && is_file($fileName) ? filemtime($fileName) : 0], array_map(function (ReflectionClass $reflectionTrait): int { return $this->getTraitLastModificationTime($reflectionTrait); }, $reflectionTrait->getTraits()) diff --git a/api/vendor/doctrine/annotations/psalm.xml b/api/vendor/doctrine/annotations/psalm.xml index e6af389238..e0eefe97ec 100644 --- a/api/vendor/doctrine/annotations/psalm.xml +++ b/api/vendor/doctrine/annotations/psalm.xml @@ -1,7 +1,10 @@ + + + + + + + + diff --git a/api/vendor/doctrine/inflector/composer.json b/api/vendor/doctrine/inflector/composer.json index 862ea5c35d..91d77071e5 100644 --- a/api/vendor/doctrine/inflector/composer.json +++ b/api/vendor/doctrine/inflector/composer.json @@ -16,12 +16,12 @@ "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^11.0", "phpstan/phpstan": "^1.8", "phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "^8.5 || ^9.5", - "vimeo/psalm": "^4.25" + "vimeo/psalm": "^4.25 || ^5.4" }, "autoload": { "psr-4": { diff --git a/api/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php b/api/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php index db884ca043..8bf02a2920 100644 --- a/api/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php +++ b/api/vendor/doctrine/inflector/lib/Doctrine/Inflector/Rules/English/Inflectible.php @@ -47,7 +47,7 @@ public static function getSingular(): iterable yield new Transformation(new Pattern('(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$'), '\1\2sis'); yield new Transformation(new Pattern('(tax)a$'), '\1on'); yield new Transformation(new Pattern('(c)riteria$'), '\1riterion'); - yield new Transformation(new Pattern('([ti])a$'), '\1um'); + yield new Transformation(new Pattern('([ti])a(?getName() + $reflectionClass->getName(), )); } @@ -44,7 +46,7 @@ public static function fromEnum(string $className): self { return new self(sprintf( 'The provided class "%s" is an enum, and cannot be instantiated', - $className + $className, )); } } diff --git a/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php index 4e55ac5250..4f70ded200 100644 --- a/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php +++ b/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php @@ -1,5 +1,7 @@ getName() + $reflectionClass->getName(), ), 0, - $exception + $exception, ); } @@ -42,7 +44,7 @@ public static function fromUncleanUnSerialization( string $errorString, int $errorCode, string $errorFile, - int $errorLine + int $errorLine, ): self { return new self( sprintf( @@ -50,10 +52,10 @@ public static function fromUncleanUnSerialization( . 'in file "%s" at line "%d"', $reflectionClass->getName(), $errorFile, - $errorLine + $errorLine, ), 0, - new Exception($errorString, $errorCode) + new Exception($errorString, $errorCode), ); } } diff --git a/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php b/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php index 10067a0f49..f803f89aa7 100644 --- a/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php +++ b/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/Instantiator.php @@ -1,5 +1,7 @@ $className * - * @return object * @phpstan-return T * * @throws ExceptionInterface * * @template T of object */ - public function instantiate($className) + public function instantiate(string $className): object { if (isset(self::$cachedCloneables[$className])) { /** @phpstan-var T */ @@ -84,12 +80,11 @@ public function instantiate($className) * * @phpstan-param class-string $className * - * @return object * @phpstan-return T * * @template T of object */ - private function buildAndCacheFromFactory(string $className) + private function buildAndCacheFromFactory(string $className): object { $factory = self::$cachedInstantiators[$className] = $this->buildFactory($className); $instance = $factory(); @@ -127,14 +122,12 @@ private function buildFactory(string $className): callable '%s:%d:"%s":0:{}', is_subclass_of($className, Serializable::class) ? self::SERIALIZATION_FORMAT_USE_UNSERIALIZER : self::SERIALIZATION_FORMAT_AVOID_UNSERIALIZER, strlen($className), - $className + $className, ); $this->checkIfUnSerializationIsSupported($reflectionClass, $serializedString); - return static function () use ($serializedString) { - return unserialize($serializedString); - }; + return static fn () => unserialize($serializedString); } /** @@ -153,7 +146,7 @@ private function getReflectionClass(string $className): ReflectionClass throw InvalidArgumentException::fromNonExistingClass($className); } - if (PHP_VERSION_ID >= 80100 && enum_exists($className, false)) { + if (enum_exists($className, false)) { throw InvalidArgumentException::fromEnum($className); } @@ -181,7 +174,7 @@ private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionCl $message, $code, $file, - $line + $line, ); return true; diff --git a/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php b/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php index 10508b562e..c6ebe351b5 100644 --- a/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php +++ b/api/vendor/doctrine/instantiator/src/Doctrine/Instantiator/InstantiatorInterface.php @@ -1,5 +1,7 @@ $className * - * @return object * @phpstan-return T * * @throws ExceptionInterface * * @template T of object */ - public function instantiate($className); + public function instantiate(string $className): object; } diff --git a/api/vendor/dragonmantank/cron-expression/CHANGELOG.md b/api/vendor/dragonmantank/cron-expression/CHANGELOG.md index 7b6df4b1cb..17ab2ce44d 100644 --- a/api/vendor/dragonmantank/cron-expression/CHANGELOG.md +++ b/api/vendor/dragonmantank/cron-expression/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## [3.3.3] - 2024-08-10 + +### Added +- N/A + +### Changed +- N/A + +### Fixed +- Added fixes for making sure `?` is not passed for both DOM and DOW (#148, thank you https://github.com/LeoVie) +- Fixed bug in Next Execution Time by sorting minutes properly (#160, thank you https://github.com/imyip) + ## [3.3.2] - 2022-09-19 ### Added diff --git a/api/vendor/dragonmantank/cron-expression/README.md b/api/vendor/dragonmantank/cron-expression/README.md index e853ad4555..b9df3db5fb 100644 --- a/api/vendor/dragonmantank/cron-expression/README.md +++ b/api/vendor/dragonmantank/cron-expression/README.md @@ -1,7 +1,7 @@ PHP Cron Expression Parser ========================== -[![Latest Stable Version](https://poser.pugx.org/dragonmantank/cron-expression/v/stable.png)](https://packagist.org/packages/dragonmantank/cron-expression) [![Total Downloads](https://poser.pugx.org/dragonmantank/cron-expression/downloads.png)](https://packagist.org/packages/dragonmantank/cron-expression) [![Build Status](https://secure.travis-ci.org/dragonmantank/cron-expression.png)](http://travis-ci.org/dragonmantank/cron-expression) [![StyleCI](https://github.styleci.io/repos/103715337/shield?branch=master)](https://github.styleci.io/repos/103715337) +[![Latest Stable Version](https://poser.pugx.org/dragonmantank/cron-expression/v/stable.png)](https://packagist.org/packages/dragonmantank/cron-expression) [![Total Downloads](https://poser.pugx.org/dragonmantank/cron-expression/downloads.png)](https://packagist.org/packages/dragonmantank/cron-expression) [![Tests](https://github.com/dragonmantank/cron-expression/actions/workflows/tests.yml/badge.svg)](https://github.com/dragonmantank/cron-expression/actions/workflows/tests.yml) [![StyleCI](https://github.styleci.io/repos/103715337/shield?branch=master)](https://github.styleci.io/repos/103715337) The PHP cron expression parser can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression, and calculate the previous @@ -55,23 +55,65 @@ CRON Expressions A CRON expression is a string representing the schedule for a particular command to execute. The parts of a CRON schedule are as follows: - * * * * * - - - - - - - | | | | | - | | | | | - | | | | +----- day of week (0 - 7) (Sunday=0 or 7) - | | | +---------- month (1 - 12) - | | +--------------- day of month (1 - 31) - | +-------------------- hour (0 - 23) - +------------------------- min (0 - 59) - -This library also supports a few macros: +``` +* * * * * +- - - - - +| | | | | +| | | | | +| | | | +----- day of week (0-7) (Sunday = 0 or 7) (or SUN-SAT) +| | | +--------- month (1-12) (or JAN-DEC) +| | +------------- day of month (1-31) +| +----------------- hour (0-23) ++--------------------- minute (0-59) +``` -* `@yearly`, `@annually` - Run once a year, midnight, Jan. 1 - `0 0 1 1 *` -* `@monthly` - Run once a month, midnight, first of month - `0 0 1 * *` -* `@weekly` - Run once a week, midnight on Sun - `0 0 * * 0` -* `@daily`, `@midnight` - Run once a day, midnight - `0 0 * * *` -* `@hourly` - Run once an hour, first minute - `0 * * * *` +Each part of expression can also use wildcard, lists, ranges and steps: + +- wildcard - match always + - `* * * * *` - At every minute. + - day of week and day of month also support `?`, an alias to `*` +- lists - match list of values, ranges and steps + - e.g. `15,30 * * * *` - At minute 15 and 30. +- ranges - match values in range + - e.g. `1-9 * * * *` - At every minute from 1 through 9. +- steps - match every nth value in range + - e.g. `*/5 * * * *` - At every 5th minute. + - e.g. `0-30/5 * * * *` - At every 5th minute from 0 through 30. +- combinations + - e.g. `0-14,30-44 * * * *` - At every minute from 0 through 14 and every minute from 30 through 44. + +You can also use macro instead of an expression: + +- `@yearly`, `@annually` - At 00:00 on 1st of January. (same as `0 0 1 1 *`) +- `@monthly` - At 00:00 on day-of-month 1. (same as `0 0 1 * *`) +- `@weekly` - At 00:00 on Sunday. (same as `0 0 * * 0`) +- `@daily`, `@midnight` - At 00:00. (same as `0 0 * * *`) +- `@hourly` - At minute 0. (same as `0 * * * *`) + +Day of month extra features: + +- nearest weekday - weekday (Monday-Friday) nearest to the given day + - e.g. `* * 15W * *` - At every minute on a weekday nearest to the 15th. + - If you were to specify `15W` as the value, the meaning is: "the nearest weekday to the 15th of the month" + So if the 15th is a Saturday, the trigger will fire on Friday the 14th. + If the 15th is a Sunday, the trigger will fire on Monday the 16th. + If the 15th is a Tuesday, then it will fire on Tuesday the 15th. + - However, if you specify `1W` as the value for day-of-month, + and the 1st is a Saturday, the trigger will fire on Monday the 3rd, + as it will not 'jump' over the boundary of a month's days. +- last day of the month + - e.g. `* * L * *` - At every minute on a last day-of-month. +- last weekday of the month + - e.g. `* * LW * *` - At every minute on a last weekday. + +Day of week extra features: + +- nth day + - e.g. `* * * * 7#4` - At every minute on 4th Sunday. + - 1-5 + - Every day of week repeats 4-5 times a month. To target the last one, use "last day" feature instead. +- last day + - e.g. `* * * * 7L` - At every minute on the last Sunday. Requirements ============ @@ -84,4 +126,6 @@ Projects that Use cron-expression ================================= * Part of the [Laravel Framework](https://github.com/laravel/framework/) * Available as a [Symfony Bundle - setono/cron-expression-bundle](https://github.com/Setono/CronExpressionBundle) -* Framework agnostic, PHP-based job scheduler - [Crunz](https://github.com/lavary/crunz) +* Framework agnostic, PHP-based job scheduler - [Crunz](https://github.com/crunzphp/crunz) +* Framework agnostic job scheduler - with locks, parallelism, per-second scheduling and more - [orisai/scheduler](https://github.com/orisai/scheduler) +* Explain expression in English (and other languages) with [orisai/cron-expression-explainer](https://github.com/orisai/cron-expression-explainer) diff --git a/api/vendor/dragonmantank/cron-expression/composer.json b/api/vendor/dragonmantank/cron-expression/composer.json index 657a5b47cd..fdb46ee41e 100644 --- a/api/vendor/dragonmantank/cron-expression/composer.json +++ b/api/vendor/dragonmantank/cron-expression/composer.json @@ -18,7 +18,6 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpunit/phpunit": "^7.0|^8.0|^9.0", - "phpstan/phpstan-webmozart-assert": "^1.0", "phpstan/extension-installer": "^1.0" }, "autoload": { @@ -38,6 +37,11 @@ "phpstan": "./vendor/bin/phpstan analyze", "test": "phpunit" }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, "config": { "allow-plugins": { "ocramius/package-versions": true, diff --git a/api/vendor/dragonmantank/cron-expression/phpstan.neon b/api/vendor/dragonmantank/cron-expression/phpstan.neon deleted file mode 100644 index bea9cb0dad..0000000000 --- a/api/vendor/dragonmantank/cron-expression/phpstan.neon +++ /dev/null @@ -1,15 +0,0 @@ -parameters: - checkMissingIterableValueType: false - - ignoreErrors: - - '#Call to an undefined method DateTimeInterface::add\(\)#' - - '#Call to an undefined method DateTimeInterface::modify\(\)#' - - '#Call to an undefined method DateTimeInterface::setDate\(\)#' - - '#Call to an undefined method DateTimeInterface::setTime\(\)#' - - '#Call to an undefined method DateTimeInterface::setTimezone\(\)#' - - '#Call to an undefined method DateTimeInterface::sub\(\)#' - - level: max - - paths: - - src/ diff --git a/api/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php b/api/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php index d5337cc57f..f3d8eb003f 100644 --- a/api/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php +++ b/api/vendor/dragonmantank/cron-expression/src/Cron/CronExpression.php @@ -12,7 +12,6 @@ use InvalidArgumentException; use LogicException; use RuntimeException; -use Webmozart\Assert\Assert; /** * CRON expression parser that can determine whether or not a CRON expression is @@ -148,7 +147,7 @@ public static function getAliases(): array /** * @deprecated since version 3.0.2, use __construct instead. */ - public static function factory(string $expression, FieldFactoryInterface $fieldFactory = null): CronExpression + public static function factory(string $expression, ?FieldFactoryInterface $fieldFactory = null): CronExpression { /** @phpstan-ignore-next-line */ return new static($expression, $fieldFactory); @@ -177,8 +176,9 @@ public static function isValidExpression(string $expression): bool * * @param string $expression CRON expression (e.g. '8 * * * *') * @param null|FieldFactoryInterface $fieldFactory Factory to create cron fields + * @throws InvalidArgumentException */ - public function __construct(string $expression, FieldFactoryInterface $fieldFactory = null) + public function __construct(string $expression, ?FieldFactoryInterface $fieldFactory = null) { $shortcut = strtolower($expression); $expression = self::$registeredAliases[$shortcut] ?? $expression; @@ -199,15 +199,29 @@ public function __construct(string $expression, FieldFactoryInterface $fieldFact public function setExpression(string $value): CronExpression { $split = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY); - Assert::isArray($split); - $this->cronParts = $split; - if (\count($this->cronParts) < 5) { + if (!\is_array($split)) { + throw new InvalidArgumentException( + $value . ' is not a valid CRON expression' + ); + } + + $notEnoughParts = \count($split) < 5; + + $questionMarkInInvalidPart = array_key_exists(0, $split) && $split[0] === '?' + || array_key_exists(1, $split) && $split[1] === '?' + || array_key_exists(3, $split) && $split[3] === '?'; + + $tooManyQuestionMarks = array_key_exists(2, $split) && $split[2] === '?' + && array_key_exists(4, $split) && $split[4] === '?'; + + if ($notEnoughParts || $questionMarkInInvalidPart || $tooManyQuestionMarks) { throw new InvalidArgumentException( $value . ' is not a valid CRON expression' ); } + $this->cronParts = $split; foreach ($this->cronParts as $position => $part) { $this->setPart($position, $part); } @@ -324,7 +338,10 @@ public function getMultipleRunDates(int $total, $currentTime = 'now', bool $inve $currentTime = new DateTime($currentTime); } - Assert::isInstanceOf($currentTime, DateTime::class); + if (!$currentTime instanceof DateTime) { + throw new InvalidArgumentException('invalid current time'); + } + $currentTime->setTimezone(new DateTimeZone($timeZone)); $matches = []; @@ -410,7 +427,10 @@ public function isDue($currentTime = 'now', $timeZone = null): bool $currentTime = new DateTime($currentTime); } - Assert::isInstanceOf($currentTime, DateTime::class); + if (!$currentTime instanceof DateTime) { + throw new InvalidArgumentException('invalid current time'); + } + $currentTime->setTimezone(new DateTimeZone($timeZone)); // drop the seconds to 0 @@ -452,7 +472,10 @@ protected function getRunDate($currentTime = null, int $nth = 0, bool $invert = $currentDate = new DateTime('now'); } - Assert::isInstanceOf($currentDate, DateTime::class); + if (!$currentDate instanceof DateTime) { + throw new InvalidArgumentException('invalid current date'); + } + $currentDate->setTimezone(new DateTimeZone($timeZone)); // Workaround for setTime causing an offset change: https://bugs.php.net/bug.php?id=81074 $currentDate = DateTime::createFromFormat("!Y-m-d H:iO", $currentDate->format("Y-m-d H:iP"), $currentDate->getTimezone()); diff --git a/api/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php b/api/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php index eda91098e8..f077e6ec51 100644 --- a/api/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php +++ b/api/vendor/dragonmantank/cron-expression/src/Cron/MinutesField.php @@ -49,6 +49,7 @@ public function increment(DateTimeInterface &$date, $invert = false, $parts = nu $current_minute = (int) $date->format('i'); $parts = false !== strpos($parts, ',') ? explode(',', $parts) : [$parts]; + sort($parts); $minutes = []; foreach ($parts as $part) { $minutes = array_merge($minutes, $this->getRangeForExpression($part, 59)); diff --git a/api/vendor/fakerphp/faker/CHANGELOG.md b/api/vendor/fakerphp/faker/CHANGELOG.md index 566ad322c7..d3e37221b2 100644 --- a/api/vendor/fakerphp/faker/CHANGELOG.md +++ b/api/vendor/fakerphp/faker/CHANGELOG.md @@ -1,6 +1,34 @@ # CHANGELOG -## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.20.0...main) +## [Unreleased](https://github.com/FakerPHP/Faker/compare/v1.24.0...1.24.1) + +- Removed domain `gmail.com.au` from `Provider\en_AU\Internet` (#886) + +## [2024-11-09, v1.24.0](https://github.com/FakerPHP/Faker/compare/v1.23.1..v1.24.0) + +- Fix internal deprecations in Doctrine's populator by @gnutix in (#889) +- Fix mobile phone number pattern for France by @ker0x in (#859) +- PHP 8.4 Support by @Jubeki in (#904) + +- Added support for PHP 8.4 (#904) + +## [2023-09-29, v1.23.1](https://github.com/FakerPHP/Faker/compare/v1.23.0..v1.23.1) + +- Fixed double `а` female lastName in `ru_RU/Person::name()` (#832) +- Fixed polish license plates (#685) +- Stopped using `static` in callables in `Provider\pt_BR\PhoneNumber` (#785) +- Fixed incorrect female name (#794) +- Stopped using the deprecated `MT_RAND_PHP` constant to seed the random generator on PHP 8.3 (#844) + +## [2023-06-12, v1.23.0](https://github.com/FakerPHP/Faker/compare/v1.22.0..v1.23.0) + +- Update `randomElements` to return random number of elements when no count is provided (#658) + +## [2023-05-14, v1.22.0](https://github.com/FakerPHP/Faker/compare/v1.21.0..v1.22.0) + +- Fixed `randomElements()` to accept empty iterator (#605) +- Added support for passing an `Enum` to `randomElement()` and `randomElements()` (#620) +- Started rejecting invalid arguments passed to `randomElement()` and `randomElements()` (#642) ## [2022-12-13, v1.21.0](https://github.com/FakerPHP/Faker/compare/v1.20.0..v1.21.0) diff --git a/api/vendor/fakerphp/faker/README.md b/api/vendor/fakerphp/faker/README.md index c3c199d5c1..2c6a26843e 100644 --- a/api/vendor/fakerphp/faker/README.md +++ b/api/vendor/fakerphp/faker/README.md @@ -81,11 +81,18 @@ to run `rector/rector`. *Note:* do not forget to replace `src/` with the path to your source directory. -Another way is to use it in your `rector.php` file: +Alternatively, import the configuration in your `rector.php` file: ```php -$rectorConfig->import('vendor/fakerphp/faker/rector-migrate.php'); -$faker($rectorConfig); +import('vendor/fakerphp/faker/rector-migrate.php'); +}; ``` ## License diff --git a/api/vendor/fakerphp/faker/composer.json b/api/vendor/fakerphp/faker/composer.json index 9b85ce9d43..88724f2a60 100644 --- a/api/vendor/fakerphp/faker/composer.json +++ b/api/vendor/fakerphp/faker/composer.json @@ -52,10 +52,5 @@ "composer/package-versions-deprecated": true }, "sort-packages": true - }, - "extra": { - "branch-alias": { - "dev-main": "v1.21-dev" - } } } diff --git a/api/vendor/fakerphp/faker/psalm.baseline.xml b/api/vendor/fakerphp/faker/psalm.baseline.xml deleted file mode 100644 index 7c3b4e8717..0000000000 --- a/api/vendor/fakerphp/faker/psalm.baseline.xml +++ /dev/null @@ -1,247 +0,0 @@ - - - - - 0 - - - string - - - - - $this->uniqueGenerator - new ChanceGenerator($this, $weight, $default) - new ValidGenerator($this, $validator, $maxRetries) - - - self - self - self - - - - - TableRegistry - - - - - $this->class - \Doctrine\ODM\MongoDB\Mapping\ClassMetadata - \Doctrine\ODM\MongoDB\Mapping\ClassMetadata - \Doctrine\ODM\MongoDB\Mapping\ClassMetadata - \Doctrine\ORM\Mapping\ClassMetadata - \Doctrine\ORM\Mapping\ClassMetadata - - - createQueryBuilder - getAssociationMappings - newInstance - - - - - Mandango - Mandango - - - - - $this->mandango - Mandango - - - - - \ColumnMap - - - - - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - \ColumnMap - - - - - \Propel - - - PropelPDO - - - - - ColumnMap - - - - - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - $columnMap - ColumnMap - - - - - Propel - - - PropelPDO - - - - - $this->mapper - - - string - - - $relation - $relation - BelongsTo - Locator - Mapper - - - $locator - $this->mapper - $this->mapper - $this->mapper - $this->mapper - $this->mapper - Locator - Mapper - - - - - $this->locator - Locator - - - Locator - - - - - [static::class, 'randomDigit'] - - - $array - - - Closure - - - - - false - - - - - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $element->ownerDocument - $root->ownerDocument - - - - - $imei - - - int - - - - - static::$cityPrefix - - - - - static::birthNumber(static::GENDER_FEMALE) - static::birthNumber(static::GENDER_MALE) - - - - - $weights[$i] - - - - - $ref[$i] - - - - - static::split($text) - - - - - $multipliers[$i - 1] - - - - - $weights[$i] - $weights[$i] - - - - - $weights[$i] - - - - - $high[$i] - $low[$i] - $result[$i] - $weights[$i + 3] - $weights[$i] - $weights[$i] - - - DateTime - - - - - $multipliers[$i] - - - - - static::lastName() - static::lastName() - - - diff --git a/api/vendor/fakerphp/faker/src/Faker/Calculator/Ean.php b/api/vendor/fakerphp/faker/src/Faker/Calculator/Ean.php index 9c3daf1757..fbf11fcdad 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Calculator/Ean.php +++ b/api/vendor/fakerphp/faker/src/Faker/Calculator/Ean.php @@ -17,11 +17,9 @@ class Ean * * @see https://en.wikipedia.org/wiki/International_Article_Number * - * @param string $digits - * * @return int */ - public static function checksum($digits) + public static function checksum(string $digits) { $sequence = (strlen($digits) + 1) === 8 ? [3, 1] : [1, 3]; $sums = 0; @@ -41,7 +39,7 @@ public static function checksum($digits) * * @return bool */ - public static function isValid($ean) + public static function isValid(string $ean) { if (!preg_match(self::PATTERN, $ean)) { return false; diff --git a/api/vendor/fakerphp/faker/src/Faker/Calculator/Iban.php b/api/vendor/fakerphp/faker/src/Faker/Calculator/Iban.php index b00b18f010..19068fd775 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Calculator/Iban.php +++ b/api/vendor/fakerphp/faker/src/Faker/Calculator/Iban.php @@ -7,11 +7,9 @@ class Iban /** * Generates IBAN Checksum * - * @param string $iban - * * @return string Checksum (numeric string) */ - public static function checksum($iban) + public static function checksum(string $iban) { // Move first four digits to end and set checksum to '00' $checkString = substr($iban, 4) . substr($iban, 0, 2) . '00'; @@ -34,11 +32,9 @@ static function (array $matches): string { /** * Converts letter to number * - * @param string $char - * * @return int */ - public static function alphaToNumber($char) + public static function alphaToNumber(string $char) { return ord($char) - 55; } @@ -50,7 +46,7 @@ public static function alphaToNumber($char) * * @return int */ - public static function mod97($number) + public static function mod97(string $number) { $checksum = (int) $number[0]; @@ -64,11 +60,9 @@ public static function mod97($number) /** * Checks whether an IBAN has a valid checksum * - * @param string $iban - * * @return bool */ - public static function isValid($iban) + public static function isValid(string $iban) { return self::checksum($iban) === substr($iban, 2, 2); } diff --git a/api/vendor/fakerphp/faker/src/Faker/Calculator/Luhn.php b/api/vendor/fakerphp/faker/src/Faker/Calculator/Luhn.php index 3a048fb082..4c1e6f5054 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Calculator/Luhn.php +++ b/api/vendor/fakerphp/faker/src/Faker/Calculator/Luhn.php @@ -13,11 +13,9 @@ class Luhn { /** - * @param string $number - * * @return int */ - private static function checksum($number) + private static function checksum(string $number) { $number = (string) $number; $length = strlen($number); @@ -35,16 +33,14 @@ private static function checksum($number) } /** - * @param string $partialNumber - * * @return string */ - public static function computeCheckDigit($partialNumber) + public static function computeCheckDigit(string $partialNumber) { $checkDigit = self::checksum($partialNumber . '0'); if ($checkDigit === 0) { - return 0; + return '0'; } return (string) (10 - $checkDigit); @@ -53,11 +49,9 @@ public static function computeCheckDigit($partialNumber) /** * Checks whether a number (partial number + check digit) is Luhn compliant * - * @param string $number - * * @return bool */ - public static function isValid($number) + public static function isValid(string $number) { return self::checksum($number) === 0; } @@ -65,11 +59,9 @@ public static function isValid($number) /** * Generate a Luhn compliant number. * - * @param string $partialValue - * * @return string */ - public static function generateLuhnNumber($partialValue) + public static function generateLuhnNumber(string $partialValue) { if (!preg_match('/^\d+$/', $partialValue)) { throw new \InvalidArgumentException('Argument should be an integer.'); diff --git a/api/vendor/fakerphp/faker/src/Faker/Container/Container.php b/api/vendor/fakerphp/faker/src/Faker/Container/Container.php index 2dd2d974d7..9b361845f2 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Container/Container.php +++ b/api/vendor/fakerphp/faker/src/Faker/Container/Container.php @@ -16,9 +16,9 @@ final class Container implements ContainerInterface /** * @var array */ - private $definitions; + private array $definitions; - private $services = []; + private array $services = []; /** * Create a container object with a set of definitions. The array value MUST @@ -63,7 +63,7 @@ public function get($id): Extension $definition = $this->definitions[$id]; - $service = $this->services[$id] = $this->getService($id, $definition); + $service = $this->getService($id, $definition); if (!$service instanceof Extension) { throw new \RuntimeException(sprintf( @@ -73,6 +73,8 @@ public function get($id): Extension )); } + $this->services[$id] = $service; + return $service; } @@ -81,7 +83,7 @@ public function get($id): Extension * * @param callable|object|string $definition */ - private function getService($id, $definition) + private function getService(string $id, $definition) { if (is_callable($definition)) { try { @@ -134,12 +136,4 @@ public function has($id): bool return array_key_exists($id, $this->definitions); } - - /** - * Get the bindings between Extension interfaces and implementations. - */ - public function getDefinitions(): array - { - return $this->definitions; - } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Container/ContainerBuilder.php b/api/vendor/fakerphp/faker/src/Faker/Container/ContainerBuilder.php index 3fb335fff5..f2545e944b 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Container/ContainerBuilder.php +++ b/api/vendor/fakerphp/faker/src/Faker/Container/ContainerBuilder.php @@ -5,14 +5,7 @@ namespace Faker\Container; use Faker\Core; -use Faker\Extension\BarcodeExtension; -use Faker\Extension\BloodExtension; -use Faker\Extension\ColorExtension; -use Faker\Extension\DateTimeExtension; -use Faker\Extension\FileExtension; -use Faker\Extension\NumberExtension; -use Faker\Extension\UuidExtension; -use Faker\Extension\VersionExtension; +use Faker\Extension; /** * @experimental This class is experimental and does not fall under our BC promise @@ -22,36 +15,23 @@ final class ContainerBuilder /** * @var array */ - private $definitions = []; + private array $definitions = []; /** - * @param callable|object|string $value + * @param callable|object|string $definition * * @throws \InvalidArgumentException */ - public function add($value, string $name = null): self + public function add(string $id, $definition): self { - if (!is_string($value) && !is_callable($value) && !is_object($value)) { + if (!is_string($definition) && !is_callable($definition) && !is_object($definition)) { throw new \InvalidArgumentException(sprintf( 'First argument to "%s::add()" must be a string, callable or object.', self::class, )); } - if ($name === null) { - if (is_string($value)) { - $name = $value; - } elseif (is_object($value)) { - $name = get_class($value); - } else { - throw new \InvalidArgumentException(sprintf( - 'Second argument to "%s::add()" is required not passing a string or object as first argument', - self::class, - )); - } - } - - $this->definitions[$name] = $value; + $this->definitions[$id] = $definition; return $this; } @@ -61,32 +41,28 @@ public function build(): ContainerInterface return new Container($this->definitions); } - /** - * Get an array with extension that represent the default English - * functionality. - */ - public static function defaultExtensions(): array + private static function defaultExtensions(): array { return [ - BarcodeExtension::class => Core\Barcode::class, - BloodExtension::class => Core\Blood::class, - ColorExtension::class => Core\Color::class, - DateTimeExtension::class => Core\DateTime::class, - FileExtension::class => Core\File::class, - NumberExtension::class => Core\Number::class, - VersionExtension::class => Core\Version::class, - UuidExtension::class => Core\Uuid::class, + Extension\BarcodeExtension::class => Core\Barcode::class, + Extension\BloodExtension::class => Core\Blood::class, + Extension\ColorExtension::class => Core\Color::class, + Extension\DateTimeExtension::class => Core\DateTime::class, + Extension\FileExtension::class => Core\File::class, + Extension\NumberExtension::class => Core\Number::class, + Extension\UuidExtension::class => Core\Uuid::class, + Extension\VersionExtension::class => Core\Version::class, ]; } - public static function getDefault(): ContainerInterface + public static function withDefaultExtensions(): self { $instance = new self(); foreach (self::defaultExtensions() as $id => $definition) { - $instance->add($definition, $id); + $instance->add($id, $definition); } - return $instance->build(); + return $instance; } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Container/ContainerInterface.php b/api/vendor/fakerphp/faker/src/Faker/Container/ContainerInterface.php index d34f4a8967..9e5237d341 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Container/ContainerInterface.php +++ b/api/vendor/fakerphp/faker/src/Faker/Container/ContainerInterface.php @@ -6,8 +6,4 @@ interface ContainerInterface extends BaseContainerInterface { - /** - * Get the bindings between Extension interfaces and implementations. - */ - public function getDefinitions(): array; } diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/Barcode.php b/api/vendor/fakerphp/faker/src/Faker/Core/Barcode.php index 89f801a5a0..4ad17e17a5 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/Barcode.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/Barcode.php @@ -12,6 +12,13 @@ */ final class Barcode implements Extension\BarcodeExtension { + private Extension\NumberExtension $numberExtension; + + public function __construct(?Extension\NumberExtension $numberExtension = null) + { + $this->numberExtension = $numberExtension ?: new Number(); + } + private function ean(int $length = 13): string { $code = Extension\Helper::numerify(str_repeat('#', $length - 1)); @@ -38,7 +45,7 @@ public function isbn10(): string public function isbn13(): string { - $code = '97' . mt_rand(8, 9) . Extension\Helper::numerify(str_repeat('#', 9)); + $code = '97' . $this->numberExtension->numberBetween(8, 9) . Extension\Helper::numerify(str_repeat('#', 9)); return sprintf('%s%s', $code, Calculator\Ean::checksum($code)); } diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/Blood.php b/api/vendor/fakerphp/faker/src/Faker/Core/Blood.php index 50a5806c6b..03e563fc12 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/Blood.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/Blood.php @@ -14,12 +14,12 @@ final class Blood implements Extension\BloodExtension /** * @var string[] */ - private $bloodTypes = ['A', 'AB', 'B', 'O']; + private array $bloodTypes = ['A', 'AB', 'B', 'O']; /** * @var string[] */ - private $bloodRhFactors = ['+', '-']; + private array $bloodRhFactors = ['+', '-']; public function bloodType(): string { diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/Color.php b/api/vendor/fakerphp/faker/src/Faker/Core/Color.php index 6e4e350e6d..c6cac0d33a 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/Color.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/Color.php @@ -12,19 +12,20 @@ */ final class Color implements Extension\ColorExtension { + private Extension\NumberExtension $numberExtension; + /** * @var string[] */ - private $safeColorNames = [ + private array $safeColorNames = [ 'black', 'maroon', 'green', 'navy', 'olive', 'purple', 'teal', 'lime', 'blue', 'silver', 'gray', 'yellow', 'fuchsia', 'aqua', 'white', ]; - /** * @var string[] */ - private $allColorNames = [ + private array $allColorNames = [ 'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', 'Azure', 'Beige', 'Bisque', 'Black', 'BlanchedAlmond', 'Blue', 'BlueViolet', 'Brown', 'BurlyWood', 'CadetBlue', @@ -53,14 +54,17 @@ final class Color implements Extension\ColorExtension 'Turquoise', 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow', 'YellowGreen', ]; + public function __construct(?Extension\NumberExtension $numberExtension = null) + { + $this->numberExtension = $numberExtension ?: new Number(); + } + /** * @example '#fa3cc2' */ public function hexColor(): string { - $number = new Number(); - - return '#' . str_pad(dechex($number->numberBetween(1, 16777215)), 6, '0', STR_PAD_LEFT); + return '#' . str_pad(dechex($this->numberExtension->numberBetween(1, 16777215)), 6, '0', STR_PAD_LEFT); } /** @@ -68,8 +72,7 @@ public function hexColor(): string */ public function safeHexColor(): string { - $number = new Number(); - $color = str_pad(dechex($number->numberBetween(0, 255)), 3, '0', STR_PAD_LEFT); + $color = str_pad(dechex($this->numberExtension->numberBetween(0, 255)), 3, '0', STR_PAD_LEFT); return sprintf( '#%s%s%s%s%s%s', @@ -122,12 +125,10 @@ public function rgbCssColor(): string */ public function rgbaCssColor(): string { - $number = new Number(); - return sprintf( 'rgba(%s,%s)', $this->rgbColor(), - $number->randomFloat(1, 0, 1), + $this->numberExtension->randomFloat(1, 0, 1), ); } @@ -152,13 +153,11 @@ public function colorName(): string */ public function hslColor(): string { - $number = new Number(); - return sprintf( '%s,%s,%s', - $number->numberBetween(0, 360), - $number->numberBetween(0, 100), - $number->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 360), + $this->numberExtension->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 100), ); } @@ -169,12 +168,10 @@ public function hslColor(): string */ public function hslColorAsArray(): array { - $number = new Number(); - return [ - $number->numberBetween(0, 360), - $number->numberBetween(0, 100), - $number->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 360), + $this->numberExtension->numberBetween(0, 100), + $this->numberExtension->numberBetween(0, 100), ]; } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/Coordinates.php b/api/vendor/fakerphp/faker/src/Faker/Core/Coordinates.php index 40a26589f7..bc0678f67e 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/Coordinates.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/Coordinates.php @@ -4,10 +4,20 @@ namespace Faker\Core; -use Faker\Extension\Extension; +use Faker\Extension; -class Coordinates implements Extension +/** + * @experimental This class is experimental and does not fall under our BC promise + */ +final class Coordinates implements Extension\Extension { + private Extension\NumberExtension $numberExtension; + + public function __construct(?Extension\NumberExtension $numberExtension = null) + { + $this->numberExtension = $numberExtension ?: new Number(); + } + /** * @example '77.147489' * @@ -52,8 +62,8 @@ public function longitude(float $min = -180.0, float $max = 180.0): float public function localCoordinates(): array { return [ - 'latitude' => static::latitude(), - 'longitude' => static::longitude(), + 'latitude' => $this->latitude(), + 'longitude' => $this->longitude(), ]; } @@ -63,6 +73,6 @@ private function randomFloat(int $nbMaxDecimals, float $min, float $max): float throw new \LogicException('Invalid coordinates boundaries'); } - return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); + return $this->numberExtension->randomFloat($nbMaxDecimals, $min, $max); } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/DateTime.php b/api/vendor/fakerphp/faker/src/Faker/Core/DateTime.php index f3d7877654..6e02c6670e 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/DateTime.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/DateTime.php @@ -8,7 +8,7 @@ use Faker\Extension\Helper; /** - * @experimental + * @experimental This class is experimental and does not fall under our BC promise * * @since 1.20.0 */ @@ -19,12 +19,9 @@ final class DateTime implements DateTimeExtension, GeneratorAwareExtension /** * @var string[] */ - private $centuries = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI']; + private array $centuries = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI']; - /** - * @var string - */ - private $defaultTimezone = null; + private ?string $defaultTimezone = null; /** * Get the POSIX-timestamp of a DateTime, int or string. @@ -33,7 +30,7 @@ final class DateTime implements DateTimeExtension, GeneratorAwareExtension * * @return false|int */ - protected function getTimestamp($until = 'now') + private function getTimestamp($until = 'now') { if (is_numeric($until)) { return (int) $until; @@ -51,22 +48,12 @@ protected function getTimestamp($until = 'now') * * @param int $timestamp the UNIX / POSIX-compatible timestamp */ - protected function getTimestampDateTime(int $timestamp): \DateTime + private function getTimestampDateTime(int $timestamp): \DateTime { return new \DateTime('@' . $timestamp); } - protected function setDefaultTimezone(string $timezone = null): void - { - $this->defaultTimezone = $timezone; - } - - protected function getDefaultTimezone(): ?string - { - return $this->defaultTimezone; - } - - protected function resolveTimezone(?string $timezone): string + private function resolveTimezone(?string $timezone): string { if ($timezone !== null) { return $timezone; @@ -78,14 +65,14 @@ protected function resolveTimezone(?string $timezone): string /** * Internal method to set the timezone on a DateTime object. */ - protected function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime + private function setTimezone(\DateTime $dateTime, ?string $timezone): \DateTime { $timezone = $this->resolveTimezone($timezone); return $dateTime->setTimezone(new \DateTimeZone($timezone)); } - public function dateTime($until = 'now', string $timezone = null): \DateTime + public function dateTime($until = 'now', ?string $timezone = null): \DateTime { return $this->setTimezone( $this->getTimestampDateTime($this->unixTime($until)), @@ -93,7 +80,7 @@ public function dateTime($until = 'now', string $timezone = null): \DateTime ); } - public function dateTimeAD($until = 'now', string $timezone = null): \DateTime + public function dateTimeAD($until = 'now', ?string $timezone = null): \DateTime { $min = (PHP_INT_SIZE > 4) ? -62135597361 : -PHP_INT_MAX; @@ -103,7 +90,7 @@ public function dateTimeAD($until = 'now', string $timezone = null): \DateTime ); } - public function dateTimeBetween($from = '-30 years', $until = 'now', string $timezone = null): \DateTime + public function dateTimeBetween($from = '-30 years', $until = 'now', ?string $timezone = null): \DateTime { $start = $this->getTimestamp($from); $end = $this->getTimestamp($until); @@ -120,7 +107,7 @@ public function dateTimeBetween($from = '-30 years', $until = 'now', string $tim ); } - public function dateTimeInInterval($from = '-30 years', string $interval = '+5 days', string $timezone = null): \DateTime + public function dateTimeInInterval($from = '-30 years', string $interval = '+5 days', ?string $timezone = null): \DateTime { $intervalObject = \DateInterval::createFromDateString($interval); $datetime = $from instanceof \DateTime ? $from : new \DateTime($from); @@ -133,29 +120,29 @@ public function dateTimeInInterval($from = '-30 years', string $interval = '+5 d return $this->dateTimeBetween($begin, $end, $timezone); } - public function dateTimeThisWeek($until = 'sunday this week', string $timezone = null): \DateTime + public function dateTimeThisWeek($until = 'sunday this week', ?string $timezone = null): \DateTime { return $this->dateTimeBetween('monday this week', $until, $timezone); } - public function dateTimeThisMonth($until = 'last day of this month', string $timezone = null): \DateTime + public function dateTimeThisMonth($until = 'last day of this month', ?string $timezone = null): \DateTime { return $this->dateTimeBetween('first day of this month', $until, $timezone); } - public function dateTimeThisYear($until = 'last day of december', string $timezone = null): \DateTime + public function dateTimeThisYear($until = 'last day of december', ?string $timezone = null): \DateTime { return $this->dateTimeBetween('first day of january', $until, $timezone); } - public function dateTimeThisDecade($until = 'now', string $timezone = null): \DateTime + public function dateTimeThisDecade($until = 'now', ?string $timezone = null): \DateTime { $year = floor(date('Y') / 10) * 10; return $this->dateTimeBetween("first day of january $year", $until, $timezone); } - public function dateTimeThisCentury($until = 'now', string $timezone = null): \DateTime + public function dateTimeThisCentury($until = 'now', ?string $timezone = null): \DateTime { $year = floor(date('Y') / 100) * 100; @@ -217,7 +204,7 @@ public function century(): string return Helper::randomElement($this->centuries); } - public function timezone(string $countryCode = null): string + public function timezone(?string $countryCode = null): string { if ($countryCode) { $timezones = \DateTimeZone::listIdentifiers(\DateTimeZone::PER_COUNTRY, $countryCode); diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/File.php b/api/vendor/fakerphp/faker/src/Faker/Core/File.php index adddb0cb33..5151e900f3 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/File.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/File.php @@ -18,7 +18,7 @@ final class File implements Extension\FileExtension * * @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types */ - private $mimeTypes = [ + private array $mimeTypes = [ 'application/atom+xml' => 'atom', 'application/ecmascript' => 'ecma', 'application/emma+xml' => 'emma', diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/Number.php b/api/vendor/fakerphp/faker/src/Faker/Core/Number.php index f67c042675..4334dcfa4e 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/Number.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/Number.php @@ -21,12 +21,12 @@ public function numberBetween(int $min = 0, int $max = 2147483647): int public function randomDigit(): int { - return mt_rand(0, 9); + return $this->numberBetween(0, 9); } public function randomDigitNot(int $except): int { - $result = self::numberBetween(0, 8); + $result = $this->numberBetween(0, 8); if ($result >= $except) { ++$result; @@ -37,7 +37,7 @@ public function randomDigitNot(int $except): int public function randomDigitNotZero(): int { - return mt_rand(1, 9); + return $this->numberBetween(1, 9); } public function randomFloat(?int $nbMaxDecimals = null, float $min = 0, ?float $max = null): float @@ -60,10 +60,10 @@ public function randomFloat(?int $nbMaxDecimals = null, float $min = 0, ?float $ $max = $tmp; } - return round($min + mt_rand() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); + return round($min + $this->numberBetween() / mt_getrandmax() * ($max - $min), $nbMaxDecimals); } - public function randomNumber(int $nbDigits = null, bool $strict = false): int + public function randomNumber(?int $nbDigits = null, bool $strict = false): int { if (null === $nbDigits) { $nbDigits = $this->randomDigitNotZero(); @@ -75,9 +75,9 @@ public function randomNumber(int $nbDigits = null, bool $strict = false): int } if ($strict) { - return mt_rand(10 ** ($nbDigits - 1), $max); + return $this->numberBetween(10 ** ($nbDigits - 1), $max); } - return mt_rand(0, $max); + return $this->numberBetween(0, $max); } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/Uuid.php b/api/vendor/fakerphp/faker/src/Faker/Core/Uuid.php index 5e3b633a26..4580460448 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/Uuid.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/Uuid.php @@ -2,17 +2,26 @@ namespace Faker\Core; -use Faker\Extension\UuidExtension; +use Faker\Extension; -final class Uuid implements UuidExtension +/** + * @experimental This class is experimental and does not fall under our BC promise + */ +final class Uuid implements Extension\UuidExtension { - public function uuid3(): string + private Extension\NumberExtension $numberExtension; + + public function __construct(?Extension\NumberExtension $numberExtension = null) { - $number = new Number(); + $this->numberExtension = $numberExtension ?: new Number(); + } + + public function uuid3(): string + { // fix for compatibility with 32bit architecture; each mt_rand call is restricted to 32bit // two such calls will cause 64bits of randomness regardless of architecture - $seed = $number->numberBetween(0, 2147483647) . '#' . $number->numberBetween(0, 2147483647); + $seed = $this->numberExtension->numberBetween(0, 2147483647) . '#' . $this->numberExtension->numberBetween(0, 2147483647); // Hash the seed and convert to a byte array $val = md5($seed, true); diff --git a/api/vendor/fakerphp/faker/src/Faker/Core/Version.php b/api/vendor/fakerphp/faker/src/Faker/Core/Version.php index ce484e6ad8..7c321e00ee 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Core/Version.php +++ b/api/vendor/fakerphp/faker/src/Faker/Core/Version.php @@ -4,16 +4,25 @@ namespace Faker\Core; -use Faker\Extension\Helper; -use Faker\Extension\VersionExtension; +use Faker\Extension; use Faker\Provider\DateTime; -final class Version implements VersionExtension +/** + * @experimental This class is experimental and does not fall under our BC promise + */ +final class Version implements Extension\VersionExtension { + private Extension\NumberExtension $numberExtension; /** * @var string[] */ - private $semverCommonPreReleaseIdentifiers = ['alpha', 'beta', 'rc']; + private array $semverCommonPreReleaseIdentifiers = ['alpha', 'beta', 'rc']; + + public function __construct(?Extension\NumberExtension $numberExtension = null) + { + + $this->numberExtension = $numberExtension ?: new Number(); + } /** * Represents v2.0.0 of the semantic versioning: https://semver.org/spec/v2.0.0.html @@ -22,11 +31,11 @@ public function semver(bool $preRelease = false, bool $build = false): string { return sprintf( '%d.%d.%d%s%s', - mt_rand(0, 9), - mt_rand(0, 99), - mt_rand(0, 99), - $preRelease && mt_rand(0, 1) ? '-' . $this->semverPreReleaseIdentifier() : '', - $build && mt_rand(0, 1) ? '+' . $this->semverBuildIdentifier() : '', + $this->numberExtension->numberBetween(0, 9), + $this->numberExtension->numberBetween(0, 99), + $this->numberExtension->numberBetween(0, 99), + $preRelease && $this->numberExtension->numberBetween(0, 1) === 1 ? '-' . $this->semverPreReleaseIdentifier() : '', + $build && $this->numberExtension->numberBetween(0, 1) === 1 ? '+' . $this->semverBuildIdentifier() : '', ); } @@ -35,13 +44,13 @@ public function semver(bool $preRelease = false, bool $build = false): string */ private function semverPreReleaseIdentifier(): string { - $ident = Helper::randomElement($this->semverCommonPreReleaseIdentifiers); + $ident = Extension\Helper::randomElement($this->semverCommonPreReleaseIdentifiers); - if (!mt_rand(0, 1)) { + if ($this->numberExtension->numberBetween(0, 1) !== 1) { return $ident; } - return $ident . '.' . mt_rand(1, 99); + return $ident . '.' . $this->numberExtension->numberBetween(1, 99); } /** @@ -49,9 +58,9 @@ private function semverPreReleaseIdentifier(): string */ private function semverBuildIdentifier(): string { - if (mt_rand(0, 1)) { + if ($this->numberExtension->numberBetween(0, 1) === 1) { // short git revision syntax: https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection - return substr(sha1(Helper::lexify('??????')), 0, 7); + return substr(sha1(Extension\Helper::lexify('??????')), 0, 7); } // date syntax diff --git a/api/vendor/fakerphp/faker/src/Faker/Extension/DateTimeExtension.php b/api/vendor/fakerphp/faker/src/Faker/Extension/DateTimeExtension.php index 9a27cce0e7..b7c76ba4b6 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Extension/DateTimeExtension.php +++ b/api/vendor/fakerphp/faker/src/Faker/Extension/DateTimeExtension.php @@ -25,7 +25,7 @@ interface DateTimeExtension * * @example DateTime('2005-08-16 20:39:21') */ - public function dateTime($until = 'now', string $timezone = null): \DateTime; + public function dateTime($until = 'now', ?string $timezone = null): \DateTime; /** * Get a DateTime object for a date between January 1, 0001, and now. @@ -38,7 +38,7 @@ public function dateTime($until = 'now', string $timezone = null): \DateTime; * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeAD($until = 'now', string $timezone = null): \DateTime; + public function dateTimeAD($until = 'now', ?string $timezone = null): \DateTime; /** * Get a DateTime object a random date between `$from` and `$until`. @@ -52,7 +52,7 @@ public function dateTimeAD($until = 'now', string $timezone = null): \DateTime; * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeBetween($from = '-30 years', $until = 'now', string $timezone = null): \DateTime; + public function dateTimeBetween($from = '-30 years', $until = 'now', ?string $timezone = null): \DateTime; /** * Get a DateTime object based on a random date between `$from` and an interval. @@ -66,7 +66,7 @@ public function dateTimeBetween($from = '-30 years', $until = 'now', string $tim * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeInInterval($from = '-30 years', string $interval = '+5 days', string $timezone = null): \DateTime; + public function dateTimeInInterval($from = '-30 years', string $interval = '+5 days', ?string $timezone = null): \DateTime; /** * Get a date time object somewhere inside the current week. @@ -78,7 +78,7 @@ public function dateTimeInInterval($from = '-30 years', string $interval = '+5 d * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeThisWeek($until = 'now', string $timezone = null): \DateTime; + public function dateTimeThisWeek($until = 'now', ?string $timezone = null): \DateTime; /** * Get a date time object somewhere inside the current month. @@ -90,7 +90,7 @@ public function dateTimeThisWeek($until = 'now', string $timezone = null): \Date * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeThisMonth($until = 'now', string $timezone = null): \DateTime; + public function dateTimeThisMonth($until = 'now', ?string $timezone = null): \DateTime; /** * Get a date time object somewhere inside the current year. @@ -102,7 +102,7 @@ public function dateTimeThisMonth($until = 'now', string $timezone = null): \Dat * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeThisYear($until = 'now', string $timezone = null): \DateTime; + public function dateTimeThisYear($until = 'now', ?string $timezone = null): \DateTime; /** * Get a date time object somewhere inside the current decade. @@ -114,7 +114,7 @@ public function dateTimeThisYear($until = 'now', string $timezone = null): \Date * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeThisDecade($until = 'now', string $timezone = null): \DateTime; + public function dateTimeThisDecade($until = 'now', ?string $timezone = null): \DateTime; /** * Get a date time object somewhere inside the current century. @@ -126,7 +126,7 @@ public function dateTimeThisDecade($until = 'now', string $timezone = null): \Da * @see http://php.net/manual/en/timezones.php * @see http://php.net/manual/en/function.date-default-timezone-get.php */ - public function dateTimeThisCentury($until = 'now', string $timezone = null): \DateTime; + public function dateTimeThisCentury($until = 'now', ?string $timezone = null): \DateTime; /** * Get a date string between January 1, 1970, and `$until`. @@ -238,5 +238,5 @@ public function century(): string; * * @example 'Europe/Rome' */ - public function timezone(string $countryCode = null): string; + public function timezone(?string $countryCode = null): string; } diff --git a/api/vendor/fakerphp/faker/src/Faker/Extension/Helper.php b/api/vendor/fakerphp/faker/src/Faker/Extension/Helper.php index 27a66143fe..47200e90c6 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Extension/Helper.php +++ b/api/vendor/fakerphp/faker/src/Faker/Extension/Helper.php @@ -83,10 +83,10 @@ public static function lexify(string $string): string public static function bothify(string $string): string { $string = self::replaceWildcard($string, '*', static function () { - return mt_rand(0, 1) ? '#' : '?'; + return mt_rand(0, 1) === 1 ? '#' : '?'; }); - return static::lexify(static::numerify($string)); + return self::lexify(self::numerify($string)); } private static function replaceWildcard(string $string, string $wildcard, callable $callback): string diff --git a/api/vendor/fakerphp/faker/src/Faker/Factory.php b/api/vendor/fakerphp/faker/src/Faker/Factory.php index 7d29de75b2..e9d201432d 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Factory.php +++ b/api/vendor/fakerphp/faker/src/Faker/Factory.php @@ -38,10 +38,12 @@ protected static function getProviderClassname($provider, $locale = '') if ($providerClass = self::findProviderClassname($provider, $locale)) { return $providerClass; } + // fallback to default locale if ($providerClass = self::findProviderClassname($provider, static::DEFAULT_LOCALE)) { return $providerClass; } + // fallback to no locale if ($providerClass = self::findProviderClassname($provider)) { return $providerClass; diff --git a/api/vendor/fakerphp/faker/src/Faker/Generator.php b/api/vendor/fakerphp/faker/src/Faker/Generator.php index ec77c08749..d1320312b1 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Generator.php +++ b/api/vendor/fakerphp/faker/src/Faker/Generator.php @@ -275,11 +275,11 @@ * * @property string $imageUrl * - * @method string imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false) + * @method string imageUrl($width = 640, $height = 480, $category = null, $randomize = true, $word = null, $gray = false, string $format = 'png') * * @property string $image * - * @method string image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null, $gray = false) + * @method string image($dir = null, $width = 640, $height = 480, $category = null, $fullPath = true, $randomize = true, $word = null, $gray = false, string $format = 'png') * * @property string $email * @@ -463,7 +463,7 @@ * * @property string $lastName * - * @method string lastName() + * @method string lastName($gender = null) * * @property string $title * @@ -565,9 +565,9 @@ class Generator */ private $uniqueGenerator; - public function __construct(ContainerInterface $container = null) + public function __construct(?ContainerInterface $container = null) { - $this->container = $container ?: Container\ContainerBuilder::getDefault(); + $this->container = $container ?: Container\ContainerBuilder::withDefaultExtensions()->build(); } /** @@ -687,10 +687,22 @@ public function seed($seed = null) if ($seed === null) { mt_srand(); } else { - mt_srand((int) $seed, MT_RAND_PHP); + mt_srand((int) $seed, self::mode()); } } + /** + * @see https://www.php.net/manual/en/migration83.deprecated.php#migration83.deprecated.random + */ + private static function mode(): int + { + if (PHP_VERSION_ID < 80300) { + return MT_RAND_PHP; + } + + return MT_RAND_MT19937; + } + public function format($format, $arguments = []) { return call_user_func_array($this->getFormatter($format), $arguments); diff --git a/api/vendor/fakerphp/faker/src/Faker/Guesser/Name.php b/api/vendor/fakerphp/faker/src/Faker/Guesser/Name.php index ddb048bcf5..1f98c4f810 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Guesser/Name.php +++ b/api/vendor/fakerphp/faker/src/Faker/Guesser/Name.php @@ -26,37 +26,37 @@ public function guessFormat($name, $size = null) if (preg_match('/^is[_A-Z]/', $name)) { return static function () use ($generator) { - return $generator->boolean; + return $generator->boolean(); }; } if (preg_match('/(_a|A)t$/', $name)) { return static function () use ($generator) { - return $generator->dateTime; + return $generator->dateTime(); }; } switch (str_replace('_', '', $name)) { case 'firstname': return static function () use ($generator) { - return $generator->firstName; + return $generator->firstName(); }; case 'lastname': return static function () use ($generator) { - return $generator->lastName; + return $generator->lastName(); }; case 'username': case 'login': return static function () use ($generator) { - return $generator->userName; + return $generator->userName(); }; case 'email': case 'emailaddress': return static function () use ($generator) { - return $generator->email; + return $generator->email(); }; case 'phonenumber': @@ -64,68 +64,68 @@ public function guessFormat($name, $size = null) case 'telephone': case 'telnumber': return static function () use ($generator) { - return $generator->phoneNumber; + return $generator->phoneNumber(); }; case 'address': return static function () use ($generator) { - return $generator->address; + return $generator->address(); }; case 'city': case 'town': return static function () use ($generator) { - return $generator->city; + return $generator->city(); }; case 'streetaddress': return static function () use ($generator) { - return $generator->streetAddress; + return $generator->streetAddress(); }; case 'postcode': case 'zipcode': return static function () use ($generator) { - return $generator->postcode; + return $generator->postcode(); }; case 'state': return static function () use ($generator) { - return $generator->state; + return $generator->state(); }; case 'county': if ($this->generator->locale == 'en_US') { return static function () use ($generator) { - return sprintf('%s County', $generator->city); + return sprintf('%s County', $generator->city()); }; } return static function () use ($generator) { - return $generator->state; + return $generator->state(); }; case 'country': switch ($size) { case 2: return static function () use ($generator) { - return $generator->countryCode; + return $generator->countryCode(); }; case 3: return static function () use ($generator) { - return $generator->countryISOAlpha3; + return $generator->countryISOAlpha3(); }; case 5: case 6: return static function () use ($generator) { - return $generator->locale; + return $generator->locale(); }; default: return static function () use ($generator) { - return $generator->country; + return $generator->country(); }; } @@ -133,37 +133,37 @@ public function guessFormat($name, $size = null) case 'locale': return static function () use ($generator) { - return $generator->locale; + return $generator->locale(); }; case 'currency': case 'currencycode': return static function () use ($generator) { - return $generator->currencyCode; + return $generator->currencyCode(); }; case 'url': case 'website': return static function () use ($generator) { - return $generator->url; + return $generator->url(); }; case 'company': case 'companyname': case 'employer': return static function () use ($generator) { - return $generator->company; + return $generator->company(); }; case 'title': if ($size !== null && $size <= 10) { return static function () use ($generator) { - return $generator->title; + return $generator->title(); }; } return static function () use ($generator) { - return $generator->sentence; + return $generator->sentence(); }; case 'body': @@ -171,7 +171,7 @@ public function guessFormat($name, $size = null) case 'article': case 'description': return static function () use ($generator) { - return $generator->text; + return $generator->text(); }; } diff --git a/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php b/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php index 3267fe469b..024d8a9d9b 100644 --- a/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php +++ b/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/ColumnTypeGuesser.php @@ -27,7 +27,7 @@ public function guessFormat($fieldName, ClassMetadata $class) switch ($type) { case 'boolean': return static function () use ($generator) { - return $generator->boolean; + return $generator->boolean(); }; case 'decimal': @@ -66,14 +66,14 @@ public function guessFormat($fieldName, ClassMetadata $class) case 'text': return static function () use ($generator) { - return $generator->text; + return $generator->text(); }; case 'datetime': case 'date': case 'time': return static function () use ($generator) { - return $generator->datetime; + return $generator->datetime(); }; case 'datetime_immutable': diff --git a/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/Populator.php b/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/Populator.php index 1bce6ab47c..61d4171e95 100644 --- a/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/Populator.php +++ b/api/vendor/fakerphp/faker/src/Faker/ORM/Doctrine/Populator.php @@ -48,7 +48,7 @@ class Populator * * @param int $batchSize */ - public function __construct(Generator $generator, ObjectManager $manager = null, $batchSize = 1000) + public function __construct(Generator $generator, ?ObjectManager $manager = null, $batchSize = 1000) { $this->generator = $generator; $this->manager = $manager; diff --git a/api/vendor/fakerphp/faker/src/Faker/ORM/Spot/Populator.php b/api/vendor/fakerphp/faker/src/Faker/ORM/Spot/Populator.php index b321f5c5a4..9ad3bfb621 100644 --- a/api/vendor/fakerphp/faker/src/Faker/ORM/Spot/Populator.php +++ b/api/vendor/fakerphp/faker/src/Faker/ORM/Spot/Populator.php @@ -17,7 +17,7 @@ class Populator /** * Populator constructor. */ - public function __construct(\Faker\Generator $generator, Locator $locator = null) + public function __construct(\Faker\Generator $generator, ?Locator $locator = null) { $this->generator = $generator; $this->locator = $locator; diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/Base.php b/api/vendor/fakerphp/faker/src/Faker/Provider/Base.php index e3713ce0e6..6b9876bc1d 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/Base.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/Base.php @@ -179,67 +179,115 @@ public static function randomAscii() /** * Returns randomly ordered subsequence of $count elements from a provided array * - * @param array $array Array to take elements from. Defaults to a-c - * @param int $count Number of elements to take. - * @param bool $allowDuplicates Allow elements to be picked several times. Defaults to false + * @todo update default $count to `null` (BC) for next major version * - * @throws \LengthException When requesting more elements than provided + * @param array|class-string|\Traversable $array Array to take elements from. Defaults to a-c + * @param int|null $count Number of elements to take. If `null` then returns random number of elements + * @param bool $allowDuplicates Allow elements to be picked several times. Defaults to false + * + * @throws \InvalidArgumentException + * @throws \LengthException When requesting more elements than provided * * @return array New array with $count elements from $array */ public static function randomElements($array = ['a', 'b', 'c'], $count = 1, $allowDuplicates = false) { - $traversables = []; + $elements = $array; + + if (is_string($array) && function_exists('enum_exists') && enum_exists($array)) { + $elements = $array::cases(); + } if ($array instanceof \Traversable) { - foreach ($array as $element) { - $traversables[] = $element; - } + $elements = \iterator_to_array($array, false); + } + + if (!is_array($elements)) { + throw new \InvalidArgumentException(sprintf( + 'Argument for parameter $array needs to be array, an instance of %s, or an instance of %s, got %s instead.', + \UnitEnum::class, + \Traversable::class, + is_object($array) ? get_class($array) : gettype($array), + )); } - $arr = count($traversables) ? $traversables : $array; + $numberOfElements = count($elements); - $allKeys = array_keys($arr); - $numKeys = count($allKeys); + if (!$allowDuplicates && null !== $count && $numberOfElements < $count) { + throw new \LengthException(sprintf( + 'Cannot get %d elements, only %d in array', + $count, + $numberOfElements, + )); + } - if (!$allowDuplicates && $numKeys < $count) { - throw new \LengthException(sprintf('Cannot get %d elements, only %d in array', $count, $numKeys)); + if (null === $count) { + $count = mt_rand(1, $numberOfElements); } - $highKey = $numKeys - 1; - $keys = $elements = []; - $numElements = 0; + $randomElements = []; + + $keys = array_keys($elements); + $maxIndex = $numberOfElements - 1; + $elementHasBeenSelectedAlready = []; + $numberOfRandomElements = 0; - while ($numElements < $count) { - $num = mt_rand(0, $highKey); + while ($numberOfRandomElements < $count) { + $index = mt_rand(0, $maxIndex); if (!$allowDuplicates) { - if (isset($keys[$num])) { + if (isset($elementHasBeenSelectedAlready[$index])) { continue; } - $keys[$num] = true; + + $elementHasBeenSelectedAlready[$index] = true; } - $elements[] = $arr[$allKeys[$num]]; - ++$numElements; + $key = $keys[$index]; + + $randomElements[] = $elements[$key]; + + ++$numberOfRandomElements; } - return $elements; + return $randomElements; } /** * Returns a random element from a passed array * - * @param array $array + * @param array|class-string|\Traversable $array + * + * @throws \InvalidArgumentException */ public static function randomElement($array = ['a', 'b', 'c']) { - if (!$array || ($array instanceof \Traversable && !count($array))) { + $elements = $array; + + if (is_string($array) && function_exists('enum_exists') && enum_exists($array)) { + $elements = $array::cases(); + } + + if ($array instanceof \Traversable) { + $elements = iterator_to_array($array, false); + } + + if ($elements === []) { return null; } - $elements = static::randomElements($array, 1); - return $elements[0]; + if (!is_array($elements)) { + throw new \InvalidArgumentException(sprintf( + 'Argument for parameter $array needs to be array, an instance of %s, or an instance of %s, got %s instead.', + \UnitEnum::class, + \Traversable::class, + is_object($array) ? get_class($array) : gettype($array), + )); + } + + $randomElements = static::randomElements($elements, 1); + + return $randomElements[0]; } /** @@ -443,7 +491,7 @@ public static function lexify($string = '????') public static function bothify($string = '## ??') { $string = self::replaceWildcard($string, '*', static function () { - return mt_rand(0, 1) ? '#' : '?'; + return mt_rand(0, 1) === 1 ? '#' : '?'; }); return static::lexify(static::numerify($string)); @@ -528,6 +576,7 @@ public static function regexify($regex = '') // remove backslashes (that are not followed by another backslash) because they are escape characters $match = preg_replace('/\\\(?!\\\)/', '', $matches[1]); $randomElement = Base::randomElement(str_split($match)); + //[.] should not be a random character, but a literal . return str_replace('.', '\.', $randomElement); }, $regex); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/DateTime.php b/api/vendor/fakerphp/faker/src/Faker/Provider/DateTime.php index 46c3c90fec..a8a199252d 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/DateTime.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/DateTime.php @@ -334,9 +334,15 @@ public static function century() * * @example 'Europe/Paris' */ - public static function timezone() + public static function timezone(?string $countryCode = null) { - return static::randomElement(\DateTimeZone::listIdentifiers()); + if ($countryCode) { + $timezones = \DateTimeZone::listIdentifiers(\DateTimeZone::PER_COUNTRY, $countryCode); + } else { + $timezones = \DateTimeZone::listIdentifiers(); + } + + return static::randomElement($timezones); } /** diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/Image.php b/api/vendor/fakerphp/faker/src/Faker/Provider/Image.php index 53f28dfcfa..e787142178 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/Image.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/Image.php @@ -123,6 +123,7 @@ public static function image( ); $dir = null === $dir ? sys_get_temp_dir() : $dir; // GNU/Linux / OS X / Windows compatible + // Validate directory path if (!is_dir($dir) || !is_writable($dir)) { throw new \InvalidArgumentException(sprintf('Cannot write to directory "%s"', $dir)); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php b/api/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php index a55144a586..2cfb70ea7c 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php @@ -184,7 +184,15 @@ public static function text($maxNbChars = 200) throw new \InvalidArgumentException('text() can only generate text of at least 5 characters'); } - $type = ($maxNbChars < 25) ? 'word' : (($maxNbChars < 100) ? 'sentence' : 'paragraph'); + $type = 'paragraph'; + + if ($maxNbChars < 100) { + $type = 'sentence'; + } + + if ($maxNbChars < 25) { + $type = 'word'; + } $text = []; diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/Miscellaneous.php b/api/vendor/fakerphp/faker/src/Faker/Provider/Miscellaneous.php index 91d992ec40..354f67bb3a 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/Miscellaneous.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/Miscellaneous.php @@ -202,11 +202,12 @@ class Miscellaneous extends Base /** * @see https://en.wikipedia.org/wiki/ISO_4217 - * On date of 2019-09-27 + * On date of 2023-01-01 * * With the following exceptions: * SVC has been replaced by the USD in 2001: https://en.wikipedia.org/wiki/Salvadoran_col%C3%B3n * ZWL has been suspended since 2009: https://en.wikipedia.org/wiki/Zimbabwean_dollar + * HRK has been replaced by EUR since 2023: https://en.wikipedia.org/wiki/Croatian_kuna */ protected static $currencyCode = [ 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AWG', 'AZN', @@ -214,17 +215,17 @@ class Miscellaneous extends Base 'BSD', 'BTN', 'BWP', 'BYN', 'BZD', 'CAD', 'CDF', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'EUR', 'FJD', 'FKP', 'GBP', 'GEL', 'GHS', 'GIP', - 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', - 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', - 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', - 'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', - 'MRU', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', - 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', - 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', - 'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STN', 'SYP', 'SZL', - 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', - 'UGX', 'USD', 'UYU', 'UZS', 'VES', 'VND', 'VUV', 'WST', 'XAF', 'XCD', - 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW', + 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HTG', 'HUF', 'IDR', 'ILS', + 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', + 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', + 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRU', + 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', + 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', + 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', + 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STN', 'SYP', 'SZL', 'THB', + 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', + 'USD', 'UYU', 'UZS', 'VES', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', + 'XPF', 'YER', 'ZAR', 'ZMW', ]; /** diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Address.php b/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Address.php index 8fe73f50c6..87facaaf03 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Address.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Address.php @@ -84,35 +84,35 @@ class Address extends \Faker\Provider\Address /** * @see https://ar.wikipedia.org/wiki/%D9%82%D8%A7%D8%A6%D9%85%D8%A9_%D9%85%D8%AD%D8%A7%D9%81%D8%B8%D8%A7%D8%AA_%D9%85%D8%B5%D8%B1 + * @see https://ar.wikipedia.org/wiki/%D8%A8%D8%B7%D8%A7%D9%82%D8%A9_%D8%A7%D9%84%D8%B1%D9%82%D9%85_%D8%A7%D9%84%D9%82%D9%88%D9%85%D9%8A_%D8%A7%D9%84%D9%85%D8%B5%D8%B1%D9%8A%D8%A9 */ protected static $governorates = [ - 'الإسكندرية', - 'الإسماعيلية', - 'أسوان', - 'أسيوط', - 'الأقصر', - 'البحر الأحمر', - 'البحيرة', - 'بني سويف', - 'بورسعيد', - 'جنوب سيناء', - 'الجيزة', - 'الدقهلية', - 'دمياط', - 'سوهاج', - 'السويس', - 'الشرقية', - 'شمال سيناء', - 'الغربية', - 'الفيوم', - 'القاهرة', - 'القليوبية', - 'قنا', - 'كفر الشيخ', - 'مطروح', - 'المنوفية', - 'المنيا', - 'الوادي الجديد', + 'الإسكندرية' => '02', + 'الإسماعيلية' => '19', + 'أسوان' => '28', + 'أسيوط' => '25', + 'الأقصر' => '29', + 'البحر الأحمر' => '31', + 'البحيرة' => '18', + 'بني سويف' => '22', + 'بورسعيد' => '03', + 'جنوب سيناء' => '35', + 'القاهرة' => '01', + 'الدقهلية' => '12', + 'دمياط' => '11', + 'سوهاج' => '26', + 'السويس' => '04', + 'الشرقية' => '13', + 'شمال سيناء' => '34', + 'الغربية' => '16', + 'الفيوم' => '23', + 'القليوبية' => '14', + 'قنا' => '27', + 'كفر الشيخ' => '15', + 'مطروح' => '33', + 'المنوفية' => '17', + 'المنيا' => '24', + 'الوادي الجديد' => '32', ]; protected static $buildingNumber = ['%####', '%###', '%#']; @@ -201,6 +201,16 @@ public static function secondaryAddress() * @example 'الإسكندرية' */ public static function governorate() + { + return static::randomKey(static::$governorates); + } + + /** + * @example '01' + * + * @return string + */ + public static function governorateId() { return static::randomElement(static::$governorates); } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Person.php index 76f6f79e66..f6e0b15c14 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/ar_EG/Person.php @@ -2,8 +2,6 @@ namespace Faker\Provider\ar_EG; -use Faker\Calculator\Luhn; - class Person extends \Faker\Provider\Person { protected static $maleNameFormats = [ @@ -29,7 +27,7 @@ class Person extends \Faker\Provider\Person 'حاتم', 'حازم', 'حافظ', 'حامد', 'حبيب', 'حسام', 'حسان', 'حسن', 'حسني', 'حسين', 'حمدان', 'حمدي', 'حمزة', 'حميد', 'خالد', 'خضر', 'خلف', 'خليفة', 'خليل', 'خميس', 'داوود', 'دياب', 'رأفت', 'رؤوف', 'رائد', 'رائف', 'راجح', 'راجي', 'راشد', 'راضي', 'راغب', 'رافت', 'راكان', 'رامز', 'رامي', 'ربيع', 'رجب', 'رزق', 'رشاد', 'رشيد', 'رضا', 'رضوان', 'رياض', 'ريان', 'زاهر', 'زاهي', 'زايد', 'زكريا', 'زمام', 'زهير', 'زياد', 'زيد', 'زيدان', 'زين', 'سالم', 'سامح', 'سامر', 'سامي', 'سعد', 'سعيد', 'سلام', 'سلطان', 'سلمان', 'سليم', 'سليمان', 'سمعان', 'سميح', 'سنان', 'سند', - 'سيف', 'شادي', 'شاكر', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرغام', 'ضياء', 'ضياء الدين’, ', 'طارق', 'طالب', 'طاهر', 'طه', 'عادل', 'عاصم', 'عاطف', + 'سيف', 'شادي', 'شاكر', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرغام', 'ضياء', 'ضياء الدين', 'طارق', 'طالب', 'طاهر', 'طه', 'عادل', 'عاصم', 'عاطف', 'عبيدة', 'عثمان', 'عدلي', 'عدنان', 'عزت', 'عصام', 'علاء', 'علي', 'عماد', 'عمار', 'عمر', 'عمرو', 'عنان', 'عواد', 'عوض', 'عوف', 'عوني', 'عيد', 'عيسى', 'غازي', 'غسان', 'غيث', 'فؤاد', 'فادي', 'فارس', 'فاروق', 'فاضل', 'فايز', 'فتحي', 'فراس', 'فرح', 'فريد', 'فهد', 'فهمي', 'فوزي', 'فيصل', 'قارس', 'قاسم', 'قيس', 'كامل', 'كرم', 'كريم', 'كمال', 'لؤي', 'لبيب', 'لطفي', 'ليث', 'مأمون', @@ -80,16 +78,30 @@ public static function prefix() } /** + * @see https://ar.wikipedia.org/wiki/%D8%A8%D8%B7%D8%A7%D9%82%D8%A9_%D8%A7%D9%84%D8%B1%D9%82%D9%85_%D8%A7%D9%84%D9%82%D9%88%D9%85%D9%8A_%D8%A7%D9%84%D9%85%D8%B5%D8%B1%D9%8A%D8%A9 + * * @example 27512310101010 + * + * @return string */ - public static function nationalIdNumber() + public static function nationalIdNumber($gender = null) { - $timestamp = self::numberBetween(1, time()); + $randomBirthDateTimestamp = mt_rand(strtotime('1950-Jan-10'), strtotime('2005-Dec-25')); + + $centuryId = ((int) date('Y', $randomBirthDateTimestamp)) >= 2000 ? 3 : 2; + $fullBirthDate = date('ymd', $randomBirthDateTimestamp); + $governorateId = Address::governorateId(); + $birthRegistrationSequence = mt_rand(1, 500); - $date = explode(':', date('y:m:d', $timestamp)); + if ($gender === static::GENDER_MALE) { + $birthRegistrationSequence = $birthRegistrationSequence | 1; // Convert to the nearest odd number + } elseif ($gender === static::GENDER_FEMALE) { + $birthRegistrationSequence = $birthRegistrationSequence & ~1; // Convert to the nearest even number + } - $partialValue = static::numerify(2 . $date[0] . $date[1] . $date[2] . str_repeat('#', 6)); + $birthRegistrationSequence = str_pad((string) $birthRegistrationSequence, 4, '0', STR_PAD_LEFT); + $randomCheckDigit = mt_rand(1, 9); - return Luhn::generateLuhnNumber($partialValue); + return $centuryId . $fullBirthDate . $governorateId . $birthRegistrationSequence . $randomCheckDigit; } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Person.php index 505c8640c4..91527c39ae 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/ar_SA/Person.php @@ -36,7 +36,7 @@ class Person extends \Faker\Provider\Person 'جواد', 'حابس', 'حاتم', 'حارث', 'حازم', 'حافظ', 'حاكم', 'حامد', 'حبيب', 'حذيفة', 'حسام', 'حسان', 'حسن', 'حسني', 'حسين', 'حكم', 'حمد', 'حمدالله', 'حمدان', 'حمدي', 'حمزة', 'حمود', 'حميد', 'خالد', 'خضر', 'خلدون', 'خلف', 'خليفة', 'خليل', 'خميس', 'داوود', 'ذياب', 'ذيب', 'رأفت', 'رؤوف', 'رئاد', 'رائد', 'رائف', 'راجح', 'راجي', 'راشد', 'راضي', 'راغب', 'رافت', 'رافع', 'رافي', 'راكان', 'رامان', 'رامز', 'رامي', 'رامين', 'ربيع', 'رجا', 'رجائي', 'رجب', 'رداد', 'رزق', 'رسلان', 'رشاد', 'رشيد', 'رضا', 'رضوان', 'رعد', 'رغد', 'رغيد', 'ركان', 'رماح', 'رياض', 'ريان', 'زاهر', 'زاهي', 'زايد', 'زكريا', 'زمام', 'زهير', 'زياد', 'زيد', 'زيدان', 'زيدون', 'زين', 'زين العابدين', 'سائد', 'ساري', 'سالم', 'سامح', 'سامر', 'سامي', 'ساهر', 'سدير', 'سرمد', 'سري', 'سعد', 'سعود', 'سعيد', 'سفيان', 'سكوت', 'سلام', 'سلطان', 'سلمان', 'سليم', 'سليمان', 'سمعان', 'سميح', 'سنان', 'سند', 'سهل', 'سهم', - 'سيف', 'شادي', 'شافع', 'شاكر', 'شامل', 'شاهر', 'شرحبيل', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صخر', 'صدام', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرار', 'ضرغام', 'ضياء', 'ضياء الدين’, ', 'طارق', 'طالب', 'طاهر', 'طلال', 'طه', 'عادل', 'عاصم', 'عاطف', + 'سيف', 'شادي', 'شافع', 'شاكر', 'شامل', 'شاهر', 'شرحبيل', 'شريف', 'شهاب', 'شهم', 'شوان', 'صادق', 'صافي', 'صالح', 'صخر', 'صدام', 'صفاء', 'صفوان', 'صقر', 'صلاح', 'صلاح الدين', 'صهيب', 'ضرار', 'ضرغام', 'ضياء', 'ضياء الدين', 'طارق', 'طالب', 'طاهر', 'طلال', 'طه', 'عادل', 'عاصم', 'عاطف', 'عامر', 'عايد', 'عبادة', 'عباس', 'عبد الباري', 'عبد الحافظ', 'عبد الحكيم', 'عبد الحليم', 'عبد الحميد', 'عبد الحي', 'عبد الرحمان', 'عبد الرحمن', 'عبد الرحيم', 'عبد الرزاق', 'عبد السلام', 'عبد السميع', 'عبد العزيز', 'عبد العفو', 'عبد الغني', 'عبد الفتاح', 'عبد القادر', 'عبد الكريم', 'عبد اللطيف', 'عبد الله', 'عبد المجيد', 'عبد المولى', 'عبد الناصر', 'عبد الهادي', 'عبد ربه', 'عبداالله', 'عبدالاله', 'عبدالباسط', 'عبدالجليل', 'عبدالجواد', 'عبدالحليم', 'عبدالحميد', 'عبدالرؤوف', 'عبدالرحمن', 'عبدالرحيم', 'عبدالرزاق', 'عبدالسلام', 'عبدالعزيز', 'عبدالفتاح', 'عبدالقادر', 'عبدالكريم', 'عبداللطيف', 'عبدالله', 'عبدالمجيد', 'عبدالمطلب', 'عبدالمعطي', 'عبدالمهيمن', 'عبدالناصر', 'عبدالهادي', 'عبدالوهاب', 'عبيدالله', 'عبيدة', 'عتيبه', 'عثمان', 'عدب', 'عدلي', 'عدنان', 'عدوان', 'عدي', 'عرار', 'عرمان', 'عروة', 'عريق', 'عرين', 'عز الدين', 'عزالدين', 'عزام', 'عزت', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/Person.php index 6e2bab1375..f0bca49e0b 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/cs_CZ/Person.php @@ -28,7 +28,7 @@ class Person extends \Faker\Provider\Person protected static $firstNameMale = [ 'Adam', 'Aleš', 'Alois', 'Antonín', 'Bohumil', 'Bohuslav', 'Dagmar', 'Dalibor', 'Daniel', 'David', 'Dominik', 'Dušan', 'Eduard', 'Emil', - 'Filip', 'František', 'Ilona', 'Ivan', 'Ivo', 'Jakub', 'Jan', 'Ján', + 'Filip', 'František', 'Igor', 'Ivan', 'Ivo', 'Jakub', 'Jan', 'Ján', 'Jaromír', 'Jaroslav', 'Jindřich', 'Jiří', 'Josef', 'Jozef', 'Kamil', 'Karel', 'Kryštof', 'Ladislav', 'Libor', 'Lubomír', 'Luboš', 'Luděk', 'Ludvík', 'Lukáš', 'Marcel', 'Marek', 'Martin', 'Matěj', 'Matyáš', @@ -438,8 +438,8 @@ public function birthNumber($gender = null, $minAge = 0, $maxAge = 100, $slashPr $gender = $this->generator->boolean() ? static::GENDER_MALE : static::GENDER_FEMALE; } - $startTimestamp = strtotime("-${maxAge} year"); - $endTimestamp = strtotime("-${minAge} year"); + $startTimestamp = strtotime(sprintf('-%d year', $maxAge)); + $endTimestamp = strtotime(sprintf('-%d year', $minAge)); $randTimestamp = self::numberBetween($startTimestamp, $endTimestamp); $year = (int) (date('Y', $randTimestamp)); @@ -451,6 +451,7 @@ public function birthNumber($gender = null, $minAge = 0, $maxAge = 100, $slashPr if ($gender == static::GENDER_FEMALE) { $month += 50; } + // from year 2004 everyone has +20 to month when birth numbers in one day are exhausted if ($year >= 2004 && $this->generator->boolean(10)) { $month += 20; diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/da_DK/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/da_DK/Person.php index fa1e89c6c9..732afeb218 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/da_DK/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/da_DK/Person.php @@ -36,7 +36,7 @@ class Person extends \Faker\Provider\Person * @var array Danish first names. */ protected static $firstNameMale = [ - 'Aage', 'Adam', 'Adolf', 'Ahmad', 'Ahmed', 'Aksel', 'Albert', 'Alex', 'Alexander', 'Alf', 'Alfred', 'Ali', 'Allan', + 'Aage', 'Adam', 'Ahmad', 'Ahmed', 'Aksel', 'Albert', 'Alex', 'Alexander', 'Alf', 'Alfred', 'Ali', 'Allan', 'Anders', 'Andreas', 'Anker', 'Anton', 'Arne', 'Arnold', 'Arthur', 'Asbjørn', 'Asger', 'August', 'Axel', 'Benjamin', 'Benny', 'Bent', 'Bernhard', 'Birger', 'Bjarne', 'Bjørn', 'Bo', 'Brian', 'Bruno', 'Børge', 'Carl', 'Carlo', 'Carsten', 'Casper', 'Charles', 'Chris', 'Christian', 'Christoffer', 'Christopher', 'Claus', 'Dan', 'Daniel', 'David', 'Dennis', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/de_AT/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/de_AT/Person.php index 964b8b7d31..248952ff30 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/de_AT/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/de_AT/Person.php @@ -127,7 +127,7 @@ public static function suffix() * * @return string */ - public static function ssn(\DateTime $birthdate = null) + public static function ssn(?\DateTime $birthdate = null) { $birthdate = $birthdate ?? DateTime::dateTimeThisCentury(); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/de_CH/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/de_CH/Person.php index 9910b12726..d3ead307da 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/de_CH/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/de_CH/Person.php @@ -8,7 +8,7 @@ class Person extends \Faker\Provider\de_DE\Person * @see http://www.bfs.admin.ch/bfs/portal/de/index/themen/01/02/blank/dos/prenoms/02.html */ protected static $firstNameMale = [ - 'Adolf', 'Adrian', 'Alain', 'Albert', 'Alessandro', 'Alex', 'Alexander', 'Alfred', 'Ali', 'Alois', 'Andrea', 'Andreas', 'Andrin', 'André', 'Angelo', 'Anton', 'Antonio', 'Armin', 'Arnold', 'Arthur', + 'Adrian', 'Alain', 'Albert', 'Alessandro', 'Alex', 'Alexander', 'Alfred', 'Ali', 'Alois', 'Andrea', 'Andreas', 'Andrin', 'André', 'Angelo', 'Anton', 'Antonio', 'Armin', 'Arnold', 'Arthur', 'Beat', 'Benjamin', 'Bernhard', 'Bruno', 'Carlo', 'Carlos', 'Christian', 'Christoph', 'Claudio', 'Cyrill', 'Cédric', 'Damian', 'Daniel', 'Dario', 'David', 'Denis', 'Diego', 'Dieter', 'Dominic', 'Dominik', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/de_DE/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/de_DE/Person.php index 45a0c2e6f9..44f205e062 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/de_DE/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/de_DE/Person.php @@ -31,7 +31,7 @@ class Person extends \Faker\Provider\Person * {@link} From https://de.wiktionary.org/wiki/Verzeichnis:Deutsch/Namen/die_h%C3%A4ufigsten_m%C3%A4nnlichen_Vornamen_Deutschlands */ protected static $firstNameMale = [ - 'Achim', 'Adalbert', 'Adam', 'Adolf', 'Adrian', 'Ahmed', 'Ahmet', 'Albert', 'Albin', 'Albrecht', 'Alex', 'Alexander', 'Alfons', 'Alfred', 'Ali', 'Alois', 'Aloys', 'Alwin', 'Anatoli', 'Andre', 'Andreas', 'Andree', 'Andrej', 'Andrzej', 'André', 'Andy', 'Angelo', 'Ansgar', 'Anton', 'Antonio', 'Antonius', 'Armin', 'Arnd', 'Arndt', 'Arne', 'Arno', 'Arnold', 'Arnulf', 'Arthur', 'Artur', 'August', 'Axel', + 'Achim', 'Adalbert', 'Adam', 'Adrian', 'Ahmed', 'Ahmet', 'Albert', 'Albin', 'Albrecht', 'Alex', 'Alexander', 'Alfons', 'Alfred', 'Ali', 'Alois', 'Aloys', 'Alwin', 'Anatoli', 'Andre', 'Andreas', 'Andree', 'Andrej', 'Andrzej', 'André', 'Andy', 'Angelo', 'Ansgar', 'Anton', 'Antonio', 'Antonius', 'Armin', 'Arnd', 'Arndt', 'Arne', 'Arno', 'Arnold', 'Arnulf', 'Arthur', 'Artur', 'August', 'Axel', 'Bastian', 'Benedikt', 'Benjamin', 'Benno', 'Bernard', 'Bernd', 'Berndt', 'Bernhard', 'Bert', 'Berthold', 'Bertram', 'Björn', 'Bodo', 'Bogdan', 'Boris', 'Bruno', 'Burghard', 'Burkhard', 'Carl', 'Carlo', 'Carlos', 'Carsten', 'Christian', 'Christof', 'Christoph', 'Christopher', 'Christos', 'Claudio', 'Claus', 'Claus-Dieter', 'Claus-Peter', 'Clemens', 'Cornelius', 'Daniel', 'Danny', 'Darius', 'David', 'Denis', 'Dennis', 'Detlef', 'Detlev', 'Dierk', 'Dieter', 'Diethard', 'Diethelm', 'Dietmar', 'Dietrich', 'Dimitri', 'Dimitrios', 'Dirk', 'Domenico', 'Dominik', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/en_AU/Internet.php b/api/vendor/fakerphp/faker/src/Faker/Provider/en_AU/Internet.php index e1185f18f9..39e650642b 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/en_AU/Internet.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/en_AU/Internet.php @@ -4,6 +4,6 @@ class Internet extends \Faker\Provider\Internet { - protected static $freeEmailDomain = ['gmail.com', 'yahoo.com', 'hotmail.com', 'gmail.com.au', 'yahoo.com.au', 'hotmail.com.au']; + protected static $freeEmailDomain = ['gmail.com', 'yahoo.com', 'hotmail.com', 'yahoo.com.au', 'hotmail.com.au']; protected static $tld = ['com', 'com.au', 'org', 'org.au', 'net', 'net.au', 'biz', 'info', 'edu', 'edu.au']; } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/en_GB/Company.php b/api/vendor/fakerphp/faker/src/Faker/Provider/en_GB/Company.php index 17fe07da0b..b0c3ccc721 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/en_GB/Company.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/en_GB/Company.php @@ -18,7 +18,7 @@ class Company extends \Faker\Provider\Company * * @see https://en.wikipedia.org/wiki/VAT_identification_number#VAT_numbers_by_country */ - public static function vat(string $type = null): string + public static function vat(?string $type = null): string { switch ($type) { case static::VAT_TYPE_BRANCH: diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Company.php b/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Company.php index ee72fca993..8cab28a95e 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Company.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Company.php @@ -15,7 +15,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'blockchain', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Person.php index 3c6f99a4fe..5cd22d43e2 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/en_US/Person.php @@ -27,7 +27,7 @@ class Person extends \Faker\Provider\Person ]; protected static $firstNameMale = [ - 'Aaron', 'Abdiel', 'Abdul', 'Abdullah', 'Abe', 'Abel', 'Abelardo', 'Abner', 'Abraham', 'Adalberto', 'Adam', 'Adan', 'Adelbert', 'Adolf', 'Adolfo', 'Adolph', 'Adolphus', 'Adonis', 'Adrain', 'Adrian', 'Adriel', 'Adrien', 'Afton', 'Agustin', 'Ahmad', 'Ahmed', 'Aidan', 'Aiden', 'Akeem', 'Al', 'Alan', 'Albert', 'Alberto', 'Albin', 'Alden', 'Alec', 'Alejandrin', 'Alek', 'Alessandro', 'Alex', 'Alexander', 'Alexandre', 'Alexandro', 'Alexie', 'Alexis', 'Alexys', 'Alexzander', 'Alf', 'Alfonso', 'Alfonzo', 'Alford', 'Alfred', 'Alfredo', 'Ali', 'Allan', 'Allen', 'Alphonso', 'Alvah', 'Alvis', 'Amani', 'Amari', 'Ambrose', 'Americo', 'Amir', 'Amos', 'Amparo', 'Anastacio', 'Anderson', 'Andre', 'Andres', 'Andrew', 'Andy', 'Angel', 'Angelo', 'Angus', 'Anibal', 'Ansel', 'Ansley', 'Anthony', 'Antone', 'Antonio', 'Antwan', 'Antwon', 'Arch', 'Archibald', 'Arden', 'Arely', 'Ari', 'Aric', 'Ariel', 'Arjun', 'Arlo', 'Armand', 'Armando', 'Armani', 'Arnaldo', 'Arne', 'Arno', 'Arnold', 'Arnoldo', 'Arnulfo', 'Aron', 'Art', 'Arthur', 'Arturo', 'Arvel', 'Arvid', 'Ashton', 'August', 'Augustus', 'Aurelio', 'Austen', 'Austin', 'Austyn', 'Avery', 'Axel', 'Ayden', + 'Aaron', 'Abdiel', 'Abdul', 'Abdullah', 'Abe', 'Abel', 'Abelardo', 'Abner', 'Abraham', 'Adalberto', 'Adam', 'Adan', 'Adelbert', 'Adolfo', 'Adolphus', 'Adonis', 'Adrain', 'Adrian', 'Adriel', 'Adrien', 'Afton', 'Agustin', 'Ahmad', 'Ahmed', 'Aidan', 'Aiden', 'Akeem', 'Al', 'Alan', 'Albert', 'Alberto', 'Albin', 'Alden', 'Alec', 'Alejandrin', 'Alek', 'Alessandro', 'Alex', 'Alexander', 'Alexandre', 'Alexandro', 'Alexie', 'Alexis', 'Alexys', 'Alexzander', 'Alf', 'Alfonso', 'Alfonzo', 'Alford', 'Alfred', 'Alfredo', 'Ali', 'Allan', 'Allen', 'Alphonso', 'Alvah', 'Alvis', 'Amani', 'Amari', 'Ambrose', 'Americo', 'Amir', 'Amos', 'Amparo', 'Anastacio', 'Anderson', 'Andre', 'Andres', 'Andrew', 'Andy', 'Angel', 'Angelo', 'Angus', 'Anibal', 'Ansel', 'Ansley', 'Anthony', 'Antone', 'Antonio', 'Antwan', 'Antwon', 'Arch', 'Archibald', 'Arden', 'Arely', 'Ari', 'Aric', 'Ariel', 'Arjun', 'Arlo', 'Armand', 'Armando', 'Armani', 'Arnaldo', 'Arne', 'Arno', 'Arnold', 'Arnoldo', 'Arnulfo', 'Aron', 'Art', 'Arthur', 'Arturo', 'Arvel', 'Arvid', 'Ashton', 'August', 'Augustus', 'Aurelio', 'Austen', 'Austin', 'Austyn', 'Avery', 'Axel', 'Ayden', 'Bailey', 'Barney', 'Baron', 'Barrett', 'Barry', 'Bart', 'Bartholome', 'Barton', 'Baylee', 'Beau', 'Bell', 'Ben', 'Benedict', 'Benjamin', 'Bennett', 'Bennie', 'Benny', 'Benton', 'Bernard', 'Bernardo', 'Bernhard', 'Bernie', 'Berry', 'Berta', 'Bertha', 'Bertram', 'Bertrand', 'Bill', 'Billy', 'Blair', 'Blaise', 'Blake', 'Blaze', 'Bo', 'Bobbie', 'Bobby', 'Boris', 'Boyd', 'Brad', 'Braden', 'Bradford', 'Bradley', 'Bradly', 'Brady', 'Braeden', 'Brain', 'Brando', 'Brandon', 'Brandt', 'Brannon', 'Branson', 'Brant', 'Braulio', 'Braxton', 'Brayan', 'Brendan', 'Brenden', 'Brendon', 'Brennan', 'Brennon', 'Brent', 'Bret', 'Brett', 'Brian', 'Brice', 'Brock', 'Broderick', 'Brody', 'Brook', 'Brooks', 'Brown', 'Bruce', 'Bryce', 'Brycen', 'Bryon', 'Buck', 'Bud', 'Buddy', 'Buford', 'Burley', 'Buster', 'Cade', 'Caden', 'Caesar', 'Cale', 'Caleb', 'Camden', 'Cameron', 'Camren', 'Camron', 'Camryn', 'Candelario', 'Candido', 'Carey', 'Carleton', 'Carlo', 'Carlos', 'Carmel', 'Carmelo', 'Carmine', 'Carol', 'Carroll', 'Carson', 'Carter', 'Cary', 'Casey', 'Casimer', 'Casimir', 'Casper', 'Ceasar', 'Cecil', 'Cedrick', 'Celestino', 'Cesar', 'Chad', 'Chadd', 'Chadrick', 'Chaim', 'Chance', 'Chandler', 'Charles', 'Charley', 'Charlie', 'Chase', 'Chauncey', 'Chaz', 'Chelsey', 'Chesley', 'Chester', 'Chet', 'Chris', 'Christ', 'Christian', 'Christop', 'Christophe', 'Christopher', 'Cicero', 'Cielo', 'Clair', 'Clark', 'Claud', 'Claude', 'Clay', 'Clemens', 'Clement', 'Cleo', 'Cletus', 'Cleve', 'Cleveland', 'Clifford', 'Clifton', 'Clint', 'Clinton', 'Clovis', 'Cloyd', 'Clyde', 'Coby', 'Cody', 'Colby', 'Cole', 'Coleman', 'Colin', 'Collin', 'Colt', 'Colten', 'Colton', 'Columbus', 'Conner', 'Connor', 'Conor', 'Conrad', 'Constantin', 'Consuelo', 'Cooper', 'Corbin', 'Cordelia', 'Cordell', 'Cornelius', 'Cornell', 'Cortez', 'Cory', 'Coty', 'Coy', 'Craig', 'Crawford', 'Cristian', 'Cristina', 'Cristobal', 'Cristopher', 'Cruz', 'Cullen', 'Curt', 'Curtis', 'Cyril', 'Cyrus', 'Dagmar', 'Dale', 'Dallas', 'Dallin', 'Dalton', 'Dameon', 'Damian', 'Damien', 'Damion', 'Damon', 'Dan', 'Dane', 'D\'angelo', 'Dangelo', 'Danial', 'Danny', 'Dante', 'Daren', 'Darian', 'Darien', 'Dario', 'Darion', 'Darius', 'Daron', 'Darrel', 'Darrell', 'Darren', 'Darrick', 'Darrin', 'Darrion', 'Darron', 'Darryl', 'Darwin', 'Daryl', 'Dashawn', 'Dave', 'David', 'Davin', 'Davion', 'Davon', 'Davonte', 'Dawson', 'Dax', 'Dayne', 'Dayton', 'Dean', 'Deangelo', 'Declan', 'Dedric', 'Dedrick', 'Dee', 'Deion', 'Dejon', 'Dejuan', 'Delaney', 'Delbert', 'Dell', 'Delmer', 'Demarco', 'Demarcus', 'Demario', 'Demetrius', 'Demond', 'Denis', 'Dennis', 'Deon', 'Deondre', 'Deontae', 'Deonte', 'Dereck', 'Derek', 'Derick', 'Deron', 'Derrick', 'Deshaun', 'Deshawn', 'Desmond', 'Destin', 'Devan', 'Devante', 'Deven', 'Devin', 'Devon', 'Devonte', 'Devyn', 'Dewayne', 'Dewitt', 'Dexter', 'Diamond', 'Diego', 'Dillan', 'Dillon', 'Dimitri', 'Dino', 'Dion', 'Dock', 'Domenic', 'Domenick', 'Domenico', 'Domingo', 'Dominic', 'Don', 'Donald', 'Donato', 'Donavon', 'Donnell', 'Donnie', 'Donny', 'Dorcas', 'Dorian', 'Doris', 'Dorthy', 'Doug', 'Douglas', 'Doyle', 'Drake', 'Dudley', 'Duncan', 'Durward', 'Dustin', 'Dusty', 'Dwight', 'Dylan', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/Person.php index df018d1514..2433ac1785 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/en_ZA/Person.php @@ -135,13 +135,12 @@ class Person extends \Faker\Provider\Person /** * @see https://en.wikipedia.org/wiki/National_identification_number#South_Africa * - * @param \DateTime $birthdate - * @param bool $citizen - * @param string $gender + * @param bool $citizen + * @param string $gender * * @return string */ - public function idNumber(\DateTime $birthdate = null, $citizen = true, $gender = null) + public function idNumber(?\DateTime $birthdate = null, $citizen = true, $gender = null) { if (!$birthdate) { $birthdate = $this->generator->dateTimeThisCentury(); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/es_AR/Company.php b/api/vendor/fakerphp/faker/src/Faker/Provider/es_AR/Company.php index f14d446716..bc6211cdfa 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/es_AR/Company.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/es_AR/Company.php @@ -17,7 +17,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/es_ES/Company.php b/api/vendor/fakerphp/faker/src/Faker/Provider/es_ES/Company.php index 73bd3159b2..5d6dafecc2 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/es_ES/Company.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/es_ES/Company.php @@ -22,7 +22,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/es_PE/Company.php b/api/vendor/fakerphp/faker/src/Faker/Provider/es_PE/Company.php index ff9f50dc11..96a1d13ebd 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/es_PE/Company.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/es_PE/Company.php @@ -17,7 +17,7 @@ class Company extends \Faker\Provider\Company 'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented', ], [ - '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', + '24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'asymmetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance', ], [ 'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Person.php index 328a44b2c8..2dc652090a 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/fi_FI/Person.php @@ -91,12 +91,11 @@ class Person extends \Faker\Provider\Person * * @see http://www.finlex.fi/fi/laki/ajantasa/2010/20100128 * - * @param \DateTime $birthdate - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE + * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE * * @return string on format DDMMYYCZZZQ, where DDMMYY is the date of birth, C the century sign, ZZZ the individual number and Q the control character (checksum) */ - public function personalIdentityNumber(\DateTime $birthdate = null, $gender = null) + public function personalIdentityNumber(?\DateTime $birthdate = null, $gender = null) { $checksumCharacters = '0123456789ABCDEFHJKLMNPRSTUVWXY'; diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Address.php b/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Address.php index 106f648cca..d6dbb76cca 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Address.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Address.php @@ -34,7 +34,11 @@ class Address extends \Faker\Provider\Address ]; protected static $buildingNumber = ['%', '%#', '%#', '%#', '%##']; - protected static $postcode = ['#####', '## ###']; + + /** + * @see https://en.wikipedia.org/wiki/Postal_codes_in_France + */ + protected static $postcode = ['#####']; protected static $country = [ 'Afghanistan', 'Afrique du sud', 'Albanie', 'Algérie', 'Allemagne', 'Andorre', 'Angola', 'Anguilla', 'Antarctique', 'Antigua et Barbuda', 'Antilles néerlandaises', 'Arabie saoudite', 'Argentine', 'Arménie', 'Aruba', 'Australie', 'Autriche', 'Azerbaïdjan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Belgique', 'Belize', 'Benin', 'Bermudes (Les)', 'Bhoutan', 'Biélorussie', 'Bolivie', 'Bosnie-Herzégovine', 'Botswana', 'Bouvet (Îles)', 'Brunei', 'Brésil', 'Bulgarie', 'Burkina Faso', 'Burundi', 'Cambodge', 'Cameroun', 'Canada', 'Cap Vert', 'Cayman (Îles)', 'Chili', 'Chine (Rép. pop.)', 'Christmas (Île)', 'Chypre', 'Cocos (Îles)', 'Colombie', 'Comores', 'Cook (Îles)', 'Corée du Nord', 'Corée, Sud', 'Costa Rica', 'Croatie', 'Cuba', 'Côte d\'Ivoire', 'Danemark', 'Djibouti', 'Dominique', 'Égypte', 'El Salvador', 'Émirats arabes unis', 'Équateur', 'Érythrée', 'Espagne', 'Estonie', 'États-Unis', 'Ethiopie', 'Falkland (Île)', 'Fidji (République des)', 'Finlande', 'France', 'Féroé (Îles)', 'Gabon', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php b/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php index 69c681d915..22f518d67d 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/PhoneNumber.php @@ -13,7 +13,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber '+33 (0)3 ## ## ## ##', '+33 (0)4 ## ## ## ##', '+33 (0)5 ## ## ## ##', - '+33 (0)6 ## ## ## ##', + '+33 (0)6 {{phoneNumber06WithSeparator}}', '+33 (0)7 {{phoneNumber07WithSeparator}}', '+33 (0)8 {{phoneNumber08WithSeparator}}', '+33 (0)9 ## ## ## ##', @@ -23,7 +23,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber '+33 3 ## ## ## ##', '+33 4 ## ## ## ##', '+33 5 ## ## ## ##', - '+33 6 ## ## ## ##', + '+33 6 {{phoneNumber06WithSeparator}}', '+33 7 {{phoneNumber07WithSeparator}}', '+33 8 {{phoneNumber08WithSeparator}}', '+33 9 ## ## ## ##', @@ -33,7 +33,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber '03########', '04########', '05########', - '06########', + '06{{phoneNumber06}}', '07{{phoneNumber07}}', '08{{phoneNumber08}}', '09########', @@ -43,7 +43,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber '03 ## ## ## ##', '04 ## ## ## ##', '05 ## ## ## ##', - '06 ## ## ## ##', + '06 {{phoneNumber06WithSeparator}}', '07 {{phoneNumber07WithSeparator}}', '08 {{phoneNumber08WithSeparator}}', '09 ## ## ## ##', @@ -52,13 +52,13 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber // Mobile phone numbers start by 06 and 07 // 06 is the most common prefix protected static $mobileFormats = [ - '+33 (0)6 ## ## ## ##', - '+33 6 ## ## ## ##', + '+33 (0)6 {{phoneNumber06WithSeparator}}', + '+33 6 {{phoneNumber06WithSeparator}}', '+33 (0)7 {{phoneNumber07WithSeparator}}', '+33 7 {{phoneNumber07WithSeparator}}', - '06########', + '06{{phoneNumber06}}', '07{{phoneNumber07}}', - '06 ## ## ## ##', + '06 {{phoneNumber06WithSeparator}}', '07 {{phoneNumber07WithSeparator}}', ]; @@ -73,6 +73,26 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber '+33#########', ]; + public function phoneNumber06() + { + $phoneNumber = $this->phoneNumber06WithSeparator(); + + return str_replace(' ', '', $phoneNumber); + } + + /** + * Only 0601 to 0638, 0640 to 0689, 0695 and 0698 to 0699 are acceptable prefixes with 06 + * + * @see https://www.arcep.fr/la-regulation/grands-dossiers-thematiques-transverses/la-numerotation.html#c8961 + * @see https://www.itu.int/itu-t/nnp/#/numbering-plans?country=France%C2%A0&code=33 + */ + public function phoneNumber06WithSeparator() + { + $regex = '([0-24-8]\d|3[0-8]|9[589])( \d{2}){3}'; + + return static::regexify($regex); + } + public function phoneNumber07() { $phoneNumber = $this->phoneNumber07WithSeparator(); @@ -81,16 +101,16 @@ public function phoneNumber07() } /** - * Only 073 to 079 are acceptable prefixes with 07 + * Only 0730 to 0789 are acceptable prefixes with 07 * - * @see http://www.arcep.fr/index.php?id=8146 + * @see https://www.arcep.fr/la-regulation/grands-dossiers-thematiques-transverses/la-numerotation.html#c8961 + * @see https://www.itu.int/itu-t/nnp/#/numbering-plans?country=France%C2%A0&code=33 */ public function phoneNumber07WithSeparator() { - $phoneNumber = $this->generator->numberBetween(3, 9); - $phoneNumber .= $this->numerify('# ## ## ##'); + $regex = '([3-8]\d)( \d{2}){3}'; - return $phoneNumber; + return static::regexify($regex); } public function phoneNumber08() @@ -121,9 +141,9 @@ public function phoneNumber08() */ public function phoneNumber08WithSeparator() { - $regex = '([012]{1}\d{1}|(9[1-357-9])( \d{2}){3}'; + $regex = '([012]\d|(9[1-357-9])( \d{2}){3}'; - return $this->regexify($regex); + return static::regexify($regex); } /** diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Address.php b/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Address.php index b9930ff820..efa9dd5e19 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Address.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Address.php @@ -12,35 +12,35 @@ class Address extends \Faker\Provider\Address ]; protected static $postcode = ['#####']; protected static $state = [ - 'Agrigento', 'Alessandria', 'Ancona', 'Aosta', 'Arezzo', 'Ascoli Piceno', 'Asti', 'Avellino', 'Bari', 'Barletta-Andria-Trani', 'Belluno', 'Benevento', 'Bergamo', 'Biella', 'Bologna', 'Bolzano', 'Brescia', 'Brindisi', 'Cagliari', 'Caltanissetta', 'Campobasso', 'Carbonia-Iglesias', 'Caserta', 'Catania', 'Catanzaro', 'Chieti', 'Como', 'Cosenza', 'Cremona', 'Crotone', 'Cuneo', 'Enna', 'Fermo', 'Ferrara', 'Firenze', 'Foggia', 'Forlì-Cesena', 'Frosinone', 'Genova', 'Gorizia', 'Grosseto', 'Imperia', 'Isernia', 'La Spezia', 'L\'Aquila', 'Latina', 'Lecce', 'Lecco', 'Livorno', 'Lodi', 'Lucca', 'Macerata', 'Mantova', 'Massa-Carrara', 'Matera', 'Messina', 'Milano', 'Modena', 'Monza e della Brianza', 'Napoli', 'Novara', 'Nuoro', 'Olbia-Tempio', 'Oristano', 'Padova', 'Palermo', 'Parma', 'Pavia', 'Perugia', 'Pesaro e Urbino', 'Pescara', 'Piacenza', 'Pisa', 'Pistoia', 'Pordenone', 'Potenza', 'Prato', 'Ragusa', 'Ravenna', 'Reggio Calabria', 'Reggio Emilia', 'Rieti', 'Rimini', 'Roma', 'Rovigo', 'Salerno', 'Medio Campidano', 'Sassari', 'Savona', 'Siena', 'Siracusa', 'Sondrio', 'Taranto', 'Teramo', 'Terni', 'Torino', 'Ogliastra', 'Trapani', 'Trento', 'Treviso', 'Trieste', 'Udine', 'Varese', 'Venezia', 'Verbano-Cusio-Ossola', 'Vercelli', 'Verona', 'Vibo Valentia', 'Vicenza', 'Viterbo', + 'Agrigento', 'Alessandria', 'Ancona', 'Aosta', 'Arezzo', 'Ascoli Piceno', 'Asti', 'Avellino', 'Bari', 'Barletta-Andria-Trani', 'Belluno', 'Benevento', 'Bergamo', 'Biella', 'Bologna', 'Bolzano', 'Brescia', 'Brindisi', 'Cagliari', 'Caltanissetta', 'Campobasso', 'Caserta', 'Catania', 'Catanzaro', 'Chieti', 'Como', 'Cosenza', 'Cremona', 'Crotone', 'Cuneo', 'Enna', 'Fermo', 'Ferrara', 'Firenze', 'Foggia', 'Forlì-Cesena', 'Frosinone', 'Genova', 'Gorizia', 'Grosseto', 'Imperia', 'Isernia', 'La Spezia', 'L\'Aquila', 'Latina', 'Lecce', 'Lecco', 'Livorno', 'Lodi', 'Lucca', 'Macerata', 'Mantova', 'Massa-Carrara', 'Matera', 'Messina', 'Milano', 'Modena', 'Monza e della Brianza', 'Napoli', 'Novara', 'Nuoro', 'Oristano', 'Padova', 'Palermo', 'Parma', 'Pavia', 'Perugia', 'Pesaro e Urbino', 'Pescara', 'Piacenza', 'Pisa', 'Pistoia', 'Pordenone', 'Potenza', 'Prato', 'Ragusa', 'Ravenna', 'Reggio Calabria', 'Reggio Emilia', 'Rieti', 'Rimini', 'Roma', 'Rovigo', 'Salerno', 'Sassari', 'Savona', 'Siena', 'Siracusa', 'Sondrio', 'Sud Sardegna', 'Taranto', 'Teramo', 'Terni', 'Torino', 'Trapani', 'Trento', 'Treviso', 'Trieste', 'Udine', 'Varese', 'Venezia', 'Verbano-Cusio-Ossola', 'Vercelli', 'Verona', 'Vibo Valentia', 'Vicenza', 'Viterbo', ]; protected static $stateAbbr = [ - 'AG', 'AL', 'AN', 'AO', 'AR', 'AP', 'AT', 'AV', 'BA', 'BT', 'BL', 'BN', 'BG', 'BI', 'BO', 'BZ', 'BS', 'BR', 'CA', 'CL', 'CB', 'CI', 'CE', 'CT', 'CZ', 'CH', 'CO', 'CS', 'CR', 'KR', 'CN', 'EN', 'FM', 'FE', 'FI', 'FG', 'FC', 'FR', 'GE', 'GO', 'GR', 'IM', 'IS', 'SP', 'AQ', 'LT', 'LE', 'LC', 'LI', 'LO', 'LU', 'MC', 'MN', 'MS', 'MT', 'ME', 'MI', 'MO', 'MB', 'NA', 'NO', 'NU', 'OT', 'OR', 'PD', 'PA', 'PR', 'PV', 'PG', 'PU', 'PE', 'PC', 'PI', 'PT', 'PN', 'PZ', 'PO', 'RG', 'RA', 'RC', 'RE', 'RI', 'RN', 'RM', 'RO', 'SA', 'VS', 'SS', 'SV', 'SI', 'SR', 'SO', 'TA', 'TE', 'TR', 'TO', 'OG', 'TP', 'TN', 'TV', 'TS', 'UD', 'VA', 'VE', 'VB', 'VC', 'VR', 'VV', 'VI', 'VT', + 'AG', 'AL', 'AN', 'AO', 'AR', 'AP', 'AT', 'AV', 'BA', 'BT', 'BL', 'BN', 'BG', 'BI', 'BO', 'BZ', 'BS', 'BR', 'CA', 'CL', 'CB', 'CE', 'CT', 'CZ', 'CH', 'CO', 'CS', 'CR', 'KR', 'CN', 'EN', 'FM', 'FE', 'FI', 'FG', 'FC', 'FR', 'GE', 'GO', 'GR', 'IM', 'IS', 'SP', 'AQ', 'LT', 'LE', 'LC', 'LI', 'LO', 'LU', 'MC', 'MN', 'MS', 'MT', 'ME', 'MI', 'MO', 'MB', 'NA', 'NO', 'NU', 'OR', 'PD', 'PA', 'PR', 'PV', 'PG', 'PU', 'PE', 'PC', 'PI', 'PT', 'PN', 'PZ', 'PO', 'RG', 'RA', 'RC', 'RE', 'RI', 'RN', 'RM', 'RO', 'SA', 'SS', 'SV', 'SI', 'SR', 'SO', 'SU', 'TA', 'TE', 'TR', 'TO', 'TP', 'TN', 'TV', 'TS', 'UD', 'VA', 'VE', 'VB', 'VC', 'VR', 'VV', 'VI', 'VT', ]; protected static $country = [ - 'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antartide (territori a sud del 60° parallelo)', 'Antigua e Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', - 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Bielorussia', 'Belgio', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia e Herzegovina', 'Botswana', 'Bouvet Island (Bouvetoya)', 'Brasile', 'Territorio dell\'arcipelago indiano', 'Isole Vergini Britanniche', 'Brunei Darussalam', 'Bulgaria', 'Burkina Faso', 'Burundi', - 'Cambogia', 'Cameroon', 'Canada', 'Capo Verde', 'Isole Cayman', 'Repubblica Centrale Africana', 'Chad', 'Cile', 'Cina', 'Isola di Pasqua', 'Isola di Cocos (Keeling)', 'Colombia', 'Comoros', 'Congo', 'Isole Cook', 'Costa Rica', 'Costa d\'Avorio', 'Croazia', 'Cuba', 'Cipro', 'Repubblica Ceca', - 'Danimarca', 'Gibuti', 'Repubblica Dominicana', - 'Equador', 'Egitto', 'El Salvador', 'Guinea Equatoriale', 'Eritrea', 'Estonia', 'Etiopia', - 'Isole Faroe', 'Isole Falkland (Malvinas)', 'Fiji', 'Finlandia', 'Francia', 'Guyana Francese', 'Polinesia Francese', 'Territori Francesi del sud', - 'Gabon', 'Gambia', 'Georgia', 'Germania', 'Ghana', 'Gibilterra', 'Grecia', 'Groenlandia', 'Grenada', 'Guadalupa', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', - 'Haiti', 'Heard Island and McDonald Islands', 'Città del Vaticano', 'Honduras', 'Hong Kong', 'Ungheria', - 'Islanda', 'India', 'Indonesia', 'Iran', 'Iraq', 'Irlanda', 'Isola di Man', 'Israele', 'Italia', - 'Giamaica', 'Giappone', 'Jersey', 'Giordania', - 'Kazakhstan', 'Kenya', 'Kiribati', 'Korea', 'Kuwait', 'Republicca Kirgiza', - 'Repubblica del Laos', 'Latvia', 'Libano', 'Lesotho', 'Liberia', 'Libyan Arab Jamahiriya', 'Liechtenstein', 'Lituania', 'Lussemburgo', - 'Macao', 'Macedonia', 'Madagascar', 'Malawi', 'Malesia', 'Maldive', 'Mali', 'Malta', 'Isole Marshall', 'Martinica', 'Mauritania', 'Mauritius', 'Mayotte', 'Messico', 'Micronesia', 'Moldova', 'Principato di Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Marocco', 'Mozambico', 'Myanmar', - 'Namibia', 'Nauru', 'Nepal', 'Antille Olandesi', 'Olanda', 'Nuova Caledonia', 'Nuova Zelanda', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Isole Norfolk', 'Northern Mariana Islands', 'Norvegia', - 'Oman', - 'Pakistan', 'Palau', 'Palestina', 'Panama', 'Papua Nuova Guinea', 'Paraguay', 'Peru', 'Filippine', 'Pitcairn Islands', 'Polonia', 'Portogallo', 'Porto Rico', + 'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antartide (territori a sud del 60° parallelo)', 'Antigua e Barbuda', 'Antille Olandesi', 'Arabia Saudita', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', + 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Bielorussia', 'Belgio', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia e Herzegovina', 'Botswana', 'Isola Bouvet', 'Brasile', 'Territorio dell\'arcipelago indiano', 'Isole Vergini Britanniche', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', + 'Cambogia', 'Cameroon', 'Canada', 'Capo Verde', 'Isole Cayman', 'Repubblica Centrale Africana', 'Chad', 'Cile', 'Cina', 'Isola di Pasqua', 'Isole Cocos', 'Colombia', 'Comore', 'Congo', 'Isole Cook', 'Costa Rica', 'Costa d\'Avorio', 'Croazia', 'Cuba', 'Cipro', 'Repubblica Ceca', + 'Danimarca', 'Repubblica Dominicana', + 'Equador', 'Egitto', 'El Salvador', 'Emirati Arabi Uniti', 'Eritrea', 'Estonia', 'Eswatini', 'Etiopia', + 'Isole Faroe', 'Isole Falkland', 'Fiji', 'Filippine', 'Finlandia', 'Francia', 'Guyana Francese', 'Polinesia Francese', 'Territori Francesi del Sud', + 'Gabon', 'Gambia', 'Georgia', 'Georgia del Sud e Isole Sandwich Australi', 'Germania', 'Ghana', 'Giamaica', 'Giappone', 'Gibilterra', 'Gibuti', 'Giordania', 'Grecia', 'Groenlandia', 'Grenada', 'Guadalupa', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guinea Equatoriale', 'Guyana', + 'Haiti', 'Isole Heard e McDonald', 'Honduras', 'Hong Kong', + 'Islanda', 'India', 'Indonesia', 'Iran', 'Iraq', 'Irlanda', 'Israele', 'Italia', + 'Isola di Jersey', + 'Kazakhstan', 'Kenya', 'Kirghizistan', 'Kiribati', 'Korea', 'Kuwait', + 'Repubblica del Laos', 'Latvia', 'Lesotho', 'Libano', 'Liberia', 'Libia', 'Liechtenstein', 'Lituania', 'Lussemburgo', + 'Macao', 'Macedonia', 'Madagascar', 'Malawi', 'Malesia', 'Maldive', 'Mali', 'Malta', 'Isola di Man', 'Isole Marianne Settentrionali', 'Isole Marshall', 'Martinica', 'Mauritania', 'Mauritius', 'Mayotte', 'Messico', 'Micronesia', 'Isole Minori esterne degli Stati Uniti d\'America', 'Moldova', 'Principato di Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Marocco', 'Mozambico', 'Myanmar', + 'Namibia', 'Nauru', 'Nepal', 'Nuova Caledonia', 'Nuova Zelanda', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Isole Norfolk', 'Norvegia', + 'Olanda', 'Oman', + 'Pakistan', 'Palau', 'Palestina', 'Panama', 'Papua Nuova Guinea', 'Paraguay', 'Peru', 'Isole Pitcairn', 'Polonia', 'Portogallo', 'Porto Rico', 'Qatar', - 'Reunion', 'Romania', 'Russia', 'Rwanda', - 'San Bartolomeo', 'Sant\'Elena', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Martin', 'Saint Pierre and Miquelon', 'Saint Vincent and the Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Arabia Saudita', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovenia', 'Isole Solomon', 'Somalia', 'Sud Africa', 'Georgia del sud e South Sandwich Islands', 'Spagna', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard & Jan Mayen Islands', 'Swaziland', 'Svezia', 'Svizzera', 'Siria', - 'Taiwan', 'Tajikistan', 'Tanzania', 'Tailandia', 'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad e Tobago', 'Tunisia', 'Turchia', 'Turkmenistan', 'Isole di Turks and Caicos', 'Tuvalu', - 'Uganda', 'Ucraina', 'Emirati Arabi Uniti', 'Regno Unito', 'Stati Uniti d\'America', 'United States Minor Outlying Islands', 'Isole Vergini Statunitensi', 'Uruguay', 'Uzbekistan', - 'Vanuatu', 'Venezuela', 'Vietnam', - 'Wallis and Futuna', 'Western Sahara', + 'Regno Unito', 'Isola della Riunione', 'Romania', 'Russia', 'Rwanda', + 'Sahara Occidentale', 'San Bartolomeo', 'Sant\'Elena', 'Saint Kitts e Nevis', 'Saint Lucia', 'Saint Martin', 'Saint-Pierre e Miquelon', 'Saint Vincent e Grenadine', 'Samoa', 'San Marino', 'Sao Tome e Principe', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovenia', 'Isole Solomon', 'Somalia', 'Spagna', 'Sri Lanka', 'Stati Uniti d\'America', 'Sud Africa', 'Sudan', 'Suriname', 'Isole Svalbard e Jan Mayen', 'Svezia', 'Svizzera', 'Siria', + 'Taiwan', 'Tajikistan', 'Tanzania', 'Tailandia', 'Timor Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad e Tobago', 'Tunisia', 'Turchia', 'Turkmenistan', 'Isole di Turks e Caicos', 'Tuvalu', + 'Uganda', 'Ucraina', 'Uruguay', 'Uzbekistan', 'Ungheria', + 'Vanuatu', 'Vaticano', 'Venezuela', 'Isole Vergini Statunitensi', 'Vietnam', + 'Wallis e Futuna', 'Yemen', 'Zambia', 'Zimbabwe', ]; @@ -64,7 +64,7 @@ class Address extends \Faker\Provider\Address protected static $secondaryAddressFormats = ['Appartamento ##', 'Piano #']; /** - * @example 'East' + * @example 'Borgo' */ public static function cityPrefix() { @@ -72,7 +72,7 @@ public static function cityPrefix() } /** - * @example 'Appt. 350' + * @example 'Appartamento 350' */ public static function secondaryAddress() { @@ -80,7 +80,7 @@ public static function secondaryAddress() } /** - * @example 'California' + * @example 'Cagliari' */ public static function state() { diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Person.php index 9922fd024e..c74052eaec 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/it_IT/Person.php @@ -23,41 +23,54 @@ class Person extends \Faker\Provider\Person ]; protected static $firstNameMale = [ - 'Aaron', 'Abramo', 'Adriano', 'Akira', 'Alan', 'Alberto', 'Albino', 'Alessandro', 'Alessio', 'Amedeo', 'Amos', 'Anastasio', 'Anselmo', - 'Antimo', 'Antonino', 'Antonio', 'Ariel', 'Armando', 'Aroldo', 'Arturo', 'Augusto', 'Battista', 'Bernardo', 'Boris', 'Caio', - 'Carlo', 'Carmelo', 'Ciro', 'Damiano', 'Danny', 'Dante', 'Davide', 'Davis', 'Demis', 'Dimitri', 'Domingo', 'Dylan', - 'Edilio', 'Egidio', 'Elio', 'Emanuel', 'Emidio', 'Enrico', 'Enzo', 'Ercole', 'Ermes', 'Ethan', 'Ettore', 'Eusebio', - 'Fabiano', 'Fabio', 'Ferdinando', 'Fernando', 'Fiorenzo', 'Flavio', 'Folco', 'Fulvio', 'Furio', 'Gabriele', 'Gaetano', 'Gastone', - 'Gavino', 'Gerlando', 'Germano', 'Giacinto', 'Gianantonio', 'Giancarlo', 'Gianmarco', 'Gianmaria', 'Gioacchino', 'Giordano', 'Giorgio', 'Giuliano', - 'Giulio', 'Graziano', 'Gregorio', 'Guido', 'Harry', 'Hector', 'Iacopo', 'Ian', 'Ilario', 'Italo', 'Ivano', 'Jack', - 'Jacopo', 'Jari', 'Jarno', 'Joey', 'Joseph', 'Joshua', 'Kai', 'Karim', 'Kris', 'Lamberto', 'Lauro', 'Lazzaro', - 'Leonardo', 'Liborio', 'Lino', 'Lorenzo', 'Loris', 'Ludovico', 'Luigi', 'Manfredi', 'Manuele', 'Marco', 'Mariano', 'Marino', - 'Marvin', 'Marzio', 'Matteo', 'Mattia', 'Mauro', 'Max', 'Michael', 'Mirco', 'Mirko', 'Modesto', 'Moreno', 'Nabil', - 'Nadir', 'Nathan', 'Nazzareno', 'Nick', 'Nico', 'Noah', 'Noel', 'Omar', 'Oreste', 'Osvaldo', 'Pablo', 'Patrizio', - 'Pietro', 'Priamo', 'Quirino', 'Raoul', 'Renato', 'Renzo', 'Rocco', 'Rodolfo', 'Romeo', 'Romolo', 'Rudy', 'Sabatino', - 'Sabino', 'Samuel', 'Sandro', 'Santo', 'Sebastian', 'Sesto', 'Silvano', 'Silverio', 'Sirio', 'Siro', 'Timoteo', 'Timothy', - 'Tommaso', 'Ubaldo', 'Umberto', 'Vinicio', 'Walter', 'Xavier', 'Yago', 'Alighieri', 'Alighiero', 'Amerigo', 'Arcibaldo', 'Arduino', - 'Artes', 'Audenico', 'Ausonio', 'Bacchisio', 'Baldassarre', 'Bettino', 'Bortolo', 'Caligola', 'Cecco', 'Cirino', 'Cleros', - 'Costantino', 'Costanzo', 'Danthon', 'Demian', 'Domiziano', 'Edipo', 'Egisto', 'Eliziario', 'Eriberto', 'Erminio', - 'Eustachio', 'Evangelista', 'Fiorentino', 'Giacobbe', 'Gianleonardo', 'Gianriccardo', 'Giobbe', 'Ippolito', - 'Isira', 'Joannes', 'Kociss', 'Laerte', 'Maggiore', 'Muzio', 'Nestore', 'Odino', 'Odone', 'Olo', 'Oretta', 'Orfeo', - 'Osea', 'Pacifico', 'Pericle', 'Piererminio', 'Pierfrancesco', 'Piersilvio', 'Primo', 'Quarto', 'Quasimodo', - 'Radames', 'Radio', 'Raniero', 'Rosalino', 'Rosolino', 'Rufo', 'Secondo', 'Tancredi', 'Tazio', 'Terzo', 'Teseo', - 'Tolomeo', 'Trevis', 'Tristano', 'Ulrico', 'Valdo', 'Zaccaria', 'Dindo', 'Serse', + 'Aaron', 'Abramo', 'Adriano', 'Agostino', 'Akira', 'Alan', 'Alberto', 'Albino', 'Aldo', 'Alessandro', 'Alessio', + 'Alfonso', 'Alfredo', 'Alighieri', 'Alighiero', 'Amedeo', 'Amerigo', 'Amos', 'Anastasio', 'Andrea', 'Angelo', + 'Anselmo', 'Antimo', 'Antonino', 'Antonio', 'Arcibaldo', 'Arduino', 'Ariel', 'Armando', 'Aroldo', 'Artes', 'Arturo', + 'Audenico', 'Augusto', 'Ausonio', 'Bacchisio', 'Baldassarre', 'Battista', 'Bernardo', 'Bettino', 'Boris', 'Bortolo', + 'Bruno', 'Caio', 'Caligola', 'Carlo', 'Carmelo', 'Carmine', 'Cecco', 'Cesare', 'Cirino', 'Ciro', 'Claudio', 'Cleros', + 'Corrado', 'Cosimo', 'Costantino', 'Costanzo', 'Damiano', 'Danilo', 'Danny', 'Dante', 'Danthon', 'Dario', 'David', + 'Davide', 'Davis', 'Demian', 'Demis', 'Dimitri', 'Dindo', 'Dino', 'Domenico', 'Domingo', 'Domiziano', 'Donato', 'Dylan', + 'Edilio', 'Edipo', 'Egidio', 'Egisto', 'Elio', 'Eliziario', 'Emanuel', 'Emanuele', 'Emidio', 'Emilio', 'Enrico', 'Enzo', + 'Ercole', 'Eriberto', 'Ermes', 'Erminio', 'Ernesto', 'Ethan', 'Ettore', 'Eugenio', 'Eusebio', 'Eustachio', 'Evangelista', + 'Fabiano', 'Fabio', 'Fabrizio', 'Fausto', 'Federico', 'Felice', 'Ferdinando', 'Fernando', 'Filippo', 'Fiorentino', + 'Fiorenzo', 'Flavio', 'Folco', 'Francesco', 'Franco', 'Fulvio', 'Furio', 'Gabriele', 'Gaetano', 'Gastone', 'Gavino', + 'Gennaro', 'Gerardo', 'Gerlando', 'Germano', 'Giacinto', 'Giacobbe', 'Giacomo', 'Gian', 'Gianantonio', 'Giancarlo', + 'Gianfranco', 'Gianleonardo', 'Gianluca', 'Gianmarco', 'Gianmaria', 'Gianni', 'Gianriccardo', 'Gino', 'Gioacchino', 'Giobbe', + 'Giordano', 'Giorgio', 'Giovanni', 'Giuliano', 'Giulio', 'Giuseppe', 'Graziano', 'Gregorio', 'Guido', 'Harry', 'Hector', + 'Iacopo', 'Ian', 'Ilario', 'Ippolito', 'Isira', 'Italo', 'Ivano', 'Jack', 'Jacopo', 'Jari', 'Jarno', 'Joannes', 'Joey', + 'Joseph', 'Joshua', 'Kai', 'Karim', 'Kociss', 'Kris', 'Laerte', 'Lamberto', 'Lauro', 'Lazzaro', 'Leonardo', 'Liborio', + 'Lino', 'Lorenzo', 'Loris', 'Luca', 'Luciano', 'Ludovico', 'Luigi', 'Maggiore', 'Manfredi', 'Manuele', 'Marcello', + 'Marco', 'Mariano', 'Marino', 'Mario', 'Marvin', 'Marzio', 'Massimiliano', 'Massimo', 'Matteo', 'Mattia', 'Maurizio', + 'Mauro', 'Max', 'Michael', 'Mirco', 'Mirko', 'Modesto', 'Moreno', 'Muzio', 'Nabil', 'Nadir', 'Nathan', 'Nazzareno', + 'Nestore', 'Nick', 'Nico', 'Nicola', 'Noah', 'Noel', 'Odino', 'Odone', 'Olo', 'Omar', 'Oreste', 'Oretta', 'Orfeo', + 'Osea', 'Osvaldo', 'Pablo', 'Pacifico', 'Paolo', 'Pasquale', 'Patrizio', 'Pericle', 'Piererminio', 'Pierfrancesco', + 'Piero', 'Piersilvio', 'Pietro', 'Priamo', 'Primo', 'Quarto', 'Quasimodo', 'Quirino', 'Radames', 'Radio', 'Raffaele', + 'Raniero', 'Raoul', 'Renato', 'Renzo', 'Riccardo', 'Roberto', 'Rocco', 'Rodolfo', 'Romano', 'Romeo', 'Romolo', + 'Rosalino', 'Rosolino', 'Rudy', 'Rufo', 'Sabatino', 'Sabino', 'Salvatore', 'Samuel', 'Sandro', 'Santo', 'Sebastian', + 'Sebastiano', 'Secondo', 'Sergio', 'Serse', 'Sesto', 'Silvano', 'Silverio', 'Silvio', 'Sirio', 'Siro', 'Stefano', + 'Tancredi', 'Tazio', 'Terzo', 'Teseo', 'Timoteo', 'Timothy', 'Tolomeo', 'Tommaso', 'Trevis', 'Tristano', 'Ubaldo', + 'Ugo', 'Ulrico', 'Umberto', 'Valdo', 'Vincenzo', 'Vinicio', 'Vito', 'Vittorio', 'Walter', 'Xavier', 'Yago', 'Zaccaria', ]; protected static $firstNameFemale = [ - 'Assia', 'Benedetta', 'Bibiana', 'Brigitta', 'Carmela', 'Celeste', 'Cira', 'Claudia', 'Concetta', 'Cristyn', 'Deborah', 'Demi', 'Diana', - 'Donatella', 'Doriana', 'Edvige', 'Elda', 'Elga', 'Elsa', 'Emilia', 'Enrica', 'Erminia', 'Evita', 'Fatima', 'Felicia', - 'Filomena', 'Fortunata', 'Gilda', 'Giovanna', 'Giulietta', 'Grazia', 'Helga', 'Ileana', 'Ingrid', 'Ione', 'Irene', 'Isabel', - 'Ivonne', 'Jelena', 'Kayla', 'Kristel', 'Laura', 'Leone', 'Lia', 'Lidia', 'Lisa', 'Loredana', 'Loretta', 'Luce', - 'Lucia', 'Lucrezia', 'Luna', 'Maika', 'Marcella', 'Maria', 'Marianita', 'Mariapia', 'Marina', 'Maristella', 'Maruska', 'Matilde', - 'Mercedes', 'Michele', 'Miriam', 'Miriana', 'Monia', 'Morgana', 'Naomi', 'Neri', 'Nicoletta', 'Ninfa', 'Noemi', 'Nunzia', - 'Olimpia', 'Ortensia', 'Penelope', 'Prisca', 'Rebecca', 'Rita', 'Rosalba', 'Rosaria', 'Rosita', 'Ruth', 'Samira', 'Sarita', - 'Sasha', 'Shaira', 'Thea', 'Ursula', 'Vania', 'Vera', 'Vienna', 'Artemide', 'Cassiopea', 'Cesidia', 'Clea', 'Cleopatra', - 'Clodovea', 'Cosetta', 'Damiana', 'Danuta', 'Diamante', 'Eufemia', 'Flaviana', 'Gelsomina', 'Genziana', 'Giacinta', 'Guendalina', - 'Jole', 'Mariagiulia', 'Marieva', 'Mietta', 'Nayade', 'Piccarda', 'Selvaggia', 'Sibilla', 'Soriana', 'Sue ellen', 'Tosca', 'Violante', - 'Vitalba', 'Zelida', + 'Adriana', 'Alessandra', 'Andrea', 'Angela', 'Angelina', 'Anna', 'Annalisa', 'Annamaria', 'Annunziata', 'Antonella', + 'Antonia', 'Antonietta', 'Antonina', 'Artemide', 'Asia', 'Assia', 'Assunta', 'Barbara', 'Benedetta', 'Bibiana', 'Brigitta', + 'Bruna', 'Carla', 'Carmela', 'Cassiopea', 'Caterina', 'Celeste', 'Cesidia', 'Chiara', 'Cinzia', 'Cira', 'Clara', 'Claudia', + 'Clea', 'Cleopatra', 'Clodovea', 'Concetta', 'Cosetta', 'Cristina', 'Cristyn', 'Damiana', 'Daniela', 'Danuta', 'Deborah', + 'Demi', 'Diamante', 'Diana', 'Domenica', 'Donatella', 'Doriana', 'Edvige', 'Elda', 'Elena', 'Eleonora', 'Elga', 'Elisa', + 'Elisabetta', 'Elsa', 'Emanuela', 'Emilia', 'Enrica', 'Erminia', 'Eufemia', 'Evita', 'Fatima', 'Federica', 'Felicia', + 'Filomena', 'Flaviana', 'Fortunata', 'Franca', 'Francesca', 'Gabriella', 'Gelsomina', 'Genziana', 'Giacinta', 'Gilda', + 'Giovanna', 'Giuliana', 'Giulietta', 'Giuseppa', 'Giuseppina', 'Grazia', 'Graziella', 'Guendalina', 'Helga', 'Ida', 'Ileana', + 'Ingrid', 'Ione', 'Irene', 'Isabel', 'Isabella', 'Ivana', 'Ivonne', 'Jelena', 'Jole', 'Kayla', 'Kristel', 'Laura', 'Leone', + 'Lia', 'Lidia', 'Liliana', 'Lina', 'Lisa', 'Loredana', 'Loretta', 'Luce', 'Lucia', 'Luciana', 'Lucrezia', 'Luisa', 'Luna', + 'Maddalena', 'Maika', 'Manuela', 'Marcella', 'Margherita', 'Maria', 'Mariagiulia', 'Marianita', 'Marianna', 'Mariapia', + 'Marieva', 'Marina', 'Marisa', 'Maristella', 'Marta', 'Maruska', 'Matilde', 'Mercedes', 'Michela', 'Michele', 'Michelle', + 'Mietta', 'Mirella', 'Miriam', 'Miriana', 'Monia', 'Monica', 'Morgana', 'Nadia', 'Naomi', 'Nayade', 'Neri', 'Nicoletta', + 'Ninfa', 'Noemi', 'Nunzia', 'Olimpia', 'Ortensia', 'Paola', 'Patrizia', 'Penelope', 'Piccarda', 'Pierina', 'Prisca', + 'Raffaella', 'Rebecca', 'Renata', 'Rita', 'Roberta', 'Rosa', 'Rosalba', 'Rosalia', 'Rosanna', 'Rosaria', 'Rosita', + 'Ruth', 'Sabrina', 'Samira', 'Sandra', 'Sara', 'Sarah', 'Sarita', 'Sasha', 'Selvaggia', 'Shaira', 'Sibilla', 'Silvana', + 'Silvia', 'Simona', 'Sonia', 'Soriana', 'Stefania', 'Stella', 'Sue ellen', 'Teresa', 'Thea', 'Tiziana', 'Tosca', + 'Ursula', 'Valentina', 'Vania', 'Vera', 'Veronica', 'Vienna', 'Vincenza', 'Violante', 'Vitalba', 'Vittoria', 'Zelida', ]; protected static $lastName = [ @@ -69,7 +82,7 @@ class Person extends \Faker\Provider\Person 'Rizzi', 'Monti', 'Cattaneo', 'Morelli', 'Amato', 'Silvestri', 'Mazza', 'Testa', 'Grassi', 'Pellegrino', 'Carbone', 'Giuliani', 'Benedetti', 'Barone', 'Rossetti', 'Caputo', 'Montanari', 'Guerra', 'Palmieri', 'Bernardi', 'Martino', 'Fiore', 'De rosa', 'Ferretti', 'Bellini', 'Basile', 'Riva', 'Donati', 'Piras', 'Vitali', 'Battaglia', 'Sartori', 'Neri', 'Costantini', - 'Milani', 'Pagano', 'Ruggiero', 'Sorrentino', 'D\'amico', 'Orlando', 'Damico', 'Negri', + 'Milani', 'Pagano', 'Ruggiero', 'Sorrentino', 'D\'amico', 'Orlando', 'Damico', 'Negri', 'Verdi', ]; protected static $titleMale = ['Sig.', 'Dott.', 'Dr.', 'Ing.']; diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Text.php b/api/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Text.php index 55bcc62972..9cb9a71ba4 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Text.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/ja_JP/Text.php @@ -628,10 +628,12 @@ protected static function appendEnd($text) $chars = static::split($text); $last = end($chars); } + // if the last char is a not-valid-end punctuation, remove it if (in_array($last, static::$notEndPunct, false)) { $text = preg_replace('/.$/u', '', $text); } + // if the last char is not a valid punctuation, append a default one. return in_array($last, static::$endPunct, false) ? $text : $text . '。'; } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Company.php b/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Company.php index 4663a748dd..2ba58b94c8 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Company.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Company.php @@ -54,11 +54,9 @@ public static function companyNameSuffix() * * @see http://egov.kz/wps/portal/Content?contentPath=%2Fegovcontent%2Fbus_business%2Ffor_businessmen%2Farticle%2Fbusiness_identification_number&lang=en * - * @param \DateTime $registrationDate - * * @return string 12 digits, like 150140000019 */ - public static function businessIdentificationNumber(\DateTime $registrationDate = null) + public static function businessIdentificationNumber(?\DateTime $registrationDate = null) { if (!$registrationDate) { $registrationDate = \Faker\Provider\DateTime::dateTimeThisYear(); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Person.php index 61852a2143..454ca1e5e6 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/kk_KZ/Person.php @@ -207,12 +207,11 @@ private static function getCenturyByYear($year) * @see http://egov.kz/wps/portal/Content?contentPath=%2Fegovcontent%2Fcitizen_migration%2Fpassport_id_card%2Farticle%2Fiin_info&lang=en * @see https://ru.wikipedia.org/wiki/%D0%98%D0%BD%D0%B4%D0%B8%D0%B2%D0%B8%D0%B4%D1%83%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9_%D0%B8%D0%B4%D0%B5%D0%BD%D1%82%D0%B8%D1%84%D0%B8%D0%BA%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9_%D0%BD%D0%BE%D0%BC%D0%B5%D1%80 * - * @param \DateTime $birthDate - * @param int $gender + * @param int $gender * * @return string 12 digits, like 780322300455 */ - public static function individualIdentificationNumber(\DateTime $birthDate = null, $gender = self::GENDER_MALE) + public static function individualIdentificationNumber(?\DateTime $birthDate = null, $gender = self::GENDER_MALE) { if (!$birthDate) { $birthDate = DateTime::dateTimeBetween(); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Person.php index c448ab814f..0908f8089c 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/lt_LT/Person.php @@ -325,13 +325,12 @@ public function passportNumber() * @see https://en.wikipedia.org/wiki/National_identification_number#Lithuania * @see https://lt.wikipedia.org/wiki/Asmens_kodas * - * @param string $gender [male|female] - * @param \DateTime $birthdate - * @param string $randomNumber three integers + * @param string $gender [male|female] + * @param string $randomNumber three integers * * @return string on format XXXXXXXXXXX */ - public function personalIdentityNumber($gender = 'male', \DateTime $birthdate = null, $randomNumber = '') + public function personalIdentityNumber($gender = 'male', ?\DateTime $birthdate = null, $randomNumber = '') { if (!$birthdate) { $birthdate = \Faker\Provider\DateTime::dateTimeThisCentury(); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Address.php b/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Address.php index fc8db5c196..0bddcc53b9 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Address.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Address.php @@ -12,7 +12,7 @@ class Address extends \Faker\Provider\Address ]; protected static $buildingNumber = ['%#']; - protected static $postcode = ['LV ####']; + protected static $postcode = ['LV-####']; /** * @see https://lv.wikipedia.org/wiki/Suver%C4%93no_valstu_uzskait%C4%ABjums diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Person.php index d251f891a6..f05b450710 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/lv_LV/Person.php @@ -2,7 +2,6 @@ namespace Faker\Provider\lv_LV; -use Faker\Calculator\Luhn; use Faker\Provider\DateTime; class Person extends \Faker\Provider\Person @@ -135,21 +134,40 @@ public function passportNumber() * * @see https://en.wikipedia.org/wiki/National_identification_number#Latvia * - * @param \DateTime $birthdate - * * @return string on format XXXXXX-XXXXX */ - public function personalIdentityNumber(\DateTime $birthdate = null) + public function personalIdentityNumber(?\DateTime $birthdate = null) { if (!$birthdate) { $birthdate = DateTime::dateTimeThisCentury(); } + $year = $birthdate->format('Y'); + + if ($year >= 2000 && $year <= 2099) { + $century = 2; + } elseif ($year >= 1900 && $year <= 1999) { + $century = 1; + } else { + $century = 0; + } + $datePart = $birthdate->format('dmy'); - $randomDigits = (string) static::numerify('####'); + $serialNumber = static::numerify('###'); + + $partialNumberSplit = str_split($datePart . $century . $serialNumber); + + $idDigitValidator = [1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + $total = 0; + + foreach ($partialNumberSplit as $key => $digit) { + if (isset($idDigitValidator[$key])) { + $total += $idDigitValidator[$key] * (int) $digit; + } + } - $checksum = Luhn::computeCheckDigit($datePart . $randomDigits); + $checksumDigit = (1101 - $total) % 11 % 10; - return $datePart . '-' . $randomDigits . $checksum; + return $datePart . '-' . $century . $serialNumber . $checksumDigit; } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Person.php index 1cd011bf9f..d685715d8f 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/ms_MY/Person.php @@ -792,6 +792,7 @@ public static function myKadNumber($gender = null, $hyphen = false) // gender digit. Odd = MALE, Even = FEMALE $g = self::numberBetween(0, 9); + //Credit: https://gist.github.com/mauris/3629548 if ($gender === static::GENDER_MALE) { $g = $g | 1; diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/Person.php index dff5d2dd45..e337841753 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/nb_NO/Person.php @@ -134,7 +134,7 @@ class Person extends \Faker\Provider\Person 'Abdirahim', 'Abdirahman', 'Abdirashid', 'Abdirizak', 'Abdul', 'Abdulahi', 'Abdulkadir', 'Abdullah', 'Abdullahi', 'Abdulqadir', 'Abdurahman', 'Abed', 'Abel', 'Abid', 'Abraham', 'Absalon', 'Abu', 'Abubakar', 'Adam', 'Adan', 'Adeel', 'Adelheid', 'Adelsten', 'Adem', 'Aden', 'Adham', 'Adi', 'Adil', 'Adis', 'Adler', - 'Admir', 'Adnan', 'Adolf', 'Adrian', 'Afanasi', 'Afrim', 'Afshin', 'Agim', 'Agmund', 'Agnar', 'Agvald', 'Ahmad', + 'Admir', 'Adnan', 'Adrian', 'Afanasi', 'Afrim', 'Afshin', 'Agim', 'Agmund', 'Agnar', 'Agvald', 'Ahmad', 'Ahmed', 'Aiden', 'Ailo', 'Aimar', 'Aime', 'Ajdin', 'Ajmal', 'Akam', 'Akbar', 'Akram', 'Aksel', 'Alain', 'Alan', 'Alban', 'Albert', 'Alberto', 'Albin', 'Albrecht', 'Alejandro', 'Aleksander', 'Alen', 'Alessandro', 'Alex', 'Alexander', 'Alexsander', 'Alf', 'Alfred', 'Algirdas', 'Algot', 'Ali', 'Allan', 'Almar', 'Almas', 'Almaz', @@ -288,12 +288,11 @@ class Person extends \Faker\Provider\Person * * @see https://no.wikipedia.org/wiki/Personnummer * - * @param \DateTime $birthdate - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE + * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE * * @return string on format DDMMYY##### */ - public function personalIdentityNumber(\DateTime $birthdate = null, $gender = null) + public function personalIdentityNumber(?\DateTime $birthdate = null, $gender = null) { if (!$birthdate) { $birthdate = \Faker\Provider\DateTime::dateTimeThisCentury(); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/nl_BE/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/nl_BE/Person.php index f4a60f96b4..55d6f18eaa 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/nl_BE/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/nl_BE/Person.php @@ -73,17 +73,17 @@ class Person extends \Faker\Provider\Person ]; /** - * Belgian Rijksregister numbers are used to identify each citizen, - * it consists of three parts, the person's day of birth, in the - * format 'ymd', followed by a number between 1 and 997, odd for - * males, even for females. The last part is used to check if it's - * a valid number. + * Belgian Rijksregister numbers are used to identify each citizen, + * it consists of three parts, the person's day of birth, in the + * format 'ymd', followed by a number between 1 and 997, odd for + * males, even for females. The last part is used to check if it's + * a valid number. * * @see https://nl.wikipedia.org/wiki/Rijksregisternummer * - * @param string|null $gender 'male', 'female' or null for any + * @param string|null $gender 'male', 'female' or null for any * - * @return string + * @return string */ public static function rrn($gender = null) { diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Address.php b/api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Address.php index ca42cb8c31..a7b01bbb1b 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Address.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Address.php @@ -99,101 +99,97 @@ class Address extends \Faker\Provider\Address * @see http://www.poczta-polska.pl/ */ protected static $street = [ - '1 Maja', '3 Maja', '11 Listopada', 'Agrestowa', 'Akacjowa', 'Andersa Władysława', 'Armii Krajowej', - 'Asnyka Adama', 'Astrów', 'Azaliowa', 'Baczyńskiego Krzysztofa Kamila', 'Bałtycka', - 'Barlickiego Norberta', 'Batalionów Chłopskich', 'Batorego Stefana', 'Bema Józefa', - 'Bema Józefa', 'Beskidzka', 'Białostocka', 'Bielska', 'Bieszczadzka', 'Błękitna', - 'Boczna', 'Bogusławskiego Wojciecha', 'Bohaterów Westerplatte', 'Bolesława Chrobrego', - 'Bolesława Krzywoustego', 'Borowa', 'Botaniczna', 'Bracka', 'Bratków', 'Broniewskiego Władysława', - 'Brzechwy Jana', 'Brzoskwiniowa', 'Brzozowa', 'Budowlanych', 'Bukowa', 'Bursztynowa', - 'Bydgoska', 'Bytomska', 'Cedrowa', 'Cegielniana', 'Ceglana', 'Chabrowa', 'Chełmońskiego Józefa', - 'Chłodna', 'Chłopska', 'Chmielna', 'Chopina Fryderyka', 'Chorzowska', 'Chrobrego Bolesława', - 'Ciasna', 'Cicha', 'Cieszyńska', 'Cisowa', 'Cmentarna', 'Curie-Skłodowskiej Marii', - 'Czarnieckiego Stefana', 'Czereśniowa', 'Częstochowska', 'Czwartaków', 'Daleka', 'Daszyńskiego Ignacego', - 'Dąbrowskiego Jana Henryka', 'Dąbrowskiego Jarosława', 'Dąbrowskiego Jarosława', - 'Dąbrowskiej Marii', 'Dąbrowszczaków', 'Dąbrówki', 'Dębowa', 'Diamentowa', 'Długa', - 'Długosza Jana', 'Dmowskiego Romana', 'Dobra', 'Dolna', 'Dożynkowa', 'Drzymały Michała', - 'Dubois Stanisława', 'Dworcowa', 'Dworska', 'Działkowa', 'Energetyków', 'Fabryczna', - 'Fałata Juliana', 'Fiołkowa', 'Folwarczna', 'Franciszkańska', 'Francuska', 'Fredry Aleksandra', - 'Gagarina Jurija', 'Gajowa', 'Gałczyńskiego Konstantego Ildefonsa', 'Gdańska', 'Gdyńska', - 'Gliwicka', 'Głogowa', 'Głogowska', 'Głowackiego Bartosza', 'Główna', 'Gminna', 'Gnieźnieńska', - 'Gojawiczyńskiej Poli', 'Gołębia', 'Gościnna', 'Górna', 'Górnicza', 'Górnośląska', - 'Grabowa', 'Graniczna', 'Granitowa', 'Grochowska', 'Grodzka', 'Grota-Roweckiego Stefana', - 'Grottgera Artura', 'Grójecka', 'Grunwaldzka', 'Grzybowa', 'Hallera Józefa', 'Handlowa', - 'Harcerska', 'Hetmańska', 'Hoża', 'Husarska', 'Hutnicza', 'Inżynierska', 'Iwaszkiewicza Jarosława', - 'Jagiellońska', 'Jagiellońskie Os.', 'Jagiełły Władysława', 'Jagodowa', 'Jałowcowa', - 'Jana Pawła II', 'Jana Pawła II Al.', 'Jaracza Stefana', 'Jarzębinowa', 'Jaskółcza', - 'Jasna', 'Jastrzębia', 'Jaśminowa', 'Jaworowa', 'Jerozolimskie Al.', 'Jesienna', 'Jesionowa', - 'Jeżynowa', 'Jodłowa', 'Kalinowa', 'Kaliska', 'Kamienna', 'Karłowicza Mieczysława', - 'Karpacka', 'Kartuska', 'Kasprowicza Jana', 'Kasprzaka Marcina', 'Kasztanowa', 'Kaszubska', - 'Katowicka', 'Kazimierza Wielkiego', 'Kielecka', 'Kilińskiego Jana', 'Kleeberga Franciszka', - 'Klonowa', 'Kłosowa', 'Kochanowskiego Jana', 'Kolberga Oskara', 'Kolejowa', 'Kolorowa', - 'Kołłątaja Hugo', 'Kołłątaja Hugona', 'Kołobrzeska', 'Konarskiego Stanisława', - 'Konopnickiej Marii', 'Konstytucji 3 Maja', 'Konwaliowa', 'Kopalniana', 'Kopernika Mikołaja', - 'Koralowa', 'Korczaka Janusza', 'Korfantego Wojciecha', 'Kosmonautów', 'Kossaka Juliusza', - 'Kosynierów', 'Koszalińska', 'Koszykowa', 'Kościelna', 'Kościuszki Tadeusza', 'Kościuszki Tadeusza Pl.', - 'Kowalska', 'Krakowska', 'Krańcowa', 'Krasickiego Ignacego', 'Krasińskiego Zygmunta', - 'Kraszewskiego Józefa Ignacego', 'Kresowa', 'Kręta', 'Królewska', 'Królowej Jadwigi', - 'Krótka', 'Krucza', 'Kruczkowskiego Leona', 'Krzywa', 'Księżycowa', 'Kujawska', 'Kusocińskiego Janusza', - 'Kwiatkowskiego Eugeniusza', 'Kwiatowa', 'Lawendowa', 'Lazurowa', 'Lechicka', 'Legionów', - 'Legnicka', 'Lelewela Joachima', 'Leszczynowa', 'Leśmiana Bolesława', 'Leśna', 'Letnia', - 'Ligonia Juliusza', 'Liliowa', 'Limanowskiego Bolesława', 'Lipowa', 'Lisia', 'Litewska', - 'Lompy Józefa', 'Lotnicza', 'Lotników', 'Lubelska', 'Ludowa', 'Lwowska', 'Łabędzia', - 'Łagiewnicka', 'Łanowa', 'Łączna', 'Łąkowa', 'Łokietka Władysława', 'Łomżyńska', - 'Łowicka', 'Łódzka', 'Łukasiewicza Ignacego', 'Łużycka', 'Maczka Stanisława', - 'Magazynowa', 'Majowa', 'Makowa', 'Makuszyńskiego Kornela', 'Malczewskiego Jacka', 'Malinowa', - 'Mała', 'Małachowskiego Stanisława', 'Małopolska', 'Marszałkowska', 'Matejki Jana', - 'Mazowiecka', 'Mazurska', 'Miarki Karola', 'Mickiewicza Adama', 'Miedziana', 'Mieszka I', - 'Miła', 'Miodowa', 'Młynarska', 'Młyńska', 'Modlińska', 'Modra', 'Modrzejewskiej Heleny', - 'Modrzewiowa', 'Mokra', 'Moniuszki Stanisława', 'Morcinka Gustawa', 'Morelowa', 'Morska', - 'Mostowa', 'Myśliwska', 'Nadbrzeżna', 'Nadrzeczna', 'Nałkowskiej Zofii', 'Narutowicza Gabriela', - 'Niecała', 'Niedziałkowskiego Mieczysława', 'Niemcewicza Juliana Ursyna', 'Niepodległości', - 'Niepodległości Al.', 'Niska', 'Norwida Cypriana Kamila', 'Nowa', 'Nowowiejska', 'Nowowiejskiego Feliksa', + '1 Maja', '3 Maja', '11 Listopada', 'Agrestowa', 'Akacjowa', 'Andersa', 'Armii Krajowej', + 'Asnyka', 'Astrów', 'Azaliowa', 'Baczyńskiego', 'Bałtycka', 'Barlickiego', 'Batalionów Chłopskich', + 'Batorego', 'Bema', 'Beskidzka', 'Białostocka', 'Bielska', 'Bieszczadzka', 'Błękitna', + 'Boczna', 'Bogusławskiego', 'Bohaterów Westerplatte', 'Bolesława Chrobrego', + 'Bolesława Krzywoustego', 'Borowa', 'Botaniczna', 'Bracka', 'Bratków', 'Broniewskiego', + 'Brzechwy', 'Brzoskwiniowa', 'Brzozowa', 'Budowlanych', 'Bukowa', 'Bursztynowa', + 'Bydgoska', 'Bytomska', 'Cedrowa', 'Cegielniana', 'Ceglana', 'Chabrowa', 'Chełmońskiego', + 'Chłodna', 'Chłopska', 'Chmielna', 'Chopina Fryderyka', 'Chorzowska', + 'Ciasna', 'Cicha', 'Cieszyńska', 'Cisowa', 'Cmentarna', 'Curie-Skłodowskiej', + 'Czarnieckiego', 'Czereśniowa', 'Częstochowska', 'Czwartaków', 'Daleka', 'Daszyńskiego', + 'Dąbrowskiego', 'Dąbrowskiej', 'Dąbrowszczaków', 'Dąbrówki', 'Dębowa', 'Diamentowa', 'Długa', + 'Długosza', 'Dmowskiego', 'Dobra', 'Dolna', 'Dożynkowa', 'Drzymały', + 'Dworcowa', 'Dworska', 'Działkowa', 'Energetyków', 'Fabryczna', + 'Fałata', 'Fiołkowa', 'Folwarczna', 'Franciszkańska', 'Francuska', 'Fredry', + 'Gagarina', 'Gajowa', 'Gałczyńskiego', 'Gdańska', 'Gdyńska', + 'Gliwicka', 'Głogowa', 'Głogowska', 'Głowackiego', 'Główna', 'Gminna', 'Gnieźnieńska', + 'Gojawiczyńskiej', 'Gołębia', 'Gościnna', 'Górna', 'Górnicza', 'Górnośląska', + 'Grabowa', 'Graniczna', 'Granitowa', 'Grochowska', 'Grodzka', 'Grota-Roweckiego', + 'Grottgera', 'Grójecka', 'Grunwaldzka', 'Grzybowa', 'Hallera', 'Handlowa', + 'Harcerska', 'Hetmańska', 'Hoża', 'Husarska', 'Hutnicza', 'Inżynierska', 'Iwaszkiewicza', + 'Jagiellońska', 'Os. Jagiellońskie', 'Jagiełły', 'Jagodowa', 'Jałowcowa', + 'Jana Pawła II', 'Al. Jana Pawła II', 'Jaracza', 'Jarzębinowa', 'Jaskółcza', + 'Jasna', 'Jastrzębia', 'Jaśminowa', 'Jaworowa', 'Al. Jerozolimskie', 'Jesienna', 'Jesionowa', + 'Jeżynowa', 'Jodłowa', 'Kalinowa', 'Kaliska', 'Kamienna', 'Karłowicza', + 'Karpacka', 'Kartuska', 'Kasprowicza', 'Kasprzaka Marcina', 'Kasztanowa', 'Kaszubska', + 'Katowicka', 'Kazimierza Wielkiego', 'Kielecka', 'Kilińskiego', 'Kleeberga', + 'Klonowa', 'Kłosowa', 'Kochanowskiego', 'Kolberga', 'Kolejowa', 'Kolorowa', + 'Kołłątaja', 'Kołobrzeska', 'Konarskiego', + 'Konopnickiej', 'Konstytucji 3 Maja', 'Konwaliowa', 'Kopalniana', 'Kopernika', + 'Koralowa', 'Korczaka', 'Korfantego', 'Kosmonautów', 'Kossaka', + 'Kosynierów', 'Koszalińska', 'Koszykowa', 'Kościelna', 'Kościuszki', 'Pl. Kościuszki', + 'Kowalska', 'Krakowska', 'Krańcowa', 'Krasickiego', 'Krasińskiego', + 'Kraszewskiego', 'Kresowa', 'Kręta', 'Królewska', 'Królowej Jadwigi', + 'Krótka', 'Krucza', 'Kruczkowskiego', 'Krzywa', 'Księżycowa', 'Kujawska', 'Kusocińskiego', + 'Kwiatkowskiego', 'Kwiatowa', 'Lawendowa', 'Lazurowa', 'Lechicka', 'Legionów', + 'Legnicka', 'Lelewela', 'Leszczynowa', 'Leśmiana', 'Leśna', 'Letnia', + 'Ligonia', 'Liliowa', 'Limanowskiego', 'Lipowa', 'Lisia', 'Litewska', + 'Lompy', 'Lotnicza', 'Lotników', 'Lubelska', 'Ludowa', 'Lwowska', 'Łabędzia', + 'Łagiewnicka', 'Łanowa', 'Łączna', 'Łąkowa', 'Łokietka', 'Łomżyńska', + 'Łowicka', 'Łódzka', 'Łukasiewicza', 'Łużycka', 'Maczka', + 'Magazynowa', 'Majowa', 'Makowa', 'Makuszyńskiego', 'Malczewskiego', 'Malinowa', + 'Mała', 'Małachowskiego', 'Małopolska', 'Marszałkowska', 'Matejki', + 'Mazowiecka', 'Mazurska', 'Miarki', 'Mickiewicza', 'Miedziana', 'Mieszka I', + 'Miła', 'Miodowa', 'Młynarska', 'Młyńska', 'Modlińska', 'Modra', 'Modrzejewskiej', + 'Modrzewiowa', 'Mokra', 'Moniuszki', 'Morcinka', 'Morelowa', 'Morska', + 'Mostowa', 'Myśliwska', 'Nadbrzeżna', 'Nadrzeczna', 'Nałkowskiej', 'Narutowicza', + 'Niecała', 'Niedziałkowskiego', 'Niemcewicza', 'Niepodległości', + 'Al. Niepodległości', 'Niska', 'Norwida', 'Nowa', 'Nowowiejska', 'Nowowiejskiego', 'Nowy Świat', 'Obrońców Westerplatte', 'Odrodzenia', 'Odrzańska', 'Ogrodowa', 'Okopowa', - 'Okólna', 'Okrężna', 'Okrzei Stefana', 'Okulickiego Leopolda', 'Olchowa', 'Olimpijska', - 'Olsztyńska', 'Opolska', 'Orkana Władysława', 'Orla', 'Orzechowa', 'Orzeszkowej Elizy', - 'Osiedlowa', 'Oświęcimska', 'Owocowa', 'Paderewskiego Ignacego', 'Parkowa', 'Partyzantów', - 'Patriotów', 'Pawia', 'Perłowa', 'Piaskowa', 'Piastowska', 'Piastowskie Os.', 'Piekarska', - 'Piękna', 'Piłsudskiego Józefa', 'Piłsudskiego Józefa', 'Piłsudskiego Józefa Al.', - 'Piotrkowska', 'Piwna', 'Plater Emilii', 'Plebiscytowa', 'Płocka', 'Pocztowa', 'Podchorążych', + 'Okólna', 'Okrężna', 'Okrzei', 'Okulickiego', 'Olchowa', 'Olimpijska', + 'Olsztyńska', 'Opolska', 'Orkana', 'Orla', 'Orzechowa', 'Orzeszkowej', + 'Osiedlowa', 'Oświęcimska', 'Owocowa', 'Paderewskiego', 'Parkowa', 'Partyzantów', + 'Patriotów', 'Pawia', 'Perłowa', 'Piaskowa', 'Piastowska', 'Os. Piastowskie', 'Piekarska', + 'Piękna', 'Piłsudskiego', 'Al. Piłsudskiego', + 'Piotrkowska', 'Piwna', 'Emilii Plater', 'Plebiscytowa', 'Płocka', 'Pocztowa', 'Podchorążych', 'Podgórna', 'Podhalańska', 'Podleśna', 'Podmiejska', 'Podwale', 'Pogodna', 'Pokoju', - 'Pola Wincentego', 'Polna', 'Południowa', 'Pomorska', 'Poniatowskiego Józefa', 'Poniatowskiego Józefa', - 'Popiełuszki Jerzego', 'Poprzeczna', 'Portowa', 'Porzeczkowa', 'Powstańców', 'Powstańców Śląskich', + 'Wincentego Pola', 'Polna', 'Południowa', 'Pomorska', 'Poniatowskiego', + 'Popiełuszki', 'Poprzeczna', 'Portowa', 'Porzeczkowa', 'Powstańców', 'Powstańców Śląskich', 'Powstańców Wielkopolskich', 'Poziomkowa', 'Poznańska', 'Północna', 'Promienna', - 'Prosta', 'Prusa Bolesława', 'Przechodnia', 'Przemysłowa', 'Przybyszewskiego Stanisława', - 'Przyjaźni', 'Pszenna', 'Ptasia', 'Pułaskiego Kazimierza', 'Pułaskiego Kazimierza', - 'Puławska', 'Puszkina Aleksandra', 'Racławicka', 'Radomska', 'Radosna', 'Rataja Macieja', - 'Reja Mikołaja', 'Rejtana Tadeusza', 'Reymonta Władysława', 'Reymonta Władysława Stanisława', + 'Prosta', 'Bolesława Prusa', 'Przechodnia', 'Przemysłowa', 'Przybyszewskiego', + 'Przyjaźni', 'Pszenna', 'Ptasia', 'Pułaskiego', 'Puławska', 'Puszkina', 'Racławicka', + 'Radomska', 'Radosna', 'Rataja', 'Reja', 'Rejtana', 'Reymonta', 'Robotnicza', 'Rodzinna', 'Rolna', 'Rolnicza', 'Równa', 'Różana', 'Rubinowa', 'Rumiankowa', - 'Rybacka', 'Rybna', 'Rybnicka', 'Rycerska', 'Rynek', 'Rynek Rynek', 'Rzeczna', 'Rzemieślnicza', - 'Sadowa', 'Sandomierska', 'Saperów', 'Sawickiej Hanki', 'Sądowa', 'Sąsiedzka', 'Senatorska', - 'Siemiradzkiego Henryka', 'Sienkiewicza Henryka', 'Sienna', 'Siewna', 'Sikorskiego Władysława', - 'Sikorskiego Władysława', 'Skargi Piotra', 'Skargi Piotra', 'Składowa', 'Skłodowskiej-Curie Marii', - 'Skośna', 'Skrajna', 'Słoneczna', 'Słonecznikowa', 'Słowackiego Juliusza', 'Słowiańska', - 'Słowicza', 'Sobieskiego Jana', 'Sobieskiego Jana III', 'Sokola', 'Solidarności Al.', - 'Solna', 'Solskiego Ludwika', 'Sosnowa', 'Sowia', 'Sowińskiego Józefa', 'Spacerowa', - 'Spokojna', 'Sportowa', 'Spółdzielcza', 'Srebrna', 'Staffa Leopolda', 'Stalowa', 'Staromiejska', - 'Starowiejska', 'Staszica Stanisława', 'Stawowa', 'Stolarska', 'Strażacka', 'Stroma', - 'Struga Andrzeja', 'Strumykowa', 'Strzelecka', 'Studzienna', 'Stwosza Wita', 'Sucha', - 'Sucharskiego Henryka', 'Szafirowa', 'Szarych Szeregów', 'Szczecińska', 'Szczęśliwa', - 'Szeroka', 'Szewska', 'Szkolna', 'Szmaragdowa', 'Szpitalna', 'Szymanowskiego Karola', - 'Ściegiennego Piotra', 'Śląska', 'Średnia', 'Środkowa', 'Świdnicka', 'Świerkowa', + 'Rybacka', 'Rybna', 'Rybnicka', 'Rycerska', 'Rynek', 'Rzeczna', 'Rzemieślnicza', + 'Sadowa', 'Sandomierska', 'Saperów', 'Sawickiej', 'Sądowa', 'Sąsiedzka', 'Senatorska', + 'Siemiradzkiego', 'Sienkiewicza', 'Sienna', 'Siewna', + 'Sikorskiego', 'Piotra Skargi', 'Składowa', 'Skłodowskiej-Curie', + 'Skośna', 'Skrajna', 'Słoneczna', 'Słonecznikowa', 'Słowackiego', 'Słowiańska', + 'Słowicza', 'Sobieskiego', 'Jana III Sobieskiego', 'Sokola', 'Al. Solidarności', + 'Solna', 'Solskiego', 'Sosnowa', 'Sowia', 'Sowińskiego', 'Spacerowa', + 'Spokojna', 'Sportowa', 'Spółdzielcza', 'Srebrna', 'Staffa ', 'Stalowa', 'Staromiejska', + 'Starowiejska', 'Staszica', 'Stawowa', 'Stolarska', 'Strażacka', 'Stroma', + 'Struga', 'Strumykowa', 'Strzelecka', 'Studzienna', 'Wita Stwosza', 'Sucha', + 'Sucharskiego', 'Szafirowa', 'Szarych Szeregów', 'Szczecińska', 'Szczęśliwa', + 'Szeroka', 'Szewska', 'Szkolna', 'Szmaragdowa', 'Szpitalna', 'Szymanowskiego', + 'Ściegiennego', 'Śląska', 'Średnia', 'Środkowa', 'Świdnicka', 'Świerkowa', 'Świętojańska', 'Świętokrzyska', 'Targowa', 'Tatrzańska', 'Tęczowa', 'Topolowa', - 'Torowa', 'Toruńska', 'Towarowa', 'Traugutta Romualda', 'Truskawkowa', 'Tulipanowa', - 'Tulipanów', 'Turkusowa', 'Turystyczna', 'Tuwima Juliana', 'Tylna', 'Tysiąclecia', 'Ułańska', - 'Urocza', 'Wałowa', 'Wandy', 'Wańkowicza Melchiora', 'Wapienna', 'Warmińska', 'Warszawska', - 'Waryńskiego Ludwika', 'Wąska', 'Wczasowa', 'Wesoła', 'Węglowa', 'Widok', 'Wiejska', - 'Wielkopolska', 'Wieniawskiego Henryka', 'Wierzbowa', 'Wilcza', 'Wileńska', 'Willowa', - 'Wiosenna', 'Wiśniowa', 'Witosa Wincentego', 'Władysława IV', 'Wodna', 'Wojska Polskiego', - 'Wojska Polskiego Al.', 'Wolności', 'Wolności Pl.', 'Wolska', 'Wołodyjowskiego Michała', - 'Wrocławska', 'Wronia', 'Wróblewskiego Walerego', 'Wrzosowa', 'Wschodnia', 'Wspólna', - 'Wybickiego Józefa', 'Wysoka', 'Wyspiańskiego Stanisława', 'Wyszyńskiego Stefana', - 'Wyzwolenia', 'Wyzwolenia Al.', 'Zachodnia', 'Zacisze', 'Zajęcza', 'Zakątek', 'Zakopiańska', - 'Zamenhofa Ludwika', 'Zamkowa', 'Zapolskiej Gabrieli', 'Zbożowa', 'Zdrojowa', 'Zgierska', + 'Torowa', 'Toruńska', 'Towarowa', 'Traugutta', 'Truskawkowa', 'Tulipanowa', + 'Tulipanów', 'Turkusowa', 'Turystyczna', 'Tuwima', 'Tylna', 'Tysiąclecia', 'Ułańska', + 'Urocza', 'Wałowa', 'Wandy', 'Wańkowicza', 'Wapienna', 'Warmińska', 'Warszawska', + 'Waryńskiego', 'Wąska', 'Wczasowa', 'Wesoła', 'Węglowa', 'Widok', 'Wiejska', + 'Wielkopolska', 'Wieniawskiego', 'Wierzbowa', 'Wilcza', 'Wileńska', 'Willowa', + 'Wiosenna', 'Wiśniowa', 'Witosa', 'Władysława IV', 'Wodna', 'Wojska Polskiego', + 'Al. Wojska Polskiego', 'Wolności', 'Pl. Wolności', 'Wolska', 'Wołodyjowskiego', + 'Wrocławska', 'Wronia', 'Wróblewskiego', 'Wrzosowa', 'Wschodnia', 'Wspólna', + 'Wybickiego', 'Wysoka', 'Wyspiańskiego', 'Wyszyńskiego', + 'Wyzwolenia', 'Al. Wyzwolenia', 'Zachodnia', 'Zacisze', 'Zajęcza', 'Zakątek', 'Zakopiańska', + 'Zamenhofa', 'Zamkowa', 'Zapolskiej', 'Zbożowa', 'Zdrojowa', 'Zgierska', 'Zielna', 'Zielona', 'Złota', 'Zwierzyniecka', 'Zwycięstwa', 'Źródlana', 'Żabia', - 'Żeglarska', 'Żelazna', 'Żeromskiego Stefana', 'Żniwna', 'Żołnierska', 'Żółkiewskiego Stanisława', - 'Żurawia', 'Żwirki Franciszka i Wigury Stanisława', 'Żwirki i Wigury', 'Żwirowa', - 'Żytnia', + 'Żeglarska', 'Żelazna', 'Żeromskiego', 'Żniwna', 'Żołnierska', 'Żółkiewskiego', + 'Żurawia', 'Żwirki i Wigury', 'Żwirowa', 'Żytnia', ]; public function city() diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Color.php b/api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Color.php new file mode 100644 index 0000000000..afc161a887 --- /dev/null +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/pl_PL/Color.php @@ -0,0 +1,40 @@ + 'D', - 'kujawsko-pomorskie' => 'C', - 'lubelskie' => 'L', - 'lubuskie' => 'F', - 'łódzkie' => 'E', - 'małopolskie' => 'K', - 'mazowieckie' => 'W', - 'opolskie' => 'O', - 'podkarpackie' => 'R', - 'podlaskie' => 'B', - 'pomorskie' => 'G', - 'śląskie' => 'S', - 'świętokrzyskie' => 'T', - 'warmińsko-mazurskie' => 'N', - 'wielkopolskie' => 'P', - 'zachodniopomorskie' => 'Z', + 'dolnośląskie' => ['D', 'V'], + 'kujawsko-pomorskie' => ['C'], + 'lubelskie' => ['L'], + 'lubuskie' => ['F'], + 'łódzkie' => ['E'], + 'małopolskie' => ['K', 'J'], + 'mazowieckie' => ['W', 'A'], + 'opolskie' => ['O'], + 'podkarpackie' => ['R', 'Y'], + 'podlaskie' => ['B'], + 'pomorskie' => ['G', 'X'], + 'śląskie' => ['S', 'I'], + 'świętokrzyskie' => ['T'], + 'warmińsko-mazurskie' => ['N'], + 'wielkopolskie' => ['P', 'M'], + 'zachodniopomorskie' => ['Z'], ]; /** * @var array list of special vehicle registration number prefixes. */ protected static $specials = [ - 'army' => 'U', - 'services' => 'H', + 'army' => ['U'], + 'services' => ['H'], ]; /** * @var array list of Polish counties and respective vehicle registration number prefixes. */ protected static $counties = [ - 'D' => [ + 'dolnośląskie' => [ 'Jelenia Góra' => ['J'], 'Legnica' => ['L'], 'Wałbrzych' => ['B'], @@ -77,7 +77,7 @@ class LicensePlate extends Base 'zgorzelecki' => ['ZG'], 'złotoryjski' => ['ZL'], ], - 'C' => [ + 'kujawsko-pomorskie' => [ 'Bydgoszcz' => ['B'], 'Grudziądz' => ['G'], 'Toruń' => ['T'], @@ -102,7 +102,7 @@ class LicensePlate extends Base 'włocławski' => ['WL'], 'żniński' => ['ZN'], ], - 'L' => [ + 'lubelskie' => [ 'Biała Podlaska' => ['B'], 'Chełm' => ['C'], 'Lublin' => ['U'], @@ -128,7 +128,7 @@ class LicensePlate extends Base 'włodawski' => ['WL'], 'zamojski' => ['ZA'], ], - 'F' => [ + 'lubuskie' => [ 'Gorzów Wielkopolski' => ['G'], 'Zielona Góra' => ['Z'], 'gorzowski' => ['GW'], @@ -144,8 +144,8 @@ class LicensePlate extends Base 'żagański' => ['ZG'], 'żarski' => ['ZA'], ], - 'E' => [ - 'Łódź' => ['L'], + 'łódzkie' => [ + 'Łódź' => ['L', 'D'], 'Piotrków Trybunalski' => ['P'], 'Skierniewice' => ['S'], 'brzeziński' => ['BR'], @@ -170,8 +170,8 @@ class LicensePlate extends Base 'zduńskowolski' => ['ZD'], 'zgierski' => ['ZG'], ], - 'K' => [ - 'Kraków' => ['R'], + 'małopolskie' => [ + 'Kraków' => ['R', 'K'], 'Nowy Sącz' => ['N'], 'Tarnów' => ['T'], 'bocheński' => ['BA', 'BC'], @@ -179,7 +179,7 @@ class LicensePlate extends Base 'chrzanowski' => ['CH'], 'dąbrowski' => ['DA'], 'gorlicki' => ['GR'], - 'krakowski' => ['RA'], + 'krakowski' => ['RA', 'RK'], 'limanowski' => ['LI'], 'miechowski' => ['MI'], 'myślenicki' => ['MY'], @@ -194,7 +194,7 @@ class LicensePlate extends Base 'wadowicki' => ['WA'], 'wielicki' => ['WI'], ], - 'W' => [ + 'mazowieckie' => [ 'Ostrołęka' => ['O'], 'Płock' => ['P'], 'Radom' => ['R'], @@ -216,7 +216,7 @@ class LicensePlate extends Base 'ostrołęcki' => ['OS'], 'ostrowski' => ['OR'], 'otwocki' => ['OT'], - 'piaseczyński' => ['PA', 'PI'], + 'piaseczyński' => ['PA', 'PI', 'PW', 'PX'], 'płocki' => ['PL'], 'płoński' => ['PN'], 'pruszkowski' => ['PP', 'PR', 'PS'], @@ -238,7 +238,7 @@ class LicensePlate extends Base 'żuromiński' => ['ZU'], 'żyrardowski' => ['ZY'], ], - 'O' => [ + 'opolskie' => [ 'Opole' => ['P'], 'brzeski' => ['B'], 'głubczycki' => ['GL'], @@ -252,7 +252,7 @@ class LicensePlate extends Base 'prudnicki' => ['PR'], 'strzelecki' => ['ST'], ], - 'R' => [ + 'podkarpackie' => [ 'Krosno' => ['K'], 'Przemyśl' => ['P'], 'Rzeszów' => ['Z'], @@ -273,18 +273,18 @@ class LicensePlate extends Base 'przemyski' => ['PR'], 'przeworski' => ['PZ'], 'ropczycko-sędziszowski' => ['RS'], - 'rzeszowski' => ['ZE'], + 'rzeszowski' => ['ZE', 'ZR', 'ZZ'], 'sanocki' => ['SA'], 'stalowowolski' => ['ST'], 'strzyżowski' => ['SR'], 'tarnobrzeski' => ['TA'], ], - 'B' => [ + 'podlaskie' => [ 'Białystok' => ['I'], 'Łomża' => ['L'], 'Suwałki' => ['S'], 'augustowski' => ['AU'], - 'białostocki' => ['IA'], + 'białostocki' => ['IA', 'IB'], 'bielski' => ['BI'], 'grajewski' => ['GR'], 'hajnowski' => ['HA'], @@ -298,7 +298,7 @@ class LicensePlate extends Base 'wysokomazowiecki' => ['WM'], 'zambrowski' => ['ZA'], ], - 'G' => [ + 'pomorskie' => [ 'Gdańsk' => ['D'], 'Gdynia' => ['A'], 'Słupsk' => ['S'], @@ -307,7 +307,7 @@ class LicensePlate extends Base 'chojnicki' => ['CH'], 'człuchowski' => ['CZ'], 'gdański' => ['DA'], - 'kartuski' => ['KY', 'KA'], + 'kartuski' => ['KA', 'KY', 'KZ'], 'kościerski' => ['KS'], 'kwidzyński' => ['KW'], 'lęborski' => ['LE'], @@ -320,7 +320,7 @@ class LicensePlate extends Base 'tczewski' => ['TC'], 'wejherowski' => ['WE', 'WO'], ], - 'S' => [ + 'śląskie' => [ 'Bielsko-Biała' => ['B'], 'Bytom' => ['Y'], 'Chorzów' => ['H'], @@ -340,9 +340,9 @@ class LicensePlate extends Base 'Tychy' => ['T'], 'Zabrze' => ['Z'], 'Żory' => ['ZO'], - 'będziński' => ['BE'], + 'będziński' => ['BE', 'BN', 'E'], 'bielski' => ['BI'], - 'cieszyński' => ['CN', 'CI'], + 'cieszyński' => ['CI', 'CN'], 'częstochowski' => ['CZ'], 'gliwicki' => ['GL'], 'kłobucki' => ['KL'], @@ -358,7 +358,7 @@ class LicensePlate extends Base 'zawierciański' => ['ZA'], 'żywiecki' => ['ZY'], ], - 'T' => [ + 'świętokrzyskie' => [ 'Kielce' => ['K'], 'buski' => ['BU'], 'jędrzejowski' => ['JE'], @@ -374,7 +374,7 @@ class LicensePlate extends Base 'staszowski' => ['SZ'], 'włoszczowski' => ['LW'], ], - 'N' => [ + 'warmińsko-mazurskie' => [ 'Elbląg' => ['E'], 'Olsztyn' => ['O'], 'bartoszycki' => ['BA'], @@ -397,7 +397,7 @@ class LicensePlate extends Base 'szczycieński' => ['SZ'], 'węgorzewski' => ['WE'], ], - 'P' => [ + 'wielkopolskie' => [ 'Kalisz' => ['A', 'K'], 'Konin' => ['KO', 'N'], 'Leszno' => ['L'], @@ -434,7 +434,7 @@ class LicensePlate extends Base 'wrzesiński' => ['WR'], 'złotowski' => ['ZL'], ], - 'Z' => [ + 'zachodniopomorskie' => [ 'Koszalin' => ['K'], 'Szczecin' => ['S', 'Z'], 'Świnoujście' => ['SW'], @@ -457,10 +457,10 @@ class LicensePlate extends Base 'świdwiński' => ['SD'], 'wałecki' => ['WA'], ], - 'U' => [ + 'army' => [ 'Siły Zbrojne Rzeczypospolitej Polskiej' => ['A', 'B', 'C', 'D', 'E', 'G', 'I', 'J', 'K', 'L'], ], - 'H' => [ + 'services' => [ 'Centralne Biuro Antykorupcyjne' => ['A'], 'Służba Ochrony Państwa' => ['BA', 'BB', 'BE', 'BF', 'BG'], 'Służba Celno-Skarbowa' => ['CA', 'CB', 'CC', 'CD', 'CE', 'CF', 'CG', 'CH', 'CJ', 'CK', 'CL', 'CM', 'CN', 'CO', 'CP', 'CR'], @@ -514,12 +514,13 @@ public static function licensePlate( ?array $counties = null ): string { $voivodeshipsAvailable = static::$voivodeships + ($special ? static::$specials : []); - $voivodeshipCode = static::selectRandomArea($voivodeshipsAvailable, $voivodeships); + $voivodeshipSelected = static::selectRandomArea($voivodeshipsAvailable, $voivodeships); + $voivodeshipCode = static::randomElement($voivodeshipsAvailable[$voivodeshipSelected]); - $countiesAvailable = static::$counties[$voivodeshipCode]; + $countiesAvailable = static::$counties[$voivodeshipSelected]; $countySelected = self::selectRandomArea($countiesAvailable, $counties); - $countyCode = static::randomElement($countySelected); + $countyCode = static::randomElement(static::$counties[$voivodeshipSelected][$countySelected]); $suffix = static::regexify(static::randomElement(strlen($countyCode) === 1 ? static::$plateSuffixesGroup1 : static::$plateSuffixesGroup2)); @@ -528,6 +529,8 @@ public static function licensePlate( /** * Selects random area from the list of available and requested. + * + * @return string */ protected static function selectRandomArea(array $available, ?array $requested) { @@ -537,6 +540,6 @@ protected static function selectRandomArea(array $available, ?array $requested) $requested = array_keys($available); } - return $available[static::randomElement($requested)]; + return static::randomElement($requested); } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/PhoneNumber.php b/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/PhoneNumber.php index 6717def5a5..6601658306 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/PhoneNumber.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/PhoneNumber.php @@ -83,7 +83,7 @@ public static function phone($formatted = true) ['landline', null], ]); - return call_user_func("static::{$options[0]}", $formatted, $options[1]); + return call_user_func([static::class, $options[0]], $formatted, $options[1]); } /** @@ -135,7 +135,7 @@ public function phoneNumber() { $method = static::randomElement(['cellphoneNumber', 'landlineNumber']); - return call_user_func("static::$method", true); + return call_user_func([static::class, $method], true); } /** @@ -145,6 +145,6 @@ public static function phoneNumberCleared() { $method = static::randomElement(['cellphoneNumber', 'landlineNumber']); - return call_user_func("static::$method", false); + return call_user_func([static::class, $method], false); } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Text.php b/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Text.php index d177c8725c..ce60728557 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Text.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/pt_BR/Text.php @@ -5,52 +5,52 @@ class Text extends \Faker\Provider\Text { /** - * The Project Gutenberg EBook of Dom Casmurro, by Machado de Assis + * The Project Gutenberg EBook of Dom Casmurro, by Machado de Assis * - * This eBook is for the use of anyone anywhere in the United States and most - * other parts of the world at no cost and with almost no restrictions - * whatsoever. You may copy it, give it away or re-use it under the terms of - * the Project Gutenberg License included with this eBook or online at - * www.gutenberg.org. If you are not located in the United States, you'll have - * to check the laws of the country where you are located before using this ebook. + * This eBook is for the use of anyone anywhere in the United States and most + * other parts of the world at no cost and with almost no restrictions + * whatsoever. You may copy it, give it away or re-use it under the terms of + * the Project Gutenberg License included with this eBook or online at + * www.gutenberg.org. If you are not located in the United States, you'll have + * to check the laws of the country where you are located before using this ebook. * - * Title: Dom Casmurro + * Title: Dom Casmurro * - * Author: Machado de Assis + * Author: Machado de Assis * - * Release Date: October 15, 2017 [EBook #55752] + * Release Date: October 15, 2017 [EBook #55752] * - * Language: Portuguese + * Language: Portuguese * - * *** START OF THIS PROJECT GUTENBERG EBOOK DOM CASMURRO *** + * *** START OF THIS PROJECT GUTENBERG EBOOK DOM CASMURRO *** * - * Produced by Laura Natal Rodriguez & Marc D'Hooghe at Free - * Literature (online soon in an extended version,also linking - * to free sources for education worldwide ... MOOC's, - * educational materials,...) (Images generously made available - * by the Bibliotheca Nacional Digital Brasil.) + * Produced by Laura Natal Rodriguez & Marc D'Hooghe at Free + * Literature (online soon in an extended version,also linking + * to free sources for education worldwide ... MOOC's, + * educational materials,...) (Images generously made available + * by the Bibliotheca Nacional Digital Brasil.) * - * DOM CASMURRO + * DOM CASMURRO * - * POR + * POR * - * MACHADO DE ASSIS + * MACHADO DE ASSIS * - * DA ACADEMIA BRAZILEIRA + * DA ACADEMIA BRAZILEIRA * - * H. GARNIER, LIVREIRO-EDITOR + * H. GARNIER, LIVREIRO-EDITOR * - * RUA MOREIRA CEZAR, 71 + * RUA MOREIRA CEZAR, 71 * - * RIO DE JANEIRO + * RIO DE JANEIRO * - * 6, RUE DES SAINTS-PÈRES, 6 + * 6, RUE DES SAINTS-PÈRES, 6 * - * PARIZ + * PARIZ * - * @see https://www.gutenberg.org/cache/epub/55752/pg55752.txt + * @see https://www.gutenberg.org/cache/epub/55752/pg55752.txt * - * @var string + * @var string */ protected static $baseText = <<<'EOT' I diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/Person.php index d8ef51d005..9077004135 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/ro_RO/Person.php @@ -182,6 +182,7 @@ protected function getDateOfBirth($dateOfBirth) $dateOfBirthFinal = implode('-', $dateOfBirthParts); $date = \DateTime::createFromFormat('Y-m-d', $dateOfBirthFinal); + //a full (invalid) date might have been supplied, check if it converts if ($date->format('Y-m-d') !== $dateOfBirthFinal) { throw new \InvalidArgumentException("Invalid date of birth - '{$date->format('Y-m-d')}' generated based on '{$dateOfBirth}' received"); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Person.php index 95ec8069a8..b0e17d4e19 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/ru_RU/Person.php @@ -5,8 +5,8 @@ class Person extends \Faker\Provider\Person { protected static $maleNameFormats = [ - '{{firstNameMale}} {{middleNameMale}} {{lastName}}', - '{{lastName}} {{firstNameMale}} {{middleNameMale}}', + '{{firstNameMale}} {{middleNameMale}} {{lastNameMale}}', + '{{lastNameMale}} {{firstNameMale}} {{middleNameMale}}', ]; /** @@ -14,8 +14,8 @@ class Person extends \Faker\Provider\Person * That list of MALE last names could be safely extended to FEMALE list just by adding 'a' letter at the end */ protected static $femaleNameFormats = [ - '{{firstNameFemale}} {{middleNameFemale}} {{lastName}}а', - '{{lastName}}а {{firstNameFemale}} {{middleNameFemale}}', + '{{firstNameFemale}} {{middleNameFemale}} {{lastNameFemale}}', + '{{lastNameFemale}} {{firstNameFemale}} {{middleNameFemale}}', ]; /** @@ -165,16 +165,24 @@ public function middleName($gender = null) */ public function lastName($gender = null) { - $lastName = static::randomElement(static::$lastName); - if (static::GENDER_FEMALE === $gender) { - return $lastName . 'а'; + return $this->lastNameFemale(); } if (static::GENDER_MALE === $gender) { - return $lastName; + return $this->lastNameMale(); } - return $lastName . static::randomElement(static::$lastNameSuffix); + return static::randomElement(static::$lastName) . static::randomElement(static::$lastNameSuffix); + } + + public function lastNameMale(): string + { + return static::randomElement(static::$lastName); + } + + public function lastNameFemale(): string + { + return static::randomElement(static::$lastName) . 'а'; } } diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/sk_SK/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/sk_SK/Person.php index 5f8fe70adf..583759ba4d 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/sk_SK/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/sk_SK/Person.php @@ -34,7 +34,7 @@ class Person extends \Faker\Provider\Person 'Vlastimil', 'Boleslav', 'Eduard', 'Jozef', 'Víťazoslav', 'Blahoslav', 'Beňadik', 'Adrián', 'Gabriel', 'Marián', 'Emanuel', 'Miroslav', 'Benjamín', 'Hugo', 'Richard', 'Izidor', 'Zoltán', 'Albert', 'Igor', 'Július', 'Aleš', 'Fedor', 'Rudolf', 'Valér', 'Marcel', 'Ervín', 'Slavomír', 'Vojtech', 'Juraj', 'Marek', 'Jaroslav', 'Žigmund', 'Florián', 'Roland', 'Pankrác', 'Servác', 'Bonifác', 'Svetozár', 'Bernard', - 'Júlia', 'Urban', 'Dušan', 'Viliam', 'Ferdinand', 'Norbert', 'Róbert', 'Medard', 'Zlatko', 'Anton', 'Vasil', 'Vít', 'Adolf', 'Vratislav', + 'Júlia', 'Urban', 'Dušan', 'Viliam', 'Ferdinand', 'Norbert', 'Róbert', 'Medard', 'Zlatko', 'Anton', 'Vasil', 'Vít', 'Vratislav', 'Alfréd', 'Alojz', 'Ján', 'Tadeáš', 'Ladislav', 'Peter', 'Pavol', 'Miloslav', 'Prokop', 'Cyril', 'Metod', 'Patrik', 'Oliver', 'Ivan', 'Kamil', 'Henrich', 'Drahomír', 'Bohuslav', 'Iľja', 'Daniel', 'Vladimír', 'Jakub', 'Krištof', 'Ignác', 'Gustáv', 'Jerguš', 'Dominik', 'Oskar', 'Vavrinec', 'Ľubomír', 'Mojmír', 'Leonard', 'Tichomír', 'Filip', 'Bartolomej', 'Ľudovít', 'Samuel', 'Augustín', 'Belo', 'Oleg', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/sl_SI/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/sl_SI/Person.php index 08463950a6..20a2946949 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/sl_SI/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/sl_SI/Person.php @@ -25,7 +25,7 @@ class Person extends \Faker\Provider\Person * @see http://www.stat.si/doc/vsebina/05/imena/TOPIMENA_SI.xlsx */ protected static $firstNameMale = [ - 'Adam', 'Adolf', 'Albert', 'Albin', 'Aleks', 'Aleksandar', 'Aleksander', 'Aleksej', 'Alen', + 'Adam', 'Albert', 'Albin', 'Aleks', 'Aleksandar', 'Aleksander', 'Aleksej', 'Alen', 'Alex', 'Aleš', 'Aljaž', 'Aljoša', 'Alojz', 'Alojzij', 'Andraž', 'Andrej', 'Anej', 'Anton', 'Anže', 'Avgust', 'Ažbe', 'Benjamin', 'Bernard', 'Bine', 'Blaž', 'Bogdan', 'Bogomir', 'Bojan', 'Bor', 'Boris', 'Borut', 'Boštjan', 'Božidar', 'Branko', 'Brin', 'Bruno', 'Ciril', diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/sv_SE/Person.php b/api/vendor/fakerphp/faker/src/Faker/Provider/sv_SE/Person.php index c078f6bf8e..7c42f6bd9e 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/sv_SE/Person.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/sv_SE/Person.php @@ -59,7 +59,7 @@ class Person extends \Faker\Provider\Person * @see http://spraakbanken.gu.se/statistik/lbfnamnalf.phtml */ protected static $firstNameMale = [ - 'Abraham', 'Adam', 'Adolf', 'Adrian', 'Agaton', 'Agne', 'Albert', 'Albin', 'Aldor', 'Alex', 'Alexander', 'Alexis', 'Alexius', 'Alf', 'Alfons', 'Alfred', 'Algot', 'Allan', 'Alrik', 'Alvar', 'Alve', 'Amandus', 'Anders', 'André', 'Andreas', 'Anselm', 'Anshelm', 'Antero', 'Anton', 'Antonius', 'Arne', 'Arnold', 'Aron', 'Arthur', 'Artur', 'Arvid', 'Assar', 'Astor', 'August', 'Augustin', 'Axel', + 'Abraham', 'Adam', 'Adrian', 'Agaton', 'Agne', 'Albert', 'Albin', 'Aldor', 'Alex', 'Alexander', 'Alexis', 'Alexius', 'Alf', 'Alfons', 'Alfred', 'Algot', 'Allan', 'Alrik', 'Alvar', 'Alve', 'Amandus', 'Anders', 'André', 'Andreas', 'Anselm', 'Anshelm', 'Antero', 'Anton', 'Antonius', 'Arne', 'Arnold', 'Aron', 'Arthur', 'Artur', 'Arvid', 'Assar', 'Astor', 'August', 'Augustin', 'Axel', 'Bengt', 'Bengt-Göran', 'Bengt-Olof', 'Bengt-Åke', 'Benny', 'Berndt', 'Berne', 'Bernhard', 'Bernt', 'Bert', 'Berth', 'Berthold', 'Bertil', 'Bill', 'Billy', 'Birger', 'Bjarne', 'Björn', 'Bo', 'Boris', 'Bror', 'Bruno', 'Brynolf', 'Börje', 'Carl', 'Carl-Axel', 'Carl-Erik', 'Carl-Gustaf', 'Carl-Gustav', 'Carl-Johan', 'Charles', 'Christer', 'Christian', 'Claes', 'Claes-Göran', 'Clarence', 'Clas', 'Conny', 'Crister', 'Curt', 'Dag', 'Dan', 'Daniel', 'David', 'Dennis', 'Dick', 'Donald', 'Douglas', @@ -121,12 +121,11 @@ class Person extends \Faker\Provider\Person * * @see http://en.wikipedia.org/wiki/Personal_identity_number_(Sweden) * - * @param \DateTime $birthdate - * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE + * @param string $gender Person::GENDER_MALE || Person::GENDER_FEMALE * * @return string on format XXXXXX-XXXX */ - public function personalIdentityNumber(\DateTime $birthdate = null, $gender = null) + public function personalIdentityNumber(?\DateTime $birthdate = null, $gender = null) { if (!$birthdate) { $birthdate = \Faker\Provider\DateTime::dateTimeThisCentury(); diff --git a/api/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Address.php b/api/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Address.php index d67e14977e..00b9eb771e 100644 --- a/api/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Address.php +++ b/api/vendor/fakerphp/faker/src/Faker/Provider/zh_CN/Address.php @@ -101,7 +101,7 @@ class Address extends \Faker\Provider\Address '斯威士兰', '瑞典', '瑞士', '叙利亚', '塔吉克斯坦', '坦桑尼亚', '泰国', '阿拉伯联合酋长国', '多哥', '托克劳群岛', '汤加', '特立尼达和多巴哥', '突尼斯', '土耳其', '土库曼斯坦', - '特克斯和凯科斯群岛(', '图瓦卢', '美国', '乌干达', '乌克兰', + '特克斯和凯科斯群岛', '图瓦卢', '美国', '乌干达', '乌克兰', '英国', '乌拉圭', '乌兹别克斯坦', '瓦努阿图', '梵蒂冈', '委内瑞拉', '越南', '维尔京群岛', '维尔京群岛和圣罗克伊', '威克岛', '瓦里斯和富士那群岛', '西撒哈拉', '也门', '南斯拉夫', diff --git a/api/vendor/graham-campbell/result-type/LICENSE b/api/vendor/graham-campbell/result-type/LICENSE index 9a8accb986..8e7c898886 100644 --- a/api/vendor/graham-campbell/result-type/LICENSE +++ b/api/vendor/graham-campbell/result-type/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020-2022 Graham Campbell +Copyright (c) 2020-2024 Graham Campbell 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/api/vendor/graham-campbell/result-type/composer.json b/api/vendor/graham-campbell/result-type/composer.json index f85e1d1322..32bfc81ed8 100644 --- a/api/vendor/graham-campbell/result-type/composer.json +++ b/api/vendor/graham-campbell/result-type/composer.json @@ -12,10 +12,10 @@ ], "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9" + "phpoption/phpoption": "^1.9.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "autoload": { "psr-4": { diff --git a/api/vendor/graham-campbell/result-type/src/Error.php b/api/vendor/graham-campbell/result-type/src/Error.php index add9b2d714..2c37c3e2b7 100644 --- a/api/vendor/graham-campbell/result-type/src/Error.php +++ b/api/vendor/graham-campbell/result-type/src/Error.php @@ -19,6 +19,7 @@ /** * @template T * @template E + * * @extends \GrahamCampbell\ResultType\Result */ final class Error extends Result diff --git a/api/vendor/graham-campbell/result-type/src/Success.php b/api/vendor/graham-campbell/result-type/src/Success.php index b68ad57e7a..27cd85eecb 100644 --- a/api/vendor/graham-campbell/result-type/src/Success.php +++ b/api/vendor/graham-campbell/result-type/src/Success.php @@ -19,6 +19,7 @@ /** * @template T * @template E + * * @extends \GrahamCampbell\ResultType\Result */ final class Success extends Result diff --git a/api/vendor/laravel/serializable-closure/README.md b/api/vendor/laravel/serializable-closure/README.md index b1efef38f5..ee0d01a15c 100644 --- a/api/vendor/laravel/serializable-closure/README.md +++ b/api/vendor/laravel/serializable-closure/README.md @@ -51,9 +51,10 @@ echo $closure(); // james; ### Caveats -1. Creating **anonymous classes** within closures is not supported. -2. Using attributes within closures is not supported. -3. Serializing closures on REPL environments such as Laravel Tinker is not supported. +* Anonymous classes cannot be created within closures. +* Attributes cannot be used within closures. +* Serializing closures on REPL environments like Laravel Tinker is not supported. +* Serializing closures that reference objects with readonly properties is not supported. ## Contributing diff --git a/api/vendor/laravel/serializable-closure/composer.json b/api/vendor/laravel/serializable-closure/composer.json index 7142366b1e..d2d94f6248 100644 --- a/api/vendor/laravel/serializable-closure/composer.json +++ b/api/vendor/laravel/serializable-closure/composer.json @@ -21,10 +21,11 @@ "php": "^7.3|^8.0" }, "require-dev": { - "nesbot/carbon": "^2.61", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", + "nesbot/carbon": "^2.61|^3.0", "pestphp/pest": "^1.21.3", "phpstan/phpstan": "^1.8.2", - "symfony/var-dumper": "^5.4.11" + "symfony/var-dumper": "^5.4.11|^6.2.0|^7.0.0" }, "autoload": { "psr-4": { diff --git a/api/vendor/laravel/serializable-closure/src/Serializers/Native.php b/api/vendor/laravel/serializable-closure/src/Serializers/Native.php index 4a04b981e2..7325490260 100644 --- a/api/vendor/laravel/serializable-closure/src/Serializers/Native.php +++ b/api/vendor/laravel/serializable-closure/src/Serializers/Native.php @@ -378,6 +378,10 @@ protected function mapPointers(&$data) continue; } + if (PHP_VERSION >= 8.1 && $property->isReadOnly()) { + continue; + } + $item = $property->getValue($data); if ($item instanceof SerializableClosure || $item instanceof UnsignedSerializableClosure || ($item instanceof SelfReference && $item->hash === $this->code['self'])) { @@ -500,6 +504,10 @@ protected function mapByReference(&$data) continue; } + if (PHP_VERSION >= 8.1 && $property->isReadOnly() && $property->class !== $reflection->name) { + continue; + } + $value = $property->getValue($instance); if (is_array($value) || is_object($value)) { diff --git a/api/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php b/api/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php index a0d3707527..e92960023b 100644 --- a/api/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php +++ b/api/vendor/laravel/serializable-closure/src/Support/ReflectionClosure.php @@ -508,11 +508,9 @@ public function getCode() break; case 'id_name': switch ($token[0]) { - // named arguments... - case ':': + case $token[0] === ':' && $context !== 'instanceof': if ($lastState === 'closure' && $context === 'root') { - $state = 'ignore_next'; - $lastState = 'closure'; + $state = 'closure'; $code .= $id_start.$token; } @@ -643,6 +641,11 @@ public function getCode() break; case 'anonymous': switch ($token[0]) { + case T_NAME_QUALIFIED: + [$id_start, $id_start_ci, $id_name] = $this->parseNameQualified($token[1]); + $state = 'id_name'; + $lastState = 'anonymous'; + break 2; case T_NS_SEPARATOR: case T_STRING: $id_start = $token[1]; @@ -651,7 +654,7 @@ public function getCode() $state = 'id_name'; $context = 'extends'; $lastState = 'anonymous'; - break; + break; case '{': $state = 'closure'; if (! $inside_structure) { @@ -803,7 +806,7 @@ public function isScopeRequired() } /** - * The the hash of the current file name. + * The hash of the current file name. * * @return string */ @@ -1132,10 +1135,10 @@ protected function fetchItems() if (--$open == 0) { if (! $structIgnore) { $structures[] = [ - 'type' => $structType, - 'name' => $structName, + 'type' => $structType, + 'name' => $structName, 'start' => $startLine, - 'end' => $endLine, + 'end' => $endLine, ]; } $structIgnore = false; diff --git a/api/vendor/mockery/mockery/.readthedocs.yml b/api/vendor/mockery/mockery/.readthedocs.yml new file mode 100644 index 0000000000..7150d7b424 --- /dev/null +++ b/api/vendor/mockery/mockery/.readthedocs.yml @@ -0,0 +1,24 @@ +# Read the Docs configuration file for Sphinx projects +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools we might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Build documentation in additional formats such as PDF and ePub +formats: all + +# Build requirements for our documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: docs/requirements.txt diff --git a/api/vendor/mockery/mockery/CHANGELOG.md b/api/vendor/mockery/mockery/CHANGELOG.md index 937460e9b4..2180be21e2 100644 --- a/api/vendor/mockery/mockery/CHANGELOG.md +++ b/api/vendor/mockery/mockery/CHANGELOG.md @@ -1,217 +1,419 @@ -# Change Log +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.6.12] - 2024-05-15 + +### Changed + +- [1420: Update `psalm-baseline.xml` ](https://github.com/mockery/mockery/pull/1420) +- [1419: Update e2e-test.sh](https://github.com/mockery/mockery/pull/1419) +- [1413: Upgrade `phar` tools and `phive.xml` configuration](https://github.com/mockery/mockery/pull/1413) + +### Fixed + +- [1415: Fix mocking anonymous classes](https://github.com/mockery/mockery/pull/1415) +- [1411: Mocking final classes reports unresolvable type by PHPStan](https://github.com/mockery/mockery/issues/1411) +- [1410: Fix PHP Doc Comments](https://github.com/mockery/mockery/pull/1410) + +### Security + +- [1417: Bump `Jinja2` from `3.1.3` to `3.1.4` fix CVE-2024-34064](https://github.com/mockery/mockery/pull/1417) +- [1412: Bump `idna` from `3.6` to `3.7` fix CVE-2024-3651](https://github.com/mockery/mockery/pull/1412) + +## [1.6.11] - 2024-03-21 + +### Fixed + +- [1407: Fix constants map generics doc comments](https://github.com/mockery/mockery/pull/1407) +- [1406: Fix reserved words used to name a class, interface or trait](https://github.com/mockery/mockery/pull/1406) +- [1403: Fix regression - partial construction with trait methods](https://github.com/mockery/mockery/pull/1403) +- [1401: Improve `Mockery::mock()` parameter type compatibility with array typehints](https://github.com/mockery/mockery/pull/1401) + +## [1.6.10] - 2024-03-19 + +### Added + +- [1398: [PHP 8.4] Fixes for implicit nullability deprecation](https://github.com/mockery/mockery/pull/1398) + +### Fixed + +- [1397: Fix mock method $args parameter type](https://github.com/mockery/mockery/pull/1397) +- [1396: Fix `1.6.8` release](https://github.com/mockery/mockery/pull/1396) + +## [1.6.9] - 2024-03-12 + +- [1394: Revert v1.6.8 release](https://github.com/mockery/mockery/pull/1394) + +## [1.6.8] - 2024-03-12 + +- [1393: Changelog v1.6.8](https://github.com/mockery/mockery/pull/1393) +- [1392: Refactor remaining codebase](https://github.com/mockery/mockery/pull/1392) +- [1391: Update actions to use Node 20](https://github.com/mockery/mockery/pull/1391) +- [1390: Update `ReadTheDocs` dependencies](https://github.com/mockery/mockery/pull/1390) +- [1389: Refactor `library/Mockery/Matcher/*`](https://github.com/mockery/mockery/pull/1389) +- [1388: Refactor `library/Mockery/Loader/*`](https://github.com/mockery/mockery/pull/1388) +- [1387: Refactor `library/Mockery/CountValidator/*`](https://github.com/mockery/mockery/pull/1387) +- [1386: Add PHPUnit 10+ attributes](https://github.com/mockery/mockery/pull/1386) +- [1385: Update composer dependencies and clean up](https://github.com/mockery/mockery/pull/1385) +- [1384: Update `psalm-baseline.xml`](https://github.com/mockery/mockery/pull/1384) +- [1383: Refactor `library/helpers.php`](https://github.com/mockery/mockery/pull/1383) +- [1382: Refactor `library/Mockery/VerificationExpectation.php`](https://github.com/mockery/mockery/pull/1382) +- [1381: Refactor `library/Mockery/VerificationDirector.php`](https://github.com/mockery/mockery/pull/1381) +- [1380: Refactor `library/Mockery/QuickDefinitionsConfiguration.php`](https://github.com/mockery/mockery/pull/1380) +- [1379: Refactor `library/Mockery/Undefined.php`](https://github.com/mockery/mockery/pull/1379) +- [1378: Refactor `library/Mockery/Reflector.php`](https://github.com/mockery/mockery/pull/1378) +- [1377: Refactor `library/Mockery/ReceivedMethodCalls.php`](https://github.com/mockery/mockery/pull/1377) +- [1376: Refactor `library/Mockery.php`](https://github.com/mockery/mockery/pull/1376) +- [1375: Refactor `library/Mockery/MockInterface.php`](https://github.com/mockery/mockery/pull/1375) +- [1374: Refactor `library/Mockery/MethodCall.php`](https://github.com/mockery/mockery/pull/1374) +- [1373: Refactor `library/Mockery/LegacyMockInterface.php`](https://github.com/mockery/mockery/pull/1373) +- [1372: Refactor `library/Mockery/Instantiator.php`](https://github.com/mockery/mockery/pull/1372) +- [1371: Refactor `library/Mockery/HigherOrderMessage.php`](https://github.com/mockery/mockery/pull/1371) +- [1370: Refactor `library/Mockery/ExpectsHigherOrderMessage.php`](https://github.com/mockery/mockery/pull/1370) +- [1369: Refactor `library/Mockery/ExpectationInterface.php`](https://github.com/mockery/mockery/pull/1369) +- [1368: Refactor `library/Mockery/ExpectationDirector.php`](https://github.com/mockery/mockery/pull/1368) +- [1367: Refactor `library/Mockery/Expectation.php`](https://github.com/mockery/mockery/pull/1367) +- [1366: Refactor `library/Mockery/Exception.php`](https://github.com/mockery/mockery/pull/1366) +- [1365: Refactor `library/Mockery/Container.php`](https://github.com/mockery/mockery/pull/1365) +- [1364: Refactor `library/Mockery/Configuration.php`](https://github.com/mockery/mockery/pull/1364) +- [1363: Refactor `library/Mockery/CompositeExpectation.php`](https://github.com/mockery/mockery/pull/1363) +- [1362: Refactor `library/Mockery/ClosureWrapper.php`](https://github.com/mockery/mockery/pull/1362) +- [1361: Refactor `library/Mockery.php`](https://github.com/mockery/mockery/pull/1361) +- [1360: Refactor Container](https://github.com/mockery/mockery/pull/1360) +- [1355: Fix the namespace in the SubsetTest class](https://github.com/mockery/mockery/pull/1355) +- [1354: Add array-like objects support to hasKey/hasValue matchers](https://github.com/mockery/mockery/pull/1354) + +## [1.6.7] - 2023-12-09 + +### Added + +- [#1338: Support PHPUnit constraints as matchers](https://github.com/mockery/mockery/pull/1338) +- [#1336: Add factory methods for `IsEqual` and `IsSame` matchers](https://github.com/mockery/mockery/pull/1336) + +### Fixed + +- [#1346: Fix test namespaces](https://github.com/mockery/mockery/pull/1346) +- [#1343: Update documentation default theme and build version](https://github.com/mockery/mockery/pull/1343) +- [#1329: Prevent `shouldNotReceive` from getting overridden by invocation count methods](https://github.com/mockery/mockery/pull/1329) + +### Changed + +- [#1351: Update psalm-baseline.xml](https://github.com/mockery/mockery/pull/1351) +- [#1350: Changelog v1.6.7](https://github.com/mockery/mockery/pull/1350) +- [#1349: Cleanup](https://github.com/mockery/mockery/pull/1349) +- [#1348: Update makefile](https://github.com/mockery/mockery/pull/1348) +- [#1347: Bump phars dependencies](https://github.com/mockery/mockery/pull/1347) +- [#1344: Disabled travis-ci and sensiolabs webhooks](https://github.com/mockery/mockery/issues/1344) +- [#1342: Add `.readthedocs.yml` configuration](https://github.com/mockery/mockery/pull/1342) +- [#1340: docs: Remove misplaced semicolumn from code snippet](https://github.com/mockery/mockery/pull/1340) + +## 1.6.6 (2023-08-08) + +- [#1327: Changelog v1.6.6](https://github.com/mockery/mockery/pull/1327) +- [#1325: Keep the file that caused an error for inspection](https://github.com/mockery/mockery/pull/1325) +- [#1324: Fix Regression - Replace `+` Array Union Operator with `array_merge`](https://github.com/mockery/mockery/pull/1324) + +## 1.6.5 (2023-08-05) + +- [#1322: Changelog v1.6.5](https://github.com/mockery/mockery/pull/1322) +- [#1321: Autoload Test Fixtures Based on PHP Runtime Version](https://github.com/mockery/mockery/pull/1321) +- [#1320: Clean up mocks on destruct](https://github.com/mockery/mockery/pull/1320) +- [#1318: Fix misspelling in docs](https://github.com/mockery/mockery/pull/1318) +- [#1316: Fix compatibility issues with PHP 7.3](https://github.com/mockery/mockery/pull/1316) +- [#1315: Fix PHP 7.3 issues](https://github.com/mockery/mockery/issues/1315) +- [#1314: Add Security Policy](https://github.com/mockery/mockery/pull/1314) +- [#1313: Type declaration for `iterable|object`.](https://github.com/mockery/mockery/pull/1313) +- [#1312: Mock disjunctive normal form types](https://github.com/mockery/mockery/pull/1312) +- [#1299: Test PHP `8.3` language features](https://github.com/mockery/mockery/pull/1299) + +## 1.6.4 (2023-07-19) + +- [#1308: Changelog v1.6.4](https://github.com/mockery/mockery/pull/1308) +- [#1307: Revert `src` to `library` for `1.6.x`](https://github.com/mockery/mockery/pull/1307) + +## 1.6.3 (2023-07-18) + +- [#1304: Remove `extra.branch-alias` and update composer information](https://github.com/mockery/mockery/pull/1304) +- [#1303: Update `.gitattributes`](https://github.com/mockery/mockery/pull/1303) +- [#1302: Changelog v1.6.3](https://github.com/mockery/mockery/pull/1302) +- [#1301: Fix mocking classes with `new` initializers in method and attribute params on PHP 8.1](https://github.com/mockery/mockery/pull/1301) +- [#1298: Update default repository branch to latest release branch](https://github.com/mockery/mockery/issues/1298) +- [#1297: Update `Makefile` for contributors](https://github.com/mockery/mockery/pull/1297) +- [#1294: Correct return types of Mock for phpstan](https://github.com/mockery/mockery/pull/1294) +- [#1290: Rename directory `library` to `src`](https://github.com/mockery/mockery/pull/1290) +- [#1288: Update codecov workflow](https://github.com/mockery/mockery/pull/1288) +- [#1287: Update psalm configuration and workflow](https://github.com/mockery/mockery/pull/1287) +- [#1286: Update phpunit workflow](https://github.com/mockery/mockery/pull/1286) +- [#1285: Enforce the minimum required PHP version](https://github.com/mockery/mockery/pull/1285) +- [#1283: Update license and copyright information](https://github.com/mockery/mockery/pull/1283) +- [#1282: Create `COPYRIGHT.md` file](https://github.com/mockery/mockery/pull/1282) +- [#1279: Bump `vimeo/psalm` from `5.9.0` to `5.12.0`](https://github.com/mockery/mockery/pull/1279) + +## 1.6.2 (2023-06-07) + +- [#1276: Add `IsEqual` Argument Matcher](https://github.com/mockery/mockery/pull/1276) +- [#1275: Add `IsSame` Argument Matcher](https://github.com/mockery/mockery/pull/1275) +- [#1274: Update composer branch alias](https://github.com/mockery/mockery/pull/1274) +- [#1271: Support PHP 8.2 `true` Literal Type](https://github.com/mockery/mockery/pull/1271) +- [#1270: Support PHP 8.0 `false` Literal Type](https://github.com/mockery/mockery/pull/1270) + +## 1.6.1 (2023-06-05) + +- [#1267 Drops support for PHP <7.4](https://github.com/mockery/mockery/pull/1267) +- [#1192 Updated changelog for version 1.5.1 to include changes from #1180](https://github.com/mockery/mockery/pull/1192) +- [#1196 Update example in README.md](https://github.com/mockery/mockery/pull/1196) +- [#1199 Fix function parameter default enum value](https://github.com/mockery/mockery/pull/1199) +- [#1205 Deal with null type in PHP8.2](https://github.com/mockery/mockery/pull/1205) +- [#1208 Import MockeryTestCase fully qualified class name](https://github.com/mockery/mockery/pull/1208) +- [#1210 Add support for target class attributes](https://github.com/mockery/mockery/pull/1210) +- [#1212 docs: Add missing comma](https://github.com/mockery/mockery/pull/1212) +- [#1216 Fixes code generation for intersection types](https://github.com/mockery/mockery/pull/1216) +- [#1217 Add MockeryExceptionInterface](https://github.com/mockery/mockery/pull/1217) +- [#1218 tidy: avoids require](https://github.com/mockery/mockery/pull/1218) +- [#1222 Add .editorconfig](https://github.com/mockery/mockery/pull/1222) +- [#1225 Switch to PSR-4 autoload](https://github.com/mockery/mockery/pull/1225) +- [#1226 Refactoring risky tests](https://github.com/mockery/mockery/pull/1226) +- [#1230 Add vimeo/psalm and psalm/plugin-phpunit](https://github.com/mockery/mockery/pull/1230) +- [#1232 Split PHPUnit TestSuites for PHP 8.2](https://github.com/mockery/mockery/pull/1232) +- [#1233 Bump actions/checkout to v3](https://github.com/mockery/mockery/pull/1233) +- [#1234 Bump nick-invision/retry to v2](https://github.com/mockery/mockery/pull/1234) +- [#1235 Setup Codecov for code coverage](https://github.com/mockery/mockery/pull/1235) +- [#1236 Add Psalm CI Check](https://github.com/mockery/mockery/pull/1236) +- [#1237 Unignore composer.lock file](https://github.com/mockery/mockery/pull/1237) +- [#1239 Prevent CI run duplication](https://github.com/mockery/mockery/pull/1239) +- [#1241 Add PHPUnit workflow for PHP 8.3](https://github.com/mockery/mockery/pull/1241) +- [#1244 Improve ClassAttributesPass for Dynamic Properties](https://github.com/mockery/mockery/pull/1244) +- [#1245 Deprecate hamcrest/hamcrest-php package](https://github.com/mockery/mockery/pull/1245) +- [#1246 Add BUG_REPORT.yml Issue template](https://github.com/mockery/mockery/pull/1246) +- [#1250 Deprecate PHP <=8.0](https://github.com/mockery/mockery/issues/1250) +- [#1253 Prevent array to string conversion when serialising a Subset matcher](https://github.com/mockery/mockery/issues/1253) + +## 1.6.0 (2023-06-05) [DELETED] + +This tag was deleted due to a mistake with the composer.json PHP version +constraint, see [#1266](https://github.com/mockery/mockery/issues/1266) ## 1.3.6 (2022-09-07) -* PHP 8.2 | Fix "Use of "parent" in callables is deprecated" notice #1169 + +- PHP 8.2 | Fix "Use of "parent" in callables is deprecated" notice #1169 ## 1.5.1 (2022-09-07) -* [PHP 8.2] Various tests: explicitly declare properties #1170 -* [PHP 8.2] Fix "Use of "parent" in callables is deprecated" notice #1169 -* [PHP 8.1] Support intersection types #1164 -* Handle final `__toString` methods #1162 +- [PHP 8.2] Various tests: explicitly declare properties #1170 +- [PHP 8.2] Fix "Use of "parent" in callables is deprecated" notice #1169 +- [PHP 8.1] Support intersection types #1164 +- Handle final `__toString` methods #1162 +- Only count assertions on expectations which can fail a test #1180 ## 1.5.0 (2022-01-20) -* Override default call count expectations via expects() #1146 -* Mock methods with static return types #1157 -* Mock methods with mixed return type #1156 -* Mock classes with new in initializers on PHP 8.1 #1160 -* Removes redundant PHPUnitConstraint #1158 +- Override default call count expectations via expects() #1146 +- Mock methods with static return types #1157 +- Mock methods with mixed return type #1156 +- Mock classes with new in initializers on PHP 8.1 #1160 +- Removes redundant PHPUnitConstraint #1158 ## 1.4.4 (2021-09-13) -* Fixes auto-generated return values #1144 -* Adds support for tentative types #1130 -* Fixes for PHP 8.1 Support (#1130 and #1140) -* Add method that allows defining a set of arguments the mock should yield #1133 -* Added option to configure default matchers for objects `\Mockery::getConfiguration()->setDefaultMatcher($class, $matcherClass)` #1120 +- Fixes auto-generated return values #1144 +- Adds support for tentative types #1130 +- Fixes for PHP 8.1 Support (#1130 and #1140) +- Add method that allows defining a set of arguments the mock should yield #1133 +- Added option to configure default matchers for objects `\Mockery::getConfiguration()->setDefaultMatcher($class, $matcherClass)` #1120 ## 1.3.5 (2021-09-13) -* Fix auto-generated return values with union types #1143 -* Adds support for tentative types #1130 -* Fixes for PHP 8.1 Support (#1130 and #1140) -* Add method that allows defining a set of arguments the mock should yield #1133 -* Added option to configure default matchers for objects `\Mockery::getConfiguration()->setDefaultMatcher($class, $matcherClass)` #1120 + +- Fix auto-generated return values with union types #1143 +- Adds support for tentative types #1130 +- Fixes for PHP 8.1 Support (#1130 and #1140) +- Add method that allows defining a set of arguments the mock should yield #1133 +- Added option to configure default matchers for objects `\Mockery::getConfiguration()->setDefaultMatcher($class, $matcherClass)` #1120 ## 1.4.3 (2021-02-24) -* Fixes calls to fetchMock before initialisation #1113 -* Allow shouldIgnoreMissing() to behave in a recursive fashion #1097 -* Custom object formatters #766 (Needs Docs) -* Fix crash on a union type including null #1106 +- Fixes calls to fetchMock before initialisation #1113 +- Allow shouldIgnoreMissing() to behave in a recursive fashion #1097 +- Custom object formatters #766 (Needs Docs) +- Fix crash on a union type including null #1106 ## 1.3.4 (2021-02-24) -* Fixes calls to fetchMock before initialisation #1113 -* Fix crash on a union type including null #1106 +- Fixes calls to fetchMock before initialisation #1113 +- Fix crash on a union type including null #1106 ## 1.4.2 (2020-08-11) -* Fix array to string conversion in ConstantsPass (#1086) -* Fixed nullable PHP 8.0 union types (#1088, #1089) -* Fixed support for PHP 8.0 parent type (#1088, #1089) -* Fixed PHP 8.0 mixed type support (#1088, #1089) -* Fixed PHP 8.0 union return types (#1088, #1089) +- Fix array to string conversion in ConstantsPass (#1086) +- Fixed nullable PHP 8.0 union types (#1088, #1089) +- Fixed support for PHP 8.0 parent type (#1088, #1089) +- Fixed PHP 8.0 mixed type support (#1088, #1089) +- Fixed PHP 8.0 union return types (#1088, #1089) ## 1.4.1 (2020-07-09) -* Allow quick definitions to use 'at least once' expectation +- Allow quick definitions to use 'at least once' expectation `\Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce(true)` (#1056) -* Added provisional support for PHP 8.0 (#1068, #1072,#1079) -* Fix mocking methods with iterable return type without specifying a return value (#1075) +- Added provisional support for PHP 8.0 (#1068, #1072,#1079) +- Fix mocking methods with iterable return type without specifying a return value (#1075) ## 1.3.3 (2020-08-11) -* Fix array to string conversion in ConstantsPass (#1086) -* Fixed nullable PHP 8.0 union types (#1088) -* Fixed support for PHP 8.0 parent type (#1088) -* Fixed PHP 8.0 mixed type support (#1088) -* Fixed PHP 8.0 union return types (#1088) +- Fix array to string conversion in ConstantsPass (#1086) +- Fixed nullable PHP 8.0 union types (#1088) +- Fixed support for PHP 8.0 parent type (#1088) +- Fixed PHP 8.0 mixed type support (#1088) +- Fixed PHP 8.0 union return types (#1088) ## 1.3.2 (2020-07-09) -* Fix mocking with anonymous classes (#1039) -* Fix andAnyOthers() to properly match earlier expectations (#1051) -* Added provisional support for PHP 8.0 (#1068, #1072,#1079) -* Fix mocking methods with iterable return type without specifying a return value (#1075) +- Fix mocking with anonymous classes (#1039) +- Fix andAnyOthers() to properly match earlier expectations (#1051) +- Added provisional support for PHP 8.0 (#1068, #1072,#1079) +- Fix mocking methods with iterable return type without specifying a return value (#1075) ## 1.4.0 (2020-05-19) -* Fix mocking with anonymous classes (#1039) -* Fix andAnyOthers() to properly match earlier expectations (#1051) -* Drops support for PHP < 7.3 and PHPUnit < 8 (#1059) +- Fix mocking with anonymous classes (#1039) +- Fix andAnyOthers() to properly match earlier expectations (#1051) +- Drops support for PHP < 7.3 and PHPUnit < 8 (#1059) ## 1.3.1 (2019-12-26) -* Revert improved exception debugging due to BC breaks (#1032) +- Revert improved exception debugging due to BC breaks (#1032) ## 1.3.0 (2019-11-24) -* Added capture `Mockery::capture` convenience matcher (#1020) -* Added `andReturnArg` to echo back an argument passed to a an expectation (#992) -* Improved exception debugging (#1000) -* Fixed `andSet` to not reuse properties between mock objects (#1012) +- Added capture `Mockery::capture` convenience matcher (#1020) +- Added `andReturnArg` to echo back an argument passed to a an expectation (#992) +- Improved exception debugging (#1000) +- Fixed `andSet` to not reuse properties between mock objects (#1012) ## 1.2.4 (2019-09-30) -* Fix a bug introduced with previous release, for empty method definition lists (#1009) +- Fix a bug introduced with previous release, for empty method definition lists (#1009) ## 1.2.3 (2019-08-07) -* Allow mocking classes that have allows and expects methods (#868) -* Allow passing thru __call method in all mock types (experimental) (#969) -* Add support for `!` to blacklist methods (#959) -* Added `withSomeOfArgs` to partial match a list of args (#967) -* Fix chained demeter calls with type hint (#956) +- Allow mocking classes that have allows and expects methods (#868) +- Allow passing thru __call method in all mock types (experimental) (#969) +- Add support for `!` to blacklist methods (#959) +- Added `withSomeOfArgs` to partial match a list of args (#967) +- Fix chained demeter calls with type hint (#956) ## 1.2.2 (2019-02-13) -* Fix a BC breaking change for PHP 5.6/PHPUnit 5.7.27 (#947) +- Fix a BC breaking change for PHP 5.6/PHPUnit 5.7.27 (#947) ## 1.2.1 (2019-02-07) -* Support for PHPUnit 8 (#942) -* Allow mocking static methods called on instance (#938) +- Support for PHPUnit 8 (#942) +- Allow mocking static methods called on instance (#938) ## 1.2.0 (2018-10-02) -* Starts counting default expectations towards count (#910) -* Adds workaround for some HHVM return types (#909) -* Adds PhpStorm metadata support for autocomplete etc (#904) -* Further attempts to support multiple PHPUnit versions (#903) -* Allows setting constructor expectations on instance mocks (#900) -* Adds workaround for HHVM memoization decorator (#893) -* Adds experimental support for callable spys (#712) +- Starts counting default expectations towards count (#910) +- Adds workaround for some HHVM return types (#909) +- Adds PhpStorm metadata support for autocomplete etc (#904) +- Further attempts to support multiple PHPUnit versions (#903) +- Allows setting constructor expectations on instance mocks (#900) +- Adds workaround for HHVM memoization decorator (#893) +- Adds experimental support for callable spys (#712) ## 1.1.0 (2018-05-08) -* Allows use of string method names in allows and expects (#794) -* Finalises allows and expects syntax in API (#799) -* Search for handlers in a case instensitive way (#801) -* Deprecate allowMockingMethodsUnnecessarily (#808) -* Fix risky tests (#769) -* Fix namespace in TestListener (#812) -* Fixed conflicting mock names (#813) -* Clean elses (#819) -* Updated protected method mocking exception message (#826) -* Map of constants to mock (#829) -* Simplify foreach with `in_array` function (#830) -* Typehinted return value on Expectation#verify. (#832) -* Fix shouldNotHaveReceived with HigherOrderMessage (#842) -* Deprecates shouldDeferMissing (#839) -* Adds support for return type hints in Demeter chains (#848) -* Adds shouldNotReceive to composite expectation (#847) -* Fix internal error when using --static-backup (#845) -* Adds `andAnyOtherArgs` as an optional argument matcher (#860) -* Fixes namespace qualifying with namespaced named mocks (#872) -* Added possibility to add Constructor-Expections on hard dependencies, read: Mockery::mock('overload:...') (#781) +- Allows use of string method names in allows and expects (#794) +- Finalises allows and expects syntax in API (#799) +- Search for handlers in a case instensitive way (#801) +- Deprecate allowMockingMethodsUnnecessarily (#808) +- Fix risky tests (#769) +- Fix namespace in TestListener (#812) +- Fixed conflicting mock names (#813) +- Clean elses (#819) +- Updated protected method mocking exception message (#826) +- Map of constants to mock (#829) +- Simplify foreach with `in_array` function (#830) +- Typehinted return value on Expectation#verify. (#832) +- Fix shouldNotHaveReceived with HigherOrderMessage (#842) +- Deprecates shouldDeferMissing (#839) +- Adds support for return type hints in Demeter chains (#848) +- Adds shouldNotReceive to composite expectation (#847) +- Fix internal error when using --static-backup (#845) +- Adds `andAnyOtherArgs` as an optional argument matcher (#860) +- Fixes namespace qualifying with namespaced named mocks (#872) +- Added possibility to add Constructor-Expections on hard dependencies, read: Mockery::mock('overload:...') (#781) ## 1.0.0 (2017-09-06) -* Destructors (`__destruct`) are stubbed out where it makes sense -* Allow passing a closure argument to `withArgs()` to validate multiple arguments at once. -* `Mockery\Adapter\Phpunit\TestListener` has been rewritten because it +- Destructors (`__destruct`) are stubbed out where it makes sense +- Allow passing a closure argument to `withArgs()` to validate multiple arguments at once. +- `Mockery\Adapter\Phpunit\TestListener` has been rewritten because it incorrectly marked some tests as risky. It will no longer verify mock expectations but instead check that tests do that themselves. PHPUnit 6 is required if you want to use this fail safe. -* Removes SPL Class Loader -* Removed object recorder feature -* Bumped minimum PHP version to 5.6 -* `andThrow` will now throw anything `\Throwable` -* Adds `allows` and `expects` syntax -* Adds optional global helpers for `mock`, `namedMock` and `spy` -* Adds ability to create objects using traits -* `Mockery\Matcher\MustBe` was deprecated -* Marked `Mockery\MockInterface` as internal -* Subset matcher matches recursively -* BC BREAK - Spies return `null` by default from ignored (non-mocked) methods with nullable return type -* Removed extracting getter methods of object instances -* BC BREAK - Remove implicit regex matching when trying to match string arguments, introduce `\Mockery::pattern()` when regex matching is needed -* Fix Mockery not getting closed in cases of failing test cases -* Fix Mockery not setting properties on overloaded instance mocks -* BC BREAK - Fix Mockery not trying default expectations if there is any concrete expectation -* BC BREAK - Mockery's PHPUnit integration will mark a test as risky if it +- Removes SPL Class Loader +- Removed object recorder feature +- Bumped minimum PHP version to 5.6 +- `andThrow` will now throw anything `\Throwable` +- Adds `allows` and `expects` syntax +- Adds optional global helpers for `mock`, `namedMock` and `spy` +- Adds ability to create objects using traits +- `Mockery\Matcher\MustBe` was deprecated +- Marked `Mockery\MockInterface` as internal +- Subset matcher matches recursively +- BC BREAK - Spies return `null` by default from ignored (non-mocked) methods with nullable return type +- Removed extracting getter methods of object instances +- BC BREAK - Remove implicit regex matching when trying to match string arguments, introduce `\Mockery::pattern()` when regex matching is needed +- Fix Mockery not getting closed in cases of failing test cases +- Fix Mockery not setting properties on overloaded instance mocks +- BC BREAK - Fix Mockery not trying default expectations if there is any concrete expectation +- BC BREAK - Mockery's PHPUnit integration will mark a test as risky if it thinks one it's exceptions has been swallowed in PHPUnit > 5.7.6. Use `$e->dismiss()` to dismiss. ## 0.9.4 (XXXX-XX-XX) -* `shouldIgnoreMissing` will respect global `allowMockingNonExistentMethods` +- `shouldIgnoreMissing` will respect global `allowMockingNonExistentMethods` config -* Some support for variadic parameters -* Hamcrest is now a required dependency -* Instance mocks now respect `shouldIgnoreMissing` call on control instance -* This will be the *last version to support PHP 5.3* -* Added `Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration` trait -* Added `makePartial` to `Mockery\MockInterface` as it was missing +- Some support for variadic parameters +- Hamcrest is now a required dependency +- Instance mocks now respect `shouldIgnoreMissing` call on control instance +- This will be the *last version to support PHP 5.3* +- Added `Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration` trait +- Added `makePartial` to `Mockery\MockInterface` as it was missing ## 0.9.3 (2014-12-22) -* Added a basic spy implementation -* Added `Mockery\Adapter\Phpunit\MockeryTestCase` for more reliable PHPUnit +- Added a basic spy implementation +- Added `Mockery\Adapter\Phpunit\MockeryTestCase` for more reliable PHPUnit integration ## 0.9.2 (2014-09-03) -* Some workarounds for the serialisation problems created by changes to PHP in 5.5.13, 5.4.29, +- Some workarounds for the serialisation problems created by changes to PHP in 5.5.13, 5.4.29, 5.6. -* Demeter chains attempt to reuse doubles as they see fit, so for foo->bar and +- Demeter chains attempt to reuse doubles as they see fit, so for foo->bar and foo->baz, we'll attempt to use the same foo ## 0.9.1 (2014-05-02) -* Allow specifying consecutive exceptions to be thrown with `andThrowExceptions` -* Allow specifying methods which can be mocked when using +- Allow specifying consecutive exceptions to be thrown with `andThrowExceptions` +- Allow specifying methods which can be mocked when using `Mockery\Configuration::allowMockingNonExistentMethods(false)` with `Mockery\MockInterface::shouldAllowMockingMethod($methodName)` -* Added andReturnSelf method: `$mock->shouldReceive("foo")->andReturnSelf()` -* `shouldIgnoreMissing` now takes an optional value that will be return instead +- Added andReturnSelf method: `$mock->shouldReceive("foo")->andReturnSelf()` +- `shouldIgnoreMissing` now takes an optional value that will be return instead of null, e.g. `$mock->shouldIgnoreMissing($mock)` ## 0.9.0 (2014-02-05) -* Allow mocking classes with final __wakeup() method -* Quick definitions are now always `byDefault` -* Allow mocking of protected methods with `shouldAllowMockingProtectedMethods` -* Support official Hamcrest package -* Generator completely rewritten -* Easily create named mocks with namedMock +- Allow mocking classes with final __wakeup() method +- Quick definitions are now always `byDefault` +- Allow mocking of protected methods with `shouldAllowMockingProtectedMethods` +- Support official Hamcrest package +- Generator completely rewritten +- Easily create named mocks with namedMock diff --git a/api/vendor/mockery/mockery/CONTRIBUTING.md b/api/vendor/mockery/mockery/CONTRIBUTING.md index b714f3f44e..d828fb3023 100644 --- a/api/vendor/mockery/mockery/CONTRIBUTING.md +++ b/api/vendor/mockery/mockery/CONTRIBUTING.md @@ -6,17 +6,15 @@ We'd love you to help out with mockery and no contribution is too small. ## Reporting Bugs -Issues can be reported on the [issue -tracker](https://github.com/padraic/mockery/issues). Please try and report any -bugs with a minimal reproducible example, it will make things easier for other +Issues can be reported on the [issue tracker](https://github.com/mockery/mockery/issues). +Please try and report any bugs with a minimal reproducible example, it will make things easier for other contributors and your problems will hopefully be resolved quickly. ## Requesting Features We're always interested to hear about your ideas and you can request features by -creating a ticket in the [issue -tracker](https://github.com/padraic/mockery/issues). We can't always guarantee +creating a ticket in the [issue tracker](https://github.com/mockery/mockery/issues). We can't always guarantee someone will jump on it straight away, but putting it out there to see if anyone else is interested is a good idea. @@ -33,24 +31,20 @@ and [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standards, but we'll probably merge any code that looks close enough. -* Fork the [repository](https://github.com/padraic/mockery) on GitHub +* Fork the [repository](https://github.com/mockery/mockery) on GitHub * Add the code for your feature or bug * Add some tests for your feature or bug * Optionally, but preferably, write some documentation * Optionally, update the CHANGELOG.md file with your feature or [BC](http://en.wikipedia.org/wiki/Backward_compatibility) break -* Send a [Pull - Request](https://help.github.com/articles/creating-a-pull-request) to the +* Send a [Pull Request](https://help.github.com/articles/creating-a-pull-request) to the correct target branch (see below) If you have a big change or would like to discuss something, create an issue in -the [issue tracker](https://github.com/padraic/mockery/issues) or jump in to -\#mockery on freenode +the [issue tracker](https://github.com/mockery/mockery/issues) or jump in to \#mockery on freenode -Any code you contribute must be licensed under the [BSD 3-Clause -License](http://opensource.org/licenses/BSD-3-Clause). - +Any code you contribute must be licensed under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause). ## Target Branch @@ -67,7 +61,7 @@ To run the unit tests for Mockery, clone the git repository, download Composer u the instructions at [http://getcomposer.org/download/](http://getcomposer.org/download/), then install the dependencies with `php /path/to/composer.phar install`. -This will install the required PHPUnit and Hamcrest dev dependencies and create the +This will install the required dev dependencies and create the autoload files required by the unit tests. You may run the `vendor/bin/phpunit` command to run the unit tests. If everything goes to plan, there will be no failed tests! diff --git a/api/vendor/mockery/mockery/COPYRIGHT.md b/api/vendor/mockery/mockery/COPYRIGHT.md new file mode 100644 index 0000000000..b3b19bc418 --- /dev/null +++ b/api/vendor/mockery/mockery/COPYRIGHT.md @@ -0,0 +1,7 @@ +# Copyright + +- Copyright (c) [2009](https://github.com/mockery/mockery/commit/1d96f88142abe804ab9e893a5f07933f63e9bff9), [Pádraic Brady](https://github.com/padraic) +- Copyright (c) [2011](https://github.com/mockery/mockery/commit/94dbb63aab37c659f63ea6e34acc6958928b0f59), [Robert Basic](https://github.com/robertbasic) +- Copyright (c) [2012](https://github.com/mockery/mockery/commit/64e3ad6960eb3202b5b91b91a4ef1cf6252f0fef), [Dave Marshall](https://github.com/davedevelopment) +- Copyright (c) [2013](https://github.com/mockery/mockery/commit/270ddd0bd051251e36a5688c52fc2638a097b110), [Graham Campbell](https://github.com/GrahamCampbell) +- Copyright (c) [2017](https://github.com/mockery/mockery/commit/ba28b84c416b95924886bbd64a6a2f68e863536a), [Nathanael Esayeas](https://github.com/ghostwriter) diff --git a/api/vendor/mockery/mockery/LICENSE b/api/vendor/mockery/mockery/LICENSE index 2e127a651b..1a9030ce20 100644 --- a/api/vendor/mockery/mockery/LICENSE +++ b/api/vendor/mockery/mockery/LICENSE @@ -1,27 +1,29 @@ -Copyright (c) 2010, Pádraic Brady +BSD 3-Clause License + +Copyright (c) 2009-2023, Pádraic Brady All rights reserved. -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. - * The name of Pádraic Brady may not be used to endorse or promote - products derived from this software without specific prior written - permission. +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/api/vendor/mockery/mockery/README.md b/api/vendor/mockery/mockery/README.md index 55771dfbb5..269773420f 100644 --- a/api/vendor/mockery/mockery/README.md +++ b/api/vendor/mockery/mockery/README.md @@ -2,6 +2,9 @@ Mockery ======= [![Build Status](https://github.com/mockery/mockery/actions/workflows/tests.yml/badge.svg)](https://github.com/mockery/mockery/actions) +[![Supported PHP Version](https://badgen.net/packagist/php/mockery/mockery?color=8892bf)](https://www.php.net/supported-versions) +[![Code Coverage](https://codecov.io/gh/mockery/mockery/branch/1.6.x/graph/badge.svg?token=oxHwVM56bT)](https://codecov.io/gh/mockery/mockery) +[![Type Coverage](https://shepherd.dev/github/mockery/mockery/coverage.svg)](https://shepherd.dev/github/mockery/mockery) [![Latest Stable Version](https://poser.pugx.org/mockery/mockery/v/stable.svg)](https://packagist.org/packages/mockery/mockery) [![Total Downloads](https://poser.pugx.org/mockery/mockery/downloads.svg)](https://packagist.org/packages/mockery/mockery) @@ -167,7 +170,7 @@ $double->expects()->add($book)->twice(); If you have used Mockery before, you might see something new in the example above — we created a method expectation using `expects`, instead of the "old" `shouldReceive` syntax. This is a new feature of Mockery v1, but same as with -`accepts` in the previous section, it can be written in the "old" style. +`allows` in the previous section, it can be written in the "old" style. For new users of Mockery, the above example can also be written as: diff --git a/api/vendor/mockery/mockery/SECURITY.md b/api/vendor/mockery/mockery/SECURITY.md new file mode 100644 index 0000000000..cc8790e0f9 --- /dev/null +++ b/api/vendor/mockery/mockery/SECURITY.md @@ -0,0 +1,14 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| `2.0.x` | `yes` | +| `1.6.x` | `yes` | +| `1.5.x` | `yes` | +| `<1.5.x` | `no` | + +## Reporting a Vulnerability + +To report a security vulnerability, please [`Open a draft security advisory`](https://github.com/mockery/mockery/security/advisories/new) so we can coordinate the fix and disclosure. diff --git a/api/vendor/mockery/mockery/composer.json b/api/vendor/mockery/mockery/composer.json index 43caba8c6c..6f03cf2d43 100644 --- a/api/vendor/mockery/mockery/composer.json +++ b/api/vendor/mockery/mockery/composer.json @@ -1,9 +1,8 @@ { "name": "mockery/mockery", "description": "Mockery is a simple yet flexible PHP mock object framework", - "scripts": { - "docs": "phpdoc -d library -t docs/api" - }, + "license": "BSD-3-Clause", + "type": "library", "keywords": [ "bdd", "library", @@ -16,47 +15,105 @@ "test double", "testing" ], - "homepage": "https://github.com/mockery/mockery", - "license": "BSD-3-Clause", "authors": [ { "name": "Pádraic Brady", "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" + "homepage": "https://github.com/padraic", + "role": "Author" }, { "name": "Dave Marshall", "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], + "homepage": "https://github.com/mockery/mockery", + "support": { + "issues": "https://github.com/mockery/mockery/issues", + "source": "https://github.com/mockery/mockery", + "docs": "https://docs.mockery.io/", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories" + }, "require": { - "php": "^7.3 || ^8.0", + "php": ">=7.3", "lib-pcre": ">=7.0", "hamcrest/hamcrest-php": "^2.0.1" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3" + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" }, "conflict": { "phpunit/phpunit": "<8.0" }, "autoload": { - "psr-0": { - "Mockery": "library/" - } + "psr-4": { + "Mockery\\": "library/Mockery" + }, + "files": [ + "library/helpers.php", + "library/Mockery.php" + ] }, "autoload-dev": { "psr-4": { + "Fixture\\": "tests/Fixture/", + "Mockery\\Tests\\Unit\\": "tests/Unit", "test\\": "tests/" - } + }, + "files": [ + "fixtures/autoload.php", + "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php" + ] }, "config": { - "preferred-install": "dist" + "optimize-autoloader": true, + "platform": { + "php": "7.3.999" + }, + "preferred-install": "dist", + "sort-packages": true }, - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } + "scripts": { + "check": [ + "@composer validate", + "@ecs", + "@test" + ], + "docs": "vendor/bin/phpdoc -d library -t docs/api", + "ecs": [ + "@ecs:fix", + "@ecs:check" + ], + "ecs:check": "ecs check --clear-cache || true", + "ecs:fix": "ecs check --clear-cache --fix", + "phive": [ + "tools/phive update --force-accept-unsigned", + "tools/phive purge" + ], + "phpunit": "vendor/bin/phpunit --do-not-cache-result --colors=always", + "phpunit:coverage": "@phpunit --coverage-clover=coverage.xml", + "psalm": "tools/psalm --no-cache --show-info=true", + "psalm:alter": "tools/psalm --no-cache --alter --allow-backwards-incompatible-changes=false --safe-types", + "psalm:baseline": "@psalm --no-diff --set-baseline=psalm-baseline.xml", + "psalm:dry-run": "@psalm:alter --issues=all --dry-run", + "psalm:fix": "@psalm:alter --issues=UnnecessaryVarAnnotation,MissingPureAnnotation,MissingImmutableAnnotation", + "psalm:security": "@psalm --no-diff --taint-analysis", + "psalm:shepherd": "@psalm --no-diff --shepherd --stats --output-format=github", + "test": [ + "@phpunit --stop-on-defect", + "@psalm", + "@psalm:security", + "@psalm:dry-run" + ] } } diff --git a/api/vendor/mockery/mockery/composer.lock b/api/vendor/mockery/mockery/composer.lock new file mode 100644 index 0000000000..603f969765 --- /dev/null +++ b/api/vendor/mockery/mockery/composer.lock @@ -0,0 +1,1867 @@ +{ + "_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": "e70f68192a56a148f93ad7a1c0779be3", + "packages": [ + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, + "time": "2020-07-09T08:09:16+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "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%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.18.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" + }, + "time": "2023-12-10T21:03:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.30", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca2bd87d2f9215904682a9cb9bb37dda98e76089", + "reference": "ca2bd87d2f9215904682a9cb9bb37dda98e76089", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.30" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:47:57+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.17", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a156980d78a6666721b7e8e8502fe210b587fcd", + "reference": "1a156980d78a6666721b7e8e8502fe210b587fcd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.28", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.17" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-02-23T13:14:51+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "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": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-05-07T05:35:17+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T06:03:37+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bde739e7565280bda77be70044ac1047bc007e34" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-02T09:26:13+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symplify/easy-coding-standard", + "version": "12.1.14", + "source": { + "type": "git", + "url": "https://github.com/easy-coding-standard/easy-coding-standard.git", + "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/easy-coding-standard/easy-coding-standard/zipball/e3c4a241ee36704f7cf920d5931f39693e64afd5", + "reference": "e3c4a241ee36704f7cf920d5931f39693e64afd5", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "conflict": { + "friendsofphp/php-cs-fixer": "<3.46", + "phpcsstandards/php_codesniffer": "<3.8", + "symplify/coding-standard": "<12.1" + }, + "bin": [ + "bin/ecs" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Use Coding Standard with 0-knowledge of PHP-CS-Fixer and PHP_CodeSniffer", + "keywords": [ + "Code style", + "automation", + "fixer", + "static analysis" + ], + "support": { + "issues": "https://github.com/easy-coding-standard/easy-coding-standard/issues", + "source": "https://github.com/easy-coding-standard/easy-coding-standard/tree/12.1.14" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2024-02-23T13:10:40+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2023-11-20T00:12:19+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.3", + "lib-pcre": ">=7.0" + }, + "platform-dev": [], + "platform-overrides": { + "php": "7.3.999" + }, + "plugin-api-version": "2.6.0" +} diff --git a/api/vendor/mockery/mockery/docs/.gitignore b/api/vendor/mockery/mockery/docs/.gitignore new file mode 100644 index 0000000000..e35d8850c9 --- /dev/null +++ b/api/vendor/mockery/mockery/docs/.gitignore @@ -0,0 +1 @@ +_build diff --git a/api/vendor/mockery/mockery/docs/Makefile b/api/vendor/mockery/mockery/docs/Makefile new file mode 100644 index 0000000000..9a8c94087c --- /dev/null +++ b/api/vendor/mockery/mockery/docs/Makefile @@ -0,0 +1,177 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/MockeryDocs.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/MockeryDocs.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/MockeryDocs" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/MockeryDocs" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/api/vendor/mockery/mockery/docs/_static/.gitkeep b/api/vendor/mockery/mockery/docs/_static/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/api/vendor/mockery/mockery/docs/conf.py b/api/vendor/mockery/mockery/docs/conf.py index 901f040560..d0f6960008 100644 --- a/api/vendor/mockery/mockery/docs/conf.py +++ b/api/vendor/mockery/mockery/docs/conf.py @@ -30,6 +30,7 @@ # ones. extensions = [ 'sphinx.ext.todo', + 'sphinx_rtd_theme', ] # Add any paths that contain templates here, relative to this directory. @@ -53,9 +54,9 @@ # built documents. # # The short X.Y version. -version = '1.0' +version = '1.6' # The full version, including alpha/beta/rc tags. -release = '1.0-alpha' +release = '1.6.x' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -100,7 +101,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -256,7 +257,7 @@ import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - print sphinx_rtd_theme.get_html_theme_path() + print(sphinx_rtd_theme.get_html_theme_path()) # load PhpLexer from sphinx.highlighting import lexers diff --git a/api/vendor/mockery/mockery/docs/getting_started/upgrading.rst b/api/vendor/mockery/mockery/docs/getting_started/upgrading.rst index 7201e59732..8a17dfdad5 100644 --- a/api/vendor/mockery/mockery/docs/getting_started/upgrading.rst +++ b/api/vendor/mockery/mockery/docs/getting_started/upgrading.rst @@ -30,7 +30,7 @@ Read the documentation for a detailed overview of ":doc:`/reference/phpunit_inte +++++++++++++++++++++++++++++++++++++++++ As of 1.0.0 the ``\Mockery\Matcher\MustBe`` matcher is deprecated and will be removed in -Mockery 2.0.0. We recommend instead to use the PHPUnit or Hamcrest equivalents of the +Mockery 2.0.0. We recommend instead to use the PHPUnit equivalents of the MustBe matcher. ``allows`` and ``expects`` diff --git a/api/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst b/api/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst index 6f8f8c3f1c..b675514b11 100644 --- a/api/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst +++ b/api/vendor/mockery/mockery/docs/reference/creating_test_doubles.rst @@ -419,7 +419,7 @@ additional modifier: \Mockery::mock('MyClass')->shouldIgnoreMissing()->asUndefined(); The returned object is nothing more than a placeholder so if, by some act of -fate, it's erroneously used somewhere it shouldn't it will likely not pass a +fate, it's erroneously used somewhere it shouldn't, it will likely not pass a logic check. We have encountered the ``makePartial()`` method before, as it is the method we diff --git a/api/vendor/mockery/mockery/docs/reference/expectations.rst b/api/vendor/mockery/mockery/docs/reference/expectations.rst index 608aaef1ae..4430e97836 100644 --- a/api/vendor/mockery/mockery/docs/reference/expectations.rst +++ b/api/vendor/mockery/mockery/docs/reference/expectations.rst @@ -459,7 +459,7 @@ also works if we expect multiple calls to different methods. $mock = \Mockery::mock('MyClass'); // Expectations for the 1st call - $mock->shouldReceive('name_of_method'); + $mock->shouldReceive('name_of_method') ->once() ->with('arg1') ->andReturn($value1) diff --git a/api/vendor/mockery/mockery/docs/reference/index.rst b/api/vendor/mockery/mockery/docs/reference/index.rst index 1e5bf04814..7d6a0389b8 100644 --- a/api/vendor/mockery/mockery/docs/reference/index.rst +++ b/api/vendor/mockery/mockery/docs/reference/index.rst @@ -9,6 +9,7 @@ Reference argument_validation alternative_should_receive_syntax spies + instance_mocking partial_mocks protected_methods public_properties diff --git a/api/vendor/mockery/mockery/docs/reference/spies.rst b/api/vendor/mockery/mockery/docs/reference/spies.rst index 9a699cbf9e..1663918691 100644 --- a/api/vendor/mockery/mockery/docs/reference/spies.rst +++ b/api/vendor/mockery/mockery/docs/reference/spies.rst @@ -18,7 +18,7 @@ Spies also allow us to follow the more familiar Arrange-Act-Assert or Given-When-Then style within our tests. With mocks, we have to follow a less familiar style, something along the lines of Arrange-Expect-Act-Assert, where we have to tell our mocks what to expect before we act on the SUT, then assert -that those expectations where met: +that those expectations were met: .. code-block:: php diff --git a/api/vendor/mockery/mockery/docs/requirements.txt b/api/vendor/mockery/mockery/docs/requirements.txt new file mode 100644 index 0000000000..2f74b4c0e5 --- /dev/null +++ b/api/vendor/mockery/mockery/docs/requirements.txt @@ -0,0 +1,25 @@ +alabaster==0.7.16 +Babel==2.14.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +docutils==0.20.1 +idna==3.7 +imagesize==1.4.1 +Jinja2==3.1.4 +MarkupSafe==2.1.5 +packaging==24.0 +Pygments==2.17.2 +requests==2.31.0 +setuptools==69.2.0 +snowballstemmer==2.2.0 +Sphinx==7.3.7 +sphinx-rtd-theme==2.0.0 +sphinxcontrib-applehelp==1.0.8 +sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-jquery==4.1 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-serializinghtml==1.1.10 +urllib3==2.2.1 +wheel==0.43.0 diff --git a/api/vendor/mockery/mockery/library/Mockery.php b/api/vendor/mockery/mockery/library/Mockery.php index 95abd1b9dd..1370cea07d 100644 --- a/api/vendor/mockery/mockery/library/Mockery.php +++ b/api/vendor/mockery/mockery/library/Mockery.php @@ -1,184 +1,154 @@ */ private static $_filesToCleanUp = []; /** - * Defines the global helper functions + * Return instance of AndAnyOtherArgs matcher. * - * @return void + * @return AndAnyOtherArgs */ - public static function globalHelpers() + public static function andAnyOtherArgs() { - require_once __DIR__ . '/helpers.php'; + return new AndAnyOtherArgs(); } /** - * @return array + * Return instance of AndAnyOtherArgs matcher. * - * @deprecated since 1.3.2 and will be removed in 2.0. - */ - public static function builtInTypes() - { - return array( - 'array', - 'bool', - 'callable', - 'float', - 'int', - 'iterable', - 'object', - 'self', - 'string', - 'void', - ); - } - - /** - * @param string $type - * @return bool + * An alternative name to `andAnyOtherArgs` so + * the API stays closer to `any` as well. * - * @deprecated since 1.3.2 and will be removed in 2.0. + * @return AndAnyOtherArgs */ - public static function isBuiltInType($type) + public static function andAnyOthers() { - return in_array($type, \Mockery::builtInTypes()); + return new AndAnyOtherArgs(); } /** - * Static shortcut to \Mockery\Container::mock(). - * - * @param mixed ...$args + * Return instance of ANY matcher. * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface + * @return Any */ - public static function mock(...$args) + public static function any() { - return call_user_func_array(array(self::getContainer(), 'mock'), $args); + return new Any(); } /** - * Static and semantic shortcut for getting a mock from the container - * and applying the spy's expected behavior into it. - * - * @param mixed ...$args + * Return instance of ANYOF matcher. * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public static function spy(...$args) - { - if (count($args) && $args[0] instanceof \Closure) { - $args[0] = new ClosureWrapper($args[0]); - } - - return call_user_func_array(array(self::getContainer(), 'mock'), $args)->shouldIgnoreMissing(); - } - - /** - * Static and Semantic shortcut to \Mockery\Container::mock(). + * @template TAnyOf * - * @param mixed ...$args + * @param TAnyOf ...$args * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface + * @return AnyOf */ - public static function instanceMock(...$args) + public static function anyOf(...$args) { - return call_user_func_array(array(self::getContainer(), 'mock'), $args); + return new AnyOf($args); } /** - * Static shortcut to \Mockery\Container::mock(), first argument names the mock. - * - * @param mixed ...$args + * @return array * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface + * @deprecated since 1.3.2 and will be removed in 2.0. */ - public static function namedMock(...$args) + public static function builtInTypes() { - $name = array_shift($args); - - $builder = new MockConfigurationBuilder(); - $builder->setName($name); - - array_unshift($args, $builder); - - return call_user_func_array(array(self::getContainer(), 'mock'), $args); + return ['array', 'bool', 'callable', 'float', 'int', 'iterable', 'object', 'self', 'string', 'void']; } /** - * Static shortcut to \Mockery\Container::self(). + * Return instance of CLOSURE matcher. * - * @throws LogicException + * @template TReference * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface + * @param TReference $reference + * + * @return ClosureMatcher */ - public static function self() + public static function capture(&$reference) { - if (is_null(self::$_container)) { - throw new \LogicException('You have not declared any mocks yet'); - } + $closure = static function ($argument) use (&$reference) { + $reference = $argument; + return true; + }; - return self::$_container->self(); + return new ClosureMatcher($closure); } /** @@ -190,543 +160,672 @@ public static function self() public static function close() { foreach (self::$_filesToCleanUp as $fileName) { - @unlink($fileName); + @\unlink($fileName); } + self::$_filesToCleanUp = []; - if (is_null(self::$_container)) { + if (self::$_container === null) { return; } $container = self::$_container; + self::$_container = null; $container->mockery_teardown(); + $container->mockery_close(); } /** - * Static fetching of a mock associated with a name or explicit class poser. + * Return instance of CONTAINS matcher. + * + * @template TContains * - * @param string $name + * @param TContains $args * - * @return \Mockery\Mock + * @return Contains */ - public static function fetchMock($name) + public static function contains(...$args) { - return self::getContainer()->fetchMock($name); + return new Contains($args); } /** - * Lazy loader and getter for - * the container property. + * @param class-string $fqn * - * @return Mockery\Container + * @return void */ - public static function getContainer() + public static function declareClass($fqn) { - if (is_null(self::$_container)) { - self::$_container = new Mockery\Container(self::getGenerator(), self::getLoader()); - } - - return self::$_container; + static::declareType($fqn, 'class'); } /** - * Setter for the $_generator static property. + * @param class-string $fqn * - * @param \Mockery\Generator\Generator $generator + * @return void */ - public static function setGenerator(Generator $generator) + public static function declareInterface($fqn) { - self::$_generator = $generator; + static::declareType($fqn, 'interface'); } /** - * Lazy loader method and getter for - * the generator property. + * Return instance of DUCKTYPE matcher. * - * @return Generator + * @template TDucktype + * + * @param TDucktype ...$args + * + * @return Ducktype */ - public static function getGenerator() + public static function ducktype(...$args) { - if (is_null(self::$_generator)) { - self::$_generator = self::getDefaultGenerator(); - } - - return self::$_generator; + return new Ducktype($args); } /** - * Creates and returns a default generator - * used inside this class. + * Static fetching of a mock associated with a name or explicit class poser. * - * @return CachingGenerator + * @template TFetchMock of object + * + * @param class-string $name + * + * @return null|(LegacyMockInterface&MockInterface&TFetchMock) */ - public static function getDefaultGenerator() + public static function fetchMock($name) { - return new CachingGenerator(StringManipulationGenerator::withDefaultPasses()); + return self::getContainer()->fetchMock($name); } /** - * Setter for the $_loader static property. + * Utility method to format method name and arguments into a string. * - * @param Loader $loader + * @param string $method + * + * @return string */ - public static function setLoader(Loader $loader) + public static function formatArgs($method, ?array $arguments = null) { - self::$_loader = $loader; + if ($arguments === null) { + return $method . '()'; + } + + $formattedArguments = []; + foreach ($arguments as $argument) { + $formattedArguments[] = self::formatArgument($argument); + } + + return $method . '(' . \implode(', ', $formattedArguments) . ')'; } /** - * Lazy loader method and getter for - * the $_loader property. + * Utility function to format objects to printable arrays. * - * @return Loader + * @return string */ - public static function getLoader() + public static function formatObjects(?array $objects = null) { - if (is_null(self::$_loader)) { - self::$_loader = self::getDefaultLoader(); + static $formatting; + + if ($formatting) { + return '[Recursion]'; } - return self::$_loader; + if ($objects === null) { + return ''; + } + + $objects = \array_filter($objects, 'is_object'); + if ($objects === []) { + return ''; + } + + $formatting = true; + $parts = []; + + foreach ($objects as $object) { + $parts[\get_class($object)] = self::objectToArray($object); + } + + $formatting = false; + + return 'Objects: ( ' . \var_export($parts, true) . ')'; } /** - * Gets an EvalLoader to be used as default. + * Lazy loader and Getter for the global + * configuration container. * - * @return EvalLoader + * @return Configuration */ - public static function getDefaultLoader() + public static function getConfiguration() { - return new EvalLoader(); + if (self::$_config === null) { + self::$_config = new Configuration(); + } + + return self::$_config; } /** - * Set the container. + * Lazy loader and getter for the container property. * - * @param \Mockery\Container $container - * - * @return \Mockery\Container + * @return Container */ - public static function setContainer(Mockery\Container $container) + public static function getContainer() { - return self::$_container = $container; + if (self::$_container === null) { + self::$_container = new Container(self::getGenerator(), self::getLoader()); + } + + return self::$_container; } /** - * Reset the container to null. + * Creates and returns a default generator + * used inside this class. * - * @return void + * @return CachingGenerator */ - public static function resetContainer() + public static function getDefaultGenerator() { - self::$_container = null; + return new CachingGenerator(StringManipulationGenerator::withDefaultPasses()); } /** - * Return instance of ANY matcher. + * Gets an EvalLoader to be used as default. * - * @return \Mockery\Matcher\Any + * @return EvalLoader */ - public static function any() + public static function getDefaultLoader() { - return new \Mockery\Matcher\Any(); + return new EvalLoader(); } /** - * Return instance of AndAnyOtherArgs matcher. - * - * An alternative name to `andAnyOtherArgs` so - * the API stays closer to `any` as well. + * Lazy loader method and getter for + * the generator property. * - * @return \Mockery\Matcher\AndAnyOtherArgs + * @return Generator */ - public static function andAnyOthers() + public static function getGenerator() { - return new \Mockery\Matcher\AndAnyOtherArgs(); + if (self::$_generator === null) { + self::$_generator = self::getDefaultGenerator(); + } + + return self::$_generator; } /** - * Return instance of AndAnyOtherArgs matcher. + * Lazy loader method and getter for + * the $_loader property. * - * @return \Mockery\Matcher\AndAnyOtherArgs + * @return Loader */ - public static function andAnyOtherArgs() + public static function getLoader() { - return new \Mockery\Matcher\AndAnyOtherArgs(); + if (self::$_loader === null) { + self::$_loader = self::getDefaultLoader(); + } + + return self::$_loader; } /** - * Return instance of TYPE matcher. - * - * @param mixed $expected + * Defines the global helper functions * - * @return \Mockery\Matcher\Type + * @return void */ - public static function type($expected) + public static function globalHelpers() { - return new \Mockery\Matcher\Type($expected); + require_once __DIR__ . '/helpers.php'; } /** - * Return instance of DUCKTYPE matcher. + * Return instance of HASKEY matcher. + * + * @template THasKey * - * @param array ...$args + * @param THasKey $key * - * @return \Mockery\Matcher\Ducktype + * @return HasKey */ - public static function ducktype(...$args) + public static function hasKey($key) { - return new \Mockery\Matcher\Ducktype($args); + return new HasKey($key); } /** - * Return instance of SUBSET matcher. + * Return instance of HASVALUE matcher. * - * @param array $part - * @param bool $strict - (Optional) True for strict comparison, false for loose + * @template THasValue + * + * @param THasValue $val * - * @return \Mockery\Matcher\Subset + * @return HasValue */ - public static function subset(array $part, $strict = true) + public static function hasValue($val) { - return new \Mockery\Matcher\Subset($part, $strict); + return new HasValue($val); } /** - * Return instance of CONTAINS matcher. + * Static and Semantic shortcut to Container::mock(). + * + * @template TInstanceMock * - * @param mixed $args + * @param array|TInstanceMock|array> $args * - * @return \Mockery\Matcher\Contains + * @return LegacyMockInterface&MockInterface&TInstanceMock */ - public static function contains(...$args) + public static function instanceMock(...$args) { - return new \Mockery\Matcher\Contains($args); + return self::getContainer()->mock(...$args); } /** - * Return instance of HASKEY matcher. + * @param string $type * - * @param mixed $key + * @return bool * - * @return \Mockery\Matcher\HasKey + * @deprecated since 1.3.2 and will be removed in 2.0. */ - public static function hasKey($key) + public static function isBuiltInType($type) { - return new \Mockery\Matcher\HasKey($key); + return \in_array($type, self::builtInTypes(), true); } /** - * Return instance of HASVALUE matcher. + * Return instance of IsEqual matcher. * - * @param mixed $val + * @template TExpected * - * @return \Mockery\Matcher\HasValue + * @param TExpected $expected */ - public static function hasValue($val) + public static function isEqual($expected): IsEqual { - return new \Mockery\Matcher\HasValue($val); + return new IsEqual($expected); } /** - * Return instance of CLOSURE matcher. + * Return instance of IsSame matcher. * - * @param $reference + * @template TExpected * - * @return \Mockery\Matcher\Closure + * @param TExpected $expected */ - public static function capture(&$reference) + public static function isSame($expected): IsSame { - $closure = function ($argument) use (&$reference) { - $reference = $argument; - return true; - }; - - return new \Mockery\Matcher\Closure($closure); + return new IsSame($expected); } /** - * Return instance of CLOSURE matcher. + * Static shortcut to Container::mock(). + * + * @template TMock of object * - * @param mixed $closure + * @param array|TMock|Closure(LegacyMockInterface&MockInterface&TMock):LegacyMockInterface&MockInterface&TMock|array> $args * - * @return \Mockery\Matcher\Closure + * @return LegacyMockInterface&MockInterface&TMock */ - public static function on($closure) + public static function mock(...$args) { - return new \Mockery\Matcher\Closure($closure); + return self::getContainer()->mock(...$args); } /** * Return instance of MUSTBE matcher. * - * @param mixed $expected + * @template TExpected * - * @return \Mockery\Matcher\MustBe + * @param TExpected $expected + * + * @return MustBe */ public static function mustBe($expected) { - return new \Mockery\Matcher\MustBe($expected); + return new MustBe($expected); } /** - * Return instance of NOT matcher. + * Static shortcut to Container::mock(), first argument names the mock. * - * @param mixed $expected + * @template TNamedMock * - * @return \Mockery\Matcher\Not + * @param array|TNamedMock|array> $args + * + * @return LegacyMockInterface&MockInterface&TNamedMock */ - public static function not($expected) + public static function namedMock(...$args) { - return new \Mockery\Matcher\Not($expected); - } + $name = \array_shift($args); - /** - * Return instance of ANYOF matcher. + $builder = new MockConfigurationBuilder(); + $builder->setName($name); + + \array_unshift($args, $builder); + + return self::getContainer()->mock(...$args); + } + + /** + * Return instance of NOT matcher. + * + * @template TNotExpected * - * @param array ...$args + * @param TNotExpected $expected * - * @return \Mockery\Matcher\AnyOf + * @return Not */ - public static function anyOf(...$args) + public static function not($expected) { - return new \Mockery\Matcher\AnyOf($args); + return new Not($expected); } /** * Return instance of NOTANYOF matcher. * - * @param array ...$args + * @template TNotAnyOf + * + * @param TNotAnyOf ...$args * - * @return \Mockery\Matcher\NotAnyOf + * @return NotAnyOf */ public static function notAnyOf(...$args) { - return new \Mockery\Matcher\NotAnyOf($args); + return new NotAnyOf($args); } /** - * Return instance of PATTERN matcher. + * Return instance of CLOSURE matcher. + * + * @template TClosure of Closure * - * @param mixed $expected + * @param TClosure $closure * - * @return \Mockery\Matcher\Pattern + * @return ClosureMatcher */ - public static function pattern($expected) + public static function on($closure) { - return new \Mockery\Matcher\Pattern($expected); + return new ClosureMatcher($closure); } /** - * Lazy loader and Getter for the global - * configuration container. + * Utility function to parse shouldReceive() arguments and generate + * expectations from such as needed. + * + * @template TReturnArgs + * + * @param TReturnArgs ...$args + * @param Closure $add * - * @return \Mockery\Configuration + * @return CompositeExpectation */ - public static function getConfiguration() + public static function parseShouldReturnArgs(LegacyMockInterface $mock, $args, $add) { - if (is_null(self::$_config)) { - self::$_config = new \Mockery\Configuration(); + $composite = new CompositeExpectation(); + + foreach ($args as $arg) { + if (\is_string($arg)) { + $composite->add(self::buildDemeterChain($mock, $arg, $add)); + + continue; + } + + if (\is_array($arg)) { + foreach ($arg as $k => $v) { + $composite->add(self::buildDemeterChain($mock, $k, $add)->andReturn($v)); + } + } } - return self::$_config; + return $composite; } /** - * Utility method to format method name and arguments into a string. + * Return instance of PATTERN matcher. * - * @param string $method - * @param array $arguments + * @template TPatter * - * @return string + * @param TPatter $expected + * + * @return Pattern */ - public static function formatArgs($method, array $arguments = null) + public static function pattern($expected) { - if (is_null($arguments)) { - return $method . '()'; - } + return new Pattern($expected); + } - $formattedArguments = array(); - foreach ($arguments as $argument) { - $formattedArguments[] = self::formatArgument($argument); - } + /** + * Register a file to be deleted on tearDown. + * + * @param string $fileName + */ + public static function registerFileForCleanUp($fileName) + { + self::$_filesToCleanUp[] = $fileName; + } - return $method . '(' . implode(', ', $formattedArguments) . ')'; + /** + * Reset the container to null. + * + * @return void + */ + public static function resetContainer() + { + self::$_container = null; } /** - * Gets the string representation - * of any passed argument. + * Static shortcut to Container::self(). * - * @param mixed $argument - * @param int $depth + * @throws LogicException * - * @return mixed + * @return LegacyMockInterface|MockInterface */ - private static function formatArgument($argument, $depth = 0) + public static function self() { - if ($argument instanceof MatcherAbstract) { - return (string) $argument; - } - - if (is_object($argument)) { - return 'object(' . get_class($argument) . ')'; - } - - if (is_int($argument) || is_float($argument)) { - return $argument; - } - - if (is_array($argument)) { - if ($depth === 1) { - $argument = '[...]'; - } else { - $sample = array(); - foreach ($argument as $key => $value) { - $key = is_int($key) ? $key : "'$key'"; - $value = self::formatArgument($value, $depth + 1); - $sample[] = "$key => $value"; - } - - $argument = "[" . implode(", ", $sample) . "]"; - } - - return ((strlen($argument) > 1000) ? substr($argument, 0, 1000) . '...]' : $argument); + if (self::$_container === null) { + throw new LogicException('You have not declared any mocks yet'); } - if (is_bool($argument)) { - return $argument ? 'true' : 'false'; - } + return self::$_container->self(); + } - if (is_resource($argument)) { - return 'resource(...)'; - } + /** + * Set the container. + * + * @return Container + */ + public static function setContainer(Container $container) + { + return self::$_container = $container; + } - if (is_null($argument)) { - return 'NULL'; - } + /** + * Setter for the $_generator static property. + */ + public static function setGenerator(Generator $generator) + { + self::$_generator = $generator; + } - return "'" . (string) $argument . "'"; + /** + * Setter for the $_loader static property. + */ + public static function setLoader(Loader $loader) + { + self::$_loader = $loader; } /** - * Utility function to format objects to printable arrays. + * Static and semantic shortcut for getting a mock from the container + * and applying the spy's expected behavior into it. * - * @param array $objects + * @template TSpy * - * @return string + * @param array|TSpy|Closure(LegacyMockInterface&MockInterface&TSpy):LegacyMockInterface&MockInterface&TSpy|array> $args + * + * @return LegacyMockInterface&MockInterface&TSpy */ - public static function formatObjects(array $objects = null) + public static function spy(...$args) { - static $formatting; - - if ($formatting) { - return '[Recursion]'; - } - - if (is_null($objects)) { - return ''; - } - - $objects = array_filter($objects, 'is_object'); - if (empty($objects)) { - return ''; + if ($args !== [] && $args[0] instanceof Closure) { + $args[0] = new ClosureWrapper($args[0]); } - $formatting = true; - $parts = array(); - - foreach ($objects as $object) { - $parts[get_class($object)] = self::objectToArray($object); - } + return self::getContainer()->mock(...$args)->shouldIgnoreMissing(); + } - $formatting = false; + /** + * Return instance of SUBSET matcher. + * + * @param bool $strict - (Optional) True for strict comparison, false for loose + * + * @return Subset + */ + public static function subset(array $part, $strict = true) + { + return new Subset($part, $strict); + } - return 'Objects: ( ' . var_export($parts, true) . ')'; + /** + * Return instance of TYPE matcher. + * + * @template TExpectedType + * + * @param TExpectedType $expected + * + * @return Type + */ + public static function type($expected) + { + return new Type($expected); } /** - * Utility function to turn public properties and public get* and is* method values into an array. + * Sets up expectations on the members of the CompositeExpectation and + * builds up any demeter chain that was passed to shouldReceive. * - * @param object $object - * @param int $nesting + * @param string $arg + * @param Closure $add * - * @return array + * @throws MockeryException + * + * @return ExpectationInterface */ - private static function objectToArray($object, $nesting = 3) + protected static function buildDemeterChain(LegacyMockInterface $mock, $arg, $add) { - if ($nesting == 0) { - return array('...'); + $container = $mock->mockery_getContainer(); + $methodNames = \explode('->', $arg); + + \reset($methodNames); + + if ( + ! $mock->mockery_isAnonymous() + && ! self::getConfiguration()->mockingNonExistentMethodsAllowed() + && ! \in_array(\current($methodNames), $mock->mockery_getMockableMethods(), true) + ) { + throw new MockeryException( + "Mockery's configuration currently forbids mocking the method " + . \current($methodNames) . ' as it does not exist on the class or object ' + . 'being mocked' + ); } - $defaultFormatter = function ($object, $nesting) { - return array('properties' => self::extractInstancePublicProperties($object, $nesting)); + /** @var Closure $nextExp */ + $nextExp = static function ($method) use ($add) { + return $add($method); }; - $class = get_class($object); + $parent = \get_class($mock); - $formatter = self::getConfiguration()->getObjectFormatter($class, $defaultFormatter); + /** @var null|ExpectationInterface $expectations */ + $expectations = null; + while (true) { + $method = \array_shift($methodNames); + $expectations = $mock->mockery_getExpectationsFor($method); + + if ($expectations === null || self::noMoreElementsInChain($methodNames)) { + $expectations = $nextExp($method); + if (self::noMoreElementsInChain($methodNames)) { + break; + } + + $mock = self::getNewDemeterMock($container, $parent, $method, $expectations); + } else { + $demeterMockKey = $container->getKeyOfDemeterMockFor($method, $parent); + if ($demeterMockKey !== null) { + $mock = self::getExistingDemeterMock($container, $demeterMockKey); + } + } - $array = array( - 'class' => $class, - 'identity' => '#' . md5(spl_object_hash($object)) - ); + $parent .= '->' . $method; - $array = array_merge($array, $formatter($object, $nesting)); + $nextExp = static function ($n) use ($mock) { + return $mock->allows($n); + }; + } - return $array; + return $expectations; } /** - * Returns all public instance properties. + * Utility method for recursively generating a representation of the given array. * - * @param mixed $object - * @param int $nesting + * @template TArray or array * - * @return array + * @param TArray $argument + * @param int $nesting + * + * @return TArray */ - private static function extractInstancePublicProperties($object, $nesting) + private static function cleanupArray($argument, $nesting = 3) { - $reflection = new \ReflectionClass(get_class($object)); - $properties = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC); - $cleanedProperties = array(); + if ($nesting === 0) { + return '...'; + } - foreach ($properties as $publicProperty) { - if (!$publicProperty->isStatic()) { - $name = $publicProperty->getName(); - try { - $cleanedProperties[$name] = self::cleanupNesting($object->$name, $nesting); - } catch (\Exception $exception) { - $cleanedProperties[$name] = $exception->getMessage(); - } + foreach ($argument as $key => $value) { + if (\is_array($value)) { + $argument[$key] = self::cleanupArray($value, $nesting - 1); + + continue; + } + + if (\is_object($value)) { + $argument[$key] = self::objectToArray($value, $nesting - 1); } } - return $cleanedProperties; + return $argument; } /** * Utility method used for recursively generating * an object or array representation. * - * @param mixed $argument - * @param int $nesting + * @template TArgument + * + * @param TArgument $argument + * @param int $nesting * * @return mixed */ private static function cleanupNesting($argument, $nesting) { - if (is_object($argument)) { + if (\is_object($argument)) { $object = self::objectToArray($argument, $nesting - 1); - $object['class'] = get_class($argument); + $object['class'] = \get_class($argument); return $object; } - if (is_array($argument)) { + if (\is_array($argument)) { return self::cleanupArray($argument, $nesting - 1); } @@ -734,165 +833,181 @@ private static function cleanupNesting($argument, $nesting) } /** - * Utility method for recursively - * gerating a representation - * of the given array. - * - * @param array $argument - * @param int $nesting - * - * @return mixed + * @param string $fqn + * @param string $type */ - private static function cleanupArray($argument, $nesting = 3) + private static function declareType($fqn, $type): void { - if ($nesting == 0) { - return '...'; - } + $targetCode = ' $value) { - if (is_array($value)) { - $argument[$key] = self::cleanupArray($value, $nesting - 1); - } elseif (is_object($value)) { - $argument[$key] = self::objectToArray($value, $nesting - 1); - } + if (\strpos($fqn, '\\')) { + $parts = \explode('\\', $fqn); + + $shortName = \trim(\array_pop($parts)); + $namespace = \implode('\\', $parts); + + $targetCode .= "namespace {$namespace};\n"; } - return $argument; + $targetCode .= \sprintf('%s %s {} ', $type, $shortName); + + /* + * We could eval here, but it doesn't play well with the way + * PHPUnit tries to backup global state and the require definition + * loader + */ + $fileName = \tempnam(\sys_get_temp_dir(), 'Mockery'); + + \file_put_contents($fileName, $targetCode); + + require $fileName; + + self::registerFileForCleanUp($fileName); } /** - * Utility function to parse shouldReceive() arguments and generate - * expectations from such as needed. + * Returns all public instance properties. + * + * @param object $object + * @param int $nesting * - * @param Mockery\LegacyMockInterface $mock - * @param array ...$args - * @param callable $add - * @return \Mockery\CompositeExpectation + * @return array */ - public static function parseShouldReturnArgs(\Mockery\LegacyMockInterface $mock, $args, $add) + private static function extractInstancePublicProperties($object, $nesting) { - $composite = new \Mockery\CompositeExpectation(); + $reflection = new ReflectionClass($object); + $properties = $reflection->getProperties(ReflectionProperty::IS_PUBLIC); + $cleanedProperties = []; - foreach ($args as $arg) { - if (is_array($arg)) { - foreach ($arg as $k => $v) { - $expectation = self::buildDemeterChain($mock, $k, $add)->andReturn($v); - $composite->add($expectation); + foreach ($properties as $publicProperty) { + if (! $publicProperty->isStatic()) { + $name = $publicProperty->getName(); + try { + $cleanedProperties[$name] = self::cleanupNesting($object->{$name}, $nesting); + } catch (Exception $exception) { + $cleanedProperties[$name] = $exception->getMessage(); } - } elseif (is_string($arg)) { - $expectation = self::buildDemeterChain($mock, $arg, $add); - $composite->add($expectation); } } - return $composite; + return $cleanedProperties; } /** - * Sets up expectations on the members of the CompositeExpectation and - * builds up any demeter chain that was passed to shouldReceive. + * Gets the string representation + * of any passed argument. * - * @param \Mockery\LegacyMockInterface $mock - * @param string $arg - * @param callable $add - * @throws Mockery\Exception - * @return \Mockery\ExpectationInterface + * @param mixed $argument + * @param int $depth + * + * @return mixed */ - protected static function buildDemeterChain(\Mockery\LegacyMockInterface $mock, $arg, $add) + private static function formatArgument($argument, $depth = 0) { - /** @var Mockery\Container $container */ - $container = $mock->mockery_getContainer(); - $methodNames = explode('->', $arg); - reset($methodNames); - - if (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() - && !$mock->mockery_isAnonymous() - && !in_array(current($methodNames), $mock->mockery_getMockableMethods()) - ) { - throw new \Mockery\Exception( - 'Mockery\'s configuration currently forbids mocking the method ' - . current($methodNames) . ' as it does not exist on the class or object ' - . 'being mocked' - ); + if ($argument instanceof MatcherInterface) { + return (string) $argument; } - /** @var ExpectationInterface|null $expectations */ - $expectations = null; - - /** @var Callable $nextExp */ - $nextExp = function ($method) use ($add) { - return $add($method); - }; - - $parent = get_class($mock); - - while (true) { - $method = array_shift($methodNames); - $expectations = $mock->mockery_getExpectationsFor($method); + if (\is_object($argument)) { + return 'object(' . \get_class($argument) . ')'; + } - if (is_null($expectations) || self::noMoreElementsInChain($methodNames)) { - $expectations = $nextExp($method); - if (self::noMoreElementsInChain($methodNames)) { - break; - } + if (\is_int($argument) || \is_float($argument)) { + return $argument; + } - $mock = self::getNewDemeterMock($container, $parent, $method, $expectations); + if (\is_array($argument)) { + if ($depth === 1) { + $argument = '[...]'; } else { - $demeterMockKey = $container->getKeyOfDemeterMockFor($method, $parent); - if ($demeterMockKey) { - $mock = self::getExistingDemeterMock($container, $demeterMockKey); + $sample = []; + foreach ($argument as $key => $value) { + $key = \is_int($key) ? $key : \sprintf("'%s'", $key); + $value = self::formatArgument($value, $depth + 1); + $sample[] = \sprintf('%s => %s', $key, $value); } + + $argument = '[' . \implode(', ', $sample) . ']'; } - $parent .= '->' . $method; + return (\strlen($argument) > 1000) ? \substr($argument, 0, 1000) . '...]' : $argument; + } - $nextExp = function ($n) use ($mock) { - return $mock->shouldReceive($n); - }; + if (\is_bool($argument)) { + return $argument ? 'true' : 'false'; } - return $expectations; + if (\is_resource($argument)) { + return 'resource(...)'; + } + + if ($argument === null) { + return 'NULL'; + } + + return "'" . $argument . "'"; + } + + /** + * Gets a specific demeter mock from the ones kept by the container. + * + * @template TMock of object + * + * @param class-string $demeterMockKey + * + * @return null|(LegacyMockInterface&MockInterface&TMock) + */ + private static function getExistingDemeterMock(Container $container, $demeterMockKey) + { + return $container->getMocks()[$demeterMockKey] ?? null; } /** * Gets a new demeter configured * mock from the container. * - * @param \Mockery\Container $container * @param string $parent * @param string $method - * @param Mockery\ExpectationInterface $exp * - * @return \Mockery\Mock + * @return LegacyMockInterface&MockInterface */ - private static function getNewDemeterMock( - Mockery\Container $container, - $parent, - $method, - Mockery\ExpectationInterface $exp - ) { - $newMockName = 'demeter_' . md5($parent) . '_' . $method; + private static function getNewDemeterMock(Container $container, $parent, $method, ExpectationInterface $exp) + { + $newMockName = 'demeter_' . \md5($parent) . '_' . $method; $parRef = null; - $parRefMethod = null; - $parRefMethodRetType = null; $parentMock = $exp->getMock(); if ($parentMock !== null) { $parRef = new ReflectionObject($parentMock); } - if ($parRef !== null && $parRef->hasMethod($method)) { + if ($parRef instanceof ReflectionObject && $parRef->hasMethod($method)) { $parRefMethod = $parRef->getMethod($method); $parRefMethodRetType = Reflector::getReturnType($parRefMethod, true); - if ($parRefMethodRetType !== null && $parRefMethodRetType !== 'mixed') { - $nameBuilder = new MockNameBuilder(); - $nameBuilder->addPart('\\' . $newMockName); - $mock = self::namedMock($nameBuilder->build(), $parRefMethodRetType); - $exp->andReturn($mock); + if ($parRefMethodRetType !== null) { + $returnTypes = \explode('|', $parRefMethodRetType); + + $filteredReturnTypes = array_filter($returnTypes, static function (string $type): bool { + return ! Reflector::isReservedWord($type); + }); + + if ($filteredReturnTypes !== []) { + $nameBuilder = new MockNameBuilder(); + + $nameBuilder->addPart('\\' . $newMockName); - return $mock; + $mock = self::namedMock( + $nameBuilder->build(), + ...$filteredReturnTypes + ); + + $exp->andReturn($mock); + + return $mock; + } } } @@ -902,82 +1017,46 @@ private static function getNewDemeterMock( return $mock; } - /** - * Gets an specific demeter mock from - * the ones kept by the container. - * - * @param \Mockery\Container $container - * @param string $demeterMockKey - * - * @return mixed - */ - private static function getExistingDemeterMock( - Mockery\Container $container, - $demeterMockKey - ) { - $mocks = $container->getMocks(); - $mock = $mocks[$demeterMockKey]; - - return $mock; - } - /** * Checks if the passed array representing a demeter * chain with the method names is empty. * - * @param array $methodNames - * * @return bool */ private static function noMoreElementsInChain(array $methodNames) { - return empty($methodNames); - } - - public static function declareClass($fqn) - { - return static::declareType($fqn, "class"); - } - - public static function declareInterface($fqn) - { - return static::declareType($fqn, "interface"); + return $methodNames === []; } - private static function declareType($fqn, $type) + /** + * Utility function to turn public properties and public get* and is* method values into an array. + * + * @param object $object + * @param int $nesting + * + * @return array + */ + private static function objectToArray($object, $nesting = 3) { - $targetCode = " self::extractInstancePublicProperties($object, $nesting), + ]; + }; - $shortName = trim(array_pop($parts)); - $namespace = implode("\\", $parts); + $class = \get_class($object); - $targetCode.= "namespace $namespace;\n"; - } - - $targetCode.= "$type $shortName {} "; + $formatter = self::getConfiguration()->getObjectFormatter($class, $defaultFormatter); - /* - * We could eval here, but it doesn't play well with the way - * PHPUnit tries to backup global state and the require definition - * loader - */ - $tmpfname = tempnam(sys_get_temp_dir(), "Mockery"); - file_put_contents($tmpfname, $targetCode); - require $tmpfname; - \Mockery::registerFileForCleanUp($tmpfname); - } + $array = [ + 'class' => $class, + 'identity' => '#' . \md5(\spl_object_hash($object)), + ]; - /** - * Register a file to be deleted on tearDown. - * - * @param string $fileName - */ - public static function registerFileForCleanUp($fileName) - { - self::$_filesToCleanUp[] = $fileName; + return \array_merge($array, $formatter($object, $nesting)); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php b/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php index 472f6fbccf..a6d5b8fed3 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php +++ b/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php @@ -1,26 +1,20 @@ addMockeryExpectationsToAssertionCount(); - $this->checkMockeryExceptions(); - $this->closeMockery(); - - parent::assertPostConditions(); - } - protected function addMockeryExpectationsToAssertionCount() { $this->addToAssertionCount(Mockery::getContainer()->mockery_getExpectationCount()); @@ -52,12 +33,12 @@ protected function addMockeryExpectationsToAssertionCount() protected function checkMockeryExceptions() { - if (!method_exists($this, "markAsRisky")) { + if (! method_exists($this, 'markAsRisky')) { return; } foreach (Mockery::getContainer()->mockery_thrownExceptions() as $e) { - if (!$e->dismissed()) { + if (! $e->dismissed()) { $this->markAsRisky(); } } @@ -70,16 +51,22 @@ protected function closeMockery() } /** - * @before + * Performs assertions shared by all tests of a test case. This method is + * called before execution of a test ends and before the tearDown method. */ - protected function startMockery() + protected function mockeryAssertPostConditions() { - $this->mockeryOpen = true; + $this->addMockeryExpectationsToAssertionCount(); + $this->checkMockeryExceptions(); + $this->closeMockery(); + + parent::assertPostConditions(); } /** * @after */ + #[After] protected function purgeMockeryContainer() { if ($this->mockeryOpen) { @@ -87,4 +74,13 @@ protected function purgeMockeryContainer() Mockery::close(); } } + + /** + * @before + */ + #[Before] + protected function startMockery() + { + $this->mockeryOpen = true; + } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php b/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php index 68fc89ef5d..e4a80b5f72 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php +++ b/api/vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegrationAssertPostConditions.php @@ -1,21 +1,11 @@ getBlacklistedDirectories(); - Blacklist::addDirectory(\dirname((new \ReflectionClass(\Mockery::class))->getFileName())); + (new Blacklist())->getBlacklistedDirectories(); + Blacklist::addDirectory(dirname((new ReflectionClass(Mockery::class))->getFileName())); } else { - Blacklist::$blacklistedClassNames[\Mockery::class] = 1; + Blacklist::$blacklistedClassNames[Mockery::class] = 1; } } } diff --git a/api/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php b/api/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php index 35ca16dbe7..fae88712b0 100644 --- a/api/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php +++ b/api/vendor/mockery/mockery/library/Mockery/ClosureWrapper.php @@ -1,27 +1,18 @@ closure = $closure; } + /** + * @return mixed + */ public function __invoke() { - return call_user_func_array($this->closure, func_get_args()); + return ($this->closure)(...func_get_args()); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php b/api/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php index 52314322c5..fa03c39962 100644 --- a/api/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php +++ b/api/vendor/mockery/mockery/library/Mockery/CompositeExpectation.php @@ -1,38 +1,64 @@ */ - protected $_expectations = array(); + protected $_expectations = []; + + /** + * Intercept any expectation calls and direct against all expectations + * + * @param string $method + * + * @return self + */ + public function __call($method, array $args) + { + foreach ($this->_expectations as $expectation) { + $expectation->{$method}(...$args); + } + + return $this; + } + + /** + * Return the string summary of this composite expectation + * + * @return string + */ + public function __toString() + { + $parts = array_map(static function (ExpectationInterface $expectation): string { + return (string) $expectation; + }, $this->_expectations); + + return '[' . implode(', ', $parts) . ']'; + } /** * Add an expectation to the composite * - * @param \Mockery\Expectation|\Mockery\CompositeExpectation $expectation + * @param ExpectationInterface|HigherOrderMessage $expectation + * * @return void */ public function add($expectation) @@ -52,26 +78,24 @@ public function andReturn(...$args) * Set a return value, or sequential queue of return values * * @param mixed ...$args + * * @return self */ public function andReturns(...$args) { - return call_user_func_array([$this, 'andReturn'], $args); + return $this->andReturn(...$args); } /** - * Intercept any expectation calls and direct against all expectations + * Return the parent mock of the first expectation * - * @param string $method - * @param array $args - * @return self + * @return LegacyMockInterface&MockInterface */ - public function __call($method, array $args) + public function getMock() { - foreach ($this->_expectations as $expectation) { - call_user_func_array(array($expectation, $method), $args); - } - return $this; + reset($this->_expectations); + $first = current($this->_expectations); + return $first->getMock(); } /** @@ -86,22 +110,10 @@ public function getOrderNumber() return $first->getOrderNumber(); } - /** - * Return the parent mock of the first expectation - * - * @return \Mockery\MockInterface|\Mockery\LegacyMockInterface - */ - public function getMock() - { - reset($this->_expectations); - $first = current($this->_expectations); - return $first->getMock(); - } - /** * Mockery API alias to getMock * - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface + * @return LegacyMockInterface&MockInterface */ public function mock() { @@ -109,46 +121,30 @@ public function mock() } /** - * Starts a new expectation addition on the first mock which is the primary - * target outside of a demeter chain + * Starts a new expectation addition on the first mock which is the primary target outside of a demeter chain * * @param mixed ...$args - * @return \Mockery\Expectation + * + * @return Expectation */ - public function shouldReceive(...$args) + public function shouldNotReceive(...$args) { reset($this->_expectations); $first = current($this->_expectations); - return call_user_func_array(array($first->getMock(), 'shouldReceive'), $args); + return $first->getMock()->shouldNotReceive(...$args); } /** - * Starts a new expectation addition on the first mock which is the primary - * target outside of a demeter chain + * Starts a new expectation addition on the first mock which is the primary target, outside of a demeter chain * * @param mixed ...$args - * @return \Mockery\Expectation + * + * @return Expectation */ - public function shouldNotReceive(...$args) + public function shouldReceive(...$args) { reset($this->_expectations); $first = current($this->_expectations); - return call_user_func_array(array($first->getMock(), 'shouldNotReceive'), $args); - } - - /** - * Return the string summary of this composite expectation - * - * @return string - */ - public function __toString() - { - $return = '['; - $parts = array(); - foreach ($this->_expectations as $exp) { - $parts[] = (string) $exp; - } - $return .= implode(', ', $parts) . ']'; - return $return; + return $first->getMock()->shouldReceive(...$args); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Configuration.php b/api/vendor/mockery/mockery/library/Mockery/Configuration.php index bce05f3c5c..d415d9e0c7 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Configuration.php +++ b/api/vendor/mockery/mockery/library/Mockery/Configuration.php @@ -1,27 +1,46 @@ ['MY_CONST' => 123, 'OTHER_CONST' => 'foo']] + * + * @var array|scalar>> */ - protected $_allowMockingMethodsUnnecessarily = true; + protected $_constantsMap = []; /** - * @var QuickDefinitionsConfiguration + * Default argument matchers + * + * e.g. ['class' => 'matcher'] + * + * @var array */ - protected $_quickDefinitionsConfiguration; + protected $_defaultMatchers = []; /** * Parameter map for use with PHP internal classes. * - * @var array + * e.g. ['class' => ['method' => ['param1', 'param2']]] + * + * @var array>> */ - protected $_internalClassParamMap = array(); + protected $_internalClassParamMap = []; - protected $_constantsMap = array(); + /** + * Custom object formatters + * + * e.g. ['class' => static fn($object) => 'formatted'] + * + * @var array + */ + protected $_objectFormatters = []; + + /** + * @var QuickDefinitionsConfiguration + */ + protected $_quickDefinitionsConfiguration; /** * Boolean assertion is reflection caching enabled or not. It should be @@ -68,23 +104,30 @@ public function __construct() } /** - * Custom object formatters + * Set boolean to allow/prevent unnecessary mocking of methods * - * @var array - */ - protected $_objectFormatters = array(); - - /** - * Default argument matchers + * @param bool $flag * - * @var array + * @return void + * + * @deprecated since 1.4.0 */ - protected $_defaultMatchers = array(); + public function allowMockingMethodsUnnecessarily($flag = true) + { + @trigger_error( + sprintf('The %s method is deprecated and will be removed in a future version of Mockery', __METHOD__), + E_USER_DEPRECATED + ); + + $this->_allowMockingMethodsUnnecessarily = (bool) $flag; + } /** * Set boolean to allow/prevent mocking of non-existent methods * * @param bool $flag + * + * @return void */ public function allowMockingNonExistentMethods($flag = true) { @@ -92,96 +135,135 @@ public function allowMockingNonExistentMethods($flag = true) } /** - * Return flag indicating whether mocking non-existent methods allowed + * Disable reflection caching * - * @return bool + * It should be always enabled, except when using + * PHPUnit's --static-backup option. + * + * @see https://github.com/mockery/mockery/issues/268 + * + * @return void */ - public function mockingNonExistentMethodsAllowed() + public function disableReflectionCache() { - return $this->_allowMockingNonExistentMethod; + $this->_reflectionCacheEnabled = false; } /** - * Set boolean to allow/prevent unnecessary mocking of methods + * Enable reflection caching * - * @param bool $flag + * It should be always enabled, except when using + * PHPUnit's --static-backup option. * - * @deprecated since 1.4.0 + * @see https://github.com/mockery/mockery/issues/268 + * + * @return void */ - public function allowMockingMethodsUnnecessarily($flag = true) + public function enableReflectionCache() { - @trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED); - - $this->_allowMockingMethodsUnnecessarily = (bool) $flag; + $this->_reflectionCacheEnabled = true; } /** - * Return flag indicating whether mocking non-existent methods allowed + * Get the map of constants to be used in the mock generator * - * @return bool - * - * @deprecated since 1.4.0 + * @return array|scalar>> */ - public function mockingMethodsUnnecessarilyAllowed() + public function getConstantsMap() { - @trigger_error(sprintf("The %s method is deprecated and will be removed in a future version of Mockery", __METHOD__), E_USER_DEPRECATED); - - return $this->_allowMockingMethodsUnnecessarily; + return $this->_constantsMap; } /** - * Set a parameter map (array of param signature strings) for the method - * of an internal PHP class. + * Get the default matcher for a given class + * + * @param class-string $class * - * @param string $class - * @param string $method - * @param array $map + * @return null|class-string */ - public function setInternalClassMethodParamMap($class, $method, array $map) + public function getDefaultMatcher($class) { - if (\PHP_MAJOR_VERSION > 7) { - throw new \LogicException('Internal class parameter overriding is not available in PHP 8. Incompatible signatures have been reclassified as fatal errors.'); - } + $classes = []; + + $parentClass = $class; + + do { + $classes[] = $parentClass; + + $parentClass = get_parent_class($parentClass); + } while ($parentClass !== false); + + $classesAndInterfaces = array_merge($classes, class_implements($class)); - if (!isset($this->_internalClassParamMap[strtolower($class)])) { - $this->_internalClassParamMap[strtolower($class)] = array(); + foreach ($classesAndInterfaces as $type) { + if (array_key_exists($type, $this->_defaultMatchers)) { + return $this->_defaultMatchers[$type]; + } } - $this->_internalClassParamMap[strtolower($class)][strtolower($method)] = $map; - } - /** - * Remove all overridden parameter maps from internal PHP classes. - */ - public function resetInternalClassMethodParamMaps() - { - $this->_internalClassParamMap = array(); + return null; } /** * Get the parameter map of an internal PHP class method * - * @return array|null + * @param class-string $class + * @param string $method + * + * @return null|array */ public function getInternalClassMethodParamMap($class, $method) { - if (isset($this->_internalClassParamMap[strtolower($class)][strtolower($method)])) { - return $this->_internalClassParamMap[strtolower($class)][strtolower($method)]; + $class = strtolower($class); + $method = strtolower($method); + if (! array_key_exists($class, $this->_internalClassParamMap)) { + return null; } + + if (! array_key_exists($method, $this->_internalClassParamMap[$class])) { + return null; + } + + return $this->_internalClassParamMap[$class][$method]; } + /** + * Get the parameter maps of internal PHP classes + * + * @return array>> + */ public function getInternalClassMethodParamMaps() { return $this->_internalClassParamMap; } - public function setConstantsMap(array $map) + /** + * Get the object formatter for a class + * + * @param class-string $class + * @param Closure $defaultFormatter + * + * @return Closure + */ + public function getObjectFormatter($class, $defaultFormatter) { - $this->_constantsMap = $map; - } + $parentClass = $class; - public function getConstantsMap() - { - return $this->_constantsMap; + do { + $classes[] = $parentClass; + + $parentClass = get_parent_class($parentClass); + } while ($parentClass !== false); + + $classesAndInterfaces = array_merge($classes, class_implements($class)); + + foreach ($classesAndInterfaces as $type) { + if (array_key_exists($type, $this->_objectFormatters)) { + return $this->_objectFormatters[$type]; + } + } + + return $defaultFormatter; } /** @@ -193,91 +275,132 @@ public function getQuickDefinitions(): QuickDefinitionsConfiguration } /** - * Disable reflection caching + * Return flag indicating whether mocking non-existent methods allowed * - * It should be always enabled, except when using - * PHPUnit's --static-backup option. + * @return bool * - * @see https://github.com/mockery/mockery/issues/268 + * @deprecated since 1.4.0 */ - public function disableReflectionCache() + public function mockingMethodsUnnecessarilyAllowed() { - $this->_reflectionCacheEnabled = false; + @trigger_error( + sprintf('The %s method is deprecated and will be removed in a future version of Mockery', __METHOD__), + E_USER_DEPRECATED + ); + + return $this->_allowMockingMethodsUnnecessarily; } /** - * Enable reflection caching - * - * It should be always enabled, except when using - * PHPUnit's --static-backup option. + * Return flag indicating whether mocking non-existent methods allowed * - * @see https://github.com/mockery/mockery/issues/268 + * @return bool */ - public function enableReflectionCache() + public function mockingNonExistentMethodsAllowed() { - $this->_reflectionCacheEnabled = true; + return $this->_allowMockingNonExistentMethod; } /** * Is reflection cache enabled? + * + * @return bool */ public function reflectionCacheEnabled() { return $this->_reflectionCacheEnabled; } - public function setObjectFormatter($class, $formatterCallback) + /** + * Remove all overridden parameter maps from internal PHP classes. + * + * @return void + */ + public function resetInternalClassMethodParamMaps() { - $this->_objectFormatters[$class] = $formatterCallback; + $this->_internalClassParamMap = []; } - public function getObjectFormatter($class, $defaultFormatter) + /** + * Set a map of constants to be used in the mock generator + * + * e.g. ['MyClass' => ['MY_CONST' => 123, 'ARRAY_CONST' => ['foo', 'bar']]] + * + * @param array|scalar>> $map + * + * @return void + */ + public function setConstantsMap(array $map) { - $parentClass = $class; - do { - $classes[] = $parentClass; - $parentClass = get_parent_class($parentClass); - } while ($parentClass); - $classesAndInterfaces = array_merge($classes, class_implements($class)); - foreach ($classesAndInterfaces as $type) { - if (isset($this->_objectFormatters[$type])) { - return $this->_objectFormatters[$type]; - } - } - return $defaultFormatter; + $this->_constantsMap = $map; } /** - * @param string $class - * @param string $matcherClass + * @param class-string $class + * @param class-string $matcherClass + * + * @throws InvalidArgumentException + * + * @return void */ public function setDefaultMatcher($class, $matcherClass) { - if (!is_a($matcherClass, \Mockery\Matcher\MatcherAbstract::class, true) && - !is_a($matcherClass, \Hamcrest\Matcher::class, true) && - !is_a($matcherClass, \Hamcrest_Matcher::class, true) - ) { - throw new \InvalidArgumentException( - "Matcher class must be either Hamcrest matcher or extend \Mockery\Matcher\MatcherAbstract, " . - "'$matcherClass' given." - ); + $isHamcrest = is_a($matcherClass, Matcher::class, true) + || is_a($matcherClass, Hamcrest_Matcher::class, true); + + if ($isHamcrest) { + @trigger_error('Hamcrest package has been deprecated and will be removed in 2.0', E_USER_DEPRECATED); + } + + if (! $isHamcrest && ! is_a($matcherClass, MatcherInterface::class, true)) { + throw new InvalidArgumentException(sprintf( + "Matcher class must implement %s, '%s' given.", + MatcherInterface::class, + $matcherClass + )); } + $this->_defaultMatchers[$class] = $matcherClass; } - public function getDefaultMatcher($class) + /** + * Set a parameter map (array of param signature strings) for the method of an internal PHP class. + * + * @param class-string $class + * @param string $method + * @param list $map + * + * @throws LogicException + * + * @return void + */ + public function setInternalClassMethodParamMap($class, $method, array $map) { - $parentClass = $class; - do { - $classes[] = $parentClass; - $parentClass = get_parent_class($parentClass); - } while ($parentClass); - $classesAndInterfaces = array_merge($classes, class_implements($class)); - foreach ($classesAndInterfaces as $type) { - if (isset($this->_defaultMatchers[$type])) { - return $this->_defaultMatchers[$type]; - } + if (PHP_MAJOR_VERSION > 7) { + throw new LogicException( + 'Internal class parameter overriding is not available in PHP 8. Incompatible signatures have been reclassified as fatal errors.' + ); } - return null; + + $class = strtolower($class); + + if (! array_key_exists($class, $this->_internalClassParamMap)) { + $this->_internalClassParamMap[$class] = []; + } + + $this->_internalClassParamMap[$class][strtolower($method)] = $map; + } + + /** + * Set a custom object formatter for a class + * + * @param class-string $class + * @param Closure $formatterCallback + * + * @return void + */ + public function setObjectFormatter($class, $formatterCallback) + { + $this->_objectFormatters[$class] = $formatterCallback; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Container.php b/api/vendor/mockery/mockery/library/Mockery/Container.php index 196dc996ec..ddba888479 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Container.php +++ b/api/vendor/mockery/mockery/library/Mockery/Container.php @@ -1,39 +1,63 @@ */ - protected $_generator; + protected $_groups = []; /** * @var LoaderInterface @@ -67,14 +91,118 @@ class Container protected $_loader; /** - * @var array + * Store of mock objects + * + * @var array|array-key,LegacyMockInterface&MockInterface&TMockObject> + */ + protected $_mocks = []; + + /** + * @var array + */ + protected $_namedMocks = []; + + /** + * @var Instantiator */ - protected $_namedMocks = array(); + protected $instantiator; - public function __construct(Generator $generator = null, LoaderInterface $loader = null) + public function __construct(?Generator $generator = null, ?LoaderInterface $loader = null, ?Instantiator $instantiator = null) { - $this->_generator = $generator ?: \Mockery::getDefaultGenerator(); - $this->_loader = $loader ?: \Mockery::getDefaultLoader(); + $this->_generator = $generator instanceof Generator ? $generator : Mockery::getDefaultGenerator(); + $this->_loader = $loader instanceof LoaderInterface ? $loader : Mockery::getDefaultLoader(); + $this->instantiator = $instantiator instanceof Instantiator ? $instantiator : new Instantiator(); + } + + /** + * Return a specific remembered mock according to the array index it + * was stored to in this container instance + * + * @template TMock of object + * + * @param class-string $reference + * + * @return null|(LegacyMockInterface&MockInterface&TMock) + */ + public function fetchMock($reference) + { + return $this->_mocks[$reference] ?? null; + } + + /** + * @return Generator + */ + public function getGenerator() + { + return $this->_generator; + } + + /** + * @param string $method + * @param string $parent + * + * @return null|string + */ + public function getKeyOfDemeterMockFor($method, $parent) + { + $keys = array_keys($this->_mocks); + + $match = preg_grep('/__demeter_' . md5($parent) . sprintf('_%s$/', $method), $keys); + if ($match === false) { + return null; + } + + if ($match === []) { + return null; + } + + return array_values($match)[0]; + } + + /** + * @return LoaderInterface + */ + public function getLoader() + { + return $this->_loader; + } + + /** + * @template TMock of object + * @return array|array-key,LegacyMockInterface&MockInterface&TMockObject> + */ + public function getMocks() + { + return $this->_mocks; + } + + /** + * @return void + */ + public function instanceMock() + { + } + + /** + * see http://php.net/manual/en/language.oop5.basic.php + * + * @param string $className + * + * @return bool + */ + public function isValidClassName($className) + { + if ($className[0] === '\\') { + $className = substr($className, 1); // remove the first backslash + } + + // all the namespaces and class name should match the regex + return array_filter( + explode('\\', $className), + static function ($name): bool { + return ! preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name); + } + ) === []; } /** @@ -85,119 +213,179 @@ public function __construct(Generator $generator = null, LoaderInterface $loader * names or partials - just so long as it's something that can be mocked. * I'll refactor it one day so it's easier to follow. * - * @param array ...$args + * @template TMock of object + * + * @param array|TMock|Closure(LegacyMockInterface&MockInterface&TMock):LegacyMockInterface&MockInterface&TMock|array> $args + * + * @throws ReflectionException|RuntimeException * - * @return Mock - * @throws Exception\RuntimeException + * @return LegacyMockInterface&MockInterface&TMock */ public function mock(...$args) { + /** @var null|MockConfigurationBuilder $builder */ + $builder = null; + /** @var null|callable $expectationClosure */ $expectationClosure = null; - $quickdefs = array(); + $partialMethods = null; + $quickDefinitions = []; $constructorArgs = null; - $blocks = array(); - $class = null; + $blocks = []; if (count($args) > 1) { - $finalArg = end($args); - reset($args); + $finalArg = array_pop($args); + if (is_callable($finalArg) && is_object($finalArg)) { - $expectationClosure = array_pop($args); + $expectationClosure = $finalArg; + } else { + $args[] = $finalArg; } } - $builder = new MockConfigurationBuilder(); - foreach ($args as $k => $arg) { if ($arg instanceof MockConfigurationBuilder) { $builder = $arg; + unset($args[$k]); } } + reset($args); - $builder->setParameterOverrides(\Mockery::getConfiguration()->getInternalClassMethodParamMaps()); - $builder->setConstantsMap(\Mockery::getConfiguration()->getConstantsMap()); + $builder = $builder ?? new MockConfigurationBuilder(); + $mockeryConfiguration = Mockery::getConfiguration(); + $builder->setParameterOverrides($mockeryConfiguration->getInternalClassMethodParamMaps()); + $builder->setConstantsMap($mockeryConfiguration->getConstantsMap()); - while (count($args) > 0) { + while ($args !== []) { $arg = array_shift($args); + // check for multiple interfaces if (is_string($arg)) { foreach (explode('|', $arg) as $type) { if ($arg === 'null') { // skip PHP 8 'null's - } elseif (strpos($type, ',') && !strpos($type, ']')) { + continue; + } + + if (strpos($type, ',') && !strpos($type, ']')) { $interfaces = explode(',', str_replace(' ', '', $type)); + $builder->addTargets($interfaces); - } elseif (substr($type, 0, 6) == 'alias:') { + + continue; + } + + if (strpos($type, 'alias:') === 0) { $type = str_replace('alias:', '', $type); + $builder->addTarget('stdClass'); $builder->setName($type); - } elseif (substr($type, 0, 9) == 'overload:') { + + continue; + } + + if (strpos($type, 'overload:') === 0) { $type = str_replace('overload:', '', $type); + $builder->setInstanceMock(true); $builder->addTarget('stdClass'); $builder->setName($type); - } elseif (substr($type, strlen($type)-1, 1) == ']') { + + continue; + } + + if ($type[strlen($type) - 1] === ']') { $parts = explode('[', $type); - if (!class_exists($parts[0], true) && !interface_exists($parts[0], true)) { - throw new \Mockery\Exception('Can only create a partial mock from' - . ' an existing class or interface'); - } + $class = $parts[0]; - $parts[1] = str_replace(' ', '', $parts[1]); - $partialMethods = array_filter(explode(',', strtolower(rtrim($parts[1], ']')))); + + if (! class_exists($class, true) && ! interface_exists($class, true)) { + throw new Exception('Can only create a partial mock from an existing class or interface'); + } + $builder->addTarget($class); + + $partialMethods = array_filter( + explode(',', strtolower(rtrim(str_replace(' ', '', $parts[1]), ']'))) + ); + foreach ($partialMethods as $partialMethod) { if ($partialMethod[0] === '!') { $builder->addBlackListedMethod(substr($partialMethod, 1)); + continue; } + $builder->addWhiteListedMethod($partialMethod); } - } elseif (class_exists($type, true) || interface_exists($type, true) || trait_exists($type, true)) { - $builder->addTarget($type); - } elseif (!\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() && (!class_exists($type, true) && !interface_exists($type, true))) { - throw new \Mockery\Exception("Mockery can't find '$type' so can't mock it"); - } else { - if (!$this->isValidClassName($type)) { - throw new \Mockery\Exception('Class name contains invalid characters'); - } + + continue; + } + + if (class_exists($type, true) || interface_exists($type, true) || trait_exists($type, true)) { $builder->addTarget($type); + + continue; } - break; // unions are "sum" types and not "intersections", and so we must only process the first part + + if (! $mockeryConfiguration->mockingNonExistentMethodsAllowed()) { + throw new Exception(sprintf("Mockery can't find '%s' so can't mock it", $type)); + } + + if (! $this->isValidClassName($type)) { + throw new Exception('Class name contains invalid characters'); + } + + $builder->addTarget($type); + + // unions are "sum" types and not "intersections", and so we must only process the first part + break; } - } elseif (is_object($arg)) { + + continue; + } + + if (is_object($arg)) { $builder->addTarget($arg); - } elseif (is_array($arg)) { - if (!empty($arg) && array_keys($arg) !== range(0, count($arg) - 1)) { + + continue; + } + + if (is_array($arg)) { + if ([] !== $arg && array_keys($arg) !== range(0, count($arg) - 1)) { // if associative array if (array_key_exists(self::BLOCKS, $arg)) { $blocks = $arg[self::BLOCKS]; } + unset($arg[self::BLOCKS]); - $quickdefs = $arg; - } else { - $constructorArgs = $arg; + + $quickDefinitions = $arg; + + continue; } - } else { - throw new \Mockery\Exception( - 'Unable to parse arguments sent to ' - . get_class($this) . '::mock()' - ); + + $constructorArgs = $arg; + + continue; } + + throw new Exception(sprintf( + 'Unable to parse arguments sent to %s::mock()', get_class($this) + )); } $builder->addBlackListedMethods($blocks); - if (!is_null($constructorArgs)) { - $builder->addBlackListedMethod("__construct"); // we need to pass through + if ($constructorArgs !== null) { + $builder->addBlackListedMethod('__construct'); // we need to pass through } else { $builder->setMockOriginalDestructor(true); } - if (!empty($partialMethods) && $constructorArgs === null) { - $constructorArgs = array(); + if ($partialMethods !== null && $constructorArgs === null) { + $constructorArgs = []; } $config = $builder->getMockConfiguration(); @@ -206,145 +394,114 @@ public function mock(...$args) $def = $this->getGenerator()->generate($config); - if (class_exists($def->getClassName(), $attemptAutoload = false)) { - $rfc = new \ReflectionClass($def->getClassName()); - if (!$rfc->implementsInterface("Mockery\LegacyMockInterface")) { - throw new \Mockery\Exception\RuntimeException("Could not load mock {$def->getClassName()}, class already exists"); + $className = $def->getClassName(); + if (class_exists($className, $attemptAutoload = false)) { + $rfc = new ReflectionClass($className); + if (! $rfc->implementsInterface(LegacyMockInterface::class)) { + throw new RuntimeException(sprintf('Could not load mock %s, class already exists', $className)); } } $this->getLoader()->load($def); - $mock = $this->_getInstance($def->getClassName(), $constructorArgs); + $mock = $this->_getInstance($className, $constructorArgs); $mock->mockery_init($this, $config->getTargetObject(), $config->isInstanceMock()); - if (!empty($quickdefs)) { - if (\Mockery::getConfiguration()->getQuickDefinitions()->shouldBeCalledAtLeastOnce()) { - $mock->shouldReceive($quickdefs)->atLeast()->once(); + if ($quickDefinitions !== []) { + if ($mockeryConfiguration->getQuickDefinitions()->shouldBeCalledAtLeastOnce()) { + $mock->shouldReceive($quickDefinitions)->atLeast()->once(); } else { - $mock->shouldReceive($quickdefs)->byDefault(); + $mock->shouldReceive($quickDefinitions)->byDefault(); } } - if (!empty($expectationClosure)) { + + // if the last parameter passed to mock() is a closure, + if ($expectationClosure instanceof Closure) { + // call the closure with the mock object $expectationClosure($mock); } - $this->rememberMock($mock); - return $mock; - } - - public function instanceMock() - { - } - public function getLoader() - { - return $this->_loader; - } - - public function getGenerator() - { - return $this->_generator; - } - - /** - * @param string $method - * @param string $parent - * @return string|null - */ - public function getKeyOfDemeterMockFor($method, $parent) - { - $keys = array_keys($this->_mocks); - $match = preg_grep("/__demeter_" . md5($parent) . "_{$method}$/", $keys); - if (count($match) == 1) { - $res = array_values($match); - if (count($res) > 0) { - return $res[0]; - } - } - return null; + return $this->rememberMock($mock); } /** - * @return array + * Fetch the next available allocation order number + * + * @return int */ - public function getMocks() + public function mockery_allocateOrder() { - return $this->_mocks; + return ++$this->_allocatedOrder; } /** - * Tear down tasks for this container + * Reset the container to its original state * - * @throws \Exception * @return void */ - public function mockery_teardown() + public function mockery_close() { - try { - $this->mockery_verify(); - } catch (\Exception $e) { - $this->mockery_close(); - throw $e; + foreach ($this->_mocks as $mock) { + $mock->mockery_teardown(); } + + $this->_mocks = []; } /** - * Verify the container mocks + * Get current ordered number * - * @return void + * @return int */ - public function mockery_verify() + public function mockery_getCurrentOrder() { - foreach ($this->_mocks as $mock) { - $mock->mockery_verify(); - } + return $this->_currentOrder; } /** - * Retrieves all exceptions thrown by mocks + * Gets the count of expectations on the mocks * - * @return array + * @return int */ - public function mockery_thrownExceptions() + public function mockery_getExpectationCount() { - $e = []; - + $count = 0; foreach ($this->_mocks as $mock) { - $e = array_merge($e, $mock->mockery_thrownExceptions()); + $count += $mock->mockery_getExpectationCount(); } - return $e; + return $count; } /** - * Reset the container to its original state + * Fetch array of ordered groups * - * @return void + * @return array */ - public function mockery_close() + public function mockery_getGroups() { - foreach ($this->_mocks as $mock) { - $mock->mockery_teardown(); - } - $this->_mocks = array(); + return $this->_groups; } /** - * Fetch the next available allocation order number + * Set current ordered number * - * @return int + * @param int $order + * + * @return int The current order number that was set */ - public function mockery_allocateOrder() + public function mockery_setCurrentOrder($order) { - $this->_allocatedOrder += 1; - return $this->_allocatedOrder; + return $this->_currentOrder = $order; } /** * Set ordering for a group * - * @param mixed $group - * @param int $order + * @param string $group + * @param int $order + * + * @return void */ public function mockery_setGroup($group, $order) { @@ -352,102 +509,111 @@ public function mockery_setGroup($group, $order) } /** - * Fetch array of ordered groups + * Tear down tasks for this container * - * @return array + * @throws PHPException */ - public function mockery_getGroups() + public function mockery_teardown() { - return $this->_groups; - } + try { + $this->mockery_verify(); + } catch (PHPException $phpException) { + $this->mockery_close(); - /** - * Set current ordered number - * - * @param int $order - * @return int The current order number that was set - */ - public function mockery_setCurrentOrder($order) - { - $this->_currentOrder = $order; - return $this->_currentOrder; + throw $phpException; + } } /** - * Get current ordered number + * Retrieves all exceptions thrown by mocks * - * @return int + * @return array */ - public function mockery_getCurrentOrder() + public function mockery_thrownExceptions() { - return $this->_currentOrder; + /** @var array $exceptions */ + $exceptions = []; + + foreach ($this->_mocks as $mock) { + foreach ($mock->mockery_thrownExceptions() as $exception) { + $exceptions[] = $exception; + } + } + + return $exceptions; } /** * Validate the current mock's ordering * * @param string $method - * @param int $order - * @throws \Mockery\Exception - * @return void + * @param int $order + * + * @throws Exception */ - public function mockery_validateOrder($method, $order, \Mockery\LegacyMockInterface $mock) + public function mockery_validateOrder($method, $order, LegacyMockInterface $mock) { if ($order < $this->_currentOrder) { - $exception = new \Mockery\Exception\InvalidOrderException( - 'Method ' . $method . ' called out of order: expected order ' - . $order . ', was ' . $this->_currentOrder + $exception = new InvalidOrderException( + sprintf( + 'Method %s called out of order: expected order %d, was %d', + $method, + $order, + $this->_currentOrder + ) ); + $exception->setMock($mock) ->setMethodName($method) ->setExpectedOrder($order) ->setActualOrder($this->_currentOrder); + throw $exception; } + $this->mockery_setCurrentOrder($order); } /** - * Gets the count of expectations on the mocks - * - * @return int + * Verify the container mocks */ - public function mockery_getExpectationCount() + public function mockery_verify() { - $count = 0; foreach ($this->_mocks as $mock) { - $count += $mock->mockery_getExpectationCount(); + $mock->mockery_verify(); } - return $count; } /** * Store a mock and set its container reference * - * @param \Mockery\Mock $mock - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface + * @template TRememberMock of object + * + * @param LegacyMockInterface&MockInterface&TRememberMock $mock + * + * @return LegacyMockInterface&MockInterface&TRememberMock */ - public function rememberMock(\Mockery\LegacyMockInterface $mock) + public function rememberMock(LegacyMockInterface $mock) { - if (!isset($this->_mocks[get_class($mock)])) { - $this->_mocks[get_class($mock)] = $mock; - } else { - /** - * This condition triggers for an instance mock where origin mock - * is already remembered - */ - $this->_mocks[] = $mock; + $class = get_class($mock); + + if (! array_key_exists($class, $this->_mocks)) { + return $this->_mocks[$class] = $mock; } - return $mock; + + /** + * This condition triggers for an instance mock where origin mock + * is already remembered + */ + return $this->_mocks[] = $mock; } /** - * Retrieve the last remembered mock object, which is the same as saying - * retrieve the current mock being programmed where you have yet to call - * mock() to change it - thus why the method name is "self" since it will be - * be used during the programming of the same mock. + * Retrieve the last remembered mock object, + * which is the same as saying retrieve the current mock being programmed where you have yet to call mock() + * to change it thus why the method name is "self" since it will be used during the programming of the same mock. * - * @return \Mockery\Mock + * @return LegacyMockInterface|MockInterface */ public function self() { @@ -457,35 +623,32 @@ public function self() } /** - * Return a specific remembered mock according to the array index it - * was stored to in this container instance + * @template TMock of object + * @template TMixed + * + * @param class-string $mockName + * @param null|array $constructorArgs * - * @return \Mockery\Mock + * @return TMock */ - public function fetchMock($reference) - { - if (isset($this->_mocks[$reference])) { - return $this->_mocks[$reference]; - } - } - protected function _getInstance($mockName, $constructorArgs = null) { if ($constructorArgs !== null) { - $r = new \ReflectionClass($mockName); - return $r->newInstanceArgs($constructorArgs); + return (new ReflectionClass($mockName))->newInstanceArgs($constructorArgs); } try { - $instantiator = new Instantiator(); - $instance = $instantiator->instantiate($mockName); - } catch (\Exception $ex) { + $instance = $this->instantiator->instantiate($mockName); + } catch (PHPException $phpException) { + /** @var class-string $internalMockName */ $internalMockName = $mockName . '_Internal'; - if (!class_exists($internalMockName)) { - eval("class $internalMockName extends $mockName {" . - 'public function __construct() {}' . - '}'); + if (! class_exists($internalMockName)) { + eval(sprintf( + 'class %s extends %s { public function __construct() {} }', + $internalMockName, + $mockName + )); } $instance = new $internalMockName(); @@ -498,38 +661,18 @@ protected function checkForNamedMockClashes($config) { $name = $config->getName(); - if (!$name) { + if ($name === null) { return; } $hash = $config->getHash(); - if (isset($this->_namedMocks[$name])) { - if ($hash !== $this->_namedMocks[$name]) { - throw new \Mockery\Exception( - "The mock named '$name' has been already defined with a different mock configuration" - ); - } + if (array_key_exists($name, $this->_namedMocks) && $hash !== $this->_namedMocks[$name]) { + throw new Exception( + sprintf("The mock named '%s' has been already defined with a different mock configuration", $name) + ); } $this->_namedMocks[$name] = $hash; } - - /** - * see http://php.net/manual/en/language.oop5.basic.php - * @param string $className - * @return bool - */ - public function isValidClassName($className) - { - $pos = strpos($className, '\\'); - if ($pos === 0) { - $className = substr($className, 1); // remove the first backslash - } - // all the namespaces and class name should match the regex - $invalidNames = array_filter(explode('\\', $className), function ($name) { - return !preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $name); - }); - return empty($invalidNames); - } } diff --git a/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php b/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php index f6ac130e6d..f250d755aa 100644 --- a/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php +++ b/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtLeast.php @@ -1,26 +1,18 @@ _limit > $n) { - $exception = new Mockery\Exception\InvalidCountException( + $exception = new InvalidCountException( 'Method ' . (string) $this->_expectation . ' from ' . $this->_expectation->getMock()->mockery_getName() . ' should be called' . PHP_EOL . ' at least ' . $this->_limit . ' times but called ' . $n . ' times.' ); + $exception->setMock($this->_expectation->getMock()) ->setMethodName((string) $this->_expectation) ->setExpectedCountComparative('>=') diff --git a/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php b/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php index 4d23e28d20..11bbe37cf2 100644 --- a/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php +++ b/api/vendor/mockery/mockery/library/Mockery/CountValidator/AtMost.php @@ -1,26 +1,18 @@ _limit < $n) { - $exception = new Mockery\Exception\InvalidCountException( + $exception = new InvalidCountException( 'Method ' . (string) $this->_expectation . ' from ' . $this->_expectation->getMock()->mockery_getName() . ' should be called' . PHP_EOL diff --git a/api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php b/api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php index ae3b0bfefe..3ecfde3a5d 100644 --- a/api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php +++ b/api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorAbstract.php @@ -1,31 +1,23 @@ _expectation = $expectation; $this->_limit = $limit; @@ -52,17 +43,19 @@ public function __construct(\Mockery\Expectation $expectation, $limit) * Checks if the validator can accept an additional nth call * * @param int $n + * * @return bool */ public function isEligible($n) { - return ($n < $this->_limit); + return $n < $this->_limit; } /** * Validate the call count against this validator * * @param int $n + * * @return bool */ abstract public function validate($n); diff --git a/api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorInterface.php b/api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorInterface.php new file mode 100644 index 0000000000..1cbf4cc314 --- /dev/null +++ b/api/vendor/mockery/mockery/library/Mockery/CountValidator/CountValidatorInterface.php @@ -0,0 +1,24 @@ +_limit !== $n) { $because = $this->_expectation->getExceptionMessage(); - $exception = new Mockery\Exception\InvalidCountException( + $exception = new InvalidCountException( 'Method ' . (string) $this->_expectation . ' from ' . $this->_expectation->getMock()->mockery_getName() . ' should be called' . PHP_EOL diff --git a/api/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php b/api/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php index b43aad3ec4..b1c20cd4b6 100644 --- a/api/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php +++ b/api/vendor/mockery/mockery/library/Mockery/CountValidator/Exception.php @@ -1,25 +1,18 @@ dismissed = true; - // we sometimes stack them - if ($this->getPrevious() && $this->getPrevious() instanceof BadMethodCallException) { - $this->getPrevious()->dismiss(); + $previous = $this->getPrevious(); + if (! $previous instanceof self) { + return; } + + $previous->dismiss(); } + /** + * @return bool + */ public function dismissed() { return $this->dismissed; diff --git a/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php b/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php index ccf5c76f9d..d76e275e26 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php +++ b/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidArgumentException.php @@ -1,25 +1,15 @@ mockObject = $mock; - return $this; + return $this->actual; } - public function setMethodName($name) + /** + * @return int + */ + public function getExpectedCount() { - $this->method = $name; - return $this; + return $this->expected; } - public function setActualCount($count) + /** + * @return string + */ + public function getExpectedCountComparative() { - $this->actual = $count; - return $this; + return $this->expectedComparative; } - public function setExpectedCount($count) + /** + * @return string|null + */ + public function getMethodName() { - $this->expected = $count; - return $this; + return $this->method; } - public function setExpectedCountComparative($comp) + /** + * @return LegacyMockInterface|null + */ + public function getMock() { - if (!in_array($comp, array('=', '>', '<', '>=', '<='))) { - throw new RuntimeException( - 'Illegal comparative for expected call counts set: ' . $comp - ); - } - $this->expectedComparative = $comp; - return $this; + return $this->mockObject; } - public function getMock() + /** + * @throws RuntimeException + * @return string|null + */ + public function getMockName() { - return $this->mockObject; + $mock = $this->getMock(); + + if ($mock === null) { + return ''; + } + + return $mock->mockery_getName(); } - public function getMethodName() + /** + * @param int $count + * @return self + */ + public function setActualCount($count) { - return $this->method; + $this->actual = $count; + return $this; } - public function getActualCount() + /** + * @param int $count + * @return self + */ + public function setExpectedCount($count) { - return $this->actual; + $this->expected = $count; + return $this; } - public function getExpectedCount() + /** + * @param string $comp + * @return self + */ + public function setExpectedCountComparative($comp) { - return $this->expected; + if (! in_array($comp, ['=', '>', '<', '>=', '<='], true)) { + throw new RuntimeException('Illegal comparative for expected call counts set: ' . $comp); + } + + $this->expectedComparative = $comp; + return $this; } - public function getMockName() + /** + * @param string $name + * @return self + */ + public function setMethodName($name) { - return $this->getMock()->mockery_getName(); + $this->method = $name; + return $this; } - public function getExpectedCountComparative() + /** + * @return self + */ + public function setMock(LegacyMockInterface $mock) { - return $this->expectedComparative; + $this->mockObject = $mock; + return $this; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php b/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php index 50b8049e2d..cf5bb70d2b 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php +++ b/api/vendor/mockery/mockery/library/Mockery/Exception/InvalidOrderException.php @@ -1,83 +1,125 @@ mockObject = $mock; - return $this; + return $this->actual; } - public function setMethodName($name) + /** + * @return int + */ + public function getExpectedOrder() { - $this->method = $name; - return $this; + return $this->expected; } - public function setActualOrder($count) + /** + * @return string|null + */ + public function getMethodName() { - $this->actual = $count; - return $this; + return $this->method; } - public function setExpectedOrder($count) + /** + * @return LegacyMockInterface|null + */ + public function getMock() { - $this->expected = $count; - return $this; + return $this->mockObject; } - public function getMock() + /** + * @return string|null + */ + public function getMockName() { - return $this->mockObject; + $mock = $this->getMock(); + + if ($mock === null) { + return $mock; + } + + return $mock->mockery_getName(); } - public function getMethodName() + /** + * @param int $count + * + * @return self + */ + public function setActualOrder($count) { - return $this->method; + $this->actual = $count; + return $this; } - public function getActualOrder() + /** + * @param int $count + * + * @return self + */ + public function setExpectedOrder($count) { - return $this->actual; + $this->expected = $count; + return $this; } - public function getExpectedOrder() + /** + * @param string $name + * + * @return self + */ + public function setMethodName($name) { - return $this->expected; + $this->method = $name; + return $this; } - public function getMockName() + /** + * @return self + */ + public function setMock(LegacyMockInterface $mock) { - return $this->getMock()->mockery_getName(); + $this->mockObject = $mock; + return $this; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Exception/MockeryExceptionInterface.php b/api/vendor/mockery/mockery/library/Mockery/Exception/MockeryExceptionInterface.php new file mode 100644 index 0000000000..5ce07eee0d --- /dev/null +++ b/api/vendor/mockery/mockery/library/Mockery/Exception/MockeryExceptionInterface.php @@ -0,0 +1,19 @@ + + */ + protected $actual = []; - protected $actual = array(); + /** + * @var string|null + */ + protected $method = null; + /** + * @var LegacyMockInterface|null + */ protected $mockObject = null; - public function setMock(Mockery\LegacyMockInterface $mock) + /** + * @return array + */ + public function getActualArguments() { - $this->mockObject = $mock; - return $this; + return $this->actual; } - public function setMethodName($name) + /** + * @return string|null + */ + public function getMethodName() { - $this->method = $name; - return $this; + return $this->method; } - public function setActualArguments($count) + /** + * @return LegacyMockInterface|null + */ + public function getMock() { - $this->actual = $count; - return $this; + return $this->mockObject; } - public function getMock() + /** + * @return string|null + */ + public function getMockName() { - return $this->mockObject; + $mock = $this->getMock(); + + if ($mock === null) { + return $mock; + } + + return $mock->mockery_getName(); } - public function getMethodName() + /** + * @todo Rename param `count` to `args` + * @template TMixed + * + * @param array $count + * @return self + */ + public function setActualArguments($count) { - return $this->method; + $this->actual = $count; + return $this; } - public function getActualArguments() + /** + * @param string $name + * @return self + */ + public function setMethodName($name) { - return $this->actual; + $this->method = $name; + return $this; } - public function getMockName() + /** + * @return self + */ + public function setMock(LegacyMockInterface $mock) { - return $this->getMock()->mockery_getName(); + $this->mockObject = $mock; + return $this; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php b/api/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php index 4b2f53c220..5d4f643d7e 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php +++ b/api/vendor/mockery/mockery/library/Mockery/Exception/RuntimeException.php @@ -1,25 +1,17 @@ _mock = $mock; $this->_name = $name; $this->withAnyArgs(); } + /** + * Cloning logic + */ + public function __clone() + { + $newValidators = []; + + $countValidators = $this->_countValidators; + + foreach ($countValidators as $validator) { + $newValidators[] = clone $validator; + } + + $this->_countValidators = $newValidators; + } + /** * Return a string with the method name and arguments formatted * - * @param string $name Name of the expected method - * @param array $args List of arguments to the method * @return string */ public function __toString() { - return \Mockery::formatArgs($this->_name, $this->_expectedArgs); + return Mockery::formatArgs($this->_name, $this->_expectedArgs); } /** - * Verify the current call, i.e. that the given arguments match those - * of this expectation + * Set a return value, or sequential queue of return values * - * @param array $args - * @return mixed + * @param mixed ...$args + * + * @return self */ - public function verifyCall(array $args) + public function andReturn(...$args) { - $this->validateOrder(); - $this->_actualCount++; - if (true === $this->_passthru) { - return $this->_mock->mockery_callSubjectMethod($this->_name, $args); - } - - $return = $this->_getReturnValue($args); - $this->throwAsNecessary($return); - $this->_setValues(); + $this->_returnQueue = $args; - return $return; + return $this; } /** - * Throws an exception if the expectation has been configured to do so + * Sets up a closure to return the nth argument from the expected method call * - * @throws \Throwable - * @return void + * @param int $index + * + * @return self */ - private function throwAsNecessary($return) + public function andReturnArg($index) { - if (!$this->_throw) { - return; + if (! is_int($index) || $index < 0) { + throw new InvalidArgumentException( + 'Invalid argument index supplied. Index must be a non-negative integer.' + ); } - if ($return instanceof \Throwable) { - throw $return; - } + $closure = static function (...$args) use ($index) { + if (array_key_exists($index, $args)) { + return $args[$index]; + } + + throw new OutOfBoundsException( + 'Cannot return an argument value. No argument exists for the index ' . $index + ); + }; + + $this->_closureQueue = [$closure]; - return; + return $this; } /** - * Sets public properties with queued values to the mock object - * - * @param array $args - * @return mixed + * @return self */ - protected function _setValues() + public function andReturnFalse() { - $mockClass = get_class($this->_mock); - $container = $this->_mock->mockery_getContainer(); - /** @var Mock[] $mocks */ - $mocks = $container->getMocks(); - foreach ($this->_setQueue as $name => &$values) { - if (count($values) > 0) { - $value = array_shift($values); - $this->_mock->{$name} = $value; - foreach ($mocks as $mock) { - if (is_a($mock, $mockClass) && $mock->mockery_isInstance()) { - $mock->{$name} = $value; - } - } - } - } + return $this->andReturn(false); } /** - * Fetch the return value for the matching args + * Return null. This is merely a language construct for Mock describing. * - * @param array $args - * @return mixed + * @return self */ - protected function _getReturnValue(array $args) + public function andReturnNull() { - if (count($this->_closureQueue) > 1) { - return call_user_func_array(array_shift($this->_closureQueue), $args); - } elseif (count($this->_closureQueue) > 0) { - return call_user_func_array(current($this->_closureQueue), $args); - } elseif (count($this->_returnQueue) > 1) { - return array_shift($this->_returnQueue); - } elseif (count($this->_returnQueue) > 0) { - return current($this->_returnQueue); - } - - return $this->_mock->mockery_returnValueForMethod($this->_name); + return $this->andReturn(null); } /** - * Checks if this expectation is eligible for additional calls + * Set a return value, or sequential queue of return values * - * @return bool + * @param mixed ...$args + * + * @return self */ - public function isEligible() + public function andReturns(...$args) { - foreach ($this->_countValidators as $validator) { - if (!$validator->isEligible($this->_actualCount)) { - return false; - } - } - return true; + return $this->andReturn(...$args); } /** - * Check if there is a constraint on call count + * Return this mock, like a fluent interface * - * @return bool + * @return self */ - public function isCallCountConstrained() + public function andReturnSelf() { - return (count($this->_countValidators) > 0); + return $this->andReturn($this->_mock); } /** - * Verify call order - * - * @return void + * @return self */ - public function validateOrder() + public function andReturnTrue() { - if ($this->_orderNumber) { - $this->_mock->mockery_validateOrder((string) $this, $this->_orderNumber, $this->_mock); - } - if ($this->_globalOrderNumber) { - $this->_mock->mockery_getContainer() - ->mockery_validateOrder((string) $this, $this->_globalOrderNumber, $this->_mock); - } + return $this->andReturn(true); } /** - * Verify this expectation + * Return a self-returning black hole object. * - * @return void + * @return self */ - public function verify() + public function andReturnUndefined() { - foreach ($this->_countValidators as $validator) { - $validator->validate($this->_actualCount); - } + return $this->andReturn(new Undefined()); } /** - * Check if the registered expectation is an ArgumentListMatcher - * @return bool + * Set a closure or sequence of closures with which to generate return + * values. The arguments passed to the expected method are passed to the + * closures as parameters. + * + * @param callable ...$args + * + * @return self */ - private function isArgumentListMatcher() + public function andReturnUsing(...$args) { - return (count($this->_expectedArgs) === 1 && ($this->_expectedArgs[0] instanceof ArgumentListMatcher)); + $this->_closureQueue = $args; + + return $this; } - private function isAndAnyOtherArgumentsMatcher($expectedArg) + /** + * Set a sequential queue of return values with an array + * + * @return self + */ + public function andReturnValues(array $values) { - return $expectedArg instanceof AndAnyOtherArgs; + return $this->andReturn(...$values); } /** - * Check if passed arguments match an argument expectation + * Register values to be set to a public property each time this expectation occurs * - * @param array $args - * @return bool + * @param string $name + * @param array ...$values + * + * @return self */ - public function matchArgs(array $args) + public function andSet($name, ...$values) { - if ($this->isArgumentListMatcher()) { - return $this->_matchArg($this->_expectedArgs[0], $args); - } - $argCount = count($args); - if ($argCount !== count((array) $this->_expectedArgs)) { - $lastExpectedArgument = end($this->_expectedArgs); - reset($this->_expectedArgs); - - if ($this->isAndAnyOtherArgumentsMatcher($lastExpectedArgument)) { - $args = array_slice($args, 0, array_search($lastExpectedArgument, $this->_expectedArgs, true)); - return $this->_matchArgs($args); - } - - return false; - } + $this->_setQueue[$name] = $values; - return $this->_matchArgs($args); + return $this; } /** - * Check if the passed arguments match the expectations, one by one. + * Set Exception class and arguments to that class to be thrown * - * @param array $args - * @return bool + * @param string|Throwable $exception + * @param string $message + * @param int $code + * + * @return self */ - protected function _matchArgs($args) + public function andThrow($exception, $message = '', $code = 0, ?\Exception $previous = null) { - $argCount = count($args); - for ($i=0; $i<$argCount; $i++) { - $param =& $args[$i]; - if (!$this->_matchArg($this->_expectedArgs[$i], $param)) { - return false; - } + $this->_throw = true; + + if (is_object($exception)) { + return $this->andReturn($exception); } - return true; + + return $this->andReturn(new $exception($message, $code, $previous)); } /** - * Check if passed argument matches an argument expectation + * Set Exception classes to be thrown * - * @param mixed $expected - * @param mixed $actual - * @return bool + * @return self */ - protected function _matchArg($expected, &$actual) + public function andThrowExceptions(array $exceptions) { - if ($expected === $actual) { - return true; - } - if (!is_object($expected) && !is_object($actual) && $expected == $actual) { - return true; - } - if (is_string($expected) && is_object($actual)) { - $result = $actual instanceof $expected; - if ($result) { - return true; - } - } - if (is_object($expected)) { - $matcher = \Mockery::getConfiguration()->getDefaultMatcher(get_class($expected)); - if ($matcher !== null) { - $expected = new $matcher($expected); + $this->_throw = true; + + foreach ($exceptions as $exception) { + if (! is_object($exception)) { + throw new Exception('You must pass an array of exception objects to andThrowExceptions'); } } - if ($expected instanceof \Mockery\Matcher\MatcherAbstract) { - return $expected->match($actual); - } - if ($expected instanceof \Hamcrest\Matcher || $expected instanceof \Hamcrest_Matcher) { - return $expected->matches($actual); - } - return false; + + return $this->andReturnValues($exceptions); + } + + public function andThrows($exception, $message = '', $code = 0, ?\Exception $previous = null) + { + return $this->andThrow($exception, $message, $code, $previous); } /** - * Expected argument setter for the expectation + * Sets up a closure that will yield each of the provided args * * @param mixed ...$args * * @return self */ - public function with(...$args) + public function andYield(...$args) { - return $this->withArgs($args); + $closure = static function () use ($args) { + foreach ($args as $arg) { + yield $arg; + } + }; + + $this->_closureQueue = [$closure]; + + return $this; } /** - * Expected arguments for the expectation passed as an array + * Sets next count validator to the AtLeast instance * - * @param array $arguments * @return self */ - private function withArgsInArray(array $arguments) + public function atLeast() { - if (empty($arguments)) { - return $this->withNoArgs(); - } - $this->_expectedArgs = $arguments; + $this->_countValidatorClass = AtLeast::class; + return $this; } /** - * Expected arguments have to be matched by the given closure. + * Sets next count validator to the AtMost instance * - * @param Closure $closure * @return self */ - private function withArgsMatchedByClosure(Closure $closure) + public function atMost() { - $this->_expectedArgs = [new MultiArgumentClosure($closure)]; + $this->_countValidatorClass = AtMost::class; + return $this; } /** - * Expected arguments for the expectation passed as an array or a closure that matches each passed argument on - * each function call. + * Set the exception message * - * @param array|Closure $argsOrClosure - * @return self + * @param string $message + * + * @return $this */ - public function withArgs($argsOrClosure) + public function because($message) { - if (is_array($argsOrClosure)) { - $this->withArgsInArray($argsOrClosure); - } elseif ($argsOrClosure instanceof Closure) { - $this->withArgsMatchedByClosure($argsOrClosure); - } else { - throw new \InvalidArgumentException(sprintf('Call to %s with an invalid argument (%s), only array and ' . - 'closure are allowed', __METHOD__, $argsOrClosure)); - } + $this->_because = $message; + return $this; } /** - * Set with() as no arguments expected + * Shorthand for setting minimum and maximum constraints on call counts * - * @return self + * @param int $minimum + * @param int $maximum */ - public function withNoArgs() + public function between($minimum, $maximum) { - $this->_expectedArgs = [new NoArgs()]; - return $this; + return $this->atLeast()->times($minimum)->atMost()->times($maximum); } /** - * Set expectation that any arguments are acceptable + * Mark this expectation as being a default * * @return self */ - public function withAnyArgs() + public function byDefault() { - $this->_expectedArgs = [new AnyArgs()]; + $director = $this->_mock->mockery_getExpectationsFor($this->_name); + + if ($director instanceof ExpectationDirector) { + $director->makeExpectationDefault($this); + } + return $this; } /** - * Expected arguments should partially match the real arguments - * - * @param mixed ...$expectedArgs - * @return self + * @return null|string */ - public function withSomeOfArgs(...$expectedArgs) + public function getExceptionMessage() { - return $this->withArgs(function (...$args) use ($expectedArgs) { - foreach ($expectedArgs as $expectedArg) { - if (!in_array($expectedArg, $args, true)) { - return false; - } - } - return true; - }); + return $this->_because; } /** - * Set a return value, or sequential queue of return values + * Return the parent mock of the expectation * - * @param mixed ...$args - * @return self + * @return LegacyMockInterface|MockInterface */ - public function andReturn(...$args) + public function getMock() { - $this->_returnQueue = $args; - return $this; + return $this->_mock; } - /** - * Set a return value, or sequential queue of return values - * - * @param mixed ...$args - * @return self - */ - public function andReturns(...$args) + public function getName() { - return call_user_func_array([$this, 'andReturn'], $args); + return $this->_name; } /** - * Return this mock, like a fluent interface + * Return order number * - * @return self + * @return int */ - public function andReturnSelf() + public function getOrderNumber() { - return $this->andReturn($this->_mock); + return $this->_orderNumber; } /** - * Set a sequential queue of return values with an array + * Indicates call order should apply globally * - * @param array $values * @return self */ - public function andReturnValues(array $values) + public function globally() { - call_user_func_array(array($this, 'andReturn'), $values); + $this->_globally = true; + return $this; } /** - * Set a closure or sequence of closures with which to generate return - * values. The arguments passed to the expected method are passed to the - * closures as parameters. + * Check if there is a constraint on call count * - * @param callable ...$args - * @return self + * @return bool */ - public function andReturnUsing(...$args) + public function isCallCountConstrained() { - $this->_closureQueue = $args; - return $this; + return $this->_countValidators !== []; } /** - * Sets up a closure to return the nth argument from the expected method call + * Checks if this expectation is eligible for additional calls * - * @param int $index - * @return self + * @return bool */ - public function andReturnArg($index) + public function isEligible() { - if (!is_int($index) || $index < 0) { - throw new \InvalidArgumentException("Invalid argument index supplied. Index must be a non-negative integer."); - } - $closure = function (...$args) use ($index) { - if (array_key_exists($index, $args)) { - return $args[$index]; + foreach ($this->_countValidators as $validator) { + if (! $validator->isEligible($this->_actualCount)) { + return false; } - throw new \OutOfBoundsException("Cannot return an argument value. No argument exists for the index $index"); - }; + } - $this->_closureQueue = [$closure]; - return $this; + return true; } /** - * Return a self-returning black hole object. + * Check if passed arguments match an argument expectation * - * @return self + * @return bool */ - public function andReturnUndefined() + public function matchArgs(array $args) { - $this->andReturn(new \Mockery\Undefined()); - return $this; + if ($this->isArgumentListMatcher()) { + return $this->_matchArg($this->_expectedArgs[0], $args); + } + + $argCount = count($args); + + $expectedArgsCount = count($this->_expectedArgs); + + if ($argCount === $expectedArgsCount) { + return $this->_matchArgs($args); + } + + $lastExpectedArgument = $this->_expectedArgs[$expectedArgsCount - 1]; + + if ($lastExpectedArgument instanceof AndAnyOtherArgs) { + $firstCorrespondingKey = array_search($lastExpectedArgument, $this->_expectedArgs, true); + + $args = array_slice($args, 0, $firstCorrespondingKey); + + return $this->_matchArgs($args); + } + + return false; } /** - * Return null. This is merely a language construct for Mock describing. + * Indicates that this expectation is never expected to be called * * @return self */ - public function andReturnNull() - { - return $this->andReturn(null); - } - - public function andReturnFalse() + public function never() { - return $this->andReturn(false); + return $this->times(0); } - public function andReturnTrue() + /** + * Indicates that this expectation is expected exactly once + * + * @return self + */ + public function once() { - return $this->andReturn(true); + return $this->times(1); } /** - * Set Exception class and arguments to that class to be thrown + * Indicates that this expectation must be called in a specific given order + * + * @param string $group Name of the ordered group * - * @param string|\Exception $exception - * @param string $message - * @param int $code - * @param \Exception $previous * @return self */ - public function andThrow($exception, $message = '', $code = 0, \Exception $previous = null) + public function ordered($group = null) { - $this->_throw = true; - if (is_object($exception)) { - $this->andReturn($exception); + if ($this->_globally) { + $this->_globalOrderNumber = $this->_defineOrdered($group, $this->_mock->mockery_getContainer()); } else { - $this->andReturn(new $exception($message, $code, $previous)); + $this->_orderNumber = $this->_defineOrdered($group, $this->_mock); } - return $this; - } - public function andThrows($exception, $message = '', $code = 0, \Exception $previous = null) - { - return $this->andThrow($exception, $message, $code, $previous); + $this->_globally = false; + + return $this; } /** - * Set Exception classes to be thrown + * Flag this expectation as calling the original class method with + * the provided arguments instead of using a return value queue. * - * @param array $exceptions * @return self */ - public function andThrowExceptions(array $exceptions) + public function passthru() { - $this->_throw = true; - foreach ($exceptions as $exception) { - if (!is_object($exception)) { - throw new Exception('You must pass an array of exception objects to andThrowExceptions'); - } + if ($this->_mock instanceof Mock) { + throw new Exception( + 'Mock Objects not created from a loaded/existing class are incapable of passing method calls through to a parent class' + ); } - return $this->andReturnValues($exceptions); + + $this->_passthru = true; + + return $this; } /** - * Register values to be set to a public property each time this expectation occurs + * Alias to andSet(). Allows the natural English construct + * - set('foo', 'bar')->andReturn('bar') * * @param string $name - * @param array ...$values + * @param mixed $value + * * @return self */ - public function andSet($name, ...$values) + public function set($name, $value) { - $this->_setQueue[$name] = $values; - return $this; + return $this->andSet(...func_get_args()); } /** - * Sets up a closure that will yield each of the provided args + * Indicates the number of times this expectation should occur + * + * @param int $limit + * + * @throws InvalidArgumentException * - * @param mixed ...$args * @return self */ - public function andYield(...$args) + public function times($limit = null) { - $this->_closureQueue = [ - static function () use ($args) { - foreach ($args as $arg) { - yield $arg; - } - }, - ]; + if ($limit === null) { + return $this; + } + + if (! is_int($limit)) { + throw new InvalidArgumentException('The passed Times limit should be an integer value'); + } + + if ($this->_expectedCount === 0) { + @trigger_error(self::ERROR_ZERO_INVOCATION, E_USER_DEPRECATED); + // throw new \InvalidArgumentException(self::ERROR_ZERO_INVOCATION); + } + + if ($limit === 0) { + $this->_countValidators = []; + } + + $this->_expectedCount = $limit; + + $this->_countValidators[$this->_countValidatorClass] = new $this->_countValidatorClass($this, $limit); + + if ($this->_countValidatorClass !== Exact::class) { + $this->_countValidatorClass = Exact::class; + + unset($this->_countValidators[$this->_countValidatorClass]); + } return $this; } /** - * Alias to andSet(). Allows the natural English construct - * - set('foo', 'bar')->andReturn('bar') + * Indicates that this expectation is expected exactly twice * - * @param string $name - * @param mixed $value * @return self */ - public function set($name, $value) + public function twice() { - return call_user_func_array(array($this, 'andSet'), func_get_args()); + return $this->times(2); } /** - * Indicates this expectation should occur zero or more times + * Verify call order * - * @return self + * @return void */ - public function zeroOrMoreTimes() + public function validateOrder() { - $this->atLeast()->never(); + if ($this->_orderNumber) { + $this->_mock->mockery_validateOrder((string) $this, $this->_orderNumber, $this->_mock); + } + + if ($this->_globalOrderNumber) { + $this->_mock->mockery_getContainer()->mockery_validateOrder( + (string) $this, + $this->_globalOrderNumber, + $this->_mock + ); + } } /** - * Indicates the number of times this expectation should occur + * Verify this expectation * - * @param int $limit - * @throws \InvalidArgumentException - * @return self + * @return void */ - public function times($limit = null) + public function verify() { - if (is_null($limit)) { - return $this; - } - if (!is_int($limit)) { - throw new \InvalidArgumentException('The passed Times limit should be an integer value'); + foreach ($this->_countValidators as $validator) { + $validator->validate($this->_actualCount); } - $this->_countValidators[$this->_countValidatorClass] = new $this->_countValidatorClass($this, $limit); + } - if ('Mockery\CountValidator\Exact' !== $this->_countValidatorClass) { - $this->_countValidatorClass = 'Mockery\CountValidator\Exact'; - unset($this->_countValidators[$this->_countValidatorClass]); + /** + * Verify the current call, i.e. that the given arguments match those + * of this expectation + * + * @throws Throwable + * + * @return mixed + */ + public function verifyCall(array $args) + { + $this->validateOrder(); + + ++$this->_actualCount; + + if ($this->_passthru === true) { + return $this->_mock->mockery_callSubjectMethod($this->_name, $args); } - return $this; + $return = $this->_getReturnValue($args); + + $this->throwAsNecessary($return); + + $this->_setValues(); + + return $return; } /** - * Indicates that this expectation is never expected to be called + * Expected argument setter for the expectation + * + * @param mixed ...$args * * @return self */ - public function never() + public function with(...$args) { - return $this->times(0); + return $this->withArgs($args); } /** - * Indicates that this expectation is expected exactly once + * Set expectation that any arguments are acceptable * * @return self */ - public function once() + public function withAnyArgs() { - return $this->times(1); + $this->_expectedArgs = [new AnyArgs()]; + + return $this; } /** - * Indicates that this expectation is expected exactly twice + * Expected arguments for the expectation passed as an array or a closure that matches each passed argument on + * each function call. + * + * @param array|Closure $argsOrClosure * * @return self */ - public function twice() + public function withArgs($argsOrClosure) { - return $this->times(2); + if (is_array($argsOrClosure)) { + return $this->withArgsInArray($argsOrClosure); + } + + if ($argsOrClosure instanceof Closure) { + return $this->withArgsMatchedByClosure($argsOrClosure); + } + + throw new InvalidArgumentException(sprintf( + 'Call to %s with an invalid argument (%s), only array and closure are allowed', + __METHOD__, + $argsOrClosure + )); } /** - * Sets next count validator to the AtLeast instance + * Set with() as no arguments expected * * @return self */ - public function atLeast() + public function withNoArgs() { - $this->_countValidatorClass = 'Mockery\CountValidator\AtLeast'; + $this->_expectedArgs = [new NoArgs()]; + return $this; } /** - * Sets next count validator to the AtMost instance + * Expected arguments should partially match the real arguments + * + * @param mixed ...$expectedArgs * * @return self */ - public function atMost() + public function withSomeOfArgs(...$expectedArgs) { - $this->_countValidatorClass = 'Mockery\CountValidator\AtMost'; - return $this; + return $this->withArgs(static function (...$args) use ($expectedArgs): bool { + foreach ($expectedArgs as $expectedArg) { + if (! in_array($expectedArg, $args, true)) { + return false; + } + } + + return true; + }); } /** - * Shorthand for setting minimum and maximum constraints on call counts + * Indicates this expectation should occur zero or more times * - * @param int $minimum - * @param int $maximum + * @return self */ - public function between($minimum, $maximum) + public function zeroOrMoreTimes() { - return $this->atLeast()->times($minimum)->atMost()->times($maximum); + return $this->atLeast()->never(); } - /** - * Set the exception message + * Setup the ordering tracking on the mock or mock container * - * @param string $message - * @return $this + * @param string $group + * @param object $ordering + * + * @return int */ - public function because($message) + protected function _defineOrdered($group, $ordering) { - $this->_because = $message; - return $this; + $groups = $ordering->mockery_getGroups(); + if ($group === null) { + return $ordering->mockery_allocateOrder(); + } + + if (array_key_exists($group, $groups)) { + return $groups[$group]; + } + + $result = $ordering->mockery_allocateOrder(); + + $ordering->mockery_setGroup($group, $result); + + return $result; } /** - * Indicates that this expectation must be called in a specific given order + * Fetch the return value for the matching args * - * @param string $group Name of the ordered group - * @return self + * @return mixed */ - public function ordered($group = null) + protected function _getReturnValue(array $args) { - if ($this->_globally) { - $this->_globalOrderNumber = $this->_defineOrdered($group, $this->_mock->mockery_getContainer()); - } else { - $this->_orderNumber = $this->_defineOrdered($group, $this->_mock); + $closureQueueCount = count($this->_closureQueue); + + if ($closureQueueCount > 1) { + return array_shift($this->_closureQueue)(...$args); } - $this->_globally = false; - return $this; + + if ($closureQueueCount > 0) { + return current($this->_closureQueue)(...$args); + } + + $returnQueueCount = count($this->_returnQueue); + + if ($returnQueueCount > 1) { + return array_shift($this->_returnQueue); + } + + if ($returnQueueCount > 0) { + return current($this->_returnQueue); + } + + return $this->_mock->mockery_returnValueForMethod($this->_name); } /** - * Indicates call order should apply globally + * Check if passed argument matches an argument expectation * - * @return self + * @param mixed $expected + * @param mixed $actual + * + * @return bool */ - public function globally() + protected function _matchArg($expected, &$actual) { - $this->_globally = true; - return $this; + if ($expected === $actual) { + return true; + } + + if ($expected instanceof MatcherInterface) { + return $expected->match($actual); + } + + if ($expected instanceof Constraint) { + return (bool) $expected->evaluate($actual, '', true); + } + + if ($expected instanceof Matcher || $expected instanceof Hamcrest_Matcher) { + @trigger_error('Hamcrest package has been deprecated and will be removed in 2.0', E_USER_DEPRECATED); + + return $expected->matches($actual); + } + + if (is_object($expected)) { + $matcher = Mockery::getConfiguration()->getDefaultMatcher(get_class($expected)); + + return $matcher === null ? false : $this->_matchArg(new $matcher($expected), $actual); + } + + if (is_object($actual) && is_string($expected) && $actual instanceof $expected) { + return true; + } + + return $expected == $actual; } /** - * Setup the ordering tracking on the mock or mock container + * Check if the passed arguments match the expectations, one by one. * - * @param string $group - * @param object $ordering - * @return int + * @param array $args + * + * @return bool */ - protected function _defineOrdered($group, $ordering) + protected function _matchArgs($args) { - $groups = $ordering->mockery_getGroups(); - if (is_null($group)) { - $result = $ordering->mockery_allocateOrder(); - } elseif (isset($groups[$group])) { - $result = $groups[$group]; - } else { - $result = $ordering->mockery_allocateOrder(); - $ordering->mockery_setGroup($group, $result); + for ($index = 0, $argCount = count($args); $index < $argCount; ++$index) { + $param = &$args[$index]; + + if (! $this->_matchArg($this->_expectedArgs[$index], $param)) { + return false; + } } - return $result; + + return true; } /** - * Return order number + * Sets public properties with queued values to the mock object * - * @return int + * @return void */ - public function getOrderNumber() + protected function _setValues() { - return $this->_orderNumber; + $mockClass = get_class($this->_mock); + + $container = $this->_mock->mockery_getContainer(); + + $mocks = $container->getMocks(); + + foreach ($this->_setQueue as $name => &$values) { + if ($values === []) { + continue; + } + + $value = array_shift($values); + + $this->_mock->{$name} = $value; + + foreach ($mocks as $mock) { + if (! $mock instanceof $mockClass) { + continue; + } + + if (! $mock->mockery_isInstance()) { + continue; + } + + $mock->{$name} = $value; + } + } } /** - * Mark this expectation as being a default + * @template TExpectedArg * - * @return self + * @param TExpectedArg $expectedArg + * + * @return bool */ - public function byDefault() + private function isAndAnyOtherArgumentsMatcher($expectedArg) { - $director = $this->_mock->mockery_getExpectationsFor($this->_name); - if (!empty($director)) { - $director->makeExpectationDefault($this); - } - return $this; + return $expectedArg instanceof AndAnyOtherArgs; } /** - * Return the parent mock of the expectation + * Check if the registered expectation is an ArgumentListMatcher * - * @return \Mockery\LegacyMockInterface|\Mockery\MockInterface + * @return bool */ - public function getMock() + private function isArgumentListMatcher() { - return $this->_mock; + return $this->_expectedArgs !== [] && $this->_expectedArgs[0] instanceof ArgumentListMatcher; } /** - * Flag this expectation as calling the original class method with the - * any provided arguments instead of using a return value queue. + * Throws an exception if the expectation has been configured to do so * - * @return self + * @param Throwable $return + * + * @throws Throwable + * + * @return void */ - public function passthru() + private function throwAsNecessary($return) { - if ($this->_mock instanceof Mock) { - throw new Exception( - 'Mock Objects not created from a loaded/existing class are ' - . 'incapable of passing method calls through to a parent class' - ); + if (! $this->_throw) { + return; } - $this->_passthru = true; - return $this; + + if (! $return instanceof Throwable) { + return; + } + + throw $return; } /** - * Cloning logic + * Expected arguments for the expectation passed as an array * + * @return self */ - public function __clone() + private function withArgsInArray(array $arguments) { - $newValidators = array(); - $countValidators = $this->_countValidators; - foreach ($countValidators as $validator) { - $newValidators[] = clone $validator; + if ($arguments === []) { + return $this->withNoArgs(); } - $this->_countValidators = $newValidators; - } - public function getName() - { - return $this->_name; + $this->_expectedArgs = $arguments; + + return $this; } - public function getExceptionMessage() + /** + * Expected arguments have to be matched by the given closure. + * + * @return self + */ + private function withArgsMatchedByClosure(Closure $closure) { - return $this->_because; + $this->_expectedArgs = [new MultiArgumentClosure($closure)]; + + return $this; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php b/api/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php index efb0b70ba9..286268b811 100644 --- a/api/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php +++ b/api/vendor/mockery/mockery/library/Mockery/ExpectationDirector.php @@ -1,47 +1,39 @@ */ - protected $_mock = null; + protected $_defaults = []; /** * Stores an array of all expectations for this mock * - * @var array + * @var list */ - protected $_expectations = array(); + protected $_expectations = []; /** * The expected order of next call @@ -51,19 +43,25 @@ class ExpectationDirector protected $_expectedOrder = null; /** - * Stores an array of all default expectations for this mock + * Mock object the director is attached to * - * @var array + * @var LegacyMockInterface|MockInterface */ - protected $_defaults = array(); + protected $_mock = null; + + /** + * Method name the director is directing + * + * @var string + */ + protected $_name = null; /** * Constructor * * @param string $name - * @param \Mockery\LegacyMockInterface $mock */ - public function __construct($name, \Mockery\LegacyMockInterface $mock) + public function __construct($name, LegacyMockInterface $mock) { $this->_name = $name; $this->_mock = $mock; @@ -71,10 +69,8 @@ public function __construct($name, \Mockery\LegacyMockInterface $mock) /** * Add a new expectation to the director - * - * @param \Mockery\Expectation $expectation */ - public function addExpectation(\Mockery\Expectation $expectation) + public function addExpectation(Expectation $expectation) { $this->_expectations[] = $expectation; } @@ -82,114 +78,90 @@ public function addExpectation(\Mockery\Expectation $expectation) /** * Handle a method call being directed by this instance * - * @param array $args * @return mixed */ public function call(array $args) { $expectation = $this->findExpectation($args); - if (is_null($expectation)) { - $exception = new \Mockery\Exception\NoMatchingExpectationException( - 'No matching handler found for ' - . $this->_mock->mockery_getName() . '::' - . \Mockery::formatArgs($this->_name, $args) - . '. Either the method was unexpected or its arguments matched' - . ' no expected argument list for this method' - . PHP_EOL . PHP_EOL - . \Mockery::formatObjects($args) - ); - $exception->setMock($this->_mock) - ->setMethodName($this->_name) - ->setActualArguments($args); - throw $exception; + if ($expectation !== null) { + return $expectation->verifyCall($args); } - return $expectation->verifyCall($args); - } - /** - * Verify all expectations of the director - * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function verify() - { - if (!empty($this->_expectations)) { - foreach ($this->_expectations as $exp) { - $exp->verify(); - } - } else { - foreach ($this->_defaults as $exp) { - $exp->verify(); - } - } + $exception = new NoMatchingExpectationException( + 'No matching handler found for ' + . $this->_mock->mockery_getName() . '::' + . Mockery::formatArgs($this->_name, $args) + . '. Either the method was unexpected or its arguments matched' + . ' no expected argument list for this method' + . PHP_EOL . PHP_EOL + . Mockery::formatObjects($args) + ); + + $exception->setMock($this->_mock) + ->setMethodName($this->_name) + ->setActualArguments($args); + + throw $exception; } /** * Attempt to locate an expectation matching the provided args * - * @param array $args * @return mixed */ public function findExpectation(array $args) { $expectation = null; - if (!empty($this->_expectations)) { + if ($this->_expectations !== []) { $expectation = $this->_findExpectationIn($this->_expectations, $args); } - if ($expectation === null && !empty($this->_defaults)) { - $expectation = $this->_findExpectationIn($this->_defaults, $args); + if ($expectation === null && $this->_defaults !== []) { + return $this->_findExpectationIn($this->_defaults, $args); } return $expectation; } /** - * Make the given expectation a default for all others assuming it was - * correctly created last + * Return all expectations assigned to this director * - * @param \Mockery\Expectation $expectation + * @return array */ - public function makeExpectationDefault(\Mockery\Expectation $expectation) + public function getDefaultExpectations() { - $last = end($this->_expectations); - if ($last === $expectation) { - array_pop($this->_expectations); - array_unshift($this->_defaults, $expectation); - } else { - throw new \Mockery\Exception( - 'Cannot turn a previously defined expectation into a default' - ); - } + return $this->_defaults; } /** - * Search current array of expectations for a match + * Return the number of expectations assigned to this director. * - * @param array $expectations - * @param array $args - * @return mixed + * @return int */ - protected function _findExpectationIn(array $expectations, array $args) + public function getExpectationCount() { - foreach ($expectations as $exp) { - if ($exp->isEligible() && $exp->matchArgs($args)) { - return $exp; - } + $count = 0; + + $expectations = $this->getExpectations(); + + if ($expectations === []) { + $expectations = $this->getDefaultExpectations(); } - foreach ($expectations as $exp) { - if ($exp->matchArgs($args)) { - return $exp; + + foreach ($expectations as $expectation) { + if ($expectation->isCallCountConstrained()) { + ++$count; } } + + return $count; } /** * Return all expectations assigned to this director * - * @return array + * @return array */ public function getExpectations() { @@ -197,30 +169,74 @@ public function getExpectations() } /** - * Return all expectations assigned to this director + * Make the given expectation a default for all others assuming it was correctly created last + * + * @throws Exception * - * @return array + * @return void */ - public function getDefaultExpectations() + public function makeExpectationDefault(Expectation $expectation) { - return $this->_defaults; + if (end($this->_expectations) === $expectation) { + array_pop($this->_expectations); + + array_unshift($this->_defaults, $expectation); + + return; + } + + throw new Exception('Cannot turn a previously defined expectation into a default'); } /** - * Return the number of expectations assigned to this director. + * Verify all expectations of the director * - * @return int + * @throws Exception + * + * @return void */ - public function getExpectationCount() + public function verify() + { + if ($this->_expectations !== []) { + foreach ($this->_expectations as $expectation) { + $expectation->verify(); + } + + return; + } + + foreach ($this->_defaults as $expectation) { + $expectation->verify(); + } + } + + /** + * Search current array of expectations for a match + * + * @param array $expectations + * + * @return null|ExpectationInterface + */ + protected function _findExpectationIn(array $expectations, array $args) { - $count = 0; - /** @var Expectation $expectations */ - $expectations = $this->getExpectations() ?: $this->getDefaultExpectations(); foreach ($expectations as $expectation) { - if ($expectation->isCallCountConstrained()) { - $count++; + if (! $expectation->isEligible()) { + continue; + } + + if (! $expectation->matchArgs($args)) { + continue; + } + + return $expectation; + } + + foreach ($expectations as $expectation) { + if ($expectation->matchArgs($args)) { + return $expectation; } } - return $count; + + return null; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php b/api/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php index f1295ad355..29c27d3a28 100644 --- a/api/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php +++ b/api/vendor/mockery/mockery/library/Mockery/ExpectationInterface.php @@ -1,22 +1,11 @@ + */ + protected $cache = []; + + /** + * @var Generator + */ protected $generator; - protected $cache = array(); public function __construct(Generator $generator) { $this->generator = $generator; } + /** + * @return string + */ public function generate(MockConfiguration $config) { $hash = $config->getHash(); - if (isset($this->cache[$hash])) { + + if (array_key_exists($hash, $this->cache)) { return $this->cache[$hash]; } - $definition = $this->generator->generate($config); - $this->cache[$hash] = $definition; - - return $definition; + return $this->cache[$hash] = $this->generator->generate($config); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php index 7463f1d1d7..f2a3f32711 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/DefinedTargetClass.php @@ -1,96 +1,140 @@ rfc = $rfc; - $this->name = $alias === null ? $rfc->getName() : $alias; - } + /** + * @var ReflectionClass + */ + private $rfc; - public static function factory($name, $alias = null) + /** + * @param ReflectionClass $rfc + * @param class-string|null $alias + */ + public function __construct(ReflectionClass $rfc, $alias = null) { - return new self(new \ReflectionClass($name), $alias); + $this->rfc = $rfc; + $this->name = $alias ?? $rfc->getName(); } - public function getName() + /** + * @return class-string + */ + public function __toString() { return $this->name; } - public function isAbstract() + /** + * @param class-string $name + * @param class-string|null $alias + * @return self + */ + public static function factory($name, $alias = null) { - return $this->rfc->isAbstract(); + return new self(new ReflectionClass($name), $alias); } - public function isFinal() + /** + * @return list + */ + public function getAttributes() { - return $this->rfc->isFinal(); - } + if (PHP_VERSION_ID < 80000) { + return []; + } - public function getMethods() - { - return array_map(function ($method) { - return new Method($method); - }, $this->rfc->getMethods()); + return array_unique( + array_merge( + ['\AllowDynamicProperties'], + array_map( + static function (ReflectionAttribute $attribute): string { + return '\\' . $attribute->getName(); + }, + $this->rfc->getAttributes() + ) + ) + ); } + /** + * @return array + */ public function getInterfaces() { - $class = __CLASS__; - return array_map(function ($interface) use ($class) { - return new $class($interface); - }, $this->rfc->getInterfaces()); + return array_map( + static function (ReflectionClass $interface): self { + return new self($interface); + }, + $this->rfc->getInterfaces() + ); } - public function __toString() + /** + * @return list + */ + public function getMethods() { - return $this->getName(); + return array_map( + static function (ReflectionMethod $method): Method { + return new Method($method); + }, + $this->rfc->getMethods() + ); } - public function getNamespaceName() + /** + * @return class-string + */ + public function getName() { - return $this->rfc->getNamespaceName(); + return $this->name; } - public function inNamespace() + /** + * @return string + */ + public function getNamespaceName() { - return $this->rfc->inNamespace(); + return $this->rfc->getNamespaceName(); } + /** + * @return string + */ public function getShortName() { return $this->rfc->getShortName(); } - public function implementsInterface($interface) - { - return $this->rfc->implementsInterface($interface); - } - + /** + * @return bool + */ public function hasInternalAncestor() { if ($this->rfc->isInternal()) { @@ -102,9 +146,43 @@ public function hasInternalAncestor() if ($parent->isInternal()) { return true; } + $child = $parent; } return false; } + + /** + * @param class-string $interface + * @return bool + */ + public function implementsInterface($interface) + { + return $this->rfc->implementsInterface($interface); + } + + /** + * @return bool + */ + public function inNamespace() + { + return $this->rfc->inNamespace(); + } + + /** + * @return bool + */ + public function isAbstract() + { + return $this->rfc->isAbstract(); + } + + /** + * @return bool + */ + public function isFinal() + { + return $this->rfc->isFinal(); + } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/Generator.php b/api/vendor/mockery/mockery/library/Mockery/Generator/Generator.php index 459a93cccc..9dc59c83b2 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/Generator.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/Generator.php @@ -1,27 +1,19 @@ method = $method; } + /** + * @template TArgs + * @template TMixed + * + * @param string $method + * @param array $args + * + * @return TMixed + */ public function __call($method, $args) { - return call_user_func_array(array($this->method, $method), $args); + /** @var TMixed */ + return $this->method->{$method}(...$args); } /** - * @return Parameter[] + * @return list */ public function getParameters() { - return array_map(function (\ReflectionParameter $parameter) { + return array_map(static function (ReflectionParameter $parameter) { return new Parameter($parameter); }, $this->method->getParameters()); } /** - * @return string|null + * @return null|string */ public function getReturnType() { diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php b/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php index 05903e5bbd..1849c3e2fe 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfiguration.php @@ -1,25 +1,39 @@ */ - protected $targetClass; - protected $targetClassName; + protected $allMethods = []; /** - * A number of interfaces we'd like to mock, keyed by name to attempt to - * keep unique + * Methods that should specifically not be mocked + * + * This is currently populated with stuff we don't know how to deal with, should really be somewhere else */ - protected $targetInterfaces = array(); - protected $targetInterfaceNames = array(); + protected $blackListedMethods = []; + + protected $constantsMap = []; /** - * A number of traits we'd like to mock, keyed by name to attempt to - * keep unique + * An instance mock is where we override the original class before it's autoloaded + * + * @var bool */ - protected $targetTraits = array(); - protected $targetTraitNames = array(); + protected $instanceMock = false; /** - * An object we'd like our mock to proxy to + * If true, overrides original class destructor + * + * @var bool */ - protected $targetObject; + protected $mockOriginalDestructor = false; /** * The class name we'd like to use for a generated mock + * + * @var string|null */ protected $name; /** - * Methods that should specifically not be mocked + * Param overrides * - * This is currently populated with stuff we don't know how to deal with, - * should really be somewhere else + * @var array */ - protected $blackListedMethods = array(); + protected $parameterOverrides = []; /** - * If not empty, only these methods will be mocked + * A class that we'd like to mock + * @var TargetClassInterface|null + */ + protected $targetClass; + + /** + * @var class-string|null */ - protected $whiteListedMethods = array(); + protected $targetClassName; /** - * An instance mock is where we override the original class before it's - * autoloaded + * @var array */ - protected $instanceMock = false; + protected $targetInterfaceNames = []; /** - * Param overrides + * A number of interfaces we'd like to mock, keyed by name to attempt to keep unique + * + * @var array */ - protected $parameterOverrides = array(); + protected $targetInterfaces = []; /** - * Instance cache of all methods + * An object we'd like our mock to proxy to + * + * @var object|null */ - protected $allMethods; + protected $targetObject; /** - * If true, overrides original class destructor + * @var array */ - protected $mockOriginalDestructor = false; + protected $targetTraitNames = []; - protected $constantsMap = array(); + /** + * A number of traits we'd like to mock, keyed by name to attempt to keep unique + * + * @var array + */ + protected $targetTraits = []; + + /** + * If not empty, only these methods will be mocked + * + * @var array + */ + protected $whiteListedMethods = []; + /** + * @param array $targets + * @param array $blackListedMethods + * @param array $whiteListedMethods + * @param string|null $name + * @param bool $instanceMock + * @param array $parameterOverrides + * @param bool $mockOriginalDestructor + * @param array|scalar> $constantsMap + */ public function __construct( - array $targets = array(), - array $blackListedMethods = array(), - array $whiteListedMethods = array(), + array $targets = [], + array $blackListedMethods = [], + array $whiteListedMethods = [], $name = null, $instanceMock = false, - array $parameterOverrides = array(), + array $parameterOverrides = [], $mockOriginalDestructor = false, - array $constantsMap = array() + array $constantsMap = [] ) { $this->addTargets($targets); $this->blackListedMethods = $blackListedMethods; @@ -112,6 +163,52 @@ public function __construct( $this->constantsMap = $constantsMap; } + /** + * Generate a suitable name based on the config + * + * @return string + */ + public function generateName() + { + $nameBuilder = new MockNameBuilder(); + + $targetObject = $this->getTargetObject(); + if ($targetObject !== null) { + $className = get_class($targetObject); + + $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); + } + + $targetClass = $this->getTargetClass(); + if ($targetClass instanceof TargetClassInterface) { + $className = $targetClass->getName(); + + $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); + } + + foreach ($this->getTargetInterfaces() as $targetInterface) { + $nameBuilder->addPart($targetInterface->getName()); + } + + return $nameBuilder->build(); + } + + /** + * @return array + */ + public function getBlackListedMethods() + { + return $this->blackListedMethods; + } + + /** + * @return array> + */ + public function getConstantsMap() + { + return $this->constantsMap; + } + /** * Attempt to create a hash of the configuration, in order to allow caching * @@ -121,25 +218,26 @@ public function __construct( */ public function getHash() { - $vars = array( - 'targetClassName' => $this->targetClassName, - 'targetInterfaceNames' => $this->targetInterfaceNames, - 'targetTraitNames' => $this->targetTraitNames, - 'name' => $this->name, - 'blackListedMethods' => $this->blackListedMethods, - 'whiteListedMethod' => $this->whiteListedMethods, - 'instanceMock' => $this->instanceMock, - 'parameterOverrides' => $this->parameterOverrides, - 'mockOriginalDestructor' => $this->mockOriginalDestructor - ); + $vars = [ + 'targetClassName' => $this->targetClassName, + 'targetInterfaceNames' => $this->targetInterfaceNames, + 'targetTraitNames' => $this->targetTraitNames, + 'name' => $this->name, + 'blackListedMethods' => $this->blackListedMethods, + 'whiteListedMethod' => $this->whiteListedMethods, + 'instanceMock' => $this->instanceMock, + 'parameterOverrides' => $this->parameterOverrides, + 'mockOriginalDestructor' => $this->mockOriginalDestructor, + ]; return md5(serialize($vars)); } /** - * Gets a list of methods from the classes, interfaces and objects and - * filters them appropriately. Lot's of filtering going on, perhaps we could - * have filter classes to iterate through + * Gets a list of methods from the classes, interfaces and objects and filters them appropriately. + * Lot's of filtering going on, perhaps we could have filter classes to iterate through + * + * @return list */ public function getMethodsToMock() { @@ -154,22 +252,28 @@ public function getMethodsToMock() /** * Whitelist trumps everything else */ - if (count($this->getWhiteListedMethods())) { - $whitelist = array_map('strtolower', $this->getWhiteListedMethods()); - $methods = array_filter($methods, function ($method) use ($whitelist) { - return $method->isAbstract() || in_array(strtolower($method->getName()), $whitelist); - }); + $whiteListedMethods = $this->getWhiteListedMethods(); + if ($whiteListedMethods !== []) { + $whitelist = array_map('strtolower', $whiteListedMethods); + + return array_filter($methods, static function ($method) use ($whitelist) { + if ($method->isAbstract()) { + return true; + } - return $methods; + return in_array(strtolower($method->getName()), $whitelist, true); + }); } /** * Remove blacklisted methods */ - if (count($this->getBlackListedMethods())) { - $blacklist = array_map('strtolower', $this->getBlackListedMethods()); - $methods = array_filter($methods, function ($method) use ($blacklist) { - return !in_array(strtolower($method->getName()), $blacklist); + $blackListedMethods = $this->getBlackListedMethods(); + if ($blackListedMethods !== []) { + $blacklist = array_map('strtolower', $blackListedMethods); + + $methods = array_filter($methods, static function ($method) use ($blacklist) { + return ! in_array(strtolower($method->getName()), $blacklist, true); }); } @@ -179,11 +283,15 @@ public function getMethodsToMock() * such, we can't mock it and will need a pass to add a dummy * implementation */ - if ($this->getTargetClass() - && $this->getTargetClass()->implementsInterface("Serializable") - && $this->getTargetClass()->hasInternalAncestor()) { - $methods = array_filter($methods, function ($method) { - return $method->getName() !== "unserialize"; + $targetClass = $this->getTargetClass(); + + if ( + $targetClass !== null + && $targetClass->implementsInterface(Serializable::class) + && $targetClass->hasInternalAncestor() + ) { + $methods = array_filter($methods, static function ($method) { + return $method->getName() !== 'unserialize'; }); } @@ -191,129 +299,55 @@ public function getMethodsToMock() } /** - * We declare the __call method to handle undefined stuff, if the class - * we're mocking has also defined it, we need to comply with their interface + * @return string|null */ - public function requiresCallTypeHintRemoval() + public function getName() { - foreach ($this->getAllMethods() as $method) { - if ("__call" === $method->getName()) { - $params = $method->getParameters(); - return !$params[1]->isArray(); - } - } - - return false; + return $this->name; } /** - * We declare the __callStatic method to handle undefined stuff, if the class - * we're mocking has also defined it, we need to comply with their interface + * @return string */ - public function requiresCallStaticTypeHintRemoval() - { - foreach ($this->getAllMethods() as $method) { - if ("__callStatic" === $method->getName()) { - $params = $method->getParameters(); - return !$params[1]->isArray(); - } - } - - return false; - } - - public function rename($className) - { - $targets = array(); - - if ($this->targetClassName) { - $targets[] = $this->targetClassName; - } - - if ($this->targetInterfaceNames) { - $targets = array_merge($targets, $this->targetInterfaceNames); - } - - if ($this->targetTraitNames) { - $targets = array_merge($targets, $this->targetTraitNames); - } - - if ($this->targetObject) { - $targets[] = $this->targetObject; - } - - return new self( - $targets, - $this->blackListedMethods, - $this->whiteListedMethods, - $className, - $this->instanceMock, - $this->parameterOverrides, - $this->mockOriginalDestructor, - $this->constantsMap - ); - } - - protected function addTarget($target) + public function getNamespaceName() { - if (is_object($target)) { - $this->setTargetObject($target); - $this->setTargetClassName(get_class($target)); - return $this; - } - - if ($target[0] !== "\\") { - $target = "\\" . $target; - } - - if (class_exists($target)) { - $this->setTargetClassName($target); - return $this; - } - - if (interface_exists($target)) { - $this->addTargetInterfaceName($target); - return $this; - } + $parts = explode('\\', $this->getName()); + array_pop($parts); - if (trait_exists($target)) { - $this->addTargetTraitName($target); - return $this; + if ($parts !== []) { + return implode('\\', $parts); } - /** - * Default is to set as class, or interface if class already set - * - * Don't like this condition, can't remember what the default - * targetClass is for - */ - if ($this->getTargetClassName()) { - $this->addTargetInterfaceName($target); - return $this; - } - - $this->setTargetClassName($target); + return ''; } - protected function addTargets($interfaces) + /** + * @return array + */ + public function getParameterOverrides() { - foreach ($interfaces as $interface) { - $this->addTarget($interface); - } + return $this->parameterOverrides; } - public function getTargetClassName() + /** + * @return string + */ + public function getShortName() { - return $this->targetClassName; + $parts = explode('\\', $this->getName()); + return array_pop($parts); } + /** + * @return null|TargetClassInterface + */ public function getTargetClass() { if ($this->targetClass) { return $this->targetClass; } - if (!$this->targetClassName) { + if (! $this->targetClassName) { return null; } @@ -326,10 +360,11 @@ public function getTargetClass() ->build(); class_alias($this->targetClassName, $alias); } + $dtc = DefinedTargetClass::factory($this->targetClassName, $alias); - if ($this->getTargetObject() == false && $dtc->isFinal()) { - throw new \Mockery\Exception( + if ($this->getTargetObject() === null && $dtc->isFinal()) { + throw new Exception( 'The class ' . $this->targetClassName . ' is marked final and its methods' . ' cannot be replaced. Classes marked final can be passed in' . ' to \Mockery::mock() as instantiated objects to create a' @@ -346,28 +381,25 @@ class_alias($this->targetClassName, $alias); return $this->targetClass; } - public function getTargetTraits() + /** + * @return class-string|null + */ + public function getTargetClassName() { - if (!empty($this->targetTraits)) { - return $this->targetTraits; - } - - foreach ($this->targetTraitNames as $targetTrait) { - $this->targetTraits[] = DefinedTargetClass::factory($targetTrait); - } - - $this->targetTraits = array_unique($this->targetTraits); // just in case - return $this->targetTraits; + return $this->targetClassName; } + /** + * @return list + */ public function getTargetInterfaces() { - if (!empty($this->targetInterfaces)) { + if ($this->targetInterfaces !== []) { return $this->targetInterfaces; } foreach ($this->targetInterfaceNames as $targetInterface) { - if (!interface_exists($targetInterface)) { + if (! interface_exists($targetInterface)) { $this->targetInterfaces[] = UndefinedTargetClass::factory($targetInterface); continue; } @@ -379,118 +411,248 @@ public function getTargetInterfaces() $traversableFound = false; $iteratorShiftedToFront = false; foreach ($extendedInterfaces as $interface) { - if (!$traversableFound && preg_match("/^\\?Iterator(|Aggregate)$/i", $interface)) { + if (! $traversableFound && preg_match('/^\\?Iterator(|Aggregate)$/i', $interface)) { break; } - if (preg_match("/^\\\\?IteratorAggregate$/i", $interface)) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate"); + if (preg_match('/^\\\\?IteratorAggregate$/i', $interface)) { + $this->targetInterfaces[] = DefinedTargetClass::factory('\\IteratorAggregate'); $iteratorShiftedToFront = true; - } elseif (preg_match("/^\\\\?Iterator$/i", $interface)) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\Iterator"); + + continue; + } + + if (preg_match('/^\\\\?Iterator$/i', $interface)) { + $this->targetInterfaces[] = DefinedTargetClass::factory('\\Iterator'); $iteratorShiftedToFront = true; - } elseif (preg_match("/^\\\\?Traversable$/i", $interface)) { + + continue; + } + + if (preg_match('/^\\\\?Traversable$/i', $interface)) { $traversableFound = true; } } - if ($traversableFound && !$iteratorShiftedToFront) { - $this->targetInterfaces[] = DefinedTargetClass::factory("\\IteratorAggregate"); + if ($traversableFound && ! $iteratorShiftedToFront) { + $this->targetInterfaces[] = DefinedTargetClass::factory('\\IteratorAggregate'); } /** * We never straight up implement Traversable */ - if (!preg_match("/^\\\\?Traversable$/i", $targetInterface)) { + $isTraversable = preg_match('/^\\\\?Traversable$/i', $targetInterface); + if ($isTraversable === 0 || $isTraversable === false) { $this->targetInterfaces[] = $dtc; } } - $this->targetInterfaces = array_unique($this->targetInterfaces); // just in case - return $this->targetInterfaces; + + return $this->targetInterfaces = array_unique($this->targetInterfaces); } + /** + * @return object|null + */ public function getTargetObject() { return $this->targetObject; } - public function getName() + /** + * @return list + */ + public function getTargetTraits() { - return $this->name; + if ($this->targetTraits !== []) { + return $this->targetTraits; + } + + foreach ($this->targetTraitNames as $targetTrait) { + $this->targetTraits[] = DefinedTargetClass::factory($targetTrait); + } + + $this->targetTraits = array_unique($this->targetTraits); // just in case + return $this->targetTraits; } /** - * Generate a suitable name based on the config + * @return array */ - public function generateName() + public function getWhiteListedMethods() { - $nameBuilder = new MockNameBuilder(); + return $this->whiteListedMethods; + } - if ($this->getTargetObject()) { - $className = get_class($this->getTargetObject()); - $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); + /** + * @return bool + */ + public function isInstanceMock() + { + return $this->instanceMock; + } + + /** + * @return bool + */ + public function isMockOriginalDestructor() + { + return $this->mockOriginalDestructor; + } + + /** + * @param class-string $className + * @return self + */ + public function rename($className) + { + $targets = []; + + if ($this->targetClassName) { + $targets[] = $this->targetClassName; } - if ($this->getTargetClass()) { - $className = $this->getTargetClass()->getName(); - $nameBuilder->addPart(strpos($className, '@') !== false ? md5($className) : $className); + if ($this->targetInterfaceNames) { + $targets = array_merge($targets, $this->targetInterfaceNames); } - foreach ($this->getTargetInterfaces() as $targetInterface) { - $nameBuilder->addPart($targetInterface->getName()); + if ($this->targetTraitNames) { + $targets = array_merge($targets, $this->targetTraitNames); } - return $nameBuilder->build(); - } + if ($this->targetObject) { + $targets[] = $this->targetObject; + } - public function getShortName() - { - $parts = explode("\\", $this->getName()); - return array_pop($parts); + return new self( + $targets, + $this->blackListedMethods, + $this->whiteListedMethods, + $className, + $this->instanceMock, + $this->parameterOverrides, + $this->mockOriginalDestructor, + $this->constantsMap + ); } - public function getNamespaceName() + /** + * We declare the __callStatic method to handle undefined stuff, if the class + * we're mocking has also defined it, we need to comply with their interface + * + * @return bool + */ + public function requiresCallStaticTypeHintRemoval() { - $parts = explode("\\", $this->getName()); - array_pop($parts); + foreach ($this->getAllMethods() as $method) { + if ($method->getName() === '__callStatic') { + $params = $method->getParameters(); - if (count($parts)) { - return implode("\\", $parts); + if (! array_key_exists(1, $params)) { + return false; + } + + return ! $params[1]->isArray(); + } } - return ""; + return false; } - public function getBlackListedMethods() + /** + * We declare the __call method to handle undefined stuff, if the class + * we're mocking has also defined it, we need to comply with their interface + * + * @return bool + */ + public function requiresCallTypeHintRemoval() { - return $this->blackListedMethods; - } + foreach ($this->getAllMethods() as $method) { + if ($method->getName() === '__call') { + $params = $method->getParameters(); + return ! $params[1]->isArray(); + } + } - public function getWhiteListedMethods() - { - return $this->whiteListedMethods; + return false; } - public function isInstanceMock() + /** + * @param class-string|object $target + */ + protected function addTarget($target) { - return $this->instanceMock; + if (is_object($target)) { + $this->setTargetObject($target); + $this->setTargetClassName(get_class($target)); + return; + } + + if ($target[0] !== '\\') { + $target = '\\' . $target; + } + + if (class_exists($target)) { + $this->setTargetClassName($target); + return; + } + + if (interface_exists($target)) { + $this->addTargetInterfaceName($target); + return; + } + + if (trait_exists($target)) { + $this->addTargetTraitName($target); + return; + } + + /** + * Default is to set as class, or interface if class already set + * + * Don't like this condition, can't remember what the default + * targetClass is for + */ + if ($this->getTargetClassName()) { + $this->addTargetInterfaceName($target); + return; + } + + $this->setTargetClassName($target); } - public function getParameterOverrides() + /** + * If we attempt to implement Traversable, + * we must ensure we are also implementing either Iterator or IteratorAggregate, + * and that whichever one it is comes before Traversable in the list of implements. + * + * @param class-string $targetInterface + */ + protected function addTargetInterfaceName($targetInterface) { - return $this->parameterOverrides; + $this->targetInterfaceNames[] = $targetInterface; } - public function isMockOriginalDestructor() + /** + * @param array $interfaces + */ + protected function addTargets($interfaces) { - return $this->mockOriginalDestructor; + foreach ($interfaces as $interface) { + $this->addTarget($interface); + } } - protected function setTargetClassName($targetClassName) + /** + * @param class-string $targetTraitName + */ + protected function addTargetTraitName($targetTraitName) { - $this->targetClassName = $targetClassName; + $this->targetTraitNames[] = $targetTraitName; } + /** + * @return list + */ protected function getAllMethods() { if ($this->allMethods) { @@ -503,7 +665,7 @@ protected function getAllMethods() $classes[] = $this->getTargetClass(); } - $methods = array(); + $methods = []; foreach ($classes as $class) { $methods = array_merge($methods, $class->getMethods()); } @@ -516,9 +678,9 @@ protected function getAllMethods() } } - $names = array(); - $methods = array_filter($methods, function ($method) use (&$names) { - if (in_array($method->getName(), $names)) { + $names = []; + $methods = array_filter($methods, static function ($method) use (&$names) { + if (in_array($method->getName(), $names, true)) { return false; } @@ -530,27 +692,18 @@ protected function getAllMethods() } /** - * If we attempt to implement Traversable, we must ensure we are also - * implementing either Iterator or IteratorAggregate, and that whichever one - * it is comes before Traversable in the list of implements. + * @param class-string $targetClassName */ - protected function addTargetInterfaceName($targetInterface) - { - $this->targetInterfaceNames[] = $targetInterface; - } - - protected function addTargetTraitName($targetTraitName) + protected function setTargetClassName($targetClassName) { - $this->targetTraitNames[] = $targetTraitName; + $this->targetClassName = $targetClassName; } + /** + * @param object $object + */ protected function setTargetObject($object) { $this->targetObject = $object; } - - public function getConstantsMap() - { - return $this->constantsMap; - } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php b/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php index 273b1d8b76..989325e362 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/MockConfigurationBuilder.php @@ -1,29 +1,23 @@ + */ + protected $blackListedMethods = [ '__call', '__callStatic', '__clone', @@ -36,139 +30,223 @@ class MockConfigurationBuilder '__debugInfo', ## mocking this makes it difficult to debug with xdebug // below are reserved words in PHP - "__halt_compiler", "abstract", "and", "array", "as", - "break", "callable", "case", "catch", "class", - "clone", "const", "continue", "declare", "default", - "die", "do", "echo", "else", "elseif", - "empty", "enddeclare", "endfor", "endforeach", "endif", - "endswitch", "endwhile", "eval", "exit", "extends", - "final", "for", "foreach", "function", "global", - "goto", "if", "implements", "include", "include_once", - "instanceof", "insteadof", "interface", "isset", "list", - "namespace", "new", "or", "print", "private", - "protected", "public", "require", "require_once", "return", - "static", "switch", "throw", "trait", "try", - "unset", "use", "var", "while", "xor" - ); - - protected $php7SemiReservedKeywords = [ - "callable", "class", "trait", "extends", "implements", "static", "abstract", "final", - "public", "protected", "private", "const", "enddeclare", "endfor", "endforeach", "endif", - "endwhile", "and", "global", "goto", "instanceof", "insteadof", "interface", "namespace", "new", - "or", "xor", "try", "use", "var", "exit", "list", "clone", "include", "include_once", "throw", - "array", "print", "echo", "require", "require_once", "return", "else", "elseif", "default", - "break", "continue", "switch", "yield", "function", "if", "endswitch", "finally", "for", "foreach", - "declare", "case", "do", "while", "as", "catch", "die", "self", "parent", + '__halt_compiler', 'abstract', 'and', 'array', 'as', + 'break', 'callable', 'case', 'catch', 'class', + 'clone', 'const', 'continue', 'declare', 'default', + 'die', 'do', 'echo', 'else', 'elseif', + 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', + 'endswitch', 'endwhile', 'eval', 'exit', 'extends', + 'final', 'for', 'foreach', 'function', 'global', + 'goto', 'if', 'implements', 'include', 'include_once', + 'instanceof', 'insteadof', 'interface', 'isset', 'list', + 'namespace', 'new', 'or', 'print', 'private', + 'protected', 'public', 'require', 'require_once', 'return', + 'static', 'switch', 'throw', 'trait', 'try', + 'unset', 'use', 'var', 'while', 'xor', ]; - protected $whiteListedMethods = array(); + /** + * @var array + */ + protected $constantsMap = []; + + /** + * @var bool + */ protected $instanceMock = false; - protected $parameterOverrides = array(); + /** + * @var bool + */ protected $mockOriginalDestructor = false; - protected $targets = array(); - protected $constantsMap = array(); + /** + * @var string + */ + protected $name; + + /** + * @var array + */ + protected $parameterOverrides = []; + + /** + * @var list + */ + protected $php7SemiReservedKeywords = [ + 'callable', 'class', 'trait', 'extends', 'implements', 'static', 'abstract', 'final', + 'public', 'protected', 'private', 'const', 'enddeclare', 'endfor', 'endforeach', 'endif', + 'endwhile', 'and', 'global', 'goto', 'instanceof', 'insteadof', 'interface', 'namespace', 'new', + 'or', 'xor', 'try', 'use', 'var', 'exit', 'list', 'clone', 'include', 'include_once', 'throw', + 'array', 'print', 'echo', 'require', 'require_once', 'return', 'else', 'elseif', 'default', + 'break', 'continue', 'switch', 'yield', 'function', 'if', 'endswitch', 'finally', 'for', 'foreach', + 'declare', 'case', 'do', 'while', 'as', 'catch', 'die', 'self', 'parent', + ]; + + /** + * @var array + */ + protected $targets = []; + + /** + * @var array + */ + protected $whiteListedMethods = []; public function __construct() { $this->blackListedMethods = array_diff($this->blackListedMethods, $this->php7SemiReservedKeywords); } - public function addTarget($target) + /** + * @param string $blackListedMethod + * @return self + */ + public function addBlackListedMethod($blackListedMethod) { - $this->targets[] = $target; - + $this->blackListedMethods[] = $blackListedMethod; return $this; } - public function addTargets($targets) + /** + * @param list $blackListedMethods + * @return self + */ + public function addBlackListedMethods(array $blackListedMethods) { - foreach ($targets as $target) { - $this->addTarget($target); + foreach ($blackListedMethods as $method) { + $this->addBlackListedMethod($method); } return $this; } - public function setName($name) + /** + * @param class-string $target + * @return self + */ + public function addTarget($target) { - $this->name = $name; - return $this; - } + $this->targets[] = $target; - public function addBlackListedMethod($blackListedMethod) - { - $this->blackListedMethods[] = $blackListedMethod; return $this; } - public function addBlackListedMethods(array $blackListedMethods) + /** + * @param list $targets + * @return self + */ + public function addTargets($targets) { - foreach ($blackListedMethods as $method) { - $this->addBlackListedMethod($method); + foreach ($targets as $target) { + $this->addTarget($target); } - return $this; - } - public function setBlackListedMethods(array $blackListedMethods) - { - $this->blackListedMethods = $blackListedMethods; return $this; } + /** + * @return self + */ public function addWhiteListedMethod($whiteListedMethod) { $this->whiteListedMethods[] = $whiteListedMethod; return $this; } + /** + * @return self + */ public function addWhiteListedMethods(array $whiteListedMethods) { foreach ($whiteListedMethods as $method) { $this->addWhiteListedMethod($method); } + return $this; } - public function setWhiteListedMethods(array $whiteListedMethods) + /** + * @return MockConfiguration + */ + public function getMockConfiguration() { - $this->whiteListedMethods = $whiteListedMethods; + return new MockConfiguration( + $this->targets, + $this->blackListedMethods, + $this->whiteListedMethods, + $this->name, + $this->instanceMock, + $this->parameterOverrides, + $this->mockOriginalDestructor, + $this->constantsMap + ); + } + + /** + * @param list $blackListedMethods + * @return self + */ + public function setBlackListedMethods(array $blackListedMethods) + { + $this->blackListedMethods = $blackListedMethods; + return $this; + } + + /** + * @return self + */ + public function setConstantsMap(array $map) + { + $this->constantsMap = $map; + return $this; } + /** + * @param bool $instanceMock + */ public function setInstanceMock($instanceMock) { $this->instanceMock = (bool) $instanceMock; + + return $this; } - public function setParameterOverrides(array $overrides) + /** + * @param bool $mockDestructor + */ + public function setMockOriginalDestructor($mockDestructor) { - $this->parameterOverrides = $overrides; + $this->mockOriginalDestructor = (bool) $mockDestructor; + return $this; } - public function setMockOriginalDestructor($mockDestructor) + /** + * @param string $name + */ + public function setName($name) { - $this->mockOriginalDestructor = $mockDestructor; + $this->name = $name; return $this; } - public function setConstantsMap(array $map) + /** + * @return self + */ + public function setParameterOverrides(array $overrides) { - $this->constantsMap = $map; + $this->parameterOverrides = $overrides; + return $this; } - public function getMockConfiguration() + /** + * @param list $whiteListedMethods + * @return self + */ + public function setWhiteListedMethods(array $whiteListedMethods) { - return new MockConfiguration( - $this->targets, - $this->blackListedMethods, - $this->whiteListedMethods, - $this->name, - $this->instanceMock, - $this->parameterOverrides, - $this->mockOriginalDestructor, - $this->constantsMap - ); + $this->whiteListedMethods = $whiteListedMethods; + return $this; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php b/api/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php index fd6a9fa2ae..337c31f644 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/MockDefinition.php @@ -1,51 +1,64 @@ getName()) { - throw new \InvalidArgumentException("MockConfiguration must contain a name"); + if (! $config->getName()) { + throw new InvalidArgumentException('MockConfiguration must contain a name'); } + $this->config = $config; $this->code = $code; } - public function getConfig() - { - return $this->config; - } - + /** + * @return string + */ public function getClassName() { return $this->config->getName(); } + /** + * @return string + */ public function getCode() { return $this->code; } + + /** + * @return MockConfiguration + */ + public function getConfig() + { + return $this->config; + } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php b/api/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php index 204308ab15..424cdc5947 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/MockNameBuilder.php @@ -1,31 +1,33 @@ + */ protected $parts = []; + /** + * @param string $part + */ public function addPart($part) { $this->parts[] = $part; @@ -33,12 +35,15 @@ public function addPart($part) return $this; } + /** + * @return string + */ public function build() { $parts = ['Mockery', static::$mockCounter++]; foreach ($this->parts as $part) { - $parts[] = str_replace("\\", "_", $part); + $parts[] = str_replace('\\', '_', $part); } return implode('_', $parts); diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php b/api/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php index 7009533691..442a713c27 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/Parameter.php @@ -1,43 +1,55 @@ rfp = $rfp; } + /** + * Proxy all method calls to the reflection parameter. + * + * @template TMixed + * @template TResult + * + * @param string $method + * @param array $args + * + * @return TResult + */ public function __call($method, array $args) { - return call_user_func_array(array($this->rfp, $method), $args); + /** @var TResult */ + return $this->rfp->{$method}(...$args); } /** @@ -45,7 +57,7 @@ public function __call($method, array $args) * * This will be null if there was no type, or it was a scalar or a union. * - * @return \ReflectionClass|null + * @return null|ReflectionClass * * @deprecated since 1.3.3 and will be removed in 2.0. */ @@ -53,13 +65,31 @@ public function getClass() { $typeHint = Reflector::getTypeHint($this->rfp, true); - return \class_exists($typeHint) ? DefinedTargetClass::factory($typeHint, false) : null; + return class_exists($typeHint) ? DefinedTargetClass::factory($typeHint, false) : null; + } + + /** + * Get the name of the parameter. + * + * Some internal classes have funny looking definitions! + * + * @return string + */ + public function getName() + { + $name = $this->rfp->getName(); + + if (! $name || $name === '...') { + return 'arg' . self::$parameterCounter++; + } + + return $name; } /** * Get the string representation for the paramater type. * - * @return string|null + * @return null|string */ public function getTypeHint() { @@ -78,23 +108,6 @@ public function getTypeHintAsString() return (string) Reflector::getTypeHint($this->rfp, true); } - /** - * Get the name of the parameter. - * - * Some internal classes have funny looking definitions! - * - * @return string - */ - public function getName() - { - $name = $this->rfp->getName(); - if (!$name || $name == '...') { - $name = 'arg' . self::$parameterCounter++; - } - - return $name; - } - /** * Determine if the parameter is an array. * diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php index 45312573bb..4a7e2a57bb 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/AvoidMethodClashPass.php @@ -1,46 +1,39 @@ getName(); }, $config->getMethodsToMock()); - foreach (["allows", "expects"] as $method) { - if (in_array($method, $names)) { - $code = preg_replace( - "#// start method {$method}.*// end method {$method}#ms", - "", - $code - ); + foreach (['allows', 'expects'] as $method) { + if (in_array($method, $names, true)) { + $code = preg_replace(sprintf('#// start method %s.*// end method %s#ms', $method, $method), '', $code); - $code = str_replace(" implements MockInterface", " implements LegacyMockInterface", $code); + $code = str_replace(' implements MockInterface', ' implements LegacyMockInterface', $code); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php index fd00264ca0..747fdeee50 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/CallTypeHintPass.php @@ -1,29 +1,24 @@ requiresCallTypeHintRemoval()) { @@ -35,7 +30,7 @@ public function apply($code, MockConfiguration $config) } if ($config->requiresCallStaticTypeHintRemoval()) { - $code = str_replace( + return str_replace( 'public static function __callStatic($method, array $args)', 'public static function __callStatic($method, $args)', $code diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassAttributesPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassAttributesPass.php new file mode 100644 index 0000000000..86b157ea1e --- /dev/null +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassAttributesPass.php @@ -0,0 +1,40 @@ +getTargetClass(); + + if (! $class) { + return $code; + } + + /** @var array $attributes */ + $attributes = $class->getAttributes(); + + if ($attributes !== []) { + return str_replace('#[\AllowDynamicProperties]', '#[' . implode(',', $attributes) . ']', $code); + } + + return $code; + } +} diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php index b5a31098ea..0280a06493 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassNamePass.php @@ -1,49 +1,35 @@ getNamespaceName(); - $namespace = ltrim($namespace, "\\"); + $namespace = ltrim($namespace, '\\'); $className = $config->getShortName(); - $code = str_replace( - 'namespace Mockery;', - $namespace ? 'namespace ' . $namespace . ';' : '', - $code - ); - - $code = str_replace( - 'class Mock', - 'class ' . $className, - $code - ); + $code = str_replace('namespace Mockery;', $namespace !== '' ? 'namespace ' . $namespace . ';' : '', $code); - return $code; + return str_replace('class Mock', 'class ' . $className, $code); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php index 1debcbb189..ba4826c6a3 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ClassPass.php @@ -1,34 +1,32 @@ getTargetClass(); - if (!$target) { + if (! $target) { return $code; } @@ -36,18 +34,16 @@ public function apply($code, MockConfiguration $config) return $code; } - $className = ltrim($target->getName(), "\\"); + $className = ltrim($target->getName(), '\\'); - if (!class_exists($className)) { - \Mockery::declareClass($className); + if (! class_exists($className)) { + Mockery::declareClass($className); } - $code = str_replace( - "implements MockInterface", - "extends \\" . $className . " implements MockInterface", + return str_replace( + 'implements MockInterface', + 'extends \\' . $className . ' implements MockInterface', $code ); - - return $code; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php index df5dd8cefb..1088a0de2c 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/ConstantsPass.php @@ -1,33 +1,51 @@ getConstantsMap(); - if (empty($cm)) { + if ($cm === []) { return $code; } - if (!isset($cm[$config->getName()])) { + $name = $config->getName(); + if (! array_key_exists($name, $cm)) { return $code; } - $cm = $cm[$config->getName()]; - $constantsCode = ''; - foreach ($cm as $constant => $value) { + foreach ($cm[$name] as $constant => $value) { $constantsCode .= sprintf("\n const %s = %s;\n", $constant, var_export($value, true)); } - $i = strrpos($code, '}'); - $code = substr_replace($code, $constantsCode, $i); - $code .= "}\n"; + $offset = strrpos($code, '}'); + if ($offset === false) { + return $code; + } - return $code; + return substr_replace($code, $constantsCode, $offset) . '}' . PHP_EOL; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php index 6279147578..78adba487b 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InstanceMockPass.php @@ -1,30 +1,22 @@ rememberMock(\$this); - + \$this->_mockery_constructorCalled(func_get_args()); } MOCK; + /** + * @param string $code + * @return string + */ public function apply($code, MockConfiguration $config) { if ($config->isInstanceMock()) { - $code = $this->appendToClass($code, static::INSTANCE_MOCK_CODE); + return $this->appendToClass($code, static::INSTANCE_MOCK_CODE); } return $code; @@ -76,8 +72,7 @@ public function apply($code, MockConfiguration $config) protected function appendToClass($class, $code) { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; + $lastBrace = strrpos($class, '}'); + return substr($class, 0, $lastBrace) . $code . "\n }\n"; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php index 982956e5c1..4eabcb08b6 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/InterfacePass.php @@ -1,48 +1,41 @@ getTargetInterfaces() as $i) { - $name = ltrim($i->getName(), "\\"); - if (!interface_exists($name)) { - \Mockery::declareInterface($name); + $name = ltrim($i->getName(), '\\'); + if (! interface_exists($name)) { + Mockery::declareInterface($name); } } - $interfaces = array_reduce((array) $config->getTargetInterfaces(), function ($code, $i) { - return $code . ", \\" . ltrim($i->getName(), "\\"); - }, ""); - - $code = str_replace( - "implements MockInterface", - "implements MockInterface" . $interfaces, - $code - ); + $interfaces = array_reduce($config->getTargetInterfaces(), static function ($code, $i) { + return $code . ', \\' . ltrim($i->getName(), '\\'); + }, ''); - return $code; + return str_replace('implements MockInterface', 'implements MockInterface' . $interfaces, $code); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php index ddcdb0b774..f4191fd81d 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MagicMethodTypeHintsPass.php @@ -1,36 +1,36 @@ getMethods(), function (Method $method) { - return in_array($method->getName(), $this->mockMagicMethods); + return in_array($method->getName(), $this->mockMagicMethods, true); }); } + protected function renderTypeHint(Parameter $param) + { + $typeHint = $param->getTypeHint(); + + return $typeHint === null ? '' : sprintf('%s ', $typeHint); + } + /** * Applies type hints of magic methods from * class to the passed code. * * @param int $code - * @param Method $method + * * @return string */ private function applyMagicTypeHints($code, Method $method) { if ($this->isMethodWithinCode($code, $method)) { - $namedParameters = $this->getOriginalParameters( - $code, - $method - ); + $namedParameters = $this->getOriginalParameters($code, $method); $code = preg_replace( $this->getDeclarationRegex($method->getName()), $this->getMethodDeclaration($method, $namedParameters), $code ); } + return $code; } /** - * Checks if the method is declared within code. + * Returns a regex string used to match the + * declaration of some method. * - * @param int $code - * @param Method $method - * @return boolean - */ - private function isMethodWithinCode($code, Method $method) - { - return preg_match( - $this->getDeclarationRegex($method->getName()), - $code - ) == 1; - } - - /** - * Returns the method original parameters, as they're - * described in the $code string. + * @param string $methodName * - * @param int $code - * @param Method $method - * @return array + * @return string */ - private function getOriginalParameters($code, Method $method) + private function getDeclarationRegex($methodName) { - $matches = []; - $parameterMatches = []; - - preg_match( - $this->getDeclarationRegex($method->getName()), - $code, - $matches - ); - - if (count($matches) > 0) { - preg_match_all( - '/(?<=\$)(\w+)+/i', - $matches[0], - $parameterMatches - ); - } - - $groupMatches = end($parameterMatches); - $parameterNames = is_array($groupMatches) ? $groupMatches : [$groupMatches]; - - return $parameterNames; + return sprintf('/public\s+(?:static\s+)?function\s+%s\s*\(.*\)\s*(?=\{)/i', $methodName); } /** * Gets the declaration code, as a string, for the passed method. * - * @param Method $method - * @param array $namedParameters + * @param array $namedParameters + * * @return string */ - private function getMethodDeclaration( - Method $method, - array $namedParameters - ) { + private function getMethodDeclaration(Method $method, array $namedParameters) + { $declaration = 'public'; $declaration .= $method->isStatic() ? ' static' : ''; $declaration .= ' function ' . $method->getName() . '('; foreach ($method->getParameters() as $index => $parameter) { $declaration .= $this->renderTypeHint($parameter); - $name = isset($namedParameters[$index]) ? $namedParameters[$index] : $parameter->getName(); + $name = $namedParameters[$index] ?? $parameter->getName(); $declaration .= '$' . $name; $declaration .= ','; } + $declaration = rtrim($declaration, ','); $declaration .= ') '; @@ -191,22 +159,39 @@ private function getMethodDeclaration( return $declaration; } - protected function renderTypeHint(Parameter $param) + /** + * Returns the method original parameters, as they're + * described in the $code string. + * + * @param int $code + * + * @return array + */ + private function getOriginalParameters($code, Method $method) { - $typeHint = $param->getTypeHint(); + $matches = []; + $parameterMatches = []; - return $typeHint === null ? '' : sprintf('%s ', $typeHint); + preg_match($this->getDeclarationRegex($method->getName()), $code, $matches); + + if ($matches !== []) { + preg_match_all('/(?<=\$)(\w+)+/i', $matches[0], $parameterMatches); + } + + $groupMatches = end($parameterMatches); + + return is_array($groupMatches) ? $groupMatches : [$groupMatches]; } /** - * Returns a regex string used to match the - * declaration of some method. + * Checks if the method is declared within code. * - * @param string $methodName - * @return string + * @param int $code + * + * @return bool */ - private function getDeclarationRegex($methodName) + private function isMethodWithinCode($code, Method $method) { - return "/public\s+(?:static\s+)?function\s+$methodName\s*\(.*\)\s*(?=\{)/i"; + return preg_match($this->getDeclarationRegex($method->getName()), $code) === 1; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php index b0b743df79..68d37f9d13 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/MethodDefinitionPass.php @@ -1,31 +1,40 @@ getMethodsToMock() as $method) { @@ -54,6 +63,12 @@ public function apply($code, MockConfiguration $config) return $code; } + protected function appendToClass($class, $code) + { + $lastBrace = strrpos($class, '}'); + return substr($class, 0, $lastBrace) . $code . "\n }\n"; + } + protected function renderParams(Method $method, $config) { $class = $method->getDeclaringClass(); @@ -65,18 +80,41 @@ protected function renderParams(Method $method, $config) } } - $methodParams = array(); + $methodParams = []; $params = $method->getParameters(); + $isPhp81 = PHP_VERSION_ID >= 80100; foreach ($params as $param) { $paramDef = $this->renderTypeHint($param); $paramDef .= $param->isPassedByReference() ? '&' : ''; $paramDef .= $param->isVariadic() ? '...' : ''; $paramDef .= '$' . $param->getName(); - if (!$param->isVariadic()) { - if (false !== $param->isDefaultValueAvailable()) { + if (! $param->isVariadic()) { + if ($param->isDefaultValueAvailable() !== false) { $defaultValue = $param->getDefaultValue(); - $paramDef .= ' = ' . (is_object($defaultValue) ? get_class($defaultValue) : var_export($defaultValue, true)); + + if (is_object($defaultValue)) { + $prefix = get_class($defaultValue); + if ($isPhp81) { + if (enum_exists($prefix)) { + $prefix = var_export($defaultValue, true); + } elseif ( + ! $param->isDefaultValueConstant() && + // "Parameter #1 [ F\Q\CN $a = new \F\Q\CN(param1, param2: 2) ] + preg_match( + '#\s.*?\s=\snew\s(.*?)\s]$#', + $param->__toString(), + $matches + ) === 1 + ) { + $prefix = 'new ' . $matches[1]; + } + } + } else { + $prefix = var_export($defaultValue, true); + } + + $paramDef .= ' = ' . $prefix; } elseif ($param->isOptional()) { $paramDef .= ' = null'; } @@ -84,6 +122,7 @@ protected function renderParams(Method $method, $config) $methodParams[] = $paramDef; } + return '(' . implode(', ', $methodParams) . ')'; } @@ -94,13 +133,6 @@ protected function renderReturnType(Method $method) return $type ? sprintf(': %s', $type) : ''; } - protected function appendToClass($class, $code) - { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; - } - protected function renderTypeHint(Parameter $param) { $typeHint = $param->getTypeHint(); @@ -131,8 +163,8 @@ private function renderMethodBody($method, $config) $param = $params[$i]; if (strpos($param, '&') !== false) { $body .= << $i) { - \$argv[$i] = {$param}; +if (\$argc > {$i}) { + \$argv[{$i}] = {$param}; } BODY; @@ -143,12 +175,13 @@ private function renderMethodBody($method, $config) $paramCount = count($params); for ($i = 0; $i < $paramCount; ++$i) { $param = $params[$i]; - if (!$param->isPassedByReference()) { + if (! $param->isPassedByReference()) { continue; } + $body .= << $i) { - \$argv[$i] =& \${$param->getName()}; +if (\$argc > {$i}) { + \$argv[{$i}] =& \${$param->getName()}; } BODY; @@ -157,11 +190,10 @@ private function renderMethodBody($method, $config) $body .= "\$ret = {$invoke}(__FUNCTION__, \$argv);\n"; - if (! in_array($method->getReturnType(), ['never','void'], true)) { + if (! in_array($method->getReturnType(), ['never', 'void'], true)) { $body .= "return \$ret;\n"; } - $body .= "}\n"; - return $body; + return $body . "}\n"; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php index f7b72c9fa7..9200873bb9 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/Pass.php @@ -1,21 +1,11 @@ '/public function __wakeup\(\)\s+\{.*?\}/sm', '__toString' => '/public function __toString\(\)\s+(:\s+string)?\s*\{.*?\}/sm', - ); + ]; + /** + * @param string $code + * @return string + */ public function apply($code, MockConfiguration $config) { $target = $config->getTargetClass(); - if (!$target) { + if (! $target instanceof TargetClassInterface) { return $code; } foreach ($target->getMethods() as $method) { - if ($method->isFinal() && isset($this->methods[$method->getName()])) { - $code = preg_replace($this->methods[$method->getName()], '', $code); + if (! $method->isFinal()) { + continue; } + + if (! isset($this->methods[$method->getName()])) { + continue; + } + + $code = preg_replace($this->methods[$method->getName()], '', $code); } return $code; diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php index ed5a4206b4..7fd86e7bc9 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveDestructorPass.php @@ -1,43 +1,37 @@ + * @copyright https://github.com/mockery/mockery/blob/HEAD/COPYRIGHT.md + * @license https://github.com/mockery/mockery/blob/HEAD/LICENSE BSD 3-Clause License + * @link https://github.com/mockery/mockery for the canonical source repository */ namespace Mockery\Generator\StringManipulation\Pass; use Mockery\Generator\MockConfiguration; +use function preg_replace; /** * Remove mock's empty destructor if we tend to use original class destructor */ -class RemoveDestructorPass +class RemoveDestructorPass implements Pass { + /** + * @param string $code + * @return string + */ public function apply($code, MockConfiguration $config) { $target = $config->getTargetClass(); - if (!$target) { + if (! $target) { return $code; } - if (!$config->isMockOriginalDestructor()) { - $code = preg_replace('/public function __destruct\(\)\s+\{.*?\}/sm', '', $code); + if (! $config->isMockOriginalDestructor()) { + return preg_replace('/public function __destruct\(\)\s+\{.*?\}/sm', '', $code); } return $code; diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php index 0abefe2657..5bbb578e38 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/RemoveUnserializeForInternalSerializableClassesPass.php @@ -1,26 +1,19 @@ getTargetClass(); - if (!$target) { + if (! $target) { return $code; } - if (!$target->hasInternalAncestor() || !$target->implementsInterface("Serializable")) { + if (! $target->hasInternalAncestor() || ! $target->implementsInterface('Serializable')) { return $code; } - $code = $this->appendToClass($code, \PHP_VERSION_ID < 80100 ? self::DUMMY_METHOD_DEFINITION_LEGACY : self::DUMMY_METHOD_DEFINITION); - - return $code; + return $this->appendToClass( + $code, + PHP_VERSION_ID < 80100 ? self::DUMMY_METHOD_DEFINITION_LEGACY : self::DUMMY_METHOD_DEFINITION + ); } protected function appendToClass($class, $code) { - $lastBrace = strrpos($class, "}"); - $class = substr($class, 0, $lastBrace) . $code . "\n }\n"; - return $class; + $lastBrace = strrpos($class, '}'); + return substr($class, 0, $lastBrace) . $code . "\n }\n"; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php index f6db5d7491..faf2a90f9c 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulation/Pass/TraitPass.php @@ -1,47 +1,39 @@ getTargetTraits(); - if (empty($traits)) { + if ($traits === []) { return $code; } - $useStatements = array_map(function ($trait) { - return "use \\\\" . ltrim($trait->getName(), "\\") . ";"; + $useStatements = array_map(static function ($trait) { + return 'use \\\\' . ltrim($trait->getName(), '\\') . ';'; }, $traits); - $code = preg_replace( - '/^{$/m', - "{\n " . implode("\n ", $useStatements) . "\n", - $code - ); - - return $code; + return preg_replace('/^{$/m', "{\n " . implode("\n ", $useStatements) . "\n", $code); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php index 4bc415f61a..5cb1421722 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/StringManipulationGenerator.php @@ -1,26 +1,18 @@ + */ + protected $passes = []; /** - * Creates a new StringManipulationGenerator with the default passes - * - * @return StringManipulationGenerator + * @var string */ - public static function withDefaultPasses() - { - return new static([ - new CallTypeHintPass(), - new MagicMethodTypeHintsPass(), - new ClassPass(), - new TraitPass(), - new ClassNamePass(), - new InstanceMockPass(), - new InterfacePass(), - new AvoidMethodClashPass(), - new MethodDefinitionPass(), - new RemoveUnserializeForInternalSerializableClassesPass(), - new RemoveBuiltinMethodsThatAreFinalPass(), - new RemoveDestructorPass(), - new ConstantsPass(), - ]); - } + private $code; + /** + * @param list $passes + */ public function __construct(array $passes) { $this->passes = $passes; + + $this->code = file_get_contents(__DIR__ . '/../Mock.php'); } + /** + * @param Pass $pass + * @return void + */ + public function addPass(Pass $pass) + { + $this->passes[] = $pass; + } + + /** + * @return MockDefinition + */ public function generate(MockConfiguration $config) { - $code = file_get_contents(__DIR__ . '/../Mock.php'); $className = $config->getName() ?: $config->generateName(); $namedConfig = $config->rename($className); + $code = $this->code; foreach ($this->passes as $pass) { $code = $pass->apply($code, $namedConfig); } @@ -82,8 +75,28 @@ public function generate(MockConfiguration $config) return new MockDefinition($namedConfig, $code); } - public function addPass(Pass $pass) + /** + * Creates a new StringManipulationGenerator with the default passes + * + * @return StringManipulationGenerator + */ + public static function withDefaultPasses() { - $this->passes[] = $pass; + return new static([ + new CallTypeHintPass(), + new MagicMethodTypeHintsPass(), + new ClassPass(), + new TraitPass(), + new ClassNamePass(), + new InstanceMockPass(), + new InterfacePass(), + new AvoidMethodClashPass(), + new MethodDefinitionPass(), + new RemoveUnserializeForInternalSerializableClassesPass(), + new RemoveBuiltinMethodsThatAreFinalPass(), + new RemoveDestructorPass(), + new ConstantsPass(), + new ClassAttributesPass(), + ]); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php b/api/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php index 7724412421..730ae1b5f4 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/TargetClassInterface.php @@ -1,21 +1,11 @@ */ - public function getName(); + public function getAttributes(); + + /** + * Returns the targetClass's interfaces. + * + * @return array + */ + public function getInterfaces(); /** * Returns the targetClass's methods. * - * @return array + * @return array */ public function getMethods(); /** - * Returns the targetClass's interfaces. + * Returns the targetClass's name. * - * @return array + * @return class-string */ - public function getInterfaces(); + public function getName(); /** * Returns the targetClass's namespace name. @@ -68,40 +64,41 @@ public function getNamespaceName(); public function getShortName(); /** - * Returns whether the targetClass is abstract. + * Returns whether the targetClass has + * an internal ancestor. * - * @return boolean + * @return bool */ - public function isAbstract(); + public function hasInternalAncestor(); /** - * Returns whether the targetClass is final. + * Returns whether the targetClass is in + * the passed interface. + * + * @param class-string|string $interface * - * @return boolean + * @return bool */ - public function isFinal(); + public function implementsInterface($interface); /** * Returns whether the targetClass is in namespace. * - * @return boolean + * @return bool */ public function inNamespace(); /** - * Returns whether the targetClass is in - * the passed interface. + * Returns whether the targetClass is abstract. * - * @param mixed $interface - * @return boolean + * @return bool */ - public function implementsInterface($interface); + public function isAbstract(); /** - * Returns whether the targetClass has - * an internal ancestor. + * Returns whether the targetClass is final. * - * @return boolean + * @return bool */ - public function hasInternalAncestor(); + public function isFinal(); } diff --git a/api/vendor/mockery/mockery/library/Mockery/Generator/UndefinedTargetClass.php b/api/vendor/mockery/mockery/library/Mockery/Generator/UndefinedTargetClass.php index fb83c61047..ea72202551 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Generator/UndefinedTargetClass.php +++ b/api/vendor/mockery/mockery/library/Mockery/Generator/UndefinedTargetClass.php @@ -1,94 +1,141 @@ name = $name; } - public static function factory($name) + /** + * @return class-string + */ + public function __toString() { - return new self($name); + return $this->name; } - public function getName() + /** + * @param class-string $name + * @return self + */ + public static function factory($name) { - return $this->name; + return new self($name); } - public function isAbstract() + /** + * @return list + */ + public function getAttributes() { - return false; + return []; } - public function isFinal() + /** + * @return list + */ + public function getInterfaces() { - return false; + return []; } + /** + * @return list + */ public function getMethods() { - return array(); + return []; } - public function getInterfaces() + /** + * @return class-string + */ + public function getName() { - return array(); + return $this->name; } + /** + * @return string + */ public function getNamespaceName() { - $parts = explode("\\", ltrim($this->getName(), "\\")); + $parts = explode('\\', ltrim($this->getName(), '\\')); array_pop($parts); - return implode("\\", $parts); + return implode('\\', $parts); } - public function inNamespace() + /** + * @return string + */ + public function getShortName() { - return $this->getNamespaceName() !== ''; + $parts = explode('\\', $this->getName()); + return array_pop($parts); } - public function getShortName() + /** + * @return bool + */ + public function hasInternalAncestor() { - $parts = explode("\\", $this->getName()); - return array_pop($parts); + return false; } + /** + * @param class-string $interface + * @return bool + */ public function implementsInterface($interface) { return false; } - public function hasInternalAncestor() + /** + * @return bool + */ + public function inNamespace() + { + return $this->getNamespaceName() !== ''; + } + + /** + * @return bool + */ + public function isAbstract() { return false; } - public function __toString() + /** + * @return bool + */ + public function isFinal() { - return $this->name; + return false; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php b/api/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php index 1c13c8985c..42df34bea9 100644 --- a/api/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php +++ b/api/vendor/mockery/mockery/library/Mockery/HigherOrderMessage.php @@ -1,33 +1,32 @@ mock = $mock; @@ -35,7 +34,10 @@ public function __construct(MockInterface $mock, $method) } /** - * @return \Mockery\Expectation + * @param string $method + * @param array $args + * + * @return Expectation|ExpectationInterface|HigherOrderMessage */ public function __call($method, $args) { @@ -44,6 +46,7 @@ public function __call($method, $args) } $expectation = $this->mock->{$this->method}($method); + return $expectation->withArgs($args); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Instantiator.php b/api/vendor/mockery/mockery/library/Mockery/Instantiator.php index 0eafff7fe9..11b8e5ba02 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Instantiator.php +++ b/api/vendor/mockery/mockery/library/Mockery/Instantiator.php @@ -1,155 +1,132 @@ . + * @copyright https://github.com/mockery/mockery/blob/HEAD/COPYRIGHT.md + * @license https://github.com/mockery/mockery/blob/HEAD/LICENSE BSD 3-Clause License + * @link https://github.com/mockery/mockery for the canonical source repository */ namespace Mockery; use Closure; +use Exception; +use InvalidArgumentException; use ReflectionClass; use UnexpectedValueException; -use InvalidArgumentException; + +use function class_exists; +use function restore_error_handler; +use function set_error_handler; +use function sprintf; +use function strlen; +use function unserialize; /** - * This is a trimmed down version of https://github.com/doctrine/instantiator, - * basically without the caching - * - * @author Marco Pivetta + * This is a trimmed down version of https://github.com/doctrine/instantiator, without the caching mechanism. */ final class Instantiator { /** - * {@inheritDoc} + * @template TClass of object + * + * @param class-string $className + * + * @throws InvalidArgumentException + * @throws UnexpectedValueException + * + * @return TClass */ - public function instantiate($className) + public function instantiate($className): object { - $factory = $this->buildFactory($className); - $instance = $factory(); + return $this->buildFactory($className)(); + } - return $instance; + /** + * @throws UnexpectedValueException + */ + private function attemptInstantiationViaUnSerialization( + ReflectionClass $reflectionClass, + string $serializedString + ): void { + set_error_handler(static function ($code, $message, $file, $line) use ($reflectionClass, &$error): void { + $msg = sprintf( + 'Could not produce an instance of "%s" via un-serialization, since an error was triggered in file "%s" at line "%d"', + $reflectionClass->getName(), + $file, + $line + ); + + $error = new UnexpectedValueException($msg, 0, new Exception($message, $code)); + }); + + try { + unserialize($serializedString); + } catch (Exception $exception) { + restore_error_handler(); + + throw new UnexpectedValueException( + sprintf( + 'An exception was raised while trying to instantiate an instance of "%s" via un-serialization', + $reflectionClass->getName() + ), + 0, + $exception + ); + } + + restore_error_handler(); + + if ($error instanceof UnexpectedValueException) { + throw $error; + } } /** - * Builds a {@see \Closure} capable of instantiating the given $className without - * invoking its constructor. - * - * @param string $className - * - * @return Closure + * Builds a {@see Closure} capable of instantiating the given $className without invoking its constructor. */ - private function buildFactory($className) + private function buildFactory(string $className): Closure { $reflectionClass = $this->getReflectionClass($className); if ($this->isInstantiableViaReflection($reflectionClass)) { - return function () use ($reflectionClass) { + return static function () use ($reflectionClass) { return $reflectionClass->newInstanceWithoutConstructor(); }; } - $serializedString = sprintf( - 'O:%d:"%s":0:{}', - strlen($className), - $className - ); + $serializedString = sprintf('O:%d:"%s":0:{}', strlen($className), $className); $this->attemptInstantiationViaUnSerialization($reflectionClass, $serializedString); - return function () use ($serializedString) { + return static function () use ($serializedString) { return unserialize($serializedString); }; } /** - * @param string $className - * - * @return ReflectionClass - * * @throws InvalidArgumentException */ - private function getReflectionClass($className) + private function getReflectionClass(string $className): ReflectionClass { if (! class_exists($className)) { - throw new InvalidArgumentException("Class:$className does not exist"); + throw new InvalidArgumentException(sprintf('Class:%s does not exist', $className)); } $reflection = new ReflectionClass($className); if ($reflection->isAbstract()) { - throw new InvalidArgumentException("Class:$className is an abstract class"); + throw new InvalidArgumentException(sprintf('Class:%s is an abstract class', $className)); } return $reflection; } - /** - * @param ReflectionClass $reflectionClass - * @param string $serializedString - * - * @throws UnexpectedValueException - * - * @return void - */ - private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, $serializedString) - { - set_error_handler(function ($code, $message, $file, $line) use ($reflectionClass, & $error) { - $msg = sprintf( - 'Could not produce an instance of "%s" via un-serialization, since an error was triggered in file "%s" at line "%d"', - $reflectionClass->getName(), - $file, - $line - ); - - $error = new UnexpectedValueException($msg, 0, new \Exception($message, $code)); - }); - - try { - unserialize($serializedString); - } catch (\Exception $exception) { - restore_error_handler(); - - throw new UnexpectedValueException("An exception was raised while trying to instantiate an instance of \"{$reflectionClass->getName()}\" via un-serialization", 0, $exception); - } - - restore_error_handler(); - - if ($error) { - throw $error; - } - } - - /** - * @param ReflectionClass $reflectionClass - * - * @return bool - */ - private function isInstantiableViaReflection(ReflectionClass $reflectionClass) - { - return ! ($reflectionClass->isInternal() && $reflectionClass->isFinal()); - } - /** * Verifies whether the given class is to be considered internal - * - * @param ReflectionClass $reflectionClass - * - * @return bool */ - private function hasInternalAncestors(ReflectionClass $reflectionClass) + private function hasInternalAncestors(ReflectionClass $reflectionClass): bool { do { if ($reflectionClass->isInternal()) { @@ -159,4 +136,12 @@ private function hasInternalAncestors(ReflectionClass $reflectionClass) return false; } + + /** + * Verifies if the class is instantiable via reflection + */ + private function isInstantiableViaReflection(ReflectionClass $reflectionClass): bool + { + return ! ($reflectionClass->isInternal() && $reflectionClass->isFinal()); + } } diff --git a/api/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php b/api/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php index ae0cc2a753..5c904e1375 100644 --- a/api/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php +++ b/api/vendor/mockery/mockery/library/Mockery/LegacyMockInterface.php @@ -1,240 +1,258 @@ $args + * + * @return null|Expectation */ - public function shouldIgnoreMissing($returnValue = null); + public function mockery_findExpectation($method, array $args); /** - * @return Mock + * Return the container for this mock + * + * @return Container */ - public function shouldAllowMockingProtectedMethods(); + public function mockery_getContainer(); /** - * Set mock to defer unexpected methods to its parent if possible - * - * @deprecated since 1.4.0. Please use makePartial() instead. + * Get current ordered number * - * @return Mock + * @return int */ - public function shouldDeferMissing(); + public function mockery_getCurrentOrder(); /** - * Set mock to defer unexpected methods to its parent if possible + * Gets the count of expectations for this mock * - * @return Mock + * @return int */ - public function makePartial(); + public function mockery_getExpectationCount(); /** - * @param null|string $method - * @param null|array|Closure $args - * @return mixed + * Return the expectations director for the given method + * + * @param string $method + * + * @return null|ExpectationDirector */ - public function shouldHaveReceived($method, $args = null); + public function mockery_getExpectationsFor($method); /** - * @return mixed + * Fetch array of ordered groups + * + * @return array */ - public function shouldHaveBeenCalled(); + public function mockery_getGroups(); /** - * @param null|string $method - * @param null|array|Closure $args - * @return mixed + * @return string[] */ - public function shouldNotHaveReceived($method, $args = null); + public function mockery_getMockableMethods(); /** - * @param array $args (optional) - * @return mixed + * @return array */ - public function shouldNotHaveBeenCalled(array $args = null); + public function mockery_getMockableProperties(); /** - * In the event shouldReceive() accepting an array of methods/returns - * this method will switch them from normal expectations to default - * expectations + * Return the name for this mock * - * @return self + * @return string */ - public function byDefault(); + public function mockery_getName(); /** - * Iterate across all expectation directors and validate each + * Alternative setup method to constructor * - * @throws \Mockery\CountValidator\Exception - * @return void - */ - public function mockery_verify(); - - /** - * Tear down tasks for this mock + * @param object $partialObject * * @return void */ - public function mockery_teardown(); + public function mockery_init(?Container $container = null, $partialObject = null); /** - * Fetch the next available allocation order number - * - * @return int + * @return bool */ - public function mockery_allocateOrder(); + public function mockery_isAnonymous(); /** - * Set ordering for a group + * Set current ordered number * - * @param mixed $group * @param int $order + * + * @return int */ - public function mockery_setGroup($group, $order); + public function mockery_setCurrentOrder($order); /** - * Fetch array of ordered groups + * Return the expectations director for the given method * - * @return array + * @param string $method + * + * @return null|ExpectationDirector */ - public function mockery_getGroups(); + public function mockery_setExpectationsFor($method, ExpectationDirector $director); /** - * Set current ordered number + * Set ordering for a group * - * @param int $order + * @param string $group + * @param int $order + * + * @return void */ - public function mockery_setCurrentOrder($order); + public function mockery_setGroup($group, $order); /** - * Get current ordered number + * Tear down tasks for this mock * - * @return int + * @return void */ - public function mockery_getCurrentOrder(); + public function mockery_teardown(); /** * Validate the current mock's ordering * * @param string $method - * @param int $order - * @throws \Mockery\Exception + * @param int $order + * + * @throws Exception + * * @return void */ public function mockery_validateOrder($method, $order); /** - * Gets the count of expectations for this mock + * Iterate across all expectation directors and validate each * - * @return int + * @throws Throwable + * + * @return void */ - public function mockery_getExpectationCount(); + public function mockery_verify(); /** - * Return the expectations director for the given method + * Allows additional methods to be mocked that do not explicitly exist on mocked class * - * @var string $method - * @return \Mockery\ExpectationDirector|null + * @param string $method the method name to be mocked + * @return self */ - public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director); + public function shouldAllowMockingMethod($method); /** - * Return the expectations director for the given method + * @return self + */ + public function shouldAllowMockingProtectedMethods(); + + /** + * Set mock to defer unexpected methods to its parent if possible + * + * @deprecated since 1.4.0. Please use makePartial() instead. * - * @var string $method - * @return \Mockery\ExpectationDirector|null + * @return self */ - public function mockery_getExpectationsFor($method); + public function shouldDeferMissing(); /** - * Find an expectation matching the given method and arguments + * @return self + */ + public function shouldHaveBeenCalled(); + + /** + * @template TMixed + * @param string $method + * @param null|array|Closure $args * - * @var string $method - * @var array $args - * @return \Mockery\Expectation|null + * @return self */ - public function mockery_findExpectation($method, array $args); + public function shouldHaveReceived($method, $args = null); /** - * Return the container for this mock + * Set mock to ignore unexpected methods and return Undefined class + * + * @template TReturnValue + * + * @param null|TReturnValue $returnValue the default return value for calls to missing functions on this mock * - * @return \Mockery\Container + * @return self */ - public function mockery_getContainer(); + public function shouldIgnoreMissing($returnValue = null); /** - * Return the name for this mock + * @template TMixed + * @param null|array $args (optional) * - * @return string + * @return self */ - public function mockery_getName(); + public function shouldNotHaveBeenCalled(?array $args = null); /** - * @return array + * @template TMixed + * @param string $method + * @param null|array|Closure $args + * + * @return self */ - public function mockery_getMockableProperties(); + public function shouldNotHaveReceived($method, $args = null); /** - * @return string[] + * Shortcut method for setting an expectation that a method should not be called. + * + * @param string ...$methodNames one or many methods that are expected not to be called in this mock + * + * @return Expectation|ExpectationInterface|HigherOrderMessage */ - public function mockery_getMockableMethods(); + public function shouldNotReceive(...$methodNames); /** - * @return bool + * Set expected method calls + * + * @param string ...$methodNames one or many methods that are expected to be called in this mock + * + * @return Expectation|ExpectationInterface|HigherOrderMessage */ - public function mockery_isAnonymous(); + public function shouldReceive(...$methodNames); } diff --git a/api/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php b/api/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php index e5f78a2001..63247e87de 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php +++ b/api/vendor/mockery/mockery/library/Mockery/Loader/EvalLoader.php @@ -1,36 +1,32 @@ getClassName(), false)) { return; } - eval("?>" . $definition->getCode()); + eval('?>' . $definition->getCode()); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Loader/Loader.php b/api/vendor/mockery/mockery/library/Mockery/Loader/Loader.php index 170ffb6e91..90d568901a 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Loader/Loader.php +++ b/api/vendor/mockery/mockery/library/Mockery/Loader/Loader.php @@ -1,21 +1,11 @@ path = realpath($path) ?: sys_get_temp_dir(); + if ($path === null) { + $path = sys_get_temp_dir(); + } + + $this->path = realpath($path); } + public function __destruct() + { + $files = array_diff(glob($this->path . DIRECTORY_SEPARATOR . 'Mockery_*.php') ?: [], [$this->lastPath]); + + foreach ($files as $file) { + @unlink($file); + } + } + + /** + * Load the given mock definition + * + * @return void + */ public function load(MockDefinition $definition) { if (class_exists($definition->getClassName(), false)) { return; } - $tmpfname = $this->path . DIRECTORY_SEPARATOR . "Mockery_" . uniqid() . ".php"; - file_put_contents($tmpfname, $definition->getCode()); + $this->lastPath = sprintf('%s%s%s.php', $this->path, DIRECTORY_SEPARATOR, uniqid('Mockery_', false)); + + file_put_contents($this->lastPath, $definition->getCode()); - require $tmpfname; + if (file_exists($this->lastPath)) { + require $this->lastPath; + } } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php index e3c3b9439f..f4a698e260 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/AndAnyOtherArgs.php @@ -1,21 +1,11 @@ '; } /** - * Return a string representation of this Matcher + * Check if the actual value matches the expected. * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/Any.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/Any.php index 1ff440b1be..5bb4b2f04c 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/Any.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/Any.php @@ -1,21 +1,11 @@ '; } /** - * Return a string representation of this Matcher + * Check if the actual value matches the expected. * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php index 9663a76d47..0e1ce8c6a0 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyArgs.php @@ -1,40 +1,31 @@ '; } /** - * @inheritdoc + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php index bcce4b7453..425dcae3fc 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/AnyOf.php @@ -1,46 +1,41 @@ _expected, true); + return ''; } /** - * Return a string representation of this Matcher + * Check if the actual value does not match the expected (in this + * case it's specifically NOT expected). * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return in_array($actual, $this->_expected, true); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php index 04408f569e..56e58f6939 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/ArgumentListMatcher.php @@ -1,21 +1,11 @@ _expected; - $result = $closure($actual); - return $result === true; + return ''; } /** - * Return a string representation of this Matcher + * Check if the actual value matches the expected. * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return ($this->_expected)($actual) === true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php index 79afb73a75..9fdeb83151 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/Contains.php @@ -1,31 +1,42 @@ _expected as $v) { + $elements[] = (string) $v; + } + + return ''; + } + /** * Check if the actual value matches the expected. * - * @param mixed $actual + * @template TMixed + * + * @param TMixed $actual + * * @return bool */ public function match(&$actual) @@ -39,26 +50,12 @@ public function match(&$actual) break; } } + if ($match === false) { return false; } } - return true; - } - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - $return = '_expected as $v) { - $elements[] = (string) $v; - } - $return .= implode(', ', $elements) . ']>'; - return $return; + return true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php index 291f422081..3f3a9ef769 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/Ducktype.php @@ -1,53 +1,52 @@ _expected) . ']>'; + } + /** * Check if the actual value matches the expected. * - * @param mixed $actual + * @template TMixed + * + * @param TMixed $actual + * * @return bool */ public function match(&$actual) { - if (!is_object($actual)) { + if (! is_object($actual)) { return false; } + foreach ($this->_expected as $method) { - if (!method_exists($actual, $method)) { + if (! method_exists($actual, $method)) { return false; } } - return true; - } - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '_expected) . ']>'; + return true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php index fa983eaf78..15ef915a5a 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/HasKey.php @@ -1,45 +1,48 @@ _expected, $actual); + return sprintf('', $this->_expected); } /** - * Return a string representation of this Matcher + * Check if the actual value matches the expected. * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return "_expected]>"; + if (! is_array($actual) && ! $actual instanceof ArrayAccess) { + return false; + } + + return array_key_exists($this->_expected, (array) $actual); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php index 8ca6afd138..8d37a5f74a 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/HasValue.php @@ -1,46 +1,47 @@ _expected, $actual); + return '_expected . ']>'; } /** - * Return a string representation of this Matcher + * Check if the actual value matches the expected. * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - $return = '_expected . ']>'; - return $return; + if (! is_array($actual) && ! $actual instanceof ArrayAccess) { + return false; + } + + return in_array($this->_expected, (array) $actual, true); } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/IsEqual.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/IsEqual.php new file mode 100644 index 0000000000..72d1a02f2e --- /dev/null +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/IsEqual.php @@ -0,0 +1,38 @@ +'; + } + + /** + * Check if the actual value matches the expected. + * + * @template TMixed + * + * @param TMixed $actual + * + * @return bool + */ + public function match(&$actual) + { + return $this->_expected == $actual; + } +} diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/IsSame.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/IsSame.php new file mode 100644 index 0000000000..7671448e4a --- /dev/null +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/IsSame.php @@ -0,0 +1,38 @@ +'; + } + + /** + * Check if the actual value matches the expected. + * + * @template TMixed + * + * @param TMixed $actual + * + * @return bool + */ + public function match(&$actual) + { + return $this->_expected === $actual; + } +} diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php index 3233079ec4..813950a5d6 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherAbstract.php @@ -1,58 +1,39 @@ _expected = $expected; } - - /** - * Check if the actual value matches the expected. - * Actual passed by reference to preserve reference trail (where applicable) - * back to the original method parameter. - * - * @param mixed $actual - * @return bool - */ - abstract public function match(&$actual); - - /** - * Return a string representation of this Matcher - * - * @return string - */ - abstract public function __toString(); } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherInterface.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherInterface.php new file mode 100644 index 0000000000..19154eab22 --- /dev/null +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/MatcherInterface.php @@ -0,0 +1,36 @@ +_expected; - return true === call_user_func_array($closure, $actual); + return ''; } /** - * Return a string representation of this Matcher + * Check if the actual value matches the expected. + * Actual passed by reference to preserve reference trail (where applicable) + * back to the original method parameter. * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return ($this->_expected)(...$actual) === true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php index 27b5ec5622..d365bc70a5 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/MustBe.php @@ -1,52 +1,47 @@ '; + } + /** * Check if the actual value matches the expected. * - * @param mixed $actual + * @template TMixed + * + * @param TMixed $actual + * * @return bool */ public function match(&$actual) { - if (!is_object($actual)) { + if (! is_object($actual)) { return $this->_expected === $actual; } return $this->_expected == $actual; } - - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; - } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php index 5e9e4189e7..37438f13b5 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/NoArgs.php @@ -1,40 +1,33 @@ '; } /** - * @inheritdoc + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return count($actual) === 0; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/Not.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/Not.php index 756ccaa5b7..133007eb03 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/Not.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/Not.php @@ -1,21 +1,11 @@ _expected; + return ''; } /** - * Return a string representation of this Matcher + * Check if the actual value does not match the expected (in this + * case it's specifically NOT expected). * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return $actual !== $this->_expected; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php index cd82701573..567b24e01d 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/NotAnyOf.php @@ -1,32 +1,35 @@ '; + } + /** * Check if the actual value does not match the expected (in this * case it's specifically NOT expected). * - * @param mixed $actual + * @template TMixed + * + * @param TMixed $actual + * * @return bool */ public function match(&$actual) @@ -36,16 +39,7 @@ public function match(&$actual) return false; } } - return true; - } - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return ''; + return true; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php index 362c366fd8..b2e84dfaa3 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/Pattern.php @@ -1,45 +1,40 @@ _expected, (string) $actual) >= 1; + return ''; } /** - * Return a string representation of this Matcher + * Check if the actual value matches the expected pattern. * - * @return string + * @template TMixed + * + * @param TMixed $actual + * + * @return bool */ - public function __toString() + public function match(&$actual) { - return ''; + return preg_match($this->_expected, (string) $actual) >= 1; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php index 5e706c81f5..96893fb9f4 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/Subset.php @@ -1,33 +1,28 @@ formatArray($this->expected) . '>'; } /** @@ -58,12 +53,15 @@ public static function loose(array $expected) /** * Check if the actual value matches the expected. * - * @param mixed $actual + * @template TMixed + * + * @param TMixed $actual + * * @return bool */ public function match(&$actual) { - if (!is_array($actual)) { + if (! is_array($actual)) { return false; } @@ -75,18 +73,27 @@ public function match(&$actual) } /** - * Return a string representation of this Matcher + * @param array $expected Expected subset of data + * + * @return Subset + */ + public static function strict(array $expected) + { + return new static($expected, true); + } + + /** + * Recursively format an array into the string representation for this matcher * * @return string */ - public function __toString() + protected function formatArray(array $array) { - $return = 'expected as $k=>$v) { - $elements[] = $k . '=' . (string) $v; + $elements = []; + foreach ($array as $k => $v) { + $elements[] = $k . '=' . (is_array($v) ? $this->formatArray($v) : (string) $v); } - $return .= implode(', ', $elements) . ']>'; - return $return; + + return '[' . implode(', ', $elements) . ']'; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Matcher/Type.php b/api/vendor/mockery/mockery/library/Mockery/Matcher/Type.php index d81ce83428..8265b602ee 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Matcher/Type.php +++ b/api/vendor/mockery/mockery/library/Mockery/Matcher/Type.php @@ -1,56 +1,59 @@ _expected) . '>'; + } + /** * Check if the actual value matches the expected. * - * @param mixed $actual + * @template TMixed + * + * @param TMixed $actual + * * @return bool */ public function match(&$actual) { - if ($this->_expected == 'real') { - $function = 'is_float'; - } else { - $function = 'is_' . strtolower($this->_expected); - } + $function = $this->_expected === 'real' ? 'is_float' : 'is_' . strtolower($this->_expected); + if (function_exists($function)) { return $function($actual); - } elseif (is_string($this->_expected) - && (class_exists($this->_expected) || interface_exists($this->_expected))) { + } + + if (! is_string($this->_expected)) { + return false; + } + + if (class_exists($this->_expected) || interface_exists($this->_expected)) { return $actual instanceof $this->_expected; } - return false; - } - /** - * Return a string representation of this Matcher - * - * @return string - */ - public function __toString() - { - return '<' . ucfirst($this->_expected) . '>'; + return false; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/MethodCall.php b/api/vendor/mockery/mockery/library/Mockery/MethodCall.php index db68fd81f4..f331514f0f 100644 --- a/api/vendor/mockery/mockery/library/Mockery/MethodCall.php +++ b/api/vendor/mockery/mockery/library/Mockery/MethodCall.php @@ -1,43 +1,50 @@ method = $method; $this->args = $args; } - public function getMethod() + /** + * @return array + */ + public function getArgs() { - return $this->method; + return $this->args; } - public function getArgs() + /** + * @return string + */ + public function getMethod() { - return $this->args; + return $this->method; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Mock.php b/api/vendor/mockery/mockery/library/Mockery/Mock.php index c9000838ff..068cce35b3 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Mock.php +++ b/api/vendor/mockery/mockery/library/Mockery/Mock.php @@ -1,32 +1,34 @@ _mockery_container = $container; if (!is_null($partialObject)) { $this->_mockery_partial = $partialObject; @@ -195,6 +201,8 @@ public function mockery_init(\Mockery\Container $container = null, $partialObjec } $this->_mockery_instanceMock = $instanceMock; + + $this->_mockery_parentClass = get_parent_class($this); } /** @@ -202,54 +210,54 @@ public function mockery_init(\Mockery\Container $container = null, $partialObjec * * @param string ...$methodNames one or many methods that are expected to be called in this mock * - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage + * @return ExpectationInterface|Expectation|HigherOrderMessage */ public function shouldReceive(...$methodNames) { - if (count($methodNames) === 0) { - return new HigherOrderMessage($this, "shouldReceive"); + if ($methodNames === []) { + return new HigherOrderMessage($this, 'shouldReceive'); } foreach ($methodNames as $method) { - if ("" == $method) { - throw new \InvalidArgumentException("Received empty method name"); + if ('' === $method) { + throw new \InvalidArgumentException('Received empty method name'); } } $self = $this; $allowMockingProtectedMethods = $this->_mockery_allowMockingProtectedMethods; - - $lastExpectation = \Mockery::parseShouldReturnArgs( + return \Mockery::parseShouldReturnArgs( $this, $methodNames, - function ($method) use ($self, $allowMockingProtectedMethods) { + static function ($method) use ($self, $allowMockingProtectedMethods) { $rm = $self->mockery_getMethod($method); if ($rm) { if ($rm->isPrivate()) { - throw new \InvalidArgumentException("$method() cannot be mocked as it is a private method"); + throw new \InvalidArgumentException($method . '() cannot be mocked as it is a private method'); } + if (!$allowMockingProtectedMethods && $rm->isProtected()) { - throw new \InvalidArgumentException("$method() cannot be mocked as it is a protected method and mocking protected methods is not enabled for the currently used mock object. Use shouldAllowMockingProtectedMethods() to enable mocking of protected methods."); + throw new \InvalidArgumentException($method . '() cannot be mocked as it is a protected method and mocking protected methods is not enabled for the currently used mock object. Use shouldAllowMockingProtectedMethods() to enable mocking of protected methods.'); } } $director = $self->mockery_getExpectationsFor($method); if (!$director) { - $director = new \Mockery\ExpectationDirector($method, $self); + $director = new ExpectationDirector($method, $self); $self->mockery_setExpectationsFor($method, $director); } - $expectation = new \Mockery\Expectation($self, $method); + + $expectation = new Expectation($self, $method); $director->addExpectation($expectation); return $expectation; } ); - return $lastExpectation; } // start method allows /** * @param mixed $something String method name or map of method => return - * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage + * @return self|ExpectationInterface|Expectation|HigherOrderMessage */ public function allows($something = []) { @@ -267,14 +275,14 @@ public function allows($something = []) return $this; } - // end method allows + // end method allows // start method expects /** - /** - * @param mixed $something String method name (optional) - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|ExpectsHigherOrderMessage - */ + /** + * @param mixed $something String method name (optional) + * @return ExpectationInterface|Expectation|ExpectsHigherOrderMessage + */ public function expects($something = null) { if (is_string($something)) { @@ -283,29 +291,32 @@ public function expects($something = null) return new ExpectsHigherOrderMessage($this); } - // end method expects + // end method expects /** * Shortcut method for setting an expectation that a method should not be called. * * @param string ...$methodNames one or many methods that are expected not to be called in this mock - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage + * @return ExpectationInterface|Expectation|HigherOrderMessage */ public function shouldNotReceive(...$methodNames) { - if (count($methodNames) === 0) { - return new HigherOrderMessage($this, "shouldNotReceive"); + if ($methodNames === []) { + return new HigherOrderMessage($this, 'shouldNotReceive'); } - $expectation = call_user_func_array(array($this, 'shouldReceive'), $methodNames); + $expectation = call_user_func_array(function (string $methodNames) { + return $this->shouldReceive($methodNames); + }, $methodNames); $expectation->never(); return $expectation; } /** * Allows additional methods to be mocked that do not explicitly exist on mocked class - * @param String $method name of the method to be mocked - * @return Mock + * + * @param string $method name of the method to be mocked + * @return Mock|MockInterface|LegacyMockInterface */ public function shouldAllowMockingMethod($method) { @@ -317,7 +328,7 @@ public function shouldAllowMockingMethod($method) * Set mock to ignore unexpected methods and return Undefined class * @param mixed $returnValue the default return value for calls to missing functions on this mock * @param bool $recursive Specify if returned mocks should also have shouldIgnoreMissing set - * @return Mock + * @return static */ public function shouldIgnoreMissing($returnValue = null, $recursive = false) { @@ -330,12 +341,12 @@ public function shouldIgnoreMissing($returnValue = null, $recursive = false) public function asUndefined() { $this->_mockery_ignoreMissing = true; - $this->_mockery_defaultReturnValue = new \Mockery\Undefined(); + $this->_mockery_defaultReturnValue = new Undefined(); return $this; } /** - * @return Mock + * @return static */ public function shouldAllowMockingProtectedMethods() { @@ -360,7 +371,7 @@ public function shouldAllowMockingProtectedMethods() * * @deprecated 2.0.0 Please use makePartial() instead * - * @return Mock + * @return static */ public function shouldDeferMissing() { @@ -373,7 +384,7 @@ public function shouldDeferMissing() * It was an alias for shouldDeferMissing(), which will be removed * in 2.0.0. * - * @return Mock + * @return static */ public function makePartial() { @@ -396,6 +407,7 @@ public function byDefault() $exp->byDefault(); } } + return $this; } @@ -415,15 +427,16 @@ public static function __callStatic($method, array $args) /** * Forward calls to this magic method to the __call method */ + #[\ReturnTypeWillChange] public function __toString() { - return $this->__call('__toString', array()); + return $this->__call('__toString', []); } /** * Iterate across all expectation directors and validate each * - * @throws \Mockery\CountValidator\Exception + * @throws Exception * @return void */ public function mockery_verify() @@ -431,10 +444,12 @@ public function mockery_verify() if ($this->_mockery_verified) { return; } - if (isset($this->_mockery_ignoreVerification) + + if (property_exists($this, '_mockery_ignoreVerification') && $this->_mockery_ignoreVerification !== null && $this->_mockery_ignoreVerification == true) { return; } + $this->_mockery_verified = true; foreach ($this->_mockery_expectations as $director) { $director->verify(); @@ -467,7 +482,7 @@ public function mockery_teardown() */ public function mockery_allocateOrder() { - $this->_mockery_allocatedOrder += 1; + ++$this->_mockery_allocatedOrder; return $this->_mockery_allocatedOrder; } @@ -524,8 +539,8 @@ public function mockery_getCurrentOrder() public function mockery_validateOrder($method, $order) { if ($order < $this->_mockery_currentOrder) { - $exception = new \Mockery\Exception\InvalidOrderException( - 'Method ' . __CLASS__ . '::' . $method . '()' + $exception = new InvalidOrderException( + 'Method ' . self::class . '::' . $method . '()' . ' called out of order: expected order ' . $order . ', was ' . $this->_mockery_currentOrder ); @@ -535,6 +550,7 @@ public function mockery_validateOrder($method, $order) ->setActualOrder($this->_mockery_currentOrder); throw $exception; } + $this->mockery_setCurrentOrder($order); } @@ -549,6 +565,7 @@ public function mockery_getExpectationCount() foreach ($this->_mockery_expectations as $director) { $count += $director->getExpectationCount(); } + return $count; } @@ -556,9 +573,9 @@ public function mockery_getExpectationCount() * Return the expectations director for the given method * * @var string $method - * @return \Mockery\ExpectationDirector|null + * @return ExpectationDirector|null */ - public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector $director) + public function mockery_setExpectationsFor($method, ExpectationDirector $director) { $this->_mockery_expectations[$method] = $director; } @@ -567,7 +584,7 @@ public function mockery_setExpectationsFor($method, \Mockery\ExpectationDirector * Return the expectations director for the given method * * @var string $method - * @return \Mockery\ExpectationDirector|null + * @return ExpectationDirector|null */ public function mockery_getExpectationsFor($method) { @@ -581,13 +598,14 @@ public function mockery_getExpectationsFor($method) * * @var string $method * @var array $args - * @return \Mockery\Expectation|null + * @return Expectation|null */ public function mockery_findExpectation($method, array $args) { if (!isset($this->_mockery_expectations[$method])) { return null; } + $director = $this->_mockery_expectations[$method]; return $director->findExpectation($args); @@ -596,7 +614,7 @@ public function mockery_findExpectation($method, array $args) /** * Return the container for this mock * - * @return \Mockery\Container + * @return Container */ public function mockery_getContainer() { @@ -610,7 +628,7 @@ public function mockery_getContainer() */ public function mockery_getName() { - return __CLASS__; + return self::class; } /** @@ -623,11 +641,19 @@ public function mockery_getMockableProperties() public function __isset($name) { - if (false === stripos($name, '_mockery_') && get_parent_class($this) && method_exists(get_parent_class($this), '__isset')) { - return call_user_func(get_parent_class($this) . '::__isset', $name); + if (false !== stripos($name, '_mockery_')) { + return false; + } + + if (!$this->_mockery_parentClass) { + return false; } - return false; + if (!method_exists($this->_mockery_parentClass, '__isset')) { + return false; + } + + return call_user_func($this->_mockery_parentClass . '::__isset', $name); } public function mockery_getExpectations() @@ -646,10 +672,11 @@ public function mockery_getExpectations() */ public function mockery_callSubjectMethod($name, array $args) { - if (!method_exists($this, $name) && get_parent_class($this) && method_exists(get_parent_class($this), '__call')) { - return call_user_func(get_parent_class($this) . '::__call', $name, $args); + if (!method_exists($this, $name) && $this->_mockery_parentClass && method_exists($this->_mockery_parentClass, '__call')) { + return call_user_func($this->_mockery_parentClass . '::__call', $name, $args); } - return call_user_func_array(get_parent_class($this) . '::' . $name, $args); + + return call_user_func_array($this->_mockery_parentClass . '::' . $name, $args); } /** @@ -668,7 +695,7 @@ public function mockery_isAnonymous() $rfc = new \ReflectionClass($this); // PHP 8 has Stringable interface - $interfaces = array_filter($rfc->getInterfaces(), function ($i) { + $interfaces = array_filter($rfc->getInterfaces(), static function ($i) { return $i->getName() !== 'Stringable'; }); @@ -729,6 +756,8 @@ public function mockery_returnValueForMethod($name) case 'int': return 0; case 'float': return 0.0; case 'bool': return false; + case 'true': return true; + case 'false': return false; case 'array': case 'iterable': @@ -736,12 +765,14 @@ public function mockery_returnValueForMethod($name) case 'callable': case '\Closure': - return function () { + return static function () : void { }; case '\Traversable': case '\Generator': - $generator = function () { yield; }; + $generator = static function () { + yield; + }; return $generator(); case 'void': @@ -755,6 +786,7 @@ public function mockery_returnValueForMethod($name) if ($this->_mockery_ignoreMissingRecursive) { $mock->shouldIgnoreMissing($this->_mockery_defaultReturnValue, true); } + return $mock; default: @@ -762,6 +794,7 @@ public function mockery_returnValueForMethod($name) if ($this->_mockery_ignoreMissingRecursive) { $mock->shouldIgnoreMissing($this->_mockery_defaultReturnValue, true); } + return $mock; } } @@ -769,65 +802,67 @@ public function mockery_returnValueForMethod($name) public function shouldHaveReceived($method = null, $args = null) { if ($method === null) { - return new HigherOrderMessage($this, "shouldHaveReceived"); + return new HigherOrderMessage($this, 'shouldHaveReceived'); } - $expectation = new \Mockery\VerificationExpectation($this, $method); + $expectation = new VerificationExpectation($this, $method); if (null !== $args) { $expectation->withArgs($args); } + $expectation->atLeast()->once(); - $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); - $this->_mockery_expectations_count++; + $director = new VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); + ++$this->_mockery_expectations_count; $director->verify(); return $director; } public function shouldHaveBeenCalled() { - return $this->shouldHaveReceived("__invoke"); + return $this->shouldHaveReceived('__invoke'); } public function shouldNotHaveReceived($method = null, $args = null) { if ($method === null) { - return new HigherOrderMessage($this, "shouldNotHaveReceived"); + return new HigherOrderMessage($this, 'shouldNotHaveReceived'); } - $expectation = new \Mockery\VerificationExpectation($this, $method); + $expectation = new VerificationExpectation($this, $method); if (null !== $args) { $expectation->withArgs($args); } + $expectation->never(); - $director = new \Mockery\VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); - $this->_mockery_expectations_count++; + $director = new VerificationDirector($this->_mockery_getReceivedMethodCalls(), $expectation); + ++$this->_mockery_expectations_count; $director->verify(); return null; } - public function shouldNotHaveBeenCalled(array $args = null) + public function shouldNotHaveBeenCalled(?array $args = null) { - return $this->shouldNotHaveReceived("__invoke", $args); + return $this->shouldNotHaveReceived('__invoke', $args); } protected static function _mockery_handleStaticMethodCall($method, array $args) { - $associatedRealObject = \Mockery::fetchMock(__CLASS__); + $associatedRealObject = \Mockery::fetchMock(self::class); try { return $associatedRealObject->__call($method, $args); - } catch (BadMethodCallException $e) { + } catch (BadMethodCallException $badMethodCallException) { throw new BadMethodCallException( 'Static method ' . $associatedRealObject->mockery_getName() . '::' . $method . '() does not exist on this mock object', 0, - $e + $badMethodCallException ); } } protected function _mockery_getReceivedMethodCalls() { - return $this->_mockery_receivedMethodCalls ?: $this->_mockery_receivedMethodCalls = new \Mockery\ReceivedMethodCalls(); + return $this->_mockery_receivedMethodCalls ?: $this->_mockery_receivedMethodCalls = new ReceivedMethodCalls(); } /** @@ -841,6 +876,7 @@ protected function _mockery_constructorCalled(array $args) if (!isset($this->_mockery_expectations['__construct']) /* _mockery_handleMethodCall runs the other checks */) { return; } + $this->_mockery_handleMethodCall('__construct', $args); } @@ -853,16 +889,12 @@ protected function _mockery_findExpectedMethodHandler($method) $lowerCasedMockeryExpectations = array_change_key_case($this->_mockery_expectations, CASE_LOWER); $lowerCasedMethod = strtolower($method); - if (isset($lowerCasedMockeryExpectations[$lowerCasedMethod])) { - return $lowerCasedMockeryExpectations[$lowerCasedMethod]; - } - - return null; + return $lowerCasedMockeryExpectations[$lowerCasedMethod] ?? null; } protected function _mockery_handleMethodCall($method, array $args) { - $this->_mockery_getReceivedMethodCalls()->push(new \Mockery\MethodCall($method, $args)); + $this->_mockery_getReceivedMethodCalls()->push(new MethodCall($method, $args)); $rm = $this->mockery_getMethod($method); if ($rm && $rm->isProtected() && !$this->_mockery_allowMockingProtectedMethods) { @@ -879,7 +911,11 @@ protected function _mockery_handleMethodCall($method, array $args) // noop - there is no hasPrototype method } - return call_user_func_array(get_parent_class($this) . '::' . $method, $args); + if (null === $this->_mockery_parentClass) { + $this->_mockery_parentClass = get_parent_class($this); + } + + return call_user_func_array($this->_mockery_parentClass . '::' . $method, $args); } $handler = $this->_mockery_findExpectedMethodHandler($method); @@ -887,7 +923,7 @@ protected function _mockery_handleMethodCall($method, array $args) if ($handler !== null && !$this->_mockery_disableExpectationMatching) { try { return $handler->call($args); - } catch (\Mockery\Exception\NoMatchingExpectationException $e) { + } catch (NoMatchingExpectationException $e) { if (!$this->_mockery_ignoreMissing && !$this->_mockery_deferMissing) { throw $e; } @@ -895,36 +931,43 @@ protected function _mockery_handleMethodCall($method, array $args) } if (!is_null($this->_mockery_partial) && - (method_exists($this->_mockery_partial, $method) || method_exists($this->_mockery_partial, '__call')) - ) { - return call_user_func_array(array($this->_mockery_partial, $method), $args); - } elseif ($this->_mockery_deferMissing && is_callable(get_parent_class($this) . '::' . $method) - && (!$this->hasMethodOverloadingInParentClass() || (get_parent_class($this) && method_exists(get_parent_class($this), $method)))) { - return call_user_func_array(get_parent_class($this) . '::' . $method, $args); - } elseif ($this->_mockery_deferMissing && get_parent_class($this) && method_exists(get_parent_class($this), '__call')) { - return call_user_func(get_parent_class($this) . '::__call', $method, $args); - } elseif ($method == '__toString') { + (method_exists($this->_mockery_partial, $method) || method_exists($this->_mockery_partial, '__call'))) { + return $this->_mockery_partial->{$method}(...$args); + } + + if ($this->_mockery_deferMissing && is_callable($this->_mockery_parentClass . '::' . $method) + && (!$this->hasMethodOverloadingInParentClass() || ($this->_mockery_parentClass && method_exists($this->_mockery_parentClass, $method)))) { + return call_user_func_array($this->_mockery_parentClass . '::' . $method, $args); + } + + if ($this->_mockery_deferMissing && $this->_mockery_parentClass && method_exists($this->_mockery_parentClass, '__call')) { + return call_user_func($this->_mockery_parentClass . '::__call', $method, $args); + } + + if ($method === '__toString') { // __toString is special because we force its addition to the class API regardless of the // original implementation. Thus, we should always return a string rather than honor // _mockery_ignoreMissing and break the API with an error. - return sprintf("%s#%s", __CLASS__, spl_object_hash($this)); - } elseif ($this->_mockery_ignoreMissing) { - if (\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() || (!is_null($this->_mockery_partial) && method_exists($this->_mockery_partial, $method)) || is_callable(get_parent_class($this) . '::' . $method)) { - if ($this->_mockery_defaultReturnValue instanceof \Mockery\Undefined) { - return call_user_func_array(array($this->_mockery_defaultReturnValue, $method), $args); - } elseif (null === $this->_mockery_defaultReturnValue) { - return $this->mockery_returnValueForMethod($method); - } + return sprintf('%s#%s', self::class, spl_object_hash($this)); + } - return $this->_mockery_defaultReturnValue; + if ($this->_mockery_ignoreMissing && (\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() || (!is_null($this->_mockery_partial) && method_exists($this->_mockery_partial, $method)) || is_callable($this->_mockery_parentClass . '::' . $method))) { + if ($this->_mockery_defaultReturnValue instanceof Undefined) { + return $this->_mockery_defaultReturnValue->{$method}(...$args); } + + if (null === $this->_mockery_defaultReturnValue) { + return $this->mockery_returnValueForMethod($method); + } + + return $this->_mockery_defaultReturnValue; } - $message = 'Method ' . __CLASS__ . '::' . $method . + $message = 'Method ' . self::class . '::' . $method . '() does not exist on this mock object'; if (!is_null($rm)) { - $message = 'Received ' . __CLASS__ . + $message = 'Received ' . self::class . '::' . $method . '(), but no expectations were specified'; } @@ -945,7 +988,7 @@ protected function mockery_getMethods() return static::$_mockery_methods; } - if (isset($this->_mockery_partial)) { + if ($this->_mockery_partial !== null) { $reflected = new \ReflectionObject($this->_mockery_partial); } else { $reflected = new \ReflectionClass($this); @@ -957,7 +1000,7 @@ protected function mockery_getMethods() private function hasMethodOverloadingInParentClass() { // if there's __call any name would be callable - return is_callable(get_parent_class($this) . '::aFunctionNameThatNoOneWouldEverUseInRealLife12345'); + return is_callable($this->_mockery_parentClass . '::aFunctionNameThatNoOneWouldEverUseInRealLife12345'); } /** @@ -966,10 +1009,10 @@ private function hasMethodOverloadingInParentClass() private function getNonPublicMethods() { return array_map( - function ($method) { + static function ($method) { return $method->getName(); }, - array_filter($this->mockery_getMethods(), function ($method) { + array_filter($this->mockery_getMethods(), static function ($method) { return !$method->isPublic(); }) ); diff --git a/api/vendor/mockery/mockery/library/Mockery/MockInterface.php b/api/vendor/mockery/mockery/library/Mockery/MockInterface.php index 7c1774b49d..9dc5364763 100644 --- a/api/vendor/mockery/mockery/library/Mockery/MockInterface.php +++ b/api/vendor/mockery/mockery/library/Mockery/MockInterface.php @@ -1,38 +1,28 @@ return - * @return self|\Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage + * @param mixed $something String method name or map of method => return + * + * @return Expectation|ExpectationInterface|HigherOrderMessage|self */ public function allows($something = []); /** - * @param mixed $something String method name (optional) - * @return \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\ExpectsHigherOrderMessage + * @param mixed $something String method name (optional) + * + * @return Expectation|ExpectationInterface|ExpectsHigherOrderMessage */ public function expects($something = null); } diff --git a/api/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php b/api/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php index b0eea66237..aef28b77cc 100644 --- a/api/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php +++ b/api/vendor/mockery/mockery/library/Mockery/QuickDefinitionsConfiguration.php @@ -1,30 +1,21 @@ matchArgs($methodCall->getArgs())) { + if (! $expectation->matchArgs($methodCall->getArgs())) { continue; } diff --git a/api/vendor/mockery/mockery/library/Mockery/Reflector.php b/api/vendor/mockery/mockery/library/Mockery/Reflector.php index 4e8c6e1fcd..8e4fc1582a 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Reflector.php +++ b/api/vendor/mockery/mockery/library/Mockery/Reflector.php @@ -1,107 +1,108 @@ */ - public static function isArray(\ReflectionParameter $param) - { - $type = $param->getType(); - - return $type instanceof \ReflectionNamedType && $type->getName(); - } + public const BUILTIN_TYPES = ['array', 'bool', 'int', 'float', 'null', 'object', 'string']; /** - * Compute the string representation for the paramater type. - * - * @param \ReflectionParameter $param - * @param bool $withoutNullable + * List of reserved words. * - * @return string|null + * @var list */ - public static function getTypeHint(\ReflectionParameter $param, $withoutNullable = false) - { - if (!$param->hasType()) { - return null; - } + public const RESERVED_WORDS = ['bool', 'true', 'false', 'float', 'int', 'iterable', 'mixed', 'never', 'null', 'object', 'string', 'void']; - $type = $param->getType(); - $declaringClass = $param->getDeclaringClass(); - $typeHint = self::typeToString($type, $declaringClass); + /** + * Iterable. + * + * @var list + */ + private const ITERABLE = ['iterable']; - return (!$withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; - } + /** + * Traversable array. + * + * @var list + */ + private const TRAVERSABLE_ARRAY = ['\Traversable', 'array']; /** * Compute the string representation for the return type. * - * @param \ReflectionParameter $param * @param bool $withoutNullable * - * @return string|null + * @return null|string */ - public static function getReturnType(\ReflectionMethod $method, $withoutNullable = false) + public static function getReturnType(ReflectionMethod $method, $withoutNullable = false) { $type = $method->getReturnType(); - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { + if (! $type instanceof ReflectionType && method_exists($method, 'getTentativeReturnType')) { $type = $method->getTentativeReturnType(); } - if (is_null($type)) { + if (! $type instanceof ReflectionType) { return null; } - $typeHint = self::typeToString($type, $method->getDeclaringClass()); + $typeHint = self::getTypeFromReflectionType($type, $method->getDeclaringClass()); - return (!$withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; + return (! $withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; } /** * Compute the string representation for the simplest return type. * - * @param \ReflectionParameter $param - * - * @return string|null + * @return null|string */ - public static function getSimplestReturnType(\ReflectionMethod $method) + public static function getSimplestReturnType(ReflectionMethod $method) { $type = $method->getReturnType(); - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { + if (! $type instanceof ReflectionType && method_exists($method, 'getTentativeReturnType')) { $type = $method->getTentativeReturnType(); } - if (is_null($type) || $type->allowsNull()) { + if (! $type instanceof ReflectionType || $type->allowsNull()) { return null; } @@ -123,32 +124,139 @@ public static function getSimplestReturnType(\ReflectionMethod $method) } /** - * Get the string representation of the given type. + * Compute the string representation for the paramater type. * - * @param \ReflectionType $type - * @param string $declaringClass + * @param bool $withoutNullable * - * @return string|null + * @return null|string */ - private static function typeToString(\ReflectionType $type, \ReflectionClass $declaringClass) + public static function getTypeHint(ReflectionParameter $param, $withoutNullable = false) { - return \implode('|', \array_map(function (array $typeInformation) { - return $typeInformation['typeHint']; - }, self::getTypeInformation($type, $declaringClass))); + if (! $param->hasType()) { + return null; + } + + $type = $param->getType(); + $declaringClass = $param->getDeclaringClass(); + $typeHint = self::getTypeFromReflectionType($type, $declaringClass); + + return (! $withoutNullable && $type->allowsNull()) ? self::formatNullableType($typeHint) : $typeHint; } /** - * Get the string representation of the given type. + * Determine if the parameter is typed as an array. * - * @param \ReflectionType $type - * @param \ReflectionClass $declaringClass + * @return bool + */ + public static function isArray(ReflectionParameter $param) + { + $type = $param->getType(); + + return $type instanceof ReflectionNamedType && $type->getName(); + } + + /** + * Determine if the given type is a reserved word. + */ + public static function isReservedWord(string $type): bool + { + return in_array(strtolower($type), self::RESERVED_WORDS, true); + } + + /** + * Format the given type as a nullable type. + */ + private static function formatNullableType(string $typeHint): string + { + if ($typeHint === 'mixed') { + return $typeHint; + } + + if (strpos($typeHint, 'null') !== false) { + return $typeHint; + } + + if (PHP_VERSION_ID < 80000) { + return sprintf('?%s', $typeHint); + } + + return sprintf('%s|null', $typeHint); + } + + private static function getTypeFromReflectionType(ReflectionType $type, ReflectionClass $declaringClass): string + { + if ($type instanceof ReflectionNamedType) { + $typeHint = $type->getName(); + + if ($type->isBuiltin()) { + return $typeHint; + } + + if ($typeHint === 'static') { + return $typeHint; + } + + // 'self' needs to be resolved to the name of the declaring class + if ($typeHint === 'self') { + $typeHint = $declaringClass->getName(); + } + + // 'parent' needs to be resolved to the name of the parent class + if ($typeHint === 'parent') { + $typeHint = $declaringClass->getParentClass()->getName(); + } + + // class names need prefixing with a slash + return sprintf('\\%s', $typeHint); + } + + if ($type instanceof ReflectionIntersectionType) { + $types = array_map( + static function (ReflectionType $type) use ($declaringClass): string { + return self::getTypeFromReflectionType($type, $declaringClass); + }, + $type->getTypes() + ); + + return implode('&', $types); + } + + if ($type instanceof ReflectionUnionType) { + $types = array_map( + static function (ReflectionType $type) use ($declaringClass): string { + return self::getTypeFromReflectionType($type, $declaringClass); + }, + $type->getTypes() + ); + + $intersect = array_intersect(self::TRAVERSABLE_ARRAY, $types); + if ($intersect === self::TRAVERSABLE_ARRAY) { + $types = array_merge(self::ITERABLE, array_diff($types, self::TRAVERSABLE_ARRAY)); + } + + return implode( + '|', + array_map( + static function (string $type): string { + return strpos($type, '&') === false ? $type : sprintf('(%s)', $type); + }, + $types + ) + ); + } + + throw new InvalidArgumentException('Unknown ReflectionType: ' . get_debug_type($type)); + } + + /** + * Get the string representation of the given type. * - * @return list + * @return list */ - private static function getTypeInformation(\ReflectionType $type, \ReflectionClass $declaringClass) + private static function getTypeInformation(ReflectionType $type, ReflectionClass $declaringClass): array { // PHP 8 union types and PHP 8.1 intersection types can be recursively processed - if ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) { + if ($type instanceof ReflectionUnionType || $type instanceof ReflectionIntersectionType) { $types = []; foreach ($type->getTypes() as $innterType) { @@ -172,7 +280,7 @@ private static function getTypeInformation(\ReflectionType $type, \ReflectionCla return [ [ 'typeHint' => $typeHint, - 'isPrimitive' => in_array($typeHint, ['array', 'bool', 'int', 'float', 'null', 'object', 'string']), + 'isPrimitive' => in_array($typeHint, self::BUILTIN_TYPES, true), ], ]; } @@ -205,20 +313,4 @@ private static function getTypeInformation(\ReflectionType $type, \ReflectionCla ], ]; } - - /** - * Format the given type as a nullable type. - * - * @param string $typeHint - * - * @return string - */ - private static function formatNullableType($typeHint) - { - if (\PHP_VERSION_ID < 80000) { - return sprintf('?%s', $typeHint); - } - - return $typeHint === 'mixed' ? 'mixed' : sprintf('%s|null', $typeHint); - } } diff --git a/api/vendor/mockery/mockery/library/Mockery/Undefined.php b/api/vendor/mockery/mockery/library/Mockery/Undefined.php index 53b05e9c5f..ca3ace4671 100644 --- a/api/vendor/mockery/mockery/library/Mockery/Undefined.php +++ b/api/vendor/mockery/mockery/library/Mockery/Undefined.php @@ -1,32 +1,25 @@ receivedMethodCalls = $receivedMethodCalls; $this->expectation = $expectation; } - public function verify() + /** + * @return self + */ + public function atLeast() { - return $this->receivedMethodCalls->verify($this->expectation); + return $this->cloneWithoutCountValidatorsApplyAndVerify('atLeast', []); } - public function with(...$args) + /** + * @return self + */ + public function atMost() { - return $this->cloneApplyAndVerify("with", $args); + return $this->cloneWithoutCountValidatorsApplyAndVerify('atMost', []); } - public function withArgs($args) + /** + * @param int $minimum + * @param int $maximum + * + * @return self + */ + public function between($minimum, $maximum) { - return $this->cloneApplyAndVerify("withArgs", array($args)); + return $this->cloneWithoutCountValidatorsApplyAndVerify('between', [$minimum, $maximum]); } - public function withNoArgs() + /** + * @return self + */ + public function once() { - return $this->cloneApplyAndVerify("withNoArgs", array()); + return $this->cloneWithoutCountValidatorsApplyAndVerify('once', []); } - public function withAnyArgs() + /** + * @param int $limit + * + * @return self + */ + public function times($limit = null) { - return $this->cloneApplyAndVerify("withAnyArgs", array()); + return $this->cloneWithoutCountValidatorsApplyAndVerify('times', [$limit]); } - public function times($limit = null) + /** + * @return self + */ + public function twice() { - return $this->cloneWithoutCountValidatorsApplyAndVerify("times", array($limit)); + return $this->cloneWithoutCountValidatorsApplyAndVerify('twice', []); } - public function once() + public function verify() { - return $this->cloneWithoutCountValidatorsApplyAndVerify("once", array()); + $this->receivedMethodCalls->verify($this->expectation); } - public function twice() + /** + * @template TArgs + * + * @param TArgs $args + * + * @return self + */ + public function with(...$args) { - return $this->cloneWithoutCountValidatorsApplyAndVerify("twice", array()); + return $this->cloneApplyAndVerify('with', $args); } - public function atLeast() + /** + * @return self + */ + public function withAnyArgs() { - return $this->cloneWithoutCountValidatorsApplyAndVerify("atLeast", array()); + return $this->cloneApplyAndVerify('withAnyArgs', []); } - public function atMost() + /** + * @template TArgs + * + * @param TArgs $args + * + * @return self + */ + public function withArgs($args) { - return $this->cloneWithoutCountValidatorsApplyAndVerify("atMost", array()); + return $this->cloneApplyAndVerify('withArgs', [$args]); } - public function between($minimum, $maximum) + /** + * @return self + */ + public function withNoArgs() { - return $this->cloneWithoutCountValidatorsApplyAndVerify("between", array($minimum, $maximum)); + return $this->cloneApplyAndVerify('withNoArgs', []); } - protected function cloneWithoutCountValidatorsApplyAndVerify($method, $args) + /** + * @param string $method + * @param array $args + * + * @return self + */ + protected function cloneApplyAndVerify($method, $args) { - $expectation = clone $this->expectation; - $expectation->clearCountValidators(); - call_user_func_array(array($expectation, $method), $args); - $director = new VerificationDirector($this->receivedMethodCalls, $expectation); - $director->verify(); - return $director; + $verificationExpectation = clone $this->expectation; + + $verificationExpectation->{$method}(...$args); + + $verificationDirector = new self($this->receivedMethodCalls, $verificationExpectation); + + $verificationDirector->verify(); + + return $verificationDirector; } - protected function cloneApplyAndVerify($method, $args) + /** + * @param string $method + * @param array $args + * + * @return self + */ + protected function cloneWithoutCountValidatorsApplyAndVerify($method, $args) { - $expectation = clone $this->expectation; - call_user_func_array(array($expectation, $method), $args); - $director = new VerificationDirector($this->receivedMethodCalls, $expectation); - $director->verify(); - return $director; + $verificationExpectation = clone $this->expectation; + + $verificationExpectation->clearCountValidators(); + + $verificationExpectation->{$method}(...$args); + + $verificationDirector = new self($this->receivedMethodCalls, $verificationExpectation); + + $verificationDirector->verify(); + + return $verificationDirector; } } diff --git a/api/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php b/api/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php index 3844a090af..9e36f6c613 100644 --- a/api/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php +++ b/api/vendor/mockery/mockery/library/Mockery/VerificationExpectation.php @@ -1,35 +1,29 @@ _countValidators = array(); - } - public function __clone() { parent::__clone(); + $this->_actualCount = 0; } + + /** + * @return void + */ + public function clearCountValidators() + { + $this->_countValidators = []; + } } diff --git a/api/vendor/mockery/mockery/library/helpers.php b/api/vendor/mockery/mockery/library/helpers.php index 0756a328d1..8f15857aa3 100644 --- a/api/vendor/mockery/mockery/library/helpers.php +++ b/api/vendor/mockery/mockery/library/helpers.php @@ -1,64 +1,76 @@ |TMock|Closure(LegacyMockInterface&MockInterface&TMock):LegacyMockInterface&MockInterface&TMock|array> $args + * + * @return LegacyMockInterface&MockInterface&TMock + */ function mock(...$args) { return Mockery::mock(...$args); } } -if (!function_exists("spy")) { +if (! \function_exists('spy')) { + /** + * @template TSpy of object + * + * @param array|TSpy|Closure(LegacyMockInterface&MockInterface&TSpy):LegacyMockInterface&MockInterface&TSpy|array> $args + * + * @return LegacyMockInterface&MockInterface&TSpy + */ function spy(...$args) { return Mockery::spy(...$args); } } -if (!function_exists("namedMock")) { +if (! \function_exists('namedMock')) { + /** + * @template TNamedMock of object + * + * @param array|TNamedMock|array> $args + * + * @return LegacyMockInterface&MockInterface&TNamedMock + */ function namedMock(...$args) { return Mockery::namedMock(...$args); } } -if (!function_exists("anyArgs")) { - function anyArgs() +if (! \function_exists('anyArgs')) { + function anyArgs(): AnyArgs { return new AnyArgs(); } } -if (!function_exists("andAnyOtherArgs")) { - function andAnyOtherArgs() +if (! \function_exists('andAnyOtherArgs')) { + function andAnyOtherArgs(): AndAnyOtherArgs { return new AndAnyOtherArgs(); } } -if (!function_exists("andAnyOthers")) { - function andAnyOthers() +if (! \function_exists('andAnyOthers')) { + function andAnyOthers(): AndAnyOtherArgs { return new AndAnyOtherArgs(); } diff --git a/api/vendor/monolog/monolog/CHANGELOG.md b/api/vendor/monolog/monolog/CHANGELOG.md index 7f9db2b074..122d85cde7 100644 --- a/api/vendor/monolog/monolog/CHANGELOG.md +++ b/api/vendor/monolog/monolog/CHANGELOG.md @@ -1,3 +1,36 @@ +### 2.10.0 (2024-11-12) + + * Added `$fileOpenMode` to `StreamHandler` to define a custom fopen mode to open the log file (#1913) + * Fixed `StreamHandler` handling of write failures so that it now closes/reopens the stream and retries the write once before failing (#1882) + * Fixed `StreamHandler` error handler causing issues if a stream handler triggers an error (#1866) + * Fixed `JsonFormatter` handling of incomplete classes (#1834) + * Fixed `RotatingFileHandler` bug where rotation could sometimes not happen correctly (#1905) + +### 2.9.3 (2024-04-12) + + * Fixed PHP 8.4 deprecation warnings (#1874) + +### 2.9.2 (2023-10-27) + + * Fixed display_errors parsing in ErrorHandler which did not support string values (#1804) + * Fixed bug where the previous error handler would not be restored in some cases where StreamHandler fails (#1815) + * Fixed normalization error when normalizing incomplete classes (#1833) + +### 2.9.1 (2023-02-06) + + * Fixed Logger not being serializable anymore (#1792) + +### 2.9.0 (2023-02-05) + + * Deprecated FlowdockHandler & Formatter as the flowdock service was shutdown (#1748) + * Added support for enum context values in PsrLogMessageProcessor (#1773) + * Added graylog2/gelf-php 2.x support (#1747) + * Improved `BrowserConsoleHandler` logging to use more appropriate methods than just console.log in the browser (#1739) + * Fixed `WhatFailureGroupHandler` not catching errors happening inside `close()` (#1791) + * Fixed datetime field in `GoogleCloudLoggingFormatter` (#1758) + * Fixed infinite loop detection within Fibers (#1753) + * Fixed `AmqpHandler->setExtraAttributes` not working with buffering handler wrappers (#1781) + ### 2.8.0 (2022-07-24) * Deprecated `CubeHandler` and `PHPConsoleHandler` as both projects are abandoned and those should not be used anymore (#1734) diff --git a/api/vendor/monolog/monolog/composer.json b/api/vendor/monolog/monolog/composer.json index ab775ad634..a1f08a22d8 100644 --- a/api/vendor/monolog/monolog/composer.json +++ b/api/vendor/monolog/monolog/composer.json @@ -21,14 +21,14 @@ "aws/aws-sdk-php": "^2.4.9 || ^3.0", "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^7 || ^8", - "graylog2/gelf-php": "^1.4.2", + "graylog2/gelf-php": "^1.4.2 || ^2@dev", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.2", "mongodb/mongodb": "^1.8", "php-amqplib/php-amqplib": "~2.4 || ^3", "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.38 || ^9.6.19", "predis/predis": "^1.1 || ^2.0", "rollbar/rollbar": "^1.3 || ^2 || ^3", "ruflin/elastica": "^7", diff --git a/api/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php b/api/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php index 6a1ba9b25a..789f9bfc4c 100644 --- a/api/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php +++ b/api/vendor/monolog/monolog/src/Monolog/DateTimeImmutable.php @@ -30,6 +30,8 @@ public function __construct(bool $useMicroseconds, ?DateTimeZone $timezone = nul { $this->useMicroseconds = $useMicroseconds; + // if you like to use a custom time to pass to Logger::addRecord directly, + // call modify() or setTimestamp() on this instance to change the date after creating it parent::__construct('now', $timezone); } diff --git a/api/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/api/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index 576f1713f0..1406d34e82 100644 --- a/api/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -198,7 +198,7 @@ private function handleException(\Throwable $e): void ($this->previousExceptionHandler)($e); } - if (!headers_sent() && !ini_get('display_errors')) { + if (!headers_sent() && in_array(strtolower((string) ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) { http_response_code(500); } diff --git a/api/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php b/api/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php index 41b56b3c0a..867ae586bf 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +++ b/api/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php @@ -15,6 +15,7 @@ * formats the record to be used in the FlowdockHandler * * @author Dominik Liebler + * @deprecated Since 2.9.0 and 3.3.0, Flowdock was shutdown we will thus drop this handler in Monolog 4 */ class FlowdockFormatter implements FormatterInterface { diff --git a/api/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php b/api/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php index a1a79372df..3b3e1e7f6d 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +++ b/api/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php @@ -47,6 +47,11 @@ class GelfMessageFormatter extends NormalizerFormatter */ protected $maxLength; + /** + * @var int + */ + private $gelfVersion = 2; + /** * Translates Monolog log levels to Graylog2 log priorities. * @@ -78,6 +83,10 @@ public function __construct(?string $systemName = null, ?string $extraPrefix = n $this->extraPrefix = is_null($extraPrefix) ? '' : $extraPrefix; $this->contextPrefix = $contextPrefix; $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength; + + if (method_exists(Message::class, 'setFacility')) { + $this->gelfVersion = 1; + } } /** @@ -113,16 +122,20 @@ public function format(array $record): Message $message->setShortMessage(Utils::substr($record['message'], 0, $this->maxLength)); } - if (isset($record['channel'])) { - $message->setFacility($record['channel']); - } - if (isset($extra['line'])) { - $message->setLine($extra['line']); - unset($extra['line']); - } - if (isset($extra['file'])) { - $message->setFile($extra['file']); - unset($extra['file']); + if ($this->gelfVersion === 1) { + if (isset($record['channel'])) { + $message->setFacility($record['channel']); + } + if (isset($extra['line'])) { + $message->setLine($extra['line']); + unset($extra['line']); + } + if (isset($extra['file'])) { + $message->setFile($extra['file']); + unset($extra['file']); + } + } else { + $message->setAdditional('facility', $record['channel']); } foreach ($extra as $key => $val) { @@ -147,11 +160,13 @@ public function format(array $record): Message $message->setAdditional($this->contextPrefix . $key, $val); } - /** @phpstan-ignore-next-line */ - if (null === $message->getFile() && isset($context['exception']['file'])) { - if (preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) { - $message->setFile($matches[1]); - $message->setLine($matches[2]); + if ($this->gelfVersion === 1) { + /** @phpstan-ignore-next-line */ + if (null === $message->getFile() && isset($context['exception']['file'])) { + if (preg_match("/^(.+):([0-9]+)$/", $context['exception']['file'], $matches)) { + $message->setFile($matches[1]); + $message->setLine($matches[2]); + } } } diff --git a/api/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php b/api/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php index 0cd287f5e4..ca52ebf4e5 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php +++ b/api/vendor/monolog/monolog/src/Monolog/Formatter/GoogleCloudLoggingFormatter.php @@ -17,6 +17,7 @@ /** * Encodes message information into JSON in a format compatible with Cloud logging. * + * @see https://cloud.google.com/logging/docs/structured-logging * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry * * @author Luís Cobucci @@ -28,7 +29,7 @@ public function format(array $record): string { // Re-key level for GCP logging $record['severity'] = $record['level_name']; - $record['timestamp'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED); + $record['time'] = $record['datetime']->format(DateTimeInterface::RFC3339_EXTENDED); // Remove keys that are not used by GCP unset($record['level'], $record['level_name'], $record['datetime']); diff --git a/api/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php b/api/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php index b737d82e35..753e6852cc 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +++ b/api/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php @@ -192,6 +192,10 @@ protected function normalize($data, int $depth = 0) return $data; } + if (\get_class($data) === '__PHP_Incomplete_Class') { + return new \ArrayObject($data); + } + if (method_exists($data, '__toString')) { return $data->__toString(); } diff --git a/api/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/api/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index b31b2971a1..e6e7898336 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/api/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -155,7 +155,7 @@ protected function normalizeException(\Throwable $e, int $depth = 0): string do { $depth++; if ($depth > $this->maxNormalizeDepth) { - $str .= '\n[previous exception] Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; + $str .= "\n[previous exception] Over " . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; break; } diff --git a/api/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/api/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index 5441bc0aad..f926a842f8 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/api/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -174,6 +174,9 @@ protected function normalize($data, int $depth = 0) if ($data instanceof \JsonSerializable) { /** @var null|scalar|array $value */ $value = $data->jsonSerialize(); + } elseif (\get_class($data) === '__PHP_Incomplete_Class') { + $accessor = new \ArrayObject($data); + $value = (string) $accessor['__PHP_Incomplete_Class_Name']; } elseif (method_exists($data, '__toString')) { /** @var string $value */ $value = $data->__toString(); diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php index c4997482e8..994872ce89 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php @@ -151,13 +151,14 @@ protected function getRoutingKey(array $record): string private function createAmqpMessage(string $data): AMQPMessage { - return new AMQPMessage( - $data, - [ - 'delivery_mode' => 2, - 'content_type' => 'application/json', - ] - ); + $attributes = [ + 'delivery_mode' => 2, + 'content_type' => 'application/json', + ]; + if ($this->extraAttributes) { + $attributes = array_merge($attributes, $this->extraAttributes); + } + return new AMQPMessage($data, $attributes); } /** diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php index fa383f1c21..95bbfed426 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php @@ -14,6 +14,7 @@ use Monolog\Formatter\FormatterInterface; use Monolog\Formatter\LineFormatter; use Monolog\Utils; +use Monolog\Logger; use function count; use function headers_list; @@ -177,7 +178,7 @@ private static function generateScript(): string $extra = static::dump('Extra', $record['extra']); if (empty($context) && empty($extra)) { - $script[] = static::call_array('log', static::handleStyles($record['formatted'])); + $script[] = static::call_array(static::getConsoleMethodForLevel($record['level']), static::handleStyles($record['formatted'])); } else { $script = array_merge( $script, @@ -192,6 +193,20 @@ private static function generateScript(): string return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);"; } + private static function getConsoleMethodForLevel(int $level): string + { + return [ + Logger::DEBUG => 'debug', + Logger::INFO => 'info', + Logger::NOTICE => 'info', + Logger::WARNING => 'warn', + Logger::ERROR => 'error', + Logger::CRITICAL => 'error', + Logger::ALERT => 'error', + Logger::EMERGENCY => 'error', + ][$level] ?? 'log'; + } + /** * @return string[] */ diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php index e88375c0e5..264b380d74 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php @@ -187,6 +187,7 @@ protected function bulkSend(array $records): void */ protected function createExceptionFromResponses($responses): Throwable { + // @phpstan-ignore offsetAccess.nonOffsetAccessible foreach ($responses['items'] ?? [] as $item) { if (isset($item['index']['error'])) { return $this->createExceptionFromError($item['index']['error']); diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php index 718f17ef19..5e43e1dc2f 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php @@ -161,7 +161,7 @@ public function handleBatch(array $records): void * * @phpstan-param Record $record */ - public function getHandler(array $record = null) + public function getHandler(?array $record = null) { if (!$this->handler instanceof HandlerInterface) { $this->handler = ($this->handler)($record, $this); diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php index 0627b44514..dfcb3af288 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php @@ -210,7 +210,7 @@ private function flushBuffer(): void * * @phpstan-param Record $record */ - public function getHandler(array $record = null) + public function getHandler(?array $record = null) { if (!$this->handler instanceof HandlerInterface) { $this->handler = ($this->handler)($record, $this); diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php index b837bdb66e..5715d5800f 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php @@ -28,6 +28,7 @@ * @see https://www.flowdock.com/api/push * * @phpstan-import-type FormattedRecord from AbstractProcessingHandler + * @deprecated Since 2.9.0 and 3.3.0, Flowdock was shutdown we will thus drop this handler in Monolog 4 */ class FlowdockHandler extends SocketHandler { diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php index 17745d2215..2d0c1a72d5 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php @@ -112,17 +112,22 @@ public function setFilenameFormat(string $filenameFormat, string $dateFormat): s */ protected function write(array $record): void { - // on the first record written, if the log is new, we should rotate (once per day) + // on the first record written, if the log is new, we rotate (once per day) after the log has been written so that the new file exists if (null === $this->mustRotate) { $this->mustRotate = null === $this->url || !file_exists($this->url); } + // if the next rotation is expired, then we rotate immediately if ($this->nextRotation <= $record['datetime']) { $this->mustRotate = true; - $this->close(); + $this->close(); // triggers rotation } parent::write($record); + + if ($this->mustRotate) { + $this->close(); // triggers rotation + } } /** @@ -134,6 +139,8 @@ protected function rotate(): void $this->url = $this->getTimedFilename(); $this->nextRotation = new \DateTimeImmutable('tomorrow'); + $this->mustRotate = false; + // skip GC of old logs if files are unlimited if (0 === $this->maxFiles) { return; @@ -166,8 +173,6 @@ protected function rotate(): void restore_error_handler(); } } - - $this->mustRotate = false; } protected function getTimedFilename(): string diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php index c128a32d18..25cce07f92 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php @@ -90,7 +90,7 @@ public function handle(array $record): bool * * @return HandlerInterface */ - public function getHandler(array $record = null) + public function getHandler(?array $record = null) { if (!$this->handler instanceof HandlerInterface) { $this->handler = ($this->handler)($record, $this); diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php b/api/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php index 71a4109461..9ae100371d 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php @@ -100,7 +100,7 @@ public function __construct( bool $useShortAttachment = false, bool $includeContextAndExtra = false, array $excludeFields = array(), - FormatterInterface $formatter = null + ?FormatterInterface $formatter = null ) { $this ->setChannel($channel) diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php index 651835122e..218d438471 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -41,17 +41,22 @@ class StreamHandler extends AbstractProcessingHandler protected $filePermission; /** @var bool */ protected $useLocking; + /** @var string */ + protected $fileOpenMode; /** @var true|null */ private $dirCreated = null; + /** @var bool */ + private $retrying = false; /** * @param resource|string $stream If a missing path can't be created, an UnexpectedValueException will be thrown on first write * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) * @param bool $useLocking Try to lock log file before doing any writes + * @param string $fileOpenMode The fopen() mode used when opening a file, if $stream is a file path * * @throws \InvalidArgumentException If stream is not a resource or string */ - public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false) + public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true, ?int $filePermission = null, bool $useLocking = false, $fileOpenMode = 'a') { parent::__construct($level, $bubble); @@ -78,6 +83,7 @@ public function __construct($stream, $level = Logger::DEBUG, bool $bubble = true throw new \InvalidArgumentException('A stream must either be a resource or a string.'); } + $this->fileOpenMode = $fileOpenMode; $this->filePermission = $filePermission; $this->useLocking = $useLocking; } @@ -134,12 +140,17 @@ protected function write(array $record): void } $this->createDir($url); $this->errorMessage = null; - set_error_handler([$this, 'customErrorHandler']); - $stream = fopen($url, 'a'); - if ($this->filePermission !== null) { - @chmod($url, $this->filePermission); + set_error_handler(function (...$args) { + return $this->customErrorHandler(...$args); + }); + try { + $stream = fopen($url, $this->fileOpenMode); + if ($this->filePermission !== null) { + @chmod($url, $this->filePermission); + } + } finally { + restore_error_handler(); } - restore_error_handler(); if (!is_resource($stream)) { $this->stream = null; @@ -159,8 +170,30 @@ protected function write(array $record): void flock($stream, LOCK_EX); } - $this->streamWrite($stream, $record); + $this->errorMessage = null; + set_error_handler(function (...$args) { + return $this->customErrorHandler(...$args); + }); + try { + $this->streamWrite($stream, $record); + } finally { + restore_error_handler(); + } + if ($this->errorMessage !== null) { + $error = $this->errorMessage; + // close the resource if possible to reopen it, and retry the failed write + if (!$this->retrying && $this->url !== null && $this->url !== 'php://memory') { + $this->retrying = true; + $this->close(); + $this->write($record); + + return; + } + + throw new \UnexpectedValueException('Writing to the log file failed: '.$error . Utils::getRecordMessageForException($record)); + } + $this->retrying = false; if ($this->useLocking) { flock($stream, LOCK_UN); } @@ -180,7 +213,7 @@ protected function streamWrite($stream, array $record): void private function customErrorHandler(int $code, string $msg): bool { - $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg); + $this->errorMessage = preg_replace('{^(fopen|mkdir|fwrite)\(.*?\): }', '', $msg); return true; } @@ -209,7 +242,9 @@ private function createDir(string $url): void $dir = $this->getDirFromStream($url); if (null !== $dir && !is_dir($dir)) { $this->errorMessage = null; - set_error_handler([$this, 'customErrorHandler']); + set_error_handler(function (...$args) { + return $this->customErrorHandler(...$args); + }); $status = mkdir($dir, 0777, true); restore_error_handler(); if (false === $status && !is_dir($dir) && strpos((string) $this->errorMessage, 'File exists') === false) { diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php index 8912eba510..a6223b795a 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php @@ -108,9 +108,9 @@ public function __construct( string $channel, $level = Logger::DEBUG, bool $bubble = true, - string $parseMode = null, - bool $disableWebPagePreview = null, - bool $disableNotification = null, + ?string $parseMode = null, + ?bool $disableWebPagePreview = null, + ?bool $disableNotification = null, bool $splitLongMessages = false, bool $delayBetweenMessages = false ) @@ -130,7 +130,7 @@ public function __construct( $this->delayBetweenMessages($delayBetweenMessages); } - public function setParseMode(string $parseMode = null): self + public function setParseMode(?string $parseMode = null): self { if ($parseMode !== null && !in_array($parseMode, self::AVAILABLE_PARSE_MODES)) { throw new \InvalidArgumentException('Unknown parseMode, use one of these: ' . implode(', ', self::AVAILABLE_PARSE_MODES) . '.'); @@ -141,14 +141,14 @@ public function setParseMode(string $parseMode = null): self return $this; } - public function disableWebPagePreview(bool $disableWebPagePreview = null): self + public function disableWebPagePreview(?bool $disableWebPagePreview = null): self { $this->disableWebPagePreview = $disableWebPagePreview; return $this; } - public function disableNotification(bool $disableNotification = null): self + public function disableNotification(?bool $disableNotification = null): self { $this->disableNotification = $disableNotification; diff --git a/api/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php b/api/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php index 2dd136720e..b6d3d3b197 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +++ b/api/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php @@ -64,4 +64,18 @@ public function handleBatch(array $records): void } } } + + /** + * {@inheritDoc} + */ + public function close(): void + { + foreach ($this->handlers as $handler) { + try { + $handler->close(); + } catch (\Throwable $e) { + // What failure? + } + } + } } diff --git a/api/vendor/monolog/monolog/src/Monolog/Logger.php b/api/vendor/monolog/monolog/src/Monolog/Logger.php index 1ab75b9e09..bf65d3c534 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Logger.php +++ b/api/vendor/monolog/monolog/src/Monolog/Logger.php @@ -168,6 +168,11 @@ class Logger implements LoggerInterface, ResettableInterface */ private $logDepth = 0; + /** + * @var \WeakMap<\Fiber, int> Keeps track of depth inside fibers to prevent infinite logging loops + */ + private $fiberLogDepth; + /** * @var bool Whether to detect infinite logging loops * @@ -189,6 +194,13 @@ public function __construct(string $name, array $handlers = [], array $processor $this->setHandlers($handlers); $this->processors = $processors; $this->timezone = $timezone ?: new DateTimeZone(date_default_timezone_get() ?: 'UTC'); + + if (\PHP_VERSION_ID >= 80100) { + // Local variable for phpstan, see https://github.com/phpstan/phpstan/issues/6732#issuecomment-1111118412 + /** @var \WeakMap<\Fiber, int> $fiberLogDepth */ + $fiberLogDepth = new \WeakMap(); + $this->fiberLogDepth = $fiberLogDepth; + } } public function getName(): string @@ -325,19 +337,28 @@ public function useLoggingLoopDetection(bool $detectCycles): self * * @phpstan-param Level $level */ - public function addRecord(int $level, string $message, array $context = [], DateTimeImmutable $datetime = null): bool + public function addRecord(int $level, string $message, array $context = [], ?DateTimeImmutable $datetime = null): bool { if (isset(self::RFC_5424_LEVELS[$level])) { $level = self::RFC_5424_LEVELS[$level]; } if ($this->detectCycles) { - $this->logDepth += 1; + if (\PHP_VERSION_ID >= 80100 && $fiber = \Fiber::getCurrent()) { + // @phpstan-ignore offsetAssign.dimType + $this->fiberLogDepth[$fiber] = $this->fiberLogDepth[$fiber] ?? 0; + $logDepth = ++$this->fiberLogDepth[$fiber]; + } else { + $logDepth = ++$this->logDepth; + } + } else { + $logDepth = 0; } - if ($this->logDepth === 3) { + + if ($logDepth === 3) { $this->warning('A possible infinite logging loop was detected and aborted. It appears some of your handler code is triggering logging, see the previous log record for a hint as to what may be the cause.'); return false; - } elseif ($this->logDepth >= 5) { // log depth 4 is let through so we can log the warning above + } elseif ($logDepth >= 5) { // log depth 4 is let through, so we can log the warning above return false; } @@ -387,7 +408,11 @@ public function addRecord(int $level, string $message, array $context = [], Date } } finally { if ($this->detectCycles) { - $this->logDepth--; + if (isset($fiber)) { + $this->fiberLogDepth[$fiber]--; + } else { + $this->logDepth--; + } } } @@ -698,4 +723,40 @@ protected function handleException(Throwable $e, array $record): void ($this->exceptionHandler)($e, $record); } + + /** + * @return array + */ + public function __serialize(): array + { + return [ + 'name' => $this->name, + 'handlers' => $this->handlers, + 'processors' => $this->processors, + 'microsecondTimestamps' => $this->microsecondTimestamps, + 'timezone' => $this->timezone, + 'exceptionHandler' => $this->exceptionHandler, + 'logDepth' => $this->logDepth, + 'detectCycles' => $this->detectCycles, + ]; + } + + /** + * @param array $data + */ + public function __unserialize(array $data): void + { + foreach (['name', 'handlers', 'processors', 'microsecondTimestamps', 'timezone', 'exceptionHandler', 'logDepth', 'detectCycles'] as $property) { + if (isset($data[$property])) { + $this->$property = $data[$property]; + } + } + + if (\PHP_VERSION_ID >= 80100) { + // Local variable for phpstan, see https://github.com/phpstan/phpstan/issues/6732#issuecomment-1111118412 + /** @var \WeakMap<\Fiber, int> $fiberLogDepth */ + $fiberLogDepth = new \WeakMap(); + $this->fiberLogDepth = $fiberLogDepth; + } + } } diff --git a/api/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/api/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php index 2c2a00e75f..e7c12176a7 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +++ b/api/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php @@ -66,6 +66,8 @@ public function __invoke(array $record): array } else { $replacements[$placeholder] = $val->format($this->dateFormat ?: static::SIMPLE_DATE); } + } elseif ($val instanceof \UnitEnum) { + $replacements[$placeholder] = $val instanceof \BackedEnum ? $val->value : $val->name; } elseif (is_object($val)) { $replacements[$placeholder] = '[object '.Utils::getClass($val).']'; } elseif (is_array($val)) { diff --git a/api/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/api/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php index 51850e17f7..887f4d3968 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +++ b/api/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php @@ -43,7 +43,7 @@ class WebProcessor implements ProcessorInterface * @param array|\ArrayAccess|null $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data * @param array|array|null $extraFields Field names and the related key inside $serverData to be added (or just a list of field names to use the default configured $serverData mapping). If not provided it defaults to: [url, ip, http_method, server, referrer] + unique_id if present in server data */ - public function __construct($serverData = null, array $extraFields = null) + public function __construct($serverData = null, ?array $extraFields = null) { if (null === $serverData) { $this->serverData = &$_SERVER; diff --git a/api/vendor/monolog/monolog/src/Monolog/Utils.php b/api/vendor/monolog/monolog/src/Monolog/Utils.php index 360c42199c..d4ff4c040a 100644 --- a/api/vendor/monolog/monolog/src/Monolog/Utils.php +++ b/api/vendor/monolog/monolog/src/Monolog/Utils.php @@ -249,7 +249,7 @@ public static function expandIniShorthandBytes($val) } $val = (int) $match['val']; - switch (strtolower($match['unit'] ?? '')) { + switch (strtolower($match['unit'])) { case 'g': $val *= 1024; case 'm': diff --git a/api/vendor/myclabs/deep-copy/.github/FUNDING.yml b/api/vendor/myclabs/deep-copy/.github/FUNDING.yml deleted file mode 100644 index b8da664ddc..0000000000 --- a/api/vendor/myclabs/deep-copy/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: "packagist/myclabs/deep-copy" -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/api/vendor/myclabs/deep-copy/.github/workflows/ci.yaml b/api/vendor/myclabs/deep-copy/.github/workflows/ci.yaml deleted file mode 100644 index eac2812e39..0000000000 --- a/api/vendor/myclabs/deep-copy/.github/workflows/ci.yaml +++ /dev/null @@ -1,101 +0,0 @@ -name: "Continuous Integration" - -on: - - pull_request - - push - -env: - COMPOSER_ROOT_VERSION: 1.99 - -jobs: - composer-json-lint: - name: "Lint composer.json" - - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "8.1" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - tools: composer-normalize - - - name: "Get composer cache directory" - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: "Cache dependencies" - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- - - - name: "Install dependencies" - run: "composer update --no-interaction --no-progress" - - - name: "Validate composer.json" - run: "composer validate --strict" - - - name: "Normalize composer.json" - run: "composer-normalize --dry-run" - - tests: - name: "Tests" - - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - - "8.1" - dependencies: - - "lowest" - - "highest" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - ini-values: zend.assertions=1 - - - name: "Get composer cache directory" - id: composercache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: "Cache dependencies" - uses: actions/cache@v2 - with: - path: ${{ steps.composercache.outputs.dir }} - key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer- - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --no-interaction --no-progress --prefer-lowest" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Run tests" - timeout-minutes: 3 - run: "vendor/bin/phpunit" diff --git a/api/vendor/myclabs/deep-copy/README.md b/api/vendor/myclabs/deep-copy/README.md index 503e93dfff..88ae14ccab 100644 --- a/api/vendor/myclabs/deep-copy/README.md +++ b/api/vendor/myclabs/deep-copy/README.md @@ -3,7 +3,7 @@ DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in the association graph. [![Total Downloads](https://poser.pugx.org/myclabs/deep-copy/downloads.svg)](https://packagist.org/packages/myclabs/deep-copy) -[![Integrate](https://github.com/myclabs/DeepCopy/workflows/ci/badge.svg?branch=1.x)](https://github.com/myclabs/DeepCopy/actions) +[![Integrate](https://github.com/myclabs/DeepCopy/actions/workflows/ci.yaml/badge.svg?branch=1.x)](https://github.com/myclabs/DeepCopy/actions/workflows/ci.yaml) ## Table of Contents @@ -186,6 +186,9 @@ $matcher = new TypeMatcher('Doctrine\Common\Collections\Collection'); - `DeepCopy\Filter` applies a transformation to the object attribute matched by `DeepCopy\Matcher` - `DeepCopy\TypeFilter` applies a transformation to any element matched by `DeepCopy\TypeMatcher` +By design, matching a filter will stop the chain of filters (i.e. the next ones will not be applied). +Using the ([`ChainableFilter`](#chainablefilter-filter)) won't stop the chain of filters. + #### `SetNullFilter` (filter) @@ -226,6 +229,34 @@ $copy = $copier->copy($object); ``` +#### `ChainableFilter` (filter) + +If you use cloning on proxy classes, you might want to apply two filters for: +1. loading the data +2. applying a transformation + +You can use the `ChainableFilter` as a decorator of the proxy loader filter, which won't stop the chain of filters (i.e. +the next ones may be applied). + + +```php +use DeepCopy\DeepCopy; +use DeepCopy\Filter\ChainableFilter; +use DeepCopy\Filter\Doctrine\DoctrineProxyFilter; +use DeepCopy\Filter\SetNullFilter; +use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher; +use DeepCopy\Matcher\PropertyNameMatcher; + +$copier = new DeepCopy(); +$copier->addFilter(new ChainableFilter(new DoctrineProxyFilter()), new DoctrineProxyMatcher()); +$copier->addFilter(new SetNullFilter(), new PropertyNameMatcher('id')); + +$copy = $copier->copy($object); + +echo $copy->id; // null +``` + + #### `DoctrineCollectionFilter` (filter) If you use Doctrine and want to copy an entity, you will need to use the `DoctrineCollectionFilter`: @@ -268,6 +299,8 @@ Doctrine proxy class (...\\\_\_CG\_\_\Proxy). You can use the `DoctrineProxyFilter` to load the actual entity behind the Doctrine proxy class. **Make sure, though, to put this as one of your very first filters in the filter chain so that the entity is loaded before other filters are applied!** +We recommend to decorate the `DoctrineProxyFilter` with the `ChainableFilter` to allow applying other filters to the +cloned lazy loaded entities. ```php use DeepCopy\DeepCopy; @@ -275,7 +308,7 @@ use DeepCopy\Filter\Doctrine\DoctrineProxyFilter; use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher; $copier = new DeepCopy(); -$copier->addFilter(new DoctrineProxyFilter(), new DoctrineProxyMatcher()); +$copier->addFilter(new ChainableFilter(new DoctrineProxyFilter()), new DoctrineProxyMatcher()); $copy = $copier->copy($object); diff --git a/api/vendor/myclabs/deep-copy/composer.json b/api/vendor/myclabs/deep-copy/composer.json index 66fb34a58a..f115fff851 100644 --- a/api/vendor/myclabs/deep-copy/composer.json +++ b/api/vendor/myclabs/deep-copy/composer.json @@ -16,11 +16,12 @@ "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "autoload": { "psr-4": { @@ -32,8 +33,8 @@ }, "autoload-dev": { "psr-4": { - "DeepCopy\\": "fixtures/", - "DeepCopyTest\\": "tests/DeepCopyTest/" + "DeepCopyTest\\": "tests/DeepCopyTest/", + "DeepCopy\\": "fixtures/" } }, "config": { diff --git a/api/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/api/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php index 5e68c64e4f..f739d922db 100644 --- a/api/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php +++ b/api/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php @@ -4,13 +4,16 @@ use ArrayObject; use DateInterval; +use DatePeriod; use DateTimeInterface; use DateTimeZone; use DeepCopy\Exception\CloneException; +use DeepCopy\Filter\ChainableFilter; use DeepCopy\Filter\Filter; use DeepCopy\Matcher\Matcher; use DeepCopy\Reflection\ReflectionHelper; use DeepCopy\TypeFilter\Date\DateIntervalFilter; +use DeepCopy\TypeFilter\Date\DatePeriodFilter; use DeepCopy\TypeFilter\Spl\ArrayObjectFilter; use DeepCopy\TypeFilter\Spl\SplDoublyLinkedListFilter; use DeepCopy\TypeFilter\TypeFilter; @@ -63,6 +66,7 @@ public function __construct($useCloneMethod = false) $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); + $this->addTypeFilter(new DatePeriodFilter(), new TypeMatcher(DatePeriod::class)); $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); } @@ -223,6 +227,11 @@ private function copyObjectProperty($object, ReflectionProperty $property) return; } + // Ignore readonly properties + if (method_exists($property, 'isReadOnly') && $property->isReadOnly()) { + return; + } + // Apply the filters foreach ($this->filters as $item) { /** @var Matcher $matcher */ @@ -239,6 +248,10 @@ function ($object) { } ); + if ($filter instanceof ChainableFilter) { + continue; + } + // If a filter matches, we stop processing this property return; } diff --git a/api/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php b/api/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php new file mode 100644 index 0000000000..4e3f7bbc47 --- /dev/null +++ b/api/vendor/myclabs/deep-copy/src/DeepCopy/Filter/ChainableFilter.php @@ -0,0 +1,24 @@ +filter = $filter; + } + + public function apply($object, $property, $objectCopier) + { + $this->filter->apply($object, $property, $objectCopier); + } +} diff --git a/api/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php b/api/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php new file mode 100644 index 0000000000..6bd2f7e574 --- /dev/null +++ b/api/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php @@ -0,0 +1,42 @@ += 80200 && $element->include_end_date) { + $options |= DatePeriod::INCLUDE_END_DATE; + } + if (!$element->include_start_date) { + $options |= DatePeriod::EXCLUDE_START_DATE; + } + + if ($element->getEndDate()) { + return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $element->getEndDate(), $options); + } + + if (PHP_VERSION_ID >= 70217) { + $recurrences = $element->getRecurrences(); + } else { + $recurrences = $element->recurrences - $element->include_start_date; + } + + return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $recurrences, $options); + } +} diff --git a/api/vendor/nesbot/carbon/composer.json b/api/vendor/nesbot/carbon/composer.json index 63bfb1c2e6..0014434ea1 100644 --- a/api/vendor/nesbot/carbon/composer.json +++ b/api/vendor/nesbot/carbon/composer.json @@ -42,13 +42,15 @@ "require": { "php": "^7.1.8 || ^8.0", "ext-json": "*", + "carbonphp/carbon-doctrine-types": "*", + "psr/clock": "^1.0", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.16", "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.1.4", - "doctrine/orm": "^2.7", + "doctrine/dbal": "^2.0 || ^3.1.4 || ^4.0", + "doctrine/orm": "^2.7 || ^3.0", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", "ondrejmirtes/better-reflection": "*", @@ -59,6 +61,9 @@ "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", "squizlabs/php_codesniffer": "^3.4" }, + "provide": { + "psr/clock-implementation": "1.0" + }, "minimum-stability": "dev", "prefer-stable": true, "autoload": { @@ -87,8 +92,8 @@ }, "extra": { "branch-alias": { - "dev-3.x": "3.x-dev", - "dev-master": "2.x-dev" + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev" }, "laravel": { "providers": [ @@ -116,6 +121,7 @@ "test": [ "@phpunit", "@style-check" - ] + ], + "sponsors": "php sponsors.php" } } diff --git a/api/vendor/nesbot/carbon/readme.md b/api/vendor/nesbot/carbon/readme.md index a178c3c702..97ec8ce08d 100644 --- a/api/vendor/nesbot/carbon/readme.md +++ b/api/vendor/nesbot/carbon/readme.md @@ -2,7 +2,7 @@ [![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) [![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) -[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fbriannesbitt%2FCarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto) +[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fbriannesbitt%2FCarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://github.com/briannesbitt/Carbon/actions) [![codecov.io](https://img.shields.io/codecov/c/github/briannesbitt/Carbon.svg?style=flat-square)](https://codecov.io/github/briannesbitt/Carbon?branch=master) [![Tidelift](https://tidelift.com/badges/github/briannesbitt/Carbon)](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme) @@ -119,31 +119,53 @@ This project exists thanks to all the people who contribute. Support this project by becoming a sponsor. Your logo will show up here with a link to your website. - - - + +Онлайн казино +CasinoHex Canada +Probukmacher +Casino-portugal.pt +Игровые автоматы +Slots City +inkedin +Онлайн казино України +OnlineCasinosSpelen +Best non Gamstop sites in the UK +Real Money Pokies +Non GamStop Bookies UK +Онлайн Казино Украины +SSSTwitter +Non-GamStop Bets UK +Chudovo +UK Casino Gap +NZ Casino Deps +NonStopCasino.org +Migliori Siti Non AAMS +UK NonGamStopCasinos +SnapTik +Proxidize +IG Downloader +Blastup +Organic Social Boost +AzuraCast +Triplebyte +GitHub Sponsors +Salesforce + + +[[Become a sponsor via OpenCollective](https://opencollective.com/Carbon#sponsor)] + + - - - - - - - - - - - - - - -[[Become a sponsor](https://opencollective.com/Carbon#sponsor)] + + + +[[Become a sponsor via GitHub](https://github.com/sponsors/kylekatarnls)] ### Backers Thank you to all our backers! 🙏 - + [[Become a backer](https://opencollective.com/Carbon#backer)] diff --git a/api/vendor/nesbot/carbon/sponsors.php b/api/vendor/nesbot/carbon/sponsors.php new file mode 100644 index 0000000000..67b217161a --- /dev/null +++ b/api/vendor/nesbot/carbon/sponsors.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Carbon\CarbonImmutable; + +require_once __DIR__.'/vendor/autoload.php'; + +function getMaxHistoryMonthsByAmount($amount): int +{ + if ($amount >= 50) { + return 6; + } + + if ($amount >= 20) { + return 4; + } + + return 2; +} + +function getHtmlAttribute($rawValue): string +{ + return str_replace( + ['​', "\r"], + '', + trim(htmlspecialchars((string) $rawValue), "  \n\r\t\v\0"), + ); +} + +function getOpenCollectiveSponsors(): string +{ + $customSponsorImages = [ + // For consistency and equity among sponsors, as of now, we kindly ask our sponsors + // to provide an image having a width/height ratio between 1/1 and 2/1. + // By default, we'll show the member picture from OpenCollective, and will resize it if bigger + // int(OpenCollective.MemberId) => ImageURL + ]; + + $members = json_decode(file_get_contents('https://opencollective.com/carbon/members/all.json'), true); + + $list = array_filter($members, static function ($member): bool { + return ($member['lastTransactionAmount'] > 3 || $member['isActive']) && + $member['role'] === 'BACKER' && + $member['type'] !== 'USER' && + ( + $member['totalAmountDonated'] > 100 || + $member['lastTransactionAt'] > CarbonImmutable::now() + ->subMonthsNoOverflow(getMaxHistoryMonthsByAmount($member['lastTransactionAmount'])) + ->format('Y-m-d h:i') || + $member['isActive'] && $member['lastTransactionAmount'] >= 30 + ); + }); + + $list = array_map(static function (array $member): array { + $createdAt = CarbonImmutable::parse($member['createdAt']); + $lastTransactionAt = CarbonImmutable::parse($member['lastTransactionAt']); + + if ($createdAt->format('d H:i:s.u') > $lastTransactionAt->format('d H:i:s.u')) { + $createdAt = $createdAt + ->setDay($lastTransactionAt->day) + ->modify($lastTransactionAt->format('H:i:s.u')); + } + + $monthlyContribution = (float) ($member['totalAmountDonated'] / ceil($createdAt->floatDiffInMonths())); + + if ( + $lastTransactionAt->isAfter('last month') && + $member['lastTransactionAmount'] > $monthlyContribution + ) { + $monthlyContribution = (float) $member['lastTransactionAmount']; + } + + $yearlyContribution = (float) ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears())); + $status = null; + + if ($monthlyContribution > 29) { + $status = 'sponsor'; + } elseif ($monthlyContribution > 4.5 || $yearlyContribution > 29) { + $status = 'backer'; + } elseif ($member['totalAmountDonated'] > 0) { + $status = 'helper'; + } + + return array_merge($member, [ + 'star' => ($monthlyContribution > 98 || $yearlyContribution > 500), + 'status' => $status, + 'monthlyContribution' => $monthlyContribution, + 'yearlyContribution' => $yearlyContribution, + ]); + }, $list); + + usort($list, static function (array $a, array $b): int { + return ($b['monthlyContribution'] <=> $a['monthlyContribution']) + ?: ($b['totalAmountDonated'] <=> $a['totalAmountDonated']); + }); + + return implode('', array_map(static function (array $member) use ($customSponsorImages): string { + $href = htmlspecialchars($member['website'] ?? $member['profile']); + $src = $customSponsorImages[$member['MemberId'] ?? ''] ?? $member['image'] ?? (strtr($member['profile'], ['https://opencollective.com/' => 'https://images.opencollective.com/']).'/avatar/256.png'); + [$x, $y] = @getimagesize($src) ?: [0, 0]; + $validImage = ($x && $y); + $src = $validImage ? htmlspecialchars($src) : 'https://opencollective.com/static/images/default-guest-logo.svg'; + $height = $member['status'] === 'sponsor' ? 64 : 42; + $width = min($height * 2, $validImage ? round($x * $height / $y) : $height); + $href .= (strpos($href, '?') === false ? '?' : '&').'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon'; + $title = getHtmlAttribute(($member['description'] ?? null) ?: $member['name']); + $alt = getHtmlAttribute($member['name']); + + return "\n".''. + ''.$alt.''. + ''; + }, $list))."\n"; +} + +file_put_contents('readme.md', preg_replace_callback( + '/()[\s\S]+()/', + static function (array $match): string { + return $match[1].getOpenCollectiveSponsors().$match[2]; + }, + file_get_contents('readme.md') +)); diff --git a/api/vendor/nesbot/carbon/src/Carbon/Carbon.php b/api/vendor/nesbot/carbon/src/Carbon/Carbon.php index 1e285aa4a7..e32569ae30 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Carbon.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Carbon.php @@ -33,477 +33,477 @@ * @property int $second * @property int $micro * @property int $microsecond - * @property int|float|string $timestamp seconds since the Unix Epoch - * @property string $englishDayOfWeek the day of week in English - * @property string $shortEnglishDayOfWeek the abbreviated day of week in English - * @property string $englishMonth the month in English - * @property string $shortEnglishMonth the abbreviated month in English + * @property int|float|string $timestamp seconds since the Unix Epoch + * @property string $englishDayOfWeek the day of week in English + * @property string $shortEnglishDayOfWeek the abbreviated day of week in English + * @property string $englishMonth the month in English + * @property string $shortEnglishMonth the abbreviated month in English * @property int $milliseconds * @property int $millisecond * @property int $milli - * @property int $week 1 through 53 - * @property int $isoWeek 1 through 53 - * @property int $weekYear year according to week format - * @property int $isoWeekYear year according to ISO week format - * @property int $dayOfYear 1 through 366 - * @property int $age does a diffInYears() with default parameters - * @property int $offset the timezone offset in seconds from UTC - * @property int $offsetMinutes the timezone offset in minutes from UTC - * @property int $offsetHours the timezone offset in hours from UTC - * @property CarbonTimeZone $timezone the current timezone - * @property CarbonTimeZone $tz alias of $timezone - * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) - * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) - * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) - * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name - * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName - * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read int $noZeroHour current hour from 1 to 24 - * @property-read int $weeksInYear 51 through 53 - * @property-read int $isoWeeksInYear 51 through 53 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekNumberInMonth 1 through 5 - * @property-read int $firstWeekDay 0 through 6 - * @property-read int $lastWeekDay 0 through 6 - * @property-read int $daysInYear 365 or 366 - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $decade the decade of this instance - * @property-read int $century the century of this instance - * @property-read int $millennium the millennium of this instance - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName the current timezone name - * @property-read string $tzName alias of $timezoneName - * @property-read string $locale locale of the current instance + * @property int $week 1 through 53 + * @property int $isoWeek 1 through 53 + * @property int $weekYear year according to week format + * @property int $isoWeekYear year according to ISO week format + * @property int $dayOfYear 1 through 366 + * @property int $age does a diffInYears() with default parameters + * @property int $offset the timezone offset in seconds from UTC + * @property int $offsetMinutes the timezone offset in minutes from UTC + * @property int $offsetHours the timezone offset in hours from UTC + * @property CarbonTimeZone $timezone the current timezone + * @property CarbonTimeZone $tz alias of $timezone + * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) + * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) + * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday + * @property-read int $daysInMonth number of days in the given month + * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) + * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) + * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name + * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName + * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read int $noZeroHour current hour from 1 to 24 + * @property-read int $weeksInYear 51 through 53 + * @property-read int $isoWeeksInYear 51 through 53 + * @property-read int $weekOfMonth 1 through 5 + * @property-read int $weekNumberInMonth 1 through 5 + * @property-read int $firstWeekDay 0 through 6 + * @property-read int $lastWeekDay 0 through 6 + * @property-read int $daysInYear 365 or 366 + * @property-read int $quarter the quarter of this instance, 1 - 4 + * @property-read int $decade the decade of this instance + * @property-read int $century the century of this instance + * @property-read int $millennium the millennium of this instance + * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise + * @property-read bool $local checks if the timezone is local, true if local, false otherwise + * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise + * @property-read string $timezoneName the current timezone name + * @property-read string $tzName alias of $timezoneName + * @property-read string $locale locale of the current instance * - * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) - * @method bool isLocal() Check if the current instance has non-UTC timezone. - * @method bool isValid() Check if the current instance is a valid date. - * @method bool isDST() Check if the current instance is in a daylight saving time. - * @method bool isSunday() Checks if the instance day is sunday. - * @method bool isMonday() Checks if the instance day is monday. - * @method bool isTuesday() Checks if the instance day is tuesday. - * @method bool isWednesday() Checks if the instance day is wednesday. - * @method bool isThursday() Checks if the instance day is thursday. - * @method bool isFriday() Checks if the instance day is friday. - * @method bool isSaturday() Checks if the instance day is saturday. - * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. - * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. - * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. - * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. - * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. - * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. - * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. - * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. - * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. - * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. - * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. - * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. - * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. - * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. - * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. - * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. - * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. - * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. - * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. - * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. - * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. - * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. - * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. - * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. - * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. - * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. - * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. - * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. - * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. - * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. - * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. - * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. - * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. - * @method $this years(int $value) Set current instance year to the given value. - * @method $this year(int $value) Set current instance year to the given value. - * @method $this setYears(int $value) Set current instance year to the given value. - * @method $this setYear(int $value) Set current instance year to the given value. - * @method $this months(int $value) Set current instance month to the given value. - * @method $this month(int $value) Set current instance month to the given value. - * @method $this setMonths(int $value) Set current instance month to the given value. - * @method $this setMonth(int $value) Set current instance month to the given value. - * @method $this days(int $value) Set current instance day to the given value. - * @method $this day(int $value) Set current instance day to the given value. - * @method $this setDays(int $value) Set current instance day to the given value. - * @method $this setDay(int $value) Set current instance day to the given value. - * @method $this hours(int $value) Set current instance hour to the given value. - * @method $this hour(int $value) Set current instance hour to the given value. - * @method $this setHours(int $value) Set current instance hour to the given value. - * @method $this setHour(int $value) Set current instance hour to the given value. - * @method $this minutes(int $value) Set current instance minute to the given value. - * @method $this minute(int $value) Set current instance minute to the given value. - * @method $this setMinutes(int $value) Set current instance minute to the given value. - * @method $this setMinute(int $value) Set current instance minute to the given value. - * @method $this seconds(int $value) Set current instance second to the given value. - * @method $this second(int $value) Set current instance second to the given value. - * @method $this setSeconds(int $value) Set current instance second to the given value. - * @method $this setSecond(int $value) Set current instance second to the given value. - * @method $this millis(int $value) Set current instance millisecond to the given value. - * @method $this milli(int $value) Set current instance millisecond to the given value. - * @method $this setMillis(int $value) Set current instance millisecond to the given value. - * @method $this setMilli(int $value) Set current instance millisecond to the given value. - * @method $this milliseconds(int $value) Set current instance millisecond to the given value. - * @method $this millisecond(int $value) Set current instance millisecond to the given value. - * @method $this setMilliseconds(int $value) Set current instance millisecond to the given value. - * @method $this setMillisecond(int $value) Set current instance millisecond to the given value. - * @method $this micros(int $value) Set current instance microsecond to the given value. - * @method $this micro(int $value) Set current instance microsecond to the given value. - * @method $this setMicros(int $value) Set current instance microsecond to the given value. - * @method $this setMicro(int $value) Set current instance microsecond to the given value. - * @method $this microseconds(int $value) Set current instance microsecond to the given value. - * @method $this microsecond(int $value) Set current instance microsecond to the given value. - * @method $this setMicroseconds(int $value) Set current instance microsecond to the given value. - * @method $this setMicrosecond(int $value) Set current instance microsecond to the given value. - * @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). - * @method $this addYear() Add one year to the instance (using date interval). - * @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). - * @method $this subYear() Sub one year to the instance (using date interval). - * @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. - * @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. - * @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). - * @method $this addMonth() Add one month to the instance (using date interval). - * @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). - * @method $this subMonth() Sub one month to the instance (using date interval). - * @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). - * @method $this addDay() Add one day to the instance (using date interval). - * @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). - * @method $this subDay() Sub one day to the instance (using date interval). - * @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). - * @method $this addHour() Add one hour to the instance (using date interval). - * @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). - * @method $this subHour() Sub one hour to the instance (using date interval). - * @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). - * @method $this addMinute() Add one minute to the instance (using date interval). - * @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). - * @method $this subMinute() Sub one minute to the instance (using date interval). - * @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). - * @method $this addSecond() Add one second to the instance (using date interval). - * @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). - * @method $this subSecond() Sub one second to the instance (using date interval). - * @method $this addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMilli() Add one millisecond to the instance (using date interval). - * @method $this subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMilli() Sub one millisecond to the instance (using date interval). - * @method $this addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMillisecond() Add one millisecond to the instance (using date interval). - * @method $this subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMillisecond() Sub one millisecond to the instance (using date interval). - * @method $this addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMicro() Add one microsecond to the instance (using date interval). - * @method $this subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMicro() Sub one microsecond to the instance (using date interval). - * @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method $this addMicrosecond() Add one microsecond to the instance (using date interval). - * @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method $this subMicrosecond() Sub one microsecond to the instance (using date interval). - * @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). - * @method $this addMillennium() Add one millennium to the instance (using date interval). - * @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). - * @method $this subMillennium() Sub one millennium to the instance (using date interval). - * @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). - * @method $this addCentury() Add one century to the instance (using date interval). - * @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). - * @method $this subCentury() Sub one century to the instance (using date interval). - * @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. - * @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. - * @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). - * @method $this addDecade() Add one decade to the instance (using date interval). - * @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). - * @method $this subDecade() Sub one decade to the instance (using date interval). - * @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. - * @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. - * @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). - * @method $this addQuarter() Add one quarter to the instance (using date interval). - * @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). - * @method $this subQuarter() Sub one quarter to the instance (using date interval). - * @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). - * @method $this addWeek() Add one week to the instance (using date interval). - * @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). - * @method $this subWeek() Sub one week to the instance (using date interval). - * @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). - * @method $this addWeekday() Add one weekday to the instance (using date interval). - * @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). - * @method $this subWeekday() Sub one weekday to the instance (using date interval). - * @method $this addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMicro() Add one microsecond to the instance (using timestamp). - * @method $this subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMicro() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp). - * @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method $this addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMilli() Add one millisecond to the instance (using timestamp). - * @method $this subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMilli() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method $this addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMillisecond() Add one millisecond to the instance (using timestamp). - * @method $this subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMillisecond() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). - * @method $this addRealSecond() Add one second to the instance (using timestamp). - * @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). - * @method $this subRealSecond() Sub one second to the instance (using timestamp). - * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. - * @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMinute() Add one minute to the instance (using timestamp). - * @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMinute() Sub one minute to the instance (using timestamp). - * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. - * @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). - * @method $this addRealHour() Add one hour to the instance (using timestamp). - * @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). - * @method $this subRealHour() Sub one hour to the instance (using timestamp). - * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. - * @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). - * @method $this addRealDay() Add one day to the instance (using timestamp). - * @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). - * @method $this subRealDay() Sub one day to the instance (using timestamp). - * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. - * @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). - * @method $this addRealWeek() Add one week to the instance (using timestamp). - * @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). - * @method $this subRealWeek() Sub one week to the instance (using timestamp). - * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. - * @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMonth() Add one month to the instance (using timestamp). - * @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMonth() Sub one month to the instance (using timestamp). - * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. - * @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). - * @method $this addRealQuarter() Add one quarter to the instance (using timestamp). - * @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). - * @method $this subRealQuarter() Sub one quarter to the instance (using timestamp). - * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. - * @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). - * @method $this addRealYear() Add one year to the instance (using timestamp). - * @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). - * @method $this subRealYear() Sub one year to the instance (using timestamp). - * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. - * @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). - * @method $this addRealDecade() Add one decade to the instance (using timestamp). - * @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). - * @method $this subRealDecade() Sub one decade to the instance (using timestamp). - * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. - * @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). - * @method $this addRealCentury() Add one century to the instance (using timestamp). - * @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). - * @method $this subRealCentury() Sub one century to the instance (using timestamp). - * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. - * @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). - * @method $this addRealMillennium() Add one millennium to the instance (using timestamp). - * @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). - * @method $this subRealMillennium() Sub one millennium to the instance (using timestamp). - * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. - * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. - * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. - * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. - * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. - * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. - * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. - * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. - * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. - * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. - * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. - * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. - * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. - * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. - * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. - * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. - * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. - * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. - * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. - * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. - * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. - * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. - * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. - * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. - * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. - * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. - * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. - * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. - * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. - * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. - * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. - * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. - * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. - * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. - * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. - * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. - * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. - * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method static static|false createFromFormat(string $format, string $time, string|DateTimeZone $timezone = null) Parse a string into a new Carbon object according to the specified format. - * @method static static __set_state(array $array) https://php.net/manual/en/datetime.set-state.php + * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) + * @method bool isLocal() Check if the current instance has non-UTC timezone. + * @method bool isValid() Check if the current instance is a valid date. + * @method bool isDST() Check if the current instance is in a daylight saving time. + * @method bool isSunday() Checks if the instance day is sunday. + * @method bool isMonday() Checks if the instance day is monday. + * @method bool isTuesday() Checks if the instance day is tuesday. + * @method bool isWednesday() Checks if the instance day is wednesday. + * @method bool isThursday() Checks if the instance day is thursday. + * @method bool isFriday() Checks if the instance day is friday. + * @method bool isSaturday() Checks if the instance day is saturday. + * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. + * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. + * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. + * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. + * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. + * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. + * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. + * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. + * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. + * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. + * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. + * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. + * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. + * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. + * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. + * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. + * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. + * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. + * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. + * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. + * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. + * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. + * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. + * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. + * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. + * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. + * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. + * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. + * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. + * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. + * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. + * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. + * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. + * @method $this years(int $value) Set current instance year to the given value. + * @method $this year(int $value) Set current instance year to the given value. + * @method $this setYears(int $value) Set current instance year to the given value. + * @method $this setYear(int $value) Set current instance year to the given value. + * @method $this months(int $value) Set current instance month to the given value. + * @method $this month(int $value) Set current instance month to the given value. + * @method $this setMonths(int $value) Set current instance month to the given value. + * @method $this setMonth(int $value) Set current instance month to the given value. + * @method $this days(int $value) Set current instance day to the given value. + * @method $this day(int $value) Set current instance day to the given value. + * @method $this setDays(int $value) Set current instance day to the given value. + * @method $this setDay(int $value) Set current instance day to the given value. + * @method $this hours(int $value) Set current instance hour to the given value. + * @method $this hour(int $value) Set current instance hour to the given value. + * @method $this setHours(int $value) Set current instance hour to the given value. + * @method $this setHour(int $value) Set current instance hour to the given value. + * @method $this minutes(int $value) Set current instance minute to the given value. + * @method $this minute(int $value) Set current instance minute to the given value. + * @method $this setMinutes(int $value) Set current instance minute to the given value. + * @method $this setMinute(int $value) Set current instance minute to the given value. + * @method $this seconds(int $value) Set current instance second to the given value. + * @method $this second(int $value) Set current instance second to the given value. + * @method $this setSeconds(int $value) Set current instance second to the given value. + * @method $this setSecond(int $value) Set current instance second to the given value. + * @method $this millis(int $value) Set current instance millisecond to the given value. + * @method $this milli(int $value) Set current instance millisecond to the given value. + * @method $this setMillis(int $value) Set current instance millisecond to the given value. + * @method $this setMilli(int $value) Set current instance millisecond to the given value. + * @method $this milliseconds(int $value) Set current instance millisecond to the given value. + * @method $this millisecond(int $value) Set current instance millisecond to the given value. + * @method $this setMilliseconds(int $value) Set current instance millisecond to the given value. + * @method $this setMillisecond(int $value) Set current instance millisecond to the given value. + * @method $this micros(int $value) Set current instance microsecond to the given value. + * @method $this micro(int $value) Set current instance microsecond to the given value. + * @method $this setMicros(int $value) Set current instance microsecond to the given value. + * @method $this setMicro(int $value) Set current instance microsecond to the given value. + * @method $this microseconds(int $value) Set current instance microsecond to the given value. + * @method $this microsecond(int $value) Set current instance microsecond to the given value. + * @method $this setMicroseconds(int $value) Set current instance microsecond to the given value. + * @method $this setMicrosecond(int $value) Set current instance microsecond to the given value. + * @method $this addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). + * @method $this addYear() Add one year to the instance (using date interval). + * @method $this subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). + * @method $this subYear() Sub one year to the instance (using date interval). + * @method $this addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. + * @method $this subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. + * @method $this addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). + * @method $this addMonth() Add one month to the instance (using date interval). + * @method $this subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). + * @method $this subMonth() Sub one month to the instance (using date interval). + * @method $this addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). + * @method $this addDay() Add one day to the instance (using date interval). + * @method $this subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). + * @method $this subDay() Sub one day to the instance (using date interval). + * @method $this addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). + * @method $this addHour() Add one hour to the instance (using date interval). + * @method $this subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). + * @method $this subHour() Sub one hour to the instance (using date interval). + * @method $this addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). + * @method $this addMinute() Add one minute to the instance (using date interval). + * @method $this subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). + * @method $this subMinute() Sub one minute to the instance (using date interval). + * @method $this addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). + * @method $this addSecond() Add one second to the instance (using date interval). + * @method $this subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). + * @method $this subSecond() Sub one second to the instance (using date interval). + * @method $this addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMilli() Add one millisecond to the instance (using date interval). + * @method $this subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMilli() Sub one millisecond to the instance (using date interval). + * @method $this addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMillisecond() Add one millisecond to the instance (using date interval). + * @method $this subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMillisecond() Sub one millisecond to the instance (using date interval). + * @method $this addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMicro() Add one microsecond to the instance (using date interval). + * @method $this subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMicro() Sub one microsecond to the instance (using date interval). + * @method $this addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMicrosecond() Add one microsecond to the instance (using date interval). + * @method $this subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMicrosecond() Sub one microsecond to the instance (using date interval). + * @method $this addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). + * @method $this addMillennium() Add one millennium to the instance (using date interval). + * @method $this subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). + * @method $this subMillennium() Sub one millennium to the instance (using date interval). + * @method $this addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). + * @method $this addCentury() Add one century to the instance (using date interval). + * @method $this subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). + * @method $this subCentury() Sub one century to the instance (using date interval). + * @method $this addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. + * @method $this subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. + * @method $this addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). + * @method $this addDecade() Add one decade to the instance (using date interval). + * @method $this subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). + * @method $this subDecade() Sub one decade to the instance (using date interval). + * @method $this addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. + * @method $this subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. + * @method $this addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). + * @method $this addQuarter() Add one quarter to the instance (using date interval). + * @method $this subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). + * @method $this subQuarter() Sub one quarter to the instance (using date interval). + * @method $this addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method $this subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method $this addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). + * @method $this addWeek() Add one week to the instance (using date interval). + * @method $this subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). + * @method $this subWeek() Sub one week to the instance (using date interval). + * @method $this addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). + * @method $this addWeekday() Add one weekday to the instance (using date interval). + * @method $this subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). + * @method $this subWeekday() Sub one weekday to the instance (using date interval). + * @method $this addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addRealMicro() Add one microsecond to the instance (using timestamp). + * @method $this subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subRealMicro() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method $this addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addRealMicrosecond() Add one microsecond to the instance (using timestamp). + * @method $this subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subRealMicrosecond() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method $this addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addRealMilli() Add one millisecond to the instance (using timestamp). + * @method $this subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subRealMilli() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method $this addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addRealMillisecond() Add one millisecond to the instance (using timestamp). + * @method $this subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subRealMillisecond() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method $this addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). + * @method $this addRealSecond() Add one second to the instance (using timestamp). + * @method $this subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). + * @method $this subRealSecond() Sub one second to the instance (using timestamp). + * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. + * @method $this addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). + * @method $this addRealMinute() Add one minute to the instance (using timestamp). + * @method $this subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). + * @method $this subRealMinute() Sub one minute to the instance (using timestamp). + * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. + * @method $this addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). + * @method $this addRealHour() Add one hour to the instance (using timestamp). + * @method $this subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). + * @method $this subRealHour() Sub one hour to the instance (using timestamp). + * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. + * @method $this addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). + * @method $this addRealDay() Add one day to the instance (using timestamp). + * @method $this subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). + * @method $this subRealDay() Sub one day to the instance (using timestamp). + * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. + * @method $this addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). + * @method $this addRealWeek() Add one week to the instance (using timestamp). + * @method $this subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). + * @method $this subRealWeek() Sub one week to the instance (using timestamp). + * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. + * @method $this addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). + * @method $this addRealMonth() Add one month to the instance (using timestamp). + * @method $this subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). + * @method $this subRealMonth() Sub one month to the instance (using timestamp). + * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. + * @method $this addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). + * @method $this addRealQuarter() Add one quarter to the instance (using timestamp). + * @method $this subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). + * @method $this subRealQuarter() Sub one quarter to the instance (using timestamp). + * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. + * @method $this addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). + * @method $this addRealYear() Add one year to the instance (using timestamp). + * @method $this subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). + * @method $this subRealYear() Sub one year to the instance (using timestamp). + * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. + * @method $this addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). + * @method $this addRealDecade() Add one decade to the instance (using timestamp). + * @method $this subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). + * @method $this subRealDecade() Sub one decade to the instance (using timestamp). + * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. + * @method $this addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). + * @method $this addRealCentury() Add one century to the instance (using timestamp). + * @method $this subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). + * @method $this subRealCentury() Sub one century to the instance (using timestamp). + * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. + * @method $this addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). + * @method $this addRealMillennium() Add one millennium to the instance (using timestamp). + * @method $this subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). + * @method $this subRealMillennium() Sub one millennium to the instance (using timestamp). + * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. + * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. + * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. + * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. + * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. + * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. + * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. + * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. + * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. + * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. + * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. + * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. + * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. + * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. + * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. + * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. + * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. + * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. + * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. + * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. + * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. + * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. + * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. + * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. + * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. + * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. + * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. + * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. + * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. + * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. + * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. + * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. + * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. + * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method static static|false createFromFormat(string $format, string $time, DateTimeZone|string|false|null $timezone = null) Parse a string into a new Carbon object according to the specified format. + * @method static static __set_state(array $array) https://php.net/manual/en/datetime.set-state.php * * */ diff --git a/api/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php b/api/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php index 960d66c056..4c9c1cfef5 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php +++ b/api/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php @@ -33,477 +33,477 @@ * @property int $second * @property int $micro * @property int $microsecond - * @property int|float|string $timestamp seconds since the Unix Epoch - * @property string $englishDayOfWeek the day of week in English - * @property string $shortEnglishDayOfWeek the abbreviated day of week in English - * @property string $englishMonth the month in English - * @property string $shortEnglishMonth the abbreviated month in English + * @property int|float|string $timestamp seconds since the Unix Epoch + * @property string $englishDayOfWeek the day of week in English + * @property string $shortEnglishDayOfWeek the abbreviated day of week in English + * @property string $englishMonth the month in English + * @property string $shortEnglishMonth the abbreviated month in English * @property int $milliseconds * @property int $millisecond * @property int $milli - * @property int $week 1 through 53 - * @property int $isoWeek 1 through 53 - * @property int $weekYear year according to week format - * @property int $isoWeekYear year according to ISO week format - * @property int $dayOfYear 1 through 366 - * @property int $age does a diffInYears() with default parameters - * @property int $offset the timezone offset in seconds from UTC - * @property int $offsetMinutes the timezone offset in minutes from UTC - * @property int $offsetHours the timezone offset in hours from UTC - * @property CarbonTimeZone $timezone the current timezone - * @property CarbonTimeZone $tz alias of $timezone - * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) - * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) - * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) - * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name - * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName - * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language - * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language - * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language - * @property-read int $noZeroHour current hour from 1 to 24 - * @property-read int $weeksInYear 51 through 53 - * @property-read int $isoWeeksInYear 51 through 53 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekNumberInMonth 1 through 5 - * @property-read int $firstWeekDay 0 through 6 - * @property-read int $lastWeekDay 0 through 6 - * @property-read int $daysInYear 365 or 366 - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $decade the decade of this instance - * @property-read int $century the century of this instance - * @property-read int $millennium the millennium of this instance - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName the current timezone name - * @property-read string $tzName alias of $timezoneName - * @property-read string $locale locale of the current instance + * @property int $week 1 through 53 + * @property int $isoWeek 1 through 53 + * @property int $weekYear year according to week format + * @property int $isoWeekYear year according to ISO week format + * @property int $dayOfYear 1 through 366 + * @property int $age does a diffInYears() with default parameters + * @property int $offset the timezone offset in seconds from UTC + * @property int $offsetMinutes the timezone offset in minutes from UTC + * @property int $offsetHours the timezone offset in hours from UTC + * @property CarbonTimeZone $timezone the current timezone + * @property CarbonTimeZone $tz alias of $timezone + * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) + * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) + * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday + * @property-read int $daysInMonth number of days in the given month + * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) + * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) + * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name + * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName + * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read int $noZeroHour current hour from 1 to 24 + * @property-read int $weeksInYear 51 through 53 + * @property-read int $isoWeeksInYear 51 through 53 + * @property-read int $weekOfMonth 1 through 5 + * @property-read int $weekNumberInMonth 1 through 5 + * @property-read int $firstWeekDay 0 through 6 + * @property-read int $lastWeekDay 0 through 6 + * @property-read int $daysInYear 365 or 366 + * @property-read int $quarter the quarter of this instance, 1 - 4 + * @property-read int $decade the decade of this instance + * @property-read int $century the century of this instance + * @property-read int $millennium the millennium of this instance + * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise + * @property-read bool $local checks if the timezone is local, true if local, false otherwise + * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise + * @property-read string $timezoneName the current timezone name + * @property-read string $tzName alias of $timezoneName + * @property-read string $locale locale of the current instance * - * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) - * @method bool isLocal() Check if the current instance has non-UTC timezone. - * @method bool isValid() Check if the current instance is a valid date. - * @method bool isDST() Check if the current instance is in a daylight saving time. - * @method bool isSunday() Checks if the instance day is sunday. - * @method bool isMonday() Checks if the instance day is monday. - * @method bool isTuesday() Checks if the instance day is tuesday. - * @method bool isWednesday() Checks if the instance day is wednesday. - * @method bool isThursday() Checks if the instance day is thursday. - * @method bool isFriday() Checks if the instance day is friday. - * @method bool isSaturday() Checks if the instance day is saturday. - * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. - * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. - * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. - * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. - * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. - * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. - * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. - * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. - * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. - * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. - * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. - * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. - * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. - * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. - * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. - * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. - * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. - * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. - * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. - * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. - * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. - * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. - * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. - * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. - * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. - * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. - * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. - * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. - * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. - * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. - * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. - * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. - * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. - * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). - * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. - * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. - * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. - * @method CarbonImmutable years(int $value) Set current instance year to the given value. - * @method CarbonImmutable year(int $value) Set current instance year to the given value. - * @method CarbonImmutable setYears(int $value) Set current instance year to the given value. - * @method CarbonImmutable setYear(int $value) Set current instance year to the given value. - * @method CarbonImmutable months(int $value) Set current instance month to the given value. - * @method CarbonImmutable month(int $value) Set current instance month to the given value. - * @method CarbonImmutable setMonths(int $value) Set current instance month to the given value. - * @method CarbonImmutable setMonth(int $value) Set current instance month to the given value. - * @method CarbonImmutable days(int $value) Set current instance day to the given value. - * @method CarbonImmutable day(int $value) Set current instance day to the given value. - * @method CarbonImmutable setDays(int $value) Set current instance day to the given value. - * @method CarbonImmutable setDay(int $value) Set current instance day to the given value. - * @method CarbonImmutable hours(int $value) Set current instance hour to the given value. - * @method CarbonImmutable hour(int $value) Set current instance hour to the given value. - * @method CarbonImmutable setHours(int $value) Set current instance hour to the given value. - * @method CarbonImmutable setHour(int $value) Set current instance hour to the given value. - * @method CarbonImmutable minutes(int $value) Set current instance minute to the given value. - * @method CarbonImmutable minute(int $value) Set current instance minute to the given value. - * @method CarbonImmutable setMinutes(int $value) Set current instance minute to the given value. - * @method CarbonImmutable setMinute(int $value) Set current instance minute to the given value. - * @method CarbonImmutable seconds(int $value) Set current instance second to the given value. - * @method CarbonImmutable second(int $value) Set current instance second to the given value. - * @method CarbonImmutable setSeconds(int $value) Set current instance second to the given value. - * @method CarbonImmutable setSecond(int $value) Set current instance second to the given value. - * @method CarbonImmutable millis(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable milli(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMillis(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMilli(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable milliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable millisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMilliseconds(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable setMillisecond(int $value) Set current instance millisecond to the given value. - * @method CarbonImmutable micros(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable micro(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicros(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicro(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable microseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable microsecond(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicroseconds(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable setMicrosecond(int $value) Set current instance microsecond to the given value. - * @method CarbonImmutable addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addYear() Add one year to the instance (using date interval). - * @method CarbonImmutable subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subYear() Sub one year to the instance (using date interval). - * @method CarbonImmutable addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMonth() Add one month to the instance (using date interval). - * @method CarbonImmutable subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMonth() Sub one month to the instance (using date interval). - * @method CarbonImmutable addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addDay() Add one day to the instance (using date interval). - * @method CarbonImmutable subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subDay() Sub one day to the instance (using date interval). - * @method CarbonImmutable addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addHour() Add one hour to the instance (using date interval). - * @method CarbonImmutable subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subHour() Sub one hour to the instance (using date interval). - * @method CarbonImmutable addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMinute() Add one minute to the instance (using date interval). - * @method CarbonImmutable subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMinute() Sub one minute to the instance (using date interval). - * @method CarbonImmutable addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addSecond() Add one second to the instance (using date interval). - * @method CarbonImmutable subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subSecond() Sub one second to the instance (using date interval). - * @method CarbonImmutable addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMilli() Add one millisecond to the instance (using date interval). - * @method CarbonImmutable subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMilli() Sub one millisecond to the instance (using date interval). - * @method CarbonImmutable addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMillisecond() Add one millisecond to the instance (using date interval). - * @method CarbonImmutable subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMillisecond() Sub one millisecond to the instance (using date interval). - * @method CarbonImmutable addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMicro() Add one microsecond to the instance (using date interval). - * @method CarbonImmutable subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMicro() Sub one microsecond to the instance (using date interval). - * @method CarbonImmutable addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMicrosecond() Add one microsecond to the instance (using date interval). - * @method CarbonImmutable subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMicrosecond() Sub one microsecond to the instance (using date interval). - * @method CarbonImmutable addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addMillennium() Add one millennium to the instance (using date interval). - * @method CarbonImmutable subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subMillennium() Sub one millennium to the instance (using date interval). - * @method CarbonImmutable addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addCentury() Add one century to the instance (using date interval). - * @method CarbonImmutable subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subCentury() Sub one century to the instance (using date interval). - * @method CarbonImmutable addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addDecade() Add one decade to the instance (using date interval). - * @method CarbonImmutable subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subDecade() Sub one decade to the instance (using date interval). - * @method CarbonImmutable addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addQuarter() Add one quarter to the instance (using date interval). - * @method CarbonImmutable subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subQuarter() Sub one quarter to the instance (using date interval). - * @method CarbonImmutable addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. - * @method CarbonImmutable addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. - * @method CarbonImmutable addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addWeek() Add one week to the instance (using date interval). - * @method CarbonImmutable subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subWeek() Sub one week to the instance (using date interval). - * @method CarbonImmutable addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable addWeekday() Add one weekday to the instance (using date interval). - * @method CarbonImmutable subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). - * @method CarbonImmutable subWeekday() Sub one weekday to the instance (using date interval). - * @method CarbonImmutable addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMicro() Add one microsecond to the instance (using timestamp). - * @method CarbonImmutable subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMicro() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonImmutable addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMicrosecond() Add one microsecond to the instance (using timestamp). - * @method CarbonImmutable subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMicrosecond() Sub one microsecond to the instance (using timestamp). - * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. - * @method CarbonImmutable addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMilli() Add one millisecond to the instance (using timestamp). - * @method CarbonImmutable subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMilli() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonImmutable addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMillisecond() Add one millisecond to the instance (using timestamp). - * @method CarbonImmutable subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMillisecond() Sub one millisecond to the instance (using timestamp). - * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. - * @method CarbonImmutable addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealSecond() Add one second to the instance (using timestamp). - * @method CarbonImmutable subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealSecond() Sub one second to the instance (using timestamp). - * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. - * @method CarbonImmutable addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMinute() Add one minute to the instance (using timestamp). - * @method CarbonImmutable subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMinute() Sub one minute to the instance (using timestamp). - * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. - * @method CarbonImmutable addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealHour() Add one hour to the instance (using timestamp). - * @method CarbonImmutable subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealHour() Sub one hour to the instance (using timestamp). - * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. - * @method CarbonImmutable addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealDay() Add one day to the instance (using timestamp). - * @method CarbonImmutable subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealDay() Sub one day to the instance (using timestamp). - * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. - * @method CarbonImmutable addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealWeek() Add one week to the instance (using timestamp). - * @method CarbonImmutable subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealWeek() Sub one week to the instance (using timestamp). - * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. - * @method CarbonImmutable addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMonth() Add one month to the instance (using timestamp). - * @method CarbonImmutable subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMonth() Sub one month to the instance (using timestamp). - * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. - * @method CarbonImmutable addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealQuarter() Add one quarter to the instance (using timestamp). - * @method CarbonImmutable subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealQuarter() Sub one quarter to the instance (using timestamp). - * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. - * @method CarbonImmutable addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealYear() Add one year to the instance (using timestamp). - * @method CarbonImmutable subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealYear() Sub one year to the instance (using timestamp). - * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. - * @method CarbonImmutable addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealDecade() Add one decade to the instance (using timestamp). - * @method CarbonImmutable subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealDecade() Sub one decade to the instance (using timestamp). - * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. - * @method CarbonImmutable addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealCentury() Add one century to the instance (using timestamp). - * @method CarbonImmutable subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealCentury() Sub one century to the instance (using timestamp). - * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. - * @method CarbonImmutable addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable addRealMillennium() Add one millennium to the instance (using timestamp). - * @method CarbonImmutable subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). - * @method CarbonImmutable subRealMillennium() Sub one millennium to the instance (using timestamp). - * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. - * @method CarbonImmutable roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonImmutable roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. - * @method CarbonImmutable floorYear(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonImmutable floorYears(float $precision = 1) Truncate the current instance year with given precision. - * @method CarbonImmutable ceilYear(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonImmutable ceilYears(float $precision = 1) Ceil the current instance year with given precision. - * @method CarbonImmutable roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonImmutable roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. - * @method CarbonImmutable floorMonth(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonImmutable floorMonths(float $precision = 1) Truncate the current instance month with given precision. - * @method CarbonImmutable ceilMonth(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonImmutable ceilMonths(float $precision = 1) Ceil the current instance month with given precision. - * @method CarbonImmutable roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonImmutable roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. - * @method CarbonImmutable floorDay(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonImmutable floorDays(float $precision = 1) Truncate the current instance day with given precision. - * @method CarbonImmutable ceilDay(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonImmutable ceilDays(float $precision = 1) Ceil the current instance day with given precision. - * @method CarbonImmutable roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonImmutable roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. - * @method CarbonImmutable floorHour(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonImmutable floorHours(float $precision = 1) Truncate the current instance hour with given precision. - * @method CarbonImmutable ceilHour(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonImmutable ceilHours(float $precision = 1) Ceil the current instance hour with given precision. - * @method CarbonImmutable roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonImmutable roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. - * @method CarbonImmutable floorMinute(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonImmutable floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. - * @method CarbonImmutable ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonImmutable ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. - * @method CarbonImmutable roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonImmutable roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. - * @method CarbonImmutable floorSecond(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonImmutable floorSeconds(float $precision = 1) Truncate the current instance second with given precision. - * @method CarbonImmutable ceilSecond(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. - * @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. - * @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. - * @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. - * @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. - * @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision. - * @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. - * @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. - * @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision. - * @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. - * @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. - * @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. - * @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. - * @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. - * @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. - * @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. - * @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. - * @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. - * @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. - * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) - * @method static static|false createFromFormat(string $format, string $time, string|DateTimeZone $timezone = null) Parse a string into a new CarbonImmutable object according to the specified format. - * @method static static __set_state(array $array) https://php.net/manual/en/datetime.set-state.php + * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) + * @method bool isLocal() Check if the current instance has non-UTC timezone. + * @method bool isValid() Check if the current instance is a valid date. + * @method bool isDST() Check if the current instance is in a daylight saving time. + * @method bool isSunday() Checks if the instance day is sunday. + * @method bool isMonday() Checks if the instance day is monday. + * @method bool isTuesday() Checks if the instance day is tuesday. + * @method bool isWednesday() Checks if the instance day is wednesday. + * @method bool isThursday() Checks if the instance day is thursday. + * @method bool isFriday() Checks if the instance day is friday. + * @method bool isSaturday() Checks if the instance day is saturday. + * @method bool isSameYear(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. + * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. + * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. + * @method bool isSameWeek(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. + * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. + * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. + * @method bool isSameDay(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. + * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. + * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. + * @method bool isSameHour(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. + * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. + * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. + * @method bool isSameMinute(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. + * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. + * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. + * @method bool isSameSecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. + * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. + * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. + * @method bool isSameMicro(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameMicrosecond(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. + * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. + * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. + * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. + * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. + * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. + * @method bool isSameDecade(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. + * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. + * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. + * @method bool isSameCentury(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. + * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. + * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. + * @method bool isSameMillennium(Carbon|DateTimeInterface|string|null $date = null) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. + * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. + * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. + * @method CarbonImmutable years(int $value) Set current instance year to the given value. + * @method CarbonImmutable year(int $value) Set current instance year to the given value. + * @method CarbonImmutable setYears(int $value) Set current instance year to the given value. + * @method CarbonImmutable setYear(int $value) Set current instance year to the given value. + * @method CarbonImmutable months(int $value) Set current instance month to the given value. + * @method CarbonImmutable month(int $value) Set current instance month to the given value. + * @method CarbonImmutable setMonths(int $value) Set current instance month to the given value. + * @method CarbonImmutable setMonth(int $value) Set current instance month to the given value. + * @method CarbonImmutable days(int $value) Set current instance day to the given value. + * @method CarbonImmutable day(int $value) Set current instance day to the given value. + * @method CarbonImmutable setDays(int $value) Set current instance day to the given value. + * @method CarbonImmutable setDay(int $value) Set current instance day to the given value. + * @method CarbonImmutable hours(int $value) Set current instance hour to the given value. + * @method CarbonImmutable hour(int $value) Set current instance hour to the given value. + * @method CarbonImmutable setHours(int $value) Set current instance hour to the given value. + * @method CarbonImmutable setHour(int $value) Set current instance hour to the given value. + * @method CarbonImmutable minutes(int $value) Set current instance minute to the given value. + * @method CarbonImmutable minute(int $value) Set current instance minute to the given value. + * @method CarbonImmutable setMinutes(int $value) Set current instance minute to the given value. + * @method CarbonImmutable setMinute(int $value) Set current instance minute to the given value. + * @method CarbonImmutable seconds(int $value) Set current instance second to the given value. + * @method CarbonImmutable second(int $value) Set current instance second to the given value. + * @method CarbonImmutable setSeconds(int $value) Set current instance second to the given value. + * @method CarbonImmutable setSecond(int $value) Set current instance second to the given value. + * @method CarbonImmutable millis(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable milli(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMillis(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMilli(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable milliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable millisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMilliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMillisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable micros(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable micro(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicros(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicro(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable microseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable microsecond(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicroseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicrosecond(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable addYears(int $value = 1) Add years (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addYear() Add one year to the instance (using date interval). + * @method CarbonImmutable subYears(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subYear() Sub one year to the instance (using date interval). + * @method CarbonImmutable addYearsWithOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subYearsWithOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addYearsWithoutOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearsWithoutOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearsWithNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearsWithNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearsNoOverflow(int $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearsNoOverflow(int $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonths(int $value = 1) Add months (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMonth() Add one month to the instance (using date interval). + * @method CarbonImmutable subMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMonth() Sub one month to the instance (using date interval). + * @method CarbonImmutable addMonthsWithOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMonthsWithOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMonthsWithoutOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthsWithoutOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthsWithNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthsWithNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthsNoOverflow(int $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthsNoOverflow(int $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDays(int $value = 1) Add days (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addDay() Add one day to the instance (using date interval). + * @method CarbonImmutable subDays(int $value = 1) Sub days (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subDay() Sub one day to the instance (using date interval). + * @method CarbonImmutable addHours(int $value = 1) Add hours (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addHour() Add one hour to the instance (using date interval). + * @method CarbonImmutable subHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subHour() Sub one hour to the instance (using date interval). + * @method CarbonImmutable addMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMinute() Add one minute to the instance (using date interval). + * @method CarbonImmutable subMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMinute() Sub one minute to the instance (using date interval). + * @method CarbonImmutable addSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addSecond() Add one second to the instance (using date interval). + * @method CarbonImmutable subSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subSecond() Sub one second to the instance (using date interval). + * @method CarbonImmutable addMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMilli() Add one millisecond to the instance (using date interval). + * @method CarbonImmutable subMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMilli() Sub one millisecond to the instance (using date interval). + * @method CarbonImmutable addMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMillisecond() Add one millisecond to the instance (using date interval). + * @method CarbonImmutable subMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMillisecond() Sub one millisecond to the instance (using date interval). + * @method CarbonImmutable addMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMicro() Add one microsecond to the instance (using date interval). + * @method CarbonImmutable subMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMicro() Sub one microsecond to the instance (using date interval). + * @method CarbonImmutable addMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMicrosecond() Add one microsecond to the instance (using date interval). + * @method CarbonImmutable subMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMicrosecond() Sub one microsecond to the instance (using date interval). + * @method CarbonImmutable addMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMillennium() Add one millennium to the instance (using date interval). + * @method CarbonImmutable subMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMillennium() Sub one millennium to the instance (using date interval). + * @method CarbonImmutable addMillenniaWithOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMillenniaWithOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMillenniaWithoutOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniaWithoutOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniaWithNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniaWithNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniaNoOverflow(int $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniaNoOverflow(int $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addCentury() Add one century to the instance (using date interval). + * @method CarbonImmutable subCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subCentury() Sub one century to the instance (using date interval). + * @method CarbonImmutable addCenturiesWithOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subCenturiesWithOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addCenturiesWithoutOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturiesWithoutOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturiesWithNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturiesWithNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturiesNoOverflow(int $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturiesNoOverflow(int $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addDecade() Add one decade to the instance (using date interval). + * @method CarbonImmutable subDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subDecade() Sub one decade to the instance (using date interval). + * @method CarbonImmutable addDecadesWithOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subDecadesWithOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addDecadesWithoutOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadesWithoutOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadesWithNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadesWithNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadesNoOverflow(int $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadesNoOverflow(int $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addQuarter() Add one quarter to the instance (using date interval). + * @method CarbonImmutable subQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subQuarter() Sub one quarter to the instance (using date interval). + * @method CarbonImmutable addQuartersWithOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subQuartersWithOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addQuartersWithoutOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuartersWithoutOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuartersWithNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuartersWithNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuartersNoOverflow(int $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuartersNoOverflow(int $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addWeek() Add one week to the instance (using date interval). + * @method CarbonImmutable subWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subWeek() Sub one week to the instance (using date interval). + * @method CarbonImmutable addWeekdays(int $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addWeekday() Add one weekday to the instance (using date interval). + * @method CarbonImmutable subWeekdays(int $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subWeekday() Sub one weekday to the instance (using date interval). + * @method CarbonImmutable addRealMicros(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealMicro() Add one microsecond to the instance (using timestamp). + * @method CarbonImmutable subRealMicros(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealMicro() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method CarbonImmutable addRealMicroseconds(int $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealMicrosecond() Add one microsecond to the instance (using timestamp). + * @method CarbonImmutable subRealMicroseconds(int $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealMicrosecond() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method CarbonImmutable addRealMillis(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealMilli() Add one millisecond to the instance (using timestamp). + * @method CarbonImmutable subRealMillis(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealMilli() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method CarbonImmutable addRealMilliseconds(int $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealMillisecond() Add one millisecond to the instance (using timestamp). + * @method CarbonImmutable subRealMilliseconds(int $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealMillisecond() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisecondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method CarbonImmutable addRealSeconds(int $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealSecond() Add one second to the instance (using timestamp). + * @method CarbonImmutable subRealSeconds(int $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealSecond() Sub one second to the instance (using timestamp). + * @method CarbonPeriod secondsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. + * @method CarbonImmutable addRealMinutes(int $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealMinute() Add one minute to the instance (using timestamp). + * @method CarbonImmutable subRealMinutes(int $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealMinute() Sub one minute to the instance (using timestamp). + * @method CarbonPeriod minutesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. + * @method CarbonImmutable addRealHours(int $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealHour() Add one hour to the instance (using timestamp). + * @method CarbonImmutable subRealHours(int $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealHour() Sub one hour to the instance (using timestamp). + * @method CarbonPeriod hoursUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. + * @method CarbonImmutable addRealDays(int $value = 1) Add days (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealDay() Add one day to the instance (using timestamp). + * @method CarbonImmutable subRealDays(int $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealDay() Sub one day to the instance (using timestamp). + * @method CarbonPeriod daysUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. + * @method CarbonImmutable addRealWeeks(int $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealWeek() Add one week to the instance (using timestamp). + * @method CarbonImmutable subRealWeeks(int $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealWeek() Sub one week to the instance (using timestamp). + * @method CarbonPeriod weeksUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. + * @method CarbonImmutable addRealMonths(int $value = 1) Add months (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealMonth() Add one month to the instance (using timestamp). + * @method CarbonImmutable subRealMonths(int $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealMonth() Sub one month to the instance (using timestamp). + * @method CarbonPeriod monthsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. + * @method CarbonImmutable addRealQuarters(int $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealQuarter() Add one quarter to the instance (using timestamp). + * @method CarbonImmutable subRealQuarters(int $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealQuarter() Sub one quarter to the instance (using timestamp). + * @method CarbonPeriod quartersUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. + * @method CarbonImmutable addRealYears(int $value = 1) Add years (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealYear() Add one year to the instance (using timestamp). + * @method CarbonImmutable subRealYears(int $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealYear() Sub one year to the instance (using timestamp). + * @method CarbonPeriod yearsUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. + * @method CarbonImmutable addRealDecades(int $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealDecade() Add one decade to the instance (using timestamp). + * @method CarbonImmutable subRealDecades(int $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealDecade() Sub one decade to the instance (using timestamp). + * @method CarbonPeriod decadesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. + * @method CarbonImmutable addRealCenturies(int $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealCentury() Add one century to the instance (using timestamp). + * @method CarbonImmutable subRealCenturies(int $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealCentury() Sub one century to the instance (using timestamp). + * @method CarbonPeriod centuriesUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. + * @method CarbonImmutable addRealMillennia(int $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addRealMillennium() Add one millennium to the instance (using timestamp). + * @method CarbonImmutable subRealMillennia(int $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subRealMillennium() Sub one millennium to the instance (using timestamp). + * @method CarbonPeriod millenniaUntil($endDate = null, int $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. + * @method CarbonImmutable roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonImmutable roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonImmutable floorYear(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonImmutable floorYears(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonImmutable ceilYear(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonImmutable ceilYears(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonImmutable roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonImmutable roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonImmutable floorMonth(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonImmutable floorMonths(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonImmutable ceilMonth(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonImmutable ceilMonths(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonImmutable roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonImmutable roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonImmutable floorDay(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonImmutable floorDays(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonImmutable ceilDay(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonImmutable ceilDays(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonImmutable roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonImmutable roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonImmutable floorHour(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonImmutable floorHours(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonImmutable ceilHour(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonImmutable ceilHours(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonImmutable roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonImmutable roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonImmutable floorMinute(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonImmutable floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonImmutable ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonImmutable ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonImmutable roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonImmutable roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonImmutable floorSecond(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonImmutable floorSeconds(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonImmutable ceilSecond(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method static static|false createFromFormat(string $format, string $time, DateTimeZone|string|false|null $timezone = null) Parse a string into a new CarbonImmutable object according to the specified format. + * @method static static __set_state(array $array) https://php.net/manual/en/datetime.set-state.php * * */ diff --git a/api/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php b/api/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php index 4b6ce76c5b..b90e298172 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php +++ b/api/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php @@ -702,15 +702,6 @@ public function __get($name); */ public function __isset($name); - /** - * Returns the values to dump on serialize() called on. - * - * Only used by PHP >= 7.4. - * - * @return array - */ - public function __serialize(): array; - /** * Set a part of the Carbon object * @@ -754,15 +745,6 @@ public function __sleep(); */ public function __toString(); - /** - * Set locale if specified on unserialize() called. - * - * Only used by PHP >= 7.4. - * - * @return void - */ - public function __unserialize(array $data): void; - /** * Add given units or interval to the current instance. * @@ -1059,13 +1041,13 @@ public function copy(); * If $hour is not null then the default values for $minute and $second * will be 0. * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param DateTimeZone|string|null $tz + * @param DateTimeInterface|int|null $year + * @param int|null $month + * @param int|null $day + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|null $tz * * @throws InvalidFormatException * @@ -2771,12 +2753,35 @@ public function isLastOfMonth(); public function isLeapYear(); /** - * Determines if the instance is a long year + * Determines if the instance is a long year (using ISO 8601 year). + * + * @example + * ``` + * Carbon::parse('2015-01-01')->isLongIsoYear(); // true + * Carbon::parse('2016-01-01')->isLongIsoYear(); // true + * Carbon::parse('2016-01-03')->isLongIsoYear(); // false + * Carbon::parse('2019-12-29')->isLongIsoYear(); // false + * Carbon::parse('2019-12-30')->isLongIsoYear(); // true + * ``` + * + * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates + * + * @return bool + */ + public function isLongIsoYear(); + + /** + * Determines if the instance is a long year (using calendar year). + * + * ⚠️ This method completely ignores month and day to use the numeric year number, + * it's not correct if the exact date matters. For instance as `2019-12-30` is already + * in the first week of the 2020 year, if you want to know from this date if ISO week + * year 2020 is a long year, use `isLongIsoYear` instead. * * @example * ``` - * Carbon::parse('2015-01-01')->isLongYear(); // true - * Carbon::parse('2016-01-01')->isLongYear(); // false + * Carbon::create(2015)->isLongYear(); // true + * Carbon::create(2016)->isLongYear(); // false * ``` * * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates @@ -5115,12 +5120,14 @@ public function weeksInYear($dayOfWeek = null, $dayOfYear = null); * * /!\ Use this method for unit tests only. * + * @template T + * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure(): T $callback * - * @return mixed + * @return T */ - public static function withTestNow($testNow = null, $callback = null); + public static function withTestNow($testNow, $callback); /** * Create a Carbon instance for yesterday. diff --git a/api/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/api/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php index 796f9cdcd0..8437c545e1 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ b/api/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -15,6 +15,7 @@ use Carbon\Exceptions\BadFluentSetterException; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidIntervalException; +use Carbon\Exceptions\OutOfRangeException; use Carbon\Exceptions\ParseErrorException; use Carbon\Exceptions\UnitNotConfiguredException; use Carbon\Exceptions\UnknownGetterException; @@ -28,11 +29,14 @@ use Carbon\Traits\ToStringFormat; use Closure; use DateInterval; +use DateMalformedIntervalStringException; use DateTimeInterface; use DateTimeZone; use Exception; +use InvalidArgumentException; use ReflectionException; use ReturnTypeWillChange; +use RuntimeException; use Throwable; /** @@ -245,6 +249,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface */ private static $flipCascadeFactors; + /** + * @var bool + */ + private static $floatSettersEnabled = false; + /** * The registered macros. * @@ -346,6 +355,19 @@ public static function setCascadeFactors(array $cascadeFactors) static::$cascadeFactors = $cascadeFactors; } + /** + * This option allow you to opt-in for the Carbon 3 behavior where float + * values will no longer be cast to integer (so truncated). + * + * ⚠️ This settings will be applied globally, which mean your whole application + * code including the third-party dependencies that also may use Carbon will + * adopt the new behavior. + */ + public static function enableFloatSetters(bool $floatSettersEnabled = true): void + { + self::$floatSettersEnabled = $floatSettersEnabled; + } + /////////////////////////////////////////////////////////////////// //////////////////////////// CONSTRUCTORS ///////////////////////// /////////////////////////////////////////////////////////////////// @@ -354,13 +376,13 @@ public static function setCascadeFactors(array $cascadeFactors) * Create a new CarbonInterval instance. * * @param Closure|DateInterval|string|int|null $years - * @param int|null $months - * @param int|null $weeks - * @param int|null $days - * @param int|null $hours - * @param int|null $minutes - * @param int|null $seconds - * @param int|null $microseconds + * @param int|float|null $months + * @param int|float|null $weeks + * @param int|float|null $days + * @param int|float|null $hours + * @param int|float|null $minutes + * @param int|float|null $seconds + * @param int|float|null $microseconds * * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval. */ @@ -380,8 +402,9 @@ public function __construct($years = 1, $months = null, $weeks = null, $days = n } $spec = $years; + $isStringSpec = (\is_string($spec) && !preg_match('/^[\d.]/', $spec)); - if (!\is_string($spec) || (float) $years || preg_match('/^[\d.]/', $years)) { + if (!$isStringSpec || (float) $years) { $spec = static::PERIOD_PREFIX; $spec .= $years > 0 ? $years.static::PERIOD_YEARS : ''; @@ -406,7 +429,74 @@ public function __construct($years = 1, $months = null, $weeks = null, $days = n } } - parent::__construct($spec); + try { + parent::__construct($spec); + } catch (Throwable $exception) { + try { + parent::__construct('PT0S'); + + if ($isStringSpec) { + if (!preg_match('/^P + (?:(?[+-]?\d*(?:\.\d+)?)Y)? + (?:(?[+-]?\d*(?:\.\d+)?)M)? + (?:(?[+-]?\d*(?:\.\d+)?)W)? + (?:(?[+-]?\d*(?:\.\d+)?)D)? + (?:T + (?:(?[+-]?\d*(?:\.\d+)?)H)? + (?:(?[+-]?\d*(?:\.\d+)?)M)? + (?:(?[+-]?\d*(?:\.\d+)?)S)? + )? + $/x', $spec, $match)) { + throw new InvalidArgumentException("Invalid duration: $spec"); + } + + $years = (float) ($match['year'] ?? 0); + $this->assertSafeForInteger('year', $years); + $months = (float) ($match['month'] ?? 0); + $this->assertSafeForInteger('month', $months); + $weeks = (float) ($match['week'] ?? 0); + $this->assertSafeForInteger('week', $weeks); + $days = (float) ($match['day'] ?? 0); + $this->assertSafeForInteger('day', $days); + $hours = (float) ($match['hour'] ?? 0); + $this->assertSafeForInteger('hour', $hours); + $minutes = (float) ($match['minute'] ?? 0); + $this->assertSafeForInteger('minute', $minutes); + $seconds = (float) ($match['second'] ?? 0); + $this->assertSafeForInteger('second', $seconds); + } + + $totalDays = (($weeks * static::getDaysPerWeek()) + $days); + $this->assertSafeForInteger('days total (including weeks)', $totalDays); + + $this->y = (int) $years; + $this->m = (int) $months; + $this->d = (int) $totalDays; + $this->h = (int) $hours; + $this->i = (int) $minutes; + $this->s = (int) $seconds; + + if ( + ((float) $this->y) !== $years || + ((float) $this->m) !== $months || + ((float) $this->d) !== $totalDays || + ((float) $this->h) !== $hours || + ((float) $this->i) !== $minutes || + ((float) $this->s) !== $seconds + ) { + $this->add(static::fromString( + ($years - $this->y).' years '. + ($months - $this->m).' months '. + ($totalDays - $this->d).' days '. + ($hours - $this->h).' hours '. + ($minutes - $this->i).' minutes '. + ($seconds - $this->s).' seconds ' + )); + } + } catch (Throwable $secondException) { + throw $secondException instanceof OutOfRangeException ? $secondException : $exception; + } + } if ($microseconds !== null) { $this->f = $microseconds / Carbon::MICROSECONDS_PER_SECOND; @@ -682,6 +772,23 @@ public static function __callStatic($method, $parameters) } } + /** + * Evaluate the PHP generated by var_export() and recreate the exported CarbonInterval instance. + * + * @param array $dump data as exported by var_export() + * + * @return static + */ + #[ReturnTypeWillChange] + public static function __set_state($dump) + { + /** @noinspection PhpVoidFunctionResultUsedInspection */ + /** @var DateInterval $dateInterval */ + $dateInterval = parent::__set_state($dump); + + return static::instance($dateInterval); + } + /** * Return the current context from inside a macro callee or a new one if static. * @@ -952,11 +1059,18 @@ public function cast(string $className) * set the $days field. * * @param DateInterval $interval + * @param bool $skipCopy set to true to return the passed object + * (without copying it) if it's already of the + * current class * * @return static */ - public static function instance(DateInterval $interval, array $skip = []) + public static function instance(DateInterval $interval, array $skip = [], bool $skipCopy = false) { + if ($skipCopy && $interval instanceof static) { + return $interval; + } + return self::castIntervalToClass($interval, static::class, $skip); } @@ -968,17 +1082,20 @@ public static function instance(DateInterval $interval, array $skip = []) * * @param mixed|int|DateInterval|string|Closure|null $interval interval or number of the given $unit * @param string|null $unit if specified, $interval must be an integer + * @param bool $skipCopy set to true to return the passed object + * (without copying it) if it's already of the + * current class * * @return static|null */ - public static function make($interval, $unit = null) + public static function make($interval, $unit = null, bool $skipCopy = false) { if ($unit) { $interval = "$interval ".Carbon::pluralUnit($unit); } if ($interval instanceof DateInterval) { - return static::instance($interval); + return static::instance($interval, [], $skipCopy); } if ($interval instanceof Closure) { @@ -1004,8 +1121,14 @@ protected static function makeFromString(string $interval) return static::fromString($interval); } - /** @var static $interval */ - $interval = static::createFromDateString($interval); + // @codeCoverageIgnoreStart + try { + /** @var static $interval */ + $interval = static::createFromDateString($interval); + } catch (DateMalformedIntervalStringException $e) { + return null; + } + // @codeCoverageIgnoreEnd return !$interval || $interval->isEmpty() ? null : $interval; } @@ -1138,43 +1261,63 @@ public function set($name, $value = null) foreach ($properties as $key => $value) { switch (Carbon::singularUnit(rtrim($key, 'z'))) { case 'year': + $this->checkIntegerValue($key, $value); $this->y = $value; + $this->handleDecimalPart('year', $value, $this->y); break; case 'month': + $this->checkIntegerValue($key, $value); $this->m = $value; + $this->handleDecimalPart('month', $value, $this->m); break; case 'week': - $this->d = $value * (int) static::getDaysPerWeek(); + $this->checkIntegerValue($key, $value); + $days = $value * (int) static::getDaysPerWeek(); + $this->assertSafeForInteger('days total (including weeks)', $days); + $this->d = $days; + $this->handleDecimalPart('day', $days, $this->d); break; case 'day': + $this->checkIntegerValue($key, $value); $this->d = $value; + $this->handleDecimalPart('day', $value, $this->d); break; case 'daysexcludeweek': case 'dayzexcludeweek': - $this->d = $this->weeks * (int) static::getDaysPerWeek() + $value; + $this->checkIntegerValue($key, $value); + $days = $this->weeks * (int) static::getDaysPerWeek() + $value; + $this->assertSafeForInteger('days total (including weeks)', $days); + $this->d = $days; + $this->handleDecimalPart('day', $days, $this->d); break; case 'hour': + $this->checkIntegerValue($key, $value); $this->h = $value; + $this->handleDecimalPart('hour', $value, $this->h); break; case 'minute': + $this->checkIntegerValue($key, $value); $this->i = $value; + $this->handleDecimalPart('minute', $value, $this->i); break; case 'second': + $this->checkIntegerValue($key, $value); $this->s = $value; + $this->handleDecimalPart('second', $value, $this->s); break; @@ -2834,4 +2977,78 @@ private function needsDeclension(string $mode, int $index, int $parts): bool return true; } } + + private function checkIntegerValue(string $name, $value) + { + if (\is_int($value)) { + return; + } + + $this->assertSafeForInteger($name, $value); + + if (\is_float($value) && (((float) (int) $value) === $value)) { + return; + } + + if (!self::$floatSettersEnabled) { + $type = \gettype($value); + @trigger_error( + "Since 2.70.0, it's deprecated to pass $type value for $name.\n". + "It's truncated when stored as an integer interval unit.\n". + "From 3.0.0, decimal part will no longer be truncated and will be cascaded to smaller units.\n". + "- To maintain the current behavior, use explicit cast: $name((int) \$value)\n". + "- To adopt the new behavior globally, call CarbonInterval::enableFloatSetters()\n", + \E_USER_DEPRECATED + ); + } + } + + /** + * Throw an exception if precision loss when storing the given value as an integer would be >= 1.0. + */ + private function assertSafeForInteger(string $name, $value) + { + if ($value && !\is_int($value) && ($value >= 0x7fffffffffffffff || $value <= -0x7fffffffffffffff)) { + throw new OutOfRangeException($name, -0x7fffffffffffffff, 0x7fffffffffffffff, $value); + } + } + + private function handleDecimalPart(string $unit, $value, $integerValue) + { + if (self::$floatSettersEnabled) { + $floatValue = (float) $value; + $base = (float) $integerValue; + + if ($floatValue === $base) { + return; + } + + $units = [ + 'y' => 'year', + 'm' => 'month', + 'd' => 'day', + 'h' => 'hour', + 'i' => 'minute', + 's' => 'second', + ]; + $upper = true; + + foreach ($units as $property => $name) { + if ($name === $unit) { + $upper = false; + + continue; + } + + if (!$upper && $this->$property !== 0) { + throw new RuntimeException( + "You cannot set $unit to a float value as $name would be overridden, ". + 'set it first to 0 explicitly if you really want to erase its value' + ); + } + } + + $this->add($unit, $floatValue - $base); + } + } } diff --git a/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php index 01679142ea..d12a986971 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ b/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -51,43 +51,47 @@ * @property-read CarbonInterface $end Period end date. * @property-read CarbonInterval $interval Underlying date interval instance. Always present, one day by default. * - * @method static CarbonPeriod start($date, $inclusive = null) Create instance specifying start date or modify the start date if called on an instance. - * @method static CarbonPeriod since($date, $inclusive = null) Alias for start(). - * @method static CarbonPeriod sinceNow($inclusive = null) Create instance with start date set to now or set the start date to now if called on an instance. - * @method static CarbonPeriod end($date = null, $inclusive = null) Create instance specifying end date or modify the end date if called on an instance. - * @method static CarbonPeriod until($date = null, $inclusive = null) Alias for end(). - * @method static CarbonPeriod untilNow($inclusive = null) Create instance with end date set to now or set the end date to now if called on an instance. - * @method static CarbonPeriod dates($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. - * @method static CarbonPeriod between($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. - * @method static CarbonPeriod recurrences($recurrences = null) Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance. - * @method static CarbonPeriod times($recurrences = null) Alias for recurrences(). - * @method static CarbonPeriod options($options = null) Create instance with options or modify the options if called on an instance. - * @method static CarbonPeriod toggle($options, $state = null) Create instance with options toggled on or off, or toggle options if called on an instance. - * @method static CarbonPeriod filter($callback, $name = null) Create instance with filter added to the stack or append a filter if called on an instance. - * @method static CarbonPeriod push($callback, $name = null) Alias for filter(). - * @method static CarbonPeriod prepend($callback, $name = null) Create instance with filter prepended to the stack or prepend a filter if called on an instance. - * @method static CarbonPeriod filters(array $filters = []) Create instance with filters stack or replace the whole filters stack if called on an instance. - * @method static CarbonPeriod interval($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod each($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod every($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod step($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod stepBy($interval) Create instance with given date interval or modify the interval if called on an instance. - * @method static CarbonPeriod invert() Create instance with inverted date interval or invert the interval if called on an instance. - * @method static CarbonPeriod years($years = 1) Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance. - * @method static CarbonPeriod year($years = 1) Alias for years(). - * @method static CarbonPeriod months($months = 1) Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance. - * @method static CarbonPeriod month($months = 1) Alias for months(). - * @method static CarbonPeriod weeks($weeks = 1) Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance. - * @method static CarbonPeriod week($weeks = 1) Alias for weeks(). - * @method static CarbonPeriod days($days = 1) Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance. - * @method static CarbonPeriod dayz($days = 1) Alias for days(). - * @method static CarbonPeriod day($days = 1) Alias for days(). - * @method static CarbonPeriod hours($hours = 1) Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance. - * @method static CarbonPeriod hour($hours = 1) Alias for hours(). - * @method static CarbonPeriod minutes($minutes = 1) Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance. - * @method static CarbonPeriod minute($minutes = 1) Alias for minutes(). - * @method static CarbonPeriod seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance. - * @method static CarbonPeriod second($seconds = 1) Alias for seconds(). + * @method static static start($date, $inclusive = null) Create instance specifying start date or modify the start date if called on an instance. + * @method static static since($date, $inclusive = null) Alias for start(). + * @method static static sinceNow($inclusive = null) Create instance with start date set to now or set the start date to now if called on an instance. + * @method static static end($date = null, $inclusive = null) Create instance specifying end date or modify the end date if called on an instance. + * @method static static until($date = null, $inclusive = null) Alias for end(). + * @method static static untilNow($inclusive = null) Create instance with end date set to now or set the end date to now if called on an instance. + * @method static static dates($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. + * @method static static between($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. + * @method static static recurrences($recurrences = null) Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance. + * @method static static times($recurrences = null) Alias for recurrences(). + * @method static static options($options = null) Create instance with options or modify the options if called on an instance. + * @method static static toggle($options, $state = null) Create instance with options toggled on or off, or toggle options if called on an instance. + * @method static static filter($callback, $name = null) Create instance with filter added to the stack or append a filter if called on an instance. + * @method static static push($callback, $name = null) Alias for filter(). + * @method static static prepend($callback, $name = null) Create instance with filter prepended to the stack or prepend a filter if called on an instance. + * @method static static filters(array $filters = []) Create instance with filters stack or replace the whole filters stack if called on an instance. + * @method static static interval($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static each($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static every($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static step($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static stepBy($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static invert() Create instance with inverted date interval or invert the interval if called on an instance. + * @method static static years($years = 1) Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance. + * @method static static year($years = 1) Alias for years(). + * @method static static months($months = 1) Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance. + * @method static static month($months = 1) Alias for months(). + * @method static static weeks($weeks = 1) Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance. + * @method static static week($weeks = 1) Alias for weeks(). + * @method static static days($days = 1) Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance. + * @method static static dayz($days = 1) Alias for days(). + * @method static static day($days = 1) Alias for days(). + * @method static static hours($hours = 1) Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance. + * @method static static hour($hours = 1) Alias for hours(). + * @method static static minutes($minutes = 1) Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance. + * @method static static minute($minutes = 1) Alias for minutes(). + * @method static static seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance. + * @method static static second($seconds = 1) Alias for seconds(). + * @method static static milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds for date interval or replace the interval by the given a number of milliseconds if called on an instance. + * @method static static millisecond($milliseconds = 1) Alias for milliseconds(). + * @method static static microseconds($microseconds = 1) Create instance specifying a number of microseconds for date interval or replace the interval by the given a number of microseconds if called on an instance. + * @method static static microsecond($microseconds = 1) Alias for microseconds(). * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. @@ -234,6 +238,13 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable */ public const END_MAX_ATTEMPTS = 10000; + /** + * Default date class of iteration items. + * + * @var string + */ + protected const DEFAULT_DATE_CLASS = Carbon::class; + /** * The registered macros. * @@ -493,15 +504,16 @@ protected static function parseIso8601($iso) $interval = null; $start = null; $end = null; + $dateClass = static::DEFAULT_DATE_CLASS; foreach (explode('/', $iso) as $key => $part) { if ($key === 0 && preg_match('/^R(\d*|INF)$/', $part, $match)) { $parsed = \strlen($match[1]) ? (($match[1] !== 'INF') ? (int) $match[1] : INF) : null; } elseif ($interval === null && $parsed = CarbonInterval::make($part)) { $interval = $part; - } elseif ($start === null && $parsed = Carbon::make($part)) { + } elseif ($start === null && $parsed = $dateClass::make($part)) { $start = $part; - } elseif ($end === null && $parsed = Carbon::make(static::addMissingParts($start ?? '', $part))) { + } elseif ($end === null && $parsed = $dateClass::make(static::addMissingParts($start ?? '', $part))) { $end = $part; } else { throw new InvalidPeriodParameterException("Invalid ISO 8601 specification: $iso."); @@ -514,7 +526,7 @@ protected static function parseIso8601($iso) } /** - * Add missing parts of the target date from the soure date. + * Add missing parts of the target date from the source date. * * @param string $source * @param string $target @@ -632,6 +644,10 @@ public static function __callStatic($method, $parameters) */ public function __construct(...$arguments) { + if (is_a($this->dateClass, DateTimeImmutable::class, true)) { + $this->options = static::IMMUTABLE; + } + // Parse and assign arguments one by one. First argument may be an ISO 8601 spec, // which will be first parsed into parts and then processed the same way. @@ -659,6 +675,8 @@ public function __construct(...$arguments) } } + $optionsSet = false; + foreach ($arguments as $argument) { $parsedDate = null; @@ -682,15 +700,17 @@ public function __construct(...$arguments) $this->setEndDate($parsedDate); } elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) { $this->setRecurrences($argument); - } elseif ($this->options === null && (\is_int($argument) || $argument === null)) { - $this->setOptions($argument); + } elseif (!$optionsSet && (\is_int($argument) || $argument === null)) { + $optionsSet = true; + $this->setOptions(((int) $this->options) | ((int) $argument)); } else { throw new InvalidPeriodParameterException('Invalid constructor parameters.'); } } if ($this->startDate === null) { - $this->setStartDate(Carbon::now()); + $dateClass = $this->dateClass; + $this->setStartDate($dateClass::now()); } if ($this->dateInterval === null) { @@ -1805,13 +1825,19 @@ public function __call($method, $parameters) case 'minute': case 'seconds': case 'second': + case 'milliseconds': + case 'millisecond': + case 'microseconds': + case 'microsecond': return $this->setDateInterval(( // Override default P1D when instantiating via fluent setters. [$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method] )(...$parameters)); } - if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { + $dateClass = $this->dateClass; + + if ($this->localStrictModeEnabled ?? $dateClass::isStrictModeEnabled()) { throw new UnknownMethodException($method); } @@ -2008,7 +2034,7 @@ public function map(callable $callback) /** * Determines if the instance is equal to another. - * Warning: if options differ, instances wil never be equal. + * Warning: if options differ, instances will never be equal. * * @param mixed $period * @@ -2023,7 +2049,7 @@ public function eq($period): bool /** * Determines if the instance is equal to another. - * Warning: if options differ, instances wil never be equal. + * Warning: if options differ, instances will never be equal. * * @param mixed $period * @@ -2046,7 +2072,7 @@ public function equalTo($period): bool /** * Determines if the instance is not equal to another. - * Warning: if options differ, instances wil never be equal. + * Warning: if options differ, instances will never be equal. * * @param mixed $period * @@ -2061,7 +2087,7 @@ public function ne($period): bool /** * Determines if the instance is not equal to another. - * Warning: if options differ, instances wil never be equal. + * Warning: if options differ, instances will never be equal. * * @param mixed $period * @@ -2670,7 +2696,9 @@ private function makeDateTime($value): ?DateTimeInterface !preg_match('/^R\d/', $value) && preg_match('/[a-z\d]/i', $value) ) { - return Carbon::parse($value, $this->tzName); + $dateClass = $this->dateClass; + + return $dateClass::parse($value, $this->tzName); } } diff --git a/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php b/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php index cda0733f50..f0d0ee2811 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php +++ b/api/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php @@ -13,6 +13,13 @@ class CarbonPeriodImmutable extends CarbonPeriod { + /** + * Default date class of iteration items. + * + * @var string + */ + protected const DEFAULT_DATE_CLASS = CarbonImmutable::class; + /** * Date class of iteration items. * diff --git a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php b/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php deleted file mode 100644 index ccc457fcd2..0000000000 --- a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -interface CarbonDoctrineType -{ - public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform); - - public function convertToPHPValue($value, AbstractPlatform $platform); - - public function convertToDatabaseValue($value, AbstractPlatform $platform); -} diff --git a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php b/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php deleted file mode 100644 index bf476a77e5..0000000000 --- a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrineType -{ - /** - * {@inheritdoc} - * - * @return string - */ - public function getName() - { - return 'carbon_immutable'; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function requiresSQLCommentHint(AbstractPlatform $platform) - { - return true; - } -} diff --git a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php b/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php deleted file mode 100644 index 9289d84d34..0000000000 --- a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Doctrine; - -use Doctrine\DBAL\Platforms\AbstractPlatform; - -class CarbonType extends DateTimeType implements CarbonDoctrineType -{ - /** - * {@inheritdoc} - * - * @return string - */ - public function getName() - { - return 'carbon'; - } - - /** - * {@inheritdoc} - * - * @return bool - */ - public function requiresSQLCommentHint(AbstractPlatform $platform) - { - return true; - } -} diff --git a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php b/api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php deleted file mode 100644 index 29b0bb955e..0000000000 --- a/api/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php +++ /dev/null @@ -1,16 +0,0 @@ - */ - use CarbonTypeConverter; -} diff --git a/api/vendor/nesbot/carbon/src/Carbon/Factory.php b/api/vendor/nesbot/carbon/src/Carbon/Factory.php index a4a496c899..d497535f77 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Factory.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Factory.php @@ -231,7 +231,7 @@ * You should rather use the ->settings() method. * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * @method mixed withTestNow($testNow, $callback) Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then * clearing the test instance. * /!\ Use this method for unit tests only. diff --git a/api/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php b/api/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php index 67088f21c9..d88a1cf67f 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php +++ b/api/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php @@ -12,6 +12,9 @@ namespace Carbon; use Closure; +use DateTimeImmutable; +use DateTimeZone; +use Psr\Clock\ClockInterface; /** * A factory to generate CarbonImmutable instances with common settings. @@ -111,7 +114,6 @@ * @method CarbonImmutable maxValue() Create a Carbon instance for the greatest supported date. * @method CarbonImmutable minValue() Create a Carbon instance for the lowest supported date. * @method void mixin($mixin) Mix another object into the class. - * @method CarbonImmutable now($tz = null) Get a Carbon instance for the current date and time. * @method CarbonImmutable parse($time = null, $tz = null) Create a carbon instance from a string. * This is an alias for the constructor that allows better fluent syntax * as it allows you to do Carbon::parse('Monday next week')->fn() rather @@ -229,7 +231,7 @@ * You should rather use the ->settings() method. * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants * are available for quarters, years, decade, centuries, millennia (singular and plural forms). - * @method mixed withTestNow($testNow = null, $callback = null) Temporarily sets a static date to be used within the callback. + * @method mixed withTestNow($testNow, $callback) Temporarily sets a static date to be used within the callback. * Using setTestNow to set the date, executing the callback, then * clearing the test instance. * /!\ Use this method for unit tests only. @@ -237,7 +239,21 @@ * * */ -class FactoryImmutable extends Factory +class FactoryImmutable extends Factory implements ClockInterface { protected $className = CarbonImmutable::class; + + /** + * Get a Carbon instance for the current date and time. + * + * @param DateTimeZone|string|int|null $tz + * + * @return CarbonImmutable + */ + public function now($tz = null): DateTimeImmutable + { + $className = $this->className; + + return new $className(null, $tz); + } } diff --git a/api/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php b/api/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php index e2dd81db54..10d9cd8f1a 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php @@ -11,4 +11,12 @@ return array_replace_recursive(require __DIR__.'/en.php', [ 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], ]); diff --git a/api/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/api/vendor/nesbot/carbon/src/Carbon/Lang/hu.php index b2d2ac1137..b7583eecd7 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Lang/hu.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Lang/hu.php @@ -82,7 +82,7 @@ 'second_before' => ':count másodperccel', 's_before' => ':count másodperccel', 'months' => ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], - 'months_short' => ['jan.', 'feb.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'], + 'months_short' => ['jan.', 'febr.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'], 'weekdays' => ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], 'weekdays_short' => ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], 'weekdays_min' => ['v', 'h', 'k', 'sze', 'cs', 'p', 'sz'], diff --git a/api/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/api/vendor/nesbot/carbon/src/Carbon/Lang/ms.php index 36934eeb1c..c9e80854f9 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Lang/ms.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Lang/ms.php @@ -48,7 +48,7 @@ 'ago' => ':time yang lepas', 'from_now' => ':time dari sekarang', 'after' => ':time kemudian', - 'before' => ':time lepas', + 'before' => ':time sebelum', 'diff_now' => 'sekarang', 'diff_today' => 'Hari', 'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?', diff --git a/api/vendor/nesbot/carbon/src/Carbon/Lang/sk.php b/api/vendor/nesbot/carbon/src/Carbon/Lang/sk.php index 08af197cfe..f9702e960c 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Lang/sk.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Lang/sk.php @@ -33,33 +33,87 @@ * - Marek Adamický * - AlterwebStudio */ + +use Carbon\CarbonInterface; + +$fromNow = function ($time) { + return 'o '.strtr($time, [ + 'hodina' => 'hodinu', + 'minúta' => 'minútu', + 'sekunda' => 'sekundu', + ]); +}; + +$ago = function ($time) { + $replacements = [ + '/\bhodina\b/' => 'hodinou', + '/\bminúta\b/' => 'minútou', + '/\bsekunda\b/' => 'sekundou', + '/\bdeň\b/u' => 'dňom', + '/\btýždeň\b/u' => 'týždňom', + '/\bmesiac\b/' => 'mesiacom', + '/\brok\b/' => 'rokom', + ]; + + $replacementsPlural = [ + '/\bhodiny\b/' => 'hodinami', + '/\bminúty\b/' => 'minútami', + '/\bsekundy\b/' => 'sekundami', + '/\bdni\b/' => 'dňami', + '/\btýždne\b/' => 'týždňami', + '/\bmesiace\b/' => 'mesiacmi', + '/\broky\b/' => 'rokmi', + ]; + + foreach ($replacements + $replacementsPlural as $pattern => $replacement) { + $time = preg_replace($pattern, $replacement, $time); + } + + return "pred $time"; +}; + return [ - 'year' => 'rok|:count roky|:count rokov', + 'year' => ':count rok|:count roky|:count rokov', + 'a_year' => 'rok|:count roky|:count rokov', 'y' => ':count r', - 'month' => 'mesiac|:count mesiace|:count mesiacov', + 'month' => ':count mesiac|:count mesiace|:count mesiacov', + 'a_month' => 'mesiac|:count mesiace|:count mesiacov', 'm' => ':count m', - 'week' => 'týždeň|:count týždne|:count týždňov', + 'week' => ':count týždeň|:count týždne|:count týždňov', + 'a_week' => 'týždeň|:count týždne|:count týždňov', 'w' => ':count t', - 'day' => 'deň|:count dni|:count dní', + 'day' => ':count deň|:count dni|:count dní', + 'a_day' => 'deň|:count dni|:count dní', 'd' => ':count d', - 'hour' => 'hodinu|:count hodiny|:count hodín', + 'hour' => ':count hodina|:count hodiny|:count hodín', + 'a_hour' => 'hodina|:count hodiny|:count hodín', 'h' => ':count h', - 'minute' => 'minútu|:count minúty|:count minút', + 'minute' => ':count minúta|:count minúty|:count minút', + 'a_minute' => 'minúta|:count minúty|:count minút', 'min' => ':count min', - 'second' => 'sekundu|:count sekundy|:count sekúnd', - 'a_second' => 'pár sekúnd|:count sekundy|:count sekúnd', + 'second' => ':count sekunda|:count sekundy|:count sekúnd', + 'a_second' => 'sekunda|:count sekundy|:count sekúnd', 's' => ':count s', - 'ago' => 'pred :time', - 'from_now' => 'o :time', - 'after' => ':time po', + 'millisecond' => ':count milisekunda|:count milisekundy|:count milisekúnd', + 'a_millisecond' => 'milisekunda|:count milisekundy|:count milisekúnd', + 'ms' => ':count ms', + 'microsecond' => ':count mikrosekunda|:count mikrosekundy|:count mikrosekúnd', + 'a_microsecond' => 'mikrosekunda|:count mikrosekundy|:count mikrosekúnd', + 'µs' => ':count µs', + + 'ago' => $ago, + 'from_now' => $fromNow, 'before' => ':time pred', - 'year_ago' => 'rokom|:count rokmi|:count rokmi', - 'month_ago' => 'mesiacom|:count mesiacmi|:count mesiacmi', - 'week_ago' => 'týždňom|:count týždňami|:count týždňami', - 'day_ago' => 'dňom|:count dňami|:count dňami', - 'hour_ago' => 'hodinou|:count hodinami|:count hodinami', - 'minute_ago' => 'minútou|:count minútami|:count minútami', - 'second_ago' => 'sekundou|:count sekundami|:count sekundami', + 'after' => ':time po', + + 'hour_after' => ':count hodinu|:count hodiny|:count hodín', + 'minute_after' => ':count minútu|:count minúty|:count minút', + 'second_after' => ':count sekundu|:count sekundy|:count sekúnd', + + 'hour_before' => ':count hodinu|:count hodiny|:count hodín', + 'minute_before' => ':count minútu|:count minúty|:count minút', + 'second_before' => ':count sekundu|:count sekundy|:count sekúnd', + 'first_day_of_week' => 1, 'day_of_first_week_of_year' => 4, 'list' => [', ', ' a '], @@ -74,8 +128,26 @@ 'LLL' => 'D. M. HH:mm', 'LLLL' => 'dddd D. MMMM YYYY HH:mm', ], + 'calendar' => [ + 'sameDay' => '[dnes o] LT', + 'nextDay' => '[zajtra o] LT', + 'lastDay' => '[včera o] LT', + 'nextWeek' => 'dddd [o] LT', + 'lastWeek' => static function (CarbonInterface $date) { + switch ($date->dayOfWeek) { + case 1: + case 2: + case 4: + case 5: + return '[minulý] dddd [o] LT'; //pondelok/utorok/štvrtok/piatok + default: + return '[minulá] dddd [o] LT'; + } + }, + 'sameElse' => 'L', + ], 'weekdays' => ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'], - 'weekdays_short' => ['ned', 'pod', 'uto', 'str', 'štv', 'pia', 'sob'], + 'weekdays_short' => ['ned', 'pon', 'uto', 'str', 'štv', 'pia', 'sob'], 'weekdays_min' => ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'], 'months' => ['január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december'], 'months_short' => ['jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec'], diff --git a/api/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/api/vendor/nesbot/carbon/src/Carbon/Lang/sl.php index b000e30e3d..1f1d1b3381 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Lang/sl.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Lang/sl.php @@ -51,7 +51,7 @@ 'year_ago' => ':count letom|:count letoma|:count leti|:count leti', 'y_ago' => ':count letom|:count letoma|:count leti|:count leti', - 'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci', + 'month_ago' => ':count mesecem|:count mesecema|:count meseci|:count meseci', 'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni', 'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', 'd_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', diff --git a/api/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/api/vendor/nesbot/carbon/src/Carbon/Lang/uk.php index 1d5ba703f1..4217d16edb 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Lang/uk.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Lang/uk.php @@ -55,7 +55,7 @@ */ return [ 'year' => ':count рік|:count роки|:count років', - 'y' => ':countр', + 'y' => ':countр|:countрр|:countрр', 'a_year' => '{1}рік|:count рік|:count роки|:count років', 'month' => ':count місяць|:count місяці|:count місяців', 'm' => ':countм', diff --git a/api/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php b/api/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php index a230b06315..c054808764 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php +++ b/api/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php @@ -15,11 +15,13 @@ use Symfony\Component\Translation\Formatter\MessageFormatter; use Symfony\Component\Translation\Formatter\MessageFormatterInterface; +// @codeCoverageIgnoreStart $transMethod = new ReflectionMethod(MessageFormatterInterface::class, 'format'); require $transMethod->getParameters()[0]->hasType() ? __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php' : __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php'; +// @codeCoverageIgnoreEnd final class MessageFormatterMapper extends LazyMessageFormatter { diff --git a/api/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php b/api/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php index 5123d1e745..fde67b36aa 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php +++ b/api/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php @@ -70,11 +70,9 @@ abstract class AbstractMacro implements BuiltinMethodReflection /** * Macro constructor. * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName - * @param callable $macro + * @param class-string $className + * @param string $methodName + * @param callable $macro */ public function __construct(string $className, string $methodName, $macro) { diff --git a/api/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php b/api/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php index c88e49e578..eb8957d4d0 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php +++ b/api/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php @@ -36,10 +36,8 @@ public function __construct(ReflectionProvider $reflectionProvider) /** * Return true if the given pair class-method is a Carbon macro. * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName + * @param class-string $className + * @param string $methodName * * @return bool */ @@ -61,10 +59,8 @@ public function hasMethod(string $className, string $methodName): bool /** * Return the Macro for a given pair class-method. * - * @param string $className - * @phpstan-param class-string $className - * - * @param string $methodName + * @param class-string $className + * @param string $methodName * * @throws ReflectionException * diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php index f6261d882d..daee19cc9f 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php @@ -994,6 +994,10 @@ public function is(string $tester) return $this->year === (int) $tester; } + if (preg_match('/^(?:Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)$/i', $tester)) { + return $this->isSameMonth(static::parse($tester), false); + } + if (preg_match('/^\d{3,}-\d{1,2}$/', $tester)) { return $this->isSameMonth(static::parse($tester)); } diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php index d73dad54da..0d611ea22e 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php @@ -19,6 +19,8 @@ use Carbon\Exceptions\OutOfRangeException; use Carbon\Translator; use Closure; +use DateMalformedStringException; +use DateTimeImmutable; use DateTimeInterface; use DateTimeZone; use Exception; @@ -112,7 +114,7 @@ private function constructTimezoneFromDateTime(DateTimeInterface $date, &$tz) $safeTz = static::safeCreateDateTimeZone($tz); if ($safeTz) { - return $date->setTimezone($safeTz); + return ($date instanceof DateTimeImmutable ? $date : clone $date)->setTimezone($safeTz); } return $date; @@ -184,7 +186,13 @@ public static function rawParse($time = null, $tz = null) try { return new static($time, $tz); } catch (Exception $exception) { - $date = @static::now($tz)->change($time); + // @codeCoverageIgnoreStart + try { + $date = @static::now($tz)->change($time); + } catch (DateMalformedStringException $ignoredException) { + $date = null; + } + // @codeCoverageIgnoreEnd if (!$date) { throw new InvalidFormatException("Could not parse '$time': ".$exception->getMessage(), 0, $exception); @@ -634,6 +642,10 @@ public static function rawCreateFromFormat($format, $time, $tz = null) $time = preg_replace('/^(.*)(am|pm|AM|PM)(.*)$/U', '$1$3 $2', $time); } + if ($tz === false) { + $tz = null; + } + // First attempt to create an instance, so that error messages are based on the unmodified format. $date = self::createFromFormatAndTimezone($format, $time, $tz); $lastErrors = parent::getLastErrors(); @@ -651,12 +663,14 @@ public static function rawCreateFromFormat($format, $time, $tz = null) $tz = clone $mock->getTimezone(); } - // Set microseconds to zero to match behavior of DateTime::createFromFormat() - // See https://bugs.php.net/bug.php?id=74332 - $mock = $mock->copy()->microsecond(0); + $mock = $mock->copy(); // Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag. if (!preg_match("/{$nonEscaped}[!|]/", $format)) { + if (preg_match('/[HhGgisvuB]/', $format)) { + $mock = $mock->setTime(0, 0); + } + $format = static::MOCK_DATETIME_FORMAT.' '.$format; $time = ($mock instanceof self ? $mock->rawFormat(static::MOCK_DATETIME_FORMAT) : $mock->format(static::MOCK_DATETIME_FORMAT)).' '.$time; } diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Date.php index da3775c21a..8ae5c17819 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -2310,6 +2310,7 @@ public static function getFormatsToIsoReplacements() 'c' => true, 'r' => true, 'U' => true, + 'T' => true, ]; } diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php index a9868ebf82..ab5b65d234 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php @@ -298,9 +298,9 @@ public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null */ public function diffInWeekdays($date = null, $absolute = true) { - return $this->diffInDaysFiltered(function (CarbonInterface $date) { + return $this->diffInDaysFiltered(static function (CarbonInterface $date) { return $date->isWeekday(); - }, $date, $absolute); + }, $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), $absolute); } /** @@ -313,9 +313,9 @@ public function diffInWeekdays($date = null, $absolute = true) */ public function diffInWeekendDays($date = null, $absolute = true) { - return $this->diffInDaysFiltered(function (CarbonInterface $date) { + return $this->diffInDaysFiltered(static function (CarbonInterface $date) { return $date->isWeekend(); - }, $date, $absolute); + }, $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), $absolute); } /** diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php index 4cd66b676f..f069c280d7 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php @@ -40,7 +40,7 @@ protected function roundWith($precision, $function) $unit = 'second'; if ($precision instanceof DateInterval) { - $precision = (string) CarbonInterval::instance($precision); + $precision = (string) CarbonInterval::instance($precision, [], true); } if (\is_string($precision) && preg_match('/^\s*(?\d+)?\s*(?\w+)(?\W.*)?$/', $precision, $match)) { diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php index ff249566f2..46aff113e5 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -23,6 +23,7 @@ use Symfony\Contracts\Translation\LocaleAwareInterface; use Symfony\Contracts\Translation\TranslatorInterface as ContractsTranslatorInterface; +// @codeCoverageIgnoreStart if (interface_exists('Symfony\\Contracts\\Translation\\TranslatorInterface') && !interface_exists('Symfony\\Component\\Translation\\TranslatorInterface') ) { @@ -31,6 +32,7 @@ class_alias( 'Symfony\\Component\\Translation\\TranslatorInterface' ); } +// @codeCoverageIgnoreEnd /** * Trait Localization. diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php index 595c287b37..5822454564 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php @@ -11,6 +11,9 @@ namespace Carbon\Traits; +use Carbon\CarbonInterface; +use Carbon\CarbonInterval; +use Carbon\CarbonPeriod; use Closure; use Generator; use ReflectionClass; @@ -99,12 +102,13 @@ private static function loadMixinTrait($trait) { $context = eval(self::getAnonymousClassCodeForTrait($trait)); $className = \get_class($context); + $baseClass = static::class; foreach (self::getMixableMethods($context) as $name) { $closureBase = Closure::fromCallable([$context, $name]); - static::macro($name, function () use ($closureBase, $className) { - /** @phpstan-ignore-next-line */ + static::macro($name, function (...$parameters) use ($closureBase, $className, $baseClass) { + $downContext = isset($this) ? ($this) : new $baseClass(); $context = isset($this) ? $this->cast($className) : new $className(); try { @@ -117,7 +121,48 @@ private static function loadMixinTrait($trait) // in case of errors not converted into exceptions $closure = $closure ?: $closureBase; - return $closure(...\func_get_args()); + $result = $closure(...$parameters); + + if (!($result instanceof $className)) { + return $result; + } + + if ($downContext instanceof CarbonInterface && $result instanceof CarbonInterface) { + if ($context !== $result) { + $downContext = $downContext->copy(); + } + + return $downContext + ->setTimezone($result->getTimezone()) + ->modify($result->format('Y-m-d H:i:s.u')) + ->settings($result->getSettings()); + } + + if ($downContext instanceof CarbonInterval && $result instanceof CarbonInterval) { + if ($context !== $result) { + $downContext = $downContext->copy(); + } + + $downContext->copyProperties($result); + self::copyStep($downContext, $result); + self::copyNegativeUnits($downContext, $result); + + return $downContext->settings($result->getSettings()); + } + + if ($downContext instanceof CarbonPeriod && $result instanceof CarbonPeriod) { + if ($context !== $result) { + $downContext = $downContext->copy(); + } + + return $downContext + ->setDates($result->getStartDate(), $result->getEndDate()) + ->setRecurrences($result->getRecurrences()) + ->setOptions($result->getOptions()) + ->settings($result->getSettings()); + } + + return $result; }); } } diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Options.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Options.php index 9bb3071f57..ffad4f14b2 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Options.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Options.php @@ -22,7 +22,7 @@ * * Depends on the following methods: * - * @method \Carbon\Carbon|\Carbon\CarbonImmutable shiftTimezone($timezone) Set the timezone + * @method static shiftTimezone($timezone) Set the timezone */ trait Options { @@ -96,9 +96,9 @@ trait Options 'v' => '([0-9]{1,3})', 'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\\/[a-zA-Z]*)', 'I' => '(0|1)', - 'O' => '([+-](1[012]|0[0-9])[0134][05])', - 'P' => '([+-](1[012]|0[0-9]):[0134][05])', - 'p' => '(Z|[+-](1[012]|0[0-9]):[0134][05])', + 'O' => '([+-](1[0123]|0[0-9])[0134][05])', + 'P' => '([+-](1[0123]|0[0-9]):[0134][05])', + 'p' => '(Z|[+-](1[0123]|0[0-9]):[0134][05])', 'T' => '([a-zA-Z]{1,5})', 'Z' => '(-?[1-5]?[0-9]{1,4})', 'U' => '([0-9]*)', @@ -422,7 +422,7 @@ public function getSettings() foreach ($map as $property => $key) { $value = $this->$property ?? null; - if ($value !== null) { + if ($value !== null && ($key !== 'locale' || $value !== 'en' || $this->localTranslator)) { $settings[$key] = $value; } } @@ -437,7 +437,7 @@ public function getSettings() */ public function __debugInfo() { - $infos = array_filter(get_object_vars($this), function ($var) { + $infos = array_filter(get_object_vars($this), static function ($var) { return $var; }); diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php index f98c2a32b5..85ff5a711f 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -57,7 +57,6 @@ public function roundUnit($unit, $precision = 1, $function = 'round') 'microsecond' => [0, 999999], ]); $factor = 1; - $initialMonth = $this->month; if ($normalizedUnit === 'week') { $normalizedUnit = 'day'; @@ -130,16 +129,13 @@ public function roundUnit($unit, $precision = 1, $function = 'round') $normalizedValue = floor($function(($value - $minimum) / $precision) * $precision + $minimum); /** @var CarbonInterface $result */ - $result = $this->$normalizedUnit($normalizedValue); + $result = $this; foreach ($changes as $unit => $value) { $result = $result->$unit($value); } - return $normalizedUnit === 'month' && $precision <= 1 && abs($result->month - $initialMonth) === 2 - // Re-run the change in case an overflow occurred - ? $result->$normalizedUnit($normalizedValue) - : $result; + return $result->$normalizedUnit($normalizedValue); } /** diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php index 53fead69ea..c1d5c5e139 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php @@ -146,7 +146,7 @@ public function __sleep() public function __serialize(): array { // @codeCoverageIgnoreStart - if (isset($this->timezone_type)) { + if (isset($this->timezone_type, $this->timezone, $this->date)) { return [ 'date' => $this->date ?? null, 'timezone_type' => $this->timezone_type, diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Test.php index e0c9e80683..f23c72e8fd 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Test.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Test.php @@ -119,12 +119,14 @@ public static function setTestNowAndTimezone($testNow = null, $tz = null) * * /!\ Use this method for unit tests only. * + * @template T + * * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param Closure(): T $callback * - * @return mixed + * @return T */ - public static function withTestNow($testNow = null, $callback = null) + public static function withTestNow($testNow, $callback) { static::setTestNow($testNow); diff --git a/api/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/api/vendor/nesbot/carbon/src/Carbon/Traits/Units.php index f4f797d9b3..5be14ec7ef 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/Traits/Units.php +++ b/api/vendor/nesbot/carbon/src/Carbon/Traits/Units.php @@ -17,6 +17,7 @@ use Carbon\Exceptions\UnitException; use Closure; use DateInterval; +use DateMalformedStringException; use ReturnTypeWillChange; /** @@ -197,7 +198,7 @@ public function rawAdd(DateInterval $interval) public function add($unit, $value = 1, $overflow = null) { if (\is_string($unit) && \func_num_args() === 1) { - $unit = CarbonInterval::make($unit); + $unit = CarbonInterval::make($unit, [], true); } if ($unit instanceof CarbonConverterInterface) { @@ -304,12 +305,17 @@ public function addUnit($unit, $value = 1, $overflow = null) $unit = 'second'; $value = $second; } - $date = $date->modify("$value $unit"); - if (isset($timeString)) { - $date = $date->setTimeFromTimeString($timeString); - } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { - $date = $date->modify('last day of previous month'); + try { + $date = $date->modify("$value $unit"); + + if (isset($timeString)) { + $date = $date->setTimeFromTimeString($timeString); + } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date->day) { + $date = $date->modify('last day of previous month'); + } + } catch (DateMalformedStringException $ignoredException) { // @codeCoverageIgnore + $date = null; // @codeCoverageIgnore } if (!$date) { @@ -362,7 +368,7 @@ public function rawSub(DateInterval $interval) public function sub($unit, $value = 1, $overflow = null) { if (\is_string($unit) && \func_num_args() === 1) { - $unit = CarbonInterval::make($unit); + $unit = CarbonInterval::make($unit, [], true); } if ($unit instanceof CarbonConverterInterface) { @@ -398,7 +404,7 @@ public function sub($unit, $value = 1, $overflow = null) public function subtract($unit, $value = 1, $overflow = null) { if (\is_string($unit) && \func_num_args() === 1) { - $unit = CarbonInterval::make($unit); + $unit = CarbonInterval::make($unit, [], true); } return $this->sub($unit, $value, $overflow); diff --git a/api/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php b/api/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php index ad36c6704f..ce6b2f90ac 100644 --- a/api/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php +++ b/api/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php @@ -66,7 +66,7 @@ public function setTranslations($messages) /** * @codeCoverageIgnore */ - public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void { $this->disallowMutation(__METHOD__); diff --git a/api/vendor/nikic/php-parser/README.md b/api/vendor/nikic/php-parser/README.md index 36de23cde1..edb3ed32f3 100644 --- a/api/vendor/nikic/php-parser/README.md +++ b/api/vendor/nikic/php-parser/README.md @@ -3,24 +3,24 @@ PHP Parser [![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master) -This is a PHP 5.2 to PHP 8.2 parser written in PHP. Its purpose is to simplify static code analysis and +This is a PHP parser written in PHP. Its purpose is to simplify static code analysis and manipulation. -[**Documentation for version 4.x**][doc_4_x] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.2). +[**Documentation for version 5.x**][doc_master] (current; for running on PHP >= 7.4; for parsing PHP 7.0 to PHP 8.4, with limited support for parsing PHP 5.x). -[Documentation for version 3.x][doc_3_x] (unsupported; for running on PHP >= 5.5; for parsing PHP 5.2 to PHP 7.2). +[Documentation for version 4.x][doc_4_x] (supported; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.3). Features -------- The main features provided by this library are: - * Parsing PHP 5, PHP 7, and PHP 8 code into an abstract syntax tree (AST). + * Parsing PHP 7, and PHP 8 code into an abstract syntax tree (AST). * Invalid code can be parsed into a partial AST. * The AST contains accurate location information. * Dumping the AST in human-readable form. * Converting an AST back to PHP code. - * Experimental: Formatting can be preserved for partially changed ASTs. + * Formatting can be preserved for partially changed ASTs. * Infrastructure to traverse and modify ASTs. * Resolution of namespaced names. * Evaluation of constant expressions. @@ -51,7 +51,7 @@ function test($foo) } CODE; -$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7); +$parser = (new ParserFactory())->createForNewestSupportedVersion(); try { $ast = $parser->parse($code); } catch (Error $error) { @@ -68,12 +68,17 @@ This dumps an AST looking something like this: ``` array( 0: Stmt_Function( + attrGroups: array( + ) byRef: false name: Identifier( name: test ) params: array( 0: Param( + attrGroups: array( + ) + flags: 0 type: null byRef: false variadic: false @@ -88,12 +93,11 @@ array( 0: Stmt_Expression( expr: Expr_FuncCall( name: Name( - parts: array( - 0: var_dump - ) + name: var_dump ) args: array( 0: Arg( + name: null value: Expr_Variable( name: foo ) @@ -135,12 +139,16 @@ This gives us an AST where the `Function_::$stmts` are empty: ``` array( 0: Stmt_Function( + attrGroups: array( + ) byRef: false name: Identifier( name: test ) params: array( 0: Param( + attrGroups: array( + ) type: null byRef: false variadic: false @@ -203,9 +211,8 @@ Component documentation: * [AST builders](doc/component/AST_builders.markdown) * Fluent builders for AST nodes * [Lexer](doc/component/Lexer.markdown) - * Lexer options - * Token and file positions for nodes - * Custom attributes + * Emulation + * Tokens, positions and attributes * [Error handling](doc/component/Error_handling.markdown) * Column information for errors * Error recovery (parsing of syntactically incorrect code) @@ -223,3 +230,4 @@ Component documentation: [doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc [doc_4_x]: https://github.com/nikic/PHP-Parser/tree/4.x/doc + [doc_master]: https://github.com/nikic/PHP-Parser/tree/master/doc diff --git a/api/vendor/nikic/php-parser/bin/php-parse b/api/vendor/nikic/php-parser/bin/php-parse index bb3e46df4b..fc44f234c5 100644 --- a/api/vendor/nikic/php-parser/bin/php-parse +++ b/api/vendor/nikic/php-parser/bin/php-parse @@ -26,13 +26,7 @@ if (empty($files)) { showHelp("Must specify at least one file."); } -$lexer = new PhpParser\Lexer\Emulative(['usedAttributes' => [ - 'startLine', 'endLine', 'startFilePos', 'endFilePos', 'comments' -]]); -$parser = (new PhpParser\ParserFactory)->create( - PhpParser\ParserFactory::PREFER_PHP7, - $lexer -); +$parser = (new PhpParser\ParserFactory())->createForVersion($attributes['version']); $dumper = new PhpParser\NodeDumper([ 'dumpComments' => true, 'dumpPositions' => $attributes['with-positions'], @@ -43,7 +37,10 @@ $traverser = new PhpParser\NodeTraverser(); $traverser->addVisitor(new PhpParser\NodeVisitor\NameResolver); foreach ($files as $file) { - if (strpos($file, ' Stdin:\n"); + } else if (strpos($file, ' Code $code\n"); } else { @@ -108,7 +105,7 @@ function showHelp($error = '') { if ($error) { fwrite(STDERR, $error . "\n\n"); } - fwrite($error ? STDERR : STDOUT, << false, 'with-positions' => false, 'with-recovery' => false, + 'version' => PhpParser\PhpVersion::getNewestSupported(), ]; array_shift($args); @@ -193,7 +192,9 @@ function parseArgs($args) { $parseOptions = false; break; default: - if ($arg[0] === '-') { + if (preg_match('/^--version=(.*)$/', $arg, $matches)) { + $attributes['version'] = PhpParser\PhpVersion::fromString($matches[1]); + } elseif ($arg[0] === '-' && \strlen($arg[0]) > 1) { showHelp("Invalid operation $arg."); } else { $files[] = $arg; diff --git a/api/vendor/nikic/php-parser/composer.json b/api/vendor/nikic/php-parser/composer.json index 2fd064a212..b52f3ee57d 100644 --- a/api/vendor/nikic/php-parser/composer.json +++ b/api/vendor/nikic/php-parser/composer.json @@ -13,16 +13,18 @@ } ], "require": { - "php": ">=7.0", - "ext-tokenizer": "*" + "php": ">=7.4", + "ext-tokenizer": "*", + "ext-json": "*", + "ext-ctype": "*" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0", + "phpunit/phpunit": "^9.0", "ircmaxell/php-yacc": "^0.0.7" }, "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { diff --git a/api/vendor/nikic/php-parser/grammar/README.md b/api/vendor/nikic/php-parser/grammar/README.md deleted file mode 100644 index 4bae11d826..0000000000 --- a/api/vendor/nikic/php-parser/grammar/README.md +++ /dev/null @@ -1,30 +0,0 @@ -What do all those files mean? -============================= - - * `php5.y`: PHP 5 grammar written in a pseudo language - * `php7.y`: PHP 7 grammar written in a pseudo language - * `tokens.y`: Tokens definition shared between PHP 5 and PHP 7 grammars - * `parser.template`: A `kmyacc` parser prototype file for PHP - * `tokens.template`: A `kmyacc` prototype file for the `Tokens` class - * `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc` - -.phpy pseudo language -===================== - -The `.y` file is a normal grammar in `kmyacc` (`yacc`) style, with some transformations -applied to it: - - * Nodes are created using the syntax `Name[..., ...]`. This is transformed into - `new Name(..., ..., attributes())` - * Some function-like constructs are resolved (see `rebuildParsers.php` for a list) - -Building the parser -=================== - -Run `php grammar/rebuildParsers.php` to rebuild the parsers. Additional options: - - * The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary. - By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you - need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked). - * The `--debug` option enables emission of debug symbols and creates the `y.output` file. - * The `--keep-tmp-grammar` option preserves the preprocessed grammar file. diff --git a/api/vendor/nikic/php-parser/grammar/parser.template b/api/vendor/nikic/php-parser/grammar/parser.template deleted file mode 100644 index 6166607c9e..0000000000 --- a/api/vendor/nikic/php-parser/grammar/parser.template +++ /dev/null @@ -1,106 +0,0 @@ -semValue -#semval($,%t) $this->semValue -#semval(%n) $stackPos-(%l-%n) -#semval(%n,%t) $stackPos-(%l-%n) - -namespace PhpParser\Parser; - -use PhpParser\Error; -use PhpParser\Node; -use PhpParser\Node\Expr; -use PhpParser\Node\Name; -use PhpParser\Node\Scalar; -use PhpParser\Node\Stmt; -#include; - -/* This is an automatically GENERATED file, which should not be manually edited. - * Instead edit one of the following: - * * the grammar files grammar/php5.y or grammar/php7.y - * * the skeleton file grammar/parser.template - * * the preprocessing script grammar/rebuildParsers.php - */ -class #(-p) extends \PhpParser\ParserAbstract -{ - protected $tokenToSymbolMapSize = #(YYMAXLEX); - protected $actionTableSize = #(YYLAST); - protected $gotoTableSize = #(YYGLAST); - - protected $invalidSymbol = #(YYBADCH); - protected $errorSymbol = #(YYINTERRTOK); - protected $defaultAction = #(YYDEFAULT); - protected $unexpectedTokenRule = #(YYUNEXPECTED); - - protected $YY2TBLSTATE = #(YY2TBLSTATE); - protected $numNonLeafStates = #(YYNLSTATES); - - protected $symbolToName = array( - #listvar terminals - ); - - protected $tokenToSymbol = array( - #listvar yytranslate - ); - - protected $action = array( - #listvar yyaction - ); - - protected $actionCheck = array( - #listvar yycheck - ); - - protected $actionBase = array( - #listvar yybase - ); - - protected $actionDefault = array( - #listvar yydefault - ); - - protected $goto = array( - #listvar yygoto - ); - - protected $gotoCheck = array( - #listvar yygcheck - ); - - protected $gotoBase = array( - #listvar yygbase - ); - - protected $gotoDefault = array( - #listvar yygdefault - ); - - protected $ruleToNonTerminal = array( - #listvar yylhs - ); - - protected $ruleToLength = array( - #listvar yylen - ); -#if -t - - protected $productions = array( - #production-strings; - ); -#endif - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ -#reduce - %n => function ($stackPos) { - %b - }, -#noact - %n => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, -#endreduce - ]; - } -} -#tailcode; diff --git a/api/vendor/nikic/php-parser/grammar/php5.y b/api/vendor/nikic/php-parser/grammar/php5.y deleted file mode 100644 index 2920deadd1..0000000000 --- a/api/vendor/nikic/php-parser/grammar/php5.y +++ /dev/null @@ -1,1046 +0,0 @@ -%pure_parser -%expect 6 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC -; - -identifier_ex: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_name ';' - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations ';' { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations ';' { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration ';' { $$ = $1; } - | T_CONST constant_declaration_list ';' { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - inline_use_declarations ',' inline_use_declaration { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - constant_declaration_list ',' constant_declaration { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_ex '=' static_scalar { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF parentheses_expr statement elseif_list else_single - { $$ = Stmt\If_[$2, ['stmts' => toArray($3), 'elseifs' => $4, 'else' => $5]]; } - | T_IF parentheses_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$2, ['stmts' => $4, 'elseifs' => $5, 'else' => $6]]; } - | T_WHILE parentheses_expr while_statement { $$ = Stmt\While_[$2, $3]; } - | T_DO statement T_WHILE parentheses_expr ';' { $$ = Stmt\Do_ [$4, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH parentheses_expr switch_case_list { $$ = Stmt\Switch_[$2, $3]; } - | T_BREAK ';' { $$ = Stmt\Break_[null]; } - | T_BREAK expr ';' { $$ = Stmt\Break_[$2]; } - | T_CONTINUE ';' { $$ = Stmt\Continue_[null]; } - | T_CONTINUE expr ';' { $$ = Stmt\Continue_[$2]; } - | T_RETURN ';' { $$ = Stmt\Return_[null]; } - | T_RETURN expr ';' { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list ';' { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list ';' { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list ';' { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | yield_expr ';' { $$ = Stmt\Expression[$1]; } - | expr ';' { $$ = Stmt\Expression[$1]; } - | T_UNSET '(' variables_list ')' ';' { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_THROW expr ';' { $$ = Stmt\Throw_[$2]; } - | T_GOTO identifier ';' { $$ = Stmt\Goto_[$2]; } - | identifier ':' { $$ = Stmt\Label[$1]; } - | expr error { $$ = Stmt\Expression[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -catch: - T_CATCH '(' name plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[array($3), $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - variable { init($1); } - | variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -identifier_maybe_readonly: - identifier { $$ = $1; } - | T_READONLY { $$ = Node\Identifier[$1]; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier_maybe_readonly '(' parameter_list ')' optional_return_type '{' inner_statement_list '}' - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $9]]; } -; - -class_declaration_statement: - class_entry_type identifier extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6]]; - $this->checkClass($$, #2); } - | T_INTERFACE identifier interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$2, ['extends' => $3, 'stmts' => $5]]; - $this->checkInterface($$, #2); } - | T_TRAIT identifier '{' class_statement_list '}' - { $$ = Stmt\Trait_[$2, ['stmts' => $4]]; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | T_ABSTRACT T_CLASS { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL T_CLASS { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - class_name { init($1); } - | class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - declare_list_element { init($1); } - | declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier '=' static_scalar { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF parentheses_expr statement { $$ = Stmt\ElseIf_[$2, toArray($3)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF parentheses_expr ':' inner_statement_list { $$ = Stmt\ElseIf_[$2, $4]; } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -parameter: - optional_param_type optional_arg_ref optional_ellipsis plain_variable - { $$ = Node\Param[$4, null, $1, $2, $3]; $this->checkParam($$); } - | optional_param_type optional_arg_ref optional_ellipsis plain_variable '=' static_scalar - { $$ = Node\Param[$4, $6, $1, $2, $3]; $this->checkParam($$); } -; - -type: - name { $$ = $1; } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -optional_param_type: - /* empty */ { $$ = null; } - | type { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = array(Node\Arg[$2, false, false]); } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } -; - -global_var_list: - global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - plain_variable { $$ = $1; } - | '$' variable { $$ = Expr\Variable[$2]; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -static_var_list: - static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' static_scalar { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - variable_modifiers property_declaration_list ';' - { $$ = Stmt\Property[$1, $2]; $this->checkProperty($$, #1); } - | T_CONST class_const_list ';' { $$ = Stmt\ClassConst[$2, 0]; } - | method_modifiers T_FUNCTION optional_ref identifier_ex '(' parameter_list ')' optional_return_type method_body - { $$ = Stmt\ClassMethod[$4, ['type' => $1, 'byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9]]; - $this->checkClassMethod($$, #1); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_ex ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_ex { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | '{' inner_statement_list '}' { $$ = $2; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } -; - -property_declaration_list: - property_declaration { init($1); } - | property_declaration_list ',' property_declaration { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' static_scalar { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list: - expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | variable '=' ampersand new_expr { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | parentheses_expr { $$ = $1; } - /* we need a separate '(' new_expr ')' rule to avoid problems caused by a s/r conflict */ - | '(' new_expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' variables_list ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL parentheses_expr { $$ = Expr\Eval_[$2]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | array_expr { $$ = $1; } - | scalar_dereference { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $9]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type - '{' inner_statement_list '}' - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $10]]; } -; - -parentheses_expr: - '(' expr ')' { $$ = $2; } - | '(' yield_expr ')' { $$ = $2; } -; - -yield_expr: - T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } -; - -array_expr: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -scalar_dereference: - array_expr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[Scalar\String_::fromString($1, attributes()), $3]; } - | constant '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | scalar_dereference '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -anonymous_class: - T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $3, 'implements' => $4, 'stmts' => $6]], $2); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - lexical_var { init($1); } - | lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -name_readonly: - T_READONLY { $$ = Name[$1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | name_readonly argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '{' expr '}' argument_list - { $$ = Expr\StaticCall[$1, $4, $6]; } - | static_property argument_list - { $$ = $this->fixupPhp5StaticPropCall($1, $2, attributes()); } - | variable_without_objects argument_list - { $$ = Expr\FuncCall[$1, $2]; } - | function_call '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | dynamic_class_name_reference { $$ = $1; } -; - -dynamic_class_name_reference: - object_access_for_dcnr { $$ = $1; } - | base_variable { $$ = $1; } -; - -class_name_or_var: - class_name { $$ = $1; } - | reference_variable { $$ = $1; } -; - -object_access_for_dcnr: - base_variable T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | object_access_for_dcnr '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access_for_dcnr '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' ')' { $$ = null; } - | parentheses_expr { $$ = $1; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`', false)]); } - | encaps_list { parseEncapsed($1, '`', false); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -common_scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes(), true); } - | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); } - | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes(), false); } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), false); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), false); } -; - -static_scalar: - common_scalar { $$ = $1; } - | class_name T_PAAMAYIM_NEKUDOTAYIM identifier_ex { $$ = Expr\ClassConstFetch[$1, $3]; } - | name { $$ = Expr\ConstFetch[$1]; } - | T_ARRAY '(' static_array_pair_list ')' { $$ = Expr\Array_[$3]; } - | '[' static_array_pair_list ']' { $$ = Expr\Array_[$2]; } - | static_operation { $$ = $1; } -; - -static_operation: - static_scalar T_BOOLEAN_OR static_scalar { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | static_scalar T_BOOLEAN_AND static_scalar { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | static_scalar T_LOGICAL_OR static_scalar { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | static_scalar T_LOGICAL_AND static_scalar { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | static_scalar T_LOGICAL_XOR static_scalar { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | static_scalar '|' static_scalar { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | static_scalar T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG static_scalar - { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | static_scalar '^' static_scalar { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | static_scalar '.' static_scalar { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | static_scalar '+' static_scalar { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | static_scalar '-' static_scalar { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | static_scalar '*' static_scalar { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | static_scalar '/' static_scalar { $$ = Expr\BinaryOp\Div [$1, $3]; } - | static_scalar '%' static_scalar { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | static_scalar T_SL static_scalar { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | static_scalar T_SR static_scalar { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | static_scalar T_POW static_scalar { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' static_scalar %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' static_scalar %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' static_scalar { $$ = Expr\BooleanNot[$2]; } - | '~' static_scalar { $$ = Expr\BitwiseNot[$2]; } - | static_scalar T_IS_IDENTICAL static_scalar { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | static_scalar T_IS_NOT_IDENTICAL static_scalar { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | static_scalar T_IS_EQUAL static_scalar { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | static_scalar T_IS_NOT_EQUAL static_scalar { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | static_scalar '<' static_scalar { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | static_scalar T_IS_SMALLER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | static_scalar '>' static_scalar { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | static_scalar T_IS_GREATER_OR_EQUAL static_scalar { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | static_scalar '?' static_scalar ':' static_scalar { $$ = Expr\Ternary[$1, $3, $5]; } - | static_scalar '?' ':' static_scalar { $$ = Expr\Ternary[$1, null, $4]; } - | static_scalar '[' static_scalar ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | '(' static_scalar ')' { $$ = $2; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_ex - { $$ = Expr\ClassConstFetch[$1, $3]; } -; - -scalar: - common_scalar { $$ = $1; } - | constant { $$ = $1; } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -static_array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_static_array_pair_list optional_comma { $$ = $1; } -; - -optional_comma: - /* empty */ - | ',' -; - -non_empty_static_array_pair_list: - non_empty_static_array_pair_list ',' static_array_pair { push($1, $3); } - | static_array_pair { init($1); } -; - -static_array_pair: - static_scalar T_DOUBLE_ARROW static_scalar { $$ = Expr\ArrayItem[$3, $1, false]; } - | static_scalar { $$ = Expr\ArrayItem[$1, null, false]; } -; - -variable: - object_access { $$ = $1; } - | base_variable { $$ = $1; } - | function_call { $$ = $1; } - | new_expr_array_deref { $$ = $1; } -; - -new_expr_array_deref: - '(' new_expr ')' '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$2, $5]; } - | new_expr_array_deref '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - /* alternative array syntax missing intentionally */ -; - -object_access: - variable_or_new_expr T_OBJECT_OPERATOR object_property - { $$ = Expr\PropertyFetch[$1, $3]; } - | variable_or_new_expr T_OBJECT_OPERATOR object_property argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | object_access argument_list { $$ = Expr\FuncCall[$1, $2]; } - | object_access '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | object_access '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -variable_or_new_expr: - variable { $$ = $1; } - | '(' new_expr ')' { $$ = $2; } -; - -variable_without_objects: - reference_variable { $$ = $1; } - | '$' variable_without_objects { $$ = Expr\Variable[$2]; } -; - -base_variable: - variable_without_objects { $$ = $1; } - | static_property { $$ = $1; } -; - -static_property: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' reference_variable - { $$ = Expr\StaticPropertyFetch[$1, $4]; } - | static_property_with_arrays { $$ = $1; } -; - -static_property_simple_name: - T_VARIABLE - { $var = parseVar($1); $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_property_with_arrays: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_property_simple_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '$' '{' expr '}' - { $$ = Expr\StaticPropertyFetch[$1, $5]; } - | static_property_with_arrays '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | static_property_with_arrays '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } -; - -reference_variable: - reference_variable '[' dim_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | reference_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } -; - -dim_offset: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -object_property: - identifier { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | variable_without_objects { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' list_expr_elements ')' { $$ = Expr\List_[$3]; } -; - -list_expr_elements: - list_expr_elements ',' list_expr_element { push($1, $3); } - | list_expr_element { init($1); } -; - -list_expr_element: - variable { $$ = Expr\ArrayItem[$1, null, false]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | /* empty */ { $$ = null; } -; - -array_pair_list: - /* empty */ { $$ = array(); } - | non_empty_array_pair_list optional_comma { $$ = $1; } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier { $$ = Expr\PropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/api/vendor/nikic/php-parser/grammar/php7.y b/api/vendor/nikic/php-parser/grammar/php7.y deleted file mode 100644 index 1f9b4bdd20..0000000000 --- a/api/vendor/nikic/php-parser/grammar/php7.y +++ /dev/null @@ -1,1235 +0,0 @@ -%pure_parser -%expect 2 - -%tokens - -%% - -start: - top_statement_list { $$ = $this->handleNamespaces($1); } -; - -top_statement_list_ex: - top_statement_list_ex top_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -top_statement_list: - top_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -ampersand: - T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG -; - -reserved_non_modifiers: - T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND - | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE - | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH - | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO - | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT - | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS - | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_HALT_COMPILER | T_FN - | T_MATCH | T_ENUM -; - -semi_reserved: - reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY -; - -identifier_maybe_reserved: - T_STRING { $$ = Node\Identifier[$1]; } - | semi_reserved { $$ = Node\Identifier[$1]; } -; - -identifier_not_reserved: - T_STRING { $$ = Node\Identifier[$1]; } -; - -reserved_non_modifiers_identifier: - reserved_non_modifiers { $$ = Node\Identifier[$1]; } -; - -namespace_declaration_name: - T_STRING { $$ = Name[$1]; } - | semi_reserved { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -namespace_name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } -; - -legacy_namespace_name: - namespace_name { $$ = $1; } - | T_NAME_FULLY_QUALIFIED { $$ = Name[substr($1, 1)]; } -; - -plain_variable: - T_VARIABLE { $$ = Expr\Variable[parseVar($1)]; } -; - -semi: - ';' { /* nothing */ } - | error { /* nothing */ } -; - -no_comma: - /* empty */ { /* nothing */ } - | ',' { $this->emitError(new Error('A trailing comma is not allowed here', attributes())); } -; - -optional_comma: - /* empty */ - | ',' -; - -attribute_decl: - class_name { $$ = Node\Attribute[$1, []]; } - | class_name argument_list { $$ = Node\Attribute[$1, $2]; } -; - -attribute_group: - attribute_decl { init($1); } - | attribute_group ',' attribute_decl { push($1, $3); } -; - -attribute: - T_ATTRIBUTE attribute_group optional_comma ']' { $$ = Node\AttributeGroup[$2]; } -; - -attributes: - attribute { init($1); } - | attributes attribute { push($1, $2); } -; - -optional_attributes: - /* empty */ { $$ = []; } - | attributes { $$ = $1; } -; - -top_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { $$ = Stmt\HaltCompiler[$this->lexer->handleHaltCompiler()]; } - | T_NAMESPACE namespace_declaration_name semi - { $$ = Stmt\Namespace_[$2, null]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($$); } - | T_NAMESPACE namespace_declaration_name '{' top_statement_list '}' - { $$ = Stmt\Namespace_[$2, $4]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_NAMESPACE '{' top_statement_list '}' - { $$ = Stmt\Namespace_[null, $3]; - $$->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($$); } - | T_USE use_declarations semi { $$ = Stmt\Use_[$2, Stmt\Use_::TYPE_NORMAL]; } - | T_USE use_type use_declarations semi { $$ = Stmt\Use_[$3, $2]; } - | group_use_declaration semi { $$ = $1; } - | T_CONST constant_declaration_list semi { $$ = Stmt\Const_[$2]; } -; - -use_type: - T_FUNCTION { $$ = Stmt\Use_::TYPE_FUNCTION; } - | T_CONST { $$ = Stmt\Use_::TYPE_CONSTANT; } -; - -group_use_declaration: - T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' - { $$ = Stmt\GroupUse[$3, $6, $2]; } - | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' - { $$ = Stmt\GroupUse[$2, $5, Stmt\Use_::TYPE_UNKNOWN]; } -; - -unprefixed_use_declarations: - non_empty_unprefixed_use_declarations optional_comma { $$ = $1; } -; - -non_empty_unprefixed_use_declarations: - non_empty_unprefixed_use_declarations ',' unprefixed_use_declaration - { push($1, $3); } - | unprefixed_use_declaration { init($1); } -; - -use_declarations: - non_empty_use_declarations no_comma { $$ = $1; } -; - -non_empty_use_declarations: - non_empty_use_declarations ',' use_declaration { push($1, $3); } - | use_declaration { init($1); } -; - -inline_use_declarations: - non_empty_inline_use_declarations optional_comma { $$ = $1; } -; - -non_empty_inline_use_declarations: - non_empty_inline_use_declarations ',' inline_use_declaration - { push($1, $3); } - | inline_use_declaration { init($1); } -; - -unprefixed_use_declaration: - namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -use_declaration: - legacy_namespace_name - { $$ = Stmt\UseUse[$1, null, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); } - | legacy_namespace_name T_AS identifier_not_reserved - { $$ = Stmt\UseUse[$1, $3, Stmt\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); } -; - -inline_use_declaration: - unprefixed_use_declaration { $$ = $1; $$->type = Stmt\Use_::TYPE_NORMAL; } - | use_type unprefixed_use_declaration { $$ = $2; $$->type = $1; } -; - -constant_declaration_list: - non_empty_constant_declaration_list no_comma { $$ = $1; } -; - -non_empty_constant_declaration_list: - non_empty_constant_declaration_list ',' constant_declaration - { push($1, $3); } - | constant_declaration { init($1); } -; - -constant_declaration: - identifier_not_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -class_const_list: - non_empty_class_const_list no_comma { $$ = $1; } -; - -non_empty_class_const_list: - non_empty_class_const_list ',' class_const { push($1, $3); } - | class_const { init($1); } -; - -class_const: - identifier_maybe_reserved '=' expr { $$ = Node\Const_[$1, $3]; } -; - -inner_statement_list_ex: - inner_statement_list_ex inner_statement { pushNormalizing($1, $2); } - | /* empty */ { init(); } -; - -inner_statement_list: - inner_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -inner_statement: - statement { $$ = $1; } - | function_declaration_statement { $$ = $1; } - | class_declaration_statement { $$ = $1; } - | T_HALT_COMPILER - { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); } -; - -non_empty_statement: - '{' inner_statement_list '}' - { - if ($2) { - $$ = $2; prependLeadingComments($$); - } else { - makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if (null === $$) { $$ = array(); } - } - } - | T_IF '(' expr ')' statement elseif_list else_single - { $$ = Stmt\If_[$3, ['stmts' => toArray($5), 'elseifs' => $6, 'else' => $7]]; } - | T_IF '(' expr ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' - { $$ = Stmt\If_[$3, ['stmts' => $6, 'elseifs' => $7, 'else' => $8]]; } - | T_WHILE '(' expr ')' while_statement { $$ = Stmt\While_[$3, $5]; } - | T_DO statement T_WHILE '(' expr ')' ';' { $$ = Stmt\Do_ [$5, toArray($2)]; } - | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement - { $$ = Stmt\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; } - | T_SWITCH '(' expr ')' switch_case_list { $$ = Stmt\Switch_[$3, $5]; } - | T_BREAK optional_expr semi { $$ = Stmt\Break_[$2]; } - | T_CONTINUE optional_expr semi { $$ = Stmt\Continue_[$2]; } - | T_RETURN optional_expr semi { $$ = Stmt\Return_[$2]; } - | T_GLOBAL global_var_list semi { $$ = Stmt\Global_[$2]; } - | T_STATIC static_var_list semi { $$ = Stmt\Static_[$2]; } - | T_ECHO expr_list_forbid_comma semi { $$ = Stmt\Echo_[$2]; } - | T_INLINE_HTML { $$ = Stmt\InlineHTML[$1]; } - | expr semi { - $e = $1; - if ($e instanceof Expr\Throw_) { - // For backwards-compatibility reasons, convert throw in statement position into - // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_). - $$ = Stmt\Throw_[$e->expr]; - } else { - $$ = Stmt\Expression[$e]; - } - } - | T_UNSET '(' variables_list ')' semi { $$ = Stmt\Unset_[$3]; } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { $$ = Stmt\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; } - | T_FOREACH '(' expr error ')' foreach_statement - { $$ = Stmt\Foreach_[$3, new Expr\Error(stackAttributes(#4)), ['stmts' => $6]]; } - | T_DECLARE '(' declare_list ')' declare_statement { $$ = Stmt\Declare_[$3, $5]; } - | T_TRY '{' inner_statement_list '}' catches optional_finally - { $$ = Stmt\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); } - | T_GOTO identifier_not_reserved semi { $$ = Stmt\Goto_[$2]; } - | identifier_not_reserved ':' { $$ = Stmt\Label[$1]; } - | error { $$ = array(); /* means: no statement */ } -; - -statement: - non_empty_statement { $$ = $1; } - | ';' - { makeNop($$, $this->startAttributeStack[#1], $this->endAttributes); - if ($$ === null) $$ = array(); /* means: no statement */ } -; - -catches: - /* empty */ { init(); } - | catches catch { push($1, $2); } -; - -name_union: - name { init($1); } - | name_union '|' name { push($1, $3); } -; - -catch: - T_CATCH '(' name_union optional_plain_variable ')' '{' inner_statement_list '}' - { $$ = Stmt\Catch_[$3, $4, $7]; } -; - -optional_finally: - /* empty */ { $$ = null; } - | T_FINALLY '{' inner_statement_list '}' { $$ = Stmt\Finally_[$3]; } -; - -variables_list: - non_empty_variables_list optional_comma { $$ = $1; } -; - -non_empty_variables_list: - variable { init($1); } - | non_empty_variables_list ',' variable { push($1, $3); } -; - -optional_ref: - /* empty */ { $$ = false; } - | ampersand { $$ = true; } -; - -optional_arg_ref: - /* empty */ { $$ = false; } - | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } -; - -optional_ellipsis: - /* empty */ { $$ = false; } - | T_ELLIPSIS { $$ = true; } -; - -block_or_error: - '{' inner_statement_list '}' { $$ = $2; } - | error { $$ = []; } -; - -identifier_maybe_readonly: - identifier_not_reserved { $$ = $1; } - | T_READONLY { $$ = Node\Identifier[$1]; } -; - -function_declaration_statement: - T_FUNCTION optional_ref identifier_maybe_readonly '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | attributes T_FUNCTION optional_ref identifier_maybe_readonly '(' parameter_list ')' optional_return_type block_or_error - { $$ = Stmt\Function_[$4, ['byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } -; - -class_declaration_statement: - class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6, 'attrGroups' => []]]; - $this->checkClass($$, #2); } - | attributes class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}' - { $$ = Stmt\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkClass($$, #3); } - | optional_attributes T_INTERFACE identifier_not_reserved interface_extends_list '{' class_statement_list '}' - { $$ = Stmt\Interface_[$3, ['extends' => $4, 'stmts' => $6, 'attrGroups' => $1]]; - $this->checkInterface($$, #3); } - | optional_attributes T_TRAIT identifier_not_reserved '{' class_statement_list '}' - { $$ = Stmt\Trait_[$3, ['stmts' => $5, 'attrGroups' => $1]]; } - | optional_attributes T_ENUM identifier_not_reserved enum_scalar_type implements_list '{' class_statement_list '}' - { $$ = Stmt\Enum_[$3, ['scalarType' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]]; - $this->checkEnum($$, #3); } -; - -enum_scalar_type: - /* empty */ { $$ = null; } - | ':' type { $$ = $2; } - -enum_case_expr: - /* empty */ { $$ = null; } - | '=' expr { $$ = $2; } -; - -class_entry_type: - T_CLASS { $$ = 0; } - | class_modifiers T_CLASS { $$ = $1; } -; - -class_modifiers: - class_modifier { $$ = $1; } - | class_modifiers class_modifier { $this->checkClassModifier($1, $2, #2); $$ = $1 | $2; } -; - -class_modifier: - T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -extends_from: - /* empty */ { $$ = null; } - | T_EXTENDS class_name { $$ = $2; } -; - -interface_extends_list: - /* empty */ { $$ = array(); } - | T_EXTENDS class_name_list { $$ = $2; } -; - -implements_list: - /* empty */ { $$ = array(); } - | T_IMPLEMENTS class_name_list { $$ = $2; } -; - -class_name_list: - non_empty_class_name_list no_comma { $$ = $1; } -; - -non_empty_class_name_list: - class_name { init($1); } - | non_empty_class_name_list ',' class_name { push($1, $3); } -; - -for_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOR ';' { $$ = $2; } -; - -foreach_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDFOREACH ';' { $$ = $2; } -; - -declare_statement: - non_empty_statement { $$ = toArray($1); } - | ';' { $$ = null; } - | ':' inner_statement_list T_ENDDECLARE ';' { $$ = $2; } -; - -declare_list: - non_empty_declare_list no_comma { $$ = $1; } -; - -non_empty_declare_list: - declare_list_element { init($1); } - | non_empty_declare_list ',' declare_list_element { push($1, $3); } -; - -declare_list_element: - identifier_not_reserved '=' expr { $$ = Stmt\DeclareDeclare[$1, $3]; } -; - -switch_case_list: - '{' case_list '}' { $$ = $2; } - | '{' ';' case_list '}' { $$ = $3; } - | ':' case_list T_ENDSWITCH ';' { $$ = $2; } - | ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; } -; - -case_list: - /* empty */ { init(); } - | case_list case { push($1, $2); } -; - -case: - T_CASE expr case_separator inner_statement_list_ex { $$ = Stmt\Case_[$2, $4]; } - | T_DEFAULT case_separator inner_statement_list_ex { $$ = Stmt\Case_[null, $3]; } -; - -case_separator: - ':' - | ';' -; - -match: - T_MATCH '(' expr ')' '{' match_arm_list '}' { $$ = Expr\Match_[$3, $6]; } -; - -match_arm_list: - /* empty */ { $$ = []; } - | non_empty_match_arm_list optional_comma { $$ = $1; } -; - -non_empty_match_arm_list: - match_arm { init($1); } - | non_empty_match_arm_list ',' match_arm { push($1, $3); } -; - -match_arm: - expr_list_allow_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[$1, $3]; } - | T_DEFAULT optional_comma T_DOUBLE_ARROW expr { $$ = Node\MatchArm[null, $4]; } -; - -while_statement: - statement { $$ = toArray($1); } - | ':' inner_statement_list T_ENDWHILE ';' { $$ = $2; } -; - -elseif_list: - /* empty */ { init(); } - | elseif_list elseif { push($1, $2); } -; - -elseif: - T_ELSEIF '(' expr ')' statement { $$ = Stmt\ElseIf_[$3, toArray($5)]; } -; - -new_elseif_list: - /* empty */ { init(); } - | new_elseif_list new_elseif { push($1, $2); } -; - -new_elseif: - T_ELSEIF '(' expr ')' ':' inner_statement_list { $$ = Stmt\ElseIf_[$3, $6]; } -; - -else_single: - /* empty */ { $$ = null; } - | T_ELSE statement { $$ = Stmt\Else_[toArray($2)]; } -; - -new_else_single: - /* empty */ { $$ = null; } - | T_ELSE ':' inner_statement_list { $$ = Stmt\Else_[$3]; } -; - -foreach_variable: - variable { $$ = array($1, false); } - | ampersand variable { $$ = array($2, true); } - | list_expr { $$ = array($1, false); } - | array_short_syntax { $$ = array($1, false); } -; - -parameter_list: - non_empty_parameter_list optional_comma { $$ = $1; } - | /* empty */ { $$ = array(); } -; - -non_empty_parameter_list: - parameter { init($1); } - | non_empty_parameter_list ',' parameter { push($1, $3); } -; - -optional_property_modifiers: - /* empty */ { $$ = 0; } - | optional_property_modifiers property_modifier - { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -property_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -parameter: - optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable - { $$ = new Node\Param($6, null, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis plain_variable '=' expr - { $$ = new Node\Param($6, $8, $3, $4, $5, attributes(), $2, $1); - $this->checkParam($$); } - | optional_attributes optional_property_modifiers optional_type_without_static - optional_arg_ref optional_ellipsis error - { $$ = new Node\Param(Expr\Error[], null, $3, $4, $5, attributes(), $2, $1); } -; - -type_expr: - type { $$ = $1; } - | '?' type { $$ = Node\NullableType[$2]; } - | union_type { $$ = Node\UnionType[$1]; } - | intersection_type { $$ = $1; } -; - -type: - type_without_static { $$ = $1; } - | T_STATIC { $$ = Node\Name['static']; } -; - -type_without_static: - name { $$ = $this->handleBuiltinTypes($1); } - | T_ARRAY { $$ = Node\Identifier['array']; } - | T_CALLABLE { $$ = Node\Identifier['callable']; } -; - -union_type_element: - type { $$ = $1; } - | '(' intersection_type ')' { $$ = $2; } -; - -union_type: - union_type_element '|' union_type_element { init($1, $3); } - | union_type '|' union_type_element { push($1, $3); } -; - -union_type_without_static_element: - type_without_static { $$ = $1; } - | '(' intersection_type_without_static ')' { $$ = $2; } -; - -union_type_without_static: - union_type_without_static_element '|' union_type_without_static_element { init($1, $3); } - | union_type_without_static '|' union_type_without_static_element { push($1, $3); } -; - -intersection_type_list: - type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); } - | intersection_type_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type - { push($1, $3); } -; - -intersection_type: - intersection_type_list { $$ = Node\IntersectionType[$1]; } -; - -intersection_type_without_static_list: - type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { init($1, $3); } - | intersection_type_without_static_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static - { push($1, $3); } -; - -intersection_type_without_static: - intersection_type_without_static_list { $$ = Node\IntersectionType[$1]; } -; - -type_expr_without_static: - type_without_static { $$ = $1; } - | '?' type_without_static { $$ = Node\NullableType[$2]; } - | union_type_without_static { $$ = Node\UnionType[$1]; } - | intersection_type_without_static { $$ = $1; } -; - -optional_type_without_static: - /* empty */ { $$ = null; } - | type_expr_without_static { $$ = $1; } -; - -optional_return_type: - /* empty */ { $$ = null; } - | ':' type_expr { $$ = $2; } - | ':' error { $$ = null; } -; - -argument_list: - '(' ')' { $$ = array(); } - | '(' non_empty_argument_list optional_comma ')' { $$ = $2; } - | '(' variadic_placeholder ')' { init($2); } -; - -variadic_placeholder: - T_ELLIPSIS { $$ = Node\VariadicPlaceholder[]; } -; - -non_empty_argument_list: - argument { init($1); } - | non_empty_argument_list ',' argument { push($1, $3); } -; - -argument: - expr { $$ = Node\Arg[$1, false, false]; } - | ampersand variable { $$ = Node\Arg[$2, true, false]; } - | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } - | identifier_maybe_reserved ':' expr - { $$ = new Node\Arg($3, false, false, attributes(), $1); } -; - -global_var_list: - non_empty_global_var_list no_comma { $$ = $1; } -; - -non_empty_global_var_list: - non_empty_global_var_list ',' global_var { push($1, $3); } - | global_var { init($1); } -; - -global_var: - simple_variable { $$ = $1; } -; - -static_var_list: - non_empty_static_var_list no_comma { $$ = $1; } -; - -non_empty_static_var_list: - non_empty_static_var_list ',' static_var { push($1, $3); } - | static_var { init($1); } -; - -static_var: - plain_variable { $$ = Stmt\StaticVar[$1, null]; } - | plain_variable '=' expr { $$ = Stmt\StaticVar[$1, $3]; } -; - -class_statement_list_ex: - class_statement_list_ex class_statement { if ($2 !== null) { push($1, $2); } } - | /* empty */ { init(); } -; - -class_statement_list: - class_statement_list_ex - { makeZeroLengthNop($nop, $this->lookaheadStartAttributes); - if ($nop !== null) { $1[] = $nop; } $$ = $1; } -; - -class_statement: - optional_attributes variable_modifiers optional_type_without_static property_declaration_list semi - { $$ = new Stmt\Property($2, $4, attributes(), $3, $1); - $this->checkProperty($$, #2); } - | optional_attributes method_modifiers T_CONST class_const_list semi - { $$ = new Stmt\ClassConst($4, $2, attributes(), $1); - $this->checkClassConst($$, #2); } - | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')' - optional_return_type method_body - { $$ = Stmt\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; - $this->checkClassMethod($$, #2); } - | T_USE class_name_list trait_adaptations { $$ = Stmt\TraitUse[$2, $3]; } - | optional_attributes T_CASE identifier_maybe_reserved enum_case_expr semi - { $$ = Stmt\EnumCase[$3, $4, $1]; } - | error { $$ = null; /* will be skipped */ } -; - -trait_adaptations: - ';' { $$ = array(); } - | '{' trait_adaptation_list '}' { $$ = $2; } -; - -trait_adaptation_list: - /* empty */ { init(); } - | trait_adaptation_list trait_adaptation { push($1, $2); } -; - -trait_adaptation: - trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';' - { $$ = Stmt\TraitUseAdaptation\Precedence[$1[0], $1[1], $3]; } - | trait_method_reference T_AS member_modifier identifier_maybe_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, $4]; } - | trait_method_reference T_AS member_modifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], $3, null]; } - | trait_method_reference T_AS identifier_not_reserved ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } - | trait_method_reference T_AS reserved_non_modifiers_identifier ';' - { $$ = Stmt\TraitUseAdaptation\Alias[$1[0], $1[1], null, $3]; } -; - -trait_method_reference_fully_qualified: - name T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = array($1, $3); } -; -trait_method_reference: - trait_method_reference_fully_qualified { $$ = $1; } - | identifier_maybe_reserved { $$ = array(null, $1); } -; - -method_body: - ';' /* abstract method */ { $$ = null; } - | block_or_error { $$ = $1; } -; - -variable_modifiers: - non_empty_member_modifiers { $$ = $1; } - | T_VAR { $$ = 0; } -; - -method_modifiers: - /* empty */ { $$ = 0; } - | non_empty_member_modifiers { $$ = $1; } -; - -non_empty_member_modifiers: - member_modifier { $$ = $1; } - | non_empty_member_modifiers member_modifier { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } -; - -member_modifier: - T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } - | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } - | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } - | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } - | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } - | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } - | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } -; - -property_declaration_list: - non_empty_property_declaration_list no_comma { $$ = $1; } -; - -non_empty_property_declaration_list: - property_declaration { init($1); } - | non_empty_property_declaration_list ',' property_declaration - { push($1, $3); } -; - -property_decl_name: - T_VARIABLE { $$ = Node\VarLikeIdentifier[parseVar($1)]; } -; - -property_declaration: - property_decl_name { $$ = Stmt\PropertyProperty[$1, null]; } - | property_decl_name '=' expr { $$ = Stmt\PropertyProperty[$1, $3]; } -; - -expr_list_forbid_comma: - non_empty_expr_list no_comma { $$ = $1; } -; - -expr_list_allow_comma: - non_empty_expr_list optional_comma { $$ = $1; } -; - -non_empty_expr_list: - non_empty_expr_list ',' expr { push($1, $3); } - | expr { init($1); } -; - -for_expr: - /* empty */ { $$ = array(); } - | expr_list_forbid_comma { $$ = $1; } -; - -expr: - variable { $$ = $1; } - | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } - | array_short_syntax '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } - | new_expr { $$ = $1; } - | match { $$ = $1; } - | T_CLONE expr { $$ = Expr\Clone_[$2]; } - | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } - | variable T_MINUS_EQUAL expr { $$ = Expr\AssignOp\Minus [$1, $3]; } - | variable T_MUL_EQUAL expr { $$ = Expr\AssignOp\Mul [$1, $3]; } - | variable T_DIV_EQUAL expr { $$ = Expr\AssignOp\Div [$1, $3]; } - | variable T_CONCAT_EQUAL expr { $$ = Expr\AssignOp\Concat [$1, $3]; } - | variable T_MOD_EQUAL expr { $$ = Expr\AssignOp\Mod [$1, $3]; } - | variable T_AND_EQUAL expr { $$ = Expr\AssignOp\BitwiseAnd[$1, $3]; } - | variable T_OR_EQUAL expr { $$ = Expr\AssignOp\BitwiseOr [$1, $3]; } - | variable T_XOR_EQUAL expr { $$ = Expr\AssignOp\BitwiseXor[$1, $3]; } - | variable T_SL_EQUAL expr { $$ = Expr\AssignOp\ShiftLeft [$1, $3]; } - | variable T_SR_EQUAL expr { $$ = Expr\AssignOp\ShiftRight[$1, $3]; } - | variable T_POW_EQUAL expr { $$ = Expr\AssignOp\Pow [$1, $3]; } - | variable T_COALESCE_EQUAL expr { $$ = Expr\AssignOp\Coalesce [$1, $3]; } - | variable T_INC { $$ = Expr\PostInc[$1]; } - | T_INC variable { $$ = Expr\PreInc [$2]; } - | variable T_DEC { $$ = Expr\PostDec[$1]; } - | T_DEC variable { $$ = Expr\PreDec [$2]; } - | expr T_BOOLEAN_OR expr { $$ = Expr\BinaryOp\BooleanOr [$1, $3]; } - | expr T_BOOLEAN_AND expr { $$ = Expr\BinaryOp\BooleanAnd[$1, $3]; } - | expr T_LOGICAL_OR expr { $$ = Expr\BinaryOp\LogicalOr [$1, $3]; } - | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } - | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } - | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } - | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } - | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } - | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } - | expr '-' expr { $$ = Expr\BinaryOp\Minus [$1, $3]; } - | expr '*' expr { $$ = Expr\BinaryOp\Mul [$1, $3]; } - | expr '/' expr { $$ = Expr\BinaryOp\Div [$1, $3]; } - | expr '%' expr { $$ = Expr\BinaryOp\Mod [$1, $3]; } - | expr T_SL expr { $$ = Expr\BinaryOp\ShiftLeft [$1, $3]; } - | expr T_SR expr { $$ = Expr\BinaryOp\ShiftRight[$1, $3]; } - | expr T_POW expr { $$ = Expr\BinaryOp\Pow [$1, $3]; } - | '+' expr %prec T_INC { $$ = Expr\UnaryPlus [$2]; } - | '-' expr %prec T_INC { $$ = Expr\UnaryMinus[$2]; } - | '!' expr { $$ = Expr\BooleanNot[$2]; } - | '~' expr { $$ = Expr\BitwiseNot[$2]; } - | expr T_IS_IDENTICAL expr { $$ = Expr\BinaryOp\Identical [$1, $3]; } - | expr T_IS_NOT_IDENTICAL expr { $$ = Expr\BinaryOp\NotIdentical [$1, $3]; } - | expr T_IS_EQUAL expr { $$ = Expr\BinaryOp\Equal [$1, $3]; } - | expr T_IS_NOT_EQUAL expr { $$ = Expr\BinaryOp\NotEqual [$1, $3]; } - | expr T_SPACESHIP expr { $$ = Expr\BinaryOp\Spaceship [$1, $3]; } - | expr '<' expr { $$ = Expr\BinaryOp\Smaller [$1, $3]; } - | expr T_IS_SMALLER_OR_EQUAL expr { $$ = Expr\BinaryOp\SmallerOrEqual[$1, $3]; } - | expr '>' expr { $$ = Expr\BinaryOp\Greater [$1, $3]; } - | expr T_IS_GREATER_OR_EQUAL expr { $$ = Expr\BinaryOp\GreaterOrEqual[$1, $3]; } - | expr T_INSTANCEOF class_name_reference { $$ = Expr\Instanceof_[$1, $3]; } - | '(' expr ')' { $$ = $2; } - | expr '?' expr ':' expr { $$ = Expr\Ternary[$1, $3, $5]; } - | expr '?' ':' expr { $$ = Expr\Ternary[$1, null, $4]; } - | expr T_COALESCE expr { $$ = Expr\BinaryOp\Coalesce[$1, $3]; } - | T_ISSET '(' expr_list_allow_comma ')' { $$ = Expr\Isset_[$3]; } - | T_EMPTY '(' expr ')' { $$ = Expr\Empty_[$3]; } - | T_INCLUDE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE]; } - | T_INCLUDE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_INCLUDE_ONCE]; } - | T_EVAL '(' expr ')' { $$ = Expr\Eval_[$3]; } - | T_REQUIRE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE]; } - | T_REQUIRE_ONCE expr { $$ = Expr\Include_[$2, Expr\Include_::TYPE_REQUIRE_ONCE]; } - | T_INT_CAST expr { $$ = Expr\Cast\Int_ [$2]; } - | T_DOUBLE_CAST expr - { $attrs = attributes(); - $attrs['kind'] = $this->getFloatCastKind($1); - $$ = new Expr\Cast\Double($2, $attrs); } - | T_STRING_CAST expr { $$ = Expr\Cast\String_ [$2]; } - | T_ARRAY_CAST expr { $$ = Expr\Cast\Array_ [$2]; } - | T_OBJECT_CAST expr { $$ = Expr\Cast\Object_ [$2]; } - | T_BOOL_CAST expr { $$ = Expr\Cast\Bool_ [$2]; } - | T_UNSET_CAST expr { $$ = Expr\Cast\Unset_ [$2]; } - | T_EXIT exit_expr - { $attrs = attributes(); - $attrs['kind'] = strtolower($1) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $$ = new Expr\Exit_($2, $attrs); } - | '@' expr { $$ = Expr\ErrorSuppress[$2]; } - | scalar { $$ = $1; } - | '`' backticks_expr '`' { $$ = Expr\ShellExec[$2]; } - | T_PRINT expr { $$ = Expr\Print_[$2]; } - | T_YIELD { $$ = Expr\Yield_[null, null]; } - | T_YIELD expr { $$ = Expr\Yield_[$2, null]; } - | T_YIELD expr T_DOUBLE_ARROW expr { $$ = Expr\Yield_[$4, $2]; } - | T_YIELD_FROM expr { $$ = Expr\YieldFrom[$2]; } - | T_THROW expr { $$ = Expr\Throw_[$2]; } - - | T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $2, 'params' => $4, 'returnType' => $6, 'expr' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => []]]; } - | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; } - | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => []]]; } - - | attributes T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => false, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW - { $$ = Expr\ArrowFunction[['static' => true, 'byRef' => $4, 'params' => $6, 'returnType' => $8, 'expr' => $10, 'attrGroups' => $1]]; } - | attributes T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => false, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; } - | attributes T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error - { $$ = Expr\Closure[['static' => true, 'byRef' => $4, 'params' => $6, 'uses' => $8, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; } -; - -anonymous_class: - optional_attributes T_CLASS ctor_arguments extends_from implements_list '{' class_statement_list '}' - { $$ = array(Stmt\Class_[null, ['type' => 0, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]], $3); - $this->checkClass($$[0], -1); } -; - -new_expr: - T_NEW class_name_reference ctor_arguments { $$ = Expr\New_[$2, $3]; } - | T_NEW anonymous_class - { list($class, $ctorArgs) = $2; $$ = Expr\New_[$class, $ctorArgs]; } -; - -lexical_vars: - /* empty */ { $$ = array(); } - | T_USE '(' lexical_var_list ')' { $$ = $3; } -; - -lexical_var_list: - non_empty_lexical_var_list optional_comma { $$ = $1; } -; - -non_empty_lexical_var_list: - lexical_var { init($1); } - | non_empty_lexical_var_list ',' lexical_var { push($1, $3); } -; - -lexical_var: - optional_ref plain_variable { $$ = Expr\ClosureUse[$2, $1]; } -; - -name_readonly: - T_READONLY { $$ = Name[$1]; } -; - -function_call: - name argument_list { $$ = Expr\FuncCall[$1, $2]; } - | name_readonly argument_list { $$ = Expr\FuncCall[$1, $2]; } - | callable_expr argument_list { $$ = Expr\FuncCall[$1, $2]; } - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { $$ = Expr\StaticCall[$1, $3, $4]; } -; - -class_name: - T_STATIC { $$ = Name[$1]; } - | name { $$ = $1; } -; - -name: - T_STRING { $$ = Name[$1]; } - | T_NAME_QUALIFIED { $$ = Name[$1]; } - | T_NAME_FULLY_QUALIFIED { $$ = Name\FullyQualified[substr($1, 1)]; } - | T_NAME_RELATIVE { $$ = Name\Relative[substr($1, 10)]; } -; - -class_name_reference: - class_name { $$ = $1; } - | new_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -class_name_or_var: - class_name { $$ = $1; } - | fully_dereferencable { $$ = $1; } -; - -exit_expr: - /* empty */ { $$ = null; } - | '(' optional_expr ')' { $$ = $2; } -; - -backticks_expr: - /* empty */ { $$ = array(); } - | T_ENCAPSED_AND_WHITESPACE - { $$ = array(Scalar\EncapsedStringPart[Scalar\String_::parseEscapeSequences($1, '`')]); } - | encaps_list { parseEncapsed($1, '`', true); $$ = $1; } -; - -ctor_arguments: - /* empty */ { $$ = array(); } - | argument_list { $$ = $1; } -; - -constant: - name { $$ = Expr\ConstFetch[$1]; } - | T_LINE { $$ = Scalar\MagicConst\Line[]; } - | T_FILE { $$ = Scalar\MagicConst\File[]; } - | T_DIR { $$ = Scalar\MagicConst\Dir[]; } - | T_CLASS_C { $$ = Scalar\MagicConst\Class_[]; } - | T_TRAIT_C { $$ = Scalar\MagicConst\Trait_[]; } - | T_METHOD_C { $$ = Scalar\MagicConst\Method[]; } - | T_FUNC_C { $$ = Scalar\MagicConst\Function_[]; } - | T_NS_C { $$ = Scalar\MagicConst\Namespace_[]; } -; - -class_constant: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved - { $$ = Expr\ClassConstFetch[$1, $3]; } - /* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be - an unfinished static property fetch or unfinished scoped call. */ - | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error - { $$ = Expr\ClassConstFetch[$1, new Expr\Error(stackAttributes(#3))]; $this->errorState = 2; } -; - -array_short_syntax: - '[' array_pair_list ']' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_SHORT; - $$ = new Expr\Array_($2, $attrs); } -; - -dereferencable_scalar: - T_ARRAY '(' array_pair_list ')' - { $attrs = attributes(); $attrs['kind'] = Expr\Array_::KIND_LONG; - $$ = new Expr\Array_($3, $attrs); } - | array_short_syntax { $$ = $1; } - | T_CONSTANT_ENCAPSED_STRING { $$ = Scalar\String_::fromString($1, attributes()); } - | '"' encaps_list '"' - { $attrs = attributes(); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - parseEncapsed($2, '"', true); $$ = new Scalar\Encapsed($2, $attrs); } -; - -scalar: - T_LNUMBER { $$ = $this->parseLNumber($1, attributes()); } - | T_DNUMBER { $$ = Scalar\DNumber::fromString($1, attributes()); } - | dereferencable_scalar { $$ = $1; } - | constant { $$ = $1; } - | class_constant { $$ = $1; } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } - | T_START_HEREDOC T_END_HEREDOC - { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), true); } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); } -; - -optional_expr: - /* empty */ { $$ = null; } - | expr { $$ = $1; } -; - -fully_dereferencable: - variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } - | class_constant { $$ = $1; } -; - -array_object_dereferencable: - fully_dereferencable { $$ = $1; } - | constant { $$ = $1; } -; - -callable_expr: - callable_variable { $$ = $1; } - | '(' expr ')' { $$ = $2; } - | dereferencable_scalar { $$ = $1; } -; - -callable_variable: - simple_variable { $$ = $1; } - | array_object_dereferencable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | array_object_dereferencable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | function_call { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\MethodCall[$1, $3, $4]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name argument_list - { $$ = Expr\NullsafeMethodCall[$1, $3, $4]; } -; - -optional_plain_variable: - /* empty */ { $$ = null; } - | plain_variable { $$ = $1; } -; - -variable: - callable_variable { $$ = $1; } - | static_member { $$ = $1; } - | array_object_dereferencable T_OBJECT_OPERATOR property_name - { $$ = Expr\PropertyFetch[$1, $3]; } - | array_object_dereferencable T_NULLSAFE_OBJECT_OPERATOR property_name - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } -; - -simple_variable: - plain_variable { $$ = $1; } - | '$' '{' expr '}' { $$ = Expr\Variable[$3]; } - | '$' simple_variable { $$ = Expr\Variable[$2]; } - | '$' error { $$ = Expr\Variable[Expr\Error[]]; $this->errorState = 2; } -; - -static_member_prop_name: - simple_variable - { $var = $1->name; $$ = \is_string($var) ? Node\VarLikeIdentifier[$var] : $var; } -; - -static_member: - class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -new_variable: - simple_variable { $$ = $1; } - | new_variable '[' optional_expr ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable '{' expr '}' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | new_variable T_OBJECT_OPERATOR property_name { $$ = Expr\PropertyFetch[$1, $3]; } - | new_variable T_NULLSAFE_OBJECT_OPERATOR property_name { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | class_name T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } - | new_variable T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name - { $$ = Expr\StaticPropertyFetch[$1, $3]; } -; - -member_name: - identifier_maybe_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } -; - -property_name: - identifier_not_reserved { $$ = $1; } - | '{' expr '}' { $$ = $2; } - | simple_variable { $$ = $1; } - | error { $$ = Expr\Error[]; $this->errorState = 2; } -; - -list_expr: - T_LIST '(' inner_array_pair_list ')' { $$ = Expr\List_[$3]; } -; - -array_pair_list: - inner_array_pair_list - { $$ = $1; $end = count($$)-1; if ($$[$end] === null) array_pop($$); } -; - -comma_or_error: - ',' - | error - { /* do nothing -- prevent default action of $$=$1. See #551. */ } -; - -inner_array_pair_list: - inner_array_pair_list comma_or_error array_pair { push($1, $3); } - | array_pair { init($1); } -; - -array_pair: - expr { $$ = Expr\ArrayItem[$1, null, false]; } - | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } - | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } - | /* empty */ { $$ = null; } -; - -encaps_list: - encaps_list encaps_var { push($1, $2); } - | encaps_list encaps_string_part { push($1, $2); } - | encaps_var { init($1); } - | encaps_string_part encaps_var { init($1, $2); } -; - -encaps_string_part: - T_ENCAPSED_AND_WHITESPACE { $$ = Scalar\EncapsedStringPart[$1]; } -; - -encaps_str_varname: - T_STRING_VARNAME { $$ = Expr\Variable[$1]; } -; - -encaps_var: - plain_variable { $$ = $1; } - | plain_variable '[' encaps_var_offset ']' { $$ = Expr\ArrayDimFetch[$1, $3]; } - | plain_variable T_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\PropertyFetch[$1, $3]; } - | plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier_not_reserved - { $$ = Expr\NullsafePropertyFetch[$1, $3]; } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = Expr\Variable[$2]; } - | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}' - { $$ = Expr\ArrayDimFetch[$2, $4]; } - | T_CURLY_OPEN variable '}' { $$ = $2; } -; - -encaps_var_offset: - T_STRING { $$ = Scalar\String_[$1]; } - | T_NUM_STRING { $$ = $this->parseNumString($1, attributes()); } - | '-' T_NUM_STRING { $$ = $this->parseNumString('-' . $2, attributes()); } - | plain_variable { $$ = $1; } -; - -%% diff --git a/api/vendor/nikic/php-parser/grammar/phpyLang.php b/api/vendor/nikic/php-parser/grammar/phpyLang.php deleted file mode 100644 index 663c2a144c..0000000000 --- a/api/vendor/nikic/php-parser/grammar/phpyLang.php +++ /dev/null @@ -1,184 +0,0 @@ -\'[^\\\\\']*+(?:\\\\.[^\\\\\']*+)*+\') - (?"[^\\\\"]*+(?:\\\\.[^\\\\"]*+)*+") - (?(?&singleQuotedString)|(?&doubleQuotedString)) - (?/\*[^*]*+(?:\*(?!/)[^*]*+)*+\*/) - (?\{[^\'"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^\'"/{}]*+)*+}) -)'; - -const PARAMS = '\[(?[^[\]]*+(?:\[(?¶ms)\][^[\]]*+)*+)\]'; -const ARGS = '\((?[^()]*+(?:\((?&args)\)[^()]*+)*+)\)'; - -/////////////////////////////// -/// Preprocessing functions /// -/////////////////////////////// - -function preprocessGrammar($code) { - $code = resolveNodes($code); - $code = resolveMacros($code); - $code = resolveStackAccess($code); - - return $code; -} - -function resolveNodes($code) { - return preg_replace_callback( - '~\b(?[A-Z][a-zA-Z_\\\\]++)\s*' . PARAMS . '~', - function($matches) { - // recurse - $matches['params'] = resolveNodes($matches['params']); - - $params = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['params'] - ); - - $paramCode = ''; - foreach ($params as $param) { - $paramCode .= $param . ', '; - } - - return 'new ' . $matches['name'] . '(' . $paramCode . 'attributes())'; - }, - $code - ); -} - -function resolveMacros($code) { - return preg_replace_callback( - '~\b(?)(?!array\()(?[a-z][A-Za-z]++)' . ARGS . '~', - function($matches) { - // recurse - $matches['args'] = resolveMacros($matches['args']); - - $name = $matches['name']; - $args = magicSplit( - '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,', - $matches['args'] - ); - - if ('attributes' === $name) { - assertArgs(0, $args, $name); - return '$this->startAttributeStack[#1] + $this->endAttributes'; - } - - if ('stackAttributes' === $name) { - assertArgs(1, $args, $name); - return '$this->startAttributeStack[' . $args[0] . ']' - . ' + $this->endAttributeStack[' . $args[0] . ']'; - } - - if ('init' === $name) { - return '$$ = array(' . implode(', ', $args) . ')'; - } - - if ('push' === $name) { - assertArgs(2, $args, $name); - - return $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0]; - } - - if ('pushNormalizing' === $name) { - assertArgs(2, $args, $name); - - return 'if (is_array(' . $args[1] . ')) { $$ = array_merge(' . $args[0] . ', ' . $args[1] . '); }' - . ' else { ' . $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0] . '; }'; - } - - if ('toArray' == $name) { - assertArgs(1, $args, $name); - - return 'is_array(' . $args[0] . ') ? ' . $args[0] . ' : array(' . $args[0] . ')'; - } - - if ('parseVar' === $name) { - assertArgs(1, $args, $name); - - return 'substr(' . $args[0] . ', 1)'; - } - - if ('parseEncapsed' === $name) { - assertArgs(3, $args, $name); - - return 'foreach (' . $args[0] . ' as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) {' - . ' $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, ' . $args[1] . ', ' . $args[2] . '); } }'; - } - - if ('makeNop' === $name) { - assertArgs(3, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($startAttributes + ' . $args[2] . '); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('makeZeroLengthNop' == $name) { - assertArgs(2, $args, $name); - - return '$startAttributes = ' . $args[1] . ';' - . ' if (isset($startAttributes[\'comments\']))' - . ' { ' . $args[0] . ' = new Stmt\Nop($this->createCommentNopAttributes($startAttributes[\'comments\'])); }' - . ' else { ' . $args[0] . ' = null; }'; - } - - if ('prependLeadingComments' === $name) { - assertArgs(1, $args, $name); - - return '$attrs = $this->startAttributeStack[#1]; $stmts = ' . $args[0] . '; ' - . 'if (!empty($attrs[\'comments\'])) {' - . '$stmts[0]->setAttribute(\'comments\', ' - . 'array_merge($attrs[\'comments\'], $stmts[0]->getAttribute(\'comments\', []))); }'; - } - - return $matches[0]; - }, - $code - ); -} - -function assertArgs($num, $args, $name) { - if ($num != count($args)) { - die('Wrong argument count for ' . $name . '().'); - } -} - -function resolveStackAccess($code) { - $code = preg_replace('/\$\d+/', '$this->semStack[$0]', $code); - $code = preg_replace('/#(\d+)/', '$$1', $code); - return $code; -} - -function removeTrailingWhitespace($code) { - $lines = explode("\n", $code); - $lines = array_map('rtrim', $lines); - return implode("\n", $lines); -} - -////////////////////////////// -/// Regex helper functions /// -////////////////////////////// - -function regex($regex) { - return '~' . LIB . '(?:' . str_replace('~', '\~', $regex) . ')~'; -} - -function magicSplit($regex, $string) { - $pieces = preg_split(regex('(?:(?&string)|(?&comment)|(?&code))(*SKIP)(*FAIL)|' . $regex), $string); - - foreach ($pieces as &$piece) { - $piece = trim($piece); - } - - if ($pieces === ['']) { - return []; - } - - return $pieces; -} diff --git a/api/vendor/nikic/php-parser/grammar/rebuildParsers.php b/api/vendor/nikic/php-parser/grammar/rebuildParsers.php deleted file mode 100644 index 2d0c6b14d3..0000000000 --- a/api/vendor/nikic/php-parser/grammar/rebuildParsers.php +++ /dev/null @@ -1,81 +0,0 @@ - 'Php5', - __DIR__ . '/php7.y' => 'Php7', -]; - -$tokensFile = __DIR__ . '/tokens.y'; -$tokensTemplate = __DIR__ . '/tokens.template'; -$skeletonFile = __DIR__ . '/parser.template'; -$tmpGrammarFile = __DIR__ . '/tmp_parser.phpy'; -$tmpResultFile = __DIR__ . '/tmp_parser.php'; -$resultDir = __DIR__ . '/../lib/PhpParser/Parser'; -$tokensResultsFile = $resultDir . '/Tokens.php'; - -$kmyacc = getenv('KMYACC'); -if (!$kmyacc) { - // Use phpyacc from dev dependencies by default. - $kmyacc = __DIR__ . '/../vendor/bin/phpyacc'; -} - -$options = array_flip($argv); -$optionDebug = isset($options['--debug']); -$optionKeepTmpGrammar = isset($options['--keep-tmp-grammar']); - -/////////////////// -/// Main script /// -/////////////////// - -$tokens = file_get_contents($tokensFile); - -foreach ($grammarFileToName as $grammarFile => $name) { - echo "Building temporary $name grammar file.\n"; - - $grammarCode = file_get_contents($grammarFile); - $grammarCode = str_replace('%tokens', $tokens, $grammarCode); - $grammarCode = preprocessGrammar($grammarCode); - - file_put_contents($tmpGrammarFile, $grammarCode); - - $additionalArgs = $optionDebug ? '-t -v' : ''; - - echo "Building $name parser.\n"; - $output = execCmd("$kmyacc $additionalArgs -m $skeletonFile -p $name $tmpGrammarFile"); - - $resultCode = file_get_contents($tmpResultFile); - $resultCode = removeTrailingWhitespace($resultCode); - - ensureDirExists($resultDir); - file_put_contents("$resultDir/$name.php", $resultCode); - unlink($tmpResultFile); - - echo "Building token definition.\n"; - $output = execCmd("$kmyacc -m $tokensTemplate $tmpGrammarFile"); - rename($tmpResultFile, $tokensResultsFile); - - if (!$optionKeepTmpGrammar) { - unlink($tmpGrammarFile); - } -} - -//////////////////////////////// -/// Utility helper functions /// -//////////////////////////////// - -function ensureDirExists($dir) { - if (!is_dir($dir)) { - mkdir($dir, 0777, true); - } -} - -function execCmd($cmd) { - $output = trim(shell_exec("$cmd 2>&1")); - if ($output !== "") { - echo "> " . $cmd . "\n"; - echo $output; - } - return $output; -} diff --git a/api/vendor/nikic/php-parser/grammar/tokens.template b/api/vendor/nikic/php-parser/grammar/tokens.template deleted file mode 100644 index ba4e4901c0..0000000000 --- a/api/vendor/nikic/php-parser/grammar/tokens.template +++ /dev/null @@ -1,17 +0,0 @@ -semValue -#semval($,%t) $this->semValue -#semval(%n) $this->stackPos-(%l-%n) -#semval(%n,%t) $this->stackPos-(%l-%n) - -namespace PhpParser\Parser; -#include; - -/* GENERATED file based on grammar/tokens.y */ -final class Tokens -{ -#tokenval - const %s = %n; -#endtokenval -} diff --git a/api/vendor/nikic/php-parser/grammar/tokens.y b/api/vendor/nikic/php-parser/grammar/tokens.y deleted file mode 100644 index 8f0b217254..0000000000 --- a/api/vendor/nikic/php-parser/grammar/tokens.y +++ /dev/null @@ -1,115 +0,0 @@ -/* We currently rely on the token ID mapping to be the same between PHP 5 and PHP 7 - so the same lexer can be used for - * both. This is enforced by sharing this token file. */ - -%right T_THROW -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%right T_YIELD -%right T_DOUBLE_ARROW -%right T_YIELD_FROM -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL -%left '?' ':' -%right T_COALESCE -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right T_POW -%right '[' -%nonassoc T_NEW T_CLONE -%token T_EXIT -%token T_IF -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_MATCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_GOTO -%token T_FUNCTION -%token T_FN -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_FINALLY -%token T_THROW -%token T_USE -%token T_INSTEADOF -%token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_READONLY -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_TRAIT -%token T_INTERFACE -%token T_ENUM -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_NULLSAFE_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CALLABLE -%token T_CLASS_C -%token T_TRAIT_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_NAMESPACE -%token T_NS_C -%token T_DIR -%token T_NS_SEPARATOR -%token T_ELLIPSIS -%token T_NAME_FULLY_QUALIFIED -%token T_NAME_QUALIFIED -%token T_NAME_RELATIVE -%token T_ATTRIBUTE -%token T_ENUM diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder.php index 26d8921efc..d6aa124c02 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder.php @@ -2,12 +2,11 @@ namespace PhpParser; -interface Builder -{ +interface Builder { /** * Returns the built node. * * @return Node The built node */ - public function getNode() : Node; + public function getNode(): Node; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php index f616c62701..138fa638c1 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php @@ -6,25 +6,29 @@ use PhpParser; use PhpParser\BuilderHelpers; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\Const_; use PhpParser\Node\Identifier; use PhpParser\Node\Stmt; -class ClassConst implements PhpParser\Builder -{ - protected $flags = 0; - protected $attributes = []; - protected $constants = []; +class ClassConst implements PhpParser\Builder { + protected int $flags = 0; + /** @var array */ + protected array $attributes = []; + /** @var list */ + protected array $constants = []; - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; + /** @var list */ + protected array $attributeGroups = []; + /** @var Identifier|Node\Name|Node\ComplexType|null */ + protected ?Node $type = null; /** * Creates a class constant builder * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value + * @param string|Identifier $name Name + * @param Node\Expr|bool|null|int|float|string|array|\UnitEnum $value Value */ public function __construct($name, $value) { $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))]; @@ -33,8 +37,8 @@ public function __construct($name, $value) { /** * Add another constant to const group * - * @param string|Identifier $name Name - * @param Node\Expr|bool|null|int|float|string|array $value Value + * @param string|Identifier $name Name + * @param Node\Expr|bool|null|int|float|string|array|\UnitEnum $value Value * * @return $this The builder instance (for fluid interface) */ @@ -50,7 +54,7 @@ public function addConst($name, $value) { * @return $this The builder instance (for fluid interface) */ public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); return $this; } @@ -61,7 +65,7 @@ public function makePublic() { * @return $this The builder instance (for fluid interface) */ public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); return $this; } @@ -72,7 +76,7 @@ public function makeProtected() { * @return $this The builder instance (for fluid interface) */ public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); return $this; } @@ -83,7 +87,7 @@ public function makePrivate() { * @return $this The builder instance (for fluid interface) */ public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL); return $this; } @@ -116,6 +120,19 @@ public function addAttribute($attribute) { return $this; } + /** + * Sets the constant type. + * + * @param string|Node\Name|Identifier|Node\ComplexType $type + * + * @return $this + */ + public function setType($type) { + $this->type = BuilderHelpers::normalizeType($type); + + return $this; + } + /** * Returns the built class node. * @@ -126,7 +143,8 @@ public function getNode(): PhpParser\Node { $this->constants, $this->flags, $this->attributes, - $this->attributeGroups + $this->attributeGroups, + $this->type ); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php index 35b54d0418..6f394315ec 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Class_.php @@ -4,25 +4,27 @@ use PhpParser; use PhpParser\BuilderHelpers; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\Name; use PhpParser\Node\Stmt; -class Class_ extends Declaration -{ - protected $name; - - protected $extends = null; - protected $implements = []; - protected $flags = 0; - - protected $uses = []; - protected $constants = []; - protected $properties = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; +class Class_ extends Declaration { + protected string $name; + protected ?Name $extends = null; + /** @var list */ + protected array $implements = []; + protected int $flags = 0; + /** @var list */ + protected array $uses = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $properties = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; /** * Creates a class builder. @@ -67,7 +69,7 @@ public function implement(...$interfaces) { * @return $this The builder instance (for fluid interface) */ public function makeAbstract() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT); + $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::ABSTRACT); return $this; } @@ -78,13 +80,18 @@ public function makeAbstract() { * @return $this The builder instance (for fluid interface) */ public function makeFinal() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); + $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::FINAL); return $this; } + /** + * Makes the class readonly. + * + * @return $this The builder instance (for fluid interface) + */ public function makeReadonly() { - $this->flags = BuilderHelpers::addClassModifier($this->flags, Stmt\Class_::MODIFIER_READONLY); + $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::READONLY); return $this; } @@ -99,20 +106,18 @@ public function makeReadonly() { public function addStmt($stmt) { $stmt = BuilderHelpers::normalizeNode($stmt); - $targets = [ - Stmt\TraitUse::class => &$this->uses, - Stmt\ClassConst::class => &$this->constants, - Stmt\Property::class => &$this->properties, - Stmt\ClassMethod::class => &$this->methods, - ]; - - $class = \get_class($stmt); - if (!isset($targets[$class])) { + if ($stmt instanceof Stmt\Property) { + $this->properties[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassMethod) { + $this->methods[] = $stmt; + } elseif ($stmt instanceof Stmt\TraitUse) { + $this->uses[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassConst) { + $this->constants[] = $stmt; + } else { throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); } - $targets[$class][] = $stmt; - return $this; } @@ -134,7 +139,7 @@ public function addAttribute($attribute) { * * @return Stmt\Class_ The built class node */ - public function getNode() : PhpParser\Node { + public function getNode(): PhpParser\Node { return new Stmt\Class_($this->name, [ 'flags' => $this->flags, 'extends' => $this->extends, diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php index 830949928a..488b72131f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php @@ -5,16 +5,23 @@ use PhpParser; use PhpParser\BuilderHelpers; -abstract class Declaration implements PhpParser\Builder -{ - protected $attributes = []; +abstract class Declaration implements PhpParser\Builder { + /** @var array */ + protected array $attributes = []; + /** + * Adds a statement. + * + * @param PhpParser\Node\Stmt|PhpParser\Builder $stmt The statement to add + * + * @return $this The builder instance (for fluid interface) + */ abstract public function addStmt($stmt); /** * Adds multiple statements. * - * @param array $stmts The statements to add + * @param (PhpParser\Node\Stmt|PhpParser\Builder)[] $stmts The statements to add * * @return $this The builder instance (for fluid interface) */ diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php index accc5166b1..c766321ba3 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/EnumCase.php @@ -10,19 +10,20 @@ use PhpParser\Node\Identifier; use PhpParser\Node\Stmt; -class EnumCase implements PhpParser\Builder -{ +class EnumCase implements PhpParser\Builder { + /** @var Identifier|string */ protected $name; - protected $value = null; - protected $attributes = []; + protected ?Node\Expr $value = null; + /** @var array */ + protected array $attributes = []; - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; + /** @var list */ + protected array $attributeGroups = []; /** * Creates an enum case builder. * - * @param string|Identifier $name Name + * @param string|Identifier $name Name */ public function __construct($name) { $this->name = $name; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php index be7eef95f5..c00df03f5b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php @@ -9,20 +9,21 @@ use PhpParser\Node\Name; use PhpParser\Node\Stmt; -class Enum_ extends Declaration -{ - protected $name; - protected $scalarType = null; - - protected $implements = []; - - protected $uses = []; - protected $enumCases = []; - protected $constants = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; +class Enum_ extends Declaration { + protected string $name; + protected ?Identifier $scalarType = null; + /** @var list */ + protected array $implements = []; + /** @var list */ + protected array $uses = []; + /** @var list */ + protected array $enumCases = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; /** * Creates an enum builder. @@ -36,7 +37,7 @@ public function __construct(string $name) { /** * Sets the scalar type. * - * @param string|Identifier $type + * @param string|Identifier $scalarType * * @return $this */ @@ -71,20 +72,18 @@ public function implement(...$interfaces) { public function addStmt($stmt) { $stmt = BuilderHelpers::normalizeNode($stmt); - $targets = [ - Stmt\TraitUse::class => &$this->uses, - Stmt\EnumCase::class => &$this->enumCases, - Stmt\ClassConst::class => &$this->constants, - Stmt\ClassMethod::class => &$this->methods, - ]; - - $class = \get_class($stmt); - if (!isset($targets[$class])) { + if ($stmt instanceof Stmt\EnumCase) { + $this->enumCases[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassMethod) { + $this->methods[] = $stmt; + } elseif ($stmt instanceof Stmt\TraitUse) { + $this->uses[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassConst) { + $this->constants[] = $stmt; + } else { throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); } - $targets[$class][] = $stmt; - return $this; } @@ -106,7 +105,7 @@ public function addAttribute($attribute) { * * @return Stmt\Enum_ The built enum node */ - public function getNode() : PhpParser\Node { + public function getNode(): PhpParser\Node { return new Stmt\Enum_($this->name, [ 'scalarType' => $this->scalarType, 'implements' => $this->implements, diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php index 98ea9d3366..ff79cb6b4a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php @@ -5,13 +5,13 @@ use PhpParser\BuilderHelpers; use PhpParser\Node; -abstract class FunctionLike extends Declaration -{ - protected $returnByRef = false; - protected $params = []; +abstract class FunctionLike extends Declaration { + protected bool $returnByRef = false; + /** @var Node\Param[] */ + protected array $params = []; - /** @var string|Node\Name|Node\NullableType|null */ - protected $returnType = null; + /** @var Node\Identifier|Node\Name|Node\ComplexType|null */ + protected ?Node $returnType = null; /** * Make the function return by reference. @@ -46,7 +46,7 @@ public function addParam($param) { /** * Adds multiple parameters. * - * @param array $params The parameters to add + * @param (Node\Param|Param)[] $params The parameters to add * * @return $this The builder instance (for fluid interface) */ diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php index 1cd73c0d3b..48f5f69319 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Function_.php @@ -7,13 +7,13 @@ use PhpParser\Node; use PhpParser\Node\Stmt; -class Function_ extends FunctionLike -{ - protected $name; - protected $stmts = []; +class Function_ extends FunctionLike { + protected string $name; + /** @var list */ + protected array $stmts = []; - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; + /** @var list */ + protected array $attributeGroups = []; /** * Creates a function builder. @@ -55,7 +55,7 @@ public function addAttribute($attribute) { * * @return Stmt\Function_ The built function node */ - public function getNode() : Node { + public function getNode(): Node { return new Stmt\Function_($this->name, [ 'byRef' => $this->returnByRef, 'params' => $this->params, diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php index 7806e85fce..13dd3f7f9b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Interface_.php @@ -8,15 +8,16 @@ use PhpParser\Node\Name; use PhpParser\Node\Stmt; -class Interface_ extends Declaration -{ - protected $name; - protected $extends = []; - protected $constants = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; +class Interface_ extends Declaration { + protected string $name; + /** @var list */ + protected array $extends = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; /** * Creates an interface builder. @@ -83,7 +84,7 @@ public function addAttribute($attribute) { * * @return Stmt\Interface_ The built interface node */ - public function getNode() : PhpParser\Node { + public function getNode(): PhpParser\Node { return new Stmt\Interface_($this->name, [ 'extends' => $this->extends, 'stmts' => array_merge($this->constants, $this->methods), diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php index 232d7cb874..8358dbe38f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Method.php @@ -4,19 +4,20 @@ use PhpParser; use PhpParser\BuilderHelpers; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\Stmt; -class Method extends FunctionLike -{ - protected $name; - protected $flags = 0; +class Method extends FunctionLike { + protected string $name; - /** @var array|null */ - protected $stmts = []; + protected int $flags = 0; - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; + /** @var list|null */ + protected ?array $stmts = []; + + /** @var list */ + protected array $attributeGroups = []; /** * Creates a method builder. @@ -33,7 +34,7 @@ public function __construct(string $name) { * @return $this The builder instance (for fluid interface) */ public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); return $this; } @@ -44,7 +45,7 @@ public function makePublic() { * @return $this The builder instance (for fluid interface) */ public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); return $this; } @@ -55,7 +56,7 @@ public function makeProtected() { * @return $this The builder instance (for fluid interface) */ public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); return $this; } @@ -66,7 +67,7 @@ public function makePrivate() { * @return $this The builder instance (for fluid interface) */ public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC); return $this; } @@ -81,7 +82,7 @@ public function makeAbstract() { throw new \LogicException('Cannot make method with statements abstract'); } - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_ABSTRACT); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::ABSTRACT); $this->stmts = null; // abstract methods don't have statements return $this; @@ -93,7 +94,7 @@ public function makeAbstract() { * @return $this The builder instance (for fluid interface) */ public function makeFinal() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL); return $this; } @@ -133,7 +134,7 @@ public function addAttribute($attribute) { * * @return Stmt\ClassMethod The built method node */ - public function getNode() : Node { + public function getNode(): Node { return new Stmt\ClassMethod($this->name, [ 'flags' => $this->flags, 'byRef' => $this->returnByRef, diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php index 1c751e163a..80fe6f8464 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Namespace_.php @@ -7,10 +7,10 @@ use PhpParser\Node; use PhpParser\Node\Stmt; -class Namespace_ extends Declaration -{ - private $name; - private $stmts = []; +class Namespace_ extends Declaration { + private ?Node\Name $name; + /** @var Stmt[] */ + private array $stmts = []; /** * Creates a namespace builder. @@ -39,7 +39,7 @@ public function addStmt($stmt) { * * @return Stmt\Namespace_ The built node */ - public function getNode() : Node { + public function getNode(): Node { return new Stmt\Namespace_($this->name, $this->stmts, $this->attributes); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php index de9aae7e5e..324a32b05f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php @@ -4,23 +4,19 @@ use PhpParser; use PhpParser\BuilderHelpers; +use PhpParser\Modifiers; use PhpParser\Node; -class Param implements PhpParser\Builder -{ - protected $name; - - protected $default = null; - - /** @var Node\Identifier|Node\Name|Node\NullableType|null */ - protected $type = null; - - protected $byRef = false; - - protected $variadic = false; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; +class Param implements PhpParser\Builder { + protected string $name; + protected ?Node\Expr $default = null; + /** @var Node\Identifier|Node\Name|Node\ComplexType|null */ + protected ?Node $type = null; + protected bool $byRef = false; + protected int $flags = 0; + protected bool $variadic = false; + /** @var list */ + protected array $attributeGroups = []; /** * Creates a parameter builder. @@ -61,36 +57,89 @@ public function setType($type) { } /** - * Sets type for the parameter. + * Make the parameter accept the value by reference. * - * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type + * @return $this The builder instance (for fluid interface) + */ + public function makeByRef() { + $this->byRef = true; + + return $this; + } + + /** + * Make the parameter variadic * * @return $this The builder instance (for fluid interface) + */ + public function makeVariadic() { + $this->variadic = true; + + return $this; + } + + /** + * Makes the (promoted) parameter public. * - * @deprecated Use setType() instead + * @return $this The builder instance (for fluid interface) */ - public function setTypeHint($type) { - return $this->setType($type); + public function makePublic() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); + + return $this; } /** - * Make the parameter accept the value by reference. + * Makes the (promoted) parameter protected. * * @return $this The builder instance (for fluid interface) */ - public function makeByRef() { - $this->byRef = true; + public function makeProtected() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); return $this; } /** - * Make the parameter variadic + * Makes the (promoted) parameter private. * * @return $this The builder instance (for fluid interface) */ - public function makeVariadic() { - $this->variadic = true; + public function makePrivate() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); + + return $this; + } + + /** + * Makes the (promoted) parameter readonly. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeReadonly() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY); + + return $this; + } + + /** + * Gives the promoted property private(set) visibility. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivateSet() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE_SET); + + return $this; + } + + /** + * Gives the promoted property protected(set) visibility. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtectedSet() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED_SET); return $this; } @@ -113,10 +162,10 @@ public function addAttribute($attribute) { * * @return Node\Param The built parameter node */ - public function getNode() : Node { + public function getNode(): Node { return new Node\Param( new Node\Expr\Variable($this->name), - $this->default, $this->type, $this->byRef, $this->variadic, [], 0, $this->attributeGroups + $this->default, $this->type, $this->byRef, $this->variadic, [], $this->flags, $this->attributeGroups ); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php index 68e318565e..c80fe481bd 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php @@ -4,25 +4,27 @@ use PhpParser; use PhpParser\BuilderHelpers; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\Identifier; use PhpParser\Node\Name; use PhpParser\Node\Stmt; use PhpParser\Node\ComplexType; -class Property implements PhpParser\Builder -{ - protected $name; +class Property implements PhpParser\Builder { + protected string $name; - protected $flags = 0; - protected $default = null; - protected $attributes = []; + protected int $flags = 0; - /** @var null|Identifier|Name|NullableType */ - protected $type; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; + protected ?Node\Expr $default = null; + /** @var array */ + protected array $attributes = []; + /** @var null|Identifier|Name|ComplexType */ + protected ?Node $type = null; + /** @var list */ + protected array $attributeGroups = []; + /** @var list */ + protected array $hooks = []; /** * Creates a property builder. @@ -39,7 +41,7 @@ public function __construct(string $name) { * @return $this The builder instance (for fluid interface) */ public function makePublic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PUBLIC); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC); return $this; } @@ -50,7 +52,7 @@ public function makePublic() { * @return $this The builder instance (for fluid interface) */ public function makeProtected() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PROTECTED); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED); return $this; } @@ -61,7 +63,7 @@ public function makeProtected() { * @return $this The builder instance (for fluid interface) */ public function makePrivate() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_PRIVATE); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE); return $this; } @@ -72,7 +74,7 @@ public function makePrivate() { * @return $this The builder instance (for fluid interface) */ public function makeStatic() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_STATIC); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC); return $this; } @@ -83,7 +85,51 @@ public function makeStatic() { * @return $this The builder instance (for fluid interface) */ public function makeReadonly() { - $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_READONLY); + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY); + + return $this; + } + + /** + * Makes the property abstract. Requires at least one property hook to be specified as well. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeAbstract() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::ABSTRACT); + + return $this; + } + + /** + * Makes the property final. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeFinal() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL); + + return $this; + } + + /** + * Gives the property private(set) visibility. + * + * @return $this The builder instance (for fluid interface) + */ + public function makePrivateSet() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE_SET); + + return $this; + } + + /** + * Gives the property protected(set) visibility. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeProtectedSet() { + $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED_SET); return $this; } @@ -142,20 +188,36 @@ public function addAttribute($attribute) { return $this; } + /** + * Adds a property hook. + * + * @return $this The builder instance (for fluid interface) + */ + public function addHook(Node\PropertyHook $hook) { + $this->hooks[] = $hook; + + return $this; + } + /** * Returns the built class node. * * @return Stmt\Property The built property node */ - public function getNode() : PhpParser\Node { + public function getNode(): PhpParser\Node { + if ($this->flags & Modifiers::ABSTRACT && !$this->hooks) { + throw new PhpParser\Error('Only hooked properties may be declared abstract'); + } + return new Stmt\Property( - $this->flags !== 0 ? $this->flags : Stmt\Class_::MODIFIER_PUBLIC, + $this->flags !== 0 ? $this->flags : Modifiers::PUBLIC, [ - new Stmt\PropertyProperty($this->name, $this->default) + new Node\PropertyItem($this->name, $this->default) ], $this->attributes, $this->type, - $this->attributeGroups + $this->attributeGroups, + $this->hooks ); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php index 311e8cd7b6..cf21c821ab 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUse.php @@ -7,10 +7,11 @@ use PhpParser\Node; use PhpParser\Node\Stmt; -class TraitUse implements Builder -{ - protected $traits = []; - protected $adaptations = []; +class TraitUse implements Builder { + /** @var Node\Name[] */ + protected array $traits = []; + /** @var Stmt\TraitUseAdaptation[] */ + protected array $adaptations = []; /** * Creates a trait use builder. @@ -58,7 +59,7 @@ public function with($adaptation) { * * @return Node The built node */ - public function getNode() : Node { + public function getNode(): Node { return new Stmt\TraitUse($this->traits, $this->adaptations); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php index eb6c0b622d..fee09583a6 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/TraitUseAdaptation.php @@ -4,43 +4,40 @@ use PhpParser\Builder; use PhpParser\BuilderHelpers; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\Stmt; -class TraitUseAdaptation implements Builder -{ - const TYPE_UNDEFINED = 0; - const TYPE_ALIAS = 1; - const TYPE_PRECEDENCE = 2; +class TraitUseAdaptation implements Builder { + private const TYPE_UNDEFINED = 0; + private const TYPE_ALIAS = 1; + private const TYPE_PRECEDENCE = 2; - /** @var int Type of building adaptation */ - protected $type; - - protected $trait; - protected $method; - - protected $modifier = null; - protected $alias = null; - - protected $insteadof = []; + protected int $type; + protected ?Node\Name $trait; + protected Node\Identifier $method; + protected ?int $modifier = null; + protected ?Node\Identifier $alias = null; + /** @var Node\Name[] */ + protected array $insteadof = []; /** * Creates a trait use adaptation builder. * - * @param Node\Name|string|null $trait Name of adaptated trait - * @param Node\Identifier|string $method Name of adaptated method + * @param Node\Name|string|null $trait Name of adapted trait + * @param Node\Identifier|string $method Name of adapted method */ public function __construct($trait, $method) { $this->type = self::TYPE_UNDEFINED; - $this->trait = is_null($trait)? null: BuilderHelpers::normalizeName($trait); + $this->trait = is_null($trait) ? null : BuilderHelpers::normalizeName($trait); $this->method = BuilderHelpers::normalizeIdentifier($method); } /** * Sets alias of method. * - * @param Node\Identifier|string $alias Alias for adaptated method + * @param Node\Identifier|string $alias Alias for adapted method * * @return $this The builder instance (for fluid interface) */ @@ -53,37 +50,37 @@ public function as($alias) { throw new \LogicException('Cannot set alias for not alias adaptation buider'); } - $this->alias = $alias; + $this->alias = BuilderHelpers::normalizeIdentifier($alias); return $this; } /** - * Sets adaptated method public. + * Sets adapted method public. * * @return $this The builder instance (for fluid interface) */ public function makePublic() { - $this->setModifier(Stmt\Class_::MODIFIER_PUBLIC); + $this->setModifier(Modifiers::PUBLIC); return $this; } /** - * Sets adaptated method protected. + * Sets adapted method protected. * * @return $this The builder instance (for fluid interface) */ public function makeProtected() { - $this->setModifier(Stmt\Class_::MODIFIER_PROTECTED); + $this->setModifier(Modifiers::PROTECTED); return $this; } /** - * Sets adaptated method private. + * Sets adapted method private. * * @return $this The builder instance (for fluid interface) */ public function makePrivate() { - $this->setModifier(Stmt\Class_::MODIFIER_PRIVATE); + $this->setModifier(Modifiers::PRIVATE); return $this; } @@ -114,7 +111,7 @@ public function insteadof(...$traits) { return $this; } - protected function setModifier(int $modifier) { + protected function setModifier(int $modifier): void { if ($this->type === self::TYPE_UNDEFINED) { $this->type = self::TYPE_ALIAS; } @@ -135,7 +132,7 @@ protected function setModifier(int $modifier) { * * @return Node The built node */ - public function getNode() : Node { + public function getNode(): Node { switch ($this->type) { case self::TYPE_ALIAS: return new Stmt\TraitUseAdaptation\Alias($this->trait, $this->method, $this->modifier, $this->alias); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php index 97f32f98d6..ffa1bd5cca 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Trait_.php @@ -7,15 +7,18 @@ use PhpParser\Node; use PhpParser\Node\Stmt; -class Trait_ extends Declaration -{ - protected $name; - protected $uses = []; - protected $properties = []; - protected $methods = []; - - /** @var Node\AttributeGroup[] */ - protected $attributeGroups = []; +class Trait_ extends Declaration { + protected string $name; + /** @var list */ + protected array $uses = []; + /** @var list */ + protected array $constants = []; + /** @var list */ + protected array $properties = []; + /** @var list */ + protected array $methods = []; + /** @var list */ + protected array $attributeGroups = []; /** * Creates an interface builder. @@ -42,6 +45,8 @@ public function addStmt($stmt) { $this->methods[] = $stmt; } elseif ($stmt instanceof Stmt\TraitUse) { $this->uses[] = $stmt; + } elseif ($stmt instanceof Stmt\ClassConst) { + $this->constants[] = $stmt; } else { throw new \LogicException(sprintf('Unexpected node of type "%s"', $stmt->getType())); } @@ -67,10 +72,10 @@ public function addAttribute($attribute) { * * @return Stmt\Trait_ The built interface node */ - public function getNode() : PhpParser\Node { + public function getNode(): PhpParser\Node { return new Stmt\Trait_( $this->name, [ - 'stmts' => array_merge($this->uses, $this->properties, $this->methods), + 'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods), 'attrGroups' => $this->attributeGroups, ], $this->attributes ); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php index 4bd3d12df0..b82cf1396a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Builder/Use_.php @@ -7,17 +7,17 @@ use PhpParser\Node; use PhpParser\Node\Stmt; -class Use_ implements Builder -{ - protected $name; - protected $type; - protected $alias = null; +class Use_ implements Builder { + protected Node\Name $name; + /** @var Stmt\Use_::TYPE_* */ + protected int $type; + protected ?string $alias = null; /** * Creates a name use (alias) builder. * * @param Node\Name|string $name Name of the entity (namespace, class, function, constant) to alias - * @param int $type One of the Stmt\Use_::TYPE_* constants + * @param Stmt\Use_::TYPE_* $type One of the Stmt\Use_::TYPE_* constants */ public function __construct($name, int $type) { $this->name = BuilderHelpers::normalizeName($name); @@ -41,9 +41,9 @@ public function as(string $alias) { * * @return Stmt\Use_ The built node */ - public function getNode() : Node { + public function getNode(): Node { return new Stmt\Use_([ - new Stmt\UseUse($this->name, $this->alias) + new Node\UseItem($this->name, $this->alias) ], $this->type); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php b/api/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php index fef2579b3e..07642f92fa 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/BuilderFactory.php @@ -10,17 +10,14 @@ use PhpParser\Node\Scalar\String_; use PhpParser\Node\Stmt\Use_; -class BuilderFactory -{ +class BuilderFactory { /** * Creates an attribute node. * * @param string|Name $name Name of the attribute - * @param array $args Attribute named arguments - * - * @return Node\Attribute + * @param array $args Attribute named arguments */ - public function attribute($name, array $args = []) : Node\Attribute { + public function attribute($name, array $args = []): Node\Attribute { return new Node\Attribute( BuilderHelpers::normalizeName($name), $this->args($args) @@ -34,7 +31,7 @@ public function attribute($name, array $args = []) : Node\Attribute { * * @return Builder\Namespace_ The created namespace builder */ - public function namespace($name) : Builder\Namespace_ { + public function namespace($name): Builder\Namespace_ { return new Builder\Namespace_($name); } @@ -45,7 +42,7 @@ public function namespace($name) : Builder\Namespace_ { * * @return Builder\Class_ The created class builder */ - public function class(string $name) : Builder\Class_ { + public function class(string $name): Builder\Class_ { return new Builder\Class_($name); } @@ -56,7 +53,7 @@ public function class(string $name) : Builder\Class_ { * * @return Builder\Interface_ The created interface builder */ - public function interface(string $name) : Builder\Interface_ { + public function interface(string $name): Builder\Interface_ { return new Builder\Interface_($name); } @@ -67,7 +64,7 @@ public function interface(string $name) : Builder\Interface_ { * * @return Builder\Trait_ The created trait builder */ - public function trait(string $name) : Builder\Trait_ { + public function trait(string $name): Builder\Trait_ { return new Builder\Trait_($name); } @@ -78,7 +75,7 @@ public function trait(string $name) : Builder\Trait_ { * * @return Builder\Enum_ The created enum builder */ - public function enum(string $name) : Builder\Enum_ { + public function enum(string $name): Builder\Enum_ { return new Builder\Enum_($name); } @@ -87,21 +84,21 @@ public function enum(string $name) : Builder\Enum_ { * * @param Node\Name|string ...$traits Trait names * - * @return Builder\TraitUse The create trait use builder + * @return Builder\TraitUse The created trait use builder */ - public function useTrait(...$traits) : Builder\TraitUse { + public function useTrait(...$traits): Builder\TraitUse { return new Builder\TraitUse(...$traits); } /** * Creates a trait use adaptation builder. * - * @param Node\Name|string|null $trait Trait name + * @param Node\Name|string|null $trait Trait name * @param Node\Identifier|string $method Method name * - * @return Builder\TraitUseAdaptation The create trait use adaptation builder + * @return Builder\TraitUseAdaptation The created trait use adaptation builder */ - public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAdaptation { + public function traitUseAdaptation($trait, $method = null): Builder\TraitUseAdaptation { if ($method === null) { $method = $trait; $trait = null; @@ -117,7 +114,7 @@ public function traitUseAdaptation($trait, $method = null) : Builder\TraitUseAda * * @return Builder\Method The created method builder */ - public function method(string $name) : Builder\Method { + public function method(string $name): Builder\Method { return new Builder\Method($name); } @@ -128,7 +125,7 @@ public function method(string $name) : Builder\Method { * * @return Builder\Param The created parameter builder */ - public function param(string $name) : Builder\Param { + public function param(string $name): Builder\Param { return new Builder\Param($name); } @@ -139,7 +136,7 @@ public function param(string $name) : Builder\Param { * * @return Builder\Property The created property builder */ - public function property(string $name) : Builder\Property { + public function property(string $name): Builder\Property { return new Builder\Property($name); } @@ -150,7 +147,7 @@ public function property(string $name) : Builder\Property { * * @return Builder\Function_ The created function builder */ - public function function(string $name) : Builder\Function_ { + public function function(string $name): Builder\Function_ { return new Builder\Function_($name); } @@ -161,7 +158,7 @@ public function function(string $name) : Builder\Function_ { * * @return Builder\Use_ The created use builder */ - public function use($name) : Builder\Use_ { + public function use($name): Builder\Use_ { return new Builder\Use_($name, Use_::TYPE_NORMAL); } @@ -172,7 +169,7 @@ public function use($name) : Builder\Use_ { * * @return Builder\Use_ The created use function builder */ - public function useFunction($name) : Builder\Use_ { + public function useFunction($name): Builder\Use_ { return new Builder\Use_($name, Use_::TYPE_FUNCTION); } @@ -183,41 +180,39 @@ public function useFunction($name) : Builder\Use_ { * * @return Builder\Use_ The created use const builder */ - public function useConst($name) : Builder\Use_ { + public function useConst($name): Builder\Use_ { return new Builder\Use_($name, Use_::TYPE_CONSTANT); } /** * Creates a class constant builder. * - * @param string|Identifier $name Name + * @param string|Identifier $name Name * @param Node\Expr|bool|null|int|float|string|array $value Value * * @return Builder\ClassConst The created use const builder */ - public function classConst($name, $value) : Builder\ClassConst { + public function classConst($name, $value): Builder\ClassConst { return new Builder\ClassConst($name, $value); } /** * Creates an enum case builder. * - * @param string|Identifier $name Name + * @param string|Identifier $name Name * * @return Builder\EnumCase The created use const builder */ - public function enumCase($name) : Builder\EnumCase { + public function enumCase($name): Builder\EnumCase { return new Builder\EnumCase($name); } /** * Creates node a for a literal value. * - * @param Expr|bool|null|int|float|string|array $value $value - * - * @return Expr + * @param Expr|bool|null|int|float|string|array|\UnitEnum $value $value */ - public function val($value) : Expr { + public function val($value): Expr { return BuilderHelpers::normalizeValue($value); } @@ -225,10 +220,8 @@ public function val($value) : Expr { * Creates variable node. * * @param string|Expr $name Name - * - * @return Expr\Variable */ - public function var($name) : Expr\Variable { + public function var($name): Expr\Variable { if (!\is_string($name) && !$name instanceof Expr) { throw new \LogicException('Variable name must be string or Expr'); } @@ -243,9 +236,9 @@ public function var($name) : Expr\Variable { * * @param array $args List of arguments to normalize * - * @return Arg[] + * @return list */ - public function args(array $args) : array { + public function args(array $args): array { $normalizedArgs = []; foreach ($args as $key => $arg) { if (!($arg instanceof Arg)) { @@ -263,11 +256,9 @@ public function args(array $args) : array { * Creates a function call node. * * @param string|Name|Expr $name Function name - * @param array $args Function arguments - * - * @return Expr\FuncCall + * @param array $args Function arguments */ - public function funcCall($name, array $args = []) : Expr\FuncCall { + public function funcCall($name, array $args = []): Expr\FuncCall { return new Expr\FuncCall( BuilderHelpers::normalizeNameOrExpr($name), $this->args($args) @@ -277,13 +268,11 @@ public function funcCall($name, array $args = []) : Expr\FuncCall { /** * Creates a method call node. * - * @param Expr $var Variable the method is called on + * @param Expr $var Variable the method is called on * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - * - * @return Expr\MethodCall + * @param array $args Method arguments */ - public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall { + public function methodCall(Expr $var, $name, array $args = []): Expr\MethodCall { return new Expr\MethodCall( $var, BuilderHelpers::normalizeIdentifierOrExpr($name), @@ -294,13 +283,11 @@ public function methodCall(Expr $var, $name, array $args = []) : Expr\MethodCall /** * Creates a static method call node. * - * @param string|Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array $args Method arguments - * - * @return Expr\StaticCall + * @param string|Name|Expr $class Class name + * @param string|Identifier|Expr $name Method name + * @param array $args Method arguments */ - public function staticCall($class, $name, array $args = []) : Expr\StaticCall { + public function staticCall($class, $name, array $args = []): Expr\StaticCall { return new Expr\StaticCall( BuilderHelpers::normalizeNameOrExpr($class), BuilderHelpers::normalizeIdentifierOrExpr($name), @@ -312,11 +299,9 @@ public function staticCall($class, $name, array $args = []) : Expr\StaticCall { * Creates an object creation node. * * @param string|Name|Expr $class Class name - * @param array $args Constructor arguments - * - * @return Expr\New_ + * @param array $args Constructor arguments */ - public function new($class, array $args = []) : Expr\New_ { + public function new($class, array $args = []): Expr\New_ { return new Expr\New_( BuilderHelpers::normalizeNameOrExpr($class), $this->args($args) @@ -327,37 +312,31 @@ public function new($class, array $args = []) : Expr\New_ { * Creates a constant fetch node. * * @param string|Name $name Constant name - * - * @return Expr\ConstFetch */ - public function constFetch($name) : Expr\ConstFetch { + public function constFetch($name): Expr\ConstFetch { return new Expr\ConstFetch(BuilderHelpers::normalizeName($name)); } /** * Creates a property fetch node. * - * @param Expr $var Variable holding object + * @param Expr $var Variable holding object * @param string|Identifier|Expr $name Property name - * - * @return Expr\PropertyFetch */ - public function propertyFetch(Expr $var, $name) : Expr\PropertyFetch { + public function propertyFetch(Expr $var, $name): Expr\PropertyFetch { return new Expr\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name)); } /** * Creates a class constant fetch node. * - * @param string|Name|Expr $class Class name - * @param string|Identifier $name Constant name - * - * @return Expr\ClassConstFetch + * @param string|Name|Expr $class Class name + * @param string|Identifier|Expr $name Constant name */ public function classConstFetch($class, $name): Expr\ClassConstFetch { return new Expr\ClassConstFetch( BuilderHelpers::normalizeNameOrExpr($class), - BuilderHelpers::normalizeIdentifier($name) + BuilderHelpers::normalizeIdentifierOrExpr($name) ); } @@ -365,10 +344,8 @@ public function classConstFetch($class, $name): Expr\ClassConstFetch { * Creates nested Concat nodes from a list of expressions. * * @param Expr|string ...$exprs Expressions or literal strings - * - * @return Concat */ - public function concat(...$exprs) : Concat { + public function concat(...$exprs): Concat { $numExprs = count($exprs); if ($numExprs < 2) { throw new \LogicException('Expected at least two expressions'); @@ -383,9 +360,8 @@ public function concat(...$exprs) : Concat { /** * @param string|Expr $expr - * @return Expr */ - private function normalizeStringExpr($expr) : Expr { + private function normalizeStringExpr($expr): Expr { if ($expr instanceof Expr) { return $expr; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php b/api/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php index af6ceb9968..f29a69153d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php @@ -6,6 +6,7 @@ use PhpParser\Node\Expr; use PhpParser\Node\Identifier; use PhpParser\Node\Name; +use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\NullableType; use PhpParser\Node\Scalar; use PhpParser\Node\Stmt; @@ -15,8 +16,7 @@ * * @internal */ -final class BuilderHelpers -{ +final class BuilderHelpers { /** * Normalizes a node: Converts builder objects to nodes. * @@ -24,7 +24,7 @@ final class BuilderHelpers * * @return Node The normalized node */ - public static function normalizeNode($node) : Node { + public static function normalizeNode($node): Node { if ($node instanceof Builder) { return $node->getNode(); } @@ -45,7 +45,7 @@ public static function normalizeNode($node) : Node { * * @return Stmt The normalized statement node */ - public static function normalizeStmt($node) : Stmt { + public static function normalizeStmt($node): Stmt { $node = self::normalizeNode($node); if ($node instanceof Stmt) { return $node; @@ -65,7 +65,7 @@ public static function normalizeStmt($node) : Stmt { * * @return Identifier The normalized identifier */ - public static function normalizeIdentifier($name) : Identifier { + public static function normalizeIdentifier($name): Identifier { if ($name instanceof Identifier) { return $name; } @@ -103,7 +103,7 @@ public static function normalizeIdentifierOrExpr($name) { * * @return Name The normalized name */ - public static function normalizeName($name) : Name { + public static function normalizeName($name): Name { if ($name instanceof Name) { return $name; } @@ -215,11 +215,11 @@ public static function normalizeType($type) { * Normalizes a value: Converts nulls, booleans, integers, * floats, strings and arrays into their respective nodes * - * @param Node\Expr|bool|null|int|float|string|array $value The value to normalize + * @param Node\Expr|bool|null|int|float|string|array|\UnitEnum $value The value to normalize * * @return Expr The normalized value */ - public static function normalizeValue($value) : Expr { + public static function normalizeValue($value): Expr { if ($value instanceof Node\Expr) { return $value; } @@ -237,11 +237,11 @@ public static function normalizeValue($value) : Expr { } if (is_int($value)) { - return new Scalar\LNumber($value); + return new Scalar\Int_($value); } if (is_float($value)) { - return new Scalar\DNumber($value); + return new Scalar\Float_($value); } if (is_string($value)) { @@ -254,12 +254,12 @@ public static function normalizeValue($value) : Expr { foreach ($value as $itemKey => $itemValue) { // for consecutive, numeric keys don't generate keys if (null !== $lastKey && ++$lastKey === $itemKey) { - $items[] = new Expr\ArrayItem( + $items[] = new Node\ArrayItem( self::normalizeValue($itemValue) ); } else { $lastKey = null; - $items[] = new Expr\ArrayItem( + $items[] = new Node\ArrayItem( self::normalizeValue($itemValue), self::normalizeValue($itemKey) ); @@ -269,6 +269,10 @@ public static function normalizeValue($value) : Expr { return new Expr\Array_($items); } + if ($value instanceof \UnitEnum) { + return new Expr\ClassConstFetch(new FullyQualified(\get_class($value)), new Identifier($value->name)); + } + throw new \LogicException('Invalid value'); } @@ -279,7 +283,7 @@ public static function normalizeValue($value) : Expr { * * @return Comment\Doc The normalized doc comment */ - public static function normalizeDocComment($docComment) : Comment\Doc { + public static function normalizeDocComment($docComment): Comment\Doc { if ($docComment instanceof Comment\Doc) { return $docComment; } @@ -298,8 +302,7 @@ public static function normalizeDocComment($docComment) : Comment\Doc { * * @return Node\AttributeGroup The Attribute Group */ - public static function normalizeAttribute($attribute) : Node\AttributeGroup - { + public static function normalizeAttribute($attribute): Node\AttributeGroup { if ($attribute instanceof Node\AttributeGroup) { return $attribute; } @@ -315,12 +318,12 @@ public static function normalizeAttribute($attribute) : Node\AttributeGroup * Adds a modifier and returns new modifier bitmask. * * @param int $modifiers Existing modifiers - * @param int $modifier Modifier to set + * @param int $modifier Modifier to set * * @return int New modifiers */ - public static function addModifier(int $modifiers, int $modifier) : int { - Stmt\Class_::verifyModifier($modifiers, $modifier); + public static function addModifier(int $modifiers, int $modifier): int { + Modifiers::verifyModifier($modifiers, $modifier); return $modifiers | $modifier; } @@ -328,8 +331,8 @@ public static function addModifier(int $modifiers, int $modifier) : int { * Adds a modifier and returns new modifier bitmask. * @return int New modifiers */ - public static function addClassModifier(int $existingModifiers, int $modifierToSet) : int { - Stmt\Class_::verifyClassModifier($existingModifiers, $modifierToSet); + public static function addClassModifier(int $existingModifiers, int $modifierToSet): int { + Modifiers::verifyClassModifier($existingModifiers, $modifierToSet); return $existingModifiers | $modifierToSet; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Comment.php b/api/vendor/nikic/php-parser/lib/PhpParser/Comment.php index 61e98d3dca..01b341e438 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Comment.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Comment.php @@ -2,23 +2,22 @@ namespace PhpParser; -class Comment implements \JsonSerializable -{ - protected $text; - protected $startLine; - protected $startFilePos; - protected $startTokenPos; - protected $endLine; - protected $endFilePos; - protected $endTokenPos; +class Comment implements \JsonSerializable { + protected string $text; + protected int $startLine; + protected int $startFilePos; + protected int $startTokenPos; + protected int $endLine; + protected int $endFilePos; + protected int $endTokenPos; /** * Constructs a comment node. * - * @param string $text Comment text (including comment delimiters like /*) - * @param int $startLine Line number the comment started on - * @param int $startFilePos File offset the comment started on - * @param int $startTokenPos Token offset the comment started on + * @param string $text Comment text (including comment delimiters like /*) + * @param int $startLine Line number the comment started on + * @param int $startFilePos File offset the comment started on + * @param int $startTokenPos Token offset the comment started on */ public function __construct( string $text, @@ -39,7 +38,7 @@ public function __construct( * * @return string The comment text (including comment delimiters like /*) */ - public function getText() : string { + public function getText(): string { return $this->text; } @@ -47,8 +46,9 @@ public function getText() : string { * Gets the line number the comment started on. * * @return int Line number (or -1 if not available) + * @phpstan-return -1|positive-int */ - public function getStartLine() : int { + public function getStartLine(): int { return $this->startLine; } @@ -57,7 +57,7 @@ public function getStartLine() : int { * * @return int File offset (or -1 if not available) */ - public function getStartFilePos() : int { + public function getStartFilePos(): int { return $this->startFilePos; } @@ -66,7 +66,7 @@ public function getStartFilePos() : int { * * @return int Token offset (or -1 if not available) */ - public function getStartTokenPos() : int { + public function getStartTokenPos(): int { return $this->startTokenPos; } @@ -74,8 +74,9 @@ public function getStartTokenPos() : int { * Gets the line number the comment ends on. * * @return int Line number (or -1 if not available) + * @phpstan-return -1|positive-int */ - public function getEndLine() : int { + public function getEndLine(): int { return $this->endLine; } @@ -84,7 +85,7 @@ public function getEndLine() : int { * * @return int File offset (or -1 if not available) */ - public function getEndFilePos() : int { + public function getEndFilePos(): int { return $this->endFilePos; } @@ -93,49 +94,16 @@ public function getEndFilePos() : int { * * @return int Token offset (or -1 if not available) */ - public function getEndTokenPos() : int { + public function getEndTokenPos(): int { return $this->endTokenPos; } - /** - * Gets the line number the comment started on. - * - * @deprecated Use getStartLine() instead - * - * @return int Line number - */ - public function getLine() : int { - return $this->startLine; - } - - /** - * Gets the file offset the comment started on. - * - * @deprecated Use getStartFilePos() instead - * - * @return int File offset - */ - public function getFilePos() : int { - return $this->startFilePos; - } - - /** - * Gets the token offset the comment started on. - * - * @deprecated Use getStartTokenPos() instead - * - * @return int Token offset - */ - public function getTokenPos() : int { - return $this->startTokenPos; - } - /** * Gets the comment text. * * @return string The comment text (including comment delimiters like /*) */ - public function __toString() : string { + public function __toString(): string { return $this->text; } @@ -144,18 +112,19 @@ public function __toString() : string { * * "Reformatted" here means that we try to clean up the whitespace at the * starts of the lines. This is necessary because we receive the comments - * without trailing whitespace on the first line, but with trailing whitespace + * without leading whitespace on the first line, but with leading whitespace * on all subsequent lines. * - * @return mixed|string + * Additionally, this normalizes CRLF newlines to LF newlines. */ - public function getReformattedText() { - $text = trim($this->text); + public function getReformattedText(): string { + $text = str_replace("\r\n", "\n", $this->text); $newlinePos = strpos($text, "\n"); if (false === $newlinePos) { // Single line comments don't need further processing return $text; - } elseif (preg_match('((*BSR_ANYCRLF)(*ANYCRLF)^.*(?:\R\s+\*.*)+$)', $text)) { + } + if (preg_match('(^.*(?:\n\s+\*.*)+$)', $text)) { // Multi line comment of the type // // /* @@ -164,8 +133,9 @@ public function getReformattedText() { // */ // // is handled by replacing the whitespace sequences before the * by a single space - return preg_replace('(^\s+\*)m', ' *', $this->text); - } elseif (preg_match('(^/\*\*?\s*[\r\n])', $text) && preg_match('(\n(\s*)\*/$)', $text, $matches)) { + return preg_replace('(^\s+\*)m', ' *', $text); + } + if (preg_match('(^/\*\*?\s*\n)', $text) && preg_match('(\n(\s*)\*/$)', $text, $matches)) { // Multi line comment of the type // // /* @@ -177,7 +147,8 @@ public function getReformattedText() { // */ on all lines. So if the last line is " */", then " " is removed at the // start of all lines. return preg_replace('(^' . preg_quote($matches[1]) . ')m', '', $text); - } elseif (preg_match('(^/\*\*?\s*(?!\s))', $text, $matches)) { + } + if (preg_match('(^/\*\*?\s*(?!\s))', $text, $matches)) { // Multi line comment of the type // // /* Some text. @@ -204,9 +175,9 @@ public function getReformattedText() { * @param string $str String to check * @return int Length in characters. Tabs count as single characters. */ - private function getShortestWhitespacePrefixLen(string $str) : int { + private function getShortestWhitespacePrefixLen(string $str): int { $lines = explode("\n", $str); - $shortestPrefixLen = \INF; + $shortestPrefixLen = \PHP_INT_MAX; foreach ($lines as $line) { preg_match('(^\s*)', $line, $matches); $prefixLen = strlen($matches[0]); @@ -218,10 +189,9 @@ private function getShortestWhitespacePrefixLen(string $str) : int { } /** - * @return array - * @psalm-return array{nodeType:string, text:mixed, line:mixed, filePos:mixed} + * @return array{nodeType:string, text:mixed, line:mixed, filePos:mixed} */ - public function jsonSerialize() : array { + public function jsonSerialize(): array { // Technically not a node, but we make it look like one anyway $type = $this instanceof Comment\Doc ? 'Comment_Doc' : 'Comment'; return [ diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php b/api/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php index a9db6128f4..bb3e9146af 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Comment/Doc.php @@ -2,6 +2,5 @@ namespace PhpParser\Comment; -class Doc extends \PhpParser\Comment -{ +class Doc extends \PhpParser\Comment { } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php b/api/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php index 49c92d5950..7964058a6e 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/ConstExprEvaluationException.php @@ -1,6 +1,6 @@ -fallbackEvaluator = $fallbackEvaluator ?? function(Expr $expr) { + public function __construct(?callable $fallbackEvaluator = null) { + $this->fallbackEvaluator = $fallbackEvaluator ?? function (Expr $expr) { throw new ConstExprEvaluationException( "Expression of type {$expr->getType()} cannot be evaluated" ); @@ -63,7 +64,7 @@ public function __construct(callable $fallbackEvaluator = null) { * @throws ConstExprEvaluationException if the expression cannot be evaluated or an error occurred */ public function evaluateSilently(Expr $expr) { - set_error_handler(function($num, $str, $file, $line) { + set_error_handler(function ($num, $str, $file, $line) { throw new \ErrorException($str, 0, $num, $file, $line); }); @@ -101,9 +102,10 @@ public function evaluateDirectly(Expr $expr) { return $this->evaluate($expr); } + /** @return mixed */ private function evaluate(Expr $expr) { - if ($expr instanceof Scalar\LNumber - || $expr instanceof Scalar\DNumber + if ($expr instanceof Scalar\Int_ + || $expr instanceof Scalar\Float_ || $expr instanceof Scalar\String_ ) { return $expr->value; @@ -146,7 +148,7 @@ private function evaluate(Expr $expr) { return ($this->fallbackEvaluator)($expr); } - private function evaluateArray(Expr\Array_ $expr) { + private function evaluateArray(Expr\Array_ $expr): array { $array = []; foreach ($expr->items as $item) { if (null !== $item->key) { @@ -160,6 +162,7 @@ private function evaluateArray(Expr\Array_ $expr) { return $array; } + /** @return mixed */ private function evaluateTernary(Expr\Ternary $expr) { if (null === $expr->if) { return $this->evaluate($expr->cond) ?: $this->evaluate($expr->else); @@ -170,6 +173,7 @@ private function evaluateTernary(Expr\Ternary $expr) { : $this->evaluate($expr->else); } + /** @return mixed */ private function evaluateBinaryOp(Expr\BinaryOp $expr) { if ($expr instanceof Expr\BinaryOp\Coalesce && $expr->left instanceof Expr\ArrayDimFetch @@ -216,6 +220,7 @@ private function evaluateBinaryOp(Expr\BinaryOp $expr) { throw new \Exception('Should not happen'); } + /** @return mixed */ private function evaluateConstFetch(Expr\ConstFetch $expr) { $name = $expr->name->toLowerString(); switch ($name) { diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Error.php b/api/vendor/nikic/php-parser/lib/PhpParser/Error.php index d1fb959d19..f81f0c4202 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Error.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Error.php @@ -2,25 +2,20 @@ namespace PhpParser; -class Error extends \RuntimeException -{ - protected $rawMessage; - protected $attributes; +class Error extends \RuntimeException { + protected string $rawMessage; + /** @var array */ + protected array $attributes; /** * Creates an Exception signifying a parse error. * - * @param string $message Error message - * @param array|int $attributes Attributes of node/token where error occurred - * (or start line of error -- deprecated) + * @param string $message Error message + * @param array $attributes Attributes of node/token where error occurred */ - public function __construct(string $message, $attributes = []) { + public function __construct(string $message, array $attributes = []) { $this->rawMessage = $message; - if (is_array($attributes)) { - $this->attributes = $attributes; - } else { - $this->attributes = ['startLine' => $attributes]; - } + $this->attributes = $attributes; $this->updateMessage(); } @@ -29,7 +24,7 @@ public function __construct(string $message, $attributes = []) { * * @return string Error message */ - public function getRawMessage() : string { + public function getRawMessage(): string { return $this->rawMessage; } @@ -37,8 +32,9 @@ public function getRawMessage() : string { * Gets the line the error starts in. * * @return int Error start line + * @phpstan-return -1|positive-int */ - public function getStartLine() : int { + public function getStartLine(): int { return $this->attributes['startLine'] ?? -1; } @@ -46,26 +42,27 @@ public function getStartLine() : int { * Gets the line the error ends in. * * @return int Error end line + * @phpstan-return -1|positive-int */ - public function getEndLine() : int { + public function getEndLine(): int { return $this->attributes['endLine'] ?? -1; } /** * Gets the attributes of the node/token the error occurred at. * - * @return array + * @return array */ - public function getAttributes() : array { + public function getAttributes(): array { return $this->attributes; } /** * Sets the attributes of the node/token the error occurred at. * - * @param array $attributes + * @param array $attributes */ - public function setAttributes(array $attributes) { + public function setAttributes(array $attributes): void { $this->attributes = $attributes; $this->updateMessage(); } @@ -75,7 +72,7 @@ public function setAttributes(array $attributes) { * * @param string $message Error message */ - public function setRawMessage(string $message) { + public function setRawMessage(string $message): void { $this->rawMessage = $message; $this->updateMessage(); } @@ -85,7 +82,7 @@ public function setRawMessage(string $message) { * * @param int $line Error start line */ - public function setStartLine(int $line) { + public function setStartLine(int $line): void { $this->attributes['startLine'] = $line; $this->updateMessage(); } @@ -94,10 +91,8 @@ public function setStartLine(int $line) { * Returns whether the error has start and end column information. * * For column information enable the startFilePos and endFilePos in the lexer options. - * - * @return bool */ - public function hasColumnInfo() : bool { + public function hasColumnInfo(): bool { return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']); } @@ -105,9 +100,8 @@ public function hasColumnInfo() : bool { * Gets the start column (1-based) into the line where the error started. * * @param string $code Source code of the file - * @return int */ - public function getStartColumn(string $code) : int { + public function getStartColumn(string $code): int { if (!$this->hasColumnInfo()) { throw new \RuntimeException('Error does not have column information'); } @@ -119,9 +113,8 @@ public function getStartColumn(string $code) : int { * Gets the end column (1-based) into the line where the error ended. * * @param string $code Source code of the file - * @return int */ - public function getEndColumn(string $code) : int { + public function getEndColumn(string $code): int { if (!$this->hasColumnInfo()) { throw new \RuntimeException('Error does not have column information'); } @@ -136,7 +129,7 @@ public function getEndColumn(string $code) : int { * * @return string Formatted message */ - public function getMessageWithColumnInfo(string $code) : string { + public function getMessageWithColumnInfo(string $code): string { return sprintf( '%s from %d:%d to %d:%d', $this->getRawMessage(), $this->getStartLine(), $this->getStartColumn($code), @@ -148,11 +141,11 @@ public function getMessageWithColumnInfo(string $code) : string { * Converts a file offset into a column. * * @param string $code Source code that $pos indexes into - * @param int $pos 0-based position in $code + * @param int $pos 0-based position in $code * * @return int 1-based column (relative to start of line) */ - private function toColumn(string $code, int $pos) : int { + private function toColumn(string $code, int $pos): int { if ($pos > strlen($code)) { throw new \RuntimeException('Invalid position information'); } @@ -168,7 +161,7 @@ private function toColumn(string $code, int $pos) : int { /** * Updates the exception message after a change to rawMessage or rawLine. */ - protected function updateMessage() { + protected function updateMessage(): void { $this->message = $this->rawMessage; if (-1 === $this->getStartLine()) { diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php b/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php index d620e74536..51ad730c4e 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler.php @@ -2,12 +2,11 @@ namespace PhpParser; -interface ErrorHandler -{ +interface ErrorHandler { /** * Handle an error generated during lexing, parsing or some other operation. * * @param Error $error The error that needs to be handled */ - public function handleError(Error $error); + public function handleError(Error $error): void; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php b/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php index 784b61b143..eee634924a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Collecting.php @@ -10,12 +10,11 @@ * * This allows graceful handling of errors. */ -class Collecting implements ErrorHandler -{ +class Collecting implements ErrorHandler { /** @var Error[] Collected errors */ - private $errors = []; + private array $errors = []; - public function handleError(Error $error) { + public function handleError(Error $error): void { $this->errors[] = $error; } @@ -24,23 +23,21 @@ public function handleError(Error $error) { * * @return Error[] */ - public function getErrors() : array { + public function getErrors(): array { return $this->errors; } /** * Check whether there are any errors. - * - * @return bool */ - public function hasErrors() : bool { + public function hasErrors(): bool { return !empty($this->errors); } /** * Reset/clear collected errors. */ - public function clearErrors() { + public function clearErrors(): void { $this->errors = []; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php b/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php index aeee989b1a..dff33dd021 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/ErrorHandler/Throwing.php @@ -10,9 +10,8 @@ * * This is the default strategy used by all components. */ -class Throwing implements ErrorHandler -{ - public function handleError(Error $error) { +class Throwing implements ErrorHandler { + public function handleError(Error $error): void { throw $error; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php index a38b57ba93..7433b5d32a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/DiffElem.php @@ -5,20 +5,24 @@ /** * @internal */ -class DiffElem -{ - const TYPE_KEEP = 0; - const TYPE_REMOVE = 1; - const TYPE_ADD = 2; - const TYPE_REPLACE = 3; +class DiffElem { + public const TYPE_KEEP = 0; + public const TYPE_REMOVE = 1; + public const TYPE_ADD = 2; + public const TYPE_REPLACE = 3; /** @var int One of the TYPE_* constants */ - public $type; + public int $type; /** @var mixed Is null for add operations */ public $old; /** @var mixed Is null for remove operations */ public $new; + /** + * @param int $type One of the TYPE_* constants + * @param mixed $old Is null for add operations + * @param mixed $new Is null for remove operations + */ public function __construct(int $type, $old, $new) { $this->type = $type; $this->old = $old; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php index 7f218c74fe..253e17574c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/Differ.php @@ -8,16 +8,17 @@ * Myers, Eugene W. "An O (ND) difference algorithm and its variations." * Algorithmica 1.1 (1986): 251-266. * + * @template T * @internal */ -class Differ -{ +class Differ { + /** @var callable(T, T): bool */ private $isEqual; /** * Create differ over the given equality relation. * - * @param callable $isEqual Equality relation with signature function($a, $b) : bool + * @param callable(T, T): bool $isEqual Equality relation */ public function __construct(callable $isEqual) { $this->isEqual = $isEqual; @@ -26,12 +27,14 @@ public function __construct(callable $isEqual) { /** * Calculate diff (edit script) from $old to $new. * - * @param array $old Original array - * @param array $new New array + * @param T[] $old Original array + * @param T[] $new New array * * @return DiffElem[] Diff (edit script) */ - public function diff(array $old, array $new) { + public function diff(array $old, array $new): array { + $old = \array_values($old); + $new = \array_values($new); list($trace, $x, $y) = $this->calculateTrace($old, $new); return $this->extractDiff($trace, $x, $y, $old, $new); } @@ -42,32 +45,37 @@ public function diff(array $old, array $new) { * If a sequence of remove operations is followed by the same number of add operations, these * will be coalesced into replace operations. * - * @param array $old Original array - * @param array $new New array + * @param T[] $old Original array + * @param T[] $new New array * * @return DiffElem[] Diff (edit script), including replace operations */ - public function diffWithReplacements(array $old, array $new) { + public function diffWithReplacements(array $old, array $new): array { return $this->coalesceReplacements($this->diff($old, $new)); } - private function calculateTrace(array $a, array $b) { - $n = \count($a); - $m = \count($b); + /** + * @param T[] $old + * @param T[] $new + * @return array{array>, int, int} + */ + private function calculateTrace(array $old, array $new): array { + $n = \count($old); + $m = \count($new); $max = $n + $m; $v = [1 => 0]; $trace = []; for ($d = 0; $d <= $max; $d++) { $trace[] = $v; for ($k = -$d; $k <= $d; $k += 2) { - if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) { - $x = $v[$k+1]; + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { + $x = $v[$k + 1]; } else { - $x = $v[$k-1] + 1; + $x = $v[$k - 1] + 1; } $y = $x - $k; - while ($x < $n && $y < $m && ($this->isEqual)($a[$x], $b[$y])) { + while ($x < $n && $y < $m && ($this->isEqual)($old[$x], $new[$y])) { $x++; $y++; } @@ -81,13 +89,19 @@ private function calculateTrace(array $a, array $b) { throw new \Exception('Should not happen'); } - private function extractDiff(array $trace, int $x, int $y, array $a, array $b) { + /** + * @param array> $trace + * @param T[] $old + * @param T[] $new + * @return DiffElem[] + */ + private function extractDiff(array $trace, int $x, int $y, array $old, array $new): array { $result = []; for ($d = \count($trace) - 1; $d >= 0; $d--) { $v = $trace[$d]; $k = $x - $y; - if ($k === -$d || ($k !== $d && $v[$k-1] < $v[$k+1])) { + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { $prevK = $k + 1; } else { $prevK = $k - 1; @@ -97,7 +111,7 @@ private function extractDiff(array $trace, int $x, int $y, array $a, array $b) { $prevY = $prevX - $prevK; while ($x > $prevX && $y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_KEEP, $a[$x-1], $b[$y-1]); + $result[] = new DiffElem(DiffElem::TYPE_KEEP, $old[$x - 1], $new[$y - 1]); $x--; $y--; } @@ -107,12 +121,12 @@ private function extractDiff(array $trace, int $x, int $y, array $a, array $b) { } while ($x > $prevX) { - $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $a[$x-1], null); + $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $old[$x - 1], null); $x--; } while ($y > $prevY) { - $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $b[$y-1]); + $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $new[$y - 1]); $y--; } } @@ -125,7 +139,7 @@ private function extractDiff(array $trace, int $x, int $y, array $a, array $b) { * @param DiffElem[] $diff * @return DiffElem[] */ - private function coalesceReplacements(array $diff) { + private function coalesceReplacements(array $diff): array { $newDiff = []; $c = \count($diff); for ($i = 0; $i < $c; $i++) { diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php index 3eeac04a41..b30a99a14b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php @@ -15,47 +15,57 @@ * * @internal */ -class PrintableNewAnonClassNode extends Expr -{ +class PrintableNewAnonClassNode extends Expr { /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; - /** @var Node\Arg[] Arguments */ - public $args; + public array $attrGroups; + /** @var int Modifiers */ + public int $flags; + /** @var (Node\Arg|Node\VariadicPlaceholder)[] Arguments */ + public array $args; /** @var null|Node\Name Name of extended class */ - public $extends; + public ?Node\Name $extends; /** @var Node\Name[] Names of implemented interfaces */ - public $implements; + public array $implements; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; + /** + * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param (Node\Arg|Node\VariadicPlaceholder)[] $args Arguments + * @param Node\Name|null $extends Name of extended class + * @param Node\Name[] $implements Names of implemented interfaces + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Attributes + */ public function __construct( - array $attrGroups, array $args, Node\Name $extends = null, array $implements, + array $attrGroups, int $flags, array $args, ?Node\Name $extends, array $implements, array $stmts, array $attributes ) { parent::__construct($attributes); $this->attrGroups = $attrGroups; + $this->flags = $flags; $this->args = $args; $this->extends = $extends; $this->implements = $implements; $this->stmts = $stmts; } - public static function fromNewNode(Expr\New_ $newNode) { + public static function fromNewNode(Expr\New_ $newNode): self { $class = $newNode->class; assert($class instanceof Node\Stmt\Class_); // We don't assert that $class->name is null here, to allow consumers to assign unique names // to anonymous classes for their own purposes. We simplify ignore the name here. return new self( - $class->attrGroups, $newNode->args, $class->extends, $class->implements, + $class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements, $class->stmts, $newNode->getAttributes() ); } - public function getType() : string { + public function getType(): string { return 'Expr_PrintableNewAnonClass'; } - public function getSubNodeNames() : array { - return ['attrGroups', 'args', 'extends', 'implements', 'stmts']; + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts']; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php new file mode 100644 index 0000000000..36022d09a0 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenPolyfill.php @@ -0,0 +1,237 @@ += 80000) { + class TokenPolyfill extends \PhpToken { + } + return; +} + +/** + * This is a polyfill for the PhpToken class introduced in PHP 8.0. We do not actually polyfill + * PhpToken, because composer might end up picking a different polyfill implementation, which does + * not meet our requirements. + * + * @internal + */ +class TokenPolyfill { + /** @var int The ID of the token. Either a T_* constant of a character code < 256. */ + public int $id; + /** @var string The textual content of the token. */ + public string $text; + /** @var int The 1-based starting line of the token (or -1 if unknown). */ + public int $line; + /** @var int The 0-based starting position of the token (or -1 if unknown). */ + public int $pos; + + /** @var array Tokens ignored by the PHP parser. */ + private const IGNORABLE_TOKENS = [ + \T_WHITESPACE => true, + \T_COMMENT => true, + \T_DOC_COMMENT => true, + \T_OPEN_TAG => true, + ]; + + /** @var array Tokens that may be part of a T_NAME_* identifier. */ + private static array $identifierTokens; + + /** + * Create a Token with the given ID and text, as well optional line and position information. + */ + final public function __construct(int $id, string $text, int $line = -1, int $pos = -1) { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $pos; + } + + /** + * Get the name of the token. For single-char tokens this will be the token character. + * Otherwise it will be a T_* style name, or null if the token ID is unknown. + */ + public function getTokenName(): ?string { + if ($this->id < 256) { + return \chr($this->id); + } + + $name = token_name($this->id); + return $name === 'UNKNOWN' ? null : $name; + } + + /** + * Check whether the token is of the given kind. The kind may be either an integer that matches + * the token ID, a string that matches the token text, or an array of integers/strings. In the + * latter case, the function returns true if any of the kinds in the array match. + * + * @param int|string|(int|string)[] $kind + */ + public function is($kind): bool { + if (\is_int($kind)) { + return $this->id === $kind; + } + if (\is_string($kind)) { + return $this->text === $kind; + } + if (\is_array($kind)) { + foreach ($kind as $entry) { + if (\is_int($entry)) { + if ($this->id === $entry) { + return true; + } + } elseif (\is_string($entry)) { + if ($this->text === $entry) { + return true; + } + } else { + throw new \TypeError( + 'Argument #1 ($kind) must only have elements of type string|int, ' . + gettype($entry) . ' given'); + } + } + return false; + } + throw new \TypeError( + 'Argument #1 ($kind) must be of type string|int|array, ' .gettype($kind) . ' given'); + } + + /** + * Check whether this token would be ignored by the PHP parser. Returns true for T_WHITESPACE, + * T_COMMENT, T_DOC_COMMENT and T_OPEN_TAG, and false for everything else. + */ + public function isIgnorable(): bool { + return isset(self::IGNORABLE_TOKENS[$this->id]); + } + + /** + * Return the textual content of the token. + */ + public function __toString(): string { + return $this->text; + } + + /** + * Tokenize the given source code and return an array of tokens. + * + * This performs certain canonicalizations to match the PHP 8.0 token format: + * * Bad characters are represented using T_BAD_CHARACTER rather than omitted. + * * T_COMMENT does not include trailing newlines, instead the newline is part of a following + * T_WHITESPACE token. + * * Namespaced names are represented using T_NAME_* tokens. + * + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array { + self::init(); + + $tokens = []; + $line = 1; + $pos = 0; + $origTokens = \token_get_all($code, $flags); + + $numTokens = \count($origTokens); + for ($i = 0; $i < $numTokens; $i++) { + $token = $origTokens[$i]; + if (\is_string($token)) { + if (\strlen($token) === 2) { + // b" and B" are tokenized as single-char tokens, even though they aren't. + $tokens[] = new static(\ord('"'), $token, $line, $pos); + $pos += 2; + } else { + $tokens[] = new static(\ord($token), $token, $line, $pos); + $pos++; + } + } else { + $id = $token[0]; + $text = $token[1]; + + // Emulate PHP 8.0 comment format, which does not include trailing whitespace anymore. + if ($id === \T_COMMENT && \substr($text, 0, 2) !== '/*' && + \preg_match('/(\r\n|\n|\r)$/D', $text, $matches) + ) { + $trailingNewline = $matches[0]; + $text = \substr($text, 0, -\strlen($trailingNewline)); + $tokens[] = new static($id, $text, $line, $pos); + $pos += \strlen($text); + + if ($i + 1 < $numTokens && $origTokens[$i + 1][0] === \T_WHITESPACE) { + // Move trailing newline into following T_WHITESPACE token, if it already exists. + $origTokens[$i + 1][1] = $trailingNewline . $origTokens[$i + 1][1]; + $origTokens[$i + 1][2]--; + } else { + // Otherwise, we need to create a new T_WHITESPACE token. + $tokens[] = new static(\T_WHITESPACE, $trailingNewline, $line, $pos); + $line++; + $pos += \strlen($trailingNewline); + } + continue; + } + + // Emulate PHP 8.0 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and + // T_STRING into a single token. + if (($id === \T_NS_SEPARATOR || isset(self::$identifierTokens[$id]))) { + $newText = $text; + $lastWasSeparator = $id === \T_NS_SEPARATOR; + for ($j = $i + 1; $j < $numTokens; $j++) { + if ($lastWasSeparator) { + if (!isset(self::$identifierTokens[$origTokens[$j][0]])) { + break; + } + $lastWasSeparator = false; + } else { + if ($origTokens[$j][0] !== \T_NS_SEPARATOR) { + break; + } + $lastWasSeparator = true; + } + $newText .= $origTokens[$j][1]; + } + if ($lastWasSeparator) { + // Trailing separator is not part of the name. + $j--; + $newText = \substr($newText, 0, -1); + } + if ($j > $i + 1) { + if ($id === \T_NS_SEPARATOR) { + $id = \T_NAME_FULLY_QUALIFIED; + } elseif ($id === \T_NAMESPACE) { + $id = \T_NAME_RELATIVE; + } else { + $id = \T_NAME_QUALIFIED; + } + $tokens[] = new static($id, $newText, $line, $pos); + $pos += \strlen($newText); + $i = $j - 1; + continue; + } + } + + $tokens[] = new static($id, $text, $line, $pos); + $line += \substr_count($text, "\n"); + $pos += \strlen($text); + } + } + return $tokens; + } + + /** Initialize private static state needed by tokenize(). */ + private static function init(): void { + if (isset(self::$identifierTokens)) { + return; + } + + // Based on semi_reserved production. + self::$identifierTokens = \array_fill_keys([ + \T_STRING, + \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, + \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, + \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, + \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, + \T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO, + \T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT, + \T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS, + \T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN, + \T_MATCH, + ], true); + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php index 7e0a5de0f1..cdbe2bdcc9 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Internal/TokenStream.php @@ -2,37 +2,36 @@ namespace PhpParser\Internal; +use PhpParser\Token; + /** * Provides operations on token streams, for use by pretty printer. * * @internal */ -class TokenStream -{ - /** @var array Tokens (in token_get_all format) */ - private $tokens; +class TokenStream { + /** @var Token[] Tokens (in PhpToken::tokenize() format) */ + private array $tokens; /** @var int[] Map from position to indentation */ - private $indentMap; + private array $indentMap; /** * Create token stream instance. * - * @param array $tokens Tokens in token_get_all() format + * @param Token[] $tokens Tokens in PhpToken::tokenize() format */ - public function __construct(array $tokens) { + public function __construct(array $tokens, int $tabWidth) { $this->tokens = $tokens; - $this->indentMap = $this->calcIndentMap(); + $this->indentMap = $this->calcIndentMap($tabWidth); } /** * Whether the given position is immediately surrounded by parenthesis. * * @param int $startPos Start position - * @param int $endPos End position - * - * @return bool + * @param int $endPos End position */ - public function haveParens(int $startPos, int $endPos) : bool { + public function haveParens(int $startPos, int $endPos): bool { return $this->haveTokenImmediatelyBefore($startPos, '(') && $this->haveTokenImmediatelyAfter($endPos, ')'); } @@ -41,11 +40,9 @@ public function haveParens(int $startPos, int $endPos) : bool { * Whether the given position is immediately surrounded by braces. * * @param int $startPos Start position - * @param int $endPos End position - * - * @return bool + * @param int $endPos End position */ - public function haveBraces(int $startPos, int $endPos) : bool { + public function haveBraces(int $startPos, int $endPos): bool { return ($this->haveTokenImmediatelyBefore($startPos, '{') || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN)) && $this->haveTokenImmediatelyAfter($endPos, '}'); @@ -56,21 +53,20 @@ public function haveBraces(int $startPos, int $endPos) : bool { * * During this check whitespace and comments are skipped. * - * @param int $pos Position before which the token should occur + * @param int $pos Position before which the token should occur * @param int|string $expectedTokenType Token to check for * * @return bool Whether the expected token was found */ - public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool { + public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType): bool { $tokens = $this->tokens; $pos--; for (; $pos >= 0; $pos--) { - $tokenType = $tokens[$pos][0]; - if ($tokenType === $expectedTokenType) { + $token = $tokens[$pos]; + if ($token->is($expectedTokenType)) { return true; } - if ($tokenType !== \T_WHITESPACE - && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) { + if (!$token->isIgnorable()) { break; } } @@ -82,28 +78,28 @@ public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType) : bool * * During this check whitespace and comments are skipped. * - * @param int $pos Position after which the token should occur + * @param int $pos Position after which the token should occur * @param int|string $expectedTokenType Token to check for * * @return bool Whether the expected token was found */ - public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType) : bool { + public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType): bool { $tokens = $this->tokens; $pos++; - for (; $pos < \count($tokens); $pos++) { - $tokenType = $tokens[$pos][0]; - if ($tokenType === $expectedTokenType) { + for ($c = \count($tokens); $pos < $c; $pos++) { + $token = $tokens[$pos]; + if ($token->is($expectedTokenType)) { return true; } - if ($tokenType !== \T_WHITESPACE - && $tokenType !== \T_COMMENT && $tokenType !== \T_DOC_COMMENT) { + if (!$token->isIgnorable()) { break; } } return false; } - public function skipLeft(int $pos, $skipTokenType) { + /** @param int|string|(int|string)[] $skipTokenType */ + public function skipLeft(int $pos, $skipTokenType): int { $tokens = $this->tokens; $pos = $this->skipLeftWhitespace($pos); @@ -111,7 +107,7 @@ public function skipLeft(int $pos, $skipTokenType) { return $pos; } - if ($tokens[$pos][0] !== $skipTokenType) { + if (!$tokens[$pos]->is($skipTokenType)) { // Shouldn't happen. The skip token MUST be there throw new \Exception('Encountered unexpected token'); } @@ -120,7 +116,8 @@ public function skipLeft(int $pos, $skipTokenType) { return $this->skipLeftWhitespace($pos); } - public function skipRight(int $pos, $skipTokenType) { + /** @param int|string|(int|string)[] $skipTokenType */ + public function skipRight(int $pos, $skipTokenType): int { $tokens = $this->tokens; $pos = $this->skipRightWhitespace($pos); @@ -128,7 +125,7 @@ public function skipRight(int $pos, $skipTokenType) { return $pos; } - if ($tokens[$pos][0] !== $skipTokenType) { + if (!$tokens[$pos]->is($skipTokenType)) { // Shouldn't happen. The skip token MUST be there throw new \Exception('Encountered unexpected token'); } @@ -143,11 +140,10 @@ public function skipRight(int $pos, $skipTokenType) { * @param int $pos Token position * @return int Non-whitespace token position */ - public function skipLeftWhitespace(int $pos) { + public function skipLeftWhitespace(int $pos): int { $tokens = $this->tokens; for (; $pos >= 0; $pos--) { - $type = $tokens[$pos][0]; - if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) { + if (!$tokens[$pos]->isIgnorable()) { break; } } @@ -160,22 +156,21 @@ public function skipLeftWhitespace(int $pos) { * @param int $pos Token position * @return int Non-whitespace token position */ - public function skipRightWhitespace(int $pos) { + public function skipRightWhitespace(int $pos): int { $tokens = $this->tokens; for ($count = \count($tokens); $pos < $count; $pos++) { - $type = $tokens[$pos][0]; - if ($type !== \T_WHITESPACE && $type !== \T_COMMENT && $type !== \T_DOC_COMMENT) { + if (!$tokens[$pos]->isIgnorable()) { break; } } return $pos; } - public function findRight(int $pos, $findTokenType) { + /** @param int|string|(int|string)[] $findTokenType */ + public function findRight(int $pos, $findTokenType): int { $tokens = $this->tokens; for ($count = \count($tokens); $pos < $count; $pos++) { - $type = $tokens[$pos][0]; - if ($type === $findTokenType) { + if ($tokens[$pos]->is($findTokenType)) { return $pos; } } @@ -190,22 +185,16 @@ public function findRight(int $pos, $findTokenType) { * @param int|string $tokenType Token type to look for * @return bool Whether the token occurs in the given range */ - public function haveTokenInRange(int $startPos, int $endPos, $tokenType) { + public function haveTokenInRange(int $startPos, int $endPos, $tokenType): bool { $tokens = $this->tokens; for ($pos = $startPos; $pos < $endPos; $pos++) { - if ($tokens[$pos][0] === $tokenType) { + if ($tokens[$pos]->is($tokenType)) { return true; } } return false; } - public function haveBracesInRange(int $startPos, int $endPos) { - return $this->haveTokenInRange($startPos, $endPos, '{') - || $this->haveTokenInRange($startPos, $endPos, T_CURLY_OPEN) - || $this->haveTokenInRange($startPos, $endPos, '}'); - } - public function haveTagInRange(int $startPos, int $endPos): bool { return $this->haveTokenInRange($startPos, $endPos, \T_OPEN_TAG) || $this->haveTokenInRange($startPos, $endPos, \T_CLOSE_TAG); @@ -218,41 +207,37 @@ public function haveTagInRange(int $startPos, int $endPos): bool { * * @return int Indentation depth (in spaces) */ - public function getIndentationBefore(int $pos) : int { + public function getIndentationBefore(int $pos): int { return $this->indentMap[$pos]; } /** * Get the code corresponding to a token offset range, optionally adjusted for indentation. * - * @param int $from Token start position (inclusive) - * @param int $to Token end position (exclusive) + * @param int $from Token start position (inclusive) + * @param int $to Token end position (exclusive) * @param int $indent By how much the code should be indented (can be negative as well) * * @return string Code corresponding to token range, adjusted for indentation */ - public function getTokenCode(int $from, int $to, int $indent) : string { + public function getTokenCode(int $from, int $to, int $indent): string { $tokens = $this->tokens; $result = ''; for ($pos = $from; $pos < $to; $pos++) { $token = $tokens[$pos]; - if (\is_array($token)) { - $type = $token[0]; - $content = $token[1]; - if ($type === \T_CONSTANT_ENCAPSED_STRING || $type === \T_ENCAPSED_AND_WHITESPACE) { - $result .= $content; + $id = $token->id; + $text = $token->text; + if ($id === \T_CONSTANT_ENCAPSED_STRING || $id === \T_ENCAPSED_AND_WHITESPACE) { + $result .= $text; + } else { + // TODO Handle non-space indentation + if ($indent < 0) { + $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $text); + } elseif ($indent > 0) { + $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $text); } else { - // TODO Handle non-space indentation - if ($indent < 0) { - $result .= str_replace("\n" . str_repeat(" ", -$indent), "\n", $content); - } elseif ($indent > 0) { - $result .= str_replace("\n", "\n" . str_repeat(" ", $indent), $content); - } else { - $result .= $content; - } + $result .= $text; } - } else { - $result .= $token; } } return $result; @@ -263,17 +248,21 @@ public function getTokenCode(int $from, int $to, int $indent) : string { * * @return int[] Token position to indentation map */ - private function calcIndentMap() { + private function calcIndentMap(int $tabWidth): array { $indentMap = []; $indent = 0; - foreach ($this->tokens as $token) { + foreach ($this->tokens as $i => $token) { $indentMap[] = $indent; - if ($token[0] === \T_WHITESPACE) { - $content = $token[1]; + if ($token->id === \T_WHITESPACE) { + $content = $token->text; $newlinePos = \strrpos($content, "\n"); if (false !== $newlinePos) { - $indent = \strlen($content) - $newlinePos - 1; + $indent = $this->getIndent(\substr($content, $newlinePos + 1), $tabWidth); + } elseif ($i === 1 && $this->tokens[0]->id === \T_OPEN_TAG && + $this->tokens[0]->text[\strlen($this->tokens[0]->text) - 1] === "\n") { + // Special case: Newline at the end of opening tag followed by whitespace. + $indent = $this->getIndent($content, $tabWidth); } } } @@ -283,4 +272,11 @@ private function calcIndentMap() { return $indentMap; } + + private function getIndent(string $ws, int $tabWidth): int { + $spaces = \substr_count($ws, " "); + $tabs = \substr_count($ws, "\t"); + assert(\strlen($ws) === $spaces + $tabs); + return $spaces + $tabs * $tabWidth; + } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php b/api/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php index 47d2003d4b..7be41426ef 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/JsonDecoder.php @@ -2,11 +2,11 @@ namespace PhpParser; -class JsonDecoder -{ - /** @var \ReflectionClass[] Node type to reflection class map */ - private $reflectionClassCache; +class JsonDecoder { + /** @var \ReflectionClass[] Node type to reflection class map */ + private array $reflectionClassCache; + /** @return mixed */ public function decode(string $json) { $value = json_decode($json, true); if (json_last_error()) { @@ -16,6 +16,10 @@ public function decode(string $json) { return $this->decodeRecursive($value); } + /** + * @param mixed $value + * @return mixed + */ private function decodeRecursive($value) { if (\is_array($value)) { if (isset($value['nodeType'])) { @@ -29,7 +33,7 @@ private function decodeRecursive($value) { return $value; } - private function decodeArray(array $array) : array { + private function decodeArray(array $array): array { $decodedArray = []; foreach ($array as $key => $value) { $decodedArray[$key] = $this->decodeRecursive($value); @@ -37,14 +41,13 @@ private function decodeArray(array $array) : array { return $decodedArray; } - private function decodeNode(array $value) : Node { + private function decodeNode(array $value): Node { $nodeType = $value['nodeType']; if (!\is_string($nodeType)) { throw new \RuntimeException('Node type must be a string'); } $reflectionClass = $this->reflectionClassFromNodeType($nodeType); - /** @var Node $node */ $node = $reflectionClass->newInstanceWithoutConstructor(); if (isset($value['attributes'])) { @@ -66,7 +69,7 @@ private function decodeNode(array $value) : Node { return $node; } - private function decodeComment(array $value) : Comment { + private function decodeComment(array $value): Comment { $className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\Doc::class; if (!isset($value['text'])) { throw new \RuntimeException('Comment must have text'); @@ -79,7 +82,8 @@ private function decodeComment(array $value) : Comment { ); } - private function reflectionClassFromNodeType(string $nodeType) : \ReflectionClass { + /** @return \ReflectionClass */ + private function reflectionClassFromNodeType(string $nodeType): \ReflectionClass { if (!isset($this->reflectionClassCache[$nodeType])) { $className = $this->classNameFromNodeType($nodeType); $this->reflectionClassCache[$nodeType] = new \ReflectionClass($className); @@ -87,7 +91,8 @@ private function reflectionClassFromNodeType(string $nodeType) : \ReflectionClas return $this->reflectionClassCache[$nodeType]; } - private function classNameFromNodeType(string $nodeType) : string { + /** @return class-string */ + private function classNameFromNodeType(string $nodeType): string { $className = 'PhpParser\\Node\\' . strtr($nodeType, '_', '\\'); if (class_exists($className)) { return $className; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer.php index e15dd0a5d2..5e2ece9617 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer.php @@ -2,559 +2,115 @@ namespace PhpParser; -use PhpParser\Parser\Tokens; - -class Lexer -{ - protected $code; - protected $tokens; - protected $pos; - protected $line; - protected $filePos; - protected $prevCloseTagHasNewline; - - protected $tokenMap; - protected $dropTokens; - protected $identifierTokens; - - private $attributeStartLineUsed; - private $attributeEndLineUsed; - private $attributeStartTokenPosUsed; - private $attributeEndTokenPosUsed; - private $attributeStartFilePosUsed; - private $attributeEndFilePosUsed; - private $attributeCommentsUsed; +require __DIR__ . '/compatibility_tokens.php'; +class Lexer { /** - * Creates a Lexer. + * Tokenize the provided source code. * - * @param array $options Options array. Currently only the 'usedAttributes' option is supported, - * which is an array of attributes to add to the AST nodes. Possible - * attributes are: 'comments', 'startLine', 'endLine', 'startTokenPos', - * 'endTokenPos', 'startFilePos', 'endFilePos'. The option defaults to the - * first three. For more info see getNextToken() docs. - */ - public function __construct(array $options = []) { - // Create Map from internal tokens to PhpParser tokens. - $this->defineCompatibilityTokens(); - $this->tokenMap = $this->createTokenMap(); - $this->identifierTokens = $this->createIdentifierTokenMap(); - - // map of tokens to drop while lexing (the map is only used for isset lookup, - // that's why the value is simply set to 1; the value is never actually used.) - $this->dropTokens = array_fill_keys( - [\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], 1 - ); - - $defaultAttributes = ['comments', 'startLine', 'endLine']; - $usedAttributes = array_fill_keys($options['usedAttributes'] ?? $defaultAttributes, true); - - // Create individual boolean properties to make these checks faster. - $this->attributeStartLineUsed = isset($usedAttributes['startLine']); - $this->attributeEndLineUsed = isset($usedAttributes['endLine']); - $this->attributeStartTokenPosUsed = isset($usedAttributes['startTokenPos']); - $this->attributeEndTokenPosUsed = isset($usedAttributes['endTokenPos']); - $this->attributeStartFilePosUsed = isset($usedAttributes['startFilePos']); - $this->attributeEndFilePosUsed = isset($usedAttributes['endFilePos']); - $this->attributeCommentsUsed = isset($usedAttributes['comments']); - } - - /** - * Initializes the lexer for lexing the provided source code. + * The token array is in the same format as provided by the PhpToken::tokenize() method in + * PHP 8.0. The tokens are instances of PhpParser\Token, to abstract over a polyfill + * implementation in earlier PHP version. * - * This function does not throw if lexing errors occur. Instead, errors may be retrieved using - * the getErrors() method. + * The token array is terminated by a sentinel token with token ID 0. + * The token array does not discard any tokens (i.e. whitespace and comments are included). + * The token position attributes are against this token array. * - * @param string $code The source code to lex + * @param string $code The source code to tokenize. * @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to - * ErrorHandler\Throwing + * ErrorHandler\Throwing. + * @return Token[] Tokens */ - public function startLexing(string $code, ErrorHandler $errorHandler = null) { + public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { if (null === $errorHandler) { $errorHandler = new ErrorHandler\Throwing(); } - $this->code = $code; // keep the code around for __halt_compiler() handling - $this->pos = -1; - $this->line = 1; - $this->filePos = 0; - - // If inline HTML occurs without preceding code, treat it as if it had a leading newline. - // This ensures proper composability, because having a newline is the "safe" assumption. - $this->prevCloseTagHasNewline = true; - $scream = ini_set('xdebug.scream', '0'); - $this->tokens = @token_get_all($code); - $this->postprocessTokens($errorHandler); + $tokens = @Token::tokenize($code); + $this->postprocessTokens($tokens, $errorHandler); if (false !== $scream) { ini_set('xdebug.scream', $scream); } - } - - private function handleInvalidCharacterRange($start, $end, $line, ErrorHandler $errorHandler) { - $tokens = []; - for ($i = $start; $i < $end; $i++) { - $chr = $this->code[$i]; - if ($chr === "\0") { - // PHP cuts error message after null byte, so need special case - $errorMsg = 'Unexpected null byte'; - } else { - $errorMsg = sprintf( - 'Unexpected character "%s" (ASCII %d)', $chr, ord($chr) - ); - } - $tokens[] = [\T_BAD_CHARACTER, $chr, $line]; - $errorHandler->handleError(new Error($errorMsg, [ - 'startLine' => $line, - 'endLine' => $line, - 'startFilePos' => $i, - 'endFilePos' => $i, - ])); - } return $tokens; } - /** - * Check whether comment token is unterminated. - * - * @return bool - */ - private function isUnterminatedComment($token) : bool { - return ($token[0] === \T_COMMENT || $token[0] === \T_DOC_COMMENT) - && substr($token[1], 0, 2) === '/*' - && substr($token[1], -2) !== '*/'; - } - - protected function postprocessTokens(ErrorHandler $errorHandler) { - // PHP's error handling for token_get_all() is rather bad, so if we want detailed - // error information we need to compute it ourselves. Invalid character errors are - // detected by finding "gaps" in the token array. Unterminated comments are detected - // by checking if a trailing comment has a "*/" at the end. - // - // Additionally, we perform a number of canonicalizations here: - // * Use the PHP 8.0 comment format, which does not include trailing whitespace anymore. - // * Use PHP 8.0 T_NAME_* tokens. - // * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and - // T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types. - - $filePos = 0; - $line = 1; - $numTokens = \count($this->tokens); - for ($i = 0; $i < $numTokens; $i++) { - $token = $this->tokens[$i]; - - // Since PHP 7.4 invalid characters are represented by a T_BAD_CHARACTER token. - // In this case we only need to emit an error. - if ($token[0] === \T_BAD_CHARACTER) { - $this->handleInvalidCharacterRange($filePos, $filePos + 1, $line, $errorHandler); - } - - if ($token[0] === \T_COMMENT && substr($token[1], 0, 2) !== '/*' - && preg_match('/(\r\n|\n|\r)$/D', $token[1], $matches)) { - $trailingNewline = $matches[0]; - $token[1] = substr($token[1], 0, -strlen($trailingNewline)); - $this->tokens[$i] = $token; - if (isset($this->tokens[$i + 1]) && $this->tokens[$i + 1][0] === \T_WHITESPACE) { - // Move trailing newline into following T_WHITESPACE token, if it already exists. - $this->tokens[$i + 1][1] = $trailingNewline . $this->tokens[$i + 1][1]; - $this->tokens[$i + 1][2]--; - } else { - // Otherwise, we need to create a new T_WHITESPACE token. - array_splice($this->tokens, $i + 1, 0, [ - [\T_WHITESPACE, $trailingNewline, $line], - ]); - $numTokens++; - } - } - - // Emulate PHP 8 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and T_STRING - // into a single token. - if (\is_array($token) - && ($token[0] === \T_NS_SEPARATOR || isset($this->identifierTokens[$token[0]]))) { - $lastWasSeparator = $token[0] === \T_NS_SEPARATOR; - $text = $token[1]; - for ($j = $i + 1; isset($this->tokens[$j]); $j++) { - if ($lastWasSeparator) { - if (!isset($this->identifierTokens[$this->tokens[$j][0]])) { - break; - } - $lastWasSeparator = false; - } else { - if ($this->tokens[$j][0] !== \T_NS_SEPARATOR) { - break; - } - $lastWasSeparator = true; - } - $text .= $this->tokens[$j][1]; - } - if ($lastWasSeparator) { - // Trailing separator is not part of the name. - $j--; - $text = substr($text, 0, -1); - } - if ($j > $i + 1) { - if ($token[0] === \T_NS_SEPARATOR) { - $type = \T_NAME_FULLY_QUALIFIED; - } else if ($token[0] === \T_NAMESPACE) { - $type = \T_NAME_RELATIVE; - } else { - $type = \T_NAME_QUALIFIED; - } - $token = [$type, $text, $line]; - array_splice($this->tokens, $i, $j - $i, [$token]); - $numTokens -= $j - $i - 1; - } - } - - if ($token === '&') { - $next = $i + 1; - while (isset($this->tokens[$next]) && $this->tokens[$next][0] === \T_WHITESPACE) { - $next++; - } - $followedByVarOrVarArg = isset($this->tokens[$next]) && - ($this->tokens[$next][0] === \T_VARIABLE || $this->tokens[$next][0] === \T_ELLIPSIS); - $this->tokens[$i] = $token = [ - $followedByVarOrVarArg - ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG - : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, - '&', - $line, - ]; - } - - $tokenValue = \is_string($token) ? $token : $token[1]; - $tokenLen = \strlen($tokenValue); - - if (substr($this->code, $filePos, $tokenLen) !== $tokenValue) { - // Something is missing, must be an invalid character - $nextFilePos = strpos($this->code, $tokenValue, $filePos); - $badCharTokens = $this->handleInvalidCharacterRange( - $filePos, $nextFilePos, $line, $errorHandler); - $filePos = (int) $nextFilePos; - - array_splice($this->tokens, $i, 0, $badCharTokens); - $numTokens += \count($badCharTokens); - $i += \count($badCharTokens); - } - - $filePos += $tokenLen; - $line += substr_count($tokenValue, "\n"); - } - - if ($filePos !== \strlen($this->code)) { - if (substr($this->code, $filePos, 2) === '/*') { - // Unlike PHP, HHVM will drop unterminated comments entirely - $comment = substr($this->code, $filePos); - $errorHandler->handleError(new Error('Unterminated comment', [ - 'startLine' => $line, - 'endLine' => $line + substr_count($comment, "\n"), - 'startFilePos' => $filePos, - 'endFilePos' => $filePos + \strlen($comment), - ])); - - // Emulate the PHP behavior - $isDocComment = isset($comment[3]) && $comment[3] === '*'; - $this->tokens[] = [$isDocComment ? \T_DOC_COMMENT : \T_COMMENT, $comment, $line]; - } else { - // Invalid characters at the end of the input - $badCharTokens = $this->handleInvalidCharacterRange( - $filePos, \strlen($this->code), $line, $errorHandler); - $this->tokens = array_merge($this->tokens, $badCharTokens); - } - return; + private function handleInvalidCharacter(Token $token, ErrorHandler $errorHandler): void { + $chr = $token->text; + if ($chr === "\0") { + // PHP cuts error message after null byte, so need special case + $errorMsg = 'Unexpected null byte'; + } else { + $errorMsg = sprintf( + 'Unexpected character "%s" (ASCII %d)', $chr, ord($chr) + ); } - if (count($this->tokens) > 0) { - // Check for unterminated comment - $lastToken = $this->tokens[count($this->tokens) - 1]; - if ($this->isUnterminatedComment($lastToken)) { - $errorHandler->handleError(new Error('Unterminated comment', [ - 'startLine' => $line - substr_count($lastToken[1], "\n"), - 'endLine' => $line, - 'startFilePos' => $filePos - \strlen($lastToken[1]), - 'endFilePos' => $filePos, - ])); - } - } + $errorHandler->handleError(new Error($errorMsg, [ + 'startLine' => $token->line, + 'endLine' => $token->line, + 'startFilePos' => $token->pos, + 'endFilePos' => $token->pos, + ])); } - /** - * Fetches the next token. - * - * The available attributes are determined by the 'usedAttributes' option, which can - * be specified in the constructor. The following attributes are supported: - * - * * 'comments' => Array of PhpParser\Comment or PhpParser\Comment\Doc instances, - * representing all comments that occurred between the previous - * non-discarded token and the current one. - * * 'startLine' => Line in which the node starts. - * * 'endLine' => Line in which the node ends. - * * 'startTokenPos' => Offset into the token array of the first token in the node. - * * 'endTokenPos' => Offset into the token array of the last token in the node. - * * 'startFilePos' => Offset into the code string of the first character that is part of the node. - * * 'endFilePos' => Offset into the code string of the last character that is part of the node. - * - * @param mixed $value Variable to store token content in - * @param mixed $startAttributes Variable to store start attributes in - * @param mixed $endAttributes Variable to store end attributes in - * - * @return int Token id - */ - public function getNextToken(&$value = null, &$startAttributes = null, &$endAttributes = null) : int { - $startAttributes = []; - $endAttributes = []; - - while (1) { - if (isset($this->tokens[++$this->pos])) { - $token = $this->tokens[$this->pos]; - } else { - // EOF token with ID 0 - $token = "\0"; - } - - if ($this->attributeStartLineUsed) { - $startAttributes['startLine'] = $this->line; - } - if ($this->attributeStartTokenPosUsed) { - $startAttributes['startTokenPos'] = $this->pos; - } - if ($this->attributeStartFilePosUsed) { - $startAttributes['startFilePos'] = $this->filePos; - } - - if (\is_string($token)) { - $value = $token; - if (isset($token[1])) { - // bug in token_get_all - $this->filePos += 2; - $id = ord('"'); - } else { - $this->filePos += 1; - $id = ord($token); - } - } elseif (!isset($this->dropTokens[$token[0]])) { - $value = $token[1]; - $id = $this->tokenMap[$token[0]]; - if (\T_CLOSE_TAG === $token[0]) { - $this->prevCloseTagHasNewline = false !== strpos($token[1], "\n") - || false !== strpos($token[1], "\r"); - } elseif (\T_INLINE_HTML === $token[0]) { - $startAttributes['hasLeadingNewline'] = $this->prevCloseTagHasNewline; - } - - $this->line += substr_count($value, "\n"); - $this->filePos += \strlen($value); - } else { - $origLine = $this->line; - $origFilePos = $this->filePos; - $this->line += substr_count($token[1], "\n"); - $this->filePos += \strlen($token[1]); - - if (\T_COMMENT === $token[0] || \T_DOC_COMMENT === $token[0]) { - if ($this->attributeCommentsUsed) { - $comment = \T_DOC_COMMENT === $token[0] - ? new Comment\Doc($token[1], - $origLine, $origFilePos, $this->pos, - $this->line, $this->filePos - 1, $this->pos) - : new Comment($token[1], - $origLine, $origFilePos, $this->pos, - $this->line, $this->filePos - 1, $this->pos); - $startAttributes['comments'][] = $comment; - } - } - continue; - } - - if ($this->attributeEndLineUsed) { - $endAttributes['endLine'] = $this->line; - } - if ($this->attributeEndTokenPosUsed) { - $endAttributes['endTokenPos'] = $this->pos; - } - if ($this->attributeEndFilePosUsed) { - $endAttributes['endFilePos'] = $this->filePos - 1; - } - - return $id; - } - - throw new \RuntimeException('Reached end of lexer loop'); - } - - /** - * Returns the token array for current code. - * - * The token array is in the same format as provided by the - * token_get_all() function and does not discard tokens (i.e. - * whitespace and comments are included). The token position - * attributes are against this token array. - * - * @return array Array of tokens in token_get_all() format - */ - public function getTokens() : array { - return $this->tokens; + private function isUnterminatedComment(Token $token): bool { + return $token->is([\T_COMMENT, \T_DOC_COMMENT]) + && substr($token->text, 0, 2) === '/*' + && substr($token->text, -2) !== '*/'; } /** - * Handles __halt_compiler() by returning the text after it. - * - * @return string Remaining text + * @param list $tokens */ - public function handleHaltCompiler() : string { - // text after T_HALT_COMPILER, still including (); - $textAfter = substr($this->code, $this->filePos); - - // ensure that it is followed by (); - // this simplifies the situation, by not allowing any comments - // in between of the tokens. - if (!preg_match('~^\s*\(\s*\)\s*(?:;|\?>\r?\n?)~', $textAfter, $matches)) { - throw new Error('__HALT_COMPILER must be followed by "();"'); - } - - // prevent the lexer from returning any further tokens - $this->pos = count($this->tokens); - - // return with (); removed - return substr($textAfter, strlen($matches[0])); - } + protected function postprocessTokens(array &$tokens, ErrorHandler $errorHandler): void { + // This function reports errors (bad characters and unterminated comments) in the token + // array, and performs certain canonicalizations: + // * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and + // T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types. + // * Add a sentinel token with ID 0. - private function defineCompatibilityTokens() { - static $compatTokensDefined = false; - if ($compatTokensDefined) { + $numTokens = \count($tokens); + if ($numTokens === 0) { + // Empty input edge case: Just add the sentinel token. + $tokens[] = new Token(0, "\0", 1, 0); return; } - $compatTokens = [ - // PHP 7.4 - 'T_BAD_CHARACTER', - 'T_FN', - 'T_COALESCE_EQUAL', - // PHP 8.0 - 'T_NAME_QUALIFIED', - 'T_NAME_FULLY_QUALIFIED', - 'T_NAME_RELATIVE', - 'T_MATCH', - 'T_NULLSAFE_OBJECT_OPERATOR', - 'T_ATTRIBUTE', - // PHP 8.1 - 'T_ENUM', - 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', - 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', - 'T_READONLY', - ]; - - // PHP-Parser might be used together with another library that also emulates some or all - // of these tokens. Perform a sanity-check that all already defined tokens have been - // assigned a unique ID. - $usedTokenIds = []; - foreach ($compatTokens as $token) { - if (\defined($token)) { - $tokenId = \constant($token); - $clashingToken = $usedTokenIds[$tokenId] ?? null; - if ($clashingToken !== null) { - throw new \Error(sprintf( - 'Token %s has same ID as token %s, ' . - 'you may be using a library with broken token emulation', - $token, $clashingToken - )); - } - $usedTokenIds[$tokenId] = $token; - } - } - - // Now define any tokens that have not yet been emulated. Try to assign IDs from -1 - // downwards, but skip any IDs that may already be in use. - $newTokenId = -1; - foreach ($compatTokens as $token) { - if (!\defined($token)) { - while (isset($usedTokenIds[$newTokenId])) { - $newTokenId--; - } - \define($token, $newTokenId); - $newTokenId--; + for ($i = 0; $i < $numTokens; $i++) { + $token = $tokens[$i]; + if ($token->id === \T_BAD_CHARACTER) { + $this->handleInvalidCharacter($token, $errorHandler); } - } - $compatTokensDefined = true; - } - - /** - * Creates the token map. - * - * The token map maps the PHP internal token identifiers - * to the identifiers used by the Parser. Additionally it - * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'. - * - * @return array The token map - */ - protected function createTokenMap() : array { - $tokenMap = []; - - // 256 is the minimum possible token number, as everything below - // it is an ASCII value - for ($i = 256; $i < 1000; ++$i) { - if (\T_DOUBLE_COLON === $i) { - // T_DOUBLE_COLON is equivalent to T_PAAMAYIM_NEKUDOTAYIM - $tokenMap[$i] = Tokens::T_PAAMAYIM_NEKUDOTAYIM; - } elseif(\T_OPEN_TAG_WITH_ECHO === $i) { - // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO - $tokenMap[$i] = Tokens::T_ECHO; - } elseif(\T_CLOSE_TAG === $i) { - // T_CLOSE_TAG is equivalent to ';' - $tokenMap[$i] = ord(';'); - } elseif ('UNKNOWN' !== $name = token_name($i)) { - if ('T_HASHBANG' === $name) { - // HHVM uses a special token for #! hashbang lines - $tokenMap[$i] = Tokens::T_INLINE_HTML; - } elseif (defined($name = Tokens::class . '::' . $name)) { - // Other tokens can be mapped directly - $tokenMap[$i] = constant($name); + if ($token->id === \ord('&')) { + $next = $i + 1; + while (isset($tokens[$next]) && $tokens[$next]->id === \T_WHITESPACE) { + $next++; } + $followedByVarOrVarArg = isset($tokens[$next]) && + $tokens[$next]->is([\T_VARIABLE, \T_ELLIPSIS]); + $token->id = $followedByVarOrVarArg + ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG + : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; } } - // HHVM uses a special token for numbers that overflow to double - if (defined('T_ONUMBER')) { - $tokenMap[\T_ONUMBER] = Tokens::T_DNUMBER; - } - // HHVM also has a separate token for the __COMPILER_HALT_OFFSET__ constant - if (defined('T_COMPILER_HALT_OFFSET')) { - $tokenMap[\T_COMPILER_HALT_OFFSET] = Tokens::T_STRING; + // Check for unterminated comment + $lastToken = $tokens[$numTokens - 1]; + if ($this->isUnterminatedComment($lastToken)) { + $errorHandler->handleError(new Error('Unterminated comment', [ + 'startLine' => $lastToken->line, + 'endLine' => $lastToken->getEndLine(), + 'startFilePos' => $lastToken->pos, + 'endFilePos' => $lastToken->getEndPos(), + ])); } - // Assign tokens for which we define compatibility constants, as token_name() does not know them. - $tokenMap[\T_FN] = Tokens::T_FN; - $tokenMap[\T_COALESCE_EQUAL] = Tokens::T_COALESCE_EQUAL; - $tokenMap[\T_NAME_QUALIFIED] = Tokens::T_NAME_QUALIFIED; - $tokenMap[\T_NAME_FULLY_QUALIFIED] = Tokens::T_NAME_FULLY_QUALIFIED; - $tokenMap[\T_NAME_RELATIVE] = Tokens::T_NAME_RELATIVE; - $tokenMap[\T_MATCH] = Tokens::T_MATCH; - $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = Tokens::T_NULLSAFE_OBJECT_OPERATOR; - $tokenMap[\T_ATTRIBUTE] = Tokens::T_ATTRIBUTE; - $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG; - $tokenMap[\T_ENUM] = Tokens::T_ENUM; - $tokenMap[\T_READONLY] = Tokens::T_READONLY; - - return $tokenMap; - } - - private function createIdentifierTokenMap(): array { - // Based on semi_reserved production. - return array_fill_keys([ - \T_STRING, - \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, - \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, - \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, - \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, - \T_FINALLY, \T_THROW, \T_USE, \T_INSTEADOF, \T_GLOBAL, \T_VAR, \T_UNSET, \T_ISSET, \T_EMPTY, \T_CONTINUE, \T_GOTO, - \T_FUNCTION, \T_CONST, \T_RETURN, \T_PRINT, \T_YIELD, \T_LIST, \T_SWITCH, \T_ENDSWITCH, \T_CASE, \T_DEFAULT, - \T_BREAK, \T_ARRAY, \T_CALLABLE, \T_EXTENDS, \T_IMPLEMENTS, \T_NAMESPACE, \T_TRAIT, \T_INTERFACE, \T_CLASS, - \T_CLASS_C, \T_TRAIT_C, \T_FUNC_C, \T_METHOD_C, \T_LINE, \T_FILE, \T_DIR, \T_NS_C, \T_HALT_COMPILER, \T_FN, - \T_MATCH, - ], true); + // Add sentinel token. + $tokens[] = new Token(0, "\0", $lastToken->getEndLine(), $lastToken->getEndPos()); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php index b0929f3ccb..c9b3b6d306 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php @@ -5,61 +5,48 @@ use PhpParser\Error; use PhpParser\ErrorHandler; use PhpParser\Lexer; +use PhpParser\Lexer\TokenEmulator\AsymmetricVisibilityTokenEmulator; use PhpParser\Lexer\TokenEmulator\AttributeEmulator; use PhpParser\Lexer\TokenEmulator\EnumTokenEmulator; -use PhpParser\Lexer\TokenEmulator\CoaleseEqualTokenEmulator; use PhpParser\Lexer\TokenEmulator\ExplicitOctalEmulator; -use PhpParser\Lexer\TokenEmulator\FlexibleDocStringEmulator; -use PhpParser\Lexer\TokenEmulator\FnTokenEmulator; use PhpParser\Lexer\TokenEmulator\MatchTokenEmulator; use PhpParser\Lexer\TokenEmulator\NullsafeTokenEmulator; -use PhpParser\Lexer\TokenEmulator\NumericLiteralSeparatorEmulator; +use PhpParser\Lexer\TokenEmulator\PropertyTokenEmulator; use PhpParser\Lexer\TokenEmulator\ReadonlyFunctionTokenEmulator; use PhpParser\Lexer\TokenEmulator\ReadonlyTokenEmulator; use PhpParser\Lexer\TokenEmulator\ReverseEmulator; use PhpParser\Lexer\TokenEmulator\TokenEmulator; +use PhpParser\PhpVersion; +use PhpParser\Token; -class Emulative extends Lexer -{ - const PHP_7_3 = '7.3dev'; - const PHP_7_4 = '7.4dev'; - const PHP_8_0 = '8.0dev'; - const PHP_8_1 = '8.1dev'; - const PHP_8_2 = '8.2dev'; +class Emulative extends Lexer { + /** @var array{int, string, string}[] Patches used to reverse changes introduced in the code */ + private array $patches = []; - /** @var mixed[] Patches used to reverse changes introduced in the code */ - private $patches = []; + /** @var list */ + private array $emulators = []; - /** @var TokenEmulator[] */ - private $emulators = []; + private PhpVersion $targetPhpVersion; - /** @var string */ - private $targetPhpVersion; + private PhpVersion $hostPhpVersion; /** - * @param mixed[] $options Lexer options. In addition to the usual options, - * accepts a 'phpVersion' string that specifies the - * version to emulate. Defaults to newest supported. + * @param PhpVersion|null $phpVersion PHP version to emulate. Defaults to newest supported. */ - public function __construct(array $options = []) - { - $this->targetPhpVersion = $options['phpVersion'] ?? Emulative::PHP_8_2; - unset($options['phpVersion']); - - parent::__construct($options); + public function __construct(?PhpVersion $phpVersion = null) { + $this->targetPhpVersion = $phpVersion ?? PhpVersion::getNewestSupported(); + $this->hostPhpVersion = PhpVersion::getHostVersion(); $emulators = [ - new FlexibleDocStringEmulator(), - new FnTokenEmulator(), new MatchTokenEmulator(), - new CoaleseEqualTokenEmulator(), - new NumericLiteralSeparatorEmulator(), new NullsafeTokenEmulator(), new AttributeEmulator(), new EnumTokenEmulator(), new ReadonlyTokenEmulator(), new ExplicitOctalEmulator(), new ReadonlyFunctionTokenEmulator(), + new PropertyTokenEmulator(), + new AsymmetricVisibilityTokenEmulator(), ]; // Collect emulators that are relevant for the PHP version we're running @@ -68,21 +55,24 @@ public function __construct(array $options = []) $emulatorPhpVersion = $emulator->getPhpVersion(); if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) { $this->emulators[] = $emulator; - } else if ($this->isReverseEmulationNeeded($emulatorPhpVersion)) { + } elseif ($this->isReverseEmulationNeeded($emulatorPhpVersion)) { $this->emulators[] = new ReverseEmulator($emulator); } } } - public function startLexing(string $code, ErrorHandler $errorHandler = null) { - $emulators = array_filter($this->emulators, function($emulator) use($code) { + public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array { + $emulators = array_filter($this->emulators, function ($emulator) use ($code) { return $emulator->isEmulationNeeded($code); }); if (empty($emulators)) { // Nothing to emulate, yay - parent::startLexing($code, $errorHandler); - return; + return parent::tokenize($code, $errorHandler); + } + + if ($errorHandler === null) { + $errorHandler = new ErrorHandler\Throwing(); } $this->patches = []; @@ -91,9 +81,9 @@ public function startLexing(string $code, ErrorHandler $errorHandler = null) { } $collector = new ErrorHandler\Collecting(); - parent::startLexing($code, $collector); + $tokens = parent::tokenize($code, $collector); $this->sortPatches(); - $this->fixupTokens(); + $tokens = $this->fixupTokens($tokens); $errors = $collector->getErrors(); if (!empty($errors)) { @@ -104,90 +94,80 @@ public function startLexing(string $code, ErrorHandler $errorHandler = null) { } foreach ($emulators as $emulator) { - $this->tokens = $emulator->emulate($code, $this->tokens); + $tokens = $emulator->emulate($code, $tokens); } + + return $tokens; } - private function isForwardEmulationNeeded(string $emulatorPhpVersion): bool { - return version_compare(\PHP_VERSION, $emulatorPhpVersion, '<') - && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '>='); + private function isForwardEmulationNeeded(PhpVersion $emulatorPhpVersion): bool { + return $this->hostPhpVersion->older($emulatorPhpVersion) + && $this->targetPhpVersion->newerOrEqual($emulatorPhpVersion); } - private function isReverseEmulationNeeded(string $emulatorPhpVersion): bool { - return version_compare(\PHP_VERSION, $emulatorPhpVersion, '>=') - && version_compare($this->targetPhpVersion, $emulatorPhpVersion, '<'); + private function isReverseEmulationNeeded(PhpVersion $emulatorPhpVersion): bool { + return $this->hostPhpVersion->newerOrEqual($emulatorPhpVersion) + && $this->targetPhpVersion->older($emulatorPhpVersion); } - private function sortPatches() - { + private function sortPatches(): void { // Patches may be contributed by different emulators. // Make sure they are sorted by increasing patch position. - usort($this->patches, function($p1, $p2) { + usort($this->patches, function ($p1, $p2) { return $p1[0] <=> $p2[0]; }); } - private function fixupTokens() - { + /** + * @param list $tokens + * @return list + */ + private function fixupTokens(array $tokens): array { if (\count($this->patches) === 0) { - return; + return $tokens; } // Load first patch $patchIdx = 0; - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; // We use a manual loop over the tokens, because we modify the array on the fly - $pos = 0; - for ($i = 0, $c = \count($this->tokens); $i < $c; $i++) { - $token = $this->tokens[$i]; - if (\is_string($token)) { - if ($patchPos === $pos) { - // Only support replacement for string tokens. - assert($patchType === 'replace'); - $this->tokens[$i] = $patchText; - - // Fetch the next patch - $patchIdx++; - if ($patchIdx >= \count($this->patches)) { - // No more patches, we're done - return; - } - list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - } - - $pos += \strlen($token); - continue; - } - - $len = \strlen($token[1]); - $posDelta = 0; + $posDelta = 0; + $lineDelta = 0; + for ($i = 0, $c = \count($tokens); $i < $c; $i++) { + $token = $tokens[$i]; + $pos = $token->pos; + $token->pos += $posDelta; + $token->line += $lineDelta; + $localPosDelta = 0; + $len = \strlen($token->text); while ($patchPos >= $pos && $patchPos < $pos + $len) { $patchTextLen = \strlen($patchText); if ($patchType === 'remove') { if ($patchPos === $pos && $patchTextLen === $len) { // Remove token entirely - array_splice($this->tokens, $i, 1, []); + array_splice($tokens, $i, 1, []); $i--; $c--; } else { // Remove from token string - $this->tokens[$i][1] = substr_replace( - $token[1], '', $patchPos - $pos + $posDelta, $patchTextLen + $token->text = substr_replace( + $token->text, '', $patchPos - $pos + $localPosDelta, $patchTextLen ); - $posDelta -= $patchTextLen; + $localPosDelta -= $patchTextLen; } + $lineDelta -= \substr_count($patchText, "\n"); } elseif ($patchType === 'add') { // Insert into the token string - $this->tokens[$i][1] = substr_replace( - $token[1], $patchText, $patchPos - $pos + $posDelta, 0 + $token->text = substr_replace( + $token->text, $patchText, $patchPos - $pos + $localPosDelta, 0 ); - $posDelta += $patchTextLen; - } else if ($patchType === 'replace') { + $localPosDelta += $patchTextLen; + $lineDelta += \substr_count($patchText, "\n"); + } elseif ($patchType === 'replace') { // Replace inside the token string - $this->tokens[$i][1] = substr_replace( - $token[1], $patchText, $patchPos - $pos + $posDelta, $patchTextLen + $token->text = substr_replace( + $token->text, $patchText, $patchPos - $pos + $localPosDelta, $patchTextLen ); } else { assert(false); @@ -196,22 +176,17 @@ private function fixupTokens() // Fetch the next patch $patchIdx++; if ($patchIdx >= \count($this->patches)) { - // No more patches, we're done - return; + // No more patches. However, we still need to adjust position. + $patchPos = \PHP_INT_MAX; + break; } list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx]; - - // Multiple patches may apply to the same token. Reload the current one to check - // If the new patch applies - $token = $this->tokens[$i]; } - $pos += $len; + $posDelta += $localPosDelta; } - - // A patch did not apply - assert(false); + return $tokens; } /** @@ -219,7 +194,7 @@ private function fixupTokens() * * @param Error[] $errors */ - private function fixupErrors(array $errors) { + private function fixupErrors(array $errors): void { foreach ($errors as $error) { $attrs = $error->getAttributes(); @@ -235,7 +210,7 @@ private function fixupErrors(array $errors) { if ($patchType === 'add') { $posDelta += strlen($patchText); $lineDelta += substr_count($patchText, "\n"); - } else if ($patchType === 'remove') { + } elseif ($patchType === 'remove') { $posDelta -= strlen($patchText); $lineDelta -= substr_count($patchText, "\n"); } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php new file mode 100644 index 0000000000..084bb75dcc --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php @@ -0,0 +1,93 @@ + \T_PUBLIC_SET, + \T_PROTECTED => \T_PROTECTED_SET, + \T_PRIVATE => \T_PRIVATE_SET, + ]; + for ($i = 0, $c = count($tokens); $i < $c; ++$i) { + $token = $tokens[$i]; + if (isset($map[$token->id]) && $i + 3 < $c && $tokens[$i + 1]->text === '(' && + $tokens[$i + 2]->id === \T_STRING && \strtolower($tokens[$i + 2]->text) === 'set' && + $tokens[$i + 3]->text === ')' && + $this->isKeywordContext($tokens, $i) + ) { + array_splice($tokens, $i, 4, [ + new Token( + $map[$token->id], $token->text . '(' . $tokens[$i + 2]->text . ')', + $token->line, $token->pos), + ]); + $c -= 3; + } + } + + return $tokens; + } + + public function reverseEmulate(string $code, array $tokens): array { + $reverseMap = [ + \T_PUBLIC_SET => \T_PUBLIC, + \T_PROTECTED_SET => \T_PROTECTED, + \T_PRIVATE_SET => \T_PRIVATE, + ]; + for ($i = 0, $c = count($tokens); $i < $c; ++$i) { + $token = $tokens[$i]; + if (isset($reverseMap[$token->id]) && + \preg_match('/(public|protected|private)\((set)\)/i', $token->text, $matches) + ) { + [, $modifier, $set] = $matches; + $modifierLen = \strlen($modifier); + array_splice($tokens, $i, 1, [ + new Token($reverseMap[$token->id], $modifier, $token->line, $token->pos), + new Token(\ord('('), '(', $token->line, $token->pos + $modifierLen), + new Token(\T_STRING, $set, $token->line, $token->pos + $modifierLen + 1), + new Token(\ord(')'), ')', $token->line, $token->pos + $modifierLen + 4), + ]); + $i += 3; + $c += 3; + } + } + + return $tokens; + } + + /** @param Token[] $tokens */ + protected function isKeywordContext(array $tokens, int $pos): bool { + $prevToken = $this->getPreviousNonSpaceToken($tokens, $pos); + if ($prevToken === null) { + return false; + } + return $prevToken->id !== \T_OBJECT_OPERATOR + && $prevToken->id !== \T_NULLSAFE_OBJECT_OPERATOR; + } + + /** @param Token[] $tokens */ + private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token { + for ($i = $start - 1; $i >= 0; --$i) { + if ($tokens[$i]->id === T_WHITESPACE) { + continue; + } + + return $tokens[$i]; + } + + return null; + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php index 6776a51975..2c12f33ae6 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php @@ -2,43 +2,36 @@ namespace PhpParser\Lexer\TokenEmulator; -use PhpParser\Lexer\Emulative; +use PhpParser\PhpVersion; +use PhpParser\Token; -final class AttributeEmulator extends TokenEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_0; +final class AttributeEmulator extends TokenEmulator { + public function getPhpVersion(): PhpVersion { + return PhpVersion::fromComponents(8, 0); } - public function isEmulationNeeded(string $code) : bool - { + public function isEmulationNeeded(string $code): bool { return strpos($code, '#[') !== false; } - public function emulate(string $code, array $tokens): array - { + public function emulate(string $code, array $tokens): array { // We need to manually iterate and manage a count because we'll change // the tokens array on the way. - $line = 1; for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if ($tokens[$i] === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1] === '[') { + $token = $tokens[$i]; + if ($token->text === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1]->text === '[') { array_splice($tokens, $i, 2, [ - [\T_ATTRIBUTE, '#[', $line] + new Token(\T_ATTRIBUTE, '#[', $token->line, $token->pos), ]); $c--; continue; } - if (\is_array($tokens[$i])) { - $line += substr_count($tokens[$i][1], "\n"); - } } return $tokens; } - public function reverseEmulate(string $code, array $tokens): array - { + public function reverseEmulate(string $code, array $tokens): array { // TODO return $tokens; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php deleted file mode 100644 index d91da92143..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/CoaleseEqualTokenEmulator.php +++ /dev/null @@ -1,47 +0,0 @@ -id === \T_WHITESPACE + && $tokens[$pos + 2]->id === \T_STRING; } -} \ No newline at end of file +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php index f5f6805b80..9cadf420c0 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php @@ -2,11 +2,12 @@ namespace PhpParser\Lexer\TokenEmulator; -use PhpParser\Lexer\Emulative; +use PhpParser\PhpVersion; +use PhpParser\Token; class ExplicitOctalEmulator extends TokenEmulator { - public function getPhpVersion(): string { - return Emulative::PHP_8_1; + public function getPhpVersion(): PhpVersion { + return PhpVersion::fromComponents(8, 1); } public function isEmulationNeeded(string $code): bool { @@ -15,13 +16,14 @@ public function isEmulationNeeded(string $code): bool { public function emulate(string $code, array $tokens): array { for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if ($tokens[$i][0] == \T_LNUMBER && $tokens[$i][1] === '0' && - isset($tokens[$i + 1]) && $tokens[$i + 1][0] == \T_STRING && - preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1][1]) + $token = $tokens[$i]; + if ($token->id == \T_LNUMBER && $token->text === '0' && + isset($tokens[$i + 1]) && $tokens[$i + 1]->id == \T_STRING && + preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1]->text) ) { - $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1][1]); + $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1]->text); array_splice($tokens, $i, 2, [ - [$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]], + new Token($tokenKind, '0' . $tokens[$i + 1]->text, $token->line, $token->pos), ]); $c--; } @@ -29,8 +31,7 @@ public function emulate(string $code, array $tokens): array { return $tokens; } - private function resolveIntegerOrFloatToken(string $str): int - { + private function resolveIntegerOrFloatToken(string $str): int { $str = substr($str, 1); $str = str_replace('_', '', $str); $num = octdec($str); @@ -41,4 +42,4 @@ public function reverseEmulate(string $code, array $tokens): array { // Explicit octals were not legal code previously, don't bother. return $tokens; } -} \ No newline at end of file +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php deleted file mode 100644 index c15d6271fc..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FlexibleDocStringEmulator.php +++ /dev/null @@ -1,76 +0,0 @@ -\h*)\2(?![a-zA-Z0-9_\x80-\xff])(?(?:;?[\r\n])?)/x -REGEX; - - public function getPhpVersion(): string - { - return Emulative::PHP_7_3; - } - - public function isEmulationNeeded(string $code) : bool - { - return strpos($code, '<<<') !== false; - } - - public function emulate(string $code, array $tokens): array - { - // Handled by preprocessing + fixup. - return $tokens; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // Not supported. - return $tokens; - } - - public function preprocessCode(string $code, array &$patches): string { - if (!preg_match_all(self::FLEXIBLE_DOC_STRING_REGEX, $code, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE)) { - // No heredoc/nowdoc found - return $code; - } - - // Keep track of how much we need to adjust string offsets due to the modifications we - // already made - $posDelta = 0; - foreach ($matches as $match) { - $indentation = $match['indentation'][0]; - $indentationStart = $match['indentation'][1]; - - $separator = $match['separator'][0]; - $separatorStart = $match['separator'][1]; - - if ($indentation === '' && $separator !== '') { - // Ordinary heredoc/nowdoc - continue; - } - - if ($indentation !== '') { - // Remove indentation - $indentationLen = strlen($indentation); - $code = substr_replace($code, '', $indentationStart + $posDelta, $indentationLen); - $patches[] = [$indentationStart + $posDelta, 'add', $indentation]; - $posDelta -= $indentationLen; - } - - if ($separator === '') { - // Insert newline as separator - $code = substr_replace($code, "\n", $separatorStart + $posDelta, 0); - $patches[] = [$separatorStart + $posDelta, 'remove', "\n"]; - $posDelta += 1; - } - } - - return $code; - } -} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php deleted file mode 100644 index eb7e49634a..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php +++ /dev/null @@ -1,23 +0,0 @@ -getKeywordString()) !== false; } - protected function isKeywordContext(array $tokens, int $pos): bool - { - $previousNonSpaceToken = $this->getPreviousNonSpaceToken($tokens, $pos); - return $previousNonSpaceToken === null || $previousNonSpaceToken[0] !== \T_OBJECT_OPERATOR; + /** @param Token[] $tokens */ + protected function isKeywordContext(array $tokens, int $pos): bool { + $prevToken = $this->getPreviousNonSpaceToken($tokens, $pos); + if ($prevToken === null) { + return false; + } + return $prevToken->id !== \T_OBJECT_OPERATOR + && $prevToken->id !== \T_NULLSAFE_OBJECT_OPERATOR; } - public function emulate(string $code, array $tokens): array - { + public function emulate(string $code, array $tokens): array { $keywordString = $this->getKeywordString(); foreach ($tokens as $i => $token) { - if ($token[0] === T_STRING && strtolower($token[1]) === $keywordString + if ($token->id === T_STRING && strtolower($token->text) === $keywordString && $this->isKeywordContext($tokens, $i)) { - $tokens[$i][0] = $this->getKeywordToken(); + $token->id = $this->getKeywordToken(); } } return $tokens; } - /** - * @param mixed[] $tokens - * @return array|string|null - */ - private function getPreviousNonSpaceToken(array $tokens, int $start) - { + /** @param Token[] $tokens */ + private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token { for ($i = $start - 1; $i >= 0; --$i) { - if ($tokens[$i][0] === T_WHITESPACE) { + if ($tokens[$i]->id === T_WHITESPACE) { continue; } @@ -48,12 +47,11 @@ private function getPreviousNonSpaceToken(array $tokens, int $start) return null; } - public function reverseEmulate(string $code, array $tokens): array - { + public function reverseEmulate(string $code, array $tokens): array { $keywordToken = $this->getKeywordToken(); - foreach ($tokens as $i => $token) { - if ($token[0] === $keywordToken) { - $tokens[$i][0] = \T_STRING; + foreach ($tokens as $token) { + if ($token->id === $keywordToken) { + $token->id = \T_STRING; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php index 902a46dfcb..0fa5fbc2f2 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php @@ -2,22 +2,18 @@ namespace PhpParser\Lexer\TokenEmulator; -use PhpParser\Lexer\Emulative; +use PhpParser\PhpVersion; -final class MatchTokenEmulator extends KeywordEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_0; +final class MatchTokenEmulator extends KeywordEmulator { + public function getPhpVersion(): PhpVersion { + return PhpVersion::fromComponents(8, 0); } - public function getKeywordString(): string - { + public function getKeywordString(): string { return 'match'; } - public function getKeywordToken(): int - { + public function getKeywordToken(): int { return \T_MATCH; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php index 1a29c676e4..cede96f0f7 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php @@ -2,65 +2,58 @@ namespace PhpParser\Lexer\TokenEmulator; -use PhpParser\Lexer\Emulative; +use PhpParser\PhpVersion; +use PhpParser\Token; -final class NullsafeTokenEmulator extends TokenEmulator -{ - public function getPhpVersion(): string - { - return Emulative::PHP_8_0; +final class NullsafeTokenEmulator extends TokenEmulator { + public function getPhpVersion(): PhpVersion { + return PhpVersion::fromComponents(8, 0); } - public function isEmulationNeeded(string $code): bool - { + public function isEmulationNeeded(string $code): bool { return strpos($code, '?->') !== false; } - public function emulate(string $code, array $tokens): array - { + public function emulate(string $code, array $tokens): array { // We need to manually iterate and manage a count because we'll change // the tokens array on the way - $line = 1; for ($i = 0, $c = count($tokens); $i < $c; ++$i) { - if ($tokens[$i] === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1][0] === \T_OBJECT_OPERATOR) { + $token = $tokens[$i]; + if ($token->text === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1]->id === \T_OBJECT_OPERATOR) { array_splice($tokens, $i, 2, [ - [\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line] + new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos), ]); $c--; continue; } // Handle ?-> inside encapsed string. - if ($tokens[$i][0] === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) - && $tokens[$i - 1][0] === \T_VARIABLE - && preg_match('/^\?->([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)/', $tokens[$i][1], $matches) + if ($token->id === \T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1]) + && $tokens[$i - 1]->id === \T_VARIABLE + && preg_match('/^\?->([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*)/', $token->text, $matches) ) { $replacement = [ - [\T_NULLSAFE_OBJECT_OPERATOR, '?->', $line], - [\T_STRING, $matches[1], $line], + new Token(\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos), + new Token(\T_STRING, $matches[1], $token->line, $token->pos + 3), ]; - if (\strlen($matches[0]) !== \strlen($tokens[$i][1])) { - $replacement[] = [ + $matchLen = \strlen($matches[0]); + if ($matchLen !== \strlen($token->text)) { + $replacement[] = new Token( \T_ENCAPSED_AND_WHITESPACE, - \substr($tokens[$i][1], \strlen($matches[0])), - $line - ]; + \substr($token->text, $matchLen), + $token->line, $token->pos + $matchLen + ); } array_splice($tokens, $i, 1, $replacement); $c += \count($replacement) - 1; continue; } - - if (\is_array($tokens[$i])) { - $line += substr_count($tokens[$i][1], "\n"); - } } return $tokens; } - public function reverseEmulate(string $code, array $tokens): array - { + public function reverseEmulate(string $code, array $tokens): array { // ?-> was not valid code previously, don't bother. return $tokens; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php deleted file mode 100644 index cdf793e46e..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/NumericLiteralSeparatorEmulator.php +++ /dev/null @@ -1,105 +0,0 @@ -resolveIntegerOrFloatToken($match); - $newTokens = [[$tokenKind, $match, $token[2]]]; - - $numTokens = 1; - $len = $tokenLen; - while ($matchLen > $len) { - $nextToken = $tokens[$i + $numTokens]; - $nextTokenText = \is_array($nextToken) ? $nextToken[1] : $nextToken; - $nextTokenLen = \strlen($nextTokenText); - - $numTokens++; - if ($matchLen < $len + $nextTokenLen) { - // Split trailing characters into a partial token. - assert(is_array($nextToken), "Partial token should be an array token"); - $partialText = substr($nextTokenText, $matchLen - $len); - $newTokens[] = [$nextToken[0], $partialText, $nextToken[2]]; - break; - } - - $len += $nextTokenLen; - } - - array_splice($tokens, $i, $numTokens, $newTokens); - $c -= $numTokens - \count($newTokens); - $codeOffset += $matchLen; - } - - return $tokens; - } - - private function resolveIntegerOrFloatToken(string $str): int - { - $str = str_replace('_', '', $str); - - if (stripos($str, '0b') === 0) { - $num = bindec($str); - } elseif (stripos($str, '0x') === 0) { - $num = hexdec($str); - } elseif (stripos($str, '0') === 0 && ctype_digit($str)) { - $num = octdec($str); - } else { - $num = +$str; - } - - return is_float($num) ? T_DNUMBER : T_LNUMBER; - } - - public function reverseEmulate(string $code, array $tokens): array - { - // Numeric separators were not legal code previously, don't bother. - return $tokens; - } -} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php new file mode 100644 index 0000000000..71b7fc232d --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php @@ -0,0 +1,19 @@ +text === '(' || + ($tokens[$pos + 1]->id === \T_WHITESPACE && isset($tokens[$pos + 2]) && - $tokens[$pos + 2][0] === '('))); + $tokens[$pos + 2]->text === '('))); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php index 90093f66b2..851b5c4acf 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php @@ -2,19 +2,20 @@ namespace PhpParser\Lexer\TokenEmulator; +use PhpParser\PhpVersion; + /** * Reverses emulation direction of the inner emulator. */ -final class ReverseEmulator extends TokenEmulator -{ +final class ReverseEmulator extends TokenEmulator { /** @var TokenEmulator Inner emulator */ - private $emulator; + private TokenEmulator $emulator; public function __construct(TokenEmulator $emulator) { $this->emulator = $emulator; } - public function getPhpVersion(): string { + public function getPhpVersion(): PhpVersion { return $this->emulator->getPhpVersion(); } @@ -33,4 +34,4 @@ public function reverseEmulate(string $code, array $tokens): array { public function preprocessCode(string $code, array &$patches): string { return $code; } -} \ No newline at end of file +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php index a020bc0ff4..fec2f19f44 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php @@ -2,23 +2,28 @@ namespace PhpParser\Lexer\TokenEmulator; +use PhpParser\PhpVersion; +use PhpParser\Token; + /** @internal */ -abstract class TokenEmulator -{ - abstract public function getPhpVersion(): string; +abstract class TokenEmulator { + abstract public function getPhpVersion(): PhpVersion; abstract public function isEmulationNeeded(string $code): bool; /** - * @return array Modified Tokens + * @param Token[] $tokens Original tokens + * @return Token[] Modified Tokens */ abstract public function emulate(string $code, array $tokens): array; /** - * @return array Modified Tokens + * @param Token[] $tokens Original tokens + * @return Token[] Modified Tokens */ abstract public function reverseEmulate(string $code, array $tokens): array; + /** @param array{int, string, string}[] $patches */ public function preprocessCode(string $code, array &$patches): string { return $code; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php b/api/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php new file mode 100644 index 0000000000..0f0f22d6bb --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Modifiers.php @@ -0,0 +1,85 @@ + 'public', + self::PROTECTED => 'protected', + self::PRIVATE => 'private', + self::STATIC => 'static', + self::ABSTRACT => 'abstract', + self::FINAL => 'final', + self::READONLY => 'readonly', + self::PUBLIC_SET => 'public(set)', + self::PROTECTED_SET => 'protected(set)', + self::PRIVATE_SET => 'private(set)', + ]; + + public static function toString(int $modifier): string { + if (!isset(self::TO_STRING_MAP[$modifier])) { + throw new \InvalidArgumentException("Unknown modifier $modifier"); + } + return self::TO_STRING_MAP[$modifier]; + } + + private static function isValidModifier(int $modifier): bool { + $isPow2 = ($modifier & ($modifier - 1)) == 0 && $modifier != 0; + return $isPow2 && $modifier <= self::PRIVATE_SET; + } + + /** + * @internal + */ + public static function verifyClassModifier(int $a, int $b): void { + assert(self::isValidModifier($b)); + if (($a & $b) != 0) { + throw new Error( + 'Multiple ' . self::toString($b) . ' modifiers are not allowed'); + } + + if ($a & 48 && $b & 48) { + throw new Error('Cannot use the final modifier on an abstract class'); + } + } + + /** + * @internal + */ + public static function verifyModifier(int $a, int $b): void { + assert(self::isValidModifier($b)); + if (($a & Modifiers::VISIBILITY_MASK && $b & Modifiers::VISIBILITY_MASK) || + ($a & Modifiers::VISIBILITY_SET_MASK && $b & Modifiers::VISIBILITY_SET_MASK) + ) { + throw new Error('Multiple access type modifiers are not allowed'); + } + + if (($a & $b) != 0) { + throw new Error( + 'Multiple ' . self::toString($b) . ' modifiers are not allowed'); + } + + if ($a & 48 && $b & 48) { + throw new Error('Cannot use the final modifier on an abstract class member'); + } + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NameContext.php b/api/vendor/nikic/php-parser/lib/PhpParser/NameContext.php index 777a4afdee..2265ecce82 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NameContext.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NameContext.php @@ -6,19 +6,18 @@ use PhpParser\Node\Name\FullyQualified; use PhpParser\Node\Stmt; -class NameContext -{ +class NameContext { /** @var null|Name Current namespace */ - protected $namespace; + protected ?Name $namespace; /** @var Name[][] Map of format [aliasType => [aliasName => originalName]] */ - protected $aliases = []; + protected array $aliases = []; /** @var Name[][] Same as $aliases but preserving original case */ - protected $origAliases = []; + protected array $origAliases = []; /** @var ErrorHandler Error handler */ - protected $errorHandler; + protected ErrorHandler $errorHandler; /** * Create a name context. @@ -36,7 +35,7 @@ public function __construct(ErrorHandler $errorHandler) { * * @param Name|null $namespace Null is the global namespace */ - public function startNamespace(Name $namespace = null) { + public function startNamespace(?Name $namespace = null): void { $this->namespace = $namespace; $this->origAliases = $this->aliases = [ Stmt\Use_::TYPE_NORMAL => [], @@ -48,12 +47,12 @@ public function startNamespace(Name $namespace = null) { /** * Add an alias / import. * - * @param Name $name Original name - * @param string $aliasName Aliased name - * @param int $type One of Stmt\Use_::TYPE_* - * @param array $errorAttrs Attributes to use to report an error + * @param Name $name Original name + * @param string $aliasName Aliased name + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* + * @param array $errorAttrs Attributes to use to report an error */ - public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []) { + public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []): void { // Constant names are case sensitive, everything else case insensitive if ($type === Stmt\Use_::TYPE_CONSTANT) { $aliasLookupName = $aliasName; @@ -87,7 +86,7 @@ public function addAlias(Name $name, string $aliasName, int $type, array $errorA * * @return null|Name Namespace (or null if global namespace) */ - public function getNamespace() { + public function getNamespace(): ?Name { return $this->namespace; } @@ -95,11 +94,11 @@ public function getNamespace() { * Get resolved name. * * @param Name $name Name to resolve - * @param int $type One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT} + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_{FUNCTION|CONSTANT} * * @return null|Name Resolved name, or null if static resolution is not possible */ - public function getResolvedName(Name $name, int $type) { + public function getResolvedName(Name $name, int $type): ?Name { // don't resolve special class names if ($type === Stmt\Use_::TYPE_NORMAL && $name->isSpecialClassName()) { if (!$name->isUnqualified()) { @@ -142,7 +141,7 @@ public function getResolvedName(Name $name, int $type) { * * @return Name Resolved name */ - public function getResolvedClassName(Name $name) : Name { + public function getResolvedClassName(Name $name): Name { return $this->getResolvedName($name, Stmt\Use_::TYPE_NORMAL); } @@ -150,11 +149,11 @@ public function getResolvedClassName(Name $name) : Name { * Get possible ways of writing a fully qualified name (e.g., by making use of aliases). * * @param string $name Fully-qualified name (without leading namespace separator) - * @param int $type One of Stmt\Use_::TYPE_* + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* * * @return Name[] Possible representations of the name */ - public function getPossibleNames(string $name, int $type) : array { + public function getPossibleNames(string $name, int $type): array { $lcName = strtolower($name); if ($type === Stmt\Use_::TYPE_NORMAL) { @@ -186,7 +185,7 @@ public function getPossibleNames(string $name, int $type) : array { // Check for relevant type-specific use statements foreach ($this->origAliases[$type] as $alias => $orig) { if ($type === Stmt\Use_::TYPE_CONSTANT) { - // Constants are are complicated-sensitive + // Constants are complicated-sensitive $normalizedOrig = $this->normalizeConstName($orig->toString()); if ($normalizedOrig === $this->normalizeConstName($name)) { $possibleNames[] = new Name($alias); @@ -206,11 +205,11 @@ public function getPossibleNames(string $name, int $type) : array { * Get shortest representation of this fully-qualified name. * * @param string $name Fully-qualified name (without leading namespace separator) - * @param int $type One of Stmt\Use_::TYPE_* + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* * * @return Name Shortest representation */ - public function getShortName(string $name, int $type) : Name { + public function getShortName(string $name, int $type): Name { $possibleNames = $this->getPossibleNames($name, $type); // Find shortest name @@ -224,10 +223,10 @@ public function getShortName(string $name, int $type) : Name { } } - return $shortestName; + return $shortestName; } - private function resolveAlias(Name $name, $type) { + private function resolveAlias(Name $name, int $type): ?FullyQualified { $firstPart = $name->getFirst(); if ($name->isQualified()) { @@ -250,7 +249,7 @@ private function resolveAlias(Name $name, $type) { return null; } - private function getNamespaceRelativeName(string $name, string $lcName, int $type) { + private function getNamespaceRelativeName(string $name, string $lcName, int $type): ?Name { if (null === $this->namespace) { return new Name($name); } @@ -271,7 +270,7 @@ private function getNamespaceRelativeName(string $name, string $lcName, int $typ return null; } - private function normalizeConstName(string $name) { + private function normalizeConstName(string $name): string { $nsSep = strrpos($name, '\\'); if (false === $nsSep) { return $name; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node.php index befb256504..fd2a9b7247 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node.php @@ -2,28 +2,31 @@ namespace PhpParser; -interface Node -{ +interface Node { /** * Gets the type of the node. * + * @psalm-return non-empty-string * @return string Type of the node */ - public function getType() : string; + public function getType(): string; /** * Gets the names of the sub nodes. * - * @return array Names of sub nodes + * @return string[] Names of sub nodes */ - public function getSubNodeNames() : array; + public function getSubNodeNames(): array; /** * Gets line the node started in (alias of getStartLine). * * @return int Start line (or -1 if not available) + * @phpstan-return -1|positive-int + * + * @deprecated Use getStartLine() instead */ - public function getLine() : int; + public function getLine(): int; /** * Gets line the node started in. @@ -31,8 +34,9 @@ public function getLine() : int; * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default). * * @return int Start line (or -1 if not available) + * @phpstan-return -1|positive-int */ - public function getStartLine() : int; + public function getStartLine(): int; /** * Gets the line the node ended in. @@ -40,8 +44,9 @@ public function getStartLine() : int; * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default). * * @return int End line (or -1 if not available) + * @phpstan-return -1|positive-int */ - public function getEndLine() : int; + public function getEndLine(): int; /** * Gets the token offset of the first token that is part of this node. @@ -52,7 +57,7 @@ public function getEndLine() : int; * * @return int Token start position (or -1 if not available) */ - public function getStartTokenPos() : int; + public function getStartTokenPos(): int; /** * Gets the token offset of the last token that is part of this node. @@ -63,7 +68,7 @@ public function getStartTokenPos() : int; * * @return int Token end position (or -1 if not available) */ - public function getEndTokenPos() : int; + public function getEndTokenPos(): int; /** * Gets the file offset of the first character that is part of this node. @@ -72,7 +77,7 @@ public function getEndTokenPos() : int; * * @return int File start position (or -1 if not available) */ - public function getStartFilePos() : int; + public function getStartFilePos(): int; /** * Gets the file offset of the last character that is part of this node. @@ -81,7 +86,7 @@ public function getStartFilePos() : int; * * @return int File end position (or -1 if not available) */ - public function getEndFilePos() : int; + public function getEndFilePos(): int; /** * Gets all comments directly preceding this node. @@ -90,14 +95,14 @@ public function getEndFilePos() : int; * * @return Comment[] */ - public function getComments() : array; + public function getComments(): array; /** * Gets the doc comment of the node. * * @return null|Comment\Doc Doc comment object or null */ - public function getDocComment(); + public function getDocComment(): ?Comment\Doc; /** * Sets the doc comment of the node. @@ -106,30 +111,24 @@ public function getDocComment(); * * @param Comment\Doc $docComment Doc comment to set */ - public function setDocComment(Comment\Doc $docComment); + public function setDocComment(Comment\Doc $docComment): void; /** * Sets an attribute on a node. * - * @param string $key - * @param mixed $value + * @param mixed $value */ - public function setAttribute(string $key, $value); + public function setAttribute(string $key, $value): void; /** * Returns whether an attribute exists. - * - * @param string $key - * - * @return bool */ - public function hasAttribute(string $key) : bool; + public function hasAttribute(string $key): bool; /** * Returns the value of an attribute. * - * @param string $key - * @param mixed $default + * @param mixed $default * * @return mixed */ @@ -138,14 +137,14 @@ public function getAttribute(string $key, $default = null); /** * Returns all the attributes of this node. * - * @return array + * @return array */ - public function getAttributes() : array; + public function getAttributes(): array; /** * Replaces all the attributes of this node. * - * @param array $attributes + * @param array $attributes */ - public function setAttributes(array $attributes); + public function setAttributes(array $attributes): void; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php index bcf130e68c..6680efac98 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Arg.php @@ -2,32 +2,30 @@ namespace PhpParser\Node; -use PhpParser\Node\VariadicPlaceholder; use PhpParser\NodeAbstract; -class Arg extends NodeAbstract -{ +class Arg extends NodeAbstract { /** @var Identifier|null Parameter name (for named parameters) */ - public $name; + public ?Identifier $name; /** @var Expr Value to pass */ - public $value; + public Expr $value; /** @var bool Whether to pass by ref */ - public $byRef; + public bool $byRef; /** @var bool Whether to unpack the argument */ - public $unpack; + public bool $unpack; /** * Constructs a function call argument node. * - * @param Expr $value Value to pass - * @param bool $byRef Whether to pass by ref - * @param bool $unpack Whether to unpack the argument - * @param array $attributes Additional attributes + * @param Expr $value Value to pass + * @param bool $byRef Whether to pass by ref + * @param bool $unpack Whether to unpack the argument + * @param array $attributes Additional attributes * @param Identifier|null $name Parameter name (for named parameters) */ public function __construct( Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [], - Identifier $name = null + ?Identifier $name = null ) { $this->attributes = $attributes; $this->name = $name; @@ -36,11 +34,11 @@ public function __construct( $this->unpack = $unpack; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name', 'value', 'byRef', 'unpack']; } - - public function getType() : string { + + public function getType(): string { return 'Arg'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php new file mode 100644 index 0000000000..fa1cff5276 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/ArrayItem.php @@ -0,0 +1,43 @@ + $attributes Additional attributes + */ + public function __construct(Expr $value, ?Expr $key = null, bool $byRef = false, array $attributes = [], bool $unpack = false) { + $this->attributes = $attributes; + $this->key = $key; + $this->value = $value; + $this->byRef = $byRef; + $this->unpack = $unpack; + } + + public function getSubNodeNames(): array { + return ['key', 'value', 'byRef', 'unpack']; + } + + public function getType(): string { + return 'ArrayItem'; + } +} + +// @deprecated compatibility alias +class_alias(ArrayItem::class, Expr\ArrayItem::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php index c96f66e514..9d892436af 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Attribute.php @@ -5,18 +5,17 @@ use PhpParser\Node; use PhpParser\NodeAbstract; -class Attribute extends NodeAbstract -{ +class Attribute extends NodeAbstract { /** @var Name Attribute name */ - public $name; + public Name $name; - /** @var Arg[] Attribute arguments */ - public $args; + /** @var list Attribute arguments */ + public array $args; /** - * @param Node\Name $name Attribute name - * @param Arg[] $args Attribute arguments - * @param array $attributes Additional node attributes + * @param Node\Name $name Attribute name + * @param list $args Attribute arguments + * @param array $attributes Additional node attributes */ public function __construct(Name $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Name $name, array $args = [], array $attributes = [] $this->args = $args; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name', 'args']; } - public function getType() : string { + public function getType(): string { return 'Attribute'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php index 613bfc4134..b9eb588d01 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/AttributeGroup.php @@ -2,28 +2,26 @@ namespace PhpParser\Node; -use PhpParser\Node; use PhpParser\NodeAbstract; -class AttributeGroup extends NodeAbstract -{ +class AttributeGroup extends NodeAbstract { /** @var Attribute[] Attributes */ - public $attrs; + public array $attrs; /** * @param Attribute[] $attrs PHP attributes - * @param array $attributes Additional node attributes + * @param array $attributes Additional node attributes */ public function __construct(array $attrs, array $attributes = []) { $this->attributes = $attributes; $this->attrs = $attrs; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrs']; } - public function getType() : string { + public function getType(): string { return 'AttributeGroup'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php new file mode 100644 index 0000000000..e313280b6c --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/ClosureUse.php @@ -0,0 +1,36 @@ + $attributes Additional attributes + */ + public function __construct(Expr\Variable $var, bool $byRef = false, array $attributes = []) { + $this->attributes = $attributes; + $this->var = $var; + $this->byRef = $byRef; + } + + public function getSubNodeNames(): array { + return ['var', 'byRef']; + } + + public function getType(): string { + return 'ClosureUse'; + } +} + +// @deprecated compatibility alias +class_alias(ClosureUse::class, Expr\ClosureUse::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php index 9505532ae9..05a5e5eef4 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/ComplexType.php @@ -9,6 +9,5 @@ * * It does not provide any shared behavior and exists only for type-checking purposes. */ -abstract class ComplexType extends NodeAbstract -{ +abstract class ComplexType extends NodeAbstract { } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php index 07a74df80e..8b26ae86a4 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Const_.php @@ -4,22 +4,21 @@ use PhpParser\NodeAbstract; -class Const_ extends NodeAbstract -{ +class Const_ extends NodeAbstract { /** @var Identifier Name */ - public $name; + public Identifier $name; /** @var Expr Value */ - public $value; + public Expr $value; /** @var Name|null Namespaced name (if using NameResolver) */ - public $namespacedName; + public ?Name $namespacedName; /** * Constructs a const node for use in class const and const statements. * - * @param string|Identifier $name Name - * @param Expr $value Value - * @param array $attributes Additional attributes + * @param string|Identifier $name Name + * @param Expr $value Value + * @param array $attributes Additional attributes */ public function __construct($name, Expr $value, array $attributes = []) { $this->attributes = $attributes; @@ -27,11 +26,11 @@ public function __construct($name, Expr $value, array $attributes = []) { $this->value = $value; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name', 'value']; } - public function getType() : string { + public function getType(): string { return 'Const'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php new file mode 100644 index 0000000000..55c1fe4f19 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/DeclareItem.php @@ -0,0 +1,37 @@ +value pair node. + * + * @param string|Node\Identifier $key Key + * @param Node\Expr $value Value + * @param array $attributes Additional attributes + */ + public function __construct($key, Node\Expr $value, array $attributes = []) { + $this->attributes = $attributes; + $this->key = \is_string($key) ? new Node\Identifier($key) : $key; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['key', 'value']; + } + + public function getType(): string { + return 'DeclareItem'; + } +} + +// @deprecated compatibility alias +class_alias(DeclareItem::class, Stmt\DeclareDeclare::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php index 6cf4df2233..8b7dbb6ca8 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr.php @@ -4,6 +4,5 @@ use PhpParser\NodeAbstract; -abstract class Expr extends NodeAbstract -{ +abstract class Expr extends NodeAbstract { } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php index 71694478e9..24427bbc35 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayDimFetch.php @@ -4,31 +4,30 @@ use PhpParser\Node\Expr; -class ArrayDimFetch extends Expr -{ +class ArrayDimFetch extends Expr { /** @var Expr Variable */ - public $var; + public Expr $var; /** @var null|Expr Array index / dim */ - public $dim; + public ?Expr $dim; /** * Constructs an array index fetch node. * - * @param Expr $var Variable - * @param null|Expr $dim Array index / dim - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param null|Expr $dim Array index / dim + * @param array $attributes Additional attributes */ - public function __construct(Expr $var, Expr $dim = null, array $attributes = []) { + public function __construct(Expr $var, ?Expr $dim = null, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; $this->dim = $dim; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'dim']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_ArrayDimFetch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php index 1b078f8218..490ac93793 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php @@ -1,41 +1,3 @@ attributes = $attributes; - $this->key = $key; - $this->value = $value; - $this->byRef = $byRef; - $this->unpack = $unpack; - } - - public function getSubNodeNames() : array { - return ['key', 'value', 'byRef', 'unpack']; - } - - public function getType() : string { - return 'Expr_ArrayItem'; - } -} +require __DIR__ . '/../ArrayItem.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php index e6eaa2834d..3c8c9c2fcf 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Array_.php @@ -2,33 +2,33 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node\ArrayItem; use PhpParser\Node\Expr; -class Array_ extends Expr -{ +class Array_ extends Expr { // For use in "kind" attribute - const KIND_LONG = 1; // array() syntax - const KIND_SHORT = 2; // [] syntax + public const KIND_LONG = 1; // array() syntax + public const KIND_SHORT = 2; // [] syntax - /** @var (ArrayItem|null)[] Items */ - public $items; + /** @var ArrayItem[] Items */ + public array $items; /** * Constructs an array node. * - * @param (ArrayItem|null)[] $items Items of the array - * @param array $attributes Additional attributes + * @param ArrayItem[] $items Items of the array + * @param array $attributes Additional attributes */ public function __construct(array $items = [], array $attributes = []) { $this->attributes = $attributes; $this->items = $items; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['items']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Array'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php index c273fb7ee8..0e98ce9f6b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrowFunction.php @@ -6,55 +6,60 @@ use PhpParser\Node\Expr; use PhpParser\Node\FunctionLike; -class ArrowFunction extends Expr implements FunctionLike -{ - /** @var bool */ - public $static; +class ArrowFunction extends Expr implements FunctionLike { + /** @var bool Whether the closure is static */ + public bool $static; - /** @var bool */ - public $byRef; + /** @var bool Whether to return by reference */ + public bool $byRef; /** @var Node\Param[] */ - public $params = []; + public array $params = []; /** @var null|Node\Identifier|Node\Name|Node\ComplexType */ - public $returnType; + public ?Node $returnType; - /** @var Expr */ - public $expr; + /** @var Expr Expression body */ + public Expr $expr; /** @var Node\AttributeGroup[] */ - public $attrGroups; + public array $attrGroups; /** - * @param array $subNodes Array of the following optional subnodes: - * 'static' => false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'expr' => Expr : Expression body - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes + * @param array{ + * expr: Expr, + * static?: bool, + * byRef?: bool, + * params?: Node\Param[], + * returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, + * attrGroups?: Node\AttributeGroup[] + * } $subNodes Array of the following subnodes: + * 'expr' : Expression body + * 'static' => false : Whether the closure is static + * 'byRef' => false : Whether to return by reference + * 'params' => array() : Parameters + * 'returnType' => null : Return type + * 'attrGroups' => array() : PHP attribute groups + * @param array $attributes Additional attributes */ - public function __construct(array $subNodes = [], array $attributes = []) { + public function __construct(array $subNodes, array $attributes = []) { $this->attributes = $attributes; $this->static = $subNodes['static'] ?? false; $this->byRef = $subNodes['byRef'] ?? false; $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; + $this->returnType = $subNodes['returnType'] ?? null; $this->expr = $subNodes['expr']; $this->attrGroups = $subNodes['attrGroups'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr']; } - public function returnsByRef() : bool { + public function returnsByRef(): bool { return $this->byRef; } - public function getParams() : array { + public function getParams(): array { return $this->params; } @@ -62,18 +67,18 @@ public function getReturnType() { return $this->returnType; } - public function getAttrGroups() : array { + public function getAttrGroups(): array { return $this->attrGroups; } /** * @return Node\Stmt\Return_[] */ - public function getStmts() : array { + public function getStmts(): array { return [new Node\Stmt\Return_($this->expr)]; } - public function getType() : string { + public function getType(): string { return 'Expr_ArrowFunction'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php index cf9e6e82b4..dcbf84dd41 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Assign.php @@ -4,19 +4,18 @@ use PhpParser\Node\Expr; -class Assign extends Expr -{ +class Assign extends Expr { /** @var Expr Variable */ - public $var; + public Expr $var; /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs an assignment node. * - * @param Expr $var Variable - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Assign'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php index bce8604f14..5209a64b1f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp.php @@ -4,19 +4,18 @@ use PhpParser\Node\Expr; -abstract class AssignOp extends Expr -{ +abstract class AssignOp extends Expr { /** @var Expr Variable */ - public $var; + public Expr $var; /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs a compound assignment operation node. * - * @param Expr $var Variable - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->attributes = $attributes; @@ -24,7 +23,7 @@ public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'expr']; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php index 420284cdc1..4f3623fb6d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class BitwiseAnd extends AssignOp -{ - public function getType() : string { +class BitwiseAnd extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_BitwiseAnd'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php index 481ad3bbce..23efe10716 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class BitwiseOr extends AssignOp -{ - public function getType() : string { +class BitwiseOr extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_BitwiseOr'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php index f41d4c8e73..24be7303f6 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class BitwiseXor extends AssignOp -{ - public function getType() : string { +class BitwiseXor extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_BitwiseXor'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php index c0e9b316cf..b78ea901ab 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Coalesce.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Coalesce extends AssignOp -{ - public function getType() : string { +class Coalesce extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Coalesce'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php index ac16820785..f419e2ea06 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Concat.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Concat extends AssignOp -{ - public function getType() : string { +class Concat extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Concat'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php index f1fcfc09ad..98b0472745 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Div.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Div extends AssignOp -{ - public function getType() : string { +class Div extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Div'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php index 82ef4517b7..2076599304 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Minus.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Minus extends AssignOp -{ - public function getType() : string { +class Minus extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Minus'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php index be3b4a0adb..526430e2ff 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mod.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Mod extends AssignOp -{ - public function getType() : string { +class Mod extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Mod'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php index 5c196c3bcb..81241ac9af 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Mul.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Mul extends AssignOp -{ - public function getType() : string { +class Mul extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Mul'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php index dd101c61cb..0bca8cc17f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Plus.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Plus extends AssignOp -{ - public function getType() : string { +class Plus extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Plus'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php index 5e1307d1da..4e3279c428 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/Pow.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class Pow extends AssignOp -{ - public function getType() : string { +class Pow extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_Pow'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php index b8f88269b6..7a5dd60c66 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class ShiftLeft extends AssignOp -{ - public function getType() : string { +class ShiftLeft extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_ShiftLeft'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php index e0cc67b7ff..4f270864dd 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\AssignOp; -class ShiftRight extends AssignOp -{ - public function getType() : string { +class ShiftRight extends AssignOp { + public function getType(): string { return 'Expr_AssignOp_ShiftRight'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php index de3c644c3c..9714650a54 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/AssignRef.php @@ -4,19 +4,18 @@ use PhpParser\Node\Expr; -class AssignRef extends Expr -{ +class AssignRef extends Expr { /** @var Expr Variable reference is assigned to */ - public $var; + public Expr $var; /** @var Expr Variable which is referenced */ - public $expr; + public Expr $expr; /** * Constructs an assignment node. * - * @param Expr $var Variable - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Expr $var, Expr $expr, array $attributes = []) { $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_AssignRef'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php index d9c582b0d2..1b92bd4f50 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp.php @@ -4,19 +4,18 @@ use PhpParser\Node\Expr; -abstract class BinaryOp extends Expr -{ +abstract class BinaryOp extends Expr { /** @var Expr The left hand side expression */ - public $left; + public Expr $left; /** @var Expr The right hand side expression */ - public $right; + public Expr $right; /** * Constructs a binary operator node. * - * @param Expr $left The left hand side expression - * @param Expr $right The right hand side expression - * @param array $attributes Additional attributes + * @param Expr $left The left hand side expression + * @param Expr $right The right hand side expression + * @param array $attributes Additional attributes */ public function __construct(Expr $left, Expr $right, array $attributes = []) { $this->attributes = $attributes; @@ -24,7 +23,7 @@ public function __construct(Expr $left, Expr $right, array $attributes = []) { $this->right = $right; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['left', 'right']; } @@ -33,8 +32,6 @@ public function getSubNodeNames() : array { * * In the case there are multiple possible sigils for an operator, this method does not * necessarily return the one used in the parsed code. - * - * @return string */ - abstract public function getOperatorSigil() : string; + abstract public function getOperatorSigil(): string; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php index d907393bfa..5930c5413c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class BitwiseAnd extends BinaryOp -{ - public function getOperatorSigil() : string { +class BitwiseAnd extends BinaryOp { + public function getOperatorSigil(): string { return '&'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_BitwiseAnd'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php index d92069f321..adcefd0e2c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class BitwiseOr extends BinaryOp -{ - public function getOperatorSigil() : string { +class BitwiseOr extends BinaryOp { + public function getOperatorSigil(): string { return '|'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_BitwiseOr'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php index 40fa94f887..92bca60946 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class BitwiseXor extends BinaryOp -{ - public function getOperatorSigil() : string { +class BitwiseXor extends BinaryOp { + public function getOperatorSigil(): string { return '^'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_BitwiseXor'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php index 4c3c9e9b1e..82a6b5a270 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class BooleanAnd extends BinaryOp -{ - public function getOperatorSigil() : string { +class BooleanAnd extends BinaryOp { + public function getOperatorSigil(): string { return '&&'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_BooleanAnd'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php index 5ad417279a..739edafafc 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class BooleanOr extends BinaryOp -{ - public function getOperatorSigil() : string { +class BooleanOr extends BinaryOp { + public function getOperatorSigil(): string { return '||'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_BooleanOr'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php index b8cf6f4599..ab75a23e48 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Coalesce extends BinaryOp -{ - public function getOperatorSigil() : string { +class Coalesce extends BinaryOp { + public function getOperatorSigil(): string { return '??'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Coalesce'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php index 9a8d9873c0..a730f57604 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Concat.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Concat extends BinaryOp -{ - public function getOperatorSigil() : string { +class Concat extends BinaryOp { + public function getOperatorSigil(): string { return '.'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Concat'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php index d38df0db4d..ba1f629d30 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Div.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Div extends BinaryOp -{ - public function getOperatorSigil() : string { +class Div extends BinaryOp { + public function getOperatorSigil(): string { return '/'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Div'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php index e7b11dc824..28bde8122d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Equal.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Equal extends BinaryOp -{ - public function getOperatorSigil() : string { +class Equal extends BinaryOp { + public function getOperatorSigil(): string { return '=='; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Equal'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php index da01f7a100..6215c50b82 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Greater.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Greater extends BinaryOp -{ - public function getOperatorSigil() : string { +class Greater extends BinaryOp { + public function getOperatorSigil(): string { return '>'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Greater'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php index d677502cf5..4d440b100c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class GreaterOrEqual extends BinaryOp -{ - public function getOperatorSigil() : string { +class GreaterOrEqual extends BinaryOp { + public function getOperatorSigil(): string { return '>='; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_GreaterOrEqual'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php index 3d96285c64..e25d17cd99 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Identical.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Identical extends BinaryOp -{ - public function getOperatorSigil() : string { +class Identical extends BinaryOp { + public function getOperatorSigil(): string { return '==='; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Identical'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php index 2a3afd548f..9b9ea1f6e4 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class LogicalAnd extends BinaryOp -{ - public function getOperatorSigil() : string { +class LogicalAnd extends BinaryOp { + public function getOperatorSigil(): string { return 'and'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_LogicalAnd'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php index 21507dba63..a6235ee76d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class LogicalOr extends BinaryOp -{ - public function getOperatorSigil() : string { +class LogicalOr extends BinaryOp { + public function getOperatorSigil(): string { return 'or'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_LogicalOr'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php index 261c6a9100..7ff2fdb0a1 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class LogicalXor extends BinaryOp -{ - public function getOperatorSigil() : string { +class LogicalXor extends BinaryOp { + public function getOperatorSigil(): string { return 'xor'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_LogicalXor'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php index 54b3c6e905..8924c55e1e 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Minus.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Minus extends BinaryOp -{ - public function getOperatorSigil() : string { +class Minus extends BinaryOp { + public function getOperatorSigil(): string { return '-'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Minus'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php index 1034040401..56619de1bd 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mod.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Mod extends BinaryOp -{ - public function getOperatorSigil() : string { +class Mod extends BinaryOp { + public function getOperatorSigil(): string { return '%'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Mod'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php index b82d0b2fcb..98745fbe2f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Mul.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Mul extends BinaryOp -{ - public function getOperatorSigil() : string { +class Mul extends BinaryOp { + public function getOperatorSigil(): string { return '*'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Mul'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php index 51075da563..72d03c4590 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class NotEqual extends BinaryOp -{ - public function getOperatorSigil() : string { +class NotEqual extends BinaryOp { + public function getOperatorSigil(): string { return '!='; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_NotEqual'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php index fa4050e058..e9befd80f3 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class NotIdentical extends BinaryOp -{ - public function getOperatorSigil() : string { +class NotIdentical extends BinaryOp { + public function getOperatorSigil(): string { return '!=='; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_NotIdentical'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php index 62f0229985..fe34b84c9a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Plus.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Plus extends BinaryOp -{ - public function getOperatorSigil() : string { +class Plus extends BinaryOp { + public function getOperatorSigil(): string { return '+'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Plus'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php index 572a1e8e43..e4e641cb72 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Pow.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Pow extends BinaryOp -{ - public function getOperatorSigil() : string { +class Pow extends BinaryOp { + public function getOperatorSigil(): string { return '**'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Pow'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php index 4e70b4ef0b..22c6260f55 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class ShiftLeft extends BinaryOp -{ - public function getOperatorSigil() : string { +class ShiftLeft extends BinaryOp { + public function getOperatorSigil(): string { return '<<'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_ShiftLeft'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php index 45acbd0461..cd42644af2 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class ShiftRight extends BinaryOp -{ - public function getOperatorSigil() : string { +class ShiftRight extends BinaryOp { + public function getOperatorSigil(): string { return '>>'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_ShiftRight'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php index 3cb8e7e0d1..01e9b2310d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Smaller.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Smaller extends BinaryOp -{ - public function getOperatorSigil() : string { +class Smaller extends BinaryOp { + public function getOperatorSigil(): string { return '<'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Smaller'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php index 83e8e214d0..2c88f3836d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class SmallerOrEqual extends BinaryOp -{ - public function getOperatorSigil() : string { +class SmallerOrEqual extends BinaryOp { + public function getOperatorSigil(): string { return '<='; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_SmallerOrEqual'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php index 8c6d787f6a..974ec7dd37 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php @@ -4,13 +4,12 @@ use PhpParser\Node\Expr\BinaryOp; -class Spaceship extends BinaryOp -{ - public function getOperatorSigil() : string { +class Spaceship extends BinaryOp { + public function getOperatorSigil(): string { return '<=>'; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BinaryOp_Spaceship'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php index ed44984bea..b7175a7ae5 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BitwiseNot.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class BitwiseNot extends Expr -{ +class BitwiseNot extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs a bitwise not node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BitwiseNot'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php index bf27e9f657..c66d23326d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/BooleanNot.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class BooleanNot extends Expr -{ +class BooleanNot extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs a boolean not node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_BooleanNot'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php index 78e1cf3494..2af2245bab 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/CallLike.php @@ -19,12 +19,8 @@ abstract public function getRawArgs(): array; * Returns whether this call expression is actually a first class callable. */ public function isFirstClassCallable(): bool { - foreach ($this->getRawArgs() as $arg) { - if ($arg instanceof VariadicPlaceholder) { - return true; - } - } - return false; + $rawArgs = $this->getRawArgs(); + return count($rawArgs) === 1 && current($rawArgs) instanceof VariadicPlaceholder; } /** @@ -36,4 +32,4 @@ public function getArgs(): array { assert(!$this->isFirstClassCallable()); return $this->getRawArgs(); } -} \ No newline at end of file +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php index 36769d4fc6..c2751de470 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast.php @@ -4,23 +4,22 @@ use PhpParser\Node\Expr; -abstract class Cast extends Expr -{ +abstract class Cast extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs a cast node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php index 57cc473b62..471cb824a0 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Array_.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\Cast; -class Array_ extends Cast -{ - public function getType() : string { +class Array_ extends Cast { + public function getType(): string { return 'Expr_Cast_Array'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php index 04eb4af584..3aed497c71 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Bool_.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\Cast; -class Bool_ extends Cast -{ - public function getType() : string { +class Bool_ extends Cast { + public function getType(): string { return 'Expr_Cast_Bool'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php index 891ba5f870..e7f5cd9b92 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Double.php @@ -4,14 +4,13 @@ use PhpParser\Node\Expr\Cast; -class Double extends Cast -{ +class Double extends Cast { // For use in "kind" attribute - const KIND_DOUBLE = 1; // "double" syntax - const KIND_FLOAT = 2; // "float" syntax - const KIND_REAL = 3; // "real" syntax + public const KIND_DOUBLE = 1; // "double" syntax + public const KIND_FLOAT = 2; // "float" syntax + public const KIND_REAL = 3; // "real" syntax - public function getType() : string { + public function getType(): string { return 'Expr_Cast_Double'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php index 01ed594bd0..20744b9b0f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Int_.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\Cast; -class Int_ extends Cast -{ - public function getType() : string { +class Int_ extends Cast { + public function getType(): string { return 'Expr_Cast_Int'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php index 163752be89..dffa9e54ad 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Object_.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\Cast; -class Object_ extends Cast -{ - public function getType() : string { +class Object_ extends Cast { + public function getType(): string { return 'Expr_Cast_Object'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php index b3d99270ac..c7605ab82c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/String_.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\Cast; -class String_ extends Cast -{ - public function getType() : string { +class String_ extends Cast { + public function getType(): string { return 'Expr_Cast_String'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php index accda3e4ff..cb709a43e3 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Cast/Unset_.php @@ -4,9 +4,8 @@ use PhpParser\Node\Expr\Cast; -class Unset_ extends Cast -{ - public function getType() : string { +class Unset_ extends Cast { + public function getType(): string { return 'Expr_Cast_Unset'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php index faf832f938..7fdd40e411 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClassConstFetch.php @@ -2,35 +2,35 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; use PhpParser\Node\Name; -class ClassConstFetch extends Expr -{ +class ClassConstFetch extends Expr { /** @var Name|Expr Class name */ - public $class; - /** @var Identifier|Error Constant name */ - public $name; + public Node $class; + /** @var Identifier|Expr|Error Constant name */ + public Node $name; /** * Constructs a class const fetch node. * - * @param Name|Expr $class Class name - * @param string|Identifier|Error $name Constant name - * @param array $attributes Additional attributes + * @param Name|Expr $class Class name + * @param string|Identifier|Expr|Error $name Constant name + * @param array $attributes Additional attributes */ - public function __construct($class, $name, array $attributes = []) { + public function __construct(Node $class, $name, array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->name = \is_string($name) ? new Identifier($name) : $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['class', 'name']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_ClassConstFetch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php index db216b8f84..d85bc9ab42 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Clone_.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class Clone_ extends Expr -{ +class Clone_ extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs a clone node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Clone'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php index 56ddea6aa5..0680446f34 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php @@ -3,38 +3,46 @@ namespace PhpParser\Node\Expr; use PhpParser\Node; +use PhpParser\Node\ClosureUse; use PhpParser\Node\Expr; use PhpParser\Node\FunctionLike; -class Closure extends Expr implements FunctionLike -{ +class Closure extends Expr implements FunctionLike { /** @var bool Whether the closure is static */ - public $static; + public bool $static; /** @var bool Whether to return by reference */ - public $byRef; + public bool $byRef; /** @var Node\Param[] Parameters */ - public $params; + public array $params; /** @var ClosureUse[] use()s */ - public $uses; + public array $uses; /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ - public $returnType; + public ?Node $returnType; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; + public array $attrGroups; /** * Constructs a lambda function node. * - * @param array $subNodes Array of the following optional subnodes: - * 'static' => false : Whether the closure is static - * 'byRef' => false : Whether to return by reference - * 'params' => array(): Parameters - * 'uses' => array(): use()s - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attributes groups - * @param array $attributes Additional attributes + * @param array{ + * static?: bool, + * byRef?: bool, + * params?: Node\Param[], + * uses?: ClosureUse[], + * returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, + * stmts?: Node\Stmt[], + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'static' => false : Whether the closure is static + * 'byRef' => false : Whether to return by reference + * 'params' => array(): Parameters + * 'uses' => array(): use()s + * 'returnType' => null : Return type + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attributes groups + * @param array $attributes Additional attributes */ public function __construct(array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -42,21 +50,20 @@ public function __construct(array $subNodes = [], array $attributes = []) { $this->byRef = $subNodes['byRef'] ?? false; $this->params = $subNodes['params'] ?? []; $this->uses = $subNodes['uses'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; + $this->returnType = $subNodes['returnType'] ?? null; $this->stmts = $subNodes['stmts'] ?? []; $this->attrGroups = $subNodes['attrGroups'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts']; } - public function returnsByRef() : bool { + public function returnsByRef(): bool { return $this->byRef; } - public function getParams() : array { + public function getParams(): array { return $this->params; } @@ -65,15 +72,15 @@ public function getReturnType() { } /** @return Node\Stmt[] */ - public function getStmts() : array { + public function getStmts(): array { return $this->stmts; } - public function getAttrGroups() : array { + public function getAttrGroups(): array { return $this->attrGroups; } - public function getType() : string { + public function getType(): string { return 'Expr_Closure'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php index 2b8a096666..681ff317be 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ClosureUse.php @@ -1,34 +1,3 @@ attributes = $attributes; - $this->var = $var; - $this->byRef = $byRef; - } - - public function getSubNodeNames() : array { - return ['var', 'byRef']; - } - - public function getType() : string { - return 'Expr_ClosureUse'; - } -} +require __DIR__ . '/../ClosureUse.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php index 14ebd16bd8..47191c5f33 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ConstFetch.php @@ -5,27 +5,26 @@ use PhpParser\Node\Expr; use PhpParser\Node\Name; -class ConstFetch extends Expr -{ +class ConstFetch extends Expr { /** @var Name Constant name */ - public $name; + public Name $name; /** * Constructs a const fetch node. * - * @param Name $name Constant name - * @param array $attributes Additional attributes + * @param Name $name Constant name + * @param array $attributes Additional attributes */ public function __construct(Name $name, array $attributes = []) { $this->attributes = $attributes; $this->name = $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_ConstFetch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php index 4042ec93ca..d2f30506ba 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Empty_.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class Empty_ extends Expr -{ +class Empty_ extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs an empty() node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Empty'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php index 1637f3aeae..43010ac45d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Error.php @@ -10,22 +10,21 @@ * An error node may be placed at a position where an expression is required, but an error occurred. * Error nodes will not be present if the parser is run in throwOnError mode (the default). */ -class Error extends Expr -{ +class Error extends Expr { /** * Constructs an error node. * - * @param array $attributes Additional attributes + * @param array $attributes Additional attributes */ public function __construct(array $attributes = []) { $this->attributes = $attributes; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return []; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Error'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php index c44ff6f931..32625a2335 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ErrorSuppress.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class ErrorSuppress extends Expr -{ +class ErrorSuppress extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs an error suppress node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_ErrorSuppress'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php index 8568547438..5120b1b4f3 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class Eval_ extends Expr -{ +class Eval_ extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs an eval() node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Eval'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php index b88a8f7e6f..cf00246699 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Exit_.php @@ -4,31 +4,30 @@ use PhpParser\Node\Expr; -class Exit_ extends Expr -{ +class Exit_ extends Expr { /* For use in "kind" attribute */ - const KIND_EXIT = 1; - const KIND_DIE = 2; + public const KIND_EXIT = 1; + public const KIND_DIE = 2; /** @var null|Expr Expression */ - public $expr; + public ?Expr $expr; /** * Constructs an exit() node. * - * @param null|Expr $expr Expression - * @param array $attributes Additional attributes + * @param null|Expr $expr Expression + * @param array $attributes Additional attributes */ - public function __construct(Expr $expr = null, array $attributes = []) { + public function __construct(?Expr $expr = null, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Exit'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php index 2de4d0dd57..0b85840d8e 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php @@ -5,31 +5,30 @@ use PhpParser\Node; use PhpParser\Node\Expr; -class FuncCall extends CallLike -{ +class FuncCall extends CallLike { /** @var Node\Name|Expr Function name */ - public $name; + public Node $name; /** @var array Arguments */ - public $args; + public array $args; /** * Constructs a function call node. * - * @param Node\Name|Expr $name Function name - * @param array $args Arguments - * @param array $attributes Additional attributes + * @param Node\Name|Expr $name Function name + * @param array $args Arguments + * @param array $attributes Additional attributes */ - public function __construct($name, array $args = [], array $attributes = []) { + public function __construct(Node $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->name = $name; $this->args = $args; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name', 'args']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_FuncCall'; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php index 07ce5968e4..e1187b194f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Include_.php @@ -4,24 +4,23 @@ use PhpParser\Node\Expr; -class Include_ extends Expr -{ - const TYPE_INCLUDE = 1; - const TYPE_INCLUDE_ONCE = 2; - const TYPE_REQUIRE = 3; - const TYPE_REQUIRE_ONCE = 4; +class Include_ extends Expr { + public const TYPE_INCLUDE = 1; + public const TYPE_INCLUDE_ONCE = 2; + public const TYPE_REQUIRE = 3; + public const TYPE_REQUIRE_ONCE = 4; /** @var Expr Expression */ - public $expr; + public Expr $expr; /** @var int Type of include */ - public $type; + public int $type; /** * Constructs an include node. * - * @param Expr $expr Expression - * @param int $type Type of include - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param int $type Type of include + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, int $type, array $attributes = []) { $this->attributes = $attributes; @@ -29,11 +28,11 @@ public function __construct(Expr $expr, int $type, array $attributes = []) { $this->type = $type; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr', 'type']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Include'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php index 9000d47bb1..a2783cb3af 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Instanceof_.php @@ -2,34 +2,34 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Name; -class Instanceof_ extends Expr -{ +class Instanceof_ extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** @var Name|Expr Class name */ - public $class; + public Node $class; /** * Constructs an instanceof check node. * - * @param Expr $expr Expression - * @param Name|Expr $class Class name - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param Name|Expr $class Class name + * @param array $attributes Additional attributes */ - public function __construct(Expr $expr, $class, array $attributes = []) { + public function __construct(Expr $expr, Node $class, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; $this->class = $class; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr', 'class']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Instanceof'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php index 76b7387587..4f80fff723 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Isset_.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class Isset_ extends Expr -{ +class Isset_ extends Expr { /** @var Expr[] Variables */ - public $vars; + public array $vars; /** * Constructs an array node. * - * @param Expr[] $vars Variables - * @param array $attributes Additional attributes + * @param Expr[] $vars Variables + * @param array $attributes Additional attributes */ public function __construct(array $vars, array $attributes = []) { $this->attributes = $attributes; $this->vars = $vars; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['vars']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Isset'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php index c27a27b957..496b7b3853 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/List_.php @@ -2,29 +2,33 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node\ArrayItem; use PhpParser\Node\Expr; -class List_ extends Expr -{ +class List_ extends Expr { + // For use in "kind" attribute + public const KIND_LIST = 1; // list() syntax + public const KIND_ARRAY = 2; // [] syntax + /** @var (ArrayItem|null)[] List of items to assign to */ - public $items; + public array $items; /** * Constructs a list() destructuring node. * - * @param (ArrayItem|null)[] $items List of items to assign to - * @param array $attributes Additional attributes + * @param (ArrayItem|null)[] $items List of items to assign to + * @param array $attributes Additional attributes */ public function __construct(array $items, array $attributes = []) { $this->attributes = $attributes; $this->items = $items; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['items']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_List'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php index 2455a30264..cd028a2da7 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Match_.php @@ -5,15 +5,16 @@ use PhpParser\Node; use PhpParser\Node\MatchArm; -class Match_ extends Node\Expr -{ - /** @var Node\Expr */ - public $cond; +class Match_ extends Node\Expr { + /** @var Node\Expr Condition */ + public Node\Expr $cond; /** @var MatchArm[] */ - public $arms; + public array $arms; /** + * @param Node\Expr $cond Condition * @param MatchArm[] $arms + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) { $this->attributes = $attributes; @@ -21,11 +22,11 @@ public function __construct(Node\Expr $cond, array $arms = [], array $attributes $this->arms = $arms; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['cond', 'arms']; } - public function getType() : string { + public function getType(): string { return 'Expr_Match'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php index 49ca483565..2703c75d88 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php @@ -2,27 +2,27 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; use PhpParser\Node\VariadicPlaceholder; -class MethodCall extends CallLike -{ +class MethodCall extends CallLike { /** @var Expr Variable holding object */ - public $var; + public Expr $var; /** @var Identifier|Expr Method name */ - public $name; + public Node $name; /** @var array Arguments */ - public $args; + public array $args; /** * Constructs a function call node. * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes */ public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; @@ -31,11 +31,11 @@ public function __construct(Expr $var, $name, array $args = [], array $attribute $this->args = $args; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'name', 'args']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_MethodCall'; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php index e2bb64928d..eedaaa1e3b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php @@ -7,31 +7,30 @@ use PhpParser\Node\Expr; use PhpParser\Node\VariadicPlaceholder; -class New_ extends CallLike -{ +class New_ extends CallLike { /** @var Node\Name|Expr|Node\Stmt\Class_ Class name */ - public $class; + public Node $class; /** @var array Arguments */ - public $args; + public array $args; /** * Constructs a function call node. * - * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) - * @param array $args Arguments - * @param array $attributes Additional attributes + * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) + * @param array $args Arguments + * @param array $attributes Additional attributes */ - public function __construct($class, array $args = [], array $attributes = []) { + public function __construct(Node $class, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->args = $args; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['class', 'args']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_New'; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php index 07a571fd8f..a151f71528 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafeMethodCall.php @@ -2,27 +2,27 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; use PhpParser\Node\VariadicPlaceholder; -class NullsafeMethodCall extends CallLike -{ +class NullsafeMethodCall extends CallLike { /** @var Expr Variable holding object */ - public $var; + public Expr $var; /** @var Identifier|Expr Method name */ - public $name; + public Node $name; /** @var array Arguments */ - public $args; + public array $args; /** * Constructs a nullsafe method call node. * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes */ public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; @@ -31,11 +31,11 @@ public function __construct(Expr $var, $name, array $args = [], array $attribute $this->args = $args; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'name', 'args']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_NullsafeMethodCall'; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php index 9317eb3b91..6f73a16d76 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/NullsafePropertyFetch.php @@ -2,22 +2,22 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; -class NullsafePropertyFetch extends Expr -{ +class NullsafePropertyFetch extends Expr { /** @var Expr Variable holding object */ - public $var; + public Expr $var; /** @var Identifier|Expr Property name */ - public $name; + public Node $name; /** * Constructs a nullsafe property fetch node. * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Property name - * @param array $attributes Additional attributes + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Property name + * @param array $attributes Additional attributes */ public function __construct(Expr $var, $name, array $attributes = []) { $this->attributes = $attributes; @@ -25,11 +25,11 @@ public function __construct(Expr $var, $name, array $attributes = []) { $this->name = \is_string($name) ? new Identifier($name) : $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'name']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_NullsafePropertyFetch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php index 94d6c296d8..3dca8fdc5a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostDec.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class PostDec extends Expr -{ +class PostDec extends Expr { /** @var Expr Variable */ - public $var; + public Expr $var; /** * Constructs a post decrement node. * - * @param Expr $var Variable - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param array $attributes Additional attributes */ public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_PostDec'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php index 005c443a2d..bc990c3030 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PostInc.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class PostInc extends Expr -{ +class PostInc extends Expr { /** @var Expr Variable */ - public $var; + public Expr $var; /** * Constructs a post increment node. * - * @param Expr $var Variable - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param array $attributes Additional attributes */ public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_PostInc'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php index a5ca685a8a..2f16873016 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreDec.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class PreDec extends Expr -{ +class PreDec extends Expr { /** @var Expr Variable */ - public $var; + public Expr $var; /** * Constructs a pre decrement node. * - * @param Expr $var Variable - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param array $attributes Additional attributes */ public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var']; } - public function getType() : string { + public function getType(): string { return 'Expr_PreDec'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php index 0986c44748..fd455f55b9 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PreInc.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class PreInc extends Expr -{ +class PreInc extends Expr { /** @var Expr Variable */ - public $var; + public Expr $var; /** * Constructs a pre increment node. * - * @param Expr $var Variable - * @param array $attributes Additional attributes + * @param Expr $var Variable + * @param array $attributes Additional attributes */ public function __construct(Expr $var, array $attributes = []) { $this->attributes = $attributes; $this->var = $var; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_PreInc'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php index 2d43c2ac82..605747604d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Print_.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class Print_ extends Expr -{ +class Print_ extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs an print() node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Print'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php index 4281f31ccf..8c416a8c40 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/PropertyFetch.php @@ -2,22 +2,22 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; -class PropertyFetch extends Expr -{ +class PropertyFetch extends Expr { /** @var Expr Variable holding object */ - public $var; + public Expr $var; /** @var Identifier|Expr Property name */ - public $name; + public Node $name; /** * Constructs a function call node. * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Property name - * @param array $attributes Additional attributes + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Property name + * @param array $attributes Additional attributes */ public function __construct(Expr $var, $name, array $attributes = []) { $this->attributes = $attributes; @@ -25,11 +25,11 @@ public function __construct(Expr $var, $name, array $attributes = []) { $this->name = \is_string($name) ? new Identifier($name) : $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['var', 'name']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_PropertyFetch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php index 537a7cc809..e400351277 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ShellExec.php @@ -3,28 +3,28 @@ namespace PhpParser\Node\Expr; use PhpParser\Node\Expr; +use PhpParser\Node\InterpolatedStringPart; -class ShellExec extends Expr -{ - /** @var array Encapsed string array */ - public $parts; +class ShellExec extends Expr { + /** @var (Expr|InterpolatedStringPart)[] Interpolated string array */ + public array $parts; /** * Constructs a shell exec (backtick) node. * - * @param array $parts Encapsed string array - * @param array $attributes Additional attributes + * @param (Expr|InterpolatedStringPart)[] $parts Interpolated string array + * @param array $attributes Additional attributes */ public function __construct(array $parts, array $attributes = []) { $this->attributes = $attributes; $this->parts = $parts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['parts']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_ShellExec'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php index d0d099c472..707f34b669 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php @@ -8,35 +8,34 @@ use PhpParser\Node\Identifier; use PhpParser\Node\VariadicPlaceholder; -class StaticCall extends CallLike -{ +class StaticCall extends CallLike { /** @var Node\Name|Expr Class name */ - public $class; + public Node $class; /** @var Identifier|Expr Method name */ - public $name; + public Node $name; /** @var array Arguments */ - public $args; + public array $args; /** * Constructs a static method call node. * - * @param Node\Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param array $args Arguments - * @param array $attributes Additional attributes + * @param Node\Name|Expr $class Class name + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes */ - public function __construct($class, $name, array $args = [], array $attributes = []) { + public function __construct(Node $class, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->name = \is_string($name) ? new Identifier($name) : $name; $this->args = $args; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['class', 'name', 'args']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_StaticCall'; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php index 1ee1a25e50..4836a65b23 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticPropertyFetch.php @@ -2,35 +2,35 @@ namespace PhpParser\Node\Expr; +use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Name; use PhpParser\Node\VarLikeIdentifier; -class StaticPropertyFetch extends Expr -{ +class StaticPropertyFetch extends Expr { /** @var Name|Expr Class name */ - public $class; + public Node $class; /** @var VarLikeIdentifier|Expr Property name */ - public $name; + public Node $name; /** * Constructs a static property fetch node. * - * @param Name|Expr $class Class name - * @param string|VarLikeIdentifier|Expr $name Property name - * @param array $attributes Additional attributes + * @param Name|Expr $class Class name + * @param string|VarLikeIdentifier|Expr $name Property name + * @param array $attributes Additional attributes */ - public function __construct($class, $name, array $attributes = []) { + public function __construct(Node $class, $name, array $attributes = []) { $this->attributes = $attributes; $this->class = $class; $this->name = \is_string($name) ? new VarLikeIdentifier($name) : $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['class', 'name']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_StaticPropertyFetch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php index 9316f47d4d..d4837e6402 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Ternary.php @@ -4,35 +4,34 @@ use PhpParser\Node\Expr; -class Ternary extends Expr -{ +class Ternary extends Expr { /** @var Expr Condition */ - public $cond; + public Expr $cond; /** @var null|Expr Expression for true */ - public $if; + public ?Expr $if; /** @var Expr Expression for false */ - public $else; + public Expr $else; /** * Constructs a ternary operator node. * - * @param Expr $cond Condition - * @param null|Expr $if Expression for true - * @param Expr $else Expression for false - * @param array $attributes Additional attributes + * @param Expr $cond Condition + * @param null|Expr $if Expression for true + * @param Expr $else Expression for false + * @param array $attributes Additional attributes */ - public function __construct(Expr $cond, $if, Expr $else, array $attributes = []) { + public function __construct(Expr $cond, ?Expr $if, Expr $else, array $attributes = []) { $this->attributes = $attributes; $this->cond = $cond; $this->if = $if; $this->else = $else; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['cond', 'if', 'else']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Ternary'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php index 5c97f0e2b4..ee49f835fb 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Throw_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Throw_ extends Node\Expr -{ +class Throw_ extends Node\Expr { /** @var Node\Expr Expression */ - public $expr; + public Node\Expr $expr; /** * Constructs a throw expression node. * - * @param Node\Expr $expr Expression - * @param array $attributes Additional attributes + * @param Node\Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - public function getType() : string { + public function getType(): string { return 'Expr_Throw'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php index ce8808bc64..cd06f74bab 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryMinus.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class UnaryMinus extends Expr -{ +class UnaryMinus extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs a unary minus node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_UnaryMinus'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php index d23047e54e..1b44f7b3e7 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/UnaryPlus.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class UnaryPlus extends Expr -{ +class UnaryPlus extends Expr { /** @var Expr Expression */ - public $expr; + public Expr $expr; /** * Constructs a unary plus node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_UnaryPlus'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php index b47d38e934..bab74920a1 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Variable.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class Variable extends Expr -{ +class Variable extends Expr { /** @var string|Expr Name */ public $name; /** * Constructs a variable node. * - * @param string|Expr $name Name - * @param array $attributes Additional attributes + * @param string|Expr $name Name + * @param array $attributes Additional attributes */ public function __construct($name, array $attributes = []) { $this->attributes = $attributes; $this->name = $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Variable'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php index a3efce618c..5cff88f869 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/YieldFrom.php @@ -4,27 +4,26 @@ use PhpParser\Node\Expr; -class YieldFrom extends Expr -{ +class YieldFrom extends Expr { /** @var Expr Expression to yield from */ - public $expr; + public Expr $expr; /** * Constructs an "yield from" node. * - * @param Expr $expr Expression - * @param array $attributes Additional attributes + * @param Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_YieldFrom'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php index aef8fc333d..bd81e69b31 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Yield_.php @@ -4,31 +4,30 @@ use PhpParser\Node\Expr; -class Yield_ extends Expr -{ +class Yield_ extends Expr { /** @var null|Expr Key expression */ - public $key; + public ?Expr $key; /** @var null|Expr Value expression */ - public $value; + public ?Expr $value; /** * Constructs a yield expression node. * - * @param null|Expr $value Value expression - * @param null|Expr $key Key expression - * @param array $attributes Additional attributes + * @param null|Expr $value Value expression + * @param null|Expr $key Key expression + * @param array $attributes Additional attributes */ - public function __construct(Expr $value = null, Expr $key = null, array $attributes = []) { + public function __construct(?Expr $value = null, ?Expr $key = null, array $attributes = []) { $this->attributes = $attributes; $this->key = $key; $this->value = $value; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['key', 'value']; } - - public function getType() : string { + + public function getType(): string { return 'Expr_Yield'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php index 5a825e7311..58f653a89f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php @@ -4,21 +4,18 @@ use PhpParser\Node; -interface FunctionLike extends Node -{ +interface FunctionLike extends Node { /** * Whether to return by reference - * - * @return bool */ - public function returnsByRef() : bool; + public function returnsByRef(): bool; /** * List of parameters * * @return Param[] */ - public function getParams() : array; + public function getParams(): array; /** * Get the declared return type or null @@ -32,12 +29,12 @@ public function getReturnType(); * * @return Stmt[]|null */ - public function getStmts(); + public function getStmts(): ?array; /** * Get PHP attribute groups. * * @return AttributeGroup[] */ - public function getAttrGroups() : array; + public function getAttrGroups(): array; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php index 2f262db0aa..01eebe5ca4 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php @@ -7,12 +7,15 @@ /** * Represents a non-namespaced name. Namespaced names are represented using Name nodes. */ -class Identifier extends NodeAbstract -{ - /** @var string Identifier as string */ - public $name; +class Identifier extends NodeAbstract { + /** + * @psalm-var non-empty-string + * @var string Identifier as string + */ + public string $name; - private static $specialClassNames = [ + /** @var array */ + private static array $specialClassNames = [ 'self' => true, 'parent' => true, 'static' => true, @@ -21,33 +24,39 @@ class Identifier extends NodeAbstract /** * Constructs an identifier node. * - * @param string $name Identifier as string - * @param array $attributes Additional attributes + * @param string $name Identifier as string + * @param array $attributes Additional attributes */ public function __construct(string $name, array $attributes = []) { + if ($name === '') { + throw new \InvalidArgumentException('Identifier name cannot be empty'); + } + $this->attributes = $attributes; $this->name = $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name']; } /** * Get identifier as string. * + * @psalm-return non-empty-string * @return string Identifier as string. */ - public function toString() : string { + public function toString(): string { return $this->name; } /** * Get lowercased identifier as string. * + * @psalm-return non-empty-string * @return string Lowercased identifier as string */ - public function toLowerString() : string { + public function toLowerString(): string { return strtolower($this->name); } @@ -56,20 +65,21 @@ public function toLowerString() : string { * * @return bool Whether identifier is a special class name */ - public function isSpecialClassName() : bool { + public function isSpecialClassName(): bool { return isset(self::$specialClassNames[strtolower($this->name)]); } /** * Get identifier as string. * + * @psalm-return non-empty-string * @return string Identifier as string */ - public function __toString() : string { + public function __toString(): string { return $this->name; } - - public function getType() : string { + + public function getType(): string { return 'Identifier'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php new file mode 100644 index 0000000000..576dac46f5 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/InterpolatedStringPart.php @@ -0,0 +1,32 @@ + $attributes Additional attributes + */ + public function __construct(string $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + public function getType(): string { + return 'InterpolatedStringPart'; + } +} + +// @deprecated compatibility alias +class_alias(InterpolatedStringPart::class, Scalar\EncapsedStringPart::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php index 9208e1392d..3b39cf105b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php @@ -2,29 +2,26 @@ namespace PhpParser\Node; -use PhpParser\NodeAbstract; - -class IntersectionType extends ComplexType -{ +class IntersectionType extends ComplexType { /** @var (Identifier|Name)[] Types */ - public $types; + public array $types; /** * Constructs an intersection type. * - * @param (Identifier|Name)[] $types Types - * @param array $attributes Additional attributes + * @param (Identifier|Name)[] $types Types + * @param array $attributes Additional attributes */ public function __construct(array $types, array $attributes = []) { $this->attributes = $attributes; $this->types = $types; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['types']; } - public function getType() : string { + public function getType(): string { return 'IntersectionType'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php index 2ae1c86b85..2927f029d6 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/MatchArm.php @@ -5,27 +5,26 @@ use PhpParser\Node; use PhpParser\NodeAbstract; -class MatchArm extends NodeAbstract -{ - /** @var null|Node\Expr[] */ - public $conds; +class MatchArm extends NodeAbstract { + /** @var null|list */ + public ?array $conds; /** @var Node\Expr */ - public $body; + public Expr $body; /** - * @param null|Node\Expr[] $conds + * @param null|list $conds */ - public function __construct($conds, Node\Expr $body, array $attributes = []) { + public function __construct(?array $conds, Node\Expr $body, array $attributes = []) { $this->conds = $conds; $this->body = $body; $this->attributes = $attributes; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['conds', 'body']; } - public function getType() : string { + public function getType(): string { return 'MatchArm'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php index 17bd1c0f7e..aa2b90eb22 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name.php @@ -4,12 +4,15 @@ use PhpParser\NodeAbstract; -class Name extends NodeAbstract -{ - /** @var string[] Parts of the name */ - public $parts; +class Name extends NodeAbstract { + /** + * @psalm-var non-empty-string + * @var string Name as string + */ + public string $name; - private static $specialClassNames = [ + /** @var array */ + private static array $specialClassNames = [ 'self' => true, 'parent' => true, 'static' => true, @@ -18,16 +21,26 @@ class Name extends NodeAbstract /** * Constructs a name node. * - * @param string|string[]|self $name Name as string, part array or Name instance (copy ctor) - * @param array $attributes Additional attributes + * @param string|string[]|self $name Name as string, part array or Name instance (copy ctor) + * @param array $attributes Additional attributes */ - public function __construct($name, array $attributes = []) { + final public function __construct($name, array $attributes = []) { $this->attributes = $attributes; - $this->parts = self::prepareName($name); + $this->name = self::prepareName($name); } - public function getSubNodeNames() : array { - return ['parts']; + public function getSubNodeNames(): array { + return ['name']; + } + + /** + * Get parts of name (split by the namespace separator). + * + * @psalm-return non-empty-list + * @return string[] Parts of name + */ + public function getParts(): array { + return \explode('\\', $this->name); } /** @@ -35,8 +48,11 @@ public function getSubNodeNames() : array { * * @return string First part of the name */ - public function getFirst() : string { - return $this->parts[0]; + public function getFirst(): string { + if (false !== $pos = \strpos($this->name, '\\')) { + return \substr($this->name, 0, $pos); + } + return $this->name; } /** @@ -44,8 +60,11 @@ public function getFirst() : string { * * @return string Last part of the name */ - public function getLast() : string { - return $this->parts[count($this->parts) - 1]; + public function getLast(): string { + if (false !== $pos = \strrpos($this->name, '\\')) { + return \substr($this->name, $pos + 1); + } + return $this->name; } /** @@ -53,8 +72,8 @@ public function getLast() : string { * * @return bool Whether the name is unqualified */ - public function isUnqualified() : bool { - return 1 === count($this->parts); + public function isUnqualified(): bool { + return false === \strpos($this->name, '\\'); } /** @@ -62,8 +81,8 @@ public function isUnqualified() : bool { * * @return bool Whether the name is qualified */ - public function isQualified() : bool { - return 1 < count($this->parts); + public function isQualified(): bool { + return false !== \strpos($this->name, '\\'); } /** @@ -71,7 +90,7 @@ public function isQualified() : bool { * * @return bool Whether the name is fully qualified */ - public function isFullyQualified() : bool { + public function isFullyQualified(): bool { return false; } @@ -80,7 +99,7 @@ public function isFullyQualified() : bool { * * @return bool Whether the name is relative */ - public function isRelative() : bool { + public function isRelative(): bool { return false; } @@ -88,19 +107,21 @@ public function isRelative() : bool { * Returns a string representation of the name itself, without taking the name type into * account (e.g., not including a leading backslash for fully qualified names). * + * @psalm-return non-empty-string * @return string String representation */ - public function toString() : string { - return implode('\\', $this->parts); + public function toString(): string { + return $this->name; } /** * Returns a string representation of the name as it would occur in code (e.g., including * leading backslash for fully qualified names. * + * @psalm-return non-empty-string * @return string String representation */ - public function toCodeString() : string { + public function toCodeString(): string { return $this->toString(); } @@ -108,10 +129,11 @@ public function toCodeString() : string { * Returns lowercased string representation of the name, without taking the name type into * account (e.g., no leading backslash for fully qualified names). * + * @psalm-return non-empty-string * @return string Lowercased string representation */ - public function toLowerString() : string { - return strtolower(implode('\\', $this->parts)); + public function toLowerString(): string { + return strtolower($this->name); } /** @@ -119,19 +141,19 @@ public function toLowerString() : string { * * @return bool Whether identifier is a special class name */ - public function isSpecialClassName() : bool { - return count($this->parts) === 1 - && isset(self::$specialClassNames[strtolower($this->parts[0])]); + public function isSpecialClassName(): bool { + return isset(self::$specialClassNames[strtolower($this->name)]); } /** * Returns a string representation of the name by imploding the namespace parts with the * namespace separator. * + * @psalm-return non-empty-string * @return string String representation */ - public function __toString() : string { - return implode('\\', $this->parts); + public function __toString(): string { + return $this->name; } /** @@ -145,13 +167,22 @@ public function __toString() : string { * * Offset and length have the same meaning as in array_slice(). * - * @param int $offset Offset to start the slice at (may be negative) + * @param int $offset Offset to start the slice at (may be negative) * @param int|null $length Length of the slice (may be negative) * * @return static|null Sliced name */ - public function slice(int $offset, int $length = null) { - $numParts = count($this->parts); + public function slice(int $offset, ?int $length = null) { + if ($offset === 1 && $length === null) { + // Short-circuit the common case. + if (false !== $pos = \strpos($this->name, '\\')) { + return new static(\substr($this->name, $pos + 1)); + } + return null; + } + + $parts = \explode('\\', $this->name); + $numParts = \count($parts); $realOffset = $offset < 0 ? $offset + $numParts : $offset; if ($realOffset < 0 || $realOffset > $numParts) { @@ -172,7 +203,7 @@ public function slice(int $offset, int $length = null) { return null; } - return new static(array_slice($this->parts, $realOffset, $realLength), $this->attributes); + return new static(array_slice($parts, $realOffset, $realLength), $this->attributes); } /** @@ -186,49 +217,54 @@ public function slice(int $offset, int $length = null) { * Name::concat($namespace, $shortName) * where $namespace is a Name node or null will work as expected. * - * @param string|string[]|self|null $name1 The first name - * @param string|string[]|self|null $name2 The second name - * @param array $attributes Attributes to assign to concatenated name + * @param string|string[]|self|null $name1 The first name + * @param string|string[]|self|null $name2 The second name + * @param array $attributes Attributes to assign to concatenated name * * @return static|null Concatenated name */ public static function concat($name1, $name2, array $attributes = []) { if (null === $name1 && null === $name2) { return null; - } elseif (null === $name1) { - return new static(self::prepareName($name2), $attributes); - } elseif (null === $name2) { - return new static(self::prepareName($name1), $attributes); + } + if (null === $name1) { + return new static($name2, $attributes); + } + if (null === $name2) { + return new static($name1, $attributes); } else { return new static( - array_merge(self::prepareName($name1), self::prepareName($name2)), $attributes + self::prepareName($name1) . '\\' . self::prepareName($name2), $attributes ); } } /** * Prepares a (string, array or Name node) name for use in name changing methods by converting - * it to an array. + * it to a string. * * @param string|string[]|self $name Name to prepare * - * @return string[] Prepared name + * @psalm-return non-empty-string + * @return string Prepared name */ - private static function prepareName($name) : array { + private static function prepareName($name): string { if (\is_string($name)) { if ('' === $name) { throw new \InvalidArgumentException('Name cannot be empty'); } - return explode('\\', $name); - } elseif (\is_array($name)) { + return $name; + } + if (\is_array($name)) { if (empty($name)) { throw new \InvalidArgumentException('Name cannot be empty'); } - return $name; - } elseif ($name instanceof self) { - return $name->parts; + return implode('\\', $name); + } + if ($name instanceof self) { + return $name->name; } throw new \InvalidArgumentException( @@ -236,7 +272,7 @@ private static function prepareName($name) : array { ); } - public function getType() : string { + public function getType(): string { return 'Name'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php index 1df93a56b6..21183786ba 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/FullyQualified.php @@ -2,14 +2,13 @@ namespace PhpParser\Node\Name; -class FullyQualified extends \PhpParser\Node\Name -{ +class FullyQualified extends \PhpParser\Node\Name { /** * Checks whether the name is unqualified. (E.g. Name) * * @return bool Whether the name is unqualified */ - public function isUnqualified() : bool { + public function isUnqualified(): bool { return false; } @@ -18,7 +17,7 @@ public function isUnqualified() : bool { * * @return bool Whether the name is qualified */ - public function isQualified() : bool { + public function isQualified(): bool { return false; } @@ -27,7 +26,7 @@ public function isQualified() : bool { * * @return bool Whether the name is fully qualified */ - public function isFullyQualified() : bool { + public function isFullyQualified(): bool { return true; } @@ -36,15 +35,15 @@ public function isFullyQualified() : bool { * * @return bool Whether the name is relative */ - public function isRelative() : bool { + public function isRelative(): bool { return false; } - public function toCodeString() : string { + public function toCodeString(): string { return '\\' . $this->toString(); } - - public function getType() : string { + + public function getType(): string { return 'Name_FullyQualified'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php index 57bf7af2b2..0226a4e485 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Name/Relative.php @@ -2,14 +2,13 @@ namespace PhpParser\Node\Name; -class Relative extends \PhpParser\Node\Name -{ +class Relative extends \PhpParser\Node\Name { /** * Checks whether the name is unqualified. (E.g. Name) * * @return bool Whether the name is unqualified */ - public function isUnqualified() : bool { + public function isUnqualified(): bool { return false; } @@ -18,7 +17,7 @@ public function isUnqualified() : bool { * * @return bool Whether the name is qualified */ - public function isQualified() : bool { + public function isQualified(): bool { return false; } @@ -27,7 +26,7 @@ public function isQualified() : bool { * * @return bool Whether the name is fully qualified */ - public function isFullyQualified() : bool { + public function isFullyQualified(): bool { return false; } @@ -36,15 +35,15 @@ public function isFullyQualified() : bool { * * @return bool Whether the name is relative */ - public function isRelative() : bool { + public function isRelative(): bool { return true; } - public function toCodeString() : string { + public function toCodeString(): string { return 'namespace\\' . $this->toString(); } - - public function getType() : string { + + public function getType(): string { return 'Name_Relative'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php index d68e26a38f..b99acd1351 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php @@ -2,27 +2,28 @@ namespace PhpParser\Node; -class NullableType extends ComplexType -{ +use PhpParser\Node; + +class NullableType extends ComplexType { /** @var Identifier|Name Type */ - public $type; + public Node $type; /** * Constructs a nullable type (wrapping another type). * - * @param string|Identifier|Name $type Type - * @param array $attributes Additional attributes + * @param Identifier|Name $type Type + * @param array $attributes Additional attributes */ - public function __construct($type, array $attributes = []) { + public function __construct(Node $type, array $attributes = []) { $this->attributes = $attributes; - $this->type = \is_string($type) ? new Identifier($type) : $type; + $this->type = $type; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['type']; } - - public function getType() : string { + + public function getType(): string { return 'NullableType'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php index 1e90b79441..a277ca0a15 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php @@ -2,59 +2,109 @@ namespace PhpParser\Node; +use PhpParser\Modifiers; +use PhpParser\Node; use PhpParser\NodeAbstract; -class Param extends NodeAbstract -{ +class Param extends NodeAbstract { /** @var null|Identifier|Name|ComplexType Type declaration */ - public $type; + public ?Node $type; /** @var bool Whether parameter is passed by reference */ - public $byRef; + public bool $byRef; /** @var bool Whether this is a variadic argument */ - public $variadic; + public bool $variadic; /** @var Expr\Variable|Expr\Error Parameter variable */ - public $var; + public Expr $var; /** @var null|Expr Default value */ - public $default; - /** @var int */ - public $flags; + public ?Expr $default; + /** @var int Optional visibility flags */ + public int $flags; /** @var AttributeGroup[] PHP attribute groups */ - public $attrGroups; + public array $attrGroups; + /** @var PropertyHook[] Property hooks for promoted properties */ + public array $hooks; /** * Constructs a parameter node. * - * @param Expr\Variable|Expr\Error $var Parameter variable - * @param null|Expr $default Default value - * @param null|string|Identifier|Name|ComplexType $type Type declaration - * @param bool $byRef Whether is passed by reference - * @param bool $variadic Whether this is a variadic argument - * @param array $attributes Additional attributes - * @param int $flags Optional visibility flags - * @param AttributeGroup[] $attrGroups PHP attribute groups + * @param Expr\Variable|Expr\Error $var Parameter variable + * @param null|Expr $default Default value + * @param null|Identifier|Name|ComplexType $type Type declaration + * @param bool $byRef Whether is passed by reference + * @param bool $variadic Whether this is a variadic argument + * @param array $attributes Additional attributes + * @param int $flags Optional visibility flags + * @param list $attrGroups PHP attribute groups + * @param PropertyHook[] $hooks Property hooks for promoted properties */ public function __construct( - $var, Expr $default = null, $type = null, + Expr $var, ?Expr $default = null, ?Node $type = null, bool $byRef = false, bool $variadic = false, array $attributes = [], int $flags = 0, - array $attrGroups = [] + array $attrGroups = [], + array $hooks = [] ) { $this->attributes = $attributes; - $this->type = \is_string($type) ? new Identifier($type) : $type; + $this->type = $type; $this->byRef = $byRef; $this->variadic = $variadic; $this->var = $var; $this->default = $default; $this->flags = $flags; $this->attrGroups = $attrGroups; + $this->hooks = $hooks; } - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default']; + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default', 'hooks']; } - public function getType() : string { + public function getType(): string { return 'Param'; } + + /** + * Whether this parameter uses constructor property promotion. + */ + public function isPromoted(): bool { + return $this->flags !== 0; + } + + public function isPublic(): bool { + return (bool) ($this->flags & Modifiers::PUBLIC); + } + + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); + } + + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); + } + + public function isReadonly(): bool { + return (bool) ($this->flags & Modifiers::READONLY); + } + + /** + * Whether the promoted property has explicit public(set) visibility. + */ + public function isPublicSet(): bool { + return (bool) ($this->flags & Modifiers::PUBLIC_SET); + } + + /** + * Whether the promoted property has explicit protected(set) visibility. + */ + public function isProtectedSet(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED_SET); + } + + /** + * Whether the promoted property has explicit private(set) visibility. + */ + public function isPrivateSet(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE_SET); + } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php new file mode 100644 index 0000000000..a8cde850f7 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php @@ -0,0 +1,78 @@ + false : Whether hook returns by reference + * 'params' => array(): Parameters + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes + */ + public function __construct($name, $body, array $subNodes = [], array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Identifier($name) : $name; + $this->body = $body; + $this->flags = $subNodes['flags'] ?? 0; + $this->byRef = $subNodes['byRef'] ?? false; + $this->params = $subNodes['params'] ?? []; + $this->attrGroups = $subNodes['attrGroups'] ?? []; + } + + public function returnsByRef(): bool { + return $this->byRef; + } + + public function getParams(): array { + return $this->params; + } + + public function getReturnType() { + return null; + } + + public function getStmts(): ?array { + if ($this->body instanceof Expr) { + return [new Return_($this->body)]; + } + return $this->body; + } + + public function getAttrGroups(): array { + return $this->attrGroups; + } + + public function getType(): string { + return 'PropertyHook'; + } + + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'body']; + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php new file mode 100644 index 0000000000..101611e6bc --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php @@ -0,0 +1,37 @@ + $attributes Additional attributes + */ + public function __construct($name, ?Node\Expr $default = null, array $attributes = []) { + $this->attributes = $attributes; + $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; + $this->default = $default; + } + + public function getSubNodeNames(): array { + return ['name', 'default']; + } + + public function getType(): string { + return 'PropertyItem'; + } +} + +// @deprecated compatibility alias +class_alias(PropertyItem::class, Stmt\PropertyProperty::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php index 8117909b65..3df2572169 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar.php @@ -2,6 +2,5 @@ namespace PhpParser\Node; -abstract class Scalar extends Expr -{ +abstract class Scalar extends Expr { } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php index 8a15c6f1f7..ad3937a54c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php @@ -1,77 +1,3 @@ attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * @param mixed[] $attributes - */ - public static function fromString(string $str, array $attributes = []): DNumber - { - $attributes['rawValue'] = $str; - $float = self::parse($str); - - return new DNumber($float, $attributes); - } - - /** - * @internal - * - * Parses a DNUMBER token like PHP would. - * - * @param string $str A string number - * - * @return float The parsed number - */ - public static function parse(string $str) : float { - $str = str_replace('_', '', $str); - - // Check whether this is one of the special integer notations. - if ('0' === $str[0]) { - // hex - if ('x' === $str[1] || 'X' === $str[1]) { - return hexdec($str); - } - - // bin - if ('b' === $str[1] || 'B' === $str[1]) { - return bindec($str); - } - - // oct, but only if the string does not contain any of '.eE'. - if (false === strpbrk($str, '.eE')) { - // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit - // (8 or 9) so that only the digits before that are used. - return octdec(substr($str, 0, strcspn($str, '89'))); - } - } - - // dec - return (float) $str; - } - - public function getType() : string { - return 'Scalar_DNumber'; - } -} +require __DIR__ . '/Float_.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php index fa5d2e2681..c5aaf5b4e2 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Encapsed.php @@ -1,31 +1,3 @@ attributes = $attributes; - $this->parts = $parts; - } - - public function getSubNodeNames() : array { - return ['parts']; - } - - public function getType() : string { - return 'Scalar_Encapsed'; - } -} +require __DIR__ . '/InterpolatedString.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php index bb3194c1d7..990e9801b5 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/EncapsedStringPart.php @@ -1,30 +1,3 @@ attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - public function getType() : string { - return 'Scalar_EncapsedStringPart'; - } -} +require __DIR__ . '/../InterpolatedStringPart.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php new file mode 100644 index 0000000000..5af1319237 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Float_.php @@ -0,0 +1,78 @@ + $attributes Additional attributes + */ + public function __construct(float $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + /** + * @param mixed[] $attributes + */ + public static function fromString(string $str, array $attributes = []): Float_ { + $attributes['rawValue'] = $str; + $float = self::parse($str); + + return new Float_($float, $attributes); + } + + /** + * @internal + * + * Parses a DNUMBER token like PHP would. + * + * @param string $str A string number + * + * @return float The parsed number + */ + public static function parse(string $str): float { + $str = str_replace('_', '', $str); + + // Check whether this is one of the special integer notations. + if ('0' === $str[0]) { + // hex + if ('x' === $str[1] || 'X' === $str[1]) { + return hexdec($str); + } + + // bin + if ('b' === $str[1] || 'B' === $str[1]) { + return bindec($str); + } + + // oct, but only if the string does not contain any of '.eE'. + if (false === strpbrk($str, '.eE')) { + // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit + // (8 or 9) so that only the digits before that are used. + return octdec(substr($str, 0, strcspn($str, '89'))); + } + } + + // dec + return (float) $str; + } + + public function getType(): string { + return 'Scalar_Float'; + } +} + +// @deprecated compatibility alias +class_alias(Float_::class, DNumber::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php new file mode 100644 index 0000000000..bcc257a6a1 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/Int_.php @@ -0,0 +1,82 @@ + $attributes Additional attributes + */ + public function __construct(int $value, array $attributes = []) { + $this->attributes = $attributes; + $this->value = $value; + } + + public function getSubNodeNames(): array { + return ['value']; + } + + /** + * Constructs an Int node from a string number literal. + * + * @param string $str String number literal (decimal, octal, hex or binary) + * @param array $attributes Additional attributes + * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5) + * + * @return Int_ The constructed LNumber, including kind attribute + */ + public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false): Int_ { + $attributes['rawValue'] = $str; + + $str = str_replace('_', '', $str); + + if ('0' !== $str[0] || '0' === $str) { + $attributes['kind'] = Int_::KIND_DEC; + return new Int_((int) $str, $attributes); + } + + if ('x' === $str[1] || 'X' === $str[1]) { + $attributes['kind'] = Int_::KIND_HEX; + return new Int_(hexdec($str), $attributes); + } + + if ('b' === $str[1] || 'B' === $str[1]) { + $attributes['kind'] = Int_::KIND_BIN; + return new Int_(bindec($str), $attributes); + } + + if (!$allowInvalidOctal && strpbrk($str, '89')) { + throw new Error('Invalid numeric literal', $attributes); + } + + // Strip optional explicit octal prefix. + if ('o' === $str[1] || 'O' === $str[1]) { + $str = substr($str, 2); + } + + // use intval instead of octdec to get proper cutting behavior with malformed numbers + $attributes['kind'] = Int_::KIND_OCT; + return new Int_(intval($str, 8), $attributes); + } + + public function getType(): string { + return 'Scalar_Int'; + } +} + +// @deprecated compatibility alias +class_alias(Int_::class, LNumber::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php new file mode 100644 index 0000000000..9336dfe4da --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/InterpolatedString.php @@ -0,0 +1,34 @@ + $attributes Additional attributes + */ + public function __construct(array $parts, array $attributes = []) { + $this->attributes = $attributes; + $this->parts = $parts; + } + + public function getSubNodeNames(): array { + return ['parts']; + } + + public function getType(): string { + return 'Scalar_InterpolatedString'; + } +} + +// @deprecated compatibility alias +class_alias(InterpolatedString::class, Encapsed::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php index 2cc2b22c8e..cfe8c8c1c5 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php @@ -1,80 +1,3 @@ attributes = $attributes; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['value']; - } - - /** - * Constructs an LNumber node from a string number literal. - * - * @param string $str String number literal (decimal, octal, hex or binary) - * @param array $attributes Additional attributes - * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5) - * - * @return LNumber The constructed LNumber, including kind attribute - */ - public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false) : LNumber { - $attributes['rawValue'] = $str; - - $str = str_replace('_', '', $str); - - if ('0' !== $str[0] || '0' === $str) { - $attributes['kind'] = LNumber::KIND_DEC; - return new LNumber((int) $str, $attributes); - } - - if ('x' === $str[1] || 'X' === $str[1]) { - $attributes['kind'] = LNumber::KIND_HEX; - return new LNumber(hexdec($str), $attributes); - } - - if ('b' === $str[1] || 'B' === $str[1]) { - $attributes['kind'] = LNumber::KIND_BIN; - return new LNumber(bindec($str), $attributes); - } - - if (!$allowInvalidOctal && strpbrk($str, '89')) { - throw new Error('Invalid numeric literal', $attributes); - } - - // Strip optional explicit octal prefix. - if ('o' === $str[1] || 'O' === $str[1]) { - $str = substr($str, 2); - } - - // use intval instead of octdec to get proper cutting behavior with malformed numbers - $attributes['kind'] = LNumber::KIND_OCT; - return new LNumber(intval($str, 8), $attributes); - } - - public function getType() : string { - return 'Scalar_LNumber'; - } -} +require __DIR__ . '/Int_.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php index 941f0c7620..1da9b391cb 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst.php @@ -4,18 +4,17 @@ use PhpParser\Node\Scalar; -abstract class MagicConst extends Scalar -{ +abstract class MagicConst extends Scalar { /** * Constructs a magic constant node. * - * @param array $attributes Additional attributes + * @param array $attributes Additional attributes */ public function __construct(array $attributes = []) { $this->attributes = $attributes; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return []; } @@ -24,5 +23,5 @@ public function getSubNodeNames() : array { * * @return string Name of magic constant */ - abstract public function getName() : string; + abstract public function getName(): string; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php index 244328476d..732ed140f1 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Class_.php @@ -4,13 +4,12 @@ use PhpParser\Node\Scalar\MagicConst; -class Class_ extends MagicConst -{ - public function getName() : string { +class Class_ extends MagicConst { + public function getName(): string { return '__CLASS__'; } - - public function getType() : string { + + public function getType(): string { return 'Scalar_MagicConst_Class'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php index 2b618473e3..64daa713bb 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php @@ -4,13 +4,12 @@ use PhpParser\Node\Scalar\MagicConst; -class Dir extends MagicConst -{ - public function getName() : string { +class Dir extends MagicConst { + public function getName(): string { return '__DIR__'; } - - public function getType() : string { + + public function getType(): string { return 'Scalar_MagicConst_Dir'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php index 3422db0692..91041f0f99 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/File.php @@ -4,13 +4,12 @@ use PhpParser\Node\Scalar\MagicConst; -class File extends MagicConst -{ - public function getName() : string { +class File extends MagicConst { + public function getName(): string { return '__FILE__'; } - - public function getType() : string { + + public function getType(): string { return 'Scalar_MagicConst_File'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php index 1db65a1513..c242d2d95d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Function_.php @@ -4,13 +4,12 @@ use PhpParser\Node\Scalar\MagicConst; -class Function_ extends MagicConst -{ - public function getName() : string { +class Function_ extends MagicConst { + public function getName(): string { return '__FUNCTION__'; } - - public function getType() : string { + + public function getType(): string { return 'Scalar_MagicConst_Function'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php index 25d3de57c1..58d8ce39da 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Line.php @@ -4,13 +4,12 @@ use PhpParser\Node\Scalar\MagicConst; -class Line extends MagicConst -{ - public function getName() : string { +class Line extends MagicConst { + public function getName(): string { return '__LINE__'; } - - public function getType() : string { + + public function getType(): string { return 'Scalar_MagicConst_Line'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php index d168d56f10..47f341f10a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Method.php @@ -4,13 +4,12 @@ use PhpParser\Node\Scalar\MagicConst; -class Method extends MagicConst -{ - public function getName() : string { +class Method extends MagicConst { + public function getName(): string { return '__METHOD__'; } - - public function getType() : string { + + public function getType(): string { return 'Scalar_MagicConst_Method'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php index 4fabb751af..e9f8c0eae4 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php @@ -4,13 +4,12 @@ use PhpParser\Node\Scalar\MagicConst; -class Namespace_ extends MagicConst -{ - public function getName() : string { +class Namespace_ extends MagicConst { + public function getName(): string { return '__NAMESPACE__'; } - - public function getType() : string { + + public function getType(): string { return 'Scalar_MagicConst_Namespace'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Property.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Property.php new file mode 100644 index 0000000000..6c0c968fce --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Property.php @@ -0,0 +1,15 @@ + Escaped character to its decoded value */ + protected static array $replacements = [ '\\' => '\\', '$' => '$', 'n' => "\n", @@ -30,23 +30,23 @@ class String_ extends Scalar /** * Constructs a string scalar node. * - * @param string $value Value of the string - * @param array $attributes Additional attributes + * @param string $value Value of the string + * @param array $attributes Additional attributes */ public function __construct(string $value, array $attributes = []) { $this->attributes = $attributes; $this->value = $value; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['value']; } /** + * @param array $attributes * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes */ - public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true): self - { + public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true): self { $attributes['kind'] = ($str[0] === "'" || ($str[1] === "'" && ($str[0] === 'b' || $str[0] === 'B'))) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED; @@ -68,7 +68,7 @@ public static function fromString(string $str, array $attributes = [], bool $par * * @return string The parsed string */ - public static function parse(string $str, bool $parseUnicodeEscape = true) : string { + public static function parse(string $str, bool $parseUnicodeEscape = true): string { $bLength = 0; if ('b' === $str[0] || 'B' === $str[0]) { $bLength = 1; @@ -92,13 +92,13 @@ public static function parse(string $str, bool $parseUnicodeEscape = true) : str * * Parses escape sequences in strings (all string types apart from single quoted). * - * @param string $str String without quotes + * @param string $str String without quotes * @param null|string $quote Quote type * @param bool $parseUnicodeEscape Whether to parse PHP 7 \u escapes * * @return string String with escape sequences parsed */ - public static function parseEscapeSequences(string $str, $quote, bool $parseUnicodeEscape = true) : string { + public static function parseEscapeSequences(string $str, ?string $quote, bool $parseUnicodeEscape = true): string { if (null !== $quote) { $str = str_replace('\\' . $quote, $quote, $str); } @@ -110,15 +110,19 @@ public static function parseEscapeSequences(string $str, $quote, bool $parseUnic return preg_replace_callback( '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~', - function($matches) { + function ($matches) { $str = $matches[1]; if (isset(self::$replacements[$str])) { return self::$replacements[$str]; - } elseif ('x' === $str[0] || 'X' === $str[0]) { + } + if ('x' === $str[0] || 'X' === $str[0]) { return chr(hexdec(substr($str, 1))); - } elseif ('u' === $str[0]) { - return self::codePointToUtf8(hexdec($matches[2])); + } + if ('u' === $str[0]) { + $dec = hexdec($matches[2]); + // If it overflowed to float, treat as INT_MAX, it will throw an error anyway. + return self::codePointToUtf8(\is_int($dec) ? $dec : \PHP_INT_MAX); } else { return chr(octdec($str)); } @@ -134,24 +138,24 @@ function($matches) { * * @return string UTF-8 representation of code point */ - private static function codePointToUtf8(int $num) : string { + private static function codePointToUtf8(int $num): string { if ($num <= 0x7F) { return chr($num); } if ($num <= 0x7FF) { - return chr(($num>>6) + 0xC0) . chr(($num&0x3F) + 0x80); + return chr(($num >> 6) + 0xC0) . chr(($num & 0x3F) + 0x80); } if ($num <= 0xFFFF) { - return chr(($num>>12) + 0xE0) . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); + return chr(($num >> 12) + 0xE0) . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80); } if ($num <= 0x1FFFFF) { - return chr(($num>>18) + 0xF0) . chr((($num>>12)&0x3F) + 0x80) - . chr((($num>>6)&0x3F) + 0x80) . chr(($num&0x3F) + 0x80); + return chr(($num >> 18) + 0xF0) . chr((($num >> 12) & 0x3F) + 0x80) + . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80); } throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large'); } - public function getType() : string { + public function getType(): string { return 'Scalar_String'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php new file mode 100644 index 0000000000..517c0edddd --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/StaticVar.php @@ -0,0 +1,39 @@ + $attributes Additional attributes + */ + public function __construct( + Expr\Variable $var, ?Node\Expr $default = null, array $attributes = [] + ) { + $this->attributes = $attributes; + $this->var = $var; + $this->default = $default; + } + + public function getSubNodeNames(): array { + return ['var', 'default']; + } + + public function getType(): string { + return 'StaticVar'; + } +} + +// @deprecated compatibility alias +class_alias(StaticVar::class, Stmt\StaticVar::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php index 69d33e5796..481d31a939 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt.php @@ -4,6 +4,5 @@ use PhpParser\NodeAbstract; -abstract class Stmt extends NodeAbstract -{ +abstract class Stmt extends NodeAbstract { } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php new file mode 100644 index 0000000000..073df2086f --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Block.php @@ -0,0 +1,29 @@ + $attributes Additional attributes + */ + public function __construct(array $stmts, array $attributes = []) { + $this->attributes = $attributes; + $this->stmts = $stmts; + } + + public function getType(): string { + return 'Stmt_Block'; + } + + public function getSubNodeNames(): array { + return ['stmts']; + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php index 6adc5a6c6f..d2bcc5eb2d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Break_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Break_ extends Node\Stmt -{ +class Break_ extends Node\Stmt { /** @var null|Node\Expr Number of loops to break */ - public $num; + public ?Node\Expr $num; /** * Constructs a break node. * - * @param null|Node\Expr $num Number of loops to break - * @param array $attributes Additional attributes + * @param null|Node\Expr $num Number of loops to break + * @param array $attributes Additional attributes */ - public function __construct(Node\Expr $num = null, array $attributes = []) { + public function __construct(?Node\Expr $num = null, array $attributes = []) { $this->attributes = $attributes; $this->num = $num; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['num']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Break'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php index 2bf044c900..a06ca1832e 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php @@ -4,31 +4,30 @@ use PhpParser\Node; -class Case_ extends Node\Stmt -{ +class Case_ extends Node\Stmt { /** @var null|Node\Expr Condition (null for default) */ - public $cond; + public ?Node\Expr $cond; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs a case node. * - * @param null|Node\Expr $cond Condition (null for default) - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param null|Node\Expr $cond Condition (null for default) + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ - public function __construct($cond, array $stmts = [], array $attributes = []) { + public function __construct(?Node\Expr $cond, array $stmts = [], array $attributes = []) { $this->attributes = $attributes; $this->cond = $cond; $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['cond', 'stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Case'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php index 9b9c094782..e8d39c9cce 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Catch_.php @@ -5,25 +5,24 @@ use PhpParser\Node; use PhpParser\Node\Expr; -class Catch_ extends Node\Stmt -{ +class Catch_ extends Node\Stmt { /** @var Node\Name[] Types of exceptions to catch */ - public $types; + public array $types; /** @var Expr\Variable|null Variable for exception */ - public $var; + public ?Expr\Variable $var; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs a catch node. * - * @param Node\Name[] $types Types of exceptions to catch - * @param Expr\Variable|null $var Variable for exception - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param Node\Name[] $types Types of exceptions to catch + * @param Expr\Variable|null $var Variable for exception + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ public function __construct( - array $types, Expr\Variable $var = null, array $stmts = [], array $attributes = [] + array $types, ?Expr\Variable $var = null, array $stmts = [], array $attributes = [] ) { $this->attributes = $attributes; $this->types = $types; @@ -31,11 +30,11 @@ public function __construct( $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['types', 'var', 'stmts']; } - public function getType() : string { + public function getType(): string { return 'Stmt_Catch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php index 1fc7f3362a..9bdce1f1db 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php @@ -2,79 +2,76 @@ namespace PhpParser\Node\Stmt; +use PhpParser\Modifiers; use PhpParser\Node; -class ClassConst extends Node\Stmt -{ +class ClassConst extends Node\Stmt { /** @var int Modifiers */ - public $flags; + public int $flags; /** @var Node\Const_[] Constant declarations */ - public $consts; - /** @var Node\AttributeGroup[] */ - public $attrGroups; + public array $consts; + /** @var Node\AttributeGroup[] PHP attribute groups */ + public array $attrGroups; + /** @var Node\Identifier|Node\Name|Node\ComplexType|null Type declaration */ + public ?Node $type; /** * Constructs a class const list node. * - * @param Node\Const_[] $consts Constant declarations - * @param int $flags Modifiers - * @param array $attributes Additional attributes - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param Node\Const_[] $consts Constant declarations + * @param int $flags Modifiers + * @param array $attributes Additional attributes + * @param list $attrGroups PHP attribute groups + * @param null|Node\Identifier|Node\Name|Node\ComplexType $type Type declaration */ public function __construct( array $consts, int $flags = 0, array $attributes = [], - array $attrGroups = [] + array $attrGroups = [], + ?Node $type = null ) { $this->attributes = $attributes; $this->flags = $flags; $this->consts = $consts; $this->attrGroups = $attrGroups; + $this->type = $type; } - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'consts']; + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'type', 'consts']; } /** * Whether constant is explicitly or implicitly public. - * - * @return bool */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; + public function isPublic(): bool { + return ($this->flags & Modifiers::PUBLIC) !== 0 + || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; } /** * Whether constant is protected. - * - * @return bool */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); } /** * Whether constant is private. - * - * @return bool */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); } /** * Whether constant is final. - * - * @return bool */ - public function isFinal() : bool { - return (bool) ($this->flags & Class_::MODIFIER_FINAL); + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); } - public function getType() : string { + public function getType(): string { return 'Stmt_ClassConst'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php index 2fa4e861b3..fb9ba4f59a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassLike.php @@ -3,23 +3,23 @@ namespace PhpParser\Node\Stmt; use PhpParser\Node; +use PhpParser\Node\PropertyItem; -abstract class ClassLike extends Node\Stmt -{ +abstract class ClassLike extends Node\Stmt { /** @var Node\Identifier|null Name */ - public $name; + public ?Node\Identifier $name; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; + public array $attrGroups; /** @var Node\Name|null Namespaced name (if using NameResolver) */ - public $namespacedName; + public ?Node\Name $namespacedName; /** * @return TraitUse[] */ - public function getTraitUses() : array { + public function getTraitUses(): array { $traitUses = []; foreach ($this->stmts as $stmt) { if ($stmt instanceof TraitUse) { @@ -32,7 +32,7 @@ public function getTraitUses() : array { /** * @return ClassConst[] */ - public function getConstants() : array { + public function getConstants(): array { $constants = []; foreach ($this->stmts as $stmt) { if ($stmt instanceof ClassConst) { @@ -45,7 +45,7 @@ public function getConstants() : array { /** * @return Property[] */ - public function getProperties() : array { + public function getProperties(): array { $properties = []; foreach ($this->stmts as $stmt) { if ($stmt instanceof Property) { @@ -62,11 +62,11 @@ public function getProperties() : array { * * @return Property|null Property node or null if the property does not exist */ - public function getProperty(string $name) { + public function getProperty(string $name): ?Property { foreach ($this->stmts as $stmt) { if ($stmt instanceof Property) { foreach ($stmt->props as $prop) { - if ($prop instanceof PropertyProperty && $name === $prop->name->toString()) { + if ($prop instanceof PropertyItem && $name === $prop->name->toString()) { return $stmt; } } @@ -80,7 +80,7 @@ public function getProperty(string $name) { * * @return ClassMethod[] */ - public function getMethods() : array { + public function getMethods(): array { $methods = []; foreach ($this->stmts as $stmt) { if ($stmt instanceof ClassMethod) { @@ -97,7 +97,7 @@ public function getMethods() : array { * * @return ClassMethod|null Method node or null if the method does not exist */ - public function getMethod(string $name) { + public function getMethod(string $name): ?ClassMethod { $lowerName = strtolower($name); foreach ($this->stmts as $stmt) { if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) { diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php index 6e85161e31..59c0519ea6 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php @@ -2,27 +2,28 @@ namespace PhpParser\Node\Stmt; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\FunctionLike; -class ClassMethod extends Node\Stmt implements FunctionLike -{ +class ClassMethod extends Node\Stmt implements FunctionLike { /** @var int Flags */ - public $flags; + public int $flags; /** @var bool Whether to return by reference */ - public $byRef; + public bool $byRef; /** @var Node\Identifier Name */ - public $name; + public Node\Identifier $name; /** @var Node\Param[] Parameters */ - public $params; + public array $params; /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ - public $returnType; + public ?Node $returnType; /** @var Node\Stmt[]|null Statements */ - public $stmts; + public ?array $stmts; /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; + public array $attrGroups; - private static $magicNames = [ + /** @var array */ + private static array $magicNames = [ '__construct' => true, '__destruct' => true, '__call' => true, @@ -46,14 +47,21 @@ class ClassMethod extends Node\Stmt implements FunctionLike * Constructs a class method node. * * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'flags => MODIFIER_PUBLIC: Flags - * 'byRef' => false : Whether to return by reference - * 'params' => array() : Parameters - * 'returnType' => null : Return type - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes + * @param array{ + * flags?: int, + * byRef?: bool, + * params?: Node\Param[], + * returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, + * stmts?: Node\Stmt[]|null, + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'flags => 0 : Flags + * 'byRef' => false : Whether to return by reference + * 'params' => array() : Parameters + * 'returnType' => null : Return type + * 'stmts' => array() : Statements + * 'attrGroups' => array() : PHP attribute groups + * @param array $attributes Additional attributes */ public function __construct($name, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -61,21 +69,20 @@ public function __construct($name, array $subNodes = [], array $attributes = []) $this->byRef = $subNodes['byRef'] ?? false; $this->name = \is_string($name) ? new Node\Identifier($name) : $name; $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; + $this->returnType = $subNodes['returnType'] ?? null; $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : []; $this->attrGroups = $subNodes['attrGroups'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts']; } - public function returnsByRef() : bool { + public function returnsByRef(): bool { return $this->byRef; } - public function getParams() : array { + public function getParams(): array { return $this->params; } @@ -83,79 +90,65 @@ public function getReturnType() { return $this->returnType; } - public function getStmts() { + public function getStmts(): ?array { return $this->stmts; } - public function getAttrGroups() : array { + public function getAttrGroups(): array { return $this->attrGroups; } /** * Whether the method is explicitly or implicitly public. - * - * @return bool */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; + public function isPublic(): bool { + return ($this->flags & Modifiers::PUBLIC) !== 0 + || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; } /** * Whether the method is protected. - * - * @return bool */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); } /** * Whether the method is private. - * - * @return bool */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); } /** * Whether the method is abstract. - * - * @return bool */ - public function isAbstract() : bool { - return (bool) ($this->flags & Class_::MODIFIER_ABSTRACT); + public function isAbstract(): bool { + return (bool) ($this->flags & Modifiers::ABSTRACT); } /** * Whether the method is final. - * - * @return bool */ - public function isFinal() : bool { - return (bool) ($this->flags & Class_::MODIFIER_FINAL); + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); } /** * Whether the method is static. - * - * @return bool */ - public function isStatic() : bool { - return (bool) ($this->flags & Class_::MODIFIER_STATIC); + public function isStatic(): bool { + return (bool) ($this->flags & Modifiers::STATIC); } /** * Whether the method is magic. - * - * @return bool */ - public function isMagic() : bool { + public function isMagic(): bool { return isset(self::$magicNames[$this->name->toLowerString()]); } - public function getType() : string { + public function getType(): string { return 'Stmt_ClassMethod'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php index 52ed6c6cd6..3f492b7bb3 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php @@ -2,39 +2,52 @@ namespace PhpParser\Node\Stmt; -use PhpParser\Error; +use PhpParser\Modifiers; use PhpParser\Node; -class Class_ extends ClassLike -{ - const MODIFIER_PUBLIC = 1; - const MODIFIER_PROTECTED = 2; - const MODIFIER_PRIVATE = 4; - const MODIFIER_STATIC = 8; - const MODIFIER_ABSTRACT = 16; - const MODIFIER_FINAL = 32; - const MODIFIER_READONLY = 64; - - const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4 - - /** @var int Type */ - public $flags; +class Class_ extends ClassLike { + /** @deprecated Use Modifiers::PUBLIC instead */ + public const MODIFIER_PUBLIC = 1; + /** @deprecated Use Modifiers::PROTECTED instead */ + public const MODIFIER_PROTECTED = 2; + /** @deprecated Use Modifiers::PRIVATE instead */ + public const MODIFIER_PRIVATE = 4; + /** @deprecated Use Modifiers::STATIC instead */ + public const MODIFIER_STATIC = 8; + /** @deprecated Use Modifiers::ABSTRACT instead */ + public const MODIFIER_ABSTRACT = 16; + /** @deprecated Use Modifiers::FINAL instead */ + public const MODIFIER_FINAL = 32; + /** @deprecated Use Modifiers::READONLY instead */ + public const MODIFIER_READONLY = 64; + + /** @deprecated Use Modifiers::VISIBILITY_MASK instead */ + public const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4 + + /** @var int Modifiers */ + public int $flags; /** @var null|Node\Name Name of extended class */ - public $extends; + public ?Node\Name $extends; /** @var Node\Name[] Names of implemented interfaces */ - public $implements; + public array $implements; /** * Constructs a class node. * * @param string|Node\Identifier|null $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'flags' => 0 : Flags - * 'extends' => null : Name of extended class - * 'implements' => array(): Names of implemented interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes + * @param array{ + * flags?: int, + * extends?: Node\Name|null, + * implements?: Node\Name[], + * stmts?: Node\Stmt[], + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'flags' => 0 : Flags + * 'extends' => null : Name of extended class + * 'implements' => array(): Names of implemented interfaces + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes */ public function __construct($name, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -46,92 +59,36 @@ public function __construct($name, array $subNodes = [], array $attributes = []) $this->attrGroups = $subNodes['attrGroups'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts']; } /** * Whether the class is explicitly abstract. - * - * @return bool */ - public function isAbstract() : bool { - return (bool) ($this->flags & self::MODIFIER_ABSTRACT); + public function isAbstract(): bool { + return (bool) ($this->flags & Modifiers::ABSTRACT); } /** * Whether the class is final. - * - * @return bool */ - public function isFinal() : bool { - return (bool) ($this->flags & self::MODIFIER_FINAL); + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); } - public function isReadonly() : bool { - return (bool) ($this->flags & self::MODIFIER_READONLY); + public function isReadonly(): bool { + return (bool) ($this->flags & Modifiers::READONLY); } /** * Whether the class is anonymous. - * - * @return bool */ - public function isAnonymous() : bool { + public function isAnonymous(): bool { return null === $this->name; } - /** - * @internal - */ - public static function verifyClassModifier($a, $b) { - if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { - throw new Error('Multiple abstract modifiers are not allowed'); - } - - if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { - throw new Error('Multiple final modifiers are not allowed'); - } - - if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { - throw new Error('Multiple readonly modifiers are not allowed'); - } - - if ($a & 48 && $b & 48) { - throw new Error('Cannot use the final modifier on an abstract class'); - } - } - - /** - * @internal - */ - public static function verifyModifier($a, $b) { - if ($a & self::VISIBILITY_MODIFIER_MASK && $b & self::VISIBILITY_MODIFIER_MASK) { - throw new Error('Multiple access type modifiers are not allowed'); - } - - if ($a & self::MODIFIER_ABSTRACT && $b & self::MODIFIER_ABSTRACT) { - throw new Error('Multiple abstract modifiers are not allowed'); - } - - if ($a & self::MODIFIER_STATIC && $b & self::MODIFIER_STATIC) { - throw new Error('Multiple static modifiers are not allowed'); - } - - if ($a & self::MODIFIER_FINAL && $b & self::MODIFIER_FINAL) { - throw new Error('Multiple final modifiers are not allowed'); - } - - if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { - throw new Error('Multiple readonly modifiers are not allowed'); - } - - if ($a & 48 && $b & 48) { - throw new Error('Cannot use the final modifier on an abstract class member'); - } - } - - public function getType() : string { + public function getType(): string { return 'Stmt_Class'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php index e6316345ee..f1165fd0b0 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Const_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Const_ extends Node\Stmt -{ +class Const_ extends Node\Stmt { /** @var Node\Const_[] Constant declarations */ - public $consts; + public array $consts; /** * Constructs a const list node. * - * @param Node\Const_[] $consts Constant declarations - * @param array $attributes Additional attributes + * @param Node\Const_[] $consts Constant declarations + * @param array $attributes Additional attributes */ public function __construct(array $consts, array $attributes = []) { $this->attributes = $attributes; $this->consts = $consts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['consts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Const'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php index 24882683b3..54e979ddaa 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Continue_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Continue_ extends Node\Stmt -{ +class Continue_ extends Node\Stmt { /** @var null|Node\Expr Number of loops to continue */ - public $num; + public ?Node\Expr $num; /** * Constructs a continue node. * - * @param null|Node\Expr $num Number of loops to continue - * @param array $attributes Additional attributes + * @param null|Node\Expr $num Number of loops to continue + * @param array $attributes Additional attributes */ - public function __construct(Node\Expr $num = null, array $attributes = []) { + public function __construct(?Node\Expr $num = null, array $attributes = []) { $this->attributes = $attributes; $this->num = $num; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['num']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Continue'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php index ac07f30c78..cb9e8376e3 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/DeclareDeclare.php @@ -1,34 +1,3 @@ value pair node. - * - * @param string|Node\Identifier $key Key - * @param Node\Expr $value Value - * @param array $attributes Additional attributes - */ - public function __construct($key, Node\Expr $value, array $attributes = []) { - $this->attributes = $attributes; - $this->key = \is_string($key) ? new Node\Identifier($key) : $key; - $this->value = $value; - } - - public function getSubNodeNames() : array { - return ['key', 'value']; - } - - public function getType() : string { - return 'Stmt_DeclareDeclare'; - } -} +require __DIR__ . '/../DeclareItem.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php index f46ff0bafd..3c0547bdf2 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Declare_.php @@ -3,32 +3,32 @@ namespace PhpParser\Node\Stmt; use PhpParser\Node; +use PhpParser\Node\DeclareItem; -class Declare_ extends Node\Stmt -{ - /** @var DeclareDeclare[] List of declares */ - public $declares; +class Declare_ extends Node\Stmt { + /** @var DeclareItem[] List of declares */ + public array $declares; /** @var Node\Stmt[]|null Statements */ - public $stmts; + public ?array $stmts; /** * Constructs a declare node. * - * @param DeclareDeclare[] $declares List of declares - * @param Node\Stmt[]|null $stmts Statements - * @param array $attributes Additional attributes + * @param DeclareItem[] $declares List of declares + * @param Node\Stmt[]|null $stmts Statements + * @param array $attributes Additional attributes */ - public function __construct(array $declares, array $stmts = null, array $attributes = []) { + public function __construct(array $declares, ?array $stmts = null, array $attributes = []) { $this->attributes = $attributes; $this->declares = $declares; $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['declares', 'stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Declare'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php index 78e90da03a..6124442881 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Do_.php @@ -4,19 +4,18 @@ use PhpParser\Node; -class Do_ extends Node\Stmt -{ +class Do_ extends Node\Stmt { /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** @var Node\Expr Condition */ - public $cond; + public Node\Expr $cond; /** * Constructs a do while node. * - * @param Node\Expr $cond Condition - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param Node\Expr $cond Condition + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Node\Expr $cond, array $stmts = [], array $attribute $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['stmts', 'cond']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Do'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php index 7cc50d5d6e..4d42452353 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Echo_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Echo_ extends Node\Stmt -{ +class Echo_ extends Node\Stmt { /** @var Node\Expr[] Expressions */ - public $exprs; + public array $exprs; /** * Constructs an echo node. * - * @param Node\Expr[] $exprs Expressions - * @param array $attributes Additional attributes + * @param Node\Expr[] $exprs Expressions + * @param array $attributes Additional attributes */ public function __construct(array $exprs, array $attributes = []) { $this->attributes = $attributes; $this->exprs = $exprs; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['exprs']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Echo'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php index eef1ece324..b26d59ce5f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ElseIf_.php @@ -4,19 +4,18 @@ use PhpParser\Node; -class ElseIf_ extends Node\Stmt -{ +class ElseIf_ extends Node\Stmt { /** @var Node\Expr Condition */ - public $cond; + public Node\Expr $cond; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs an elseif node. * - * @param Node\Expr $cond Condition - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param Node\Expr $cond Condition + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Node\Expr $cond, array $stmts = [], array $attribute $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['cond', 'stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_ElseIf'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php index 0e61778e26..3d2b066ec9 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Else_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Else_ extends Node\Stmt -{ +class Else_ extends Node\Stmt { /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs an else node. * - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ public function __construct(array $stmts = [], array $attributes = []) { $this->attributes = $attributes; $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Else'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php index 5beff8b39f..c071a0af13 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/EnumCase.php @@ -5,33 +5,32 @@ use PhpParser\Node; use PhpParser\Node\AttributeGroup; -class EnumCase extends Node\Stmt -{ +class EnumCase extends Node\Stmt { /** @var Node\Identifier Enum case name */ - public $name; + public Node\Identifier $name; /** @var Node\Expr|null Enum case expression */ - public $expr; + public ?Node\Expr $expr; /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; + public array $attrGroups; /** - * @param string|Node\Identifier $name Enum case name - * @param Node\Expr|null $expr Enum case expression - * @param AttributeGroup[] $attrGroups PHP attribute groups - * @param array $attributes Additional attributes + * @param string|Node\Identifier $name Enum case name + * @param Node\Expr|null $expr Enum case expression + * @param list $attrGroups PHP attribute groups + * @param array $attributes Additional attributes */ - public function __construct($name, Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) { + public function __construct($name, ?Node\Expr $expr = null, array $attrGroups = [], array $attributes = []) { parent::__construct($attributes); $this->name = \is_string($name) ? new Node\Identifier($name) : $name; $this->expr = $expr; $this->attrGroups = $attrGroups; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'name', 'expr']; } - public function getType() : string { + public function getType(): string { return 'Stmt_EnumCase'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php index 3a50c225db..7eea6a6991 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Enum_.php @@ -4,21 +4,25 @@ use PhpParser\Node; -class Enum_ extends ClassLike -{ +class Enum_ extends ClassLike { /** @var null|Node\Identifier Scalar Type */ - public $scalarType; + public ?Node $scalarType; /** @var Node\Name[] Names of implemented interfaces */ - public $implements; + public array $implements; /** - * @param string|Node\Identifier|null $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'scalarType' => null : Scalar type - * 'implements' => array() : Names of implemented interfaces - * 'stmts' => array() : Statements - * 'attrGroups' => array() : PHP attribute groups - * @param array $attributes Additional attributes + * @param string|Node\Identifier|null $name Name + * @param array{ + * scalarType?: Node\Identifier|null, + * implements?: Node\Name[], + * stmts?: Node\Stmt[], + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'scalarType' => null : Scalar type + * 'implements' => array() : Names of implemented interfaces + * 'stmts' => array() : Statements + * 'attrGroups' => array() : PHP attribute groups + * @param array $attributes Additional attributes */ public function __construct($name, array $subNodes = [], array $attributes = []) { $this->name = \is_string($name) ? new Node\Identifier($name) : $name; @@ -30,11 +34,11 @@ public function __construct($name, array $subNodes = [], array $attributes = []) parent::__construct($attributes); } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts']; } - public function getType() : string { + public function getType(): string { return 'Stmt_Enum'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php index 99d1687ded..89751fa2dc 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Expression.php @@ -7,27 +7,26 @@ /** * Represents statements of type "expr;" */ -class Expression extends Node\Stmt -{ +class Expression extends Node\Stmt { /** @var Node\Expr Expression */ - public $expr; + public Node\Expr $expr; /** * Constructs an expression statement. * - * @param Node\Expr $expr Expression - * @param array $attributes Additional attributes + * @param Node\Expr $expr Expression + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $expr, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Expression'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php index d55b8b6872..69ecf25373 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Finally_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Finally_ extends Node\Stmt -{ +class Finally_ extends Node\Stmt { /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs a finally node. * - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ public function __construct(array $stmts = [], array $attributes = []) { $this->attributes = $attributes; $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Finally'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php index 1323d37cf3..6f2fbb9e3a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/For_.php @@ -4,26 +4,30 @@ use PhpParser\Node; -class For_ extends Node\Stmt -{ +class For_ extends Node\Stmt { /** @var Node\Expr[] Init expressions */ - public $init; + public array $init; /** @var Node\Expr[] Loop conditions */ - public $cond; + public array $cond; /** @var Node\Expr[] Loop expressions */ - public $loop; + public array $loop; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs a for loop node. * - * @param array $subNodes Array of the following optional subnodes: - * 'init' => array(): Init expressions - * 'cond' => array(): Loop conditions - * 'loop' => array(): Loop expressions - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes + * @param array{ + * init?: Node\Expr[], + * cond?: Node\Expr[], + * loop?: Node\Expr[], + * stmts?: Node\Stmt[], + * } $subNodes Array of the following optional subnodes: + * 'init' => array(): Init expressions + * 'cond' => array(): Loop conditions + * 'loop' => array(): Loop expressions + * 'stmts' => array(): Statements + * @param array $attributes Additional attributes */ public function __construct(array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -33,11 +37,11 @@ public function __construct(array $subNodes = [], array $attributes = []) { $this->stmts = $subNodes['stmts'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['init', 'cond', 'loop', 'stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_For'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php index 0556a7ce5f..c5d9a8b132 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Foreach_.php @@ -4,29 +4,32 @@ use PhpParser\Node; -class Foreach_ extends Node\Stmt -{ +class Foreach_ extends Node\Stmt { /** @var Node\Expr Expression to iterate */ - public $expr; + public Node\Expr $expr; /** @var null|Node\Expr Variable to assign key to */ - public $keyVar; + public ?Node\Expr $keyVar; /** @var bool Whether to assign value by reference */ - public $byRef; + public bool $byRef; /** @var Node\Expr Variable to assign value to */ - public $valueVar; + public Node\Expr $valueVar; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs a foreach node. * - * @param Node\Expr $expr Expression to iterate - * @param Node\Expr $valueVar Variable to assign value to - * @param array $subNodes Array of the following optional subnodes: - * 'keyVar' => null : Variable to assign key to - * 'byRef' => false : Whether to assign value by reference - * 'stmts' => array(): Statements - * @param array $attributes Additional attributes + * @param Node\Expr $expr Expression to iterate + * @param Node\Expr $valueVar Variable to assign value to + * @param array{ + * keyVar?: Node\Expr|null, + * byRef?: bool, + * stmts?: Node\Stmt[], + * } $subNodes Array of the following optional subnodes: + * 'keyVar' => null : Variable to assign key to + * 'byRef' => false : Whether to assign value by reference + * 'stmts' => array(): Statements + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -37,11 +40,11 @@ public function __construct(Node\Expr $expr, Node\Expr $valueVar, array $subNode $this->stmts = $subNodes['stmts'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Foreach'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php index c2ccae24ee..2111bab749 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php @@ -5,56 +5,60 @@ use PhpParser\Node; use PhpParser\Node\FunctionLike; -class Function_ extends Node\Stmt implements FunctionLike -{ +class Function_ extends Node\Stmt implements FunctionLike { /** @var bool Whether function returns by reference */ - public $byRef; + public bool $byRef; /** @var Node\Identifier Name */ - public $name; + public Node\Identifier $name; /** @var Node\Param[] Parameters */ - public $params; + public array $params; /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ - public $returnType; + public ?Node $returnType; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; + public array $attrGroups; /** @var Node\Name|null Namespaced name (if using NameResolver) */ - public $namespacedName; + public ?Node\Name $namespacedName; /** * Constructs a function node. * * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'byRef' => false : Whether to return by reference - * 'params' => array(): Parameters - * 'returnType' => null : Return type - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes + * @param array{ + * byRef?: bool, + * params?: Node\Param[], + * returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, + * stmts?: Node\Stmt[], + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'byRef' => false : Whether to return by reference + * 'params' => array(): Parameters + * 'returnType' => null : Return type + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes */ public function __construct($name, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; $this->byRef = $subNodes['byRef'] ?? false; $this->name = \is_string($name) ? new Node\Identifier($name) : $name; $this->params = $subNodes['params'] ?? []; - $returnType = $subNodes['returnType'] ?? null; - $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType; + $this->returnType = $subNodes['returnType'] ?? null; $this->stmts = $subNodes['stmts'] ?? []; $this->attrGroups = $subNodes['attrGroups'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'byRef', 'name', 'params', 'returnType', 'stmts']; } - public function returnsByRef() : bool { + public function returnsByRef(): bool { return $this->byRef; } - public function getParams() : array { + public function getParams(): array { return $this->params; } @@ -62,16 +66,16 @@ public function getReturnType() { return $this->returnType; } - public function getAttrGroups() : array { + public function getAttrGroups(): array { return $this->attrGroups; } /** @return Node\Stmt[] */ - public function getStmts() : array { + public function getStmts(): array { return $this->stmts; } - public function getType() : string { + public function getType(): string { return 'Stmt_Function'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php index a0022ad932..d3ab12fc24 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Global_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Global_ extends Node\Stmt -{ +class Global_ extends Node\Stmt { /** @var Node\Expr[] Variables */ - public $vars; + public array $vars; /** * Constructs a global variables list node. * - * @param Node\Expr[] $vars Variables to unset - * @param array $attributes Additional attributes + * @param Node\Expr[] $vars Variables to unset + * @param array $attributes Additional attributes */ public function __construct(array $vars, array $attributes = []) { $this->attributes = $attributes; $this->vars = $vars; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['vars']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Global'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php index 24a57f7807..26a0d01eae 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Goto_.php @@ -5,27 +5,26 @@ use PhpParser\Node\Identifier; use PhpParser\Node\Stmt; -class Goto_ extends Stmt -{ +class Goto_ extends Stmt { /** @var Identifier Name of label to jump to */ - public $name; + public Identifier $name; /** * Constructs a goto node. * - * @param string|Identifier $name Name of label to jump to - * @param array $attributes Additional attributes + * @param string|Identifier $name Name of label to jump to + * @param array $attributes Additional attributes */ public function __construct($name, array $attributes = []) { $this->attributes = $attributes; $this->name = \is_string($name) ? new Identifier($name) : $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Goto'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php index 24520d2233..0ec8e9d42b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/GroupUse.php @@ -4,23 +4,25 @@ use PhpParser\Node\Name; use PhpParser\Node\Stmt; +use PhpParser\Node\UseItem; -class GroupUse extends Stmt -{ - /** @var int Type of group use */ - public $type; +class GroupUse extends Stmt { + /** + * @var Use_::TYPE_* Type of group use + */ + public int $type; /** @var Name Prefix for uses */ - public $prefix; - /** @var UseUse[] Uses */ - public $uses; + public Name $prefix; + /** @var UseItem[] Uses */ + public array $uses; /** * Constructs a group use node. * - * @param Name $prefix Prefix for uses - * @param UseUse[] $uses Uses - * @param int $type Type of group use - * @param array $attributes Additional attributes + * @param Name $prefix Prefix for uses + * @param UseItem[] $uses Uses + * @param Use_::TYPE_* $type Type of group use + * @param array $attributes Additional attributes */ public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = []) { $this->attributes = $attributes; @@ -29,11 +31,11 @@ public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NO $this->uses = $uses; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['type', 'prefix', 'uses']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_GroupUse'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php index 8e624e0f1f..665bacdee2 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/HaltCompiler.php @@ -4,27 +4,26 @@ use PhpParser\Node\Stmt; -class HaltCompiler extends Stmt -{ +class HaltCompiler extends Stmt { /** @var string Remaining text after halt compiler statement. */ - public $remaining; + public string $remaining; /** * Constructs a __halt_compiler node. * - * @param string $remaining Remaining text after halt compiler statement. - * @param array $attributes Additional attributes + * @param string $remaining Remaining text after halt compiler statement. + * @param array $attributes Additional attributes */ public function __construct(string $remaining, array $attributes = []) { $this->attributes = $attributes; $this->remaining = $remaining; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['remaining']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_HaltCompiler'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php index a1bae4bf89..544390ff5e 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/If_.php @@ -4,26 +4,29 @@ use PhpParser\Node; -class If_ extends Node\Stmt -{ +class If_ extends Node\Stmt { /** @var Node\Expr Condition expression */ - public $cond; + public Node\Expr $cond; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** @var ElseIf_[] Elseif clauses */ - public $elseifs; + public array $elseifs; /** @var null|Else_ Else clause */ - public $else; + public ?Else_ $else; /** * Constructs an if node. * - * @param Node\Expr $cond Condition - * @param array $subNodes Array of the following optional subnodes: - * 'stmts' => array(): Statements - * 'elseifs' => array(): Elseif clauses - * 'else' => null : Else clause - * @param array $attributes Additional attributes + * @param Node\Expr $cond Condition + * @param array{ + * stmts?: Node\Stmt[], + * elseifs?: ElseIf_[], + * else?: Else_|null, + * } $subNodes Array of the following optional subnodes: + * 'stmts' => array(): Statements + * 'elseifs' => array(): Elseif clauses + * 'else' => null : Else clause + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $cond, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -33,11 +36,11 @@ public function __construct(Node\Expr $cond, array $subNodes = [], array $attrib $this->else = $subNodes['else'] ?? null; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['cond', 'stmts', 'elseifs', 'else']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_If'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php index 0711d2842c..0515d02054 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/InlineHTML.php @@ -4,27 +4,26 @@ use PhpParser\Node\Stmt; -class InlineHTML extends Stmt -{ +class InlineHTML extends Stmt { /** @var string String */ - public $value; + public string $value; /** * Constructs an inline HTML node. * - * @param string $value String - * @param array $attributes Additional attributes + * @param string $value String + * @param array $attributes Additional attributes */ public function __construct(string $value, array $attributes = []) { $this->attributes = $attributes; $this->value = $value; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['value']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_InlineHTML'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php index 4d587dd484..9359064f8e 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Interface_.php @@ -4,20 +4,23 @@ use PhpParser\Node; -class Interface_ extends ClassLike -{ +class Interface_ extends ClassLike { /** @var Node\Name[] Extended interfaces */ - public $extends; + public array $extends; /** * Constructs a class node. * * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'extends' => array(): Name of extended interfaces - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes + * @param array{ + * extends?: Node\Name[], + * stmts?: Node\Stmt[], + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'extends' => array(): Name of extended interfaces + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes */ public function __construct($name, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -27,11 +30,11 @@ public function __construct($name, array $subNodes = [], array $attributes = []) $this->attrGroups = $subNodes['attrGroups'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'name', 'extends', 'stmts']; } - public function getType() : string { + public function getType(): string { return 'Stmt_Interface'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php index 3edcb3be7e..658468d2f6 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Label.php @@ -5,27 +5,26 @@ use PhpParser\Node\Identifier; use PhpParser\Node\Stmt; -class Label extends Stmt -{ +class Label extends Stmt { /** @var Identifier Name */ - public $name; + public Identifier $name; /** * Constructs a label node. * - * @param string|Identifier $name Name - * @param array $attributes Additional attributes + * @param string|Identifier $name Name + * @param array $attributes Additional attributes */ public function __construct($name, array $attributes = []) { $this->attributes = $attributes; $this->name = \is_string($name) ? new Identifier($name) : $name; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Label'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php index c63204577c..f5b59ad6e3 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Namespace_.php @@ -4,35 +4,34 @@ use PhpParser\Node; -class Namespace_ extends Node\Stmt -{ +class Namespace_ extends Node\Stmt { /* For use in the "kind" attribute */ - const KIND_SEMICOLON = 1; - const KIND_BRACED = 2; + public const KIND_SEMICOLON = 1; + public const KIND_BRACED = 2; /** @var null|Node\Name Name */ - public $name; + public ?Node\Name $name; /** @var Node\Stmt[] Statements */ public $stmts; /** * Constructs a namespace node. * - * @param null|Node\Name $name Name - * @param null|Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param null|Node\Name $name Name + * @param null|Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ - public function __construct(Node\Name $name = null, $stmts = [], array $attributes = []) { + public function __construct(?Node\Name $name = null, ?array $stmts = [], array $attributes = []) { $this->attributes = $attributes; $this->name = $name; $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['name', 'stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Namespace'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php index f86f8df7d3..3acfa46fb0 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Nop.php @@ -5,13 +5,12 @@ use PhpParser\Node; /** Nop/empty statement (;). */ -class Nop extends Node\Stmt -{ - public function getSubNodeNames() : array { +class Nop extends Node\Stmt { + public function getSubNodeNames(): array { return []; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Nop'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php index bc781bbffc..3b238c76a9 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php @@ -2,90 +2,106 @@ namespace PhpParser\Node\Stmt; +use PhpParser\Modifiers; use PhpParser\Node; use PhpParser\Node\ComplexType; use PhpParser\Node\Identifier; use PhpParser\Node\Name; +use PhpParser\Node\PropertyItem; -class Property extends Node\Stmt -{ +class Property extends Node\Stmt { /** @var int Modifiers */ - public $flags; - /** @var PropertyProperty[] Properties */ - public $props; + public int $flags; + /** @var PropertyItem[] Properties */ + public array $props; /** @var null|Identifier|Name|ComplexType Type declaration */ - public $type; + public ?Node $type; /** @var Node\AttributeGroup[] PHP attribute groups */ - public $attrGroups; + public array $attrGroups; + /** @var Node\PropertyHook[] Property hooks */ + public array $hooks; /** * Constructs a class property list node. * - * @param int $flags Modifiers - * @param PropertyProperty[] $props Properties - * @param array $attributes Additional attributes - * @param null|string|Identifier|Name|ComplexType $type Type declaration - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param int $flags Modifiers + * @param PropertyItem[] $props Properties + * @param array $attributes Additional attributes + * @param null|Identifier|Name|ComplexType $type Type declaration + * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param Node\PropertyHook[] $hooks Property hooks */ - public function __construct(int $flags, array $props, array $attributes = [], $type = null, array $attrGroups = []) { + public function __construct(int $flags, array $props, array $attributes = [], ?Node $type = null, array $attrGroups = [], array $hooks = []) { $this->attributes = $attributes; $this->flags = $flags; $this->props = $props; - $this->type = \is_string($type) ? new Identifier($type) : $type; + $this->type = $type; $this->attrGroups = $attrGroups; + $this->hooks = $hooks; } - public function getSubNodeNames() : array { - return ['attrGroups', 'flags', 'type', 'props']; + public function getSubNodeNames(): array { + return ['attrGroups', 'flags', 'type', 'props', 'hooks']; } /** * Whether the property is explicitly or implicitly public. - * - * @return bool */ - public function isPublic() : bool { - return ($this->flags & Class_::MODIFIER_PUBLIC) !== 0 - || ($this->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0; + public function isPublic(): bool { + return ($this->flags & Modifiers::PUBLIC) !== 0 + || ($this->flags & Modifiers::VISIBILITY_MASK) === 0; } /** * Whether the property is protected. - * - * @return bool */ - public function isProtected() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PROTECTED); + public function isProtected(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED); } /** * Whether the property is private. - * - * @return bool */ - public function isPrivate() : bool { - return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); + public function isPrivate(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE); } /** * Whether the property is static. - * - * @return bool */ - public function isStatic() : bool { - return (bool) ($this->flags & Class_::MODIFIER_STATIC); + public function isStatic(): bool { + return (bool) ($this->flags & Modifiers::STATIC); } /** * Whether the property is readonly. - * - * @return bool */ - public function isReadonly() : bool { - return (bool) ($this->flags & Class_::MODIFIER_READONLY); + public function isReadonly(): bool { + return (bool) ($this->flags & Modifiers::READONLY); + } + + /** + * Whether the property has explicit public(set) visibility. + */ + public function isPublicSet(): bool { + return (bool) ($this->flags & Modifiers::PUBLIC_SET); + } + + /** + * Whether the property has explicit protected(set) visibility. + */ + public function isProtectedSet(): bool { + return (bool) ($this->flags & Modifiers::PROTECTED_SET); + } + + /** + * Whether the property has explicit private(set) visibility. + */ + public function isPrivateSet(): bool { + return (bool) ($this->flags & Modifiers::PRIVATE_SET); } - public function getType() : string { + public function getType(): string { return 'Stmt_Property'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php index 205731e20e..4a21a8806b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php @@ -1,34 +1,3 @@ attributes = $attributes; - $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name; - $this->default = $default; - } - - public function getSubNodeNames() : array { - return ['name', 'default']; - } - - public function getType() : string { - return 'Stmt_PropertyProperty'; - } -} +require __DIR__ . '/../PropertyItem.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php index efc578c58f..9c44cca85c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Return_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Return_ extends Node\Stmt -{ +class Return_ extends Node\Stmt { /** @var null|Node\Expr Expression */ - public $expr; + public ?Node\Expr $expr; /** * Constructs a return node. * - * @param null|Node\Expr $expr Expression - * @param array $attributes Additional attributes + * @param null|Node\Expr $expr Expression + * @param array $attributes Additional attributes */ - public function __construct(Node\Expr $expr = null, array $attributes = []) { + public function __construct(?Node\Expr $expr = null, array $attributes = []) { $this->attributes = $attributes; $this->expr = $expr; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['expr']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Return'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php index 29584560d3..88452e7f9c 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/StaticVar.php @@ -1,37 +1,3 @@ attributes = $attributes; - $this->var = $var; - $this->default = $default; - } - - public function getSubNodeNames() : array { - return ['var', 'default']; - } - - public function getType() : string { - return 'Stmt_StaticVar'; - } -} +require __DIR__ . '/../StaticVar.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php index 464898ffa6..a84de106ac 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Static_.php @@ -2,29 +2,29 @@ namespace PhpParser\Node\Stmt; +use PhpParser\Node\StaticVar; use PhpParser\Node\Stmt; -class Static_ extends Stmt -{ +class Static_ extends Stmt { /** @var StaticVar[] Variable definitions */ - public $vars; + public array $vars; /** * Constructs a static variables list node. * - * @param StaticVar[] $vars Variable definitions - * @param array $attributes Additional attributes + * @param StaticVar[] $vars Variable definitions + * @param array $attributes Additional attributes */ public function __construct(array $vars, array $attributes = []) { $this->attributes = $attributes; $this->vars = $vars; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['vars']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Static'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php index 2c8dae0221..21e5efa569 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Switch_.php @@ -4,19 +4,18 @@ use PhpParser\Node; -class Switch_ extends Node\Stmt -{ +class Switch_ extends Node\Stmt { /** @var Node\Expr Condition */ - public $cond; + public Node\Expr $cond; /** @var Case_[] Case list */ - public $cases; + public array $cases; /** * Constructs a case node. * - * @param Node\Expr $cond Condition - * @param Case_[] $cases Case list - * @param array $attributes Additional attributes + * @param Node\Expr $cond Condition + * @param Case_[] $cases Case list + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $cond, array $cases, array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Node\Expr $cond, array $cases, array $attributes = [ $this->cases = $cases; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['cond', 'cases']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Switch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php deleted file mode 100644 index a34e2b3624..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Throw_.php +++ /dev/null @@ -1,30 +0,0 @@ -attributes = $attributes; - $this->expr = $expr; - } - - public function getSubNodeNames() : array { - return ['expr']; - } - - public function getType() : string { - return 'Stmt_Throw'; - } -} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php index 9e97053b40..7705a57057 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUse.php @@ -4,19 +4,18 @@ use PhpParser\Node; -class TraitUse extends Node\Stmt -{ +class TraitUse extends Node\Stmt { /** @var Node\Name[] Traits */ - public $traits; + public array $traits; /** @var TraitUseAdaptation[] Adaptations */ - public $adaptations; + public array $adaptations; /** * Constructs a trait use node. * - * @param Node\Name[] $traits Traits + * @param Node\Name[] $traits Traits * @param TraitUseAdaptation[] $adaptations Adaptations - * @param array $attributes Additional attributes + * @param array $attributes Additional attributes */ public function __construct(array $traits, array $adaptations = [], array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(array $traits, array $adaptations = [], array $attri $this->adaptations = $adaptations; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['traits', 'adaptations']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_TraitUse'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php index 8bdd2c041f..987bc88ed0 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation.php @@ -4,10 +4,9 @@ use PhpParser\Node; -abstract class TraitUseAdaptation extends Node\Stmt -{ +abstract class TraitUseAdaptation extends Node\Stmt { /** @var Node\Name|null Trait name */ - public $trait; + public ?Node\Name $trait; /** @var Node\Identifier Method name */ - public $method; + public Node\Identifier $method; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php index a3bccbd10c..449671e771 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php @@ -4,23 +4,22 @@ use PhpParser\Node; -class Alias extends Node\Stmt\TraitUseAdaptation -{ +class Alias extends Node\Stmt\TraitUseAdaptation { /** @var null|int New modifier */ - public $newModifier; + public ?int $newModifier; /** @var null|Node\Identifier New name */ - public $newName; + public ?Node\Identifier $newName; /** * Constructs a trait use precedence adaptation node. * - * @param null|Node\Name $trait Trait name - * @param string|Node\Identifier $method Method name - * @param null|int $newModifier New modifier - * @param null|string|Node\Identifier $newName New name - * @param array $attributes Additional attributes + * @param null|Node\Name $trait Trait name + * @param string|Node\Identifier $method Method name + * @param null|int $newModifier New modifier + * @param null|string|Node\Identifier $newName New name + * @param array $attributes Additional attributes */ - public function __construct($trait, $method, $newModifier, $newName, array $attributes = []) { + public function __construct(?Node\Name $trait, $method, ?int $newModifier, $newName, array $attributes = []) { $this->attributes = $attributes; $this->trait = $trait; $this->method = \is_string($method) ? new Node\Identifier($method) : $method; @@ -28,11 +27,11 @@ public function __construct($trait, $method, $newModifier, $newName, array $attr $this->newName = \is_string($newName) ? new Node\Identifier($newName) : $newName; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['trait', 'method', 'newModifier', 'newName']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_TraitUseAdaptation_Alias'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php index 80385f64e3..7bc4083769 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php @@ -4,18 +4,17 @@ use PhpParser\Node; -class Precedence extends Node\Stmt\TraitUseAdaptation -{ +class Precedence extends Node\Stmt\TraitUseAdaptation { /** @var Node\Name[] Overwritten traits */ - public $insteadof; + public array $insteadof; /** * Constructs a trait use precedence adaptation node. * - * @param Node\Name $trait Trait name - * @param string|Node\Identifier $method Method name - * @param Node\Name[] $insteadof Overwritten traits - * @param array $attributes Additional attributes + * @param Node\Name $trait Trait name + * @param string|Node\Identifier $method Method name + * @param Node\Name[] $insteadof Overwritten traits + * @param array $attributes Additional attributes */ public function __construct(Node\Name $trait, $method, array $insteadof, array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Node\Name $trait, $method, array $insteadof, array $ $this->insteadof = $insteadof; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['trait', 'method', 'insteadof']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_TraitUseAdaptation_Precedence'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php index 0cec203ac7..5f2b33070a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Trait_.php @@ -4,16 +4,18 @@ use PhpParser\Node; -class Trait_ extends ClassLike -{ +class Trait_ extends ClassLike { /** * Constructs a trait node. * * @param string|Node\Identifier $name Name - * @param array $subNodes Array of the following optional subnodes: - * 'stmts' => array(): Statements - * 'attrGroups' => array(): PHP attribute groups - * @param array $attributes Additional attributes + * @param array{ + * stmts?: Node\Stmt[], + * attrGroups?: Node\AttributeGroup[], + * } $subNodes Array of the following optional subnodes: + * 'stmts' => array(): Statements + * 'attrGroups' => array(): PHP attribute groups + * @param array $attributes Additional attributes */ public function __construct($name, array $subNodes = [], array $attributes = []) { $this->attributes = $attributes; @@ -22,11 +24,11 @@ public function __construct($name, array $subNodes = [], array $attributes = []) $this->attrGroups = $subNodes['attrGroups'] ?? []; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['attrGroups', 'name', 'stmts']; } - public function getType() : string { + public function getType(): string { return 'Stmt_Trait'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php index 7fc158c570..6414c46c94 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/TryCatch.php @@ -4,35 +4,34 @@ use PhpParser\Node; -class TryCatch extends Node\Stmt -{ +class TryCatch extends Node\Stmt { /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** @var Catch_[] Catches */ - public $catches; + public array $catches; /** @var null|Finally_ Optional finally node */ - public $finally; + public ?Finally_ $finally; /** * Constructs a try catch node. * - * @param Node\Stmt[] $stmts Statements - * @param Catch_[] $catches Catches - * @param null|Finally_ $finally Optional finally node - * @param array $attributes Additional attributes + * @param Node\Stmt[] $stmts Statements + * @param Catch_[] $catches Catches + * @param null|Finally_ $finally Optional finally node + * @param array $attributes Additional attributes */ - public function __construct(array $stmts, array $catches, Finally_ $finally = null, array $attributes = []) { + public function __construct(array $stmts, array $catches, ?Finally_ $finally = null, array $attributes = []) { $this->attributes = $attributes; $this->stmts = $stmts; $this->catches = $catches; $this->finally = $finally; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['stmts', 'catches', 'finally']; } - public function getType() : string { + public function getType(): string { return 'Stmt_TryCatch'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php index 310e427aa2..c211beb0c5 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Unset_.php @@ -4,27 +4,26 @@ use PhpParser\Node; -class Unset_ extends Node\Stmt -{ +class Unset_ extends Node\Stmt { /** @var Node\Expr[] Variables to unset */ - public $vars; + public array $vars; /** * Constructs an unset node. * - * @param Node\Expr[] $vars Variables to unset - * @param array $attributes Additional attributes + * @param Node\Expr[] $vars Variables to unset + * @param array $attributes Additional attributes */ public function __construct(array $vars, array $attributes = []) { $this->attributes = $attributes; $this->vars = $vars; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['vars']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Unset'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php index 32bd7847da..85830edc3b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/UseUse.php @@ -1,52 +1,3 @@ attributes = $attributes; - $this->type = $type; - $this->name = $name; - $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; - } - - public function getSubNodeNames() : array { - return ['type', 'name', 'alias']; - } - - /** - * Get alias. If not explicitly given this is the last component of the used name. - * - * @return Identifier - */ - public function getAlias() : Identifier { - if (null !== $this->alias) { - return $this->alias; - } - - return new Identifier($this->name->getLast()); - } - - public function getType() : string { - return 'Stmt_UseUse'; - } -} +require __DIR__ . '/../UseItem.php'; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php index 8753da313d..5b2d864832 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Use_.php @@ -3,33 +3,33 @@ namespace PhpParser\Node\Stmt; use PhpParser\Node\Stmt; +use PhpParser\Node\UseItem; -class Use_ extends Stmt -{ +class Use_ extends Stmt { /** * Unknown type. Both Stmt\Use_ / Stmt\GroupUse and Stmt\UseUse have a $type property, one of them will always be * TYPE_UNKNOWN while the other has one of the three other possible types. For normal use statements the type on the * Stmt\UseUse is unknown. It's only the other way around for mixed group use declarations. */ - const TYPE_UNKNOWN = 0; + public const TYPE_UNKNOWN = 0; /** Class or namespace import */ - const TYPE_NORMAL = 1; + public const TYPE_NORMAL = 1; /** Function import */ - const TYPE_FUNCTION = 2; + public const TYPE_FUNCTION = 2; /** Constant import */ - const TYPE_CONSTANT = 3; + public const TYPE_CONSTANT = 3; - /** @var int Type of alias */ - public $type; - /** @var UseUse[] Aliases */ - public $uses; + /** @var self::TYPE_* Type of alias */ + public int $type; + /** @var UseItem[] Aliases */ + public array $uses; /** * Constructs an alias (use) list node. * - * @param UseUse[] $uses Aliases - * @param int $type Type of alias - * @param array $attributes Additional attributes + * @param UseItem[] $uses Aliases + * @param Stmt\Use_::TYPE_* $type Type of alias + * @param array $attributes Additional attributes */ public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = []) { $this->attributes = $attributes; @@ -37,11 +37,11 @@ public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $a $this->uses = $uses; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['type', 'uses']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_Use'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php index f41034f8c2..2f7aed2343 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/While_.php @@ -4,19 +4,18 @@ use PhpParser\Node; -class While_ extends Node\Stmt -{ +class While_ extends Node\Stmt { /** @var Node\Expr Condition */ - public $cond; + public Node\Expr $cond; /** @var Node\Stmt[] Statements */ - public $stmts; + public array $stmts; /** * Constructs a while node. * - * @param Node\Expr $cond Condition - * @param Node\Stmt[] $stmts Statements - * @param array $attributes Additional attributes + * @param Node\Expr $cond Condition + * @param Node\Stmt[] $stmts Statements + * @param array $attributes Additional attributes */ public function __construct(Node\Expr $cond, array $stmts = [], array $attributes = []) { $this->attributes = $attributes; @@ -24,11 +23,11 @@ public function __construct(Node\Expr $cond, array $stmts = [], array $attribute $this->stmts = $stmts; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['cond', 'stmts']; } - - public function getType() : string { + + public function getType(): string { return 'Stmt_While'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php index 93cecd2382..bad88d2b8b 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php @@ -2,27 +2,26 @@ namespace PhpParser\Node; -class UnionType extends ComplexType -{ +class UnionType extends ComplexType { /** @var (Identifier|Name|IntersectionType)[] Types */ - public $types; + public array $types; /** * Constructs a union type. * - * @param (Identifier|Name|IntersectionType)[] $types Types - * @param array $attributes Additional attributes + * @param (Identifier|Name|IntersectionType)[] $types Types + * @param array $attributes Additional attributes */ public function __construct(array $types, array $attributes = []) { $this->attributes = $attributes; $this->types = $types; } - public function getSubNodeNames() : array { + public function getSubNodeNames(): array { return ['types']; } - - public function getType() : string { + + public function getType(): string { return 'UnionType'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php new file mode 100644 index 0000000000..a7d9fc447c --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/UseItem.php @@ -0,0 +1,55 @@ + $attributes Additional attributes + */ + public function __construct(Node\Name $name, $alias = null, int $type = Use_::TYPE_UNKNOWN, array $attributes = []) { + $this->attributes = $attributes; + $this->type = $type; + $this->name = $name; + $this->alias = \is_string($alias) ? new Identifier($alias) : $alias; + } + + public function getSubNodeNames(): array { + return ['type', 'name', 'alias']; + } + + /** + * Get alias. If not explicitly given this is the last component of the used name. + */ + public function getAlias(): Identifier { + if (null !== $this->alias) { + return $this->alias; + } + + return new Identifier($this->name->getLast()); + } + + public function getType(): string { + return 'UseItem'; + } +} + +// @deprecated compatibility alias +class_alias(UseItem::class, Stmt\UseUse::class); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php index a30807a6d5..9baa6fe0bb 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/VarLikeIdentifier.php @@ -9,9 +9,8 @@ * Examples: Names in property declarations are formatted as variables. Names in static property * lookups are also formatted as variables. */ -class VarLikeIdentifier extends Identifier -{ - public function getType() : string { +class VarLikeIdentifier extends Identifier { + public function getType(): string { return 'VarLikeIdentifier'; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php b/api/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php index 403a24df2f..48c4f338c0 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php @@ -11,7 +11,7 @@ class VariadicPlaceholder extends NodeAbstract { /** * Create a variadic argument placeholder (first-class callable syntax). * - * @param array $attributes Additional attributes + * @param array $attributes Additional attributes */ public function __construct(array $attributes = []) { $this->attributes = $attributes; @@ -24,4 +24,4 @@ public function getType(): string { public function getSubNodeNames(): array { return []; } -} \ No newline at end of file +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php index 04514da116..a6a50aea0f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php @@ -2,14 +2,14 @@ namespace PhpParser; -abstract class NodeAbstract implements Node, \JsonSerializable -{ - protected $attributes; +abstract class NodeAbstract implements Node, \JsonSerializable { + /** @var array Attributes */ + protected array $attributes; /** * Creates a Node. * - * @param array $attributes Array of attributes + * @param array $attributes Array of attributes */ public function __construct(array $attributes = []) { $this->attributes = $attributes; @@ -19,8 +19,9 @@ public function __construct(array $attributes = []) { * Gets line the node started in (alias of getStartLine). * * @return int Start line (or -1 if not available) + * @phpstan-return -1|positive-int */ - public function getLine() : int { + public function getLine(): int { return $this->attributes['startLine'] ?? -1; } @@ -30,8 +31,9 @@ public function getLine() : int { * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default). * * @return int Start line (or -1 if not available) + * @phpstan-return -1|positive-int */ - public function getStartLine() : int { + public function getStartLine(): int { return $this->attributes['startLine'] ?? -1; } @@ -41,8 +43,9 @@ public function getStartLine() : int { * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default). * * @return int End line (or -1 if not available) + * @phpstan-return -1|positive-int */ - public function getEndLine() : int { + public function getEndLine(): int { return $this->attributes['endLine'] ?? -1; } @@ -55,7 +58,7 @@ public function getEndLine() : int { * * @return int Token start position (or -1 if not available) */ - public function getStartTokenPos() : int { + public function getStartTokenPos(): int { return $this->attributes['startTokenPos'] ?? -1; } @@ -68,7 +71,7 @@ public function getStartTokenPos() : int { * * @return int Token end position (or -1 if not available) */ - public function getEndTokenPos() : int { + public function getEndTokenPos(): int { return $this->attributes['endTokenPos'] ?? -1; } @@ -79,7 +82,7 @@ public function getEndTokenPos() : int { * * @return int File start position (or -1 if not available) */ - public function getStartFilePos() : int { + public function getStartFilePos(): int { return $this->attributes['startFilePos'] ?? -1; } @@ -90,7 +93,7 @@ public function getStartFilePos() : int { * * @return int File end position (or -1 if not available) */ - public function getEndFilePos() : int { + public function getEndFilePos(): int { return $this->attributes['endFilePos'] ?? -1; } @@ -101,7 +104,7 @@ public function getEndFilePos() : int { * * @return Comment[] */ - public function getComments() : array { + public function getComments(): array { return $this->attributes['comments'] ?? []; } @@ -110,7 +113,7 @@ public function getComments() : array { * * @return null|Comment\Doc Doc comment object or null */ - public function getDocComment() { + public function getDocComment(): ?Comment\Doc { $comments = $this->getComments(); for ($i = count($comments) - 1; $i >= 0; $i--) { $comment = $comments[$i]; @@ -129,7 +132,7 @@ public function getDocComment() { * * @param Comment\Doc $docComment Doc comment to set */ - public function setDocComment(Comment\Doc $docComment) { + public function setDocComment(Comment\Doc $docComment): void { $comments = $this->getComments(); for ($i = count($comments) - 1; $i >= 0; $i--) { if ($comments[$i] instanceof Comment\Doc) { @@ -145,11 +148,11 @@ public function setDocComment(Comment\Doc $docComment) { $this->setAttribute('comments', $comments); } - public function setAttribute(string $key, $value) { + public function setAttribute(string $key, $value): void { $this->attributes[$key] = $value; } - public function hasAttribute(string $key) : bool { + public function hasAttribute(string $key): bool { return array_key_exists($key, $this->attributes); } @@ -161,18 +164,18 @@ public function getAttribute(string $key, $default = null) { return $default; } - public function getAttributes() : array { + public function getAttributes(): array { return $this->attributes; } - public function setAttributes(array $attributes) { + public function setAttributes(array $attributes): void { $this->attributes = $attributes; } /** - * @return array + * @return array */ - public function jsonSerialize() : array { + public function jsonSerialize(): array { return ['nodeType' => $this->getType()] + get_object_vars($this); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php index ba622efd12..39ce86aa23 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php @@ -2,17 +2,33 @@ namespace PhpParser; +use PhpParser\Node\Expr\Array_; use PhpParser\Node\Expr\Include_; -use PhpParser\Node\Stmt\Class_; +use PhpParser\Node\Expr\List_; +use PhpParser\Node\Scalar\Int_; +use PhpParser\Node\Scalar\InterpolatedString; +use PhpParser\Node\Scalar\String_; use PhpParser\Node\Stmt\GroupUse; use PhpParser\Node\Stmt\Use_; -use PhpParser\Node\Stmt\UseUse; +use PhpParser\Node\UseItem; -class NodeDumper -{ - private $dumpComments; - private $dumpPositions; - private $code; +class NodeDumper { + private bool $dumpComments; + private bool $dumpPositions; + private bool $dumpOtherAttributes; + private ?string $code; + private string $res; + private string $nl; + + private const IGNORE_ATTRIBUTES = [ + 'comments' => true, + 'startLine' => true, + 'endLine' => true, + 'startFilePos' => true, + 'endFilePos' => true, + 'startTokenPos' => true, + 'endTokenPos' => true, + ]; /** * Constructs a NodeDumper. @@ -21,150 +37,227 @@ class NodeDumper * * bool dumpComments: Whether comments should be dumped. * * bool dumpPositions: Whether line/offset information should be dumped. To dump offset * information, the code needs to be passed to dump(). + * * bool dumpOtherAttributes: Whether non-comment, non-position attributes should be dumped. * * @param array $options Options (see description) */ public function __construct(array $options = []) { $this->dumpComments = !empty($options['dumpComments']); $this->dumpPositions = !empty($options['dumpPositions']); + $this->dumpOtherAttributes = !empty($options['dumpOtherAttributes']); } /** * Dumps a node or array. * - * @param array|Node $node Node or array to dump + * @param array|Node $node Node or array to dump * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if * the dumpPositions option is enabled and the dumping of node offsets * is desired. * * @return string Dumped value */ - public function dump($node, string $code = null) : string { + public function dump($node, ?string $code = null): string { $this->code = $code; - return $this->dumpRecursive($node); + $this->res = ''; + $this->nl = "\n"; + $this->dumpRecursive($node, false); + return $this->res; } - protected function dumpRecursive($node) { + /** @param mixed $node */ + protected function dumpRecursive($node, bool $indent = true): void { + if ($indent) { + $this->nl .= " "; + } if ($node instanceof Node) { - $r = $node->getType(); + $this->res .= $node->getType(); if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) { - $r .= $p; + $this->res .= $p; } - $r .= '('; + $this->res .= '('; foreach ($node->getSubNodeNames() as $key) { - $r .= "\n " . $key . ': '; + $this->res .= "$this->nl " . $key . ': '; $value = $node->$key; - if (null === $value) { - $r .= 'null'; - } elseif (false === $value) { - $r .= 'false'; - } elseif (true === $value) { - $r .= 'true'; - } elseif (is_scalar($value)) { + if (\is_int($value)) { if ('flags' === $key || 'newModifier' === $key) { - $r .= $this->dumpFlags($value); - } elseif ('type' === $key && $node instanceof Include_) { - $r .= $this->dumpIncludeType($value); - } elseif ('type' === $key - && ($node instanceof Use_ || $node instanceof UseUse || $node instanceof GroupUse)) { - $r .= $this->dumpUseType($value); - } else { - $r .= $value; + $this->res .= $this->dumpFlags($value); + continue; + } + if ('type' === $key && $node instanceof Include_) { + $this->res .= $this->dumpIncludeType($value); + continue; + } + if ('type' === $key + && ($node instanceof Use_ || $node instanceof UseItem || $node instanceof GroupUse)) { + $this->res .= $this->dumpUseType($value); + continue; } - } else { - $r .= str_replace("\n", "\n ", $this->dumpRecursive($value)); } + $this->dumpRecursive($value); } if ($this->dumpComments && $comments = $node->getComments()) { - $r .= "\n comments: " . str_replace("\n", "\n ", $this->dumpRecursive($comments)); + $this->res .= "$this->nl comments: "; + $this->dumpRecursive($comments); } - } elseif (is_array($node)) { - $r = 'array('; - foreach ($node as $key => $value) { - $r .= "\n " . $key . ': '; - - if (null === $value) { - $r .= 'null'; - } elseif (false === $value) { - $r .= 'false'; - } elseif (true === $value) { - $r .= 'true'; - } elseif (is_scalar($value)) { - $r .= $value; - } else { - $r .= str_replace("\n", "\n ", $this->dumpRecursive($value)); + if ($this->dumpOtherAttributes) { + foreach ($node->getAttributes() as $key => $value) { + if (isset(self::IGNORE_ATTRIBUTES[$key])) { + continue; + } + + $this->res .= "$this->nl $key: "; + if (\is_int($value)) { + if ('kind' === $key) { + if ($node instanceof Int_) { + $this->res .= $this->dumpIntKind($value); + continue; + } + if ($node instanceof String_ || $node instanceof InterpolatedString) { + $this->res .= $this->dumpStringKind($value); + continue; + } + if ($node instanceof Array_) { + $this->res .= $this->dumpArrayKind($value); + continue; + } + if ($node instanceof List_) { + $this->res .= $this->dumpListKind($value); + continue; + } + } + } + $this->dumpRecursive($value); } } + $this->res .= "$this->nl)"; + } elseif (\is_array($node)) { + $this->res .= 'array('; + foreach ($node as $key => $value) { + $this->res .= "$this->nl " . $key . ': '; + $this->dumpRecursive($value); + } + $this->res .= "$this->nl)"; } elseif ($node instanceof Comment) { - return $node->getReformattedText(); + $this->res .= \str_replace("\n", $this->nl, $node->getReformattedText()); + } elseif (\is_string($node)) { + $this->res .= \str_replace("\n", $this->nl, (string)$node); + } elseif (\is_int($node) || \is_float($node)) { + $this->res .= $node; + } elseif (null === $node) { + $this->res .= 'null'; + } elseif (false === $node) { + $this->res .= 'false'; + } elseif (true === $node) { + $this->res .= 'true'; } else { throw new \InvalidArgumentException('Can only dump nodes and arrays.'); } - - return $r . "\n)"; + if ($indent) { + $this->nl = \substr($this->nl, 0, -4); + } } - protected function dumpFlags($flags) { + protected function dumpFlags(int $flags): string { $strs = []; - if ($flags & Class_::MODIFIER_PUBLIC) { - $strs[] = 'MODIFIER_PUBLIC'; + if ($flags & Modifiers::PUBLIC) { + $strs[] = 'PUBLIC'; + } + if ($flags & Modifiers::PROTECTED) { + $strs[] = 'PROTECTED'; + } + if ($flags & Modifiers::PRIVATE) { + $strs[] = 'PRIVATE'; } - if ($flags & Class_::MODIFIER_PROTECTED) { - $strs[] = 'MODIFIER_PROTECTED'; + if ($flags & Modifiers::ABSTRACT) { + $strs[] = 'ABSTRACT'; } - if ($flags & Class_::MODIFIER_PRIVATE) { - $strs[] = 'MODIFIER_PRIVATE'; + if ($flags & Modifiers::STATIC) { + $strs[] = 'STATIC'; } - if ($flags & Class_::MODIFIER_ABSTRACT) { - $strs[] = 'MODIFIER_ABSTRACT'; + if ($flags & Modifiers::FINAL) { + $strs[] = 'FINAL'; } - if ($flags & Class_::MODIFIER_STATIC) { - $strs[] = 'MODIFIER_STATIC'; + if ($flags & Modifiers::READONLY) { + $strs[] = 'READONLY'; } - if ($flags & Class_::MODIFIER_FINAL) { - $strs[] = 'MODIFIER_FINAL'; + if ($flags & Modifiers::PUBLIC_SET) { + $strs[] = 'PUBLIC_SET'; } - if ($flags & Class_::MODIFIER_READONLY) { - $strs[] = 'MODIFIER_READONLY'; + if ($flags & Modifiers::PROTECTED_SET) { + $strs[] = 'PROTECTED_SET'; + } + if ($flags & Modifiers::PRIVATE_SET) { + $strs[] = 'PRIVATE_SET'; } if ($strs) { return implode(' | ', $strs) . ' (' . $flags . ')'; } else { - return $flags; + return (string) $flags; + } + } + + /** @param array $map */ + private function dumpEnum(int $value, array $map): string { + if (!isset($map[$value])) { + return (string) $value; } + return $map[$value] . ' (' . $value . ')'; } - protected function dumpIncludeType($type) { - $map = [ + private function dumpIncludeType(int $type): string { + return $this->dumpEnum($type, [ Include_::TYPE_INCLUDE => 'TYPE_INCLUDE', Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE', Include_::TYPE_REQUIRE => 'TYPE_REQUIRE', Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE', - ]; - - if (!isset($map[$type])) { - return $type; - } - return $map[$type] . ' (' . $type . ')'; + ]); } - protected function dumpUseType($type) { - $map = [ + private function dumpUseType(int $type): string { + return $this->dumpEnum($type, [ Use_::TYPE_UNKNOWN => 'TYPE_UNKNOWN', Use_::TYPE_NORMAL => 'TYPE_NORMAL', Use_::TYPE_FUNCTION => 'TYPE_FUNCTION', Use_::TYPE_CONSTANT => 'TYPE_CONSTANT', - ]; + ]); + } - if (!isset($map[$type])) { - return $type; - } - return $map[$type] . ' (' . $type . ')'; + private function dumpIntKind(int $kind): string { + return $this->dumpEnum($kind, [ + Int_::KIND_BIN => 'KIND_BIN', + Int_::KIND_OCT => 'KIND_OCT', + Int_::KIND_DEC => 'KIND_DEC', + Int_::KIND_HEX => 'KIND_HEX', + ]); + } + + private function dumpStringKind(int $kind): string { + return $this->dumpEnum($kind, [ + String_::KIND_SINGLE_QUOTED => 'KIND_SINGLE_QUOTED', + String_::KIND_DOUBLE_QUOTED => 'KIND_DOUBLE_QUOTED', + String_::KIND_HEREDOC => 'KIND_HEREDOC', + String_::KIND_NOWDOC => 'KIND_NOWDOC', + ]); + } + + private function dumpArrayKind(int $kind): string { + return $this->dumpEnum($kind, [ + Array_::KIND_LONG => 'KIND_LONG', + Array_::KIND_SHORT => 'KIND_SHORT', + ]); + } + + private function dumpListKind(int $kind): string { + return $this->dumpEnum($kind, [ + List_::KIND_LIST => 'KIND_LIST', + List_::KIND_ARRAY => 'KIND_ARRAY', + ]); } /** @@ -174,7 +267,7 @@ protected function dumpUseType($type) { * * @return string|null Dump of position, or null if position information not available */ - protected function dumpPosition(Node $node) { + protected function dumpPosition(Node $node): ?string { if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) { return null; } @@ -191,7 +284,7 @@ protected function dumpPosition(Node $node) { } // Copied from Error class - private function toColumn($code, $pos) { + private function toColumn(string $code, int $pos): int { if ($pos > strlen($code)) { throw new \RuntimeException('Invalid position information'); } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php index 2e7cfdad4d..96c8452633 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeFinder.php @@ -5,25 +5,27 @@ use PhpParser\NodeVisitor\FindingVisitor; use PhpParser\NodeVisitor\FirstFindingVisitor; -class NodeFinder -{ +class NodeFinder { /** * Find all nodes satisfying a filter callback. * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param callable $filter Filter callback: function(Node $node) : bool + * @param Node|Node[] $nodes Single node or array of nodes to search in + * @param callable $filter Filter callback: function(Node $node) : bool * * @return Node[] Found nodes satisfying the filter callback */ - public function find($nodes, callable $filter) : array { + public function find($nodes, callable $filter): array { + if ($nodes === []) { + return []; + } + if (!is_array($nodes)) { $nodes = [$nodes]; } $visitor = new FindingVisitor($filter); - $traverser = new NodeTraverser; - $traverser->addVisitor($visitor); + $traverser = new NodeTraverser($visitor); $traverser->traverse($nodes); return $visitor->getFoundNodes(); @@ -31,13 +33,15 @@ public function find($nodes, callable $filter) : array { /** * Find all nodes that are instances of a certain class. + + * @template TNode as Node * * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param string $class Class name + * @param class-string $class Class name * - * @return Node[] Found nodes (all instances of $class) + * @return TNode[] Found nodes (all instances of $class) */ - public function findInstanceOf($nodes, string $class) : array { + public function findInstanceOf($nodes, string $class): array { return $this->find($nodes, function ($node) use ($class) { return $node instanceof $class; }); @@ -46,20 +50,23 @@ public function findInstanceOf($nodes, string $class) : array { /** * Find first node satisfying a filter callback. * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param callable $filter Filter callback: function(Node $node) : bool + * @param Node|Node[] $nodes Single node or array of nodes to search in + * @param callable $filter Filter callback: function(Node $node) : bool * * @return null|Node Found node (or null if none found) */ - public function findFirst($nodes, callable $filter) { + public function findFirst($nodes, callable $filter): ?Node { + if ($nodes === []) { + return null; + } + if (!is_array($nodes)) { $nodes = [$nodes]; } $visitor = new FirstFindingVisitor($filter); - $traverser = new NodeTraverser; - $traverser->addVisitor($visitor); + $traverser = new NodeTraverser($visitor); $traverser->traverse($nodes); return $visitor->getFoundNode(); @@ -68,12 +75,14 @@ public function findFirst($nodes, callable $filter) { /** * Find first node that is an instance of a certain class. * - * @param Node|Node[] $nodes Single node or array of nodes to search in - * @param string $class Class name + * @template TNode as Node + * + * @param Node|Node[] $nodes Single node or array of nodes to search in + * @param class-string $class Class name * - * @return null|Node Found node, which is an instance of $class (or null if none found) + * @return null|TNode Found node, which is an instance of $class (or null if none found) */ - public function findFirstInstanceOf($nodes, string $class) { + public function findFirstInstanceOf($nodes, string $class): ?Node { return $this->findFirst($nodes, function ($node) use ($class) { return $node instanceof $class; }); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php index 97d45bdaaa..f5b868a1f8 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php @@ -2,51 +2,40 @@ namespace PhpParser; -class NodeTraverser implements NodeTraverserInterface -{ +class NodeTraverser implements NodeTraverserInterface { /** - * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes - * of the current node will not be traversed for any visitors. - * - * For subsequent visitors enterNode() will still be called on the current - * node and leaveNode() will also be invoked for the current node. + * @deprecated Use NodeVisitor::DONT_TRAVERSE_CHILDREN instead. */ - const DONT_TRAVERSE_CHILDREN = 1; + public const DONT_TRAVERSE_CHILDREN = NodeVisitor::DONT_TRAVERSE_CHILDREN; /** - * If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns - * STOP_TRAVERSAL, traversal is aborted. - * - * The afterTraverse() method will still be invoked. + * @deprecated Use NodeVisitor::STOP_TRAVERSAL instead. */ - const STOP_TRAVERSAL = 2; + public const STOP_TRAVERSAL = NodeVisitor::STOP_TRAVERSAL; /** - * If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs - * in an array, it will be removed from the array. - * - * For subsequent visitors leaveNode() will still be invoked for the - * removed node. + * @deprecated Use NodeVisitor::REMOVE_NODE instead. */ - const REMOVE_NODE = 3; + public const REMOVE_NODE = NodeVisitor::REMOVE_NODE; /** - * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CURRENT_AND_CHILDREN, child nodes - * of the current node will not be traversed for any visitors. - * - * For subsequent visitors enterNode() will not be called as well. - * leaveNode() will be invoked for visitors that has enterNode() method invoked. + * @deprecated Use NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN instead. */ - const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4; + public const DONT_TRAVERSE_CURRENT_AND_CHILDREN = NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN; - /** @var NodeVisitor[] Visitors */ - protected $visitors = []; + /** @var list Visitors */ + protected array $visitors = []; /** @var bool Whether traversal should be stopped */ - protected $stopTraversal; + protected bool $stopTraversal; - public function __construct() { - // for BC + /** + * Create a traverser with the given visitors. + * + * @param NodeVisitor ...$visitors Node visitors + */ + public function __construct(NodeVisitor ...$visitors) { + $this->visitors = $visitors; } /** @@ -54,21 +43,17 @@ public function __construct() { * * @param NodeVisitor $visitor Visitor to add */ - public function addVisitor(NodeVisitor $visitor) { + public function addVisitor(NodeVisitor $visitor): void { $this->visitors[] = $visitor; } /** * Removes an added visitor. - * - * @param NodeVisitor $visitor */ - public function removeVisitor(NodeVisitor $visitor) { - foreach ($this->visitors as $index => $storedVisitor) { - if ($storedVisitor === $visitor) { - unset($this->visitors[$index]); - break; - } + public function removeVisitor(NodeVisitor $visitor): void { + $index = array_search($visitor, $this->visitors); + if ($index !== false) { + array_splice($this->visitors, $index, 1, []); } } @@ -79,7 +64,7 @@ public function removeVisitor(NodeVisitor $visitor) { * * @return Node[] Traversed array of nodes */ - public function traverse(array $nodes) : array { + public function traverse(array $nodes): array { $this->stopTraversal = false; foreach ($this->visitors as $visitor) { @@ -90,7 +75,8 @@ public function traverse(array $nodes) : array { $nodes = $this->traverseArray($nodes); - foreach ($this->visitors as $visitor) { + for ($i = \count($this->visitors) - 1; $i >= 0; --$i) { + $visitor = $this->visitors[$i]; if (null !== $return = $visitor->afterTraverse($nodes)) { $nodes = $return; } @@ -103,37 +89,37 @@ public function traverse(array $nodes) : array { * Recursively traverse a node. * * @param Node $node Node to traverse. - * - * @return Node Result of traversal (may be original node or new one) */ - protected function traverseNode(Node $node) : Node { + protected function traverseNode(Node $node): void { foreach ($node->getSubNodeNames() as $name) { - $subNode =& $node->$name; + $subNode = $node->$name; if (\is_array($subNode)) { - $subNode = $this->traverseArray($subNode); + $node->$name = $this->traverseArray($subNode); if ($this->stopTraversal) { break; } } elseif ($subNode instanceof Node) { $traverseChildren = true; - $breakVisitorIndex = null; + $visitorIndex = -1; foreach ($this->visitors as $visitorIndex => $visitor) { $return = $visitor->enterNode($subNode); if (null !== $return) { if ($return instanceof Node) { $this->ensureReplacementReasonable($subNode, $return); - $subNode = $return; - } elseif (self::DONT_TRAVERSE_CHILDREN === $return) { + $subNode = $node->$name = $return; + } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { $traverseChildren = false; - } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { + } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { $traverseChildren = false; - $breakVisitorIndex = $visitorIndex; break; - } elseif (self::STOP_TRAVERSAL === $return) { + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { $this->stopTraversal = true; break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + $node->$name = null; + continue 2; } else { throw new \LogicException( 'enterNode() returned invalid value of type ' . gettype($return) @@ -143,22 +129,26 @@ protected function traverseNode(Node $node) : Node { } if ($traverseChildren) { - $subNode = $this->traverseNode($subNode); + $this->traverseNode($subNode); if ($this->stopTraversal) { break; } } - foreach ($this->visitors as $visitorIndex => $visitor) { + for (; $visitorIndex >= 0; --$visitorIndex) { + $visitor = $this->visitors[$visitorIndex]; $return = $visitor->leaveNode($subNode); if (null !== $return) { if ($return instanceof Node) { $this->ensureReplacementReasonable($subNode, $return); - $subNode = $return; - } elseif (self::STOP_TRAVERSAL === $return) { + $subNode = $node->$name = $return; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { $this->stopTraversal = true; break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + $node->$name = null; + break; } elseif (\is_array($return)) { throw new \LogicException( 'leaveNode() may only return an array ' . @@ -170,15 +160,9 @@ protected function traverseNode(Node $node) : Node { ); } } - - if ($breakVisitorIndex === $visitorIndex) { - break; - } } } } - - return $node; } /** @@ -188,29 +172,37 @@ protected function traverseNode(Node $node) : Node { * * @return array Result of traversal (may be original array or changed one) */ - protected function traverseArray(array $nodes) : array { + protected function traverseArray(array $nodes): array { $doNodes = []; - foreach ($nodes as $i => &$node) { + foreach ($nodes as $i => $node) { if ($node instanceof Node) { $traverseChildren = true; - $breakVisitorIndex = null; + $visitorIndex = -1; foreach ($this->visitors as $visitorIndex => $visitor) { $return = $visitor->enterNode($node); if (null !== $return) { if ($return instanceof Node) { $this->ensureReplacementReasonable($node, $return); - $node = $return; - } elseif (self::DONT_TRAVERSE_CHILDREN === $return) { + $nodes[$i] = $node = $return; + } elseif (\is_array($return)) { + $doNodes[] = [$i, $return]; + continue 2; + } elseif (NodeVisitor::REMOVE_NODE === $return) { + $doNodes[] = [$i, []]; + continue 2; + } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { $traverseChildren = false; - } elseif (self::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { + } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { $traverseChildren = false; - $breakVisitorIndex = $visitorIndex; break; - } elseif (self::STOP_TRAVERSAL === $return) { + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { $this->stopTraversal = true; break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + throw new \LogicException( + 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); } else { throw new \LogicException( 'enterNode() returned invalid value of type ' . gettype($return) @@ -220,43 +212,38 @@ protected function traverseArray(array $nodes) : array { } if ($traverseChildren) { - $node = $this->traverseNode($node); + $this->traverseNode($node); if ($this->stopTraversal) { break; } } - foreach ($this->visitors as $visitorIndex => $visitor) { + for (; $visitorIndex >= 0; --$visitorIndex) { + $visitor = $this->visitors[$visitorIndex]; $return = $visitor->leaveNode($node); if (null !== $return) { if ($return instanceof Node) { $this->ensureReplacementReasonable($node, $return); - $node = $return; + $nodes[$i] = $node = $return; } elseif (\is_array($return)) { $doNodes[] = [$i, $return]; break; - } elseif (self::REMOVE_NODE === $return) { + } elseif (NodeVisitor::REMOVE_NODE === $return) { $doNodes[] = [$i, []]; break; - } elseif (self::STOP_TRAVERSAL === $return) { + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { $this->stopTraversal = true; break 2; - } elseif (false === $return) { + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { throw new \LogicException( - 'bool(false) return from leaveNode() no longer supported. ' . - 'Return NodeTraverser::REMOVE_NODE instead' - ); + 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); } else { throw new \LogicException( 'leaveNode() returned invalid value of type ' . gettype($return) ); } } - - if ($breakVisitorIndex === $visitorIndex) { - break; - } } } elseif (\is_array($node)) { throw new \LogicException('Invalid node structure: Contains nested arrays'); @@ -272,7 +259,7 @@ protected function traverseArray(array $nodes) : array { return $nodes; } - private function ensureReplacementReasonable($old, $new) { + private function ensureReplacementReasonable(Node $old, Node $new): void { if ($old instanceof Node\Stmt && $new instanceof Node\Expr) { throw new \LogicException( "Trying to replace statement ({$old->getType()}) " . diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php index 77ff3d27f6..c3992b3dc4 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeTraverserInterface.php @@ -2,21 +2,18 @@ namespace PhpParser; -interface NodeTraverserInterface -{ +interface NodeTraverserInterface { /** * Adds a visitor. * * @param NodeVisitor $visitor Visitor to add */ - public function addVisitor(NodeVisitor $visitor); + public function addVisitor(NodeVisitor $visitor): void; /** * Removes an added visitor. - * - * @param NodeVisitor $visitor */ - public function removeVisitor(NodeVisitor $visitor); + public function removeVisitor(NodeVisitor $visitor): void; /** * Traverses an array of nodes using the registered visitors. @@ -25,5 +22,5 @@ public function removeVisitor(NodeVisitor $visitor); * * @return Node[] Traversed array of nodes */ - public function traverse(array $nodes) : array; + public function traverse(array $nodes): array; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php index f1f7f3e3e3..0ec4f7beb2 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php @@ -2,8 +2,49 @@ namespace PhpParser; -interface NodeVisitor -{ +interface NodeVisitor { + /** + * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes + * of the current node will not be traversed for any visitors. + * + * For subsequent visitors enterNode() will still be called on the current + * node and leaveNode() will also be invoked for the current node. + */ + public const DONT_TRAVERSE_CHILDREN = 1; + + /** + * If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns + * STOP_TRAVERSAL, traversal is aborted. + * + * The afterTraverse() method will still be invoked. + */ + public const STOP_TRAVERSAL = 2; + + /** + * If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs + * in an array, it will be removed from the array. + * + * For subsequent visitors leaveNode() will still be invoked for the + * removed node. + */ + public const REMOVE_NODE = 3; + + /** + * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CURRENT_AND_CHILDREN, child nodes + * of the current node will not be traversed for any visitors. + * + * For subsequent visitors enterNode() will not be called as well. + * leaveNode() will be invoked for visitors that has enterNode() method invoked. + */ + public const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4; + + /** + * If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns REPLACE_WITH_NULL, + * the node will be replaced with null. This is not a legal return value if the node is part + * of an array, rather than another node. + */ + public const REPLACE_WITH_NULL = 5; + /** * Called once before traversal. * @@ -23,16 +64,25 @@ public function beforeTraverse(array $nodes); * Return value semantics: * * null * => $node stays as-is - * * NodeTraverser::DONT_TRAVERSE_CHILDREN + * * array (of Nodes) + * => The return value is merged into the parent array (at the position of the $node) + * * NodeVisitor::REMOVE_NODE + * => $node is removed from the parent array + * * NodeVisitor::REPLACE_WITH_NULL + * => $node is replaced with null + * * NodeVisitor::DONT_TRAVERSE_CHILDREN * => Children of $node are not traversed. $node stays as-is - * * NodeTraverser::STOP_TRAVERSAL + * * NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN + * => Further visitors for the current node are skipped, and its children are not + * traversed. $node stays as-is. + * * NodeVisitor::STOP_TRAVERSAL * => Traversal is aborted. $node stays as-is * * otherwise * => $node is set to the return value * * @param Node $node Node * - * @return null|int|Node Replacement node (or special return value) + * @return null|int|Node|Node[] Replacement node (or special return value) */ public function enterNode(Node $node); @@ -42,9 +92,11 @@ public function enterNode(Node $node); * Return value semantics: * * null * => $node stays as-is - * * NodeTraverser::REMOVE_NODE + * * NodeVisitor::REMOVE_NODE * => $node is removed from the parent array - * * NodeTraverser::STOP_TRAVERSAL + * * NodeVisitor::REPLACE_WITH_NULL + * => $node is replaced with null + * * NodeVisitor::STOP_TRAVERSAL * => Traversal is aborted. $node stays as-is * * array (of Nodes) * => The return value is merged into the parent array (at the position of the $node) diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php index a85fa493b0..cba924998a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CloningVisitor.php @@ -10,8 +10,7 @@ * * This visitor is required to perform format-preserving pretty prints. */ -class CloningVisitor extends NodeVisitorAbstract -{ +class CloningVisitor extends NodeVisitorAbstract { public function enterNode(Node $origNode) { $node = clone $origNode; $node->setAttribute('origNode', $origNode); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php new file mode 100644 index 0000000000..5e2aed313f --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php @@ -0,0 +1,82 @@ + Token positions of comments */ + private array $commentPositions = []; + + /** + * Create a comment annotation visitor. + * + * @param Token[] $tokens Token array + */ + public function __construct(array $tokens) { + $this->tokens = $tokens; + + // Collect positions of comments. We use this to avoid traversing parts of the AST where + // there are no comments. + foreach ($tokens as $i => $token) { + if ($token->id === \T_COMMENT || $token->id === \T_DOC_COMMENT) { + $this->commentPositions[] = $i; + } + } + } + + public function enterNode(Node $node) { + $nextCommentPos = current($this->commentPositions); + if ($nextCommentPos === false) { + // No more comments. + return self::STOP_TRAVERSAL; + } + + $oldPos = $this->pos; + $this->pos = $pos = $node->getStartTokenPos(); + if ($nextCommentPos > $oldPos && $nextCommentPos < $pos) { + $comments = []; + while (--$pos >= $oldPos) { + $token = $this->tokens[$pos]; + if ($token->id === \T_DOC_COMMENT) { + $comments[] = new Comment\Doc( + $token->text, $token->line, $token->pos, $pos, + $token->getEndLine(), $token->getEndPos() - 1, $pos); + continue; + } + if ($token->id === \T_COMMENT) { + $comments[] = new Comment( + $token->text, $token->line, $token->pos, $pos, + $token->getEndLine(), $token->getEndPos() - 1, $pos); + continue; + } + if ($token->id !== \T_WHITESPACE) { + break; + } + } + if (!empty($comments)) { + $node->setAttribute('comments', array_reverse($comments)); + } + + do { + $nextCommentPos = next($this->commentPositions); + } while ($nextCommentPos !== false && $nextCommentPos < $this->pos); + } + + $endPos = $node->getEndTokenPos(); + if ($nextCommentPos > $endPos) { + // Skip children if there are no comments located inside this node. + $this->pos = $endPos; + return self::DONT_TRAVERSE_CHILDREN; + } + + return null; + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php index 9531edbce7..1f3f4bae88 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FindingVisitor.php @@ -9,12 +9,11 @@ * This visitor can be used to find and collect all nodes satisfying some criterion determined by * a filter callback. */ -class FindingVisitor extends NodeVisitorAbstract -{ +class FindingVisitor extends NodeVisitorAbstract { /** @var callable Filter callback */ protected $filterCallback; /** @var Node[] Found nodes */ - protected $foundNodes; + protected array $foundNodes; public function __construct(callable $filterCallback) { $this->filterCallback = $filterCallback; @@ -27,11 +26,11 @@ public function __construct(callable $filterCallback) { * * @return Node[] Found nodes */ - public function getFoundNodes() : array { + public function getFoundNodes(): array { return $this->foundNodes; } - public function beforeTraverse(array $nodes) { + public function beforeTraverse(array $nodes): ?array { $this->foundNodes = []; return null; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php index 596a7d7fd5..05deed597a 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/FirstFindingVisitor.php @@ -3,19 +3,18 @@ namespace PhpParser\NodeVisitor; use PhpParser\Node; -use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; use PhpParser\NodeVisitorAbstract; /** * This visitor can be used to find the first node satisfying some criterion determined by * a filter callback. */ -class FirstFindingVisitor extends NodeVisitorAbstract -{ +class FirstFindingVisitor extends NodeVisitorAbstract { /** @var callable Filter callback */ protected $filterCallback; /** @var null|Node Found node */ - protected $foundNode; + protected ?Node $foundNode; public function __construct(callable $filterCallback) { $this->filterCallback = $filterCallback; @@ -28,11 +27,11 @@ public function __construct(callable $filterCallback) { * * @return null|Node Found node (or null if not found) */ - public function getFoundNode() { + public function getFoundNode(): ?Node { return $this->foundNode; } - public function beforeTraverse(array $nodes) { + public function beforeTraverse(array $nodes): ?array { $this->foundNode = null; return null; @@ -42,7 +41,7 @@ public function enterNode(Node $node) { $filterCallback = $this->filterCallback; if ($filterCallback($node)) { $this->foundNode = $node; - return NodeTraverser::STOP_TRAVERSAL; + return NodeVisitor::STOP_TRAVERSAL; } return null; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php index d0e7de02f5..99449c496f 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php @@ -11,16 +11,15 @@ use PhpParser\Node\Stmt; use PhpParser\NodeVisitorAbstract; -class NameResolver extends NodeVisitorAbstract -{ +class NameResolver extends NodeVisitorAbstract { /** @var NameContext Naming context */ - protected $nameContext; + protected NameContext $nameContext; /** @var bool Whether to preserve original names */ - protected $preserveOriginalNames; + protected bool $preserveOriginalNames; /** @var bool Whether to replace resolved nodes in place, or to add resolvedNode attributes */ - protected $replaceNodes; + protected bool $replaceNodes; /** * Constructs a name resolution visitor. @@ -33,24 +32,22 @@ class NameResolver extends NodeVisitorAbstract * namespacedName attribute, as usual.) * * @param ErrorHandler|null $errorHandler Error handler - * @param array $options Options + * @param array{preserveOriginalNames?: bool, replaceNodes?: bool} $options Options */ - public function __construct(ErrorHandler $errorHandler = null, array $options = []) { - $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing); + public function __construct(?ErrorHandler $errorHandler = null, array $options = []) { + $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\Throwing()); $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false; $this->replaceNodes = $options['replaceNodes'] ?? true; } /** * Get name resolution context. - * - * @return NameContext */ - public function getNameContext() : NameContext { + public function getNameContext(): NameContext { return $this->nameContext; } - public function beforeTraverse(array $nodes) { + public function beforeTraverse(array $nodes): ?array { $this->nameContext->startNamespace(); return null; } @@ -78,6 +75,8 @@ public function enterNode(Node $node) { $this->resolveAttrGroups($node); if (null !== $node->name) { $this->addNamespacedName($node); + } else { + $node->namespacedName = null; } } elseif ($node instanceof Stmt\Interface_) { foreach ($node->extends as &$interface) { @@ -86,15 +85,13 @@ public function enterNode(Node $node) { $this->resolveAttrGroups($node); $this->addNamespacedName($node); - } elseif ($node instanceof Stmt\Enum_) { + } elseif ($node instanceof Stmt\Enum_) { foreach ($node->implements as &$interface) { $interface = $this->resolveClassName($interface); } $this->resolveAttrGroups($node); - if (null !== $node->name) { - $this->addNamespacedName($node); - } + $this->addNamespacedName($node); } elseif ($node instanceof Stmt\Trait_) { $this->resolveAttrGroups($node); $this->addNamespacedName($node); @@ -113,13 +110,22 @@ public function enterNode(Node $node) { $node->type = $this->resolveType($node->type); } $this->resolveAttrGroups($node); + } elseif ($node instanceof Node\PropertyHook) { + foreach ($node->params as $param) { + $param->type = $this->resolveType($param->type); + $this->resolveAttrGroups($param); + } + $this->resolveAttrGroups($node); } elseif ($node instanceof Stmt\Const_) { foreach ($node->consts as $const) { $this->addNamespacedName($const); } - } else if ($node instanceof Stmt\ClassConst) { + } elseif ($node instanceof Stmt\ClassConst) { + if (null !== $node->type) { + $node->type = $this->resolveType($node->type); + } $this->resolveAttrGroups($node); - } else if ($node instanceof Stmt\EnumCase) { + } elseif ($node instanceof Stmt\EnumCase) { $this->resolveAttrGroups($node); } elseif ($node instanceof Expr\StaticCall || $node instanceof Expr\StaticPropertyFetch @@ -161,7 +167,8 @@ public function enterNode(Node $node) { return null; } - private function addAlias(Stmt\UseUse $use, int $type, Name $prefix = null) { + /** @param Stmt\Use_::TYPE_* $type */ + private function addAlias(Node\UseItem $use, int $type, ?Name $prefix = null): void { // Add prefix for group uses $name = $prefix ? Name::concat($prefix, $use->name) : $use->name; // Type is determined either by individual element or whole use declaration @@ -172,8 +179,8 @@ private function addAlias(Stmt\UseUse $use, int $type, Name $prefix = null) { ); } - /** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure $node */ - private function resolveSignature($node) { + /** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure|Expr\ArrowFunction $node */ + private function resolveSignature($node): void { foreach ($node->params as $param) { $param->type = $this->resolveType($param->type); $this->resolveAttrGroups($param); @@ -181,7 +188,12 @@ private function resolveSignature($node) { $node->returnType = $this->resolveType($node->returnType); } - private function resolveType($node) { + /** + * @template T of Node\Identifier|Name|Node\ComplexType|null + * @param T $node + * @return T + */ + private function resolveType(?Node $node): ?Node { if ($node instanceof Name) { return $this->resolveClassName($node); } @@ -202,11 +214,11 @@ private function resolveType($node) { * Resolve name, according to name resolver options. * * @param Name $name Function or constant name to resolve - * @param int $type One of Stmt\Use_::TYPE_* + * @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_* * * @return Name Resolved name, or original name with attribute */ - protected function resolveName(Name $name, int $type) : Name { + protected function resolveName(Name $name, int $type): Name { if (!$this->replaceNodes) { $resolvedName = $this->nameContext->getResolvedName($name, $type); if (null !== $resolvedName) { @@ -237,17 +249,16 @@ protected function resolveName(Name $name, int $type) : Name { return $name; } - protected function resolveClassName(Name $name) { + protected function resolveClassName(Name $name): Name { return $this->resolveName($name, Stmt\Use_::TYPE_NORMAL); } - protected function addNamespacedName(Node $node) { + protected function addNamespacedName(Node $node): void { $node->namespacedName = Name::concat( $this->nameContext->getNamespace(), (string) $node->name); } - protected function resolveAttrGroups(Node $node) - { + protected function resolveAttrGroups(Node $node): void { foreach ($node->attrGroups as $attrGroup) { foreach ($attrGroup->attrs as $attr) { $attr->name = $this->resolveClassName($attr->name); diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php index ea372e5b99..38fedfd506 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php @@ -14,12 +14,11 @@ * node can be accessed through $node->getAttribute('previous'), * and the next node can be accessed through $node->getAttribute('next'). */ -final class NodeConnectingVisitor extends NodeVisitorAbstract -{ +final class NodeConnectingVisitor extends NodeVisitorAbstract { /** * @var Node[] */ - private $stack = []; + private array $stack = []; /** * @var ?Node diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php index b98d2bfa6f..1e7e9e8be5 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php @@ -2,31 +2,29 @@ namespace PhpParser\NodeVisitor; -use function array_pop; -use function count; use PhpParser\Node; use PhpParser\NodeVisitorAbstract; +use function array_pop; +use function count; + /** * Visitor that connects a child node to its parent node. * * On the child node, the parent node can be accessed through * $node->getAttribute('parent'). */ -final class ParentConnectingVisitor extends NodeVisitorAbstract -{ +final class ParentConnectingVisitor extends NodeVisitorAbstract { /** * @var Node[] */ - private $stack = []; + private array $stack = []; - public function beforeTraverse(array $nodes) - { + public function beforeTraverse(array $nodes) { $this->stack = []; } - public function enterNode(Node $node) - { + public function enterNode(Node $node) { if (!empty($this->stack)) { $node->setAttribute('parent', $this->stack[count($this->stack) - 1]); } @@ -34,8 +32,7 @@ public function enterNode(Node $node) $this->stack[] = $node; } - public function leaveNode(Node $node) - { + public function leaveNode(Node $node) { array_pop($this->stack); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php index d378d67096..6fb15cca4d 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/NodeVisitorAbstract.php @@ -5,8 +5,7 @@ /** * @codeCoverageIgnore */ -class NodeVisitorAbstract implements NodeVisitor -{ +abstract class NodeVisitorAbstract implements NodeVisitor { public function beforeTraverse(array $nodes) { return null; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Parser.php b/api/vendor/nikic/php-parser/lib/PhpParser/Parser.php index 8956c76718..68954afea7 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Parser.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Parser.php @@ -2,8 +2,7 @@ namespace PhpParser; -interface Parser -{ +interface Parser { /** * Parses PHP code into a node tree. * @@ -14,5 +13,12 @@ interface Parser * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and * the parser was unable to recover from an error). */ - public function parse(string $code, ErrorHandler $errorHandler = null); + public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array; + + /** + * Return tokens for the last parse. + * + * @return Token[] + */ + public function getTokens(): array; } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php b/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php deleted file mode 100644 index 77fd1f3fbb..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Multiple.php +++ /dev/null @@ -1,55 +0,0 @@ -parsers = $parsers; - } - - public function parse(string $code, ErrorHandler $errorHandler = null) { - if (null === $errorHandler) { - $errorHandler = new ErrorHandler\Throwing; - } - - list($firstStmts, $firstError) = $this->tryParse($this->parsers[0], $errorHandler, $code); - if ($firstError === null) { - return $firstStmts; - } - - for ($i = 1, $c = count($this->parsers); $i < $c; ++$i) { - list($stmts, $error) = $this->tryParse($this->parsers[$i], $errorHandler, $code); - if ($error === null) { - return $stmts; - } - } - - throw $firstError; - } - - private function tryParse(Parser $parser, ErrorHandler $errorHandler, $code) { - $stmts = null; - $error = null; - try { - $stmts = $parser->parse($code, $errorHandler); - } catch (Error $error) {} - return [$stmts, $error]; - } -} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php b/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php deleted file mode 100644 index 351db9ed08..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +++ /dev/null @@ -1,2682 +0,0 @@ -'", - "T_IS_GREATER_OR_EQUAL", - "T_SL", - "T_SR", - "'+'", - "'-'", - "'.'", - "'*'", - "'/'", - "'%'", - "'!'", - "T_INSTANCEOF", - "'~'", - "T_INC", - "T_DEC", - "T_INT_CAST", - "T_DOUBLE_CAST", - "T_STRING_CAST", - "T_ARRAY_CAST", - "T_OBJECT_CAST", - "T_BOOL_CAST", - "T_UNSET_CAST", - "'@'", - "T_POW", - "'['", - "T_NEW", - "T_CLONE", - "T_EXIT", - "T_IF", - "T_ELSEIF", - "T_ELSE", - "T_ENDIF", - "T_LNUMBER", - "T_DNUMBER", - "T_STRING", - "T_STRING_VARNAME", - "T_VARIABLE", - "T_NUM_STRING", - "T_INLINE_HTML", - "T_ENCAPSED_AND_WHITESPACE", - "T_CONSTANT_ENCAPSED_STRING", - "T_ECHO", - "T_DO", - "T_WHILE", - "T_ENDWHILE", - "T_FOR", - "T_ENDFOR", - "T_FOREACH", - "T_ENDFOREACH", - "T_DECLARE", - "T_ENDDECLARE", - "T_AS", - "T_SWITCH", - "T_MATCH", - "T_ENDSWITCH", - "T_CASE", - "T_DEFAULT", - "T_BREAK", - "T_CONTINUE", - "T_GOTO", - "T_FUNCTION", - "T_FN", - "T_CONST", - "T_RETURN", - "T_TRY", - "T_CATCH", - "T_FINALLY", - "T_USE", - "T_INSTEADOF", - "T_GLOBAL", - "T_STATIC", - "T_ABSTRACT", - "T_FINAL", - "T_PRIVATE", - "T_PROTECTED", - "T_PUBLIC", - "T_READONLY", - "T_VAR", - "T_UNSET", - "T_ISSET", - "T_EMPTY", - "T_HALT_COMPILER", - "T_CLASS", - "T_TRAIT", - "T_INTERFACE", - "T_EXTENDS", - "T_IMPLEMENTS", - "T_OBJECT_OPERATOR", - "T_LIST", - "T_ARRAY", - "T_CALLABLE", - "T_CLASS_C", - "T_TRAIT_C", - "T_METHOD_C", - "T_FUNC_C", - "T_LINE", - "T_FILE", - "T_START_HEREDOC", - "T_END_HEREDOC", - "T_DOLLAR_OPEN_CURLY_BRACES", - "T_CURLY_OPEN", - "T_PAAMAYIM_NEKUDOTAYIM", - "T_NAMESPACE", - "T_NS_C", - "T_DIR", - "T_NS_SEPARATOR", - "T_ELLIPSIS", - "T_NAME_FULLY_QUALIFIED", - "T_NAME_QUALIFIED", - "T_NAME_RELATIVE", - "';'", - "'{'", - "'}'", - "'('", - "')'", - "'$'", - "'`'", - "']'", - "'\"'", - "T_ENUM", - "T_NULLSAFE_OBJECT_OPERATOR", - "T_ATTRIBUTE" - ); - - protected $tokenToSymbol = array( - 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 56, 164, 168, 161, 55, 168, 168, - 159, 160, 53, 50, 8, 51, 52, 54, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 31, 156, - 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 70, 168, 163, 36, 168, 162, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 157, 35, 158, 58, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, - 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, - 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 165, 131, - 132, 133, 166, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 167 - ); - - protected $action = array( - 700, 670, 671, 672, 673, 674, 286, 675, 676, 677, - 713, 714, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 0, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244,-32766,-32766,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, 245, 246, - 242, 243, 244,-32766,-32766, 678,-32766,-32766,-32766,-32766, - -32766,-32766,-32766,-32766,-32766, 1229, 245, 246, 1230, 679, - 680, 681, 682, 683, 684, 685, 899, 900, 747,-32766, - -32766,-32766,-32766,-32766,-32766, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 716, 739, 717, 718, - 719, 720, 708, 709, 710, 738, 711, 712, 697, 698, - 699, 701, 702, 703, 741, 742, 743, 744, 745, 746, - 875, 704, 705, 706, 707, 737, 728, 726, 727, 723, - 724, 1046, 715, 721, 722, 729, 730, 732, 731, 733, - 734, 55, 56, 425, 57, 58, 725, 736, 735, 755, - 59, 60, -226, 61,-32766,-32766,-32766,-32766,-32766,-32766, - -32766,-32766,-32766,-32766, 337,-32767,-32767,-32767,-32767, 29, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 620,-32766,-32766,-32766,-32766, 62, 63, - 1046,-32766,-32766,-32766, 64, 419, 65, 294, 295, 66, - 67, 68, 69, 70, 71, 72, 73, 823, 25, 302, - 74, 418, 984, 986, 669, 668, 1100, 1101, 1078, 755, - 755, 767, 1220, 768, 470,-32766,-32766,-32766, 341, 749, - 824, 54,-32767,-32767,-32767,-32767, 98, 99, 100, 101, - 102, 220, 221, 222, 362, 876,-32766, 27,-32766,-32766, - -32766,-32766,-32766, 1046, 493, 126, 1080, 1079, 1081, 370, - 1068, 930, 207, 478, 479, 952, 953, 954, 951, 950, - 949, 128, 480, 481, 803, 1106, 1107, 1108, 1109, 1103, - 1104, 319, 32, 297, 10, 211, -515, 1110, 1105, 669, - 668, 1080, 1079, 1081, 220, 221, 222, 41, 364, 341, - 334, 421, 336, 426, -128, -128, -128, 313, 1046, 469, - -4, 824, 54, 812, 770, 207, 40, 21, 427, -128, - 471, -128, 472, -128, 473, -128, 1046, 428, 220, 221, - 222,-32766, 33, 34, 429, 361, 327, 52, 35, 474, - -32766,-32766,-32766, 342, 357, 358, 475, 476, 48, 207, - 249, 669, 668, 477, 443, 300, 795, 846, 430, 431, - 28,-32766, 814,-32766,-32766,-32766,-32766,-32766,-32766,-32766, - -32767,-32767,-32767,-32767,-32767, 952, 953, 954, 951, 950, - 949, 422, 755, 424, 426, 826, 634, -128,-32766,-32766, - 469, 824, 54, 288, 812, 1151, 755, 40, 21, 427, - 317, 471, 345, 472, 129, 473, 9, 1186, 428, 769, - 360, 324, 905, 33, 34, 429, 361, 1046, 415, 35, - 474, 944, 1068, 315, 125, 357, 358, 475, 476,-32766, - -32766,-32766, 926, 302, 477, 121, 1068, 759, 846, 430, - 431, 669, 668, 423, 755, 1152, 809, 1046, 480, 766, - -32766, 805,-32766,-32766,-32766,-32766, -261, 127, 347, 436, - 841, 341, 1078, 1200, 426, 446, 826, 634, -4, 807, - 469, 824, 54, 436, 812, 341, 755, 40, 21, 427, - 444, 471, 130, 472, 1068, 473, 346, 767, 428, 768, - -211, -211, -211, 33, 34, 429, 361, 308, 1076, 35, - 474,-32766,-32766,-32766, 1046, 357, 358, 475, 476,-32766, - -32766,-32766, 906, 120, 477, 539, 1068, 795, 846, 430, - 431, 436,-32766, 341,-32766,-32766,-32766, 1046, 480, 810, - -32766, 925,-32766,-32766, 754, 1080, 1079, 1081, 49,-32766, - -32766,-32766, 749, 751, 426, 1201, 826, 634, -211, 30, - 469, 669, 668, 436, 812, 341, 75, 40, 21, 427, - -32766, 471, 1064, 472, 124, 473, 669, 668, 428, 212, - -210, -210, -210, 33, 34, 429, 361, 51, 1186, 35, - 474, 755,-32766,-32766,-32766, 357, 358, 475, 476, 213, - 824, 54, 221, 222, 477, 20, 581, 795, 846, 430, - 431, 220, 221, 222, 755, 222, 247, 78, 79, 80, - 81, 341, 207, 517, 103, 104, 105, 752, 307, 131, - 637, 1068, 207, 341, 207, 122, 826, 634, -210, 36, - 106, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 1112, 307, 346, 436, 214, - 341, 824, 54, 426, 123, 250, 129, 134, 106, 469, - -32766, 572, 1112, 812, 245, 246, 40, 21, 427, 251, - 471, 252, 472, 341, 473, 453, 22, 428, 207, 899, - 900, 638, 33, 34, 429, 824, 54, -86, 35, 474, - 220, 221, 222, 314, 357, 358, 100, 101, 102, 239, - 240, 241, 645, 477, -230, 458, 589, 135, 374, 596, - 597, 207, 760, 640, 648, 642, 941, 654, 929, 662, - 822, 133, 307, 837, 426,-32766, 106, 749, 43, 44, - 469, 45, 442, 46, 812, 826, 634, 40, 21, 427, - 47, 471, 50, 472, 53, 473, 132, 608, 428, 302, - 604, -280,-32766, 33, 34, 429, 824, 54, 426, 35, - 474, 755, 957, -84, 469, 357, 358, 521, 812, 628, - 363, 40, 21, 427, 477, 471, 575, 472, -515, 473, - 847, 616, 428, -423,-32766, 11, 646, 33, 34, 429, - 824, 54, 445, 35, 474, 462, 285, 578, 1111, 357, - 358, 593, 369, 848, 594, 290, 826, 634, 477, 0, - 0, 532, 0, 0, 325, 0, 0, 0, 0, 0, - 651, 0, 0, 0, 322, 326, 0, 0, 0, 426, - 0, 0, 0, 0, 323, 469, 316, 318, -516, 812, - 862, 634, 40, 21, 427, 0, 471, 0, 472, 0, - 473, 1158, 0, 428, 0, -414, 6, 7, 33, 34, - 429, 824, 54, 426, 35, 474, 12, 14, 373, 469, - 357, 358, -424, 812, 563, 754, 40, 21, 427, 477, - 471, 248, 472, 839, 473, 38, 39, 428, 657, 658, - 765, 813, 33, 34, 429, 821, 800, 815, 35, 474, - 215, 216, 878, 869, 357, 358, 217, 870, 218, 798, - 863, 826, 634, 477, 860, 858, 936, 937, 934, 820, - 209, 804, 806, 808, 811, 933, 763, 764, 1100, 1101, - 935, 659, 78, 335, 426, 359, 1102, 635, 639, 641, - 469, 643, 644, 647, 812, 826, 634, 40, 21, 427, - 649, 471, 650, 472, 652, 473, 653, 636, 428, 796, - 1226, 1228, 762, 33, 34, 429, 215, 216, 845, 35, - 474, 761, 217, 844, 218, 357, 358, 1227, 843, 1060, - 831, 1048, 842, 1049, 477, 559, 209, 1106, 1107, 1108, - 1109, 1103, 1104, 398, 1100, 1101, 829, 942, 867, 1110, - 1105, 868, 1102, 457, 1225, 1194, 1192, 1177, 1157, 219, - 1190, 1091, 917, 1198, 1188, 0, 826, 634, 24, -433, - 26, 31, 37, 42, 76, 77, 210, 287, 292, 293, - 308, 309, 310, 311, 339, 356, 416, 0, -227, -226, - 16, 17, 18, 393, 454, 461, 463, 467, 553, 625, - 1051, 559, 1054, 1106, 1107, 1108, 1109, 1103, 1104, 398, - 907, 1116, 1050, 1026, 564, 1110, 1105, 1025, 1093, 1055, - 0, 1044, 0, 1057, 1056, 219, 1059, 1058, 1075, 0, - 1191, 1176, 1172, 1189, 1090, 1223, 1117, 1171, 600 - ); - - protected $actionCheck = array( - 2, 3, 4, 5, 6, 7, 14, 9, 10, 11, - 12, 13, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 0, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 9, 10, 11, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 69, 70, - 53, 54, 55, 9, 10, 57, 30, 116, 32, 33, - 34, 35, 36, 37, 38, 80, 69, 70, 83, 71, - 72, 73, 74, 75, 76, 77, 135, 136, 80, 33, - 34, 35, 36, 37, 38, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 31, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 13, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 3, 4, 5, 6, 7, 148, 149, 150, 82, - 12, 13, 160, 15, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 8, 44, 45, 46, 47, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 80, 33, 34, 35, 36, 50, 51, - 13, 9, 10, 11, 56, 128, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 1, 70, 71, - 72, 73, 59, 60, 37, 38, 78, 79, 80, 82, - 82, 106, 85, 108, 86, 9, 10, 11, 161, 80, - 1, 2, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 9, 10, 11, 106, 156, 30, 8, 32, 33, - 34, 35, 36, 13, 116, 8, 153, 154, 155, 8, - 122, 158, 30, 125, 126, 116, 117, 118, 119, 120, - 121, 31, 134, 135, 156, 137, 138, 139, 140, 141, - 142, 143, 145, 146, 8, 8, 133, 149, 150, 37, - 38, 153, 154, 155, 9, 10, 11, 159, 8, 161, - 162, 8, 164, 74, 75, 76, 77, 8, 13, 80, - 0, 1, 2, 84, 158, 30, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 13, 98, 9, 10, - 11, 9, 103, 104, 105, 106, 8, 70, 109, 110, - 9, 10, 11, 8, 115, 116, 117, 118, 70, 30, - 31, 37, 38, 124, 31, 8, 127, 128, 129, 130, - 8, 30, 156, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 116, 117, 118, 119, 120, - 121, 8, 82, 8, 74, 156, 157, 158, 33, 34, - 80, 1, 2, 8, 84, 163, 82, 87, 88, 89, - 133, 91, 70, 93, 152, 95, 108, 82, 98, 158, - 8, 113, 160, 103, 104, 105, 106, 13, 108, 109, - 110, 123, 122, 113, 157, 115, 116, 117, 118, 9, - 10, 11, 156, 71, 124, 157, 122, 127, 128, 129, - 130, 37, 38, 8, 82, 160, 156, 13, 134, 156, - 30, 156, 32, 33, 34, 35, 158, 157, 148, 159, - 122, 161, 80, 1, 74, 133, 156, 157, 158, 156, - 80, 1, 2, 159, 84, 161, 82, 87, 88, 89, - 157, 91, 157, 93, 122, 95, 161, 106, 98, 108, - 100, 101, 102, 103, 104, 105, 106, 159, 116, 109, - 110, 9, 10, 11, 13, 115, 116, 117, 118, 9, - 10, 11, 160, 16, 124, 81, 122, 127, 128, 129, - 130, 159, 30, 161, 32, 33, 34, 13, 134, 156, - 30, 156, 32, 33, 153, 153, 154, 155, 70, 9, - 10, 11, 80, 80, 74, 160, 156, 157, 158, 14, - 80, 37, 38, 159, 84, 161, 152, 87, 88, 89, - 30, 91, 160, 93, 14, 95, 37, 38, 98, 16, - 100, 101, 102, 103, 104, 105, 106, 70, 82, 109, - 110, 82, 33, 34, 35, 115, 116, 117, 118, 16, - 1, 2, 10, 11, 124, 160, 85, 127, 128, 129, - 130, 9, 10, 11, 82, 11, 14, 157, 9, 10, - 11, 161, 30, 85, 53, 54, 55, 154, 57, 157, - 31, 122, 30, 161, 30, 157, 156, 157, 158, 30, - 69, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 144, 57, 161, 159, 16, - 161, 1, 2, 74, 157, 16, 152, 157, 69, 80, - 116, 161, 144, 84, 69, 70, 87, 88, 89, 16, - 91, 16, 93, 161, 95, 75, 76, 98, 30, 135, - 136, 31, 103, 104, 105, 1, 2, 31, 109, 110, - 9, 10, 11, 31, 115, 116, 50, 51, 52, 50, - 51, 52, 31, 124, 160, 75, 76, 101, 102, 111, - 112, 30, 156, 157, 31, 31, 156, 157, 156, 157, - 31, 31, 57, 38, 74, 33, 69, 80, 70, 70, - 80, 70, 89, 70, 84, 156, 157, 87, 88, 89, - 70, 91, 70, 93, 70, 95, 70, 96, 98, 71, - 77, 82, 85, 103, 104, 105, 1, 2, 74, 109, - 110, 82, 82, 97, 80, 115, 116, 85, 84, 92, - 106, 87, 88, 89, 124, 91, 90, 93, 133, 95, - 128, 94, 98, 147, 116, 97, 31, 103, 104, 105, - 1, 2, 97, 109, 110, 97, 97, 100, 144, 115, - 116, 100, 106, 128, 113, 161, 156, 157, 124, -1, - -1, 151, -1, -1, 114, -1, -1, -1, -1, -1, - 31, -1, -1, -1, 131, 131, -1, -1, -1, 74, - -1, -1, -1, -1, 132, 80, 133, 133, 133, 84, - 156, 157, 87, 88, 89, -1, 91, -1, 93, -1, - 95, 144, -1, 98, -1, 147, 147, 147, 103, 104, - 105, 1, 2, 74, 109, 110, 147, 147, 147, 80, - 115, 116, 147, 84, 151, 153, 87, 88, 89, 124, - 91, 31, 93, 152, 95, 156, 156, 98, 156, 156, - 156, 156, 103, 104, 105, 156, 156, 156, 109, 110, - 50, 51, 156, 156, 115, 116, 56, 156, 58, 156, - 156, 156, 157, 124, 156, 156, 156, 156, 156, 156, - 70, 156, 156, 156, 156, 156, 156, 156, 78, 79, - 156, 158, 157, 157, 74, 157, 86, 157, 157, 157, - 80, 157, 157, 157, 84, 156, 157, 87, 88, 89, - 157, 91, 157, 93, 157, 95, 157, 157, 98, 158, - 158, 158, 158, 103, 104, 105, 50, 51, 158, 109, - 110, 158, 56, 158, 58, 115, 116, 158, 158, 158, - 158, 158, 158, 158, 124, 135, 70, 137, 138, 139, - 140, 141, 142, 143, 78, 79, 158, 158, 158, 149, - 150, 158, 86, 158, 158, 158, 158, 158, 164, 159, - 158, 158, 158, 158, 158, -1, 156, 157, 159, 162, - 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, - 159, 159, 159, 159, 159, 159, 159, -1, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 135, 160, 137, 138, 139, 140, 141, 142, 143, - 160, 160, 160, 160, 160, 149, 150, 160, 160, 163, - -1, 162, -1, 163, 163, 159, 163, 163, 163, -1, - 163, 163, 163, 163, 163, 163, 163, 163, 163 - ); - - protected $actionBase = array( - 0, 229, 310, 390, 470, 103, 325, 325, 784, -2, - -2, 149, -2, -2, -2, 660, 765, 799, 765, 589, - 694, 870, 870, 870, 252, 404, 404, 404, 514, 177, - 177, 918, 434, 118, 295, 313, 240, 491, 491, 491, - 491, 138, 138, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 491, 491, 491, 491, - 491, 491, 491, 491, 491, 491, 89, 206, 773, 550, - 535, 775, 776, 777, 912, 709, 913, 856, 857, 700, - 858, 859, 862, 863, 864, 855, 865, 935, 866, 599, - 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, - 599, 322, 592, 285, 319, 232, 44, 691, 691, 691, - 691, 691, 691, 691, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 582, 530, 530, 530, 594, 860, 658, 926, - 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - 926, 926, 926, 926, 926, 926, 926, 926, 926, 926, - 926, 926, 926, 500, -21, -21, 492, 702, 420, 355, - 216, 549, 151, 26, 26, 331, 331, 331, 331, 331, - 46, 46, 5, 5, 5, 5, 153, 188, 188, 188, - 188, 121, 121, 121, 121, 314, 314, 394, 394, 362, - 300, 298, 499, 499, 499, 499, 499, 499, 499, 499, - 499, 499, 67, 656, 656, 659, 659, 522, 554, 554, - 554, 554, 679, -59, -59, 381, 462, 462, 462, 528, - 717, 854, 382, 382, 382, 382, 382, 382, 561, 561, - 561, -3, -3, -3, 692, 115, 137, 115, 137, 678, - 732, 450, 732, 338, 677, -15, 510, 810, 468, 707, - 850, 711, 853, 572, 735, 267, 529, 654, 674, 463, - 529, 529, 529, 529, 654, 610, 640, 608, 463, 529, - 463, 718, 323, 496, 89, 570, 507, 675, 778, 293, - 670, 780, 290, 373, 332, 566, 278, 435, 733, 781, - 914, 917, 385, 715, 675, 675, 675, 352, 511, 278, - -8, 605, 605, 605, 605, 156, 605, 605, 605, 605, - 251, 276, 375, 402, 779, 657, 657, 690, 872, 869, - 869, 657, 689, 657, 690, 874, 874, 874, 874, 657, - 657, 657, 657, 869, 869, 869, 688, 869, 239, 703, - 704, 704, 874, 742, 743, 657, 657, 712, 869, 869, - 869, 712, 695, 874, 701, 741, 277, 869, 874, 672, - 689, 672, 657, 701, 672, 689, 689, 672, 22, 666, - 668, 873, 875, 887, 790, 662, 685, 879, 880, 876, - 878, 871, 699, 744, 745, 497, 669, 671, 673, 680, - 719, 682, 713, 674, 667, 667, 667, 655, 720, 655, - 667, 667, 667, 667, 667, 667, 667, 667, 916, 646, - 731, 714, 653, 749, 553, 573, 791, 664, 811, 900, - 893, 867, 919, 881, 898, 655, 920, 739, 247, 643, - 882, 783, 786, 655, 883, 655, 792, 655, 902, 812, - 686, 813, 814, 667, 910, 921, 923, 924, 925, 927, - 928, 929, 930, 684, 931, 750, 696, 894, 299, 877, - 718, 729, 705, 788, 751, 820, 328, 932, 823, 655, - 655, 794, 785, 655, 795, 756, 740, 890, 757, 895, - 933, 664, 708, 896, 655, 706, 825, 934, 328, 681, - 683, 888, 661, 761, 886, 911, 885, 796, 649, 663, - 829, 830, 831, 693, 763, 891, 892, 889, 764, 803, - 665, 805, 697, 832, 807, 884, 768, 833, 834, 899, - 676, 730, 710, 698, 687, 809, 835, 897, 769, 770, - 771, 848, 772, 849, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 138, 138, 138, 138, -2, -2, - -2, -2, 0, 0, -2, 0, 0, 0, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 0, 0, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 138, 138, 138, 599, - 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, - 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, - 599, 599, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 599, -21, -21, -21, -21, 599, - -21, -21, -21, -21, -21, -21, -21, 599, 599, 599, - 599, 599, 599, 599, 599, 599, 599, 599, 599, 599, - 599, 599, 599, 599, 599, -21, 599, 599, 599, -21, - 382, -21, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 599, 0, 0, 599, - -21, 599, -21, 599, -21, -21, 599, 599, 599, 599, - 599, 599, 599, -21, -21, -21, -21, -21, -21, 0, - 561, 561, 561, 561, -21, -21, -21, -21, 382, 382, - 382, 382, 382, 382, 259, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 382, 382, 561, 561, -3, -3, - 382, 382, 382, 382, 382, 259, 382, 382, 463, 689, - 689, 689, 137, 137, 137, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 137, 463, 0, - 463, 0, 382, 463, 689, 463, 657, 137, 689, 689, - 463, 869, 616, 616, 616, 616, 328, 278, 0, 0, - 689, 689, 0, 0, 0, 0, 0, 689, 0, 0, - 0, 0, 0, 0, 869, 0, 0, 0, 0, 0, - 667, 247, 0, 705, 335, 0, 0, 0, 0, 0, - 0, 705, 335, 347, 347, 0, 684, 667, 667, 667, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 328 - ); - - protected $actionDefault = array( - 3,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 544, 544, 499,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 299, 299, 299, - 32767,32767,32767, 532, 532, 532, 532, 532, 532, 532, - 532, 532, 532, 532,32767,32767,32767,32767,32767,32767, - 383,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 389, - 549,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 364, - 365, 367, 368, 298, 552, 533, 247, 390, 548, 297, - 249, 327, 503,32767,32767,32767, 329, 122, 258, 203, - 502, 125, 296, 234, 382, 384, 328, 303, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 302, 458, 361, 360, 359, 460,32767, 459, 496, - 496, 499,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 325, 487, 486, 326, 456, 330, 457, - 333, 461, 464, 331, 332, 349, 350, 347, 348, 351, - 462, 463, 480, 481, 478, 479, 301, 352, 353, 354, - 355, 482, 483, 484, 485,32767,32767, 543, 543,32767, - 32767, 282,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 340, 341, 471, 472,32767, 238, 238, - 238, 238, 283, 238,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 335, 336, - 334, 466, 467, 465, 432,32767,32767,32767, 434,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 504,32767, - 32767,32767,32767,32767, 517, 421, 171,32767, 413,32767, - 171, 171, 171, 171,32767, 222, 224, 167,32767, 171, - 32767, 490,32767,32767,32767,32767, 522, 345,32767,32767, - 116,32767,32767,32767, 559,32767, 517,32767, 116,32767, - 32767,32767,32767, 358, 337, 338, 339,32767,32767, 521, - 515, 474, 475, 476, 477,32767, 468, 469, 470, 473, - 32767,32767,32767,32767,32767,32767,32767,32767, 429, 435, - 435,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 520, 519,32767, 414, 498, 188, - 186, 186,32767, 208, 208,32767,32767, 190, 491, 510, - 32767, 190, 173,32767, 400, 175, 498,32767,32767, 240, - 32767, 240,32767, 400, 240,32767,32767, 240,32767, 415, - 439,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 379, 380, 493, 506, - 32767, 507,32767, 413, 343, 344, 346, 322,32767, 324, - 369, 370, 371, 372, 373, 374, 375, 377,32767, 419, - 32767, 422,32767,32767,32767, 257,32767, 557,32767,32767, - 306, 557,32767,32767,32767, 551,32767,32767, 300,32767, - 32767,32767,32767, 253,32767, 169,32767, 541,32767, 558, - 32767, 515,32767, 342,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 516,32767,32767,32767,32767, 229,32767, - 452,32767, 116,32767,32767,32767, 189,32767,32767, 304, - 248,32767,32767, 550,32767,32767,32767,32767,32767,32767, - 32767,32767, 114,32767, 170,32767,32767,32767, 191,32767, - 32767, 515,32767,32767,32767,32767,32767,32767,32767, 295, - 32767,32767,32767,32767,32767,32767,32767, 515,32767,32767, - 233,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 415,32767, 276,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 127, 127, 3, 127, 127, 260, - 3, 260, 127, 260, 260, 127, 127, 127, 127, 127, - 127, 127, 127, 127, 127, 216, 219, 208, 208, 164, - 127, 127, 268 - ); - - protected $goto = array( - 166, 140, 140, 140, 166, 187, 168, 144, 147, 141, - 142, 143, 149, 163, 163, 163, 163, 144, 144, 165, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 138, 159, 160, 161, 162, 184, 139, 185, 494, 495, - 377, 496, 500, 501, 502, 503, 504, 505, 506, 507, - 970, 164, 145, 146, 148, 171, 176, 186, 203, 253, - 256, 258, 260, 263, 264, 265, 266, 267, 268, 269, - 277, 278, 279, 280, 303, 304, 328, 329, 330, 394, - 395, 396, 543, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 150, 151, 152, - 167, 153, 169, 154, 204, 170, 155, 156, 157, 205, - 158, 136, 621, 561, 757, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 561, - 561, 561, 561, 561, 561, 561, 561, 561, 561, 1113, - 629, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, - 1113, 1113, 1113, 1113, 1113, 758, 520, 531, 509, 656, - 556, 1183, 750, 509, 592, 786, 1183, 888, 612, 613, - 884, 617, 618, 624, 626, 631, 633, 817, 855, 855, - 855, 855, 850, 856, 174, 891, 891, 1205, 1205, 177, - 178, 179, 401, 402, 403, 404, 173, 202, 206, 208, - 257, 259, 261, 262, 270, 271, 272, 273, 274, 275, - 281, 282, 283, 284, 305, 306, 331, 332, 333, 406, - 407, 408, 409, 175, 180, 254, 255, 181, 182, 183, - 498, 498, 498, 498, 498, 498, 861, 498, 498, 498, - 498, 498, 498, 498, 498, 498, 498, 510, 586, 538, - 601, 602, 510, 545, 546, 547, 548, 549, 550, 551, - 552, 554, 587, 1209, 560, 350, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, - 400, 607, 537, 537, 569, 533, 909, 535, 535, 497, - 499, 525, 541, 570, 573, 584, 591, 298, 296, 296, - 296, 298, 289, 299, 611, 378, 511, 614, 595, 947, - 375, 511, 437, 437, 437, 437, 437, 437, 1163, 437, - 437, 437, 437, 437, 437, 437, 437, 437, 437, 1077, - 948, 338, 1175, 321, 1077, 898, 898, 898, 898, 606, - 898, 898, 1217, 1217, 1202, 753, 576, 605, 756, 1077, - 1077, 1077, 1077, 1077, 1077, 1069, 384, 384, 384, 391, - 1217, 877, 859, 857, 859, 655, 466, 512, 886, 881, - 753, 384, 753, 384, 968, 384, 895, 385, 588, 353, - 414, 384, 1231, 1019, 542, 1197, 1197, 1197, 568, 1094, - 386, 386, 386, 904, 915, 515, 1029, 19, 15, 372, - 389, 915, 940, 448, 450, 632, 340, 1216, 1216, 1114, - 615, 938, 840, 555, 775, 386, 913, 1070, 1073, 1074, - 399, 1069, 1182, 660, 23, 1216, 773, 1182, 544, 603, - 1066, 1219, 1071, 1174, 1071, 519, 1199, 1199, 1199, 1089, - 1088, 1072, 343, 523, 534, 519, 519, 772, 351, 352, - 13, 579, 583, 627, 1061, 388, 782, 562, 771, 515, - 783, 1181, 3, 4, 918, 956, 865, 451, 574, 1160, - 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 514, 529, 0, 0, 0, 0, - 514, 0, 529, 0, 0, 0, 0, 610, 513, 516, - 439, 440, 1067, 619, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 780, 1224, 0, 0, 0, 0, - 0, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 778, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 301, 301 - ); - - protected $gotoCheck = array( - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 57, 69, 15, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 128, - 9, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 16, 102, 32, 69, 32, - 32, 120, 6, 69, 32, 29, 120, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 50, 69, 69, - 69, 69, 69, 69, 27, 77, 77, 77, 77, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 119, 119, 119, 119, 119, 119, 33, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 67, 110, - 67, 67, 119, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 142, 57, 72, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 51, 51, 51, 51, 51, 51, 84, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 5, 5, 5, - 5, 5, 5, 5, 63, 46, 124, 63, 129, 98, - 63, 124, 57, 57, 57, 57, 57, 57, 133, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 98, 127, 82, 127, 57, 57, 57, 57, 57, 49, - 57, 57, 144, 144, 140, 11, 40, 40, 14, 57, - 57, 57, 57, 57, 57, 82, 13, 13, 13, 48, - 144, 14, 14, 14, 14, 14, 57, 14, 14, 14, - 11, 13, 11, 13, 102, 13, 79, 11, 70, 70, - 70, 13, 13, 103, 2, 9, 9, 9, 2, 34, - 125, 125, 125, 81, 13, 13, 34, 34, 34, 34, - 17, 13, 8, 8, 8, 8, 18, 143, 143, 8, - 8, 8, 9, 34, 25, 125, 85, 82, 82, 82, - 125, 82, 121, 74, 34, 143, 24, 121, 47, 34, - 116, 143, 82, 82, 82, 47, 121, 121, 121, 126, - 126, 82, 58, 58, 58, 47, 47, 23, 72, 72, - 58, 62, 62, 62, 114, 12, 23, 12, 23, 13, - 26, 121, 30, 30, 86, 100, 71, 65, 66, 132, - 109, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, - 9, -1, 9, -1, -1, -1, -1, 13, 9, 9, - 9, 9, 13, 13, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, - -1, 102, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 5, 5 - ); - - protected $gotoBase = array( - 0, 0, -172, 0, 0, 353, 201, 0, 477, 149, - 0, 110, 195, 117, 426, 112, 203, 140, 171, 0, - 0, 0, 0, 168, 164, 157, 119, 27, 0, 205, - -118, 0, -428, 266, 51, 0, 0, 0, 0, 0, - 388, 0, 0, -24, 0, 0, 345, 484, 146, 133, - 209, 75, 0, 0, 0, 0, 0, 107, 161, 0, - 0, 0, 222, -77, 0, 106, 97, -343, 0, -94, - 135, 123, -129, 0, 129, 0, 0, -50, 0, 143, - 0, 159, 64, 0, 338, 132, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, - 121, 0, 165, 156, 0, 0, 0, 0, 0, 87, - 273, 259, 0, 0, 114, 0, 150, 0, 0, -5, - -91, 200, 0, 0, 84, 154, 202, 77, -48, 178, - 0, 0, 93, 187, 0, 0, 0, 0, 0, 0, - 136, 0, 286, 167, 102, 0, 0 - ); - - protected $gotoDefault = array( - -32768, 468, 664, 2, 665, 835, 740, 748, 598, 482, - 630, 582, 380, 1193, 792, 793, 794, 381, 368, 483, - 379, 410, 405, 781, 774, 776, 784, 172, 411, 787, - 1, 789, 518, 825, 1020, 365, 797, 366, 590, 799, - 527, 801, 802, 137, 382, 383, 528, 484, 390, 577, - 816, 276, 387, 818, 367, 819, 828, 371, 465, 455, - 460, 530, 557, 609, 432, 447, 571, 565, 536, 1086, - 566, 864, 349, 872, 661, 880, 883, 485, 558, 894, - 452, 902, 1099, 397, 908, 914, 919, 291, 922, 417, - 412, 585, 927, 928, 5, 932, 622, 623, 8, 312, - 955, 599, 969, 420, 1039, 1041, 486, 487, 522, 459, - 508, 526, 488, 1062, 441, 413, 1065, 433, 489, 490, - 434, 435, 1083, 355, 1168, 354, 449, 320, 1155, 580, - 1118, 456, 1208, 1164, 348, 491, 492, 376, 1187, 392, - 1203, 438, 1210, 1218, 344, 540, 567 - ); - - protected $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 8, 8, 9, 10, 11, 11, - 12, 12, 13, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 18, 18, 19, 19, 21, 21, - 17, 17, 22, 22, 23, 23, 24, 24, 25, 25, - 20, 20, 26, 28, 28, 29, 30, 30, 32, 31, - 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 14, 14, 54, 54, 56, 55, 55, 48, - 48, 58, 58, 59, 59, 60, 60, 61, 61, 15, - 16, 16, 16, 64, 64, 64, 65, 65, 68, 68, - 66, 66, 70, 70, 41, 41, 50, 50, 53, 53, - 53, 52, 52, 71, 42, 42, 42, 42, 72, 72, - 73, 73, 74, 74, 39, 39, 35, 35, 75, 37, - 37, 76, 36, 36, 38, 38, 49, 49, 49, 62, - 62, 78, 78, 79, 79, 81, 81, 81, 80, 80, - 63, 63, 82, 82, 82, 83, 83, 84, 84, 84, - 44, 44, 85, 85, 85, 45, 45, 86, 86, 87, - 87, 67, 88, 88, 88, 88, 93, 93, 94, 94, - 95, 95, 95, 95, 95, 96, 97, 97, 92, 92, - 89, 89, 91, 91, 99, 99, 98, 98, 98, 98, - 98, 98, 90, 90, 101, 100, 100, 46, 46, 40, - 40, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 34, 34, 47, - 47, 106, 106, 107, 107, 107, 107, 113, 102, 102, - 109, 109, 115, 115, 116, 117, 118, 118, 118, 118, - 118, 118, 118, 69, 69, 57, 57, 57, 57, 103, - 103, 122, 122, 119, 119, 123, 123, 123, 123, 104, - 104, 104, 108, 108, 108, 114, 114, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 27, 27, 27, 27, 27, 27, 130, 130, 130, 130, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, - 112, 112, 105, 105, 105, 105, 129, 129, 132, 132, - 131, 131, 133, 133, 51, 51, 51, 51, 135, 135, - 134, 134, 134, 134, 134, 136, 136, 121, 121, 124, - 124, 120, 120, 138, 137, 137, 137, 137, 125, 125, - 125, 125, 111, 111, 126, 126, 126, 126, 77, 139, - 139, 140, 140, 140, 110, 110, 141, 141, 142, 142, - 142, 142, 142, 127, 127, 127, 127, 144, 145, 143, - 143, 143, 143, 143, 143, 143, 146, 146, 146 - ); - - protected $ruleToLength = array( - 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 5, 4, - 3, 4, 2, 3, 1, 1, 7, 6, 3, 1, - 3, 1, 3, 1, 1, 3, 1, 3, 1, 2, - 3, 1, 3, 3, 1, 3, 2, 0, 1, 1, - 1, 1, 1, 3, 5, 8, 3, 5, 9, 3, - 2, 3, 2, 3, 2, 3, 3, 3, 3, 1, - 2, 2, 5, 7, 9, 5, 6, 3, 3, 2, - 2, 1, 1, 1, 0, 2, 8, 0, 4, 1, - 3, 0, 1, 0, 1, 0, 1, 1, 1, 10, - 7, 6, 5, 1, 2, 2, 0, 2, 0, 2, - 0, 2, 1, 3, 1, 4, 1, 4, 1, 1, - 4, 1, 3, 3, 3, 4, 4, 5, 0, 2, - 4, 3, 1, 1, 1, 4, 0, 2, 3, 0, - 2, 4, 0, 2, 0, 3, 1, 2, 1, 1, - 0, 1, 3, 4, 6, 1, 1, 1, 0, 1, - 0, 2, 2, 3, 3, 1, 3, 1, 2, 2, - 3, 1, 1, 2, 4, 3, 1, 1, 3, 2, - 0, 1, 3, 3, 9, 3, 1, 3, 0, 2, - 4, 5, 4, 4, 4, 3, 1, 1, 1, 3, - 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 1, 3, 3, 1, 0, - 1, 1, 3, 3, 4, 4, 1, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 1, 3, 5, - 4, 3, 4, 4, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, - 1, 3, 2, 1, 2, 10, 11, 3, 3, 2, - 4, 4, 3, 4, 4, 4, 4, 7, 3, 2, - 0, 4, 1, 3, 2, 1, 2, 2, 4, 6, - 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 3, 4, 4, 0, - 2, 1, 0, 1, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, - 1, 3, 1, 4, 3, 1, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, - 1, 3, 1, 1, 3, 3, 0, 2, 0, 1, - 3, 1, 3, 1, 1, 1, 1, 1, 6, 4, - 3, 4, 2, 4, 4, 1, 3, 1, 2, 1, - 1, 4, 1, 1, 3, 6, 4, 4, 4, 4, - 1, 4, 0, 1, 1, 3, 1, 1, 4, 3, - 1, 1, 1, 0, 0, 2, 3, 1, 3, 1, - 4, 2, 2, 2, 2, 1, 2, 1, 1, 1, - 4, 3, 3, 3, 6, 3, 1, 1, 1 - ); - - protected function initReduceCallbacks() { - $this->reduceCallbacks = [ - 0 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 6 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 7 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 8 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 9 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 10 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 11 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 12 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 13 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 14 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 15 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 16 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 17 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 18 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 19 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 20 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 21 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 22 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 23 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 24 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 25 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 26 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 27 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 28 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 29 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 30 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 31 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 32 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 33 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 34 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 35 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 36 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 37 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 38 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 39 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 40 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 41 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 42 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 43 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 44 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 45 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 46 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 47 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 48 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 49 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 50 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 51 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 52 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 53 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 54 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 55 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 56 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 57 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 58 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 59 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 60 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 61 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 62 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 63 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 64 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 65 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 66 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 67 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 68 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 69 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 70 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 71 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 72 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 73 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 74 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 75 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 77 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 78 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 79 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 80 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 81 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 82 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 83 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 84 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 85 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 88 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 89 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 90 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 91 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 92 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 93 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 94 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 95 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 96 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 97 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); - }, - 98 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 99 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); - }, - 100 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 101 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 102 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 103 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 104 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; - }, - 105 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; - }, - 106 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 107 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 108 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 109 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 110 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 111 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 112 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 113 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 114 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 115 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); - }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); - }, - 118 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; - }, - 119 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; - }, - 120 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 121 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 122 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 123 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 124 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 125 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 126 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 127 => function ($stackPos) { - $this->semValue = array(); - }, - 128 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 129 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 130 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 131 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 132 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 133 => function ($stackPos) { - - if ($this->semStack[$stackPos-(3-2)]) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; - } else { - $startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if (null === $this->semValue) { $this->semValue = array(); } - } - - }, - 134 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(5-2)], ['stmts' => is_array($this->semStack[$stackPos-(5-3)]) ? $this->semStack[$stackPos-(5-3)] : array($this->semStack[$stackPos-(5-3)]), 'elseifs' => $this->semStack[$stackPos-(5-4)], 'else' => $this->semStack[$stackPos-(5-5)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 135 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(8-2)], ['stmts' => $this->semStack[$stackPos-(8-4)], 'elseifs' => $this->semStack[$stackPos-(8-5)], 'else' => $this->semStack[$stackPos-(8-6)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 136 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 137 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(5-4)], is_array($this->semStack[$stackPos-(5-2)]) ? $this->semStack[$stackPos-(5-2)] : array($this->semStack[$stackPos-(5-2)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 138 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 139 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 140 => function ($stackPos) { - $this->semValue = new Stmt\Break_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 141 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 142 => function ($stackPos) { - $this->semValue = new Stmt\Continue_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 143 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 144 => function ($stackPos) { - $this->semValue = new Stmt\Return_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 145 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 146 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 147 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 148 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 149 => function ($stackPos) { - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 150 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 151 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 152 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 153 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 154 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 155 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 156 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); - }, - 157 => function ($stackPos) { - $this->semValue = new Stmt\Throw_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 158 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 161 => function ($stackPos) { - $this->semValue = array(); /* means: no statement */ - }, - 162 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 163 => function ($stackPos) { - $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ - }, - 164 => function ($stackPos) { - $this->semValue = array(); - }, - 165 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Catch_(array($this->semStack[$stackPos-(8-3)]), $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - }, - 167 => function ($stackPos) { - $this->semValue = null; - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 169 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 170 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 171 => function ($stackPos) { - $this->semValue = false; - }, - 172 => function ($stackPos) { - $this->semValue = true; - }, - 173 => function ($stackPos) { - $this->semValue = false; - }, - 174 => function ($stackPos) { - $this->semValue = true; - }, - 175 => function ($stackPos) { - $this->semValue = false; - }, - 176 => function ($stackPos) { - $this->semValue = true; - }, - 177 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 178 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(10-3)], ['byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-5)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(7-2)); - }, - 181 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(6-2)], ['extends' => $this->semStack[$stackPos-(6-3)], 'stmts' => $this->semStack[$stackPos-(6-5)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - $this->checkInterface($this->semValue, $stackPos-(6-2)); - }, - 182 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(5-2)], ['stmts' => $this->semStack[$stackPos-(5-4)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 183 => function ($stackPos) { - $this->semValue = 0; - }, - 184 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 185 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 186 => function ($stackPos) { - $this->semValue = null; - }, - 187 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 188 => function ($stackPos) { - $this->semValue = array(); - }, - 189 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 190 => function ($stackPos) { - $this->semValue = array(); - }, - 191 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 192 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 193 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 194 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 195 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 196 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 197 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 198 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 199 => function ($stackPos) { - $this->semValue = null; - }, - 200 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 201 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 202 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 203 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 204 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 205 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 206 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 207 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; - }, - 208 => function ($stackPos) { - $this->semValue = array(); - }, - 209 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 210 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 211 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 212 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 213 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 214 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); - }, - 215 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; - }, - 216 => function ($stackPos) { - $this->semValue = array(); - }, - 217 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 218 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(3-2)], is_array($this->semStack[$stackPos-(3-3)]) ? $this->semStack[$stackPos-(3-3)] : array($this->semStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 219 => function ($stackPos) { - $this->semValue = array(); - }, - 220 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 221 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 222 => function ($stackPos) { - $this->semValue = null; - }, - 223 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 224 => function ($stackPos) { - $this->semValue = null; - }, - 225 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 226 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 227 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); - }, - 228 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); - }, - 229 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 230 => function ($stackPos) { - $this->semValue = array(); - }, - 231 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 232 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 233 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(4-4)], null, $this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->checkParam($this->semValue); - }, - 234 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-3)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkParam($this->semValue); - }, - 235 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 236 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 237 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 238 => function ($stackPos) { - $this->semValue = null; - }, - 239 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 240 => function ($stackPos) { - $this->semValue = null; - }, - 241 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; - }, - 242 => function ($stackPos) { - $this->semValue = array(); - }, - 243 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 244 => function ($stackPos) { - $this->semValue = array(new Node\Arg($this->semStack[$stackPos-(3-2)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes)); - }, - 245 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 246 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 247 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 248 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 249 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 250 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 251 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 252 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 253 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 254 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 255 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 256 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 257 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 258 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 259 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } - }, - 260 => function ($stackPos) { - $this->semValue = array(); - }, - 261 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 262 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkProperty($this->semValue, $stackPos-(3-1)); - }, - 263 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(3-2)], 0, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 264 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(9-4)], ['type' => $this->semStack[$stackPos-(9-1)], 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - $this->checkClassMethod($this->semValue, $stackPos-(9-1)); - }, - 265 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 266 => function ($stackPos) { - $this->semValue = array(); - }, - 267 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 268 => function ($stackPos) { - $this->semValue = array(); - }, - 269 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 270 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 271 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 272 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 273 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 274 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 275 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); - }, - 276 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 277 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); - }, - 278 => function ($stackPos) { - $this->semValue = null; - }, - 279 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 280 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 281 => function ($stackPos) { - $this->semValue = 0; - }, - 282 => function ($stackPos) { - $this->semValue = 0; - }, - 283 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 284 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 285 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; - }, - 286 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; - }, - 287 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; - }, - 288 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; - }, - 289 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; - }, - 290 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; - }, - 291 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; - }, - 292 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 293 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 294 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 295 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 296 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 297 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 298 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 299 => function ($stackPos) { - $this->semValue = array(); - }, - 300 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 301 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 302 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 303 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 304 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 305 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 306 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 307 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 308 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 309 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 310 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 311 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 312 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 313 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 314 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 315 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 316 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 317 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 318 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 319 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 320 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 321 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 322 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 323 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 324 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 325 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 326 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 327 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 328 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 329 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 330 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 331 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 332 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 333 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 334 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 335 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 336 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 337 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 338 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 339 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 340 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 341 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 342 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 343 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 344 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 345 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 346 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 347 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 348 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 349 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 350 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 351 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 352 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 353 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 354 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 355 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 356 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 357 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 358 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 359 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 360 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 361 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 362 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 363 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 364 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 365 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 366 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 367 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 368 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 369 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 370 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); - }, - 371 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 372 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 373 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 374 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 375 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 376 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); - }, - 377 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 378 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 379 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 380 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 381 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 382 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 383 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 384 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 385 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-4)], 'uses' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 386 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(11-3)], 'params' => $this->semStack[$stackPos-(11-5)], 'uses' => $this->semStack[$stackPos-(11-7)], 'returnType' => $this->semStack[$stackPos-(11-8)], 'stmts' => $this->semStack[$stackPos-(11-10)]], $this->startAttributeStack[$stackPos-(11-1)] + $this->endAttributes); - }, - 387 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 388 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 389 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 390 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 391 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); - }, - 392 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); - }, - 393 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch(Scalar\String_::fromString($this->semStack[$stackPos-(4-1)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes), $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 395 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 396 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 397 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes), $this->semStack[$stackPos-(7-2)]); - $this->checkClass($this->semValue[0], -1); - }, - 398 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 399 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 400 => function ($stackPos) { - $this->semValue = array(); - }, - 401 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; - }, - 402 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 403 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 405 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 406 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 409 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 410 => function ($stackPos) { - $this->semValue = $this->fixupPhp5StaticPropCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 411 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 412 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 413 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 414 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 415 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 416 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 417 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 418 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 419 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 420 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 421 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 422 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 423 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 424 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 425 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 426 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 427 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 428 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 429 => function ($stackPos) { - $this->semValue = null; - }, - 430 => function ($stackPos) { - $this->semValue = null; - }, - 431 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 432 => function ($stackPos) { - $this->semValue = array(); - }, - 433 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`', false), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); - }, - 434 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', false); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 435 => function ($stackPos) { - $this->semValue = array(); - }, - 436 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 437 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes, true); - }, - 438 => function ($stackPos) { - $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 439 => function ($stackPos) { - $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes, false); - }, - 440 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 441 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 442 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 443 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 444 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 445 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 446 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 447 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 448 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], false); - }, - 449 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], false); - }, - 450 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 451 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 452 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 453 => function ($stackPos) { - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 454 => function ($stackPos) { - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 455 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 456 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 457 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 458 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 459 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 460 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 461 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 462 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 463 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 464 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 465 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 466 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 467 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 468 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 469 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 470 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 471 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 472 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 473 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 474 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 475 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 476 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 477 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 478 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 479 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 480 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 481 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 482 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 483 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 484 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 485 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 486 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 487 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 488 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 489 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 490 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 491 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 492 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 493 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 494 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); - }, - 495 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); - }, - 496 => function ($stackPos) { - $this->semValue = array(); - }, - 497 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 498 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 499 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 500 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 501 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 502 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 503 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 504 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 505 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 506 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 507 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 508 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 509 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 510 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 511 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 512 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 513 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 514 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 515 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 516 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 517 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 518 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 519 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 520 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 521 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 522 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 523 => function ($stackPos) { - $var = substr($this->semStack[$stackPos-(1-1)], 1); $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; - }, - 524 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 525 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 526 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 527 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 528 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 529 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 530 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 531 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 532 => function ($stackPos) { - $this->semValue = null; - }, - 533 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 534 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 535 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 536 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 537 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; - }, - 538 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 539 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 540 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 541 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 542 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 543 => function ($stackPos) { - $this->semValue = null; - }, - 544 => function ($stackPos) { - $this->semValue = array(); - }, - 545 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 546 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 547 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 548 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 549 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 550 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 551 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 552 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 553 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 554 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 555 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 556 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); - }, - 557 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 558 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 559 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 560 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 561 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 562 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 563 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 564 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - }, - 565 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; - }, - 566 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 567 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 568 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - ]; - } -} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php index 48deff23b1..2ab1695450 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php @@ -1,8 +1,9 @@ -reduceCallbacks = [ - 0 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 1 => function ($stackPos) { - $this->semValue = $this->handleNamespaces($this->semStack[$stackPos-(1-1)]); - }, - 2 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; - }, - 3 => function ($stackPos) { - $this->semValue = array(); - }, - 4 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 5 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 6 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 7 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 8 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 9 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 10 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 11 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 12 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 13 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 14 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 15 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 16 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 17 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 18 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 19 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 20 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 21 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 22 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 23 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 24 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 25 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 26 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 27 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 28 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 29 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 30 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 31 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 32 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 33 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 34 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 35 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 36 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 37 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 38 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 39 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 40 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 41 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 42 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 43 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 44 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 45 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 46 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 47 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 48 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 49 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 50 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 51 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 52 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 53 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 54 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 55 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 56 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 57 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 58 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 59 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 60 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 61 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 62 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 63 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 64 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 65 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 66 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 67 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 68 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 69 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 70 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 71 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 72 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 73 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 74 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 75 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 76 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 77 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 78 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 79 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 80 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 81 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 82 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 83 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 84 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 85 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; - }, - 86 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 87 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 88 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 89 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 90 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 91 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 92 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 93 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 94 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 95 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 96 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 97 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 98 => function ($stackPos) { + 0 => null, + 1 => static function ($self, $stackPos) { + $self->semValue = $self->handleNamespaces($self->semStack[$stackPos-(1-1)]); + }, + 2 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];; + }, + 3 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 4 => static function ($self, $stackPos) { + $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);; + if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)]; + }, + 5 => null, + 6 => null, + 7 => null, + 8 => null, + 9 => null, + 10 => null, + 11 => null, + 12 => null, + 13 => null, + 14 => null, + 15 => null, + 16 => null, + 17 => null, + 18 => null, + 19 => null, + 20 => null, + 21 => null, + 22 => null, + 23 => null, + 24 => null, + 25 => null, + 26 => null, + 27 => null, + 28 => null, + 29 => null, + 30 => null, + 31 => null, + 32 => null, + 33 => null, + 34 => null, + 35 => null, + 36 => null, + 37 => null, + 38 => null, + 39 => null, + 40 => null, + 41 => null, + 42 => null, + 43 => null, + 44 => null, + 45 => null, + 46 => null, + 47 => null, + 48 => null, + 49 => null, + 50 => null, + 51 => null, + 52 => null, + 53 => null, + 54 => null, + 55 => null, + 56 => null, + 57 => null, + 58 => null, + 59 => null, + 60 => null, + 61 => null, + 62 => null, + 63 => null, + 64 => null, + 65 => null, + 66 => null, + 67 => null, + 68 => null, + 69 => null, + 70 => null, + 71 => null, + 72 => null, + 73 => null, + 74 => null, + 75 => null, + 76 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; if ($self->semValue === "emitError(new Error('Cannot use "getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]))); + }, + 77 => null, + 78 => null, + 79 => null, + 80 => null, + 81 => null, + 82 => null, + 83 => null, + 84 => null, + 85 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 86 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 87 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 88 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 89 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 90 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 91 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 92 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 93 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 94 => null, + 95 => static function ($self, $stackPos) { + $self->semValue = new Name(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 96 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 97 => static function ($self, $stackPos) { /* nothing */ }, - 99 => function ($stackPos) { + 98 => static function ($self, $stackPos) { /* nothing */ }, - 100 => function ($stackPos) { + 99 => static function ($self, $stackPos) { /* nothing */ }, - 101 => function ($stackPos) { - $this->emitError(new Error('A trailing comma is not allowed here', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); + 100 => static function ($self, $stackPos) { + $self->emitError(new Error('A trailing comma is not allowed here', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]))); }, - 102 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + 101 => null, + 102 => null, + 103 => static function ($self, $stackPos) { + $self->semValue = new Node\Attribute($self->semStack[$stackPos-(1-1)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 103 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + 104 => static function ($self, $stackPos) { + $self->semValue = new Node\Attribute($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 104 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 105 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 105 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 106 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 106 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 107 => static function ($self, $stackPos) { + $self->semValue = new Node\AttributeGroup($self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 107 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 108 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 108 => function ($stackPos) { - $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 109 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 109 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 110 => static function ($self, $stackPos) { + $self->semValue = []; }, - 110 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 111 => null, + 112 => null, + 113 => null, + 114 => null, + 115 => static function ($self, $stackPos) { + $self->semValue = new Stmt\HaltCompiler($self->handleHaltCompiler(), $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 111 => function ($stackPos) { - $this->semValue = []; + 116 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Namespace_($self->semStack[$stackPos-(3-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); + $self->checkNamespace($self->semValue); }, - 112 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 117 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Namespace_($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $self->checkNamespace($self->semValue); }, - 113 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 118 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Namespace_(null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $self->checkNamespace($self->semValue); }, - 114 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 119 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Use_($self->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 115 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 120 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Use_($self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 116 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 121 => null, + 122 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Const_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); - $this->checkNamespace($this->semValue); + 123 => static function ($self, $stackPos) { + $self->semValue = Stmt\Use_::TYPE_FUNCTION; }, - 118 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); + 124 => static function ($self, $stackPos) { + $self->semValue = Stmt\Use_::TYPE_CONSTANT; }, - 119 => function ($stackPos) { - $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); - $this->checkNamespace($this->semValue); + 125 => static function ($self, $stackPos) { + $self->semValue = new Stmt\GroupUse($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-6)], $self->semStack[$stackPos-(8-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); }, - 120 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 126 => static function ($self, $stackPos) { + $self->semValue = new Stmt\GroupUse($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-5)], Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); }, - 121 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 127 => null, + 128 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 122 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 129 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 123 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 130 => null, + 131 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 124 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; + 132 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 125 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; + 133 => null, + 134 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 126 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + 135 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 127 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + 136 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1)); }, - 128 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 137 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3)); }, - 129 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 138 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1)); }, - 130 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 139 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3)); }, - 131 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 140 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->semValue->type = Stmt\Use_::TYPE_NORMAL; }, - 132 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 141 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; $self->semValue->type = $self->semStack[$stackPos-(2-1)]; }, - 133 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 142 => null, + 143 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 134 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 144 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 135 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 145 => static function ($self, $stackPos) { + $self->semValue = new Node\Const_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 136 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 146 => null, + 147 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 137 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + 148 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 138 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + 149 => static function ($self, $stackPos) { + $self->semValue = new Node\Const_(new Node\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 139 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + 150 => static function ($self, $stackPos) { + $self->semValue = new Node\Const_(new Node\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 140 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + 151 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];; }, - 141 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; + 152 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 142 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; + 153 => static function ($self, $stackPos) { + $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);; + if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)]; }, - 143 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 154 => null, + 155 => null, + 156 => null, + 157 => static function ($self, $stackPos) { + throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 144 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 158 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Block($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 145 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 159 => static function ($self, $stackPos) { + $self->semValue = new Stmt\If_($self->semStack[$stackPos-(7-3)], ['stmts' => $self->semStack[$stackPos-(7-5)], 'elseifs' => $self->semStack[$stackPos-(7-6)], 'else' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); }, - 146 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 160 => static function ($self, $stackPos) { + $self->semValue = new Stmt\If_($self->semStack[$stackPos-(10-3)], ['stmts' => $self->semStack[$stackPos-(10-6)], 'elseifs' => $self->semStack[$stackPos-(10-7)], 'else' => $self->semStack[$stackPos-(10-8)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); }, - 147 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 161 => static function ($self, $stackPos) { + $self->semValue = new Stmt\While_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 148 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 162 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Do_($self->semStack[$stackPos-(7-5)], $self->semStack[$stackPos-(7-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); }, - 149 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 163 => static function ($self, $stackPos) { + $self->semValue = new Stmt\For_(['init' => $self->semStack[$stackPos-(9-3)], 'cond' => $self->semStack[$stackPos-(9-5)], 'loop' => $self->semStack[$stackPos-(9-7)], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); }, - 150 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 164 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Switch_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 151 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; + 165 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Break_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 152 => function ($stackPos) { - $this->semValue = array(); + 166 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Continue_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 153 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + 167 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Return_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 154 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 168 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Global_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 155 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 169 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Static_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 156 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 170 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Echo_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 157 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 158 => function ($stackPos) { + 171 => static function ($self, $stackPos) { - if ($this->semStack[$stackPos-(3-2)]) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; - } else { - $startAttributes = $this->startAttributeStack[$stackPos-(3-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if (null === $this->semValue) { $this->semValue = array(); } - } + $self->semValue = new Stmt\InlineHTML($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('hasLeadingNewline', $self->inlineHtmlHasLeadingNewline($stackPos-(1-1))); }, - 159 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => is_array($this->semStack[$stackPos-(7-5)]) ? $this->semStack[$stackPos-(7-5)] : array($this->semStack[$stackPos-(7-5)]), 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 160 => function ($stackPos) { - $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - }, - 161 => function ($stackPos) { - $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + 172 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Expression($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 162 => function ($stackPos) { - $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], is_array($this->semStack[$stackPos-(7-2)]) ? $this->semStack[$stackPos-(7-2)] : array($this->semStack[$stackPos-(7-2)]), $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - }, - 163 => function ($stackPos) { - $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); - }, - 164 => function ($stackPos) { - $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); - }, - 165 => function ($stackPos) { - $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 166 => function ($stackPos) { - $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 167 => function ($stackPos) { - $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 168 => function ($stackPos) { - $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 169 => function ($stackPos) { - $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 170 => function ($stackPos) { - $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 171 => function ($stackPos) { - $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 172 => function ($stackPos) { - - $e = $this->semStack[$stackPos-(2-1)]; - if ($e instanceof Expr\Throw_) { - // For backwards-compatibility reasons, convert throw in statement position into - // Stmt\Throw_ rather than Stmt\Expression(Expr\Throw_). - $this->semValue = new Stmt\Throw_($e->expr, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - } else { - $this->semValue = new Stmt\Expression($e, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - } - + 173 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Unset_($self->semStack[$stackPos-(5-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 173 => function ($stackPos) { - $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + 174 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Foreach_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $self->semStack[$stackPos-(7-5)][1], 'stmts' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); }, - 174 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + 175 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Foreach_($self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-7)][0], ['keyVar' => $self->semStack[$stackPos-(9-5)], 'byRef' => $self->semStack[$stackPos-(9-7)][1], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); }, - 175 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + 176 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Foreach_($self->semStack[$stackPos-(6-3)], new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-4)], $self->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $self->semStack[$stackPos-(6-6)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); }, - 176 => function ($stackPos) { - $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->startAttributeStack[$stackPos-(6-4)] + $this->endAttributeStack[$stackPos-(6-4)]), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + 177 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Declare_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 177 => function ($stackPos) { - $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + 178 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TryCatch($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->checkTryCatch($self->semValue); }, - 178 => function ($stackPos) { - $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); + 179 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Goto_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 179 => function ($stackPos) { - $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 180 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Label($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 180 => function ($stackPos) { - $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 181 => static function ($self, $stackPos) { + $self->semValue = null; /* means: no statement */ }, - 181 => function ($stackPos) { - $this->semValue = array(); /* means: no statement */ + 182 => null, + 183 => static function ($self, $stackPos) { + $self->semValue = $self->maybeCreateNop($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]); }, - 182 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 184 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; }; }, - 183 => function ($stackPos) { - $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; - if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ + 185 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 184 => function ($stackPos) { - $this->semValue = array(); + 186 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 185 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 187 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 186 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 188 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 187 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 189 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Catch_($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-7)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); }, - 188 => function ($stackPos) { - $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + 190 => static function ($self, $stackPos) { + $self->semValue = null; }, - 189 => function ($stackPos) { - $this->semValue = null; + 191 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Finally_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 190 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 192 => null, + 193 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 191 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 194 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 192 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 195 => static function ($self, $stackPos) { + $self->semValue = false; }, - 193 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 196 => static function ($self, $stackPos) { + $self->semValue = true; }, - 194 => function ($stackPos) { - $this->semValue = false; + 197 => static function ($self, $stackPos) { + $self->semValue = false; }, - 195 => function ($stackPos) { - $this->semValue = true; + 198 => static function ($self, $stackPos) { + $self->semValue = true; }, - 196 => function ($stackPos) { - $this->semValue = false; + 199 => static function ($self, $stackPos) { + $self->semValue = false; }, - 197 => function ($stackPos) { - $this->semValue = true; + 200 => static function ($self, $stackPos) { + $self->semValue = true; }, - 198 => function ($stackPos) { - $this->semValue = false; + 201 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 199 => function ($stackPos) { - $this->semValue = true; + 202 => static function ($self, $stackPos) { + $self->semValue = []; }, - 200 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 203 => null, + 204 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 201 => function ($stackPos) { - $this->semValue = []; + 205 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 202 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 206 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Function_($self->semStack[$stackPos-(8-3)], ['byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-5)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); }, - 203 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 207 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Function_($self->semStack[$stackPos-(9-4)], ['byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-6)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); }, - 204 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + 208 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Class_($self->semStack[$stackPos-(7-2)], ['type' => $self->semStack[$stackPos-(7-1)], 'extends' => $self->semStack[$stackPos-(7-3)], 'implements' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + $self->checkClass($self->semValue, $stackPos-(7-2)); }, - 205 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + 209 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Class_($self->semStack[$stackPos-(8-3)], ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + $self->checkClass($self->semValue, $stackPos-(8-3)); }, - 206 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(7-2)); + 210 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Interface_($self->semStack[$stackPos-(7-3)], ['extends' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => $self->semStack[$stackPos-(7-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + $self->checkInterface($self->semValue, $stackPos-(7-3)); }, - 207 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - $this->checkClass($this->semValue, $stackPos-(8-3)); + 211 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Trait_($self->semStack[$stackPos-(6-3)], ['stmts' => $self->semStack[$stackPos-(6-5)], 'attrGroups' => $self->semStack[$stackPos-(6-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); }, - 208 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); - $this->checkInterface($this->semValue, $stackPos-(7-3)); + 212 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Enum_($self->semStack[$stackPos-(8-3)], ['scalarType' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + $self->checkEnum($self->semValue, $stackPos-(8-3)); }, - 209 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + 213 => static function ($self, $stackPos) { + $self->semValue = null; }, - 210 => function ($stackPos) { - $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); - $this->checkEnum($this->semValue, $stackPos-(8-3)); + 214 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; }, - 211 => function ($stackPos) { - $this->semValue = null; + 215 => static function ($self, $stackPos) { + $self->semValue = null; }, - 212 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + 216 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; }, - 213 => function ($stackPos) { - $this->semValue = null; + 217 => static function ($self, $stackPos) { + $self->semValue = 0; }, - 214 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + 218 => null, + 219 => null, + 220 => static function ($self, $stackPos) { + $self->checkClassModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; }, - 215 => function ($stackPos) { - $this->semValue = 0; + 221 => static function ($self, $stackPos) { + $self->semValue = Modifiers::ABSTRACT; }, - 216 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 222 => static function ($self, $stackPos) { + $self->semValue = Modifiers::FINAL; }, - 217 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 223 => static function ($self, $stackPos) { + $self->semValue = Modifiers::READONLY; }, - 218 => function ($stackPos) { - $this->checkClassModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + 224 => static function ($self, $stackPos) { + $self->semValue = null; }, - 219 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + 225 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; }, - 220 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; + 226 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 221 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + 227 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; }, - 222 => function ($stackPos) { - $this->semValue = null; + 228 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 223 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + 229 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; }, - 224 => function ($stackPos) { - $this->semValue = array(); + 230 => null, + 231 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 225 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + 232 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 226 => function ($stackPos) { - $this->semValue = array(); + 233 => null, + 234 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; }, - 227 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + 235 => null, + 236 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; }, - 228 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 237 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; }; }, - 229 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 238 => static function ($self, $stackPos) { + $self->semValue = null; }, - 230 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 239 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; }, - 231 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + 240 => null, + 241 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 232 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + 242 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 233 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + 243 => static function ($self, $stackPos) { + $self->semValue = new Node\DeclareItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 234 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + 244 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 235 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + 245 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-3)]; }, - 236 => function ($stackPos) { - $this->semValue = null; + 246 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; }, - 237 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + 247 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(5-3)]; }, - 238 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 248 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 239 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 249 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 240 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 250 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Case_($self->semStack[$stackPos-(4-2)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 241 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 251 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Case_(null, $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 242 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 252 => null, + 253 => null, + 254 => static function ($self, $stackPos) { + $self->semValue = new Expr\Match_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); }, - 243 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; + 255 => static function ($self, $stackPos) { + $self->semValue = []; }, - 244 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + 256 => null, + 257 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 245 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; + 258 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 246 => function ($stackPos) { - $this->semValue = array(); + 259 => static function ($self, $stackPos) { + $self->semValue = new Node\MatchArm($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 247 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 260 => static function ($self, $stackPos) { + $self->semValue = new Node\MatchArm(null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 248 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 261 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; }, - 249 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 262 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; }, - 250 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + 263 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 251 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + 264 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 252 => function ($stackPos) { - $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + 265 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ElseIf_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 253 => function ($stackPos) { - $this->semValue = []; + 266 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 254 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 267 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 255 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 268 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ElseIf_($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue); }, - 256 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 269 => static function ($self, $stackPos) { + $self->semValue = null; }, - 257 => function ($stackPos) { - $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 270 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Else_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 258 => function ($stackPos) { - $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 271 => static function ($self, $stackPos) { + $self->semValue = null; }, - 259 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + 272 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Else_($self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue); }, - 260 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + 273 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)], false); }, - 261 => function ($stackPos) { - $this->semValue = array(); + 274 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(2-2)], true); }, - 262 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 275 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)], false); }, - 263 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + 276 => static function ($self, $stackPos) { + $self->semValue = array($self->fixupArrayDestructuring($self->semStack[$stackPos-(1-1)]), false); }, - 264 => function ($stackPos) { - $this->semValue = array(); + 277 => null, + 278 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 265 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 279 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 266 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + 280 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 267 => function ($stackPos) { - $this->semValue = null; + 281 => static function ($self, $stackPos) { + $self->semValue = 0; }, - 268 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 282 => static function ($self, $stackPos) { + $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; }, - 269 => function ($stackPos) { - $this->semValue = null; + 283 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC; }, - 270 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 284 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED; }, - 271 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + 285 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE; }, - 272 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); + 286 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC_SET; }, - 273 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + 287 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED_SET; }, - 274 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + 288 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE_SET; }, - 275 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 289 => static function ($self, $stackPos) { + $self->semValue = Modifiers::READONLY; }, - 276 => function ($stackPos) { - $this->semValue = array(); + 290 => static function ($self, $stackPos) { + $self->semValue = new Node\Param($self->semStack[$stackPos-(7-6)], null, $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-4)], $self->semStack[$stackPos-(7-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-7)]); + $self->checkParam($self->semValue); }, - 277 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 291 => static function ($self, $stackPos) { + $self->semValue = new Node\Param($self->semStack[$stackPos-(9-6)], $self->semStack[$stackPos-(9-8)], $self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-4)], $self->semStack[$stackPos-(9-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(9-2)], $self->semStack[$stackPos-(9-1)], $self->semStack[$stackPos-(9-9)]); + $self->checkParam($self->semValue); }, - 278 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 292 => static function ($self, $stackPos) { + $self->semValue = new Node\Param(new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])), null, $self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-4)], $self->semStack[$stackPos-(6-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-1)]); }, - 279 => function ($stackPos) { - $this->semValue = 0; + 293 => null, + 294 => static function ($self, $stackPos) { + $self->semValue = new Node\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 280 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + 295 => static function ($self, $stackPos) { + $self->semValue = new Node\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 281 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; + 296 => null, + 297 => null, + 298 => static function ($self, $stackPos) { + $self->semValue = new Node\Name('static', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 282 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; + 299 => static function ($self, $stackPos) { + $self->semValue = $self->handleBuiltinTypes($self->semStack[$stackPos-(1-1)]); }, - 283 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; + 300 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier('array', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 284 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + 301 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier('callable', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 285 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); - $this->checkParam($this->semValue); + 302 => null, + 303 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 286 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); - $this->checkParam($this->semValue); + 304 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); }, - 287 => function ($stackPos) { - $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); + 305 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 288 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 306 => null, + 307 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 289 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 308 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); }, - 290 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 309 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 291 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 310 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); }, - 292 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 311 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 293 => function ($stackPos) { - $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 312 => static function ($self, $stackPos) { + $self->semValue = new Node\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 294 => function ($stackPos) { - $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); + 313 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); }, - 295 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 314 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 296 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 315 => static function ($self, $stackPos) { + $self->semValue = new Node\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 297 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 316 => null, + 317 => static function ($self, $stackPos) { + $self->semValue = new Node\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 298 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 318 => static function ($self, $stackPos) { + $self->semValue = new Node\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 299 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + 319 => null, + 320 => static function ($self, $stackPos) { + $self->semValue = null; }, - 300 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 321 => null, + 322 => static function ($self, $stackPos) { + $self->semValue = null; }, - 301 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 323 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; }, - 302 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 324 => static function ($self, $stackPos) { + $self->semValue = null; }, - 303 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + 325 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 304 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 326 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; }, - 305 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + 327 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-2)]); }, - 306 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 328 => static function ($self, $stackPos) { + $self->semValue = new Node\VariadicPlaceholder($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 307 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 329 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 308 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + 330 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 309 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 331 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(1-1)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 310 => function ($stackPos) { - $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 332 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(2-2)], true, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 311 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 333 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(2-2)], false, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 312 => function ($stackPos) { - $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 334 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(3-3)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(3-1)]); }, - 313 => function ($stackPos) { - $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 335 => null, + 336 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 314 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 337 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 315 => function ($stackPos) { - $this->semValue = null; + 338 => null, + 339 => null, + 340 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 316 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 341 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 317 => function ($stackPos) { - $this->semValue = null; + 342 => static function ($self, $stackPos) { + $self->semValue = new Node\StaticVar($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 318 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + 343 => static function ($self, $stackPos) { + $self->semValue = new Node\StaticVar($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 319 => function ($stackPos) { - $this->semValue = null; + 344 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; } else { $self->semValue = $self->semStack[$stackPos-(2-1)]; } }, - 320 => function ($stackPos) { - $this->semValue = array(); + 345 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 321 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + 346 => static function ($self, $stackPos) { + $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);; + if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)]; }, - 322 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-2)]); + 347 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Property($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-1)]); }, - 323 => function ($stackPos) { - $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 348 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ClassConst($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-1)]); + $self->checkClassConst($self->semValue, $stackPos-(5-2)); }, - 324 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 349 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ClassConst($self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-1)], $self->semStack[$stackPos-(6-4)]); + $self->checkClassConst($self->semValue, $stackPos-(6-2)); }, - 325 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 350 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ClassMethod($self->semStack[$stackPos-(10-5)], ['type' => $self->semStack[$stackPos-(10-2)], 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-7)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); + $self->checkClassMethod($self->semValue, $stackPos-(10-2)); }, - 326 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 351 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUse($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 327 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 352 => static function ($self, $stackPos) { + $self->semValue = new Stmt\EnumCase($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 328 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 353 => static function ($self, $stackPos) { + $self->semValue = null; /* will be skipped */ }, - 329 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); + 354 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 330 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 355 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 331 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 356 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 332 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 357 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 333 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 358 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Precedence($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 334 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 359 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(5-1)][0], $self->semStack[$stackPos-(5-1)][1], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 335 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 360 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 336 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 361 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 337 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 362 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 338 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 363 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); }, - 339 => function ($stackPos) { - if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } + 364 => null, + 365 => static function ($self, $stackPos) { + $self->semValue = array(null, $self->semStack[$stackPos-(1-1)]); }, - 340 => function ($stackPos) { - $this->semValue = array(); + 366 => static function ($self, $stackPos) { + $self->semValue = null; }, - 341 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + 367 => null, + 368 => null, + 369 => static function ($self, $stackPos) { + $self->semValue = 0; }, - 342 => function ($stackPos) { - $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); - $this->checkProperty($this->semValue, $stackPos-(5-2)); + 370 => static function ($self, $stackPos) { + $self->semValue = 0; }, - 343 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-1)]); - $this->checkClassConst($this->semValue, $stackPos-(5-2)); + 371 => null, + 372 => null, + 373 => static function ($self, $stackPos) { + $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; }, - 344 => function ($stackPos) { - $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); - $this->checkClassMethod($this->semValue, $stackPos-(10-2)); + 374 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC; }, - 345 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 375 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED; }, - 346 => function ($stackPos) { - $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + 376 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE; }, - 347 => function ($stackPos) { - $this->semValue = null; /* will be skipped */ + 377 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC_SET; }, - 348 => function ($stackPos) { - $this->semValue = array(); + 378 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED_SET; }, - 349 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 379 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE_SET; }, - 350 => function ($stackPos) { - $this->semValue = array(); + 380 => static function ($self, $stackPos) { + $self->semValue = Modifiers::STATIC; }, - 351 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 381 => static function ($self, $stackPos) { + $self->semValue = Modifiers::ABSTRACT; }, - 352 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 382 => static function ($self, $stackPos) { + $self->semValue = Modifiers::FINAL; }, - 353 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + 383 => static function ($self, $stackPos) { + $self->semValue = Modifiers::READONLY; }, - 354 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 384 => null, + 385 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 355 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 386 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 356 => function ($stackPos) { - $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 387 => static function ($self, $stackPos) { + $self->semValue = new Node\VarLikeIdentifier(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 357 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + 388 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyItem($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 358 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 389 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 359 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); + 390 => static function ($self, $stackPos) { + $self->semValue = []; }, - 360 => function ($stackPos) { - $this->semValue = null; + 391 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 361 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 392 => static function ($self, $stackPos) { + $self->semValue = []; }, - 362 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 393 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyHook($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-5)], ['flags' => $self->semStack[$stackPos-(5-2)], 'byRef' => $self->semStack[$stackPos-(5-3)], 'params' => [], 'attrGroups' => $self->semStack[$stackPos-(5-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + $self->checkPropertyHook($self->semValue, null); }, - 363 => function ($stackPos) { - $this->semValue = 0; + 394 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyHook($self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-8)], ['flags' => $self->semStack[$stackPos-(8-2)], 'byRef' => $self->semStack[$stackPos-(8-3)], 'params' => $self->semStack[$stackPos-(8-6)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + $self->checkPropertyHook($self->semValue, $stackPos-(8-5)); }, - 364 => function ($stackPos) { - $this->semValue = 0; + 395 => static function ($self, $stackPos) { + $self->semValue = null; }, - 365 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 396 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 366 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 397 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 367 => function ($stackPos) { - $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)]; + 398 => static function ($self, $stackPos) { + $self->semValue = 0; }, - 368 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; + 399 => static function ($self, $stackPos) { + $self->checkPropertyHookModifiers($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; }, - 369 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; + 400 => null, + 401 => null, + 402 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 370 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; + 403 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 371 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; + 404 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 372 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + 405 => null, + 406 => null, + 407 => static function ($self, $stackPos) { + $self->semValue = new Expr\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 373 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; + 408 => static function ($self, $stackPos) { + $self->semValue = new Expr\Assign($self->fixupArrayDestructuring($self->semStack[$stackPos-(3-1)]), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 374 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_READONLY; + 409 => static function ($self, $stackPos) { + $self->semValue = new Expr\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 375 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 410 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 376 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 377 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 378 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 379 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); - }, - 380 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 381 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 382 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, - 383 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; - }, - 384 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); - }, - 385 => function ($stackPos) { - $this->semValue = array(); - }, - 386 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 387 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 388 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 389 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 390 => function ($stackPos) { - $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 391 => function ($stackPos) { - $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 392 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 393 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; - }, - 394 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 395 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 396 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 397 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 398 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 399 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 400 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 401 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 402 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 403 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 404 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 405 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 406 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 407 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 408 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 409 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 410 => function ($stackPos) { - $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 411 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); - }, - 412 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 413 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 414 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 415 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 416 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 417 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 418 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 419 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 420 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 421 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 422 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 423 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 424 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 425 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 411 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + if (!$self->phpVersion->allowsAssignNewByReference()) { + $self->emitError(new Error('Cannot assign new by reference', $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]))); + } + }, - 426 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 412 => null, + 413 => null, + 414 => static function ($self, $stackPos) { + $self->semValue = new Expr\Clone_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 427 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 415 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 428 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 416 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 429 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 417 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 430 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 418 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 431 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 419 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 432 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 420 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 433 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 421 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 434 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 422 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 435 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 423 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 436 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 424 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 437 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 425 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 438 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 426 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 439 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 427 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 440 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 428 => static function ($self, $stackPos) { + $self->semValue = new Expr\PostInc($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 441 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 429 => static function ($self, $stackPos) { + $self->semValue = new Expr\PreInc($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 442 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 430 => static function ($self, $stackPos) { + $self->semValue = new Expr\PostDec($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 443 => function ($stackPos) { - $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 431 => static function ($self, $stackPos) { + $self->semValue = new Expr\PreDec($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 444 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 432 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BooleanOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 445 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + 433 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BooleanAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 446 => function ($stackPos) { - $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 434 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\LogicalOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 447 => function ($stackPos) { - $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 435 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\LogicalAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 448 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 436 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\LogicalXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 449 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 437 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 450 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 438 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 451 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 439 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 452 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 440 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 453 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 441 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 454 => function ($stackPos) { - $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 442 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 455 => function ($stackPos) { - $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 443 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 456 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); - $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); + 444 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 457 => function ($stackPos) { - $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 445 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 458 => function ($stackPos) { - $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 446 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 459 => function ($stackPos) { - $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 447 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 460 => function ($stackPos) { - $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 448 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 461 => function ($stackPos) { - $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 449 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 462 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; - $attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; - $this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs); + 450 => static function ($self, $stackPos) { + $self->semValue = new Expr\UnaryPlus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 463 => function ($stackPos) { - $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 451 => static function ($self, $stackPos) { + $self->semValue = new Expr\UnaryMinus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 464 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 452 => static function ($self, $stackPos) { + $self->semValue = new Expr\BooleanNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 465 => function ($stackPos) { - $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 453 => static function ($self, $stackPos) { + $self->semValue = new Expr\BitwiseNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 466 => function ($stackPos) { - $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 454 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Identical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 467 => function ($stackPos) { - $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 455 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\NotIdentical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 468 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 456 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Equal($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 469 => function ($stackPos) { - $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 457 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\NotEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 470 => function ($stackPos) { - $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 458 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Spaceship($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 471 => function ($stackPos) { - $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 459 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Smaller($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 472 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + 460 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\SmallerOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 473 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + 461 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Greater($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 474 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + 462 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\GreaterOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 475 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + 463 => static function ($self, $stackPos) { + $self->semValue = new Expr\Instanceof_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 476 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + 464 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 477 => function ($stackPos) { - $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); + 465 => static function ($self, $stackPos) { + $self->semValue = new Expr\Ternary($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 478 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); + 466 => static function ($self, $stackPos) { + $self->semValue = new Expr\Ternary($self->semStack[$stackPos-(4-1)], null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 479 => function ($stackPos) { - $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); + 467 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 480 => function ($stackPos) { - $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); - $this->checkClass($this->semValue[0], -1); + 468 => static function ($self, $stackPos) { + $self->semValue = new Expr\Isset_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 481 => function ($stackPos) { - $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 469 => static function ($self, $stackPos) { + $self->semValue = new Expr\Empty_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 482 => function ($stackPos) { - list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 470 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 483 => function ($stackPos) { - $this->semValue = array(); + 471 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 484 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; + 472 => static function ($self, $stackPos) { + $self->semValue = new Expr\Eval_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 485 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + 473 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 486 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 474 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 487 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 475 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Int_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 488 => function ($stackPos) { - $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 476 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]); + $attrs['kind'] = $self->getFloatCastKind($self->semStack[$stackPos-(2-1)]); + $self->semValue = new Expr\Cast\Double($self->semStack[$stackPos-(2-2)], $attrs); }, - 489 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 477 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\String_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 490 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 478 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Array_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 491 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 479 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Object_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 492 => function ($stackPos) { - $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 480 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Bool_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 493 => function ($stackPos) { - $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 481 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Unset_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 494 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 482 => static function ($self, $stackPos) { + $self->semValue = $self->createExitExpr($self->semStack[$stackPos-(2-1)], $stackPos-(2-1), $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 495 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 483 => static function ($self, $stackPos) { + $self->semValue = new Expr\ErrorSuppress($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 496 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 484 => null, + 485 => static function ($self, $stackPos) { + $self->semValue = new Expr\ShellExec($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 497 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 486 => static function ($self, $stackPos) { + $self->semValue = new Expr\Print_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 498 => function ($stackPos) { - $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 487 => static function ($self, $stackPos) { + $self->semValue = new Expr\Yield_(null, null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 499 => function ($stackPos) { - $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 488 => static function ($self, $stackPos) { + $self->semValue = new Expr\Yield_($self->semStack[$stackPos-(2-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 500 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 489 => static function ($self, $stackPos) { + $self->semValue = new Expr\Yield_($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 501 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 490 => static function ($self, $stackPos) { + $self->semValue = new Expr\YieldFrom($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 502 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 491 => static function ($self, $stackPos) { + $self->semValue = new Expr\Throw_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 503 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; + 492 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'returnType' => $self->semStack[$stackPos-(8-6)], 'expr' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); }, - 504 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 493 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); }, - 505 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 494 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'uses' => $self->semStack[$stackPos-(8-6)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); }, - 506 => function ($stackPos) { - $this->semValue = null; + 495 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); }, - 507 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 496 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); }, - 508 => function ($stackPos) { - $this->semValue = array(); + 497 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'returnType' => $self->semStack[$stackPos-(10-8)], 'expr' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); }, - 509 => function ($stackPos) { - $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); + 498 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); }, - 510 => function ($stackPos) { - foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; + 499 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'uses' => $self->semStack[$stackPos-(10-8)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); }, - 511 => function ($stackPos) { - $this->semValue = array(); + 500 => static function ($self, $stackPos) { + $self->semValue = array(new Stmt\Class_(null, ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])), $self->semStack[$stackPos-(8-3)]); + $self->checkClass($self->semValue[0], -1); }, - 512 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 501 => static function ($self, $stackPos) { + $self->semValue = new Expr\New_($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 513 => function ($stackPos) { - $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 502 => static function ($self, $stackPos) { + list($class, $ctorArgs) = $self->semStack[$stackPos-(2-2)]; $self->semValue = new Expr\New_($class, $ctorArgs, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 514 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 503 => static function ($self, $stackPos) { + $self->semValue = new Expr\New_($self->semStack[$stackPos-(2-2)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 515 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 504 => null, + 505 => null, + 506 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 516 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 507 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-3)]; }, - 517 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 508 => null, + 509 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 518 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 510 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 519 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 511 => static function ($self, $stackPos) { + $self->semValue = new Node\ClosureUse($self->semStack[$stackPos-(2-2)], $self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 520 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 512 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 521 => function ($stackPos) { - $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 513 => static function ($self, $stackPos) { + $self->semValue = new Expr\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 522 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 514 => static function ($self, $stackPos) { + $self->semValue = new Expr\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 523 => function ($stackPos) { - $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2; + 515 => static function ($self, $stackPos) { + $self->semValue = new Expr\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 524 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs); + 516 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 525 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG; - $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs); + 517 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 526 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 518 => null, + 519 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 527 => function ($stackPos) { - $this->semValue = Scalar\String_::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 520 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 528 => function ($stackPos) { - $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; - foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs); + 521 => static function ($self, $stackPos) { + $self->semValue = new Name\FullyQualified(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 529 => function ($stackPos) { - $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 522 => static function ($self, $stackPos) { + $self->semValue = new Name\Relative(substr($self->semStack[$stackPos-(1-1)], 10), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 530 => function ($stackPos) { - $this->semValue = Scalar\DNumber::fromString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 523 => null, + 524 => null, + 525 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 531 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 526 => static function ($self, $stackPos) { + $self->semValue = new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; }, - 532 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 527 => null, + 528 => null, + 529 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 533 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 530 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); foreach ($self->semValue as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } }; }, - 534 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); + 531 => static function ($self, $stackPos) { + foreach ($self->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = $self->semStack[$stackPos-(1-1)]; }, - 535 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true); + 532 => static function ($self, $stackPos) { + $self->semValue = array(); }, - 536 => function ($stackPos) { - $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true); + 533 => null, + 534 => static function ($self, $stackPos) { + $self->semValue = new Expr\ConstFetch($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 537 => function ($stackPos) { - $this->semValue = null; + 535 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Line($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 538 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 536 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\File($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 539 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 537 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Dir($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 540 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 538 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Class_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 541 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 539 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Trait_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 542 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 540 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Method($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 543 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 541 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Function_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 544 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 542 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Namespace_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 545 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 543 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Property($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 546 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 544 => static function ($self, $stackPos) { + $self->semValue = new Expr\ClassConstFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 547 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 545 => static function ($self, $stackPos) { + $self->semValue = new Expr\ClassConstFetch($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); }, - 548 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 546 => static function ($self, $stackPos) { + $self->semValue = new Expr\ClassConstFetch($self->semStack[$stackPos-(3-1)], new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(3-3)], $self->tokenEndStack[$stackPos-(3-3)])), $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; }, - 549 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 547 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_SHORT; + $self->semValue = new Expr\Array_($self->semStack[$stackPos-(3-2)], $attrs); }, - 550 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 548 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_LONG; + $self->semValue = new Expr\Array_($self->semStack[$stackPos-(4-3)], $attrs); + $self->createdArrays->attach($self->semValue); }, - 551 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 549 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->createdArrays->attach($self->semValue); }, - 552 => function ($stackPos) { - $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 550 => static function ($self, $stackPos) { + $self->semValue = Scalar\String_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->supportsUnicodeEscapes()); }, - 553 => function ($stackPos) { - $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 551 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; + foreach ($self->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = new Scalar\InterpolatedString($self->semStack[$stackPos-(3-2)], $attrs); }, - 554 => function ($stackPos) { - $this->semValue = null; + 552 => static function ($self, $stackPos) { + $self->semValue = $self->parseLNumber($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->allowsInvalidOctals()); }, - 555 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 553 => static function ($self, $stackPos) { + $self->semValue = Scalar\Float_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 556 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 554 => null, + 555 => null, + 556 => null, + 557 => static function ($self, $stackPos) { + $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)], $self->tokenEndStack[$stackPos-(3-3)]), true); }, - 557 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 558 => static function ($self, $stackPos) { + $self->semValue = $self->parseDocString($self->semStack[$stackPos-(2-1)], '', $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(2-2)], $self->tokenEndStack[$stackPos-(2-2)]), true); }, - 558 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 559 => static function ($self, $stackPos) { + $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)], $self->tokenEndStack[$stackPos-(3-3)]), true); }, - 559 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 560 => static function ($self, $stackPos) { + $self->semValue = null; }, - 560 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 561 => null, + 562 => null, + 563 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 561 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 564 => null, + 565 => null, + 566 => null, + 567 => null, + 568 => null, + 569 => null, + 570 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 562 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 571 => null, + 572 => null, + 573 => null, + 574 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 563 => function ($stackPos) { - $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; + 575 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 564 => function ($stackPos) { - $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; + 576 => null, + 577 => static function ($self, $stackPos) { + $self->semValue = new Expr\MethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 565 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 578 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafeMethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 566 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 579 => static function ($self, $stackPos) { + $self->semValue = null; }, - 567 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 580 => null, + 581 => null, + 582 => null, + 583 => static function ($self, $stackPos) { + $self->semValue = new Expr\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 568 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 584 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 569 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 585 => null, + 586 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 570 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 587 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 571 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 588 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable(new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])), $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; }, - 572 => function ($stackPos) { - $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 589 => static function ($self, $stackPos) { + $var = $self->semStack[$stackPos-(1-1)]->name; $self->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])) : $var; }, - 573 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 590 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 574 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 591 => null, + 592 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 575 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 593 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 576 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 594 => static function ($self, $stackPos) { + $self->semValue = new Expr\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 577 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 595 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 578 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 596 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 579 => function ($stackPos) { - $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; + 597 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 580 => function ($stackPos) { - $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 598 => null, + 599 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 581 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); + 600 => null, + 601 => null, + 602 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 582 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + 603 => null, + 604 => static function ($self, $stackPos) { + $self->semValue = new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; }, - 583 => function ($stackPos) { - /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ + 605 => static function ($self, $stackPos) { + $self->semValue = new Expr\List_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); $self->semValue->setAttribute('kind', Expr\List_::KIND_LIST); + $self->postprocessList($self->semValue); }, - 584 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + 606 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; $end = count($self->semValue)-1; if ($self->semValue[$end]->value instanceof Expr\Error) array_pop($self->semValue); }, - 585 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 607 => null, + 608 => static function ($self, $stackPos) { + /* do nothing -- prevent default action of $$=$self->semStack[$1]. See $551. */ }, - 586 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 609 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; }, - 587 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 610 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 588 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 611 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 589 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 612 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(2-2)], null, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, - 590 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 613 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 591 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 614 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 592 => function ($stackPos) { - $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 615 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-1)], true, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 593 => function ($stackPos) { - $this->semValue = null; + 616 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 594 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 617 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(2-2)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), true); }, - 595 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + 618 => static function ($self, $stackPos) { + /* Create an Error node now to remember the position. We'll later either report an error, + or convert this into a null element, depending on whether this is a creation or destructuring context. */ + $attrs = $self->createEmptyElemAttributes($self->tokenPos); + $self->semValue = new Node\ArrayItem(new Expr\Error($attrs), null, false, $attrs); }, - 596 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + 619 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 597 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); + 620 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; }, - 598 => function ($stackPos) { - $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 621 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); }, - 599 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 622 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)]); }, - 600 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 623 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]); $attrs['rawValue'] = $self->semStack[$stackPos-(1-1)]; $self->semValue = new Node\InterpolatedStringPart($self->semStack[$stackPos-(1-1)], $attrs); }, - 601 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + 624 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 602 => function ($stackPos) { - $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 625 => null, + 626 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); }, - 603 => function ($stackPos) { - $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 627 => static function ($self, $stackPos) { + $self->semValue = new Expr\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 604 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 628 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 605 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + 629 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 606 => function ($stackPos) { - $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + 630 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); }, - 607 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + 631 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); }, - 608 => function ($stackPos) { - $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 632 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; }, - 609 => function ($stackPos) { - $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + 633 => static function ($self, $stackPos) { + $self->semValue = new Scalar\String_($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 610 => function ($stackPos) { - $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + 634 => static function ($self, $stackPos) { + $self->semValue = $self->parseNumString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); }, - 611 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + 635 => static function ($self, $stackPos) { + $self->semValue = $self->parseNumString('-' . $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); }, + 636 => null, ]; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php b/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php new file mode 100644 index 0000000000..e1aa4b1f3e --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php @@ -0,0 +1,2786 @@ +'", + "T_IS_GREATER_OR_EQUAL", + "'.'", + "T_SL", + "T_SR", + "'+'", + "'-'", + "'*'", + "'/'", + "'%'", + "'!'", + "T_INSTANCEOF", + "'~'", + "T_INC", + "T_DEC", + "T_INT_CAST", + "T_DOUBLE_CAST", + "T_STRING_CAST", + "T_ARRAY_CAST", + "T_OBJECT_CAST", + "T_BOOL_CAST", + "T_UNSET_CAST", + "'@'", + "T_POW", + "'['", + "T_NEW", + "T_CLONE", + "T_EXIT", + "T_IF", + "T_ELSEIF", + "T_ELSE", + "T_ENDIF", + "T_LNUMBER", + "T_DNUMBER", + "T_STRING", + "T_STRING_VARNAME", + "T_VARIABLE", + "T_NUM_STRING", + "T_INLINE_HTML", + "T_ENCAPSED_AND_WHITESPACE", + "T_CONSTANT_ENCAPSED_STRING", + "T_ECHO", + "T_DO", + "T_WHILE", + "T_ENDWHILE", + "T_FOR", + "T_ENDFOR", + "T_FOREACH", + "T_ENDFOREACH", + "T_DECLARE", + "T_ENDDECLARE", + "T_AS", + "T_SWITCH", + "T_MATCH", + "T_ENDSWITCH", + "T_CASE", + "T_DEFAULT", + "T_BREAK", + "T_CONTINUE", + "T_GOTO", + "T_FUNCTION", + "T_FN", + "T_CONST", + "T_RETURN", + "T_TRY", + "T_CATCH", + "T_FINALLY", + "T_USE", + "T_INSTEADOF", + "T_GLOBAL", + "T_STATIC", + "T_ABSTRACT", + "T_FINAL", + "T_PRIVATE", + "T_PROTECTED", + "T_PUBLIC", + "T_READONLY", + "T_PUBLIC_SET", + "T_PROTECTED_SET", + "T_PRIVATE_SET", + "T_VAR", + "T_UNSET", + "T_ISSET", + "T_EMPTY", + "T_HALT_COMPILER", + "T_CLASS", + "T_TRAIT", + "T_INTERFACE", + "T_ENUM", + "T_EXTENDS", + "T_IMPLEMENTS", + "T_OBJECT_OPERATOR", + "T_NULLSAFE_OBJECT_OPERATOR", + "T_LIST", + "T_ARRAY", + "T_CALLABLE", + "T_CLASS_C", + "T_TRAIT_C", + "T_METHOD_C", + "T_FUNC_C", + "T_PROPERTY_C", + "T_LINE", + "T_FILE", + "T_START_HEREDOC", + "T_END_HEREDOC", + "T_DOLLAR_OPEN_CURLY_BRACES", + "T_CURLY_OPEN", + "T_PAAMAYIM_NEKUDOTAYIM", + "T_NAMESPACE", + "T_NS_C", + "T_DIR", + "T_NS_SEPARATOR", + "T_ELLIPSIS", + "T_NAME_FULLY_QUALIFIED", + "T_NAME_QUALIFIED", + "T_NAME_RELATIVE", + "T_ATTRIBUTE", + "';'", + "']'", + "'('", + "')'", + "'{'", + "'}'", + "'`'", + "'\"'", + "'$'" + ); + + protected array $tokenToSymbol = array( + 0, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 56, 170, 172, 171, 55, 172, 172, + 165, 166, 53, 51, 8, 52, 48, 54, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 31, 163, + 44, 16, 46, 30, 68, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 70, 172, 164, 36, 172, 169, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 167, 35, 168, 58, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 1, 2, 3, 4, + 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, + 41, 42, 43, 45, 47, 49, 50, 57, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162 + ); + + protected array $action = array( + 126, 127, 128, 570, 129, 130, 955, 765, 766, 767, + 131, 38, 849, -85,-32766, 1376,-32766,-32766,-32766, 0, + 840, 1134, 1135, 1136, 1130, 1129, 1128, 1137, 1131, 1132, + 1133,-32766,-32766,-32766, 851, 759, 758,-32766,-32766,-32766, + -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, + -32767, 1005,-32766, 1045, -570, 768, 1134, 1135, 1136, 1130, + 1129, 1128, 1137, 1131, 1132, 1133, 388, 387, 842, 263, + 132, 389, 772, 773, 774, 775, 430, 845, 431, -85, + 2, 36, 246, 47, 291, 829, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 805, 571, 806, 807, + 808, 809, 797, 798, 344, 345, 800, 801, 786, 787, + 788, 790, 791, 792, 359, 832, 833, 834, 835, 836, + 572, -570, -570, -332, 793, 794, 573, 574, 236, 817, + 815, 816, 828, 812, 813, 26, -194, 575, 576, 811, + 577, 578, 579, 580, 323, 581, 582, 876, 844, 877, + 297, 298, 814, 583, 584, 722, 133, 846, 126, 127, + 128, 570, 129, 130, 1078, 765, 766, 767, 131, 38, + -32766, 35, 735, 1038, 1037, 1036, 1042, 1039, 1040, 1041, + -32766,-32766,-32766, 1006, 104, 105, 106, 107, 108, -372, + 275, -372,-32766, 759, 758, 1054, 850,-32766,-32766,-32766, + 848,-32766, 109,-32766,-32766,-32766,-32766,-32766,-32766,-32766, + 134, 476, 477, 768,-32766,-32766,-32766, 1054,-32766, 290, + -32766,-32766,-32766,-32766,-32766, 616, 143, 263, 132, 389, + 772, 773, 774, 775, 249,-32766, 431,-32766,-32766,-32766, + -32766, 290, 307, 829, 776, 777, 778, 779, 780, 781, + 782, 783, 784, 785, 805, 571, 806, 807, 808, 809, + 797, 798, 344, 345, 800, 801, 786, 787, 788, 790, + 791, 792, 359, 832, 833, 834, 835, 836, 572, 958, + -273, -332, 793, 794, 573, 574, 840, 817, 815, 816, + 828, 812, 813, 1301, -194, 575, 576, 811, 577, 578, + 579, 580, 566, 581, 582, 1108, 82, 83, 84, 748, + 814, 583, 584, 309, 146, 789, 760, 761, 762, 763, + 764, 235, 765, 766, 767, 802, 803, 37, 957, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 157, 275,-32766,-32766,-32766,-32767,-32767, + -32767,-32767, 101, 102, 103,-32766, 109, 1313, 622, 318, + 768,-32766,-32766,-32766, 849, 1361,-32766, 1107,-32766,-32766, + -32766, 340, 1360, 1357, 769, 770, 771, 772, 773, 774, + 775, 341,-32766, 838,-32766,-32766, 1386, 374, 1281, 1387, + 829, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 805, 827, 806, 807, 808, 809, 797, 798, 799, + 826, 800, 801, 786, 787, 788, 790, 791, 792, 831, + 832, 833, 834, 835, 836, 837, 1077, 431, -567, 793, + 794, 795, 796, 148, 817, 815, 816, 828, 812, 813, + 380, -193, 804, 810, 811, 818, 819, 821, 820, 138, + 822, 823, 840, 321, 396, 285, 24, 814, 825, 824, + 49, 50, 51, 522, 52, 53, 398, -110, 7, 849, + 54, 55, -110, 56, -110,-32766,-32766,-32766, 1342, 303, + 125, 1123, -110, -110, -110, -110, -110, -110, -110, -110, + -110, -110, -110, 161, 750, -567, -567, 291, 974, 975, + -32766,-32766,-32766, 976, 448, 285, 1276, 1275, 1277, 57, + 58, -567,-32766,-32766, 59, 1109, 60, 243, 244, 61, + 62, 63, 64, 65, 66, 67, 68,-32766, 28, 265, + 69, 446, 523, 490, -346, 449, 1307, 1308, 524, 139, + 849, 1051, 450, 321, 1305, 42, 20, 525, 934, 526, + 934, 527, 74, 528, -568, 698, 529, 530, 321, 386, + 387, 44, 45, 452, 383, 382, 1054, 46, 531, 430, + 974, 975, 451, 372, 339, 976, 1281, 855, 725, 934, + 1267, 759, 758,-32766, 970, 533, 534, 535, 149, 934, + 281, 699, -78, -566, 1274, 102, 103, 537, 538, -193, + 1293, 1294, 1295, 1296, 1298, 1290, 1291, 295, 1054, 726, + 466, 467, 468, 1297, 1292, 700, 701, 1276, 1275, 1277, + 296, -568, -568, 70, -153, -153, -153, 316, 317, 321, + 1272, 924, 290, 924, 1276, 1275, 1277, -568, 1051, -153, + 281, -153, 1150, -153, 81, -153, 740, 151, 321, -574, + 152, 759, 758,-32766, 1053, 381, 876, 849, 877, 153, + -566, -566, 924, 1054, 1051, 155, 974, 975, -606, 491, + -606, 532, 924, 1276, 1275, 1277, -566, 33, 1054, 910, + 970, -110, -110, -110, 28, 266, -58, 281, -573, 1054, + -32766,-32766, -110, -110, 665, 21, 849, -110, -57, -564, + 1305, 684, 685, 147, 413, 123, -110, 384, 385, 124, + 936, 135, 936, 136, 720,-32766, 720, -153, 142, 48, + 32, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 390, 391, 1267, 296, 759, 758, + 74, 936, 156, 934, 158, 720, 321, -4, 934, 159, + 934, 936, 160, 537, 538, 720, 1293, 1294, 1295, 1296, + 1298, 1290, 1291, 1183, 1185, 934, -564, -564, -565, 1297, + 1292, 759, 758, 727, -564,-32766, 656, 657, -306, 72, + 730, 1274, -564, -87, 317, 321, 299, 300,-32766,-32766, + -32766, -84,-32766, -78,-32766, 737,-32766, -73, -72,-32766, + -71, -70, 379, -69,-32766,-32766,-32766, -68,-32766, -67, + -32766,-32766, -66, -65, 1274, -46,-32766, 427, 28, 265, + -18,-32766,-32766,-32766, 140,-32766, 924,-32766,-32766,-32766, + 849, 924,-32766, 924, 1305, -565, -565,-32766,-32766,-32766, + 274, -564, -564,-32766,-32766, 282, 736, 739, 924,-32766, + 427, -565, 933, 381, 145, 443, 286, -564, 951, 73, + 294,-32766, -302, -572, 974, 975, 279, 280, 283, 532, + 1267, 28, 266, 284, 329, 275, 109, 536, 970, -110, + -110, -110, 287, 849, 292, 293, 840, 1305, 538, 694, + 1293, 1294, 1295, 1296, 1298, 1290, 1291, 709, 144, 587, + 711, 11, 10, 1297, 1292, 991, 849, 1141, 473, 720, + 936,-32766, 936, 72, 720, -4, 720, 1388, 317, 321, + -50, 970, 672, 1267, 687, 666, 501, 936, 971, 301, + 308, 720, 671, 1312, 302, 1314,-32766, 688, 953, -530, + -520, 538, 40, 1293, 1294, 1295, 1296, 1298, 1290, 1291, + 848, 41, 8, 137, 654, 27, 1297, 1292, 304, 34, + 593, 620, 296,-32766, 0, 0, 72, 0, 0, 1274, + 0, 317, 321, 0, 0, 0,-32766,-32766,-32766, -276, + -32766, 0,-32766, 0,-32766, 0, 0,-32766, 0, 0, + 0, 0,-32766,-32766,-32766, 934,-32766, 0,-32766,-32766, + 0, 0, 1274, 378,-32766, 427, 745, -600, 412,-32766, + -32766,-32766, 746,-32766, 868,-32766,-32766,-32766, 934, 915, + -32766, 1015, 992, 999, 989,-32766,-32766,-32766, 1000,-32766, + 913,-32766,-32766, 987, 1112, 1274, 1115,-32766, 427, 1116, + 1113, 1152,-32766,-32766,-32766, 1114,-32766, 1120,-32766,-32766, + -32766, 1302, 860,-32766, 1329, 1346, 1379, 496,-32766,-32766, + -32766, 659,-32766, -599,-32766,-32766, -598, -574, 1274, 600, + -32766, 427, -573, -572, -571,-32766,-32766,-32766, 924,-32766, + -514,-32766,-32766,-32766, 1, 29,-32766, -274, 30, 39, + 43,-32766,-32766,-32766, -251, -251, -251,-32766,-32766, 71, + 381, 924, 75,-32766, 427, 76, 77, 78, 1281, 79, + 80, 974, 975, 141, 150,-32766, 532, -250, -250, -250, + -273, 154, 241, 381, 910, 970, -110, -110, -110, 325, + 360, 361, 362, 363, 974, 975, 364, 365, -16, 532, + 366, 367, 368, 369, 370, 373, 444, 910, 970, -110, + -110, -110,-32766, 13, 565, 371, 1306, 936, 1274, 14, + 416, 720, -251, 15, 16,-32766,-32766,-32766, 18,-32766, + 354,-32766, 411,-32766, 492, 493,-32766, 500, 503, 504, + 936,-32766,-32766,-32766, 720, -250, 505,-32766,-32766, 849, + 506, 510, 511,-32766, 427, 512, 519, 598, 704, 1080, + 1223, 1303, 1079, 1060, 1262,-32766, 1056, -278, -102, 12, + 17, 22, 312, 410, 612, 617, 645, 710, 1227, 1280, + 1224, 1358, 0, 315, -110, -110, 375, 721, 724, -110, + 728, 729, 731, 732, 733, 734, 738, 750, -110, 723, + 751, 0, 742, 911, 1383, 1385, 0,-32766, 871, 870, + 964, 1007, 1384, 963, 961, 962, 965, 1255, 944, 954, + 942, 1151, 1147, 1101, 997, 998, 643, 1382, 1340, 296, + 1355, 0, 74, 1240, 321, 0, 0, 0, 321 + ); + + protected array $actionCheck = array( + 2, 3, 4, 5, 6, 7, 1, 9, 10, 11, + 12, 13, 82, 31, 116, 85, 9, 10, 11, 0, + 80, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 9, 10, 11, 1, 37, 38, 30, 140, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 31, 30, 1, 70, 57, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 106, 107, 80, 71, + 72, 73, 74, 75, 76, 77, 116, 80, 80, 97, + 8, 151, 152, 70, 30, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 137, 138, 8, 126, 127, 128, 129, 14, 131, + 132, 133, 134, 135, 136, 8, 8, 139, 140, 141, + 142, 143, 144, 145, 70, 147, 148, 106, 160, 108, + 137, 138, 154, 155, 156, 167, 158, 160, 2, 3, + 4, 5, 6, 7, 166, 9, 10, 11, 12, 13, + 116, 8, 167, 119, 120, 121, 122, 123, 124, 125, + 9, 10, 11, 163, 51, 52, 53, 54, 55, 106, + 57, 108, 116, 37, 38, 141, 163, 9, 10, 11, + 159, 30, 69, 32, 33, 34, 35, 36, 37, 38, + 8, 137, 138, 57, 9, 10, 11, 141, 30, 165, + 32, 33, 34, 35, 36, 1, 8, 71, 72, 73, + 74, 75, 76, 77, 8, 30, 80, 32, 33, 34, + 35, 165, 8, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 73, + 166, 166, 126, 127, 128, 129, 80, 131, 132, 133, + 134, 135, 136, 1, 166, 139, 140, 141, 142, 143, + 144, 145, 85, 147, 148, 163, 9, 10, 11, 167, + 154, 155, 156, 8, 158, 2, 3, 4, 5, 6, + 7, 97, 9, 10, 11, 12, 13, 30, 122, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 16, 57, 9, 10, 11, 44, 45, + 46, 47, 48, 49, 50, 9, 69, 150, 52, 8, + 57, 9, 10, 11, 82, 1, 30, 1, 32, 33, + 34, 8, 8, 1, 71, 72, 73, 74, 75, 76, + 77, 8, 30, 80, 32, 33, 80, 8, 1, 83, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 1, 80, 70, 126, + 127, 128, 129, 14, 131, 132, 133, 134, 135, 136, + 8, 8, 139, 140, 141, 142, 143, 144, 145, 167, + 147, 148, 80, 171, 8, 30, 101, 154, 155, 156, + 2, 3, 4, 5, 6, 7, 106, 101, 108, 82, + 12, 13, 106, 15, 108, 9, 10, 11, 1, 113, + 14, 126, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 14, 167, 137, 138, 30, 117, 118, + 9, 10, 11, 122, 8, 30, 159, 160, 161, 51, + 52, 153, 9, 10, 56, 168, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 140, 70, 71, + 72, 73, 74, 31, 168, 8, 78, 79, 80, 167, + 82, 116, 8, 171, 86, 87, 88, 89, 1, 91, + 1, 93, 165, 95, 70, 80, 98, 99, 171, 106, + 107, 103, 104, 105, 106, 107, 141, 109, 110, 116, + 117, 118, 8, 115, 116, 122, 1, 8, 31, 1, + 122, 37, 38, 116, 131, 127, 128, 129, 14, 1, + 165, 116, 16, 70, 80, 49, 50, 139, 140, 166, + 142, 143, 144, 145, 146, 147, 148, 149, 141, 31, + 132, 133, 134, 155, 156, 140, 141, 159, 160, 161, + 162, 137, 138, 165, 75, 76, 77, 169, 170, 171, + 116, 84, 165, 84, 159, 160, 161, 153, 116, 90, + 165, 92, 163, 94, 167, 96, 167, 14, 171, 165, + 14, 37, 38, 116, 140, 106, 106, 82, 108, 14, + 137, 138, 84, 141, 116, 14, 117, 118, 164, 167, + 166, 122, 84, 159, 160, 161, 153, 14, 141, 130, + 131, 132, 133, 134, 70, 71, 16, 165, 165, 141, + 51, 52, 117, 118, 75, 76, 82, 122, 16, 70, + 86, 75, 76, 101, 102, 16, 131, 106, 107, 16, + 163, 16, 163, 16, 167, 140, 167, 168, 16, 70, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 106, 107, 122, 162, 37, 38, + 165, 163, 16, 1, 16, 167, 171, 0, 1, 16, + 1, 163, 16, 139, 140, 167, 142, 143, 144, 145, + 146, 147, 148, 59, 60, 1, 137, 138, 70, 155, + 156, 37, 38, 31, 70, 74, 111, 112, 35, 165, + 31, 80, 153, 31, 170, 171, 137, 138, 87, 88, + 89, 31, 91, 31, 93, 31, 95, 31, 31, 98, + 31, 31, 153, 31, 103, 104, 105, 31, 74, 31, + 109, 110, 31, 31, 80, 31, 115, 116, 70, 71, + 31, 87, 88, 89, 31, 91, 84, 93, 127, 95, + 82, 84, 98, 84, 86, 137, 138, 103, 104, 105, + 31, 137, 138, 109, 110, 31, 31, 31, 84, 115, + 116, 153, 31, 106, 31, 108, 37, 153, 38, 158, + 113, 127, 35, 165, 117, 118, 35, 35, 35, 122, + 122, 70, 71, 35, 35, 57, 69, 130, 131, 132, + 133, 134, 37, 82, 37, 37, 80, 86, 140, 77, + 142, 143, 144, 145, 146, 147, 148, 80, 70, 89, + 92, 154, 97, 155, 156, 163, 82, 82, 97, 167, + 163, 85, 163, 165, 167, 168, 167, 83, 170, 171, + 31, 131, 100, 122, 94, 90, 97, 163, 131, 135, + 135, 167, 96, 150, 136, 150, 140, 100, 158, 153, + 153, 140, 163, 142, 143, 144, 145, 146, 147, 148, + 159, 163, 153, 31, 113, 153, 155, 156, 114, 167, + 157, 157, 162, 74, -1, -1, 165, -1, -1, 80, + -1, 170, 171, -1, -1, -1, 87, 88, 89, 166, + 91, -1, 93, -1, 95, -1, -1, 98, -1, -1, + -1, -1, 103, 104, 105, 1, 74, -1, 109, 110, + -1, -1, 80, 153, 115, 116, 163, 165, 168, 87, + 88, 89, 163, 91, 163, 93, 127, 95, 1, 163, + 98, 163, 163, 163, 163, 103, 104, 105, 163, 74, + 163, 109, 110, 163, 163, 80, 163, 115, 116, 163, + 163, 163, 87, 88, 89, 163, 91, 163, 93, 127, + 95, 164, 164, 98, 164, 164, 164, 102, 103, 104, + 105, 164, 74, 165, 109, 110, 165, 165, 80, 81, + 115, 116, 165, 165, 165, 87, 88, 89, 84, 91, + 165, 93, 127, 95, 165, 165, 98, 166, 165, 165, + 165, 103, 104, 105, 100, 101, 102, 109, 110, 165, + 106, 84, 165, 115, 116, 165, 165, 165, 1, 165, + 165, 117, 118, 165, 165, 127, 122, 100, 101, 102, + 166, 165, 165, 106, 130, 131, 132, 133, 134, 165, + 165, 165, 165, 165, 117, 118, 165, 165, 31, 122, + 165, 165, 165, 165, 165, 165, 165, 130, 131, 132, + 133, 134, 74, 166, 165, 165, 170, 163, 80, 166, + 168, 167, 168, 166, 166, 87, 88, 89, 166, 91, + 166, 93, 166, 95, 166, 166, 98, 166, 166, 166, + 163, 103, 104, 105, 167, 168, 166, 109, 110, 82, + 166, 166, 166, 115, 116, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 127, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, -1, 167, 117, 118, 167, 167, 167, 122, + 167, 167, 167, 167, 167, 167, 167, 167, 131, 167, + 167, -1, 168, 168, 168, 168, -1, 140, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 162, + 168, -1, 165, 169, 171, -1, -1, -1, 171 + ); + + protected array $actionBase = array( + 0, -2, 156, 559, 757, 1004, 1027, 485, 292, 357, + -60, -12, 588, 759, 759, 774, 759, 557, 752, 892, + 598, 598, 598, 827, 313, 313, 827, 313, 711, 711, + 711, 711, 744, 744, 965, 965, 998, 932, 899, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, + 1088, 1088, 33, 20, 224, 1080, 673, 1056, 1062, 1058, + 1063, 1054, 1053, 1057, 1059, 1064, 1109, 1110, 833, 1108, + 1112, 1060, 907, 1055, 1061, 888, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, + 297, 297, 356, 476, 513, 501, 501, 501, 501, 501, + 501, 501, 501, 501, 501, 501, 501, 501, 501, 501, + 501, 501, 501, 501, 501, 624, 624, 22, 22, 22, + 362, 811, 758, 811, 811, 811, 811, 811, 811, 811, + 811, 346, 205, 188, 714, 171, 171, 7, 7, 7, + 7, 7, 376, 1117, 54, 585, 585, 314, 314, 314, + 314, 365, 554, 83, 435, 397, 556, 477, 463, 532, + 532, 558, 558, 76, 76, 558, 558, 558, 133, 133, + 547, 547, 547, 547, 41, 217, 806, 382, 382, 382, + 382, 806, 806, 806, 806, 795, 996, 806, 806, 806, + 494, 533, 708, 649, 649, 560, -70, -70, 560, 800, + -70, 487, 975, 316, 982, -102, 807, -40, 514, -102, + 1000, 368, 639, 639, 659, 639, 639, 639, 801, 611, + 801, 1052, 836, 836, 794, 776, 894, 1082, 1065, 832, + 1106, 847, 1107, 1083, 489, 488, -16, 13, 74, 772, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1113, 554, 1052, -3, 1104, 1105, 1113, 1113, + 1113, 554, 554, 554, 554, 554, 554, 554, 554, 799, + 554, 554, 675, -3, 629, 636, -3, 849, 554, 797, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 512, 33, 33, 20, 5, 5, 33, 142, 52, 5, + 5, 5, 337, 5, 33, 33, 33, 611, 828, 813, + 638, -18, 814, 443, 828, 828, 828, 115, 114, 128, + 753, 837, 370, 816, 816, 835, 929, 929, 816, 834, + 816, 835, 816, 816, 929, 929, 810, 929, 202, 506, + 373, 442, 537, 929, 234, 816, 816, 816, 816, 805, + 929, 72, 544, 816, 226, 218, 816, 816, 805, 804, + 824, 808, 929, 929, 929, 805, 389, 808, 808, 808, + 853, 859, 851, 819, 361, 305, 579, 163, 830, 819, + 819, 816, 456, 851, 819, 851, 819, 790, 819, 819, + 819, 851, 819, 834, 383, 819, 736, 574, 127, 819, + 816, 19, 944, 947, 762, 950, 934, 951, 991, 952, + 954, 1070, 925, 967, 935, 955, 999, 933, 930, 831, + 699, 703, 809, 796, 919, 817, 817, 817, 912, 917, + 817, 817, 817, 817, 817, 817, 817, 817, 699, 897, + 860, 820, 976, 705, 707, 1041, 793, 1085, 1114, 975, + 944, 954, 770, 935, 955, 933, 930, 792, 791, 786, + 788, 782, 780, 777, 779, 803, 1043, 958, 789, 712, + 1012, 977, 1084, 1066, 978, 981, 1016, 1044, 861, 1045, + 1086, 838, 1087, 1090, 898, 985, 1071, 817, 911, 852, + 900, 982, 918, 699, 901, 1046, 997, 802, 1018, 1019, + 1069, 821, 844, 902, 1091, 986, 987, 988, 1073, 1074, + 798, 1003, 823, 1021, 839, 850, 1022, 1023, 1030, 1034, + 1075, 1092, 1076, 908, 1077, 866, 845, 931, 846, 1093, + 429, 843, 848, 858, 990, 584, 974, 1078, 1002, 1094, + 1035, 1036, 1039, 1095, 1096, 959, 868, 1007, 840, 1008, + 964, 869, 870, 643, 857, 1047, 841, 842, 855, 646, + 655, 1097, 1098, 1099, 966, 825, 822, 871, 875, 1048, + 829, 1050, 1100, 661, 877, 1101, 1042, 738, 743, 586, + 692, 680, 746, 818, 1079, 812, 854, 815, 989, 743, + 826, 880, 1102, 881, 883, 886, 1040, 887, 1014, 1103, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 468, 468, 468, 468, 468, 468, + 313, 313, 313, 313, 313, 468, 468, 468, 468, 468, + 468, 468, 313, 468, 468, 468, 313, 0, 0, 313, + 0, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, + 468, 468, 468, 468, 468, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 297, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 297, 524, 524, + 297, 297, 297, 297, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 524, 297, 297, 297, 0, 297, 297, + 297, 297, 297, 297, 297, 810, 524, 524, 524, 524, + 133, 133, 133, 133, -95, -95, -95, 524, 524, 133, + 524, 810, 524, 524, 524, 524, 524, 524, 524, 524, + 524, 0, 0, 524, 524, 524, 524, -3, -70, 524, + 834, 834, 834, 834, 524, 524, 524, 524, -70, -70, + 524, 524, 524, 0, 0, 0, 133, 133, -3, 0, + 0, -3, 391, 0, 834, 206, 834, 206, 524, 391, + 810, 374, 524, 489, 0, 0, 0, 0, 0, 0, + 0, -3, 834, -3, 554, -70, -70, 554, 554, 5, + 33, 374, 612, 612, 612, 612, 33, 0, 0, 0, + 0, 0, 611, 810, 810, 810, 810, 810, 810, 810, + 810, 810, 810, 810, 810, 834, 0, 810, 0, 810, + 810, 834, 834, 834, 0, 0, 0, 0, 0, 0, + 0, 0, 929, 0, 0, 0, 0, 0, 0, 0, + 834, 0, 929, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 834, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 817, 821, 0, 0, 821, 0, 817, 817, 817, + 0, 0, 0, 857, 829 + ); + + protected array $actionDefault = array( + 3,32767, 102,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 100,32767, 618, 618, + 618, 618,32767,32767, 255, 102,32767,32767, 489, 406, + 406, 406,32767,32767, 562, 562, 562, 562, 562,32767, + 32767,32767,32767,32767,32767, 489,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 36, 7, 8, 10, + 11, 49, 17, 328, 100,32767,32767,32767,32767,32767, + 32767,32767,32767, 102,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767, 393, 611,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 493, 472, 473, 475, + 476, 405, 563, 617, 331, 614, 333, 404, 145, 343, + 334, 243, 259, 494, 260, 495, 498, 499, 216, 390, + 149, 150, 436, 490, 438, 488, 492, 437, 411, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 409, 410, 491,32767,32767, 469, 468, 467, + 434,32767,32767,32767,32767,32767,32767,32767,32767, 102, + 32767, 435, 439, 442, 408, 440, 441, 458, 459, 456, + 457, 460,32767,32767, 320,32767,32767, 461, 462, 463, + 464, 371, 195, 369,32767,32767, 443, 320, 111,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 449, 450, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 102,32767, 100, + 506, 556, 466, 444, 445,32767, 531,32767, 102,32767, + 533,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767, 558, 431, 433, 526, 612, 412, 615,32767, 519, + 100, 195,32767, 532, 195, 195,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 557,32767, 625, 519, + 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110,32767, 195, 110,32767, 110, 110,32767,32767, + 100, 195, 195, 195, 195, 195, 195, 195, 195, 534, + 195, 195, 190,32767, 269, 271, 102, 580, 195, 536, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 393,32767,32767,32767,32767, 519, 454, 138, + 32767, 521, 138, 564, 446, 447, 448, 564, 564, 564, + 316, 293,32767,32767,32767,32767, 534, 534, 100, 100, + 100, 100,32767,32767,32767,32767, 111, 505, 99, 99, + 99, 99, 99, 103, 101,32767,32767,32767,32767, 224, + 32767, 101, 99,32767, 101, 101,32767,32767, 224, 226, + 213, 228,32767, 584, 585, 224, 101, 228, 228, 228, + 248, 248, 508, 322, 101, 99, 101, 101, 197, 322, + 322,32767, 101, 508, 322, 508, 322, 199, 322, 322, + 322, 508, 322,32767, 101, 322, 215, 99, 99, 322, + 32767,32767,32767,32767, 521,32767,32767,32767,32767,32767, + 32767,32767, 223,32767,32767,32767,32767,32767,32767,32767, + 32767, 551,32767, 569, 582, 452, 453, 455, 568, 566, + 477, 478, 479, 480, 481, 482, 483, 485, 613,32767, + 525,32767,32767,32767, 342,32767, 623,32767,32767,32767, + 9, 74, 514, 42, 43, 51, 57, 540, 541, 542, + 543, 537, 538, 544, 539,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 624,32767, 564,32767,32767,32767,32767, 451, 546, 590, + 32767,32767, 565, 616,32767,32767,32767,32767,32767,32767, + 32767, 138,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 551,32767, 136,32767,32767,32767,32767,32767, + 32767,32767,32767, 547,32767,32767,32767, 564,32767,32767, + 32767,32767, 318, 315,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 564,32767,32767,32767,32767,32767, 295,32767, 312,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 389, 521, 298, + 300, 301,32767,32767,32767,32767, 365,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 152, 152, 3, 3, 345, 152, 152, 152, 345, 345, + 152, 345, 345, 345, 152, 152, 152, 152, 152, 152, + 152, 281, 185, 263, 266, 248, 248, 152, 357, 152, + 391, 391, 400 + ); + + protected array $goto = array( + 194, 194, 1052, 487, 705, 278, 278, 278, 278, 990, + 489, 548, 548, 907, 865, 907, 907, 548, 714, 548, + 548, 548, 548, 548, 548, 548, 548, 166, 166, 166, + 166, 218, 195, 191, 191, 176, 178, 213, 191, 191, + 191, 191, 191, 192, 192, 192, 192, 192, 186, 187, + 188, 189, 190, 215, 213, 216, 545, 546, 428, 547, + 550, 551, 552, 553, 554, 555, 556, 557, 1169, 167, + 168, 169, 193, 170, 171, 172, 164, 173, 174, 175, + 177, 212, 214, 217, 237, 240, 251, 252, 253, 255, + 256, 257, 258, 259, 260, 261, 267, 268, 269, 270, + 276, 288, 289, 313, 314, 434, 435, 436, 607, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 186, 187, 188, 189, 190, + 215, 1169, 196, 197, 198, 199, 238, 179, 180, 200, + 181, 201, 197, 182, 239, 196, 163, 202, 203, 183, + 204, 205, 206, 184, 207, 208, 165, 209, 210, 211, + 185, 869, 560, 1083, 560, 560, 592, 1100, 475, 475, + 744, 646, 648, 609, 560, 668, 432, 475, 621, 692, + 695, 1025, 703, 712, 1021, 719, 558, 558, 558, 558, + 470, 613, 866, 663, 664, 463, 681, 682, 683, 1218, + 984, 984, 984, 984, 247, 247, 463, 978, 985, 355, + 355, 355, 355, 867, 923, 918, 919, 932, 875, 920, + 872, 921, 922, 873, 350, 926, 879, 1126, 1154, 1127, + 878, 245, 245, 245, 245, 242, 248, 841, 1106, 1102, + 1103, 438, 670, 402, 405, 610, 614, 433, 336, 332, + 333, 335, 602, 437, 337, 439, 647, 426, 1273, 1052, + 1273, 1273, 342, 900, 456, 456, 348, 456, 456, 1052, + 1273, 882, 1052, 520, 1052, 1052, 1052, 1052, 1052, 1052, + 1052, 1052, 1052, 343, 342, 1052, 1052, 1052, 1052, 894, + 465, 1273, 881, 508, 599, 509, 1273, 1273, 1273, 1273, + 358, 515, 1273, 1273, 1273, 1354, 1354, 1354, 1354, 862, + 358, 358, 1372, 1372, 630, 667, 895, 883, 1088, 1092, + 940, 358, 358, 1362, 941, 358, 1011, 1372, 1389, 993, + 956, 447, 956, 619, 633, 636, 637, 638, 639, 660, + 661, 662, 716, 718, 564, 569, 562, 358, 358, 1375, + 1375, 400, 983, 1055, 1055, 690, 967, 597, 862, 1047, + 1063, 1064, 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 1138, 899, 456, 669, 456, 456, + 1058, 1057, 322, 562, 569, 594, 595, 324, 605, 611, + 1166, 626, 627, 1028, 1028, 1061, 1062, 632, 632, 25, + 320, 306, 1334, 1304, 1304, 1304, 1304, 1304, 1304, 1304, + 1304, 1304, 1304, 702, 1349, 1350, 1014, 843, 5, 986, + 6, 743, 445, 422, 561, 1023, 1018, 1076, 1345, 702, + 1345, 1345, 702, 603, 624, 1323, 1323, 691, 250, 250, + 1345, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, + 1323, 563, 589, 927, 564, 928, 563, 675, 589, 859, + 403, 469, 1356, 1356, 1356, 1356, 338, 887, 271, 319, + 625, 319, 319, 478, 606, 479, 480, 973, 351, 352, + 409, 892, 1320, 1320, 1380, 1381, 1341, 862, 1320, 1320, + 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 982, 417, + 713, 1268, 1264, 414, 415, 1033, 884, 440, 679, 890, + 680, 1149, 419, 420, 421, 1089, 693, 847, 1266, 423, + 440, 747, 1043, 346, 485, 1093, 1059, 1059, 330, 484, + 1347, 1348, 1140, 674, 1070, 1066, 1067, 1091, 896, 995, + 549, 549, 377, 1343, 1343, 1091, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 1269, 1270, 0, 1256, + 0, 847, 0, 847, 615, 857, 0, 945, 1156, 640, + 642, 644, 1256, 0, 0, 0, 0, 608, 1119, 1030, + 0, 0, 752, 752, 1271, 1331, 1332, 886, 717, 673, + 1009, 0, 0, 516, 708, 880, 1117, 1249, 959, 0, + 0, 0, 1250, 1253, 960, 0, 1254, 1263 + ); + + protected array $gotoCheck = array( + 42, 42, 73, 84, 73, 23, 23, 23, 23, 49, + 84, 162, 162, 25, 25, 25, 25, 162, 9, 162, + 162, 162, 162, 162, 162, 162, 162, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 15, 19, 128, 19, 19, 48, 15, 154, 154, + 48, 48, 48, 131, 19, 48, 13, 154, 13, 48, + 48, 48, 48, 48, 48, 48, 107, 107, 107, 107, + 156, 107, 26, 86, 86, 19, 86, 86, 86, 156, + 19, 19, 19, 19, 5, 5, 19, 19, 19, 24, + 24, 24, 24, 27, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 97, 15, 15, 146, 146, 146, + 15, 5, 5, 5, 5, 5, 5, 6, 15, 15, + 15, 66, 66, 59, 59, 59, 59, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 43, 73, 73, + 73, 73, 174, 45, 23, 23, 185, 23, 23, 73, + 73, 35, 73, 76, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 174, 174, 73, 73, 73, 73, 35, + 83, 73, 35, 160, 178, 160, 73, 73, 73, 73, + 14, 160, 73, 73, 73, 9, 9, 9, 9, 22, + 14, 14, 188, 188, 56, 56, 16, 16, 16, 16, + 73, 14, 14, 187, 73, 14, 103, 188, 14, 16, + 9, 83, 9, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 81, 14, 76, 76, 14, 14, 188, + 188, 62, 16, 89, 89, 89, 89, 104, 22, 89, + 89, 89, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 16, 16, 23, 64, 23, 23, + 119, 119, 76, 76, 76, 76, 76, 76, 76, 76, + 155, 76, 76, 107, 107, 120, 120, 108, 108, 76, + 175, 175, 14, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 7, 184, 184, 50, 7, 46, 50, + 46, 50, 113, 14, 50, 50, 50, 115, 131, 7, + 131, 131, 7, 2, 2, 176, 176, 117, 5, 5, + 131, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 9, 9, 65, 14, 65, 9, 121, 9, 18, + 9, 9, 131, 131, 131, 131, 29, 39, 24, 24, + 80, 24, 24, 9, 9, 9, 9, 92, 97, 97, + 28, 9, 177, 177, 9, 9, 131, 22, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 93, 93, + 93, 20, 166, 82, 82, 110, 37, 118, 82, 9, + 82, 153, 82, 82, 82, 130, 82, 12, 14, 82, + 118, 99, 114, 82, 157, 133, 118, 118, 9, 182, + 182, 182, 149, 118, 118, 118, 118, 131, 41, 96, + 179, 179, 138, 131, 131, 131, 179, 179, 179, 179, + 179, 179, 179, 179, 179, 179, 20, 20, -1, 20, + -1, 12, -1, 12, 17, 20, -1, 17, 17, 85, + 85, 85, 20, -1, -1, -1, -1, 8, 8, 17, + -1, -1, 24, 24, 20, 20, 20, 17, 8, 17, + 17, -1, -1, 8, 8, 17, 8, 79, 79, -1, + -1, -1, 79, 79, 79, -1, 79, 17 + ); + + protected array $gotoBase = array( + 0, 0, -289, 0, 0, 203, 227, 406, 569, 8, + 0, 0, 223, -162, 5, -186, -143, 93, 152, -101, + 102, 0, 31, 2, 206, 10, 188, 209, 142, 172, + 0, 0, 0, 0, 0, -104, 0, 166, 0, 149, + 0, 90, -1, 234, 0, 237, -329, 0, -555, -9, + 404, 0, 0, 0, 0, 0, 274, 0, 0, 198, + 0, 0, 309, 0, 141, 439, 6, 0, 0, 0, + 0, 0, 0, -5, 0, 0, 1, 0, 0, 183, + 146, -28, 4, 12, -475, 82, -535, 0, 0, 74, + 0, 0, 151, 196, 0, 0, 89, -267, 0, 108, + 0, 0, 0, 291, 314, 0, 0, 158, 162, 0, + 131, 0, 0, 145, 100, 153, 0, 156, 243, 101, + 112, 167, 0, 0, 0, 0, 0, 0, 161, 0, + 135, 165, 0, 76, 0, 0, 0, 0, -209, 0, + 0, 0, 0, 0, 0, 0, -44, 0, 0, 81, + 0, 0, 0, 157, 134, 148, -76, 77, 0, 0, + -210, 0, -224, 0, 0, 0, 129, 0, 0, 0, + 0, 0, 0, 0, -33, 84, 200, 247, 265, 305, + 0, 0, 231, 0, 36, 236, 0, 292, 7, 0, + 0 + ); + + protected array $gotoDefault = array( + -32768, 521, 754, 4, 755, 949, 830, 839, 585, 539, + 715, 347, 634, 429, 1339, 925, 1155, 604, 858, 1282, + 1288, 464, 861, 327, 741, 937, 908, 909, 406, 393, + 874, 404, 658, 635, 502, 893, 460, 885, 494, 888, + 459, 897, 162, 425, 518, 901, 3, 904, 567, 935, + 988, 394, 912, 395, 686, 914, 588, 916, 917, 401, + 407, 408, 1160, 596, 631, 929, 254, 590, 930, 392, + 931, 939, 397, 399, 696, 474, 513, 507, 418, 1121, + 591, 618, 655, 453, 481, 629, 641, 628, 488, 441, + 424, 326, 972, 980, 495, 472, 994, 349, 1002, 749, + 1168, 649, 497, 1010, 650, 1017, 1020, 540, 541, 486, + 1032, 264, 1035, 498, 1044, 23, 676, 1049, 1050, 677, + 651, 1072, 652, 678, 653, 1074, 471, 586, 1082, 461, + 1090, 1328, 462, 1094, 262, 1097, 277, 353, 376, 442, + 1104, 1105, 9, 1111, 706, 707, 19, 273, 517, 1139, + 697, 1145, 272, 1148, 458, 1167, 457, 1237, 1239, 568, + 499, 1257, 310, 1260, 689, 514, 1265, 454, 1330, 455, + 542, 482, 334, 543, 1373, 305, 356, 331, 559, 311, + 357, 544, 483, 1336, 1344, 328, 31, 1363, 1374, 601, + 623 + ); + + protected array $ruleToNonTerminal = array( + 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 7, 7, 7, 8, 8, 9, 10, 11, + 11, 11, 12, 12, 13, 13, 14, 15, 15, 16, + 16, 17, 17, 18, 18, 21, 21, 22, 23, 23, + 24, 24, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 29, 29, 30, 30, 32, 34, 34, + 28, 36, 36, 33, 38, 38, 35, 35, 37, 37, + 39, 39, 31, 40, 40, 41, 43, 44, 44, 45, + 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 25, 25, 50, 69, 69, 72, 72, 71, + 70, 70, 63, 75, 75, 76, 76, 77, 77, 78, + 78, 79, 79, 80, 80, 80, 26, 26, 27, 27, + 27, 27, 27, 88, 88, 90, 90, 83, 83, 91, + 91, 92, 92, 92, 84, 84, 87, 87, 85, 85, + 93, 94, 94, 57, 57, 65, 65, 68, 68, 68, + 67, 95, 95, 96, 58, 58, 58, 58, 97, 97, + 98, 98, 99, 99, 100, 101, 101, 102, 102, 103, + 103, 55, 55, 51, 51, 105, 53, 53, 106, 52, + 52, 54, 54, 64, 64, 64, 64, 81, 81, 109, + 109, 111, 111, 112, 112, 112, 112, 112, 112, 112, + 110, 110, 110, 115, 115, 115, 115, 89, 89, 118, + 118, 118, 119, 119, 116, 116, 120, 120, 122, 122, + 123, 123, 117, 124, 124, 121, 125, 125, 125, 125, + 113, 113, 82, 82, 82, 20, 20, 20, 127, 126, + 126, 128, 128, 128, 128, 60, 129, 129, 130, 61, + 132, 132, 133, 133, 134, 134, 86, 135, 135, 135, + 135, 135, 135, 135, 135, 141, 141, 142, 142, 143, + 143, 143, 143, 143, 144, 145, 145, 140, 140, 136, + 136, 139, 139, 147, 147, 146, 146, 146, 146, 146, + 146, 146, 146, 146, 146, 137, 148, 148, 150, 149, + 149, 138, 138, 114, 114, 151, 151, 153, 153, 153, + 152, 152, 62, 104, 154, 154, 56, 56, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 161, 162, 162, 163, 155, 155, 160, 160, + 164, 165, 165, 166, 167, 168, 168, 168, 168, 19, + 19, 73, 73, 73, 73, 156, 156, 156, 156, 170, + 170, 159, 159, 159, 157, 157, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 177, 177, 177, 108, + 179, 179, 179, 179, 158, 158, 158, 158, 158, 158, + 158, 158, 59, 59, 173, 173, 173, 173, 173, 180, + 180, 169, 169, 169, 169, 181, 181, 181, 181, 181, + 74, 74, 66, 66, 66, 66, 131, 131, 131, 131, + 184, 183, 172, 172, 172, 172, 172, 172, 171, 171, + 171, 182, 182, 182, 182, 107, 178, 186, 186, 185, + 185, 187, 187, 187, 187, 187, 187, 187, 187, 175, + 175, 175, 175, 174, 189, 188, 188, 188, 188, 188, + 188, 188, 188, 190, 190, 190, 190 + ); + + protected array $ruleToLength = array( + 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 0, 1, 1, 2, 1, 3, 4, 1, 2, + 0, 1, 1, 1, 1, 4, 3, 5, 4, 3, + 4, 1, 3, 1, 1, 8, 7, 2, 3, 1, + 2, 3, 1, 2, 3, 1, 1, 3, 1, 3, + 1, 2, 2, 3, 1, 3, 2, 3, 1, 3, + 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, + 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, + 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, + 2, 1, 1, 1, 1, 0, 2, 1, 3, 8, + 0, 4, 2, 1, 3, 0, 1, 0, 1, 0, + 1, 3, 1, 1, 1, 1, 8, 9, 7, 8, + 7, 6, 8, 0, 2, 0, 2, 1, 2, 1, + 2, 1, 1, 1, 0, 2, 0, 2, 0, 2, + 2, 1, 3, 1, 4, 1, 4, 1, 1, 4, + 2, 1, 3, 3, 3, 4, 4, 5, 0, 2, + 4, 3, 1, 1, 7, 0, 2, 1, 3, 3, + 4, 1, 4, 0, 2, 5, 0, 2, 6, 0, + 2, 0, 3, 1, 2, 1, 1, 2, 0, 1, + 3, 0, 2, 1, 1, 1, 1, 1, 1, 1, + 7, 9, 6, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, + 3, 3, 1, 3, 3, 1, 1, 2, 1, 1, + 0, 1, 0, 2, 2, 2, 4, 3, 1, 1, + 3, 1, 2, 2, 3, 2, 3, 1, 1, 2, + 3, 1, 1, 3, 2, 0, 1, 5, 7, 5, + 6, 10, 3, 5, 1, 1, 3, 0, 2, 4, + 5, 4, 4, 4, 3, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, + 3, 0, 2, 0, 3, 5, 8, 1, 3, 3, + 0, 2, 2, 2, 3, 1, 0, 1, 1, 3, + 3, 3, 4, 4, 1, 1, 2, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 5, 4, 3, + 4, 4, 2, 2, 4, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 3, 2, 1, + 2, 4, 2, 2, 8, 9, 8, 9, 9, 10, + 9, 10, 8, 3, 2, 2, 1, 1, 0, 4, + 2, 1, 3, 2, 1, 2, 2, 2, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, + 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 5, 3, 3, + 4, 1, 1, 3, 1, 1, 1, 1, 1, 3, + 2, 3, 0, 1, 1, 3, 1, 1, 1, 1, + 1, 1, 3, 1, 1, 1, 4, 1, 4, 4, + 0, 1, 1, 1, 3, 3, 1, 4, 2, 2, + 1, 3, 1, 4, 3, 3, 3, 3, 1, 3, + 1, 1, 3, 1, 1, 4, 1, 1, 1, 3, + 1, 1, 2, 1, 3, 4, 3, 2, 0, 2, + 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, + 3, 6, 3, 1, 1, 2, 1 + ); + + protected function initReduceCallbacks(): void { + $this->reduceCallbacks = [ + 0 => null, + 1 => static function ($self, $stackPos) { + $self->semValue = $self->handleNamespaces($self->semStack[$stackPos-(1-1)]); + }, + 2 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];; + }, + 3 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 4 => static function ($self, $stackPos) { + $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);; + if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)]; + }, + 5 => null, + 6 => null, + 7 => null, + 8 => null, + 9 => null, + 10 => null, + 11 => null, + 12 => null, + 13 => null, + 14 => null, + 15 => null, + 16 => null, + 17 => null, + 18 => null, + 19 => null, + 20 => null, + 21 => null, + 22 => null, + 23 => null, + 24 => null, + 25 => null, + 26 => null, + 27 => null, + 28 => null, + 29 => null, + 30 => null, + 31 => null, + 32 => null, + 33 => null, + 34 => null, + 35 => null, + 36 => null, + 37 => null, + 38 => null, + 39 => null, + 40 => null, + 41 => null, + 42 => null, + 43 => null, + 44 => null, + 45 => null, + 46 => null, + 47 => null, + 48 => null, + 49 => null, + 50 => null, + 51 => null, + 52 => null, + 53 => null, + 54 => null, + 55 => null, + 56 => null, + 57 => null, + 58 => null, + 59 => null, + 60 => null, + 61 => null, + 62 => null, + 63 => null, + 64 => null, + 65 => null, + 66 => null, + 67 => null, + 68 => null, + 69 => null, + 70 => null, + 71 => null, + 72 => null, + 73 => null, + 74 => null, + 75 => null, + 76 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; if ($self->semValue === "emitError(new Error('Cannot use "getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]))); + }, + 77 => null, + 78 => null, + 79 => null, + 80 => null, + 81 => null, + 82 => null, + 83 => null, + 84 => null, + 85 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 86 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 87 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 88 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 89 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 90 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 91 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 92 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 93 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 94 => null, + 95 => static function ($self, $stackPos) { + $self->semValue = new Name(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 96 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 97 => static function ($self, $stackPos) { + /* nothing */ + }, + 98 => static function ($self, $stackPos) { + /* nothing */ + }, + 99 => static function ($self, $stackPos) { + /* nothing */ + }, + 100 => static function ($self, $stackPos) { + $self->emitError(new Error('A trailing comma is not allowed here', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]))); + }, + 101 => null, + 102 => null, + 103 => static function ($self, $stackPos) { + $self->semValue = new Node\Attribute($self->semStack[$stackPos-(1-1)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 104 => static function ($self, $stackPos) { + $self->semValue = new Node\Attribute($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 105 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 106 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 107 => static function ($self, $stackPos) { + $self->semValue = new Node\AttributeGroup($self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 108 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 109 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 110 => static function ($self, $stackPos) { + $self->semValue = []; + }, + 111 => null, + 112 => null, + 113 => null, + 114 => null, + 115 => static function ($self, $stackPos) { + $self->semValue = new Stmt\HaltCompiler($self->handleHaltCompiler(), $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 116 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Namespace_($self->semStack[$stackPos-(3-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); + $self->checkNamespace($self->semValue); + }, + 117 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Namespace_($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $self->checkNamespace($self->semValue); + }, + 118 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Namespace_(null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); + $self->checkNamespace($self->semValue); + }, + 119 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Use_($self->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 120 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Use_($self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 121 => null, + 122 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Const_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 123 => static function ($self, $stackPos) { + $self->semValue = Stmt\Use_::TYPE_FUNCTION; + }, + 124 => static function ($self, $stackPos) { + $self->semValue = Stmt\Use_::TYPE_CONSTANT; + }, + 125 => static function ($self, $stackPos) { + $self->semValue = new Stmt\GroupUse($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-6)], $self->semStack[$stackPos-(8-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + }, + 126 => static function ($self, $stackPos) { + $self->semValue = new Stmt\GroupUse($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-5)], Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + }, + 127 => null, + 128 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 129 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 130 => null, + 131 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 132 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 133 => null, + 134 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 135 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 136 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1)); + }, + 137 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3)); + }, + 138 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1)); + }, + 139 => static function ($self, $stackPos) { + $self->semValue = new Node\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3)); + }, + 140 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->semValue->type = Stmt\Use_::TYPE_NORMAL; + }, + 141 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; $self->semValue->type = $self->semStack[$stackPos-(2-1)]; + }, + 142 => null, + 143 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 144 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 145 => static function ($self, $stackPos) { + $self->semValue = new Node\Const_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 146 => null, + 147 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 148 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 149 => static function ($self, $stackPos) { + $self->semValue = new Node\Const_(new Node\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 150 => static function ($self, $stackPos) { + $self->semValue = new Node\Const_(new Node\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 151 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];; + }, + 152 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 153 => static function ($self, $stackPos) { + $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);; + if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)]; + }, + 154 => null, + 155 => null, + 156 => null, + 157 => static function ($self, $stackPos) { + throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 158 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Block($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 159 => static function ($self, $stackPos) { + $self->semValue = new Stmt\If_($self->semStack[$stackPos-(7-3)], ['stmts' => $self->semStack[$stackPos-(7-5)], 'elseifs' => $self->semStack[$stackPos-(7-6)], 'else' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + }, + 160 => static function ($self, $stackPos) { + $self->semValue = new Stmt\If_($self->semStack[$stackPos-(10-3)], ['stmts' => $self->semStack[$stackPos-(10-6)], 'elseifs' => $self->semStack[$stackPos-(10-7)], 'else' => $self->semStack[$stackPos-(10-8)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); + }, + 161 => static function ($self, $stackPos) { + $self->semValue = new Stmt\While_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 162 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Do_($self->semStack[$stackPos-(7-5)], $self->semStack[$stackPos-(7-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + }, + 163 => static function ($self, $stackPos) { + $self->semValue = new Stmt\For_(['init' => $self->semStack[$stackPos-(9-3)], 'cond' => $self->semStack[$stackPos-(9-5)], 'loop' => $self->semStack[$stackPos-(9-7)], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); + }, + 164 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Switch_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 165 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Break_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 166 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Continue_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 167 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Return_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 168 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Global_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 169 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Static_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 170 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Echo_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 171 => static function ($self, $stackPos) { + + $self->semValue = new Stmt\InlineHTML($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + $self->semValue->setAttribute('hasLeadingNewline', $self->inlineHtmlHasLeadingNewline($stackPos-(1-1))); + + }, + 172 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Expression($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 173 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Unset_($self->semStack[$stackPos-(5-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 174 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Foreach_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $self->semStack[$stackPos-(7-5)][1], 'stmts' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + }, + 175 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Foreach_($self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-7)][0], ['keyVar' => $self->semStack[$stackPos-(9-5)], 'byRef' => $self->semStack[$stackPos-(9-7)][1], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); + }, + 176 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Foreach_($self->semStack[$stackPos-(6-3)], new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-4)], $self->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $self->semStack[$stackPos-(6-6)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); + }, + 177 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Declare_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 178 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TryCatch($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->checkTryCatch($self->semValue); + }, + 179 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Goto_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 180 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Label($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 181 => static function ($self, $stackPos) { + $self->semValue = null; /* means: no statement */ + }, + 182 => null, + 183 => static function ($self, $stackPos) { + $self->semValue = $self->maybeCreateNop($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]); + }, + 184 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; }; + }, + 185 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 186 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 187 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 188 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 189 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Catch_($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-7)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + }, + 190 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 191 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Finally_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 192 => null, + 193 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 194 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 195 => static function ($self, $stackPos) { + $self->semValue = false; + }, + 196 => static function ($self, $stackPos) { + $self->semValue = true; + }, + 197 => static function ($self, $stackPos) { + $self->semValue = false; + }, + 198 => static function ($self, $stackPos) { + $self->semValue = true; + }, + 199 => static function ($self, $stackPos) { + $self->semValue = false; + }, + 200 => static function ($self, $stackPos) { + $self->semValue = true; + }, + 201 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 202 => static function ($self, $stackPos) { + $self->semValue = []; + }, + 203 => null, + 204 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 205 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 206 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Function_($self->semStack[$stackPos-(8-3)], ['byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-5)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + }, + 207 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Function_($self->semStack[$stackPos-(9-4)], ['byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-6)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); + }, + 208 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Class_($self->semStack[$stackPos-(7-2)], ['type' => $self->semStack[$stackPos-(7-1)], 'extends' => $self->semStack[$stackPos-(7-3)], 'implements' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + $self->checkClass($self->semValue, $stackPos-(7-2)); + }, + 209 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Class_($self->semStack[$stackPos-(8-3)], ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + $self->checkClass($self->semValue, $stackPos-(8-3)); + }, + 210 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Interface_($self->semStack[$stackPos-(7-3)], ['extends' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => $self->semStack[$stackPos-(7-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + $self->checkInterface($self->semValue, $stackPos-(7-3)); + }, + 211 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Trait_($self->semStack[$stackPos-(6-3)], ['stmts' => $self->semStack[$stackPos-(6-5)], 'attrGroups' => $self->semStack[$stackPos-(6-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); + }, + 212 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Enum_($self->semStack[$stackPos-(8-3)], ['scalarType' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + $self->checkEnum($self->semValue, $stackPos-(8-3)); + }, + 213 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 214 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; + }, + 215 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 216 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; + }, + 217 => static function ($self, $stackPos) { + $self->semValue = 0; + }, + 218 => null, + 219 => null, + 220 => static function ($self, $stackPos) { + $self->checkClassModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; + }, + 221 => static function ($self, $stackPos) { + $self->semValue = Modifiers::ABSTRACT; + }, + 222 => static function ($self, $stackPos) { + $self->semValue = Modifiers::FINAL; + }, + 223 => static function ($self, $stackPos) { + $self->semValue = Modifiers::READONLY; + }, + 224 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 225 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; + }, + 226 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 227 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; + }, + 228 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 229 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; + }, + 230 => null, + 231 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 232 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 233 => null, + 234 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; + }, + 235 => null, + 236 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; + }, + 237 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; }; + }, + 238 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 239 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; + }, + 240 => null, + 241 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 242 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 243 => static function ($self, $stackPos) { + $self->semValue = new Node\DeclareItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 244 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 245 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-3)]; + }, + 246 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; + }, + 247 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(5-3)]; + }, + 248 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 249 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 250 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Case_($self->semStack[$stackPos-(4-2)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 251 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Case_(null, $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 252 => null, + 253 => null, + 254 => static function ($self, $stackPos) { + $self->semValue = new Expr\Match_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos])); + }, + 255 => static function ($self, $stackPos) { + $self->semValue = []; + }, + 256 => null, + 257 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 258 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 259 => static function ($self, $stackPos) { + $self->semValue = new Node\MatchArm($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 260 => static function ($self, $stackPos) { + $self->semValue = new Node\MatchArm(null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 261 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; + }, + 262 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; + }, + 263 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 264 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 265 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ElseIf_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 266 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 267 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 268 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ElseIf_($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue); + }, + 269 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 270 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Else_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 271 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 272 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Else_($self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue); + }, + 273 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)], false); + }, + 274 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(2-2)], true); + }, + 275 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)], false); + }, + 276 => static function ($self, $stackPos) { + $self->semValue = array($self->fixupArrayDestructuring($self->semStack[$stackPos-(1-1)]), false); + }, + 277 => null, + 278 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 279 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 280 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 281 => static function ($self, $stackPos) { + $self->semValue = 0; + }, + 282 => static function ($self, $stackPos) { + $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; + }, + 283 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC; + }, + 284 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED; + }, + 285 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE; + }, + 286 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC_SET; + }, + 287 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED_SET; + }, + 288 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE_SET; + }, + 289 => static function ($self, $stackPos) { + $self->semValue = Modifiers::READONLY; + }, + 290 => static function ($self, $stackPos) { + $self->semValue = new Node\Param($self->semStack[$stackPos-(7-6)], null, $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-4)], $self->semStack[$stackPos-(7-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-7)]); + $self->checkParam($self->semValue); + }, + 291 => static function ($self, $stackPos) { + $self->semValue = new Node\Param($self->semStack[$stackPos-(9-6)], $self->semStack[$stackPos-(9-8)], $self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-4)], $self->semStack[$stackPos-(9-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(9-2)], $self->semStack[$stackPos-(9-1)], $self->semStack[$stackPos-(9-9)]); + $self->checkParam($self->semValue); + }, + 292 => static function ($self, $stackPos) { + $self->semValue = new Node\Param(new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])), null, $self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-4)], $self->semStack[$stackPos-(6-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-1)]); + }, + 293 => null, + 294 => static function ($self, $stackPos) { + $self->semValue = new Node\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 295 => static function ($self, $stackPos) { + $self->semValue = new Node\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 296 => null, + 297 => null, + 298 => static function ($self, $stackPos) { + $self->semValue = new Node\Name('static', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 299 => static function ($self, $stackPos) { + $self->semValue = $self->handleBuiltinTypes($self->semStack[$stackPos-(1-1)]); + }, + 300 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier('array', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 301 => static function ($self, $stackPos) { + $self->semValue = new Node\Identifier('callable', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 302 => null, + 303 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 304 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); + }, + 305 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 306 => null, + 307 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 308 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); + }, + 309 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 310 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); + }, + 311 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 312 => static function ($self, $stackPos) { + $self->semValue = new Node\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 313 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); + }, + 314 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 315 => static function ($self, $stackPos) { + $self->semValue = new Node\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 316 => null, + 317 => static function ($self, $stackPos) { + $self->semValue = new Node\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 318 => static function ($self, $stackPos) { + $self->semValue = new Node\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 319 => null, + 320 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 321 => null, + 322 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 323 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(2-2)]; + }, + 324 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 325 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 326 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-2)]; + }, + 327 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-2)]); + }, + 328 => static function ($self, $stackPos) { + $self->semValue = new Node\VariadicPlaceholder($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 329 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 330 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 331 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(1-1)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 332 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(2-2)], true, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 333 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(2-2)], false, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 334 => static function ($self, $stackPos) { + $self->semValue = new Node\Arg($self->semStack[$stackPos-(3-3)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(3-1)]); + }, + 335 => null, + 336 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 337 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 338 => null, + 339 => null, + 340 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 341 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 342 => static function ($self, $stackPos) { + $self->semValue = new Node\StaticVar($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 343 => static function ($self, $stackPos) { + $self->semValue = new Node\StaticVar($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 344 => static function ($self, $stackPos) { + if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; } else { $self->semValue = $self->semStack[$stackPos-(2-1)]; } + }, + 345 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 346 => static function ($self, $stackPos) { + $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);; + if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)]; + }, + 347 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Property($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-1)]); + }, + 348 => static function ($self, $stackPos) { + $self->semValue = new Stmt\Property($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-6)]); + $self->checkPropertyHookList($self->semStack[$stackPos-(7-6)], $stackPos-(7-5)); + }, + 349 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ClassConst($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-1)]); + $self->checkClassConst($self->semValue, $stackPos-(5-2)); + }, + 350 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ClassConst($self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-1)], $self->semStack[$stackPos-(6-4)]); + $self->checkClassConst($self->semValue, $stackPos-(6-2)); + }, + 351 => static function ($self, $stackPos) { + $self->semValue = new Stmt\ClassMethod($self->semStack[$stackPos-(10-5)], ['type' => $self->semStack[$stackPos-(10-2)], 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-7)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); + $self->checkClassMethod($self->semValue, $stackPos-(10-2)); + }, + 352 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUse($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 353 => static function ($self, $stackPos) { + $self->semValue = new Stmt\EnumCase($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 354 => static function ($self, $stackPos) { + $self->semValue = null; /* will be skipped */ + }, + 355 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 356 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 357 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 358 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 359 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Precedence($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 360 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(5-1)][0], $self->semStack[$stackPos-(5-1)][1], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 361 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 362 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 363 => static function ($self, $stackPos) { + $self->semValue = new Stmt\TraitUseAdaptation\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 364 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]); + }, + 365 => null, + 366 => static function ($self, $stackPos) { + $self->semValue = array(null, $self->semStack[$stackPos-(1-1)]); + }, + 367 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 368 => null, + 369 => null, + 370 => static function ($self, $stackPos) { + $self->semValue = 0; + }, + 371 => static function ($self, $stackPos) { + $self->semValue = 0; + }, + 372 => null, + 373 => null, + 374 => static function ($self, $stackPos) { + $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; + }, + 375 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC; + }, + 376 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED; + }, + 377 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE; + }, + 378 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PUBLIC_SET; + }, + 379 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PROTECTED_SET; + }, + 380 => static function ($self, $stackPos) { + $self->semValue = Modifiers::PRIVATE_SET; + }, + 381 => static function ($self, $stackPos) { + $self->semValue = Modifiers::STATIC; + }, + 382 => static function ($self, $stackPos) { + $self->semValue = Modifiers::ABSTRACT; + }, + 383 => static function ($self, $stackPos) { + $self->semValue = Modifiers::FINAL; + }, + 384 => static function ($self, $stackPos) { + $self->semValue = Modifiers::READONLY; + }, + 385 => null, + 386 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 387 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 388 => static function ($self, $stackPos) { + $self->semValue = new Node\VarLikeIdentifier(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 389 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyItem($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 390 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 391 => static function ($self, $stackPos) { + $self->semValue = []; + }, + 392 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 393 => static function ($self, $stackPos) { + $self->semValue = []; + }, + 394 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; $self->checkPropertyHookList($self->semStack[$stackPos-(3-2)], $stackPos-(3-1)); + }, + 395 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyHook($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-5)], ['flags' => $self->semStack[$stackPos-(5-2)], 'byRef' => $self->semStack[$stackPos-(5-3)], 'params' => [], 'attrGroups' => $self->semStack[$stackPos-(5-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + $self->checkPropertyHook($self->semValue, null); + }, + 396 => static function ($self, $stackPos) { + $self->semValue = new Node\PropertyHook($self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-8)], ['flags' => $self->semStack[$stackPos-(8-2)], 'byRef' => $self->semStack[$stackPos-(8-3)], 'params' => $self->semStack[$stackPos-(8-6)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + $self->checkPropertyHook($self->semValue, $stackPos-(8-5)); + }, + 397 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 398 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 399 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 400 => static function ($self, $stackPos) { + $self->semValue = 0; + }, + 401 => static function ($self, $stackPos) { + $self->checkPropertyHookModifiers($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)]; + }, + 402 => null, + 403 => null, + 404 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 405 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 406 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 407 => null, + 408 => null, + 409 => static function ($self, $stackPos) { + $self->semValue = new Expr\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 410 => static function ($self, $stackPos) { + $self->semValue = new Expr\Assign($self->fixupArrayDestructuring($self->semStack[$stackPos-(3-1)]), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 411 => static function ($self, $stackPos) { + $self->semValue = new Expr\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 412 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 413 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + if (!$self->phpVersion->allowsAssignNewByReference()) { + $self->emitError(new Error('Cannot assign new by reference', $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]))); + } + + }, + 414 => null, + 415 => null, + 416 => static function ($self, $stackPos) { + $self->semValue = new Expr\Clone_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 417 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 418 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 419 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 420 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 421 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 422 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 423 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 424 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 425 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 426 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 427 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 428 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 429 => static function ($self, $stackPos) { + $self->semValue = new Expr\AssignOp\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 430 => static function ($self, $stackPos) { + $self->semValue = new Expr\PostInc($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 431 => static function ($self, $stackPos) { + $self->semValue = new Expr\PreInc($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 432 => static function ($self, $stackPos) { + $self->semValue = new Expr\PostDec($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 433 => static function ($self, $stackPos) { + $self->semValue = new Expr\PreDec($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 434 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BooleanOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 435 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BooleanAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 436 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\LogicalOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 437 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\LogicalAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 438 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\LogicalXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 439 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 440 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 441 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 442 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 443 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 444 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 445 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 446 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 447 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 448 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 449 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 450 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 451 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 452 => static function ($self, $stackPos) { + $self->semValue = new Expr\UnaryPlus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 453 => static function ($self, $stackPos) { + $self->semValue = new Expr\UnaryMinus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 454 => static function ($self, $stackPos) { + $self->semValue = new Expr\BooleanNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 455 => static function ($self, $stackPos) { + $self->semValue = new Expr\BitwiseNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 456 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Identical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 457 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\NotIdentical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 458 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Equal($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 459 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\NotEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 460 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Spaceship($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 461 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Smaller($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 462 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\SmallerOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 463 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Greater($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 464 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\GreaterOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 465 => static function ($self, $stackPos) { + $self->semValue = new Expr\Instanceof_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 466 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 467 => static function ($self, $stackPos) { + $self->semValue = new Expr\Ternary($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 468 => static function ($self, $stackPos) { + $self->semValue = new Expr\Ternary($self->semStack[$stackPos-(4-1)], null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 469 => static function ($self, $stackPos) { + $self->semValue = new Expr\BinaryOp\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 470 => static function ($self, $stackPos) { + $self->semValue = new Expr\Isset_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 471 => static function ($self, $stackPos) { + $self->semValue = new Expr\Empty_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 472 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 473 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 474 => static function ($self, $stackPos) { + $self->semValue = new Expr\Eval_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 475 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 476 => static function ($self, $stackPos) { + $self->semValue = new Expr\Include_($self->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 477 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Int_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 478 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]); + $attrs['kind'] = $self->getFloatCastKind($self->semStack[$stackPos-(2-1)]); + $self->semValue = new Expr\Cast\Double($self->semStack[$stackPos-(2-2)], $attrs); + }, + 479 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\String_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 480 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Array_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 481 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Object_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 482 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Bool_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 483 => static function ($self, $stackPos) { + $self->semValue = new Expr\Cast\Unset_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 484 => static function ($self, $stackPos) { + $self->semValue = $self->createExitExpr($self->semStack[$stackPos-(2-1)], $stackPos-(2-1), $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 485 => static function ($self, $stackPos) { + $self->semValue = new Expr\ErrorSuppress($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 486 => null, + 487 => static function ($self, $stackPos) { + $self->semValue = new Expr\ShellExec($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 488 => static function ($self, $stackPos) { + $self->semValue = new Expr\Print_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 489 => static function ($self, $stackPos) { + $self->semValue = new Expr\Yield_(null, null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 490 => static function ($self, $stackPos) { + $self->semValue = new Expr\Yield_($self->semStack[$stackPos-(2-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 491 => static function ($self, $stackPos) { + $self->semValue = new Expr\Yield_($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 492 => static function ($self, $stackPos) { + $self->semValue = new Expr\YieldFrom($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 493 => static function ($self, $stackPos) { + $self->semValue = new Expr\Throw_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 494 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'returnType' => $self->semStack[$stackPos-(8-6)], 'expr' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + }, + 495 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); + }, + 496 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'uses' => $self->semStack[$stackPos-(8-6)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])); + }, + 497 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); + }, + 498 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); + }, + 499 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'returnType' => $self->semStack[$stackPos-(10-8)], 'expr' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); + }, + 500 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos])); + }, + 501 => static function ($self, $stackPos) { + $self->semValue = new Expr\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'uses' => $self->semStack[$stackPos-(10-8)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos])); + }, + 502 => static function ($self, $stackPos) { + $self->semValue = array(new Stmt\Class_(null, ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])), $self->semStack[$stackPos-(8-3)]); + $self->checkClass($self->semValue[0], -1); + }, + 503 => static function ($self, $stackPos) { + $self->semValue = new Expr\New_($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 504 => static function ($self, $stackPos) { + list($class, $ctorArgs) = $self->semStack[$stackPos-(2-2)]; $self->semValue = new Expr\New_($class, $ctorArgs, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 505 => static function ($self, $stackPos) { + $self->semValue = new Expr\New_($self->semStack[$stackPos-(2-2)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 506 => null, + 507 => null, + 508 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 509 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(4-3)]; + }, + 510 => null, + 511 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 512 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 513 => static function ($self, $stackPos) { + $self->semValue = new Node\ClosureUse($self->semStack[$stackPos-(2-2)], $self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 514 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 515 => static function ($self, $stackPos) { + $self->semValue = new Expr\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 516 => static function ($self, $stackPos) { + $self->semValue = new Expr\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 517 => static function ($self, $stackPos) { + $self->semValue = new Expr\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 518 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 519 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 520 => null, + 521 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 522 => static function ($self, $stackPos) { + $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 523 => static function ($self, $stackPos) { + $self->semValue = new Name\FullyQualified(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 524 => static function ($self, $stackPos) { + $self->semValue = new Name\Relative(substr($self->semStack[$stackPos-(1-1)], 10), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 525 => null, + 526 => null, + 527 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 528 => static function ($self, $stackPos) { + $self->semValue = new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; + }, + 529 => null, + 530 => null, + 531 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 532 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); foreach ($self->semValue as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } }; + }, + 533 => static function ($self, $stackPos) { + foreach ($self->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = $self->semStack[$stackPos-(1-1)]; + }, + 534 => static function ($self, $stackPos) { + $self->semValue = array(); + }, + 535 => null, + 536 => static function ($self, $stackPos) { + $self->semValue = new Expr\ConstFetch($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 537 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Line($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 538 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\File($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 539 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Dir($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 540 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Class_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 541 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Trait_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 542 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Method($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 543 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Function_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 544 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Namespace_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 545 => static function ($self, $stackPos) { + $self->semValue = new Scalar\MagicConst\Property($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 546 => static function ($self, $stackPos) { + $self->semValue = new Expr\ClassConstFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 547 => static function ($self, $stackPos) { + $self->semValue = new Expr\ClassConstFetch($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); + }, + 548 => static function ($self, $stackPos) { + $self->semValue = new Expr\ClassConstFetch($self->semStack[$stackPos-(3-1)], new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(3-3)], $self->tokenEndStack[$stackPos-(3-3)])), $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; + }, + 549 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_SHORT; + $self->semValue = new Expr\Array_($self->semStack[$stackPos-(3-2)], $attrs); + }, + 550 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\Array_::KIND_LONG; + $self->semValue = new Expr\Array_($self->semStack[$stackPos-(4-3)], $attrs); + $self->createdArrays->attach($self->semValue); + }, + 551 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->createdArrays->attach($self->semValue); + }, + 552 => static function ($self, $stackPos) { + $self->semValue = Scalar\String_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->supportsUnicodeEscapes()); + }, + 553 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED; + foreach ($self->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\InterpolatedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = new Scalar\InterpolatedString($self->semStack[$stackPos-(3-2)], $attrs); + }, + 554 => static function ($self, $stackPos) { + $self->semValue = $self->parseLNumber($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->allowsInvalidOctals()); + }, + 555 => static function ($self, $stackPos) { + $self->semValue = Scalar\Float_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 556 => null, + 557 => null, + 558 => null, + 559 => static function ($self, $stackPos) { + $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)], $self->tokenEndStack[$stackPos-(3-3)]), true); + }, + 560 => static function ($self, $stackPos) { + $self->semValue = $self->parseDocString($self->semStack[$stackPos-(2-1)], '', $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(2-2)], $self->tokenEndStack[$stackPos-(2-2)]), true); + }, + 561 => static function ($self, $stackPos) { + $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)], $self->tokenEndStack[$stackPos-(3-3)]), true); + }, + 562 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 563 => null, + 564 => null, + 565 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 566 => null, + 567 => null, + 568 => null, + 569 => null, + 570 => null, + 571 => null, + 572 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 573 => null, + 574 => null, + 575 => null, + 576 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 577 => null, + 578 => static function ($self, $stackPos) { + $self->semValue = new Expr\MethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 579 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafeMethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 580 => static function ($self, $stackPos) { + $self->semValue = null; + }, + 581 => null, + 582 => null, + 583 => null, + 584 => static function ($self, $stackPos) { + $self->semValue = new Expr\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 585 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 586 => null, + 587 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 588 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 589 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable(new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])), $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; + }, + 590 => static function ($self, $stackPos) { + $var = $self->semStack[$stackPos-(1-1)]->name; $self->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])) : $var; + }, + 591 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 592 => null, + 593 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 594 => static function ($self, $stackPos) { + $self->semValue = new Expr\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 595 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 596 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 597 => static function ($self, $stackPos) { + $self->semValue = new Expr\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 598 => null, + 599 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 600 => null, + 601 => null, + 602 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 603 => null, + 604 => static function ($self, $stackPos) { + $self->semValue = new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2; + }, + 605 => static function ($self, $stackPos) { + $self->semValue = new Expr\List_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); $self->semValue->setAttribute('kind', Expr\List_::KIND_LIST); + $self->postprocessList($self->semValue); + }, + 606 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(1-1)]; $end = count($self->semValue)-1; if ($self->semValue[$end]->value instanceof Expr\Error) array_pop($self->semValue); + }, + 607 => null, + 608 => static function ($self, $stackPos) { + /* do nothing -- prevent default action of $$=$self->semStack[$1]. See $551. */ + }, + 609 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)]; + }, + 610 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 611 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 612 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(2-2)], null, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 613 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 614 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 615 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-1)], true, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 616 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 617 => static function ($self, $stackPos) { + $self->semValue = new Node\ArrayItem($self->semStack[$stackPos-(2-2)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), true); + }, + 618 => static function ($self, $stackPos) { + /* Create an Error node now to remember the position. We'll later either report an error, + or convert this into a null element, depending on whether this is a creation or destructuring context. */ + $attrs = $self->createEmptyElemAttributes($self->tokenPos); + $self->semValue = new Node\ArrayItem(new Expr\Error($attrs), null, false, $attrs); + }, + 619 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 620 => static function ($self, $stackPos) { + $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; + }, + 621 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(1-1)]); + }, + 622 => static function ($self, $stackPos) { + $self->semValue = array($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)]); + }, + 623 => static function ($self, $stackPos) { + $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]); $attrs['rawValue'] = $self->semStack[$stackPos-(1-1)]; $self->semValue = new Node\InterpolatedStringPart($self->semStack[$stackPos-(1-1)], $attrs); + }, + 624 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 625 => null, + 626 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); + }, + 627 => static function ($self, $stackPos) { + $self->semValue = new Expr\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 628 => static function ($self, $stackPos) { + $self->semValue = new Expr\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 629 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 630 => static function ($self, $stackPos) { + $self->semValue = new Expr\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); + }, + 631 => static function ($self, $stackPos) { + $self->semValue = new Expr\ArrayDimFetch($self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); + }, + 632 => static function ($self, $stackPos) { + $self->semValue = $self->semStack[$stackPos-(3-2)]; + }, + 633 => static function ($self, $stackPos) { + $self->semValue = new Scalar\String_($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 634 => static function ($self, $stackPos) { + $self->semValue = $self->parseNumString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); + }, + 635 => static function ($self, $stackPos) { + $self->semValue = $self->parseNumString('-' . $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); + }, + 636 => null, + ]; + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php b/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php deleted file mode 100644 index b76a5d94c8..0000000000 --- a/api/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +++ /dev/null @@ -1,148 +0,0 @@ - Map of PHP token IDs to drop */ + protected array $dropTokens; + /** @var int[] Map of external symbols (static::T_*) to internal symbols */ + protected array $tokenToSymbol; /** @var string[] Map of symbols to their names */ - protected $symbolToName; - /** @var array Names of the production rules (only necessary for debugging) */ - protected $productions; + protected array $symbolToName; + /** @var array Names of the production rules (only necessary for debugging) */ + protected array $productions; /** @var int[] Map of states to a displacement into the $action table. The corresponding action for this * state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the * action is defaulted, i.e. $actionDefault[$state] should be used instead. */ - protected $actionBase; + protected array $actionBase; /** @var int[] Table of actions. Indexed according to $actionBase comment. */ - protected $action; + protected array $action; /** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol * then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */ - protected $actionCheck; + protected array $actionCheck; /** @var int[] Map of states to their default action */ - protected $actionDefault; + protected array $actionDefault; /** @var callable[] Semantic action callbacks */ - protected $reduceCallbacks; + protected array $reduceCallbacks; /** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this * non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */ - protected $gotoBase; + protected array $gotoBase; /** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */ - protected $goto; + protected array $goto; /** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal * then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */ - protected $gotoCheck; + protected array $gotoCheck; /** @var int[] Map of non-terminals to the default state to goto after their reduction */ - protected $gotoDefault; + protected array $gotoDefault; /** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for * determining the state to goto after reduction. */ - protected $ruleToNonTerminal; + protected array $ruleToNonTerminal; /** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to * be popped from the stack(s) on reduction. */ - protected $ruleToLength; + protected array $ruleToLength; /* * The following members are part of the parser state: */ - /** @var Lexer Lexer that is used when parsing */ - protected $lexer; /** @var mixed Temporary value containing the result of last semantic action (reduction) */ protected $semValue; - /** @var array Semantic value stack (contains values of tokens and semantic action results) */ - protected $semStack; - /** @var array[] Start attribute stack */ - protected $startAttributeStack; - /** @var array[] End attribute stack */ - protected $endAttributeStack; - /** @var array End attributes of last *shifted* token */ - protected $endAttributes; - /** @var array Start attributes of last *read* token */ - protected $lookaheadStartAttributes; + /** @var mixed[] Semantic value stack (contains values of tokens and semantic action results) */ + protected array $semStack; + /** @var int[] Token start position stack */ + protected array $tokenStartStack; + /** @var int[] Token end position stack */ + protected array $tokenEndStack; /** @var ErrorHandler Error handler */ - protected $errorHandler; + protected ErrorHandler $errorHandler; /** @var int Error state, used to avoid error floods */ - protected $errorState; + protected int $errorState; + + /** @var \SplObjectStorage|null Array nodes created during parsing, for postprocessing of empty elements. */ + protected ?\SplObjectStorage $createdArrays; + + /** @var Token[] Tokens for the current parse */ + protected array $tokens; + /** @var int Current position in token array */ + protected int $tokenPos; /** * Initialize $reduceCallbacks map. */ - abstract protected function initReduceCallbacks(); + abstract protected function initReduceCallbacks(): void; /** * Creates a parser instance. * - * Options: Currently none. + * Options: + * * phpVersion: ?PhpVersion, * * @param Lexer $lexer A lexer - * @param array $options Options array. + * @param PhpVersion $phpVersion PHP version to target, defaults to latest supported. This + * option is best-effort: Even if specified, parsing will generally assume the latest + * supported version and only adjust behavior in minor ways, for example by omitting + * errors in older versions and interpreting type hints as a name or identifier depending + * on version. */ - public function __construct(Lexer $lexer, array $options = []) { + public function __construct(Lexer $lexer, ?PhpVersion $phpVersion = null) { $this->lexer = $lexer; - - if (isset($options['throwOnError'])) { - throw new \LogicException( - '"throwOnError" is no longer supported, use "errorHandler" instead'); - } + $this->phpVersion = $phpVersion ?? PhpVersion::getNewestSupported(); $this->initReduceCallbacks(); + $this->phpTokenToSymbol = $this->createTokenMap(); + $this->dropTokens = array_fill_keys( + [\T_WHITESPACE, \T_OPEN_TAG, \T_COMMENT, \T_DOC_COMMENT, \T_BAD_CHARACTER], true + ); } /** @@ -152,36 +177,55 @@ public function __construct(Lexer $lexer, array $options = []) { * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and * the parser was unable to recover from an error). */ - public function parse(string $code, ErrorHandler $errorHandler = null) { - $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing; + public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array { + $this->errorHandler = $errorHandler ?: new ErrorHandler\Throwing(); + $this->createdArrays = new \SplObjectStorage(); - $this->lexer->startLexing($code, $this->errorHandler); + $this->tokens = $this->lexer->tokenize($code, $this->errorHandler); $result = $this->doParse(); + // Report errors for any empty elements used inside arrays. This is delayed until after the main parse, + // because we don't know a priori whether a given array expression will be used in a destructuring context + // or not. + foreach ($this->createdArrays as $node) { + foreach ($node->items as $item) { + if ($item->value instanceof Expr\Error) { + $this->errorHandler->handleError( + new Error('Cannot use empty array elements in arrays', $item->getAttributes())); + } + } + } + // Clear out some of the interior state, so we don't hold onto unnecessary // memory between uses of the parser - $this->startAttributeStack = []; - $this->endAttributeStack = []; + $this->tokenStartStack = []; + $this->tokenEndStack = []; $this->semStack = []; $this->semValue = null; + $this->createdArrays = null; + + if ($result !== null) { + $traverser = new NodeTraverser(new CommentAnnotatingVisitor($this->tokens)); + $traverser->traverse($result); + } return $result; } - protected function doParse() { + public function getTokens(): array { + return $this->tokens; + } + + /** @return Stmt[]|null */ + protected function doParse(): ?array { // We start off with no lookahead-token $symbol = self::SYMBOL_NONE; - - // The attributes for a node are taken from the first and last token of the node. - // From the first token only the startAttributes are taken and from the last only - // the endAttributes. Both are merged using the array union operator (+). - $startAttributes = []; - $endAttributes = []; - $this->endAttributes = $endAttributes; + $tokenValue = null; + $this->tokenPos = -1; // Keep stack of start and end attributes - $this->startAttributeStack = []; - $this->endAttributeStack = [$endAttributes]; + $this->tokenStartStack = []; + $this->tokenEndStack = [0]; // Start off in the initial state and keep a stack of previous states $state = 0; @@ -202,26 +246,20 @@ protected function doParse() { $rule = $this->actionDefault[$state]; } else { if ($symbol === self::SYMBOL_NONE) { - // Fetch the next token id from the lexer and fetch additional info by-ref. - // The end attributes are fetched into a temporary variable and only set once the token is really - // shifted (not during read). Otherwise you would sometimes get off-by-one errors, when a rule is - // reduced after a token was read but not yet shifted. - $tokenId = $this->lexer->getNextToken($tokenValue, $startAttributes, $endAttributes); - - // map the lexer token id to the internally used symbols - $symbol = $tokenId >= 0 && $tokenId < $this->tokenToSymbolMapSize - ? $this->tokenToSymbol[$tokenId] - : $this->invalidSymbol; - - if ($symbol === $this->invalidSymbol) { + do { + $token = $this->tokens[++$this->tokenPos]; + $tokenId = $token->id; + } while (isset($this->dropTokens[$tokenId])); + + // Map the lexer token id to the internally used symbols. + $tokenValue = $token->text; + if (!isset($this->phpTokenToSymbol[$tokenId])) { throw new \RangeException(sprintf( 'The lexer returned an invalid token (id=%d, value=%s)', $tokenId, $tokenValue )); } - - // Allow productions to access the start attributes of the lookahead token. - $this->lookaheadStartAttributes = $startAttributes; + $symbol = $this->phpTokenToSymbol[$tokenId]; //$this->traceRead($symbol); } @@ -246,9 +284,8 @@ protected function doParse() { ++$stackPos; $stateStack[$stackPos] = $state = $action; $this->semStack[$stackPos] = $tokenValue; - $this->startAttributeStack[$stackPos] = $startAttributes; - $this->endAttributeStack[$stackPos] = $endAttributes; - $this->endAttributes = $endAttributes; + $this->tokenStartStack[$stackPos] = $this->tokenPos; + $this->tokenEndStack[$stackPos] = $this->tokenPos; $symbol = self::SYMBOL_NONE; if ($this->errorState) { @@ -274,15 +311,22 @@ protected function doParse() { /* accept */ //$this->traceAccept(); return $this->semValue; - } elseif ($rule !== $this->unexpectedTokenRule) { + } + if ($rule !== $this->unexpectedTokenRule) { /* reduce */ //$this->traceReduce($rule); + $ruleLength = $this->ruleToLength[$rule]; try { - $this->reduceCallbacks[$rule]($stackPos); + $callback = $this->reduceCallbacks[$rule]; + if ($callback !== null) { + $callback($this, $stackPos); + } elseif ($ruleLength > 0) { + $this->semValue = $this->semStack[$stackPos - $ruleLength + 1]; + } } catch (Error $e) { - if (-1 === $e->getStartLine() && isset($startAttributes['startLine'])) { - $e->setStartLine($startAttributes['startLine']); + if (-1 === $e->getStartLine()) { + $e->setStartLine($this->tokens[$this->tokenPos]->line); } $this->emitError($e); @@ -291,8 +335,7 @@ protected function doParse() { } /* Goto - shift nonterminal */ - $lastEndAttributes = $this->endAttributeStack[$stackPos]; - $ruleLength = $this->ruleToLength[$rule]; + $lastTokenEnd = $this->tokenEndStack[$stackPos]; $stackPos -= $ruleLength; $nonTerminal = $this->ruleToNonTerminal[$rule]; $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos]; @@ -305,18 +348,19 @@ protected function doParse() { ++$stackPos; $stateStack[$stackPos] = $state; $this->semStack[$stackPos] = $this->semValue; - $this->endAttributeStack[$stackPos] = $lastEndAttributes; + $this->tokenEndStack[$stackPos] = $lastTokenEnd; if ($ruleLength === 0) { // Empty productions use the start attributes of the lookahead token. - $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; + $this->tokenStartStack[$stackPos] = $this->tokenPos; } } else { /* error */ switch ($this->errorState) { case 0: $msg = $this->getErrorMessage($symbol, $state); - $this->emitError(new Error($msg, $startAttributes + $endAttributes)); + $this->emitError(new Error($msg, $this->getAttributesForToken($this->tokenPos))); // Break missing intentionally + // no break case 1: case 2: $this->errorState = 3; @@ -343,9 +387,8 @@ protected function doParse() { // We treat the error symbol as being empty, so we reset the end attributes // to the end attributes of the last non-error symbol - $this->startAttributeStack[$stackPos] = $this->lookaheadStartAttributes; - $this->endAttributeStack[$stackPos] = $this->endAttributeStack[$stackPos - 1]; - $this->endAttributes = $this->endAttributeStack[$stackPos - 1]; + $this->tokenStartStack[$stackPos] = $this->tokenPos; + $this->tokenEndStack[$stackPos] = $this->tokenEndStack[$stackPos - 1]; break; case 3: @@ -372,7 +415,7 @@ protected function doParse() { throw new \RuntimeException('Reached end of parser loop'); } - protected function emitError(Error $error) { + protected function emitError(Error $error): void { $this->errorHandler->handleError($error); } @@ -380,11 +423,11 @@ protected function emitError(Error $error) { * Format error message including expected tokens. * * @param int $symbol Unexpected symbol - * @param int $state State at time of error + * @param int $state State at time of error * * @return string Formatted error message */ - protected function getErrorMessage(int $symbol, int $state) : string { + protected function getErrorMessage(int $symbol, int $state): string { $expectedString = ''; if ($expected = $this->getExpectedTokens($state)) { $expectedString = ', expecting ' . implode(' or ', $expected); @@ -400,7 +443,7 @@ protected function getErrorMessage(int $symbol, int $state) : string { * * @return string[] Expected tokens. If too many, an empty array is returned. */ - protected function getExpectedTokens(int $state) : array { + protected function getExpectedTokens(int $state): array { $expected = []; $base = $this->actionBase[$state]; @@ -428,37 +471,79 @@ protected function getExpectedTokens(int $state) : array { return $expected; } + /** + * Get attributes for a node with the given start and end token positions. + * + * @param int $tokenStartPos Token position the node starts at + * @param int $tokenEndPos Token position the node ends at + * @return array Attributes + */ + protected function getAttributes(int $tokenStartPos, int $tokenEndPos): array { + $startToken = $this->tokens[$tokenStartPos]; + $afterEndToken = $this->tokens[$tokenEndPos + 1]; + return [ + 'startLine' => $startToken->line, + 'startTokenPos' => $tokenStartPos, + 'startFilePos' => $startToken->pos, + 'endLine' => $afterEndToken->line, + 'endTokenPos' => $tokenEndPos, + 'endFilePos' => $afterEndToken->pos - 1, + ]; + } + + /** + * Get attributes for a single token at the given token position. + * + * @return array Attributes + */ + protected function getAttributesForToken(int $tokenPos): array { + if ($tokenPos < \count($this->tokens) - 1) { + return $this->getAttributes($tokenPos, $tokenPos); + } + + // Get attributes for the sentinel token. + $token = $this->tokens[$tokenPos]; + return [ + 'startLine' => $token->line, + 'startTokenPos' => $tokenPos, + 'startFilePos' => $token->pos, + 'endLine' => $token->line, + 'endTokenPos' => $tokenPos, + 'endFilePos' => $token->pos, + ]; + } + /* * Tracing functions used for debugging the parser. */ /* - protected function traceNewState($state, $symbol) { + protected function traceNewState($state, $symbol): void { echo '% State ' . $state . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . "\n"; } - protected function traceRead($symbol) { + protected function traceRead($symbol): void { echo '% Reading ' . $this->symbolToName[$symbol] . "\n"; } - protected function traceShift($symbol) { + protected function traceShift($symbol): void { echo '% Shift ' . $this->symbolToName[$symbol] . "\n"; } - protected function traceAccept() { + protected function traceAccept(): void { echo "% Accepted.\n"; } - protected function traceReduce($n) { + protected function traceReduce($n): void { echo '% Reduce by (' . $n . ') ' . $this->productions[$n] . "\n"; } - protected function tracePop($state) { + protected function tracePop($state): void { echo '% Recovering, uncovered state ' . $state . "\n"; } - protected function traceDiscard($symbol) { + protected function traceDiscard($symbol): void { echo '% Discard ' . $this->symbolToName[$symbol] . "\n"; } */ @@ -473,13 +558,14 @@ protected function traceDiscard($symbol) { * @param Node\Stmt[] $stmts * @return Node\Stmt[] */ - protected function handleNamespaces(array $stmts) : array { + protected function handleNamespaces(array $stmts): array { $hasErrored = false; $style = $this->getNamespacingStyle($stmts); if (null === $style) { // not namespaced, nothing to do return $stmts; - } elseif ('brace' === $style) { + } + if ('brace' === $style) { // For braced namespaces we only have to check that there are no invalid statements between the namespaces $afterFirstNamespace = false; foreach ($stmts as $stmt) { @@ -497,7 +583,7 @@ protected function handleNamespaces(array $stmts) : array { } else { // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts $resultStmts = []; - $targetStmts =& $resultStmts; + $targetStmts = &$resultStmts; $lastNs = null; foreach ($stmts as $stmt) { if ($stmt instanceof Node\Stmt\Namespace_) { @@ -506,12 +592,12 @@ protected function handleNamespaces(array $stmts) : array { } if ($stmt->stmts === null) { $stmt->stmts = []; - $targetStmts =& $stmt->stmts; + $targetStmts = &$stmt->stmts; $resultStmts[] = $stmt; } else { // This handles the invalid case of mixed style namespaces $resultStmts[] = $stmt; - $targetStmts =& $resultStmts; + $targetStmts = &$resultStmts; } $lastNs = $stmt; } elseif ($stmt instanceof Node\Stmt\HaltCompiler) { @@ -528,7 +614,7 @@ protected function handleNamespaces(array $stmts) : array { } } - private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt) { + private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt): void { // We moved the statements into the namespace node, as such the end of the namespace node // needs to be extended to the end of the statements. if (empty($stmt->stmts)) { @@ -546,6 +632,22 @@ private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt) { } } + /** @return array */ + private function getNamespaceErrorAttributes(Namespace_ $node): array { + $attrs = $node->getAttributes(); + // Adjust end attributes to only cover the "namespace" keyword, not the whole namespace. + if (isset($attrs['startLine'])) { + $attrs['endLine'] = $attrs['startLine']; + } + if (isset($attrs['startTokenPos'])) { + $attrs['endTokenPos'] = $attrs['startTokenPos']; + } + if (isset($attrs['startFilePos'])) { + $attrs['endFilePos'] = $attrs['startFilePos'] + \strlen('namespace') - 1; + } + return $attrs; + } + /** * Determine namespacing style (semicolon or brace) * @@ -553,7 +655,7 @@ private function fixupNamespaceAttributes(Node\Stmt\Namespace_ $stmt) { * * @return null|string One of "semicolon", "brace" or null (no namespaces) */ - private function getNamespacingStyle(array $stmts) { + private function getNamespacingStyle(array $stmts): ?string { $style = null; $hasNotAllowedStmts = false; foreach ($stmts as $i => $stmt) { @@ -564,13 +666,13 @@ private function getNamespacingStyle(array $stmts) { if ($hasNotAllowedStmts) { $this->emitError(new Error( 'Namespace declaration statement has to be the very first statement in the script', - $stmt->getLine() // Avoid marking the entire namespace as an error + $this->getNamespaceErrorAttributes($stmt) )); } } elseif ($style !== $currentStyle) { $this->emitError(new Error( 'Cannot mix bracketed namespace declarations with unbracketed namespace declarations', - $stmt->getLine() // Avoid marking the entire namespace as an error + $this->getNamespaceErrorAttributes($stmt) )); // Treat like semicolon style for namespace normalization return 'semicolon'; @@ -596,83 +698,14 @@ private function getNamespacingStyle(array $stmts) { return $style; } - /** - * Fix up parsing of static property calls in PHP 5. - * - * In PHP 5 A::$b[c][d] and A::$b[c][d]() have very different interpretation. The former is - * interpreted as (A::$b)[c][d], while the latter is the same as A::{$b[c][d]}(). We parse the - * latter as the former initially and this method fixes the AST into the correct form when we - * encounter the "()". - * - * @param Node\Expr\StaticPropertyFetch|Node\Expr\ArrayDimFetch $prop - * @param Node\Arg[] $args - * @param array $attributes - * - * @return Expr\StaticCall - */ - protected function fixupPhp5StaticPropCall($prop, array $args, array $attributes) : Expr\StaticCall { - if ($prop instanceof Node\Expr\StaticPropertyFetch) { - $name = $prop->name instanceof VarLikeIdentifier - ? $prop->name->toString() : $prop->name; - $var = new Expr\Variable($name, $prop->name->getAttributes()); - return new Expr\StaticCall($prop->class, $var, $args, $attributes); - } elseif ($prop instanceof Node\Expr\ArrayDimFetch) { - $tmp = $prop; - while ($tmp->var instanceof Node\Expr\ArrayDimFetch) { - $tmp = $tmp->var; - } - - /** @var Expr\StaticPropertyFetch $staticProp */ - $staticProp = $tmp->var; - - // Set start attributes to attributes of innermost node - $tmp = $prop; - $this->fixupStartAttributes($tmp, $staticProp->name); - while ($tmp->var instanceof Node\Expr\ArrayDimFetch) { - $tmp = $tmp->var; - $this->fixupStartAttributes($tmp, $staticProp->name); - } - - $name = $staticProp->name instanceof VarLikeIdentifier - ? $staticProp->name->toString() : $staticProp->name; - $tmp->var = new Expr\Variable($name, $staticProp->name->getAttributes()); - return new Expr\StaticCall($staticProp->class, $prop, $args, $attributes); - } else { - throw new \Exception; - } - } - - protected function fixupStartAttributes(Node $to, Node $from) { - $startAttributes = ['startLine', 'startFilePos', 'startTokenPos']; - foreach ($startAttributes as $startAttribute) { - if ($from->hasAttribute($startAttribute)) { - $to->setAttribute($startAttribute, $from->getAttribute($startAttribute)); - } - } - } - + /** @return Name|Identifier */ protected function handleBuiltinTypes(Name $name) { - $builtinTypes = [ - 'bool' => true, - 'int' => true, - 'float' => true, - 'string' => true, - 'iterable' => true, - 'void' => true, - 'object' => true, - 'null' => true, - 'false' => true, - 'mixed' => true, - 'never' => true, - 'true' => true, - ]; - if (!$name->isUnqualified()) { return $name; } $lowerName = $name->toLowerString(); - if (!isset($builtinTypes[$lowerName])) { + if (!$this->phpVersion->supportsBuiltinType($lowerName)) { return $name; } @@ -682,16 +715,15 @@ protected function handleBuiltinTypes(Name $name) { /** * Get combined start and end attributes at a stack location * - * @param int $pos Stack location + * @param int $stackPos Stack location * - * @return array Combined start and end attributes + * @return array Combined start and end attributes */ - protected function getAttributesAt(int $pos) : array { - return $this->startAttributeStack[$pos] + $this->endAttributeStack[$pos]; + protected function getAttributesAt(int $stackPos): array { + return $this->getAttributes($this->tokenStartStack[$stackPos], $this->tokenEndStack[$stackPos]); } - protected function getFloatCastKind(string $cast): int - { + protected function getFloatCastKind(string $cast): int { $cast = strtolower($cast); if (strpos($cast, 'float') !== false) { return Double::KIND_FLOAT; @@ -704,23 +736,24 @@ protected function getFloatCastKind(string $cast): int return Double::KIND_DOUBLE; } - protected function parseLNumber($str, $attributes, $allowInvalidOctal = false) { + /** @param array $attributes */ + protected function parseLNumber(string $str, array $attributes, bool $allowInvalidOctal = false): Int_ { try { - return LNumber::fromString($str, $attributes, $allowInvalidOctal); + return Int_::fromString($str, $attributes, $allowInvalidOctal); } catch (Error $error) { $this->emitError($error); // Use dummy value - return new LNumber(0, $attributes); + return new Int_(0, $attributes); } } /** * Parse a T_NUM_STRING token into either an integer or string node. * - * @param string $str Number string - * @param array $attributes Attributes + * @param string $str Number string + * @param array $attributes Attributes * - * @return LNumber|String_ Integer or string node. + * @return Int_|String_ Integer or string node. */ protected function parseNumString(string $str, array $attributes) { if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) { @@ -732,13 +765,14 @@ protected function parseNumString(string $str, array $attributes) { return new String_($str, $attributes); } - return new LNumber($num, $attributes); + return new Int_($num, $attributes); } + /** @param array $attributes */ protected function stripIndentation( string $string, int $indentLen, string $indentChar, bool $newlineAtStart, bool $newlineAtEnd, array $attributes - ) { + ): string { if ($indentLen === 0) { return $string; } @@ -767,10 +801,15 @@ function ($matches) use ($indentLen, $indentChar, $attributes) { ); } + /** + * @param string|(Expr|InterpolatedStringPart)[] $contents + * @param array $attributes + * @param array $endTokenAttributes + */ protected function parseDocString( string $startToken, $contents, string $endToken, array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape - ) { + ): Expr { $kind = strpos($startToken, "'") === false ? String_::KIND_HEREDOC : String_::KIND_NOWDOC; @@ -804,6 +843,7 @@ protected function parseDocString( if (\is_string($contents)) { if ($contents === '') { + $attributes['rawValue'] = $contents; return new String_('', $attributes); } @@ -811,6 +851,7 @@ protected function parseDocString( $contents, $indentLen, $indentChar, true, true, $attributes ); $contents = preg_replace('~(\r\n|\n|\r)\z~', '', $contents); + $attributes['rawValue'] = $contents; if ($kind === String_::KIND_HEREDOC) { $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape); @@ -819,7 +860,7 @@ protected function parseDocString( return new String_($contents, $attributes); } else { assert(count($contents) > 0); - if (!$contents[0] instanceof Node\Scalar\EncapsedStringPart) { + if (!$contents[0] instanceof Node\InterpolatedStringPart) { // If there is no leading encapsed string part, pretend there is an empty one $this->stripIndentation( '', $indentLen, $indentChar, true, false, $contents[0]->getAttributes() @@ -828,74 +869,175 @@ protected function parseDocString( $newContents = []; foreach ($contents as $i => $part) { - if ($part instanceof Node\Scalar\EncapsedStringPart) { + if ($part instanceof Node\InterpolatedStringPart) { $isLast = $i === \count($contents) - 1; $part->value = $this->stripIndentation( $part->value, $indentLen, $indentChar, $i === 0, $isLast, $part->getAttributes() ); - $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape); if ($isLast) { $part->value = preg_replace('~(\r\n|\n|\r)\z~', '', $part->value); } + $part->setAttribute('rawValue', $part->value); + $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape); if ('' === $part->value) { continue; } } $newContents[] = $part; } - return new Encapsed($newContents, $attributes); + return new InterpolatedString($newContents, $attributes); } } + protected function createCommentFromToken(Token $token, int $tokenPos): Comment { + assert($token->id === \T_COMMENT || $token->id == \T_DOC_COMMENT); + return \T_DOC_COMMENT === $token->id + ? new Comment\Doc($token->text, $token->line, $token->pos, $tokenPos, + $token->getEndLine(), $token->getEndPos() - 1, $tokenPos) + : new Comment($token->text, $token->line, $token->pos, $tokenPos, + $token->getEndLine(), $token->getEndPos() - 1, $tokenPos); + } + /** - * Create attributes for a zero-length common-capturing nop. - * - * @param Comment[] $comments - * @return array + * Get last comment before the given token position, if any */ - protected function createCommentNopAttributes(array $comments) { - $comment = $comments[count($comments) - 1]; + protected function getCommentBeforeToken(int $tokenPos): ?Comment { + while (--$tokenPos >= 0) { + $token = $this->tokens[$tokenPos]; + if (!isset($this->dropTokens[$token->id])) { + break; + } + + if ($token->id === \T_COMMENT || $token->id === \T_DOC_COMMENT) { + return $this->createCommentFromToken($token, $tokenPos); + } + } + return null; + } + + /** + * Create a zero-length nop to capture preceding comments, if any. + */ + protected function maybeCreateZeroLengthNop(int $tokenPos): ?Nop { + $comment = $this->getCommentBeforeToken($tokenPos); + if ($comment === null) { + return null; + } + $commentEndLine = $comment->getEndLine(); $commentEndFilePos = $comment->getEndFilePos(); $commentEndTokenPos = $comment->getEndTokenPos(); + $attributes = [ + 'startLine' => $commentEndLine, + 'endLine' => $commentEndLine, + 'startFilePos' => $commentEndFilePos + 1, + 'endFilePos' => $commentEndFilePos, + 'startTokenPos' => $commentEndTokenPos + 1, + 'endTokenPos' => $commentEndTokenPos, + ]; + return new Nop($attributes); + } - $attributes = ['comments' => $comments]; - if (-1 !== $commentEndLine) { - $attributes['startLine'] = $commentEndLine; - $attributes['endLine'] = $commentEndLine; + protected function maybeCreateNop(int $tokenStartPos, int $tokenEndPos): ?Nop { + if ($this->getCommentBeforeToken($tokenStartPos) === null) { + return null; } - if (-1 !== $commentEndFilePos) { - $attributes['startFilePos'] = $commentEndFilePos + 1; - $attributes['endFilePos'] = $commentEndFilePos; + return new Nop($this->getAttributes($tokenStartPos, $tokenEndPos)); + } + + protected function handleHaltCompiler(): string { + // Prevent the lexer from returning any further tokens. + $nextToken = $this->tokens[$this->tokenPos + 1]; + $this->tokenPos = \count($this->tokens) - 2; + + // Return text after __halt_compiler. + return $nextToken->id === \T_INLINE_HTML ? $nextToken->text : ''; + } + + protected function inlineHtmlHasLeadingNewline(int $stackPos): bool { + $tokenPos = $this->tokenStartStack[$stackPos]; + $token = $this->tokens[$tokenPos]; + assert($token->id == \T_INLINE_HTML); + if ($tokenPos > 0) { + $prevToken = $this->tokens[$tokenPos - 1]; + assert($prevToken->id == \T_CLOSE_TAG); + return false !== strpos($prevToken->text, "\n") + || false !== strpos($prevToken->text, "\r"); } - if (-1 !== $commentEndTokenPos) { - $attributes['startTokenPos'] = $commentEndTokenPos + 1; - $attributes['endTokenPos'] = $commentEndTokenPos; + return true; + } + + /** + * @return array + */ + protected function createEmptyElemAttributes(int $tokenPos): array { + return $this->getAttributesForToken($tokenPos); + } + + protected function fixupArrayDestructuring(Array_ $node): Expr\List_ { + $this->createdArrays->detach($node); + return new Expr\List_(array_map(function (Node\ArrayItem $item) { + if ($item->value instanceof Expr\Error) { + // We used Error as a placeholder for empty elements, which are legal for destructuring. + return null; + } + if ($item->value instanceof Array_) { + return new Node\ArrayItem( + $this->fixupArrayDestructuring($item->value), + $item->key, $item->byRef, $item->getAttributes()); + } + return $item; + }, $node->items), ['kind' => Expr\List_::KIND_ARRAY] + $node->getAttributes()); + } + + protected function postprocessList(Expr\List_ $node): void { + foreach ($node->items as $i => $item) { + if ($item->value instanceof Expr\Error) { + // We used Error as a placeholder for empty elements, which are legal for destructuring. + $node->items[$i] = null; + } } - return $attributes; } - protected function checkClassModifier($a, $b, $modifierPos) { + /** @param ElseIf_|Else_ $node */ + protected function fixupAlternativeElse($node): void { + // Make sure a trailing nop statement carrying comments is part of the node. + $numStmts = \count($node->stmts); + if ($numStmts !== 0 && $node->stmts[$numStmts - 1] instanceof Nop) { + $nopAttrs = $node->stmts[$numStmts - 1]->getAttributes(); + if (isset($nopAttrs['endLine'])) { + $node->setAttribute('endLine', $nopAttrs['endLine']); + } + if (isset($nopAttrs['endFilePos'])) { + $node->setAttribute('endFilePos', $nopAttrs['endFilePos']); + } + if (isset($nopAttrs['endTokenPos'])) { + $node->setAttribute('endTokenPos', $nopAttrs['endTokenPos']); + } + } + } + + protected function checkClassModifier(int $a, int $b, int $modifierPos): void { try { - Class_::verifyClassModifier($a, $b); + Modifiers::verifyClassModifier($a, $b); } catch (Error $error) { $error->setAttributes($this->getAttributesAt($modifierPos)); $this->emitError($error); } } - protected function checkModifier($a, $b, $modifierPos) { + protected function checkModifier(int $a, int $b, int $modifierPos): void { // Jumping through some hoops here because verifyModifier() is also used elsewhere try { - Class_::verifyModifier($a, $b); + Modifiers::verifyModifier($a, $b); } catch (Error $error) { $error->setAttributes($this->getAttributesAt($modifierPos)); $this->emitError($error); } } - protected function checkParam(Param $node) { + protected function checkParam(Param $node): void { if ($node->variadic && null !== $node->default) { $this->emitError(new Error( 'Variadic parameter cannot have a default value', @@ -904,7 +1046,7 @@ protected function checkParam(Param $node) { } } - protected function checkTryCatch(TryCatch $node) { + protected function checkTryCatch(TryCatch $node): void { if (empty($node->catches) && null === $node->finally) { $this->emitError(new Error( 'Cannot use try without catch or finally', $node->getAttributes() @@ -912,7 +1054,7 @@ protected function checkTryCatch(TryCatch $node) { } } - protected function checkNamespace(Namespace_ $node) { + protected function checkNamespace(Namespace_ $node): void { if (null !== $node->stmts) { foreach ($node->stmts as $stmt) { if ($stmt instanceof Namespace_) { @@ -924,7 +1066,7 @@ protected function checkNamespace(Namespace_ $node) { } } - private function checkClassName($name, $namePos) { + private function checkClassName(?Identifier $name, int $namePos): void { if (null !== $name && $name->isSpecialClassName()) { $this->emitError(new Error( sprintf('Cannot use \'%s\' as class name as it is reserved', $name), @@ -933,7 +1075,8 @@ private function checkClassName($name, $namePos) { } } - private function checkImplementedInterfaces(array $interfaces) { + /** @param Name[] $interfaces */ + private function checkImplementedInterfaces(array $interfaces): void { foreach ($interfaces as $interface) { if ($interface->isSpecialClassName()) { $this->emitError(new Error( @@ -944,7 +1087,7 @@ private function checkImplementedInterfaces(array $interfaces) { } } - protected function checkClass(Class_ $node, $namePos) { + protected function checkClass(Class_ $node, int $namePos): void { $this->checkClassName($node->name, $namePos); if ($node->extends && $node->extends->isSpecialClassName()) { @@ -957,18 +1100,18 @@ protected function checkClass(Class_ $node, $namePos) { $this->checkImplementedInterfaces($node->implements); } - protected function checkInterface(Interface_ $node, $namePos) { + protected function checkInterface(Interface_ $node, int $namePos): void { $this->checkClassName($node->name, $namePos); $this->checkImplementedInterfaces($node->extends); } - protected function checkEnum(Enum_ $node, $namePos) { + protected function checkEnum(Enum_ $node, int $namePos): void { $this->checkClassName($node->name, $namePos); $this->checkImplementedInterfaces($node->implements); } - protected function checkClassMethod(ClassMethod $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_STATIC) { + protected function checkClassMethod(ClassMethod $node, int $modifierPos): void { + if ($node->flags & Modifiers::STATIC) { switch ($node->name->toLowerString()) { case '__construct': $this->emitError(new Error( @@ -988,52 +1131,136 @@ protected function checkClassMethod(ClassMethod $node, $modifierPos) { } } - if ($node->flags & Class_::MODIFIER_READONLY) { + if ($node->flags & Modifiers::READONLY) { $this->emitError(new Error( sprintf('Method %s() cannot be readonly', $node->name), $this->getAttributesAt($modifierPos))); } } - protected function checkClassConst(ClassConst $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_STATIC) { + protected function checkClassConst(ClassConst $node, int $modifierPos): void { + foreach ([Modifiers::STATIC, Modifiers::ABSTRACT, Modifiers::READONLY] as $modifier) { + if ($node->flags & $modifier) { + $this->emitError(new Error( + "Cannot use '" . Modifiers::toString($modifier) . "' as constant modifier", + $this->getAttributesAt($modifierPos))); + } + } + } + + protected function checkUseUse(UseItem $node, int $namePos): void { + if ($node->alias && $node->alias->isSpecialClassName()) { $this->emitError(new Error( - "Cannot use 'static' as constant modifier", - $this->getAttributesAt($modifierPos))); + sprintf( + 'Cannot use %s as %s because \'%2$s\' is a special class name', + $node->name, $node->alias + ), + $this->getAttributesAt($namePos) + )); } - if ($node->flags & Class_::MODIFIER_ABSTRACT) { + } + + /** @param PropertyHook[] $hooks */ + protected function checkPropertyHookList(array $hooks, int $hookPos): void { + if (empty($hooks)) { $this->emitError(new Error( - "Cannot use 'abstract' as constant modifier", - $this->getAttributesAt($modifierPos))); + 'Property hook list cannot be empty', $this->getAttributesAt($hookPos))); } - if ($node->flags & Class_::MODIFIER_READONLY) { + } + + protected function checkPropertyHook(PropertyHook $hook, ?int $paramListPos): void { + $name = $hook->name->toLowerString(); + if ($name !== 'get' && $name !== 'set') { $this->emitError(new Error( - "Cannot use 'readonly' as constant modifier", - $this->getAttributesAt($modifierPos))); + 'Unknown hook "' . $hook->name . '", expected "get" or "set"', + $hook->name->getAttributes())); + } + if ($name === 'get' && $paramListPos !== null) { + $this->emitError(new Error( + 'get hook must not have a parameter list', $this->getAttributesAt($paramListPos))); } } - protected function checkProperty(Property $node, $modifierPos) { - if ($node->flags & Class_::MODIFIER_ABSTRACT) { - $this->emitError(new Error('Properties cannot be declared abstract', - $this->getAttributesAt($modifierPos))); + protected function checkPropertyHookModifiers(int $a, int $b, int $modifierPos): void { + try { + Modifiers::verifyModifier($a, $b); + } catch (Error $error) { + $error->setAttributes($this->getAttributesAt($modifierPos)); + $this->emitError($error); } - if ($node->flags & Class_::MODIFIER_FINAL) { - $this->emitError(new Error('Properties cannot be declared final', + if ($b != Modifiers::FINAL) { + $this->emitError(new Error( + 'Cannot use the ' . Modifiers::toString($b) . ' modifier on a property hook', $this->getAttributesAt($modifierPos))); } } - protected function checkUseUse(UseUse $node, $namePos) { - if ($node->alias && $node->alias->isSpecialClassName()) { - $this->emitError(new Error( - sprintf( - 'Cannot use %s as %s because \'%2$s\' is a special class name', - $node->name, $node->alias - ), - $this->getAttributesAt($namePos) - )); + /** @param array $args */ + private function isSimpleExit(array $args): bool { + if (\count($args) === 0) { + return true; + } + if (\count($args) === 1) { + $arg = $args[0]; + return $arg instanceof Arg && $arg->name === null && + $arg->byRef === false && $arg->unpack === false; + } + return false; + } + + /** + * @param array $args + * @param array $attrs + */ + protected function createExitExpr(string $name, int $namePos, array $args, array $attrs): Expr { + if ($this->isSimpleExit($args)) { + // Create Exit node for backwards compatibility. + $attrs['kind'] = strtolower($name) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE; + return new Expr\Exit_(\count($args) === 1 ? $args[0]->value : null, $attrs); + } + return new Expr\FuncCall(new Name($name, $this->getAttributesAt($namePos)), $args, $attrs); + } + + /** + * Creates the token map. + * + * The token map maps the PHP internal token identifiers + * to the identifiers used by the Parser. Additionally it + * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'. + * + * @return array The token map + */ + protected function createTokenMap(): array { + $tokenMap = []; + + // Single-char tokens use an identity mapping. + for ($i = 0; $i < 256; ++$i) { + $tokenMap[$i] = $i; + } + + foreach ($this->symbolToName as $name) { + if ($name[0] === 'T') { + $tokenMap[\constant($name)] = constant(static::class . '::' . $name); + } } + + // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO + $tokenMap[\T_OPEN_TAG_WITH_ECHO] = static::T_ECHO; + // T_CLOSE_TAG is equivalent to ';' + $tokenMap[\T_CLOSE_TAG] = ord(';'); + + // We have created a map from PHP token IDs to external symbol IDs. + // Now map them to the internal symbol ID. + $fullTokenMap = []; + foreach ($tokenMap as $phpToken => $extSymbol) { + $intSymbol = $this->tokenToSymbol[$extSymbol]; + if ($intSymbol === $this->invalidSymbol) { + continue; + } + $fullTokenMap[$phpToken] = $intSymbol; + } + + return $fullTokenMap; } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php b/api/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php index f041e7ffe3..3a7586ea29 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php @@ -2,43 +2,41 @@ namespace PhpParser; -class ParserFactory -{ - const PREFER_PHP7 = 1; - const PREFER_PHP5 = 2; - const ONLY_PHP7 = 3; - const ONLY_PHP5 = 4; +use PhpParser\Parser\Php7; +use PhpParser\Parser\Php8; +class ParserFactory { /** - * Creates a Parser instance, according to the provided kind. - * - * @param int $kind One of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5 - * @param Lexer|null $lexer Lexer to use. Defaults to emulative lexer when not specified - * @param array $parserOptions Parser options. See ParserAbstract::__construct() argument - * - * @return Parser The parser instance + * Create a parser targeting the given version on a best-effort basis. The parser will generally + * accept code for the newest supported version, but will try to accommodate code that becomes + * invalid in newer versions or changes in interpretation. */ - public function create(int $kind, Lexer $lexer = null, array $parserOptions = []) : Parser { - if (null === $lexer) { - $lexer = new Lexer\Emulative(); + public function createForVersion(PhpVersion $version): Parser { + if ($version->isHostVersion()) { + $lexer = new Lexer(); + } else { + $lexer = new Lexer\Emulative($version); } - switch ($kind) { - case self::PREFER_PHP7: - return new Parser\Multiple([ - new Parser\Php7($lexer, $parserOptions), new Parser\Php5($lexer, $parserOptions) - ]); - case self::PREFER_PHP5: - return new Parser\Multiple([ - new Parser\Php5($lexer, $parserOptions), new Parser\Php7($lexer, $parserOptions) - ]); - case self::ONLY_PHP7: - return new Parser\Php7($lexer, $parserOptions); - case self::ONLY_PHP5: - return new Parser\Php5($lexer, $parserOptions); - default: - throw new \LogicException( - 'Kind must be one of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5' - ); + if ($version->id >= 80000) { + return new Php8($lexer, $version); } + return new Php7($lexer, $version); + } + + /** + * Create a parser targeting the newest version supported by this library. Code for older + * versions will be accepted if there have been no relevant backwards-compatibility breaks in + * PHP. + */ + public function createForNewestSupportedVersion(): Parser { + return $this->createForVersion(PhpVersion::getNewestSupported()); + } + + /** + * Create a parser targeting the host PHP version, that is the PHP version we're currently + * running on. This parser will not use any token emulation. + */ + public function createForHostVersion(): Parser { + return $this->createForVersion(PhpVersion::getHostVersion()); } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php b/api/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php new file mode 100644 index 0000000000..04ff6ddcbf --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/PhpVersion.php @@ -0,0 +1,164 @@ + 50100, + 'callable' => 50400, + 'bool' => 70000, + 'int' => 70000, + 'float' => 70000, + 'string' => 70000, + 'iterable' => 70100, + 'void' => 70100, + 'object' => 70200, + 'null' => 80000, + 'false' => 80000, + 'mixed' => 80000, + 'never' => 80100, + 'true' => 80200, + ]; + + private function __construct(int $id) { + $this->id = $id; + } + + /** + * Create a PhpVersion object from major and minor version components. + */ + public static function fromComponents(int $major, int $minor): self { + return new self($major * 10000 + $minor * 100); + } + + /** + * Get the newest PHP version supported by this library. Support for this version may be partial, + * if it is still under development. + */ + public static function getNewestSupported(): self { + return self::fromComponents(8, 4); + } + + /** + * Get the host PHP version, that is the PHP version we're currently running on. + */ + public static function getHostVersion(): self { + return self::fromComponents(\PHP_MAJOR_VERSION, \PHP_MINOR_VERSION); + } + + /** + * Parse the version from a string like "8.1". + */ + public static function fromString(string $version): self { + if (!preg_match('/^(\d+)\.(\d+)/', $version, $matches)) { + throw new \LogicException("Invalid PHP version \"$version\""); + } + return self::fromComponents((int) $matches[1], (int) $matches[2]); + } + + /** + * Check whether two versions are the same. + */ + public function equals(PhpVersion $other): bool { + return $this->id === $other->id; + } + + /** + * Check whether this version is greater than or equal to the argument. + */ + public function newerOrEqual(PhpVersion $other): bool { + return $this->id >= $other->id; + } + + /** + * Check whether this version is older than the argument. + */ + public function older(PhpVersion $other): bool { + return $this->id < $other->id; + } + + /** + * Check whether this is the host PHP version. + */ + public function isHostVersion(): bool { + return $this->equals(self::getHostVersion()); + } + + /** + * Check whether this PHP version supports the given builtin type. Type name must be lowercase. + */ + public function supportsBuiltinType(string $type): bool { + $minVersion = self::BUILTIN_TYPE_VERSIONS[$type] ?? null; + return $minVersion !== null && $this->id >= $minVersion; + } + + /** + * Whether this version supports [] array literals. + */ + public function supportsShortArraySyntax(): bool { + return $this->id >= 50400; + } + + /** + * Whether this version supports [] for destructuring. + */ + public function supportsShortArrayDestructuring(): bool { + return $this->id >= 70100; + } + + /** + * Whether this version supports flexible heredoc/nowdoc. + */ + public function supportsFlexibleHeredoc(): bool { + return $this->id >= 70300; + } + + /** + * Whether this version supports trailing commas in parameter lists. + */ + public function supportsTrailingCommaInParamList(): bool { + return $this->id >= 80000; + } + + /** + * Whether this version allows "$var =& new Obj". + */ + public function allowsAssignNewByReference(): bool { + return $this->id < 70000; + } + + /** + * Whether this version allows invalid octals like "08". + */ + public function allowsInvalidOctals(): bool { + return $this->id < 70000; + } + + /** + * Whether this version allows DEL (\x7f) to occur in identifiers. + */ + public function allowsDelInIdentifiers(): bool { + return $this->id < 70100; + } + + /** + * Whether this version supports yield in expression context without parentheses. + */ + public function supportsYieldWithoutParentheses(): bool { + return $this->id >= 70000; + } + + /** + * Whether this version supports unicode escape sequences in strings. + */ + public function supportsUnicodeEscapes(): bool { + return $this->id >= 70000; + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php b/api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php new file mode 100644 index 0000000000..892c686e53 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter.php @@ -0,0 +1,51 @@ +pAttrGroups($node->attrGroups, true) . $this->pModifiers($node->flags) . ($node->type ? $this->p($node->type) . ' ' : '') . ($node->byRef ? '&' : '') . ($node->variadic ? '...' : '') . $this->p($node->var) - . ($node->default ? ' = ' . $this->p($node->default) : ''); + . ($node->default ? ' = ' . $this->p($node->default) : '') + . ($node->hooks ? ' {' . $this->pStmts($node->hooks) . $this->nl . '}' : ''); } - protected function pArg(Node\Arg $node) { + protected function pArg(Node\Arg $node): string { return ($node->name ? $node->name->toString() . ': ' : '') . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') . $this->p($node->value); } - protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node) { + protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node): string { return '...'; } - protected function pConst(Node\Const_ $node) { + protected function pConst(Node\Const_ $node): string { return $node->name . ' = ' . $this->p($node->value); } - protected function pNullableType(Node\NullableType $node) { + protected function pNullableType(Node\NullableType $node): string { return '?' . $this->p($node->type); } - protected function pUnionType(Node\UnionType $node) { + protected function pUnionType(Node\UnionType $node): string { $types = []; foreach ($node->types as $typeNode) { if ($typeNode instanceof Node\IntersectionType) { @@ -57,138 +57,154 @@ protected function pUnionType(Node\UnionType $node) { return implode('|', $types); } - protected function pIntersectionType(Node\IntersectionType $node) { + protected function pIntersectionType(Node\IntersectionType $node): string { return $this->pImplode($node->types, '&'); } - protected function pIdentifier(Node\Identifier $node) { + protected function pIdentifier(Node\Identifier $node): string { return $node->name; } - protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node) { + protected function pVarLikeIdentifier(Node\VarLikeIdentifier $node): string { return '$' . $node->name; } - protected function pAttribute(Node\Attribute $node) { + protected function pAttribute(Node\Attribute $node): string { return $this->p($node->name) . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : ''); } - protected function pAttributeGroup(Node\AttributeGroup $node) { + protected function pAttributeGroup(Node\AttributeGroup $node): string { return '#[' . $this->pCommaSeparated($node->attrs) . ']'; } // Names - protected function pName(Name $node) { - return implode('\\', $node->parts); + protected function pName(Name $node): string { + return $node->name; } - protected function pName_FullyQualified(Name\FullyQualified $node) { - return '\\' . implode('\\', $node->parts); + protected function pName_FullyQualified(Name\FullyQualified $node): string { + return '\\' . $node->name; } - protected function pName_Relative(Name\Relative $node) { - return 'namespace\\' . implode('\\', $node->parts); + protected function pName_Relative(Name\Relative $node): string { + return 'namespace\\' . $node->name; } // Magic Constants - protected function pScalar_MagicConst_Class(MagicConst\Class_ $node) { + protected function pScalar_MagicConst_Class(MagicConst\Class_ $node): string { return '__CLASS__'; } - protected function pScalar_MagicConst_Dir(MagicConst\Dir $node) { + protected function pScalar_MagicConst_Dir(MagicConst\Dir $node): string { return '__DIR__'; } - protected function pScalar_MagicConst_File(MagicConst\File $node) { + protected function pScalar_MagicConst_File(MagicConst\File $node): string { return '__FILE__'; } - protected function pScalar_MagicConst_Function(MagicConst\Function_ $node) { + protected function pScalar_MagicConst_Function(MagicConst\Function_ $node): string { return '__FUNCTION__'; } - protected function pScalar_MagicConst_Line(MagicConst\Line $node) { + protected function pScalar_MagicConst_Line(MagicConst\Line $node): string { return '__LINE__'; } - protected function pScalar_MagicConst_Method(MagicConst\Method $node) { + protected function pScalar_MagicConst_Method(MagicConst\Method $node): string { return '__METHOD__'; } - protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node) { + protected function pScalar_MagicConst_Namespace(MagicConst\Namespace_ $node): string { return '__NAMESPACE__'; } - protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node) { + protected function pScalar_MagicConst_Trait(MagicConst\Trait_ $node): string { return '__TRAIT__'; } + protected function pScalar_MagicConst_Property(MagicConst\Property $node): string { + return '__PROPERTY__'; + } + // Scalars - protected function pScalar_String(Scalar\String_ $node) { + private function indentString(string $str): string { + return str_replace("\n", $this->nl, $str); + } + + protected function pScalar_String(Scalar\String_ $node): string { $kind = $node->getAttribute('kind', Scalar\String_::KIND_SINGLE_QUOTED); switch ($kind) { case Scalar\String_::KIND_NOWDOC: $label = $node->getAttribute('docLabel'); if ($label && !$this->containsEndLabel($node->value, $label)) { + $shouldIdent = $this->phpVersion->supportsFlexibleHeredoc(); + $nl = $shouldIdent ? $this->nl : $this->newline; if ($node->value === '') { - return "<<<'$label'\n$label" . $this->docStringEndToken; + return "<<<'$label'$nl$label{$this->docStringEndToken}"; } - return "<<<'$label'\n$node->value\n$label" - . $this->docStringEndToken; + // Make sure trailing \r is not combined with following \n into CRLF. + if ($node->value[strlen($node->value) - 1] !== "\r") { + $value = $shouldIdent ? $this->indentString($node->value) : $node->value; + return "<<<'$label'$nl$value$nl$label{$this->docStringEndToken}"; + } } /* break missing intentionally */ + // no break case Scalar\String_::KIND_SINGLE_QUOTED: return $this->pSingleQuotedString($node->value); case Scalar\String_::KIND_HEREDOC: $label = $node->getAttribute('docLabel'); - if ($label && !$this->containsEndLabel($node->value, $label)) { - if ($node->value === '') { - return "<<<$label\n$label" . $this->docStringEndToken; + $escaped = $this->escapeString($node->value, null); + if ($label && !$this->containsEndLabel($escaped, $label)) { + $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline; + if ($escaped === '') { + return "<<<$label$nl$label{$this->docStringEndToken}"; } - $escaped = $this->escapeString($node->value, null); - return "<<<$label\n" . $escaped . "\n$label" - . $this->docStringEndToken; + return "<<<$label$nl$escaped$nl$label{$this->docStringEndToken}"; } - /* break missing intentionally */ + /* break missing intentionally */ + // no break case Scalar\String_::KIND_DOUBLE_QUOTED: return '"' . $this->escapeString($node->value, '"') . '"'; } throw new \Exception('Invalid string kind'); } - protected function pScalar_Encapsed(Scalar\Encapsed $node) { + protected function pScalar_InterpolatedString(Scalar\InterpolatedString $node): string { if ($node->getAttribute('kind') === Scalar\String_::KIND_HEREDOC) { $label = $node->getAttribute('docLabel'); if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) { + $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline; if (count($node->parts) === 1 - && $node->parts[0] instanceof Scalar\EncapsedStringPart + && $node->parts[0] instanceof Node\InterpolatedStringPart && $node->parts[0]->value === '' ) { - return "<<<$label\n$label" . $this->docStringEndToken; + return "<<<$label$nl$label{$this->docStringEndToken}"; } - return "<<<$label\n" . $this->pEncapsList($node->parts, null) . "\n$label" - . $this->docStringEndToken; + return "<<<$label$nl" . $this->pEncapsList($node->parts, null) + . "$nl$label{$this->docStringEndToken}"; } } return '"' . $this->pEncapsList($node->parts, '"') . '"'; } - protected function pScalar_LNumber(Scalar\LNumber $node) { - if ($node->value === -\PHP_INT_MAX-1) { + protected function pScalar_Int(Scalar\Int_ $node): string { + if ($node->value === -\PHP_INT_MAX - 1) { // PHP_INT_MIN cannot be represented as a literal, // because the sign is not part of the literal return '(-' . \PHP_INT_MAX . '-1)'; } - $kind = $node->getAttribute('kind', Scalar\LNumber::KIND_DEC); - if (Scalar\LNumber::KIND_DEC === $kind) { + $kind = $node->getAttribute('kind', Scalar\Int_::KIND_DEC); + if (Scalar\Int_::KIND_DEC === $kind) { return (string) $node->value; } @@ -200,22 +216,23 @@ protected function pScalar_LNumber(Scalar\LNumber $node) { $str = (string) $node->value; } switch ($kind) { - case Scalar\LNumber::KIND_BIN: + case Scalar\Int_::KIND_BIN: return $sign . '0b' . base_convert($str, 10, 2); - case Scalar\LNumber::KIND_OCT: + case Scalar\Int_::KIND_OCT: return $sign . '0' . base_convert($str, 10, 8); - case Scalar\LNumber::KIND_HEX: + case Scalar\Int_::KIND_HEX: return $sign . '0x' . base_convert($str, 10, 16); } throw new \Exception('Invalid number kind'); } - protected function pScalar_DNumber(Scalar\DNumber $node) { + protected function pScalar_Float(Scalar\Float_ $node): string { if (!is_finite($node->value)) { if ($node->value === \INF) { - return '\INF'; - } elseif ($node->value === -\INF) { - return '-\INF'; + return '1.0E+1000'; + } + if ($node->value === -\INF) { + return '-1.0E+1000'; } else { return '\NAN'; } @@ -223,7 +240,7 @@ protected function pScalar_DNumber(Scalar\DNumber $node) { // Try to find a short full-precision representation $stringValue = sprintf('%.16G', $node->value); - if ($node->value !== (double) $stringValue) { + if ($node->value !== (float) $stringValue) { $stringValue = sprintf('%.17G', $node->value); } @@ -236,300 +253,289 @@ protected function pScalar_DNumber(Scalar\DNumber $node) { return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue; } - protected function pScalar_EncapsedStringPart(Scalar\EncapsedStringPart $node) { - throw new \LogicException('Cannot directly print EncapsedStringPart'); - } - // Assignments - protected function pExpr_Assign(Expr\Assign $node) { - return $this->pInfixOp(Expr\Assign::class, $node->var, ' = ', $node->expr); + protected function pExpr_Assign(Expr\Assign $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Assign::class, $this->p($node->var) . ' = ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignRef(Expr\AssignRef $node) { - return $this->pInfixOp(Expr\AssignRef::class, $node->var, ' =& ', $node->expr); + protected function pExpr_AssignRef(Expr\AssignRef $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\AssignRef::class, $this->p($node->var) . ' =& ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Plus(AssignOp\Plus $node) { - return $this->pInfixOp(AssignOp\Plus::class, $node->var, ' += ', $node->expr); + protected function pExpr_AssignOp_Plus(AssignOp\Plus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Plus::class, $this->p($node->var) . ' += ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Minus(AssignOp\Minus $node) { - return $this->pInfixOp(AssignOp\Minus::class, $node->var, ' -= ', $node->expr); + protected function pExpr_AssignOp_Minus(AssignOp\Minus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Minus::class, $this->p($node->var) . ' -= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Mul(AssignOp\Mul $node) { - return $this->pInfixOp(AssignOp\Mul::class, $node->var, ' *= ', $node->expr); + protected function pExpr_AssignOp_Mul(AssignOp\Mul $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Mul::class, $this->p($node->var) . ' *= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Div(AssignOp\Div $node) { - return $this->pInfixOp(AssignOp\Div::class, $node->var, ' /= ', $node->expr); + protected function pExpr_AssignOp_Div(AssignOp\Div $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Div::class, $this->p($node->var) . ' /= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Concat(AssignOp\Concat $node) { - return $this->pInfixOp(AssignOp\Concat::class, $node->var, ' .= ', $node->expr); + protected function pExpr_AssignOp_Concat(AssignOp\Concat $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Concat::class, $this->p($node->var) . ' .= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Mod(AssignOp\Mod $node) { - return $this->pInfixOp(AssignOp\Mod::class, $node->var, ' %= ', $node->expr); + protected function pExpr_AssignOp_Mod(AssignOp\Mod $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Mod::class, $this->p($node->var) . ' %= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node) { - return $this->pInfixOp(AssignOp\BitwiseAnd::class, $node->var, ' &= ', $node->expr); + protected function pExpr_AssignOp_BitwiseAnd(AssignOp\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\BitwiseAnd::class, $this->p($node->var) . ' &= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node) { - return $this->pInfixOp(AssignOp\BitwiseOr::class, $node->var, ' |= ', $node->expr); + protected function pExpr_AssignOp_BitwiseOr(AssignOp\BitwiseOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\BitwiseOr::class, $this->p($node->var) . ' |= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node) { - return $this->pInfixOp(AssignOp\BitwiseXor::class, $node->var, ' ^= ', $node->expr); + protected function pExpr_AssignOp_BitwiseXor(AssignOp\BitwiseXor $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\BitwiseXor::class, $this->p($node->var) . ' ^= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node) { - return $this->pInfixOp(AssignOp\ShiftLeft::class, $node->var, ' <<= ', $node->expr); + protected function pExpr_AssignOp_ShiftLeft(AssignOp\ShiftLeft $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\ShiftLeft::class, $this->p($node->var) . ' <<= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node) { - return $this->pInfixOp(AssignOp\ShiftRight::class, $node->var, ' >>= ', $node->expr); + protected function pExpr_AssignOp_ShiftRight(AssignOp\ShiftRight $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\ShiftRight::class, $this->p($node->var) . ' >>= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Pow(AssignOp\Pow $node) { - return $this->pInfixOp(AssignOp\Pow::class, $node->var, ' **= ', $node->expr); + protected function pExpr_AssignOp_Pow(AssignOp\Pow $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Pow::class, $this->p($node->var) . ' **= ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node) { - return $this->pInfixOp(AssignOp\Coalesce::class, $node->var, ' ??= ', $node->expr); + protected function pExpr_AssignOp_Coalesce(AssignOp\Coalesce $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(AssignOp\Coalesce::class, $this->p($node->var) . ' ??= ', $node->expr, $precedence, $lhsPrecedence); } // Binary expressions - protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node) { - return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right); + protected function pExpr_BinaryOp_Plus(BinaryOp\Plus $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Plus::class, $node->left, ' + ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node) { - return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right); + protected function pExpr_BinaryOp_Minus(BinaryOp\Minus $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Minus::class, $node->left, ' - ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node) { - return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right); + protected function pExpr_BinaryOp_Mul(BinaryOp\Mul $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Mul::class, $node->left, ' * ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Div(BinaryOp\Div $node) { - return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right); + protected function pExpr_BinaryOp_Div(BinaryOp\Div $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Div::class, $node->left, ' / ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node) { - return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right); + protected function pExpr_BinaryOp_Concat(BinaryOp\Concat $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Concat::class, $node->left, ' . ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node) { - return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right); + protected function pExpr_BinaryOp_Mod(BinaryOp\Mod $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Mod::class, $node->left, ' % ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node) { - return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right); + protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\BooleanAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BooleanAnd::class, $node->left, ' && ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node) { - return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right); + protected function pExpr_BinaryOp_BooleanOr(BinaryOp\BooleanOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BooleanOr::class, $node->left, ' || ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node) { - return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right); + protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BitwiseAnd::class, $node->left, ' & ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node) { - return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right); + protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\BitwiseOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BitwiseOr::class, $node->left, ' | ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node) { - return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right); + protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\BitwiseXor $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\BitwiseXor::class, $node->left, ' ^ ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node) { - return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right); + protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\ShiftLeft $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\ShiftLeft::class, $node->left, ' << ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node) { - return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right); + protected function pExpr_BinaryOp_ShiftRight(BinaryOp\ShiftRight $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\ShiftRight::class, $node->left, ' >> ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node) { - return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right); + protected function pExpr_BinaryOp_Pow(BinaryOp\Pow $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Pow::class, $node->left, ' ** ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node) { - return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right); + protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\LogicalAnd $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\LogicalAnd::class, $node->left, ' and ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node) { - return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right); + protected function pExpr_BinaryOp_LogicalOr(BinaryOp\LogicalOr $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\LogicalOr::class, $node->left, ' or ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node) { - return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right); + protected function pExpr_BinaryOp_LogicalXor(BinaryOp\LogicalXor $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\LogicalXor::class, $node->left, ' xor ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node) { - return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right); + protected function pExpr_BinaryOp_Equal(BinaryOp\Equal $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Equal::class, $node->left, ' == ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node) { - return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right); + protected function pExpr_BinaryOp_NotEqual(BinaryOp\NotEqual $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\NotEqual::class, $node->left, ' != ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node) { - return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right); + protected function pExpr_BinaryOp_Identical(BinaryOp\Identical $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Identical::class, $node->left, ' === ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node) { - return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right); + protected function pExpr_BinaryOp_NotIdentical(BinaryOp\NotIdentical $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\NotIdentical::class, $node->left, ' !== ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node) { - return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right); + protected function pExpr_BinaryOp_Spaceship(BinaryOp\Spaceship $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Spaceship::class, $node->left, ' <=> ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node) { - return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right); + protected function pExpr_BinaryOp_Greater(BinaryOp\Greater $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Greater::class, $node->left, ' > ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node) { - return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right); + protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\GreaterOrEqual $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\GreaterOrEqual::class, $node->left, ' >= ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node) { - return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right); + protected function pExpr_BinaryOp_Smaller(BinaryOp\Smaller $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Smaller::class, $node->left, ' < ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node) { - return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right); + protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\SmallerOrEqual $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\SmallerOrEqual::class, $node->left, ' <= ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node) { - return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right); + protected function pExpr_BinaryOp_Coalesce(BinaryOp\Coalesce $node, int $precedence, int $lhsPrecedence): string { + return $this->pInfixOp(BinaryOp\Coalesce::class, $node->left, ' ?? ', $node->right, $precedence, $lhsPrecedence); } - protected function pExpr_Instanceof(Expr\Instanceof_ $node) { - list($precedence, $associativity) = $this->precedenceMap[Expr\Instanceof_::class]; - return $this->pPrec($node->expr, $precedence, $associativity, -1) - . ' instanceof ' - . $this->pNewVariable($node->class); + protected function pExpr_Instanceof(Expr\Instanceof_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPostfixOp( + Expr\Instanceof_::class, $node->expr, + ' instanceof ' . $this->pNewOperand($node->class), + $precedence, $lhsPrecedence); } // Unary expressions - protected function pExpr_BooleanNot(Expr\BooleanNot $node) { - return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr); + protected function pExpr_BooleanNot(Expr\BooleanNot $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\BooleanNot::class, '!', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_BitwiseNot(Expr\BitwiseNot $node) { - return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr); + protected function pExpr_BitwiseNot(Expr\BitwiseNot $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\BitwiseNot::class, '~', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_UnaryMinus(Expr\UnaryMinus $node) { - if ($node->expr instanceof Expr\UnaryMinus || $node->expr instanceof Expr\PreDec) { - // Enforce -(-$expr) instead of --$expr - return '-(' . $this->p($node->expr) . ')'; - } - return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr); + protected function pExpr_UnaryMinus(Expr\UnaryMinus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\UnaryMinus::class, '-', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_UnaryPlus(Expr\UnaryPlus $node) { - if ($node->expr instanceof Expr\UnaryPlus || $node->expr instanceof Expr\PreInc) { - // Enforce +(+$expr) instead of ++$expr - return '+(' . $this->p($node->expr) . ')'; - } - return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr); + protected function pExpr_UnaryPlus(Expr\UnaryPlus $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\UnaryPlus::class, '+', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_PreInc(Expr\PreInc $node) { - return $this->pPrefixOp(Expr\PreInc::class, '++', $node->var); + protected function pExpr_PreInc(Expr\PreInc $node): string { + return '++' . $this->p($node->var); } - protected function pExpr_PreDec(Expr\PreDec $node) { - return $this->pPrefixOp(Expr\PreDec::class, '--', $node->var); + protected function pExpr_PreDec(Expr\PreDec $node): string { + return '--' . $this->p($node->var); } - protected function pExpr_PostInc(Expr\PostInc $node) { - return $this->pPostfixOp(Expr\PostInc::class, $node->var, '++'); + protected function pExpr_PostInc(Expr\PostInc $node): string { + return $this->p($node->var) . '++'; } - protected function pExpr_PostDec(Expr\PostDec $node) { - return $this->pPostfixOp(Expr\PostDec::class, $node->var, '--'); + protected function pExpr_PostDec(Expr\PostDec $node): string { + return $this->p($node->var) . '--'; } - protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node) { - return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr); + protected function pExpr_ErrorSuppress(Expr\ErrorSuppress $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\ErrorSuppress::class, '@', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_YieldFrom(Expr\YieldFrom $node) { - return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr); + protected function pExpr_YieldFrom(Expr\YieldFrom $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\YieldFrom::class, 'yield from ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Print(Expr\Print_ $node) { - return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr); + protected function pExpr_Print(Expr\Print_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Print_::class, 'print ', $node->expr, $precedence, $lhsPrecedence); } // Casts - protected function pExpr_Cast_Int(Cast\Int_ $node) { - return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr); + protected function pExpr_Cast_Int(Cast\Int_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Int_::class, '(int) ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Cast_Double(Cast\Double $node) { + protected function pExpr_Cast_Double(Cast\Double $node, int $precedence, int $lhsPrecedence): string { $kind = $node->getAttribute('kind', Cast\Double::KIND_DOUBLE); if ($kind === Cast\Double::KIND_DOUBLE) { $cast = '(double)'; } elseif ($kind === Cast\Double::KIND_FLOAT) { $cast = '(float)'; - } elseif ($kind === Cast\Double::KIND_REAL) { + } else { + assert($kind === Cast\Double::KIND_REAL); $cast = '(real)'; } - return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr); + return $this->pPrefixOp(Cast\Double::class, $cast . ' ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Cast_String(Cast\String_ $node) { - return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr); + protected function pExpr_Cast_String(Cast\String_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\String_::class, '(string) ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Cast_Array(Cast\Array_ $node) { - return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr); + protected function pExpr_Cast_Array(Cast\Array_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Array_::class, '(array) ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Cast_Object(Cast\Object_ $node) { - return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr); + protected function pExpr_Cast_Object(Cast\Object_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Object_::class, '(object) ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Cast_Bool(Cast\Bool_ $node) { - return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr); + protected function pExpr_Cast_Bool(Cast\Bool_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Bool_::class, '(bool) ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Cast_Unset(Cast\Unset_ $node) { - return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr); + protected function pExpr_Cast_Unset(Cast\Unset_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Cast\Unset_::class, '(unset) ', $node->expr, $precedence, $lhsPrecedence); } // Function calls and similar constructs - protected function pExpr_FuncCall(Expr\FuncCall $node) { + protected function pExpr_FuncCall(Expr\FuncCall $node): string { return $this->pCallLhs($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')'; } - protected function pExpr_MethodCall(Expr\MethodCall $node) { + protected function pExpr_MethodCall(Expr\MethodCall $node): string { return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')'; } - protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node) { + protected function pExpr_NullsafeMethodCall(Expr\NullsafeMethodCall $node): string { return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name) . '(' . $this->pMaybeMultiline($node->args) . ')'; } - protected function pExpr_StaticCall(Expr\StaticCall $node) { - return $this->pDereferenceLhs($node->class) . '::' + protected function pExpr_StaticCall(Expr\StaticCall $node): string { + return $this->pStaticDereferenceLhs($node->class) . '::' . ($node->name instanceof Expr ? ($node->name instanceof Expr\Variable ? $this->p($node->name) @@ -538,19 +544,19 @@ protected function pExpr_StaticCall(Expr\StaticCall $node) { . '(' . $this->pMaybeMultiline($node->args) . ')'; } - protected function pExpr_Empty(Expr\Empty_ $node) { + protected function pExpr_Empty(Expr\Empty_ $node): string { return 'empty(' . $this->p($node->expr) . ')'; } - protected function pExpr_Isset(Expr\Isset_ $node) { + protected function pExpr_Isset(Expr\Isset_ $node): string { return 'isset(' . $this->pCommaSeparated($node->vars) . ')'; } - protected function pExpr_Eval(Expr\Eval_ $node) { + protected function pExpr_Eval(Expr\Eval_ $node): string { return 'eval(' . $this->p($node->expr) . ')'; } - protected function pExpr_Include(Expr\Include_ $node) { + protected function pExpr_Include(Expr\Include_ $node, int $precedence, int $lhsPrecedence): string { static $map = [ Expr\Include_::TYPE_INCLUDE => 'include', Expr\Include_::TYPE_INCLUDE_ONCE => 'include_once', @@ -558,20 +564,26 @@ protected function pExpr_Include(Expr\Include_ $node) { Expr\Include_::TYPE_REQUIRE_ONCE => 'require_once', ]; - return $map[$node->type] . ' ' . $this->p($node->expr); + return $this->pPrefixOp(Expr\Include_::class, $map[$node->type] . ' ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_List(Expr\List_ $node) { - return 'list(' . $this->pCommaSeparated($node->items) . ')'; + protected function pExpr_List(Expr\List_ $node): string { + $syntax = $node->getAttribute('kind', + $this->phpVersion->supportsShortArrayDestructuring() ? Expr\List_::KIND_ARRAY : Expr\List_::KIND_LIST); + if ($syntax === Expr\List_::KIND_ARRAY) { + return '[' . $this->pMaybeMultiline($node->items, true) . ']'; + } else { + return 'list(' . $this->pMaybeMultiline($node->items, true) . ')'; + } } // Other - protected function pExpr_Error(Expr\Error $node) { + protected function pExpr_Error(Expr\Error $node): string { throw new \LogicException('Cannot pretty-print AST with Error nodes'); } - protected function pExpr_Variable(Expr\Variable $node) { + protected function pExpr_Variable(Expr\Variable $node): string { if ($node->name instanceof Expr) { return '${' . $this->p($node->name) . '}'; } else { @@ -579,9 +591,9 @@ protected function pExpr_Variable(Expr\Variable $node) { } } - protected function pExpr_Array(Expr\Array_ $node) { + protected function pExpr_Array(Expr\Array_ $node): string { $syntax = $node->getAttribute('kind', - $this->options['shortArraySyntax'] ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG); + $this->shortArraySyntax ? Expr\Array_::KIND_SHORT : Expr\Array_::KIND_LONG); if ($syntax === Expr\Array_::KIND_SHORT) { return '[' . $this->pMaybeMultiline($node->items, true) . ']'; } else { @@ -589,124 +601,152 @@ protected function pExpr_Array(Expr\Array_ $node) { } } - protected function pExpr_ArrayItem(Expr\ArrayItem $node) { - return (null !== $node->key ? $this->p($node->key) . ' => ' : '') + protected function pKey(?Node $node): string { + if ($node === null) { + return ''; + } + + // => is not really an operator and does not typically participate in precedence resolution. + // However, there is an exception if yield expressions with keys are involved: + // [yield $a => $b] is interpreted as [(yield $a => $b)], so we need to ensure that + // [(yield $a) => $b] is printed with parentheses. We approximate this by lowering the LHS + // precedence to that of yield (which will also print unnecessary parentheses for rare low + // precedence unary operators like include). + $yieldPrecedence = $this->precedenceMap[Expr\Yield_::class][0]; + return $this->p($node, self::MAX_PRECEDENCE, $yieldPrecedence) . ' => '; + } + + protected function pArrayItem(Node\ArrayItem $node): string { + return $this->pKey($node->key) . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '') . $this->p($node->value); } - protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node) { + protected function pExpr_ArrayDimFetch(Expr\ArrayDimFetch $node): string { return $this->pDereferenceLhs($node->var) . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']'; } - protected function pExpr_ConstFetch(Expr\ConstFetch $node) { + protected function pExpr_ConstFetch(Expr\ConstFetch $node): string { return $this->p($node->name); } - protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node) { - return $this->pDereferenceLhs($node->class) . '::' . $this->p($node->name); + protected function pExpr_ClassConstFetch(Expr\ClassConstFetch $node): string { + return $this->pStaticDereferenceLhs($node->class) . '::' . $this->pObjectProperty($node->name); } - protected function pExpr_PropertyFetch(Expr\PropertyFetch $node) { + protected function pExpr_PropertyFetch(Expr\PropertyFetch $node): string { return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name); } - protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node) { + protected function pExpr_NullsafePropertyFetch(Expr\NullsafePropertyFetch $node): string { return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name); } - protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node) { - return $this->pDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); + protected function pExpr_StaticPropertyFetch(Expr\StaticPropertyFetch $node): string { + return $this->pStaticDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name); } - protected function pExpr_ShellExec(Expr\ShellExec $node) { + protected function pExpr_ShellExec(Expr\ShellExec $node): string { return '`' . $this->pEncapsList($node->parts, '`') . '`'; } - protected function pExpr_Closure(Expr\Closure $node) { + protected function pExpr_Closure(Expr\Closure $node): string { return $this->pAttrGroups($node->attrGroups, true) - . ($node->static ? 'static ' : '') + . $this->pStatic($node->static) . 'function ' . ($node->byRef ? '&' : '') - . '(' . $this->pCommaSeparated($node->params) . ')' - . (!empty($node->uses) ? ' use(' . $this->pCommaSeparated($node->uses) . ')' : '') - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' + . (!empty($node->uses) ? ' use (' . $this->pCommaSeparated($node->uses) . ')' : '') + . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') . ' {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pExpr_Match(Expr\Match_ $node) { + protected function pExpr_Match(Expr\Match_ $node): string { return 'match (' . $this->p($node->cond) . ') {' . $this->pCommaSeparatedMultiline($node->arms, true) . $this->nl . '}'; } - protected function pMatchArm(Node\MatchArm $node) { - return ($node->conds ? $this->pCommaSeparated($node->conds) : 'default') - . ' => ' . $this->p($node->body); + protected function pMatchArm(Node\MatchArm $node): string { + $result = ''; + if ($node->conds) { + for ($i = 0, $c = \count($node->conds); $i + 1 < $c; $i++) { + $result .= $this->p($node->conds[$i]) . ', '; + } + $result .= $this->pKey($node->conds[$i]); + } else { + $result = 'default => '; + } + return $result . $this->p($node->body); } - protected function pExpr_ArrowFunction(Expr\ArrowFunction $node) { - return $this->pAttrGroups($node->attrGroups, true) - . ($node->static ? 'static ' : '') + protected function pExpr_ArrowFunction(Expr\ArrowFunction $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp( + Expr\ArrowFunction::class, + $this->pAttrGroups($node->attrGroups, true) + . $this->pStatic($node->static) . 'fn' . ($node->byRef ? '&' : '') - . '(' . $this->pCommaSeparated($node->params) . ')' + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') - . ' => ' - . $this->p($node->expr); + . ' => ', + $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_ClosureUse(Expr\ClosureUse $node) { + protected function pClosureUse(Node\ClosureUse $node): string { return ($node->byRef ? '&' : '') . $this->p($node->var); } - protected function pExpr_New(Expr\New_ $node) { + protected function pExpr_New(Expr\New_ $node): string { if ($node->class instanceof Stmt\Class_) { $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : ''; return 'new ' . $this->pClassCommon($node->class, $args); } - return 'new ' . $this->pNewVariable($node->class) + return 'new ' . $this->pNewOperand($node->class) . '(' . $this->pMaybeMultiline($node->args) . ')'; } - protected function pExpr_Clone(Expr\Clone_ $node) { - return 'clone ' . $this->p($node->expr); + protected function pExpr_Clone(Expr\Clone_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Clone_::class, 'clone ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Ternary(Expr\Ternary $node) { + protected function pExpr_Ternary(Expr\Ternary $node, int $precedence, int $lhsPrecedence): string { // a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator. // this is okay because the part between ? and : never needs parentheses. return $this->pInfixOp(Expr\Ternary::class, - $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else + $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else, + $precedence, $lhsPrecedence ); } - protected function pExpr_Exit(Expr\Exit_ $node) { + protected function pExpr_Exit(Expr\Exit_ $node): string { $kind = $node->getAttribute('kind', Expr\Exit_::KIND_DIE); return ($kind === Expr\Exit_::KIND_EXIT ? 'exit' : 'die') . (null !== $node->expr ? '(' . $this->p($node->expr) . ')' : ''); } - protected function pExpr_Throw(Expr\Throw_ $node) { - return 'throw ' . $this->p($node->expr); + protected function pExpr_Throw(Expr\Throw_ $node, int $precedence, int $lhsPrecedence): string { + return $this->pPrefixOp(Expr\Throw_::class, 'throw ', $node->expr, $precedence, $lhsPrecedence); } - protected function pExpr_Yield(Expr\Yield_ $node) { + protected function pExpr_Yield(Expr\Yield_ $node, int $precedence, int $lhsPrecedence): string { if ($node->value === null) { - return 'yield'; + $opPrecedence = $this->precedenceMap[Expr\Yield_::class][0]; + return $opPrecedence >= $lhsPrecedence ? '(yield)' : 'yield'; } else { - // this is a bit ugly, but currently there is no way to detect whether the parentheses are necessary - return '(yield ' - . ($node->key !== null ? $this->p($node->key) . ' => ' : '') - . $this->p($node->value) - . ')'; + if (!$this->phpVersion->supportsYieldWithoutParentheses()) { + return '(yield ' . $this->pKey($node->key) . $this->p($node->value) . ')'; + } + return $this->pPrefixOp( + Expr\Yield_::class, 'yield ' . $this->pKey($node->key), + $node->value, $precedence, $lhsPrecedence); } } // Declarations - protected function pStmt_Namespace(Stmt\Namespace_ $node) { + protected function pStmt_Namespace(Stmt\Namespace_ $node): string { if ($this->canUseSemicolonNamespaces) { return 'namespace ' . $this->p($node->name) . ';' . $this->nl . $this->pStmts($node->stmts, false); @@ -716,147 +756,163 @@ protected function pStmt_Namespace(Stmt\Namespace_ $node) { } } - protected function pStmt_Use(Stmt\Use_ $node) { + protected function pStmt_Use(Stmt\Use_ $node): string { return 'use ' . $this->pUseType($node->type) . $this->pCommaSeparated($node->uses) . ';'; } - protected function pStmt_GroupUse(Stmt\GroupUse $node) { + protected function pStmt_GroupUse(Stmt\GroupUse $node): string { return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix) . '\{' . $this->pCommaSeparated($node->uses) . '};'; } - protected function pStmt_UseUse(Stmt\UseUse $node) { + protected function pUseItem(Node\UseItem $node): string { return $this->pUseType($node->type) . $this->p($node->name) . (null !== $node->alias ? ' as ' . $node->alias : ''); } - protected function pUseType($type) { + protected function pUseType(int $type): string { return $type === Stmt\Use_::TYPE_FUNCTION ? 'function ' : ($type === Stmt\Use_::TYPE_CONSTANT ? 'const ' : ''); } - protected function pStmt_Interface(Stmt\Interface_ $node) { + protected function pStmt_Interface(Stmt\Interface_ $node): string { return $this->pAttrGroups($node->attrGroups) . 'interface ' . $node->name . (!empty($node->extends) ? ' extends ' . $this->pCommaSeparated($node->extends) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Enum(Stmt\Enum_ $node) { + protected function pStmt_Enum(Stmt\Enum_ $node): string { return $this->pAttrGroups($node->attrGroups) . 'enum ' . $node->name - . ($node->scalarType ? " : $node->scalarType" : '') + . ($node->scalarType ? ' : ' . $this->p($node->scalarType) : '') . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Class(Stmt\Class_ $node) { + protected function pStmt_Class(Stmt\Class_ $node): string { return $this->pClassCommon($node, ' ' . $node->name); } - protected function pStmt_Trait(Stmt\Trait_ $node) { + protected function pStmt_Trait(Stmt\Trait_ $node): string { return $this->pAttrGroups($node->attrGroups) . 'trait ' . $node->name . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_EnumCase(Stmt\EnumCase $node) { + protected function pStmt_EnumCase(Stmt\EnumCase $node): string { return $this->pAttrGroups($node->attrGroups) . 'case ' . $node->name . ($node->expr ? ' = ' . $this->p($node->expr) : '') . ';'; } - protected function pStmt_TraitUse(Stmt\TraitUse $node) { + protected function pStmt_TraitUse(Stmt\TraitUse $node): string { return 'use ' . $this->pCommaSeparated($node->traits) . (empty($node->adaptations) ? ';' : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}'); } - protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node) { + protected function pStmt_TraitUseAdaptation_Precedence(Stmt\TraitUseAdaptation\Precedence $node): string { return $this->p($node->trait) . '::' . $node->method . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';'; } - protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node) { + protected function pStmt_TraitUseAdaptation_Alias(Stmt\TraitUseAdaptation\Alias $node): string { return (null !== $node->trait ? $this->p($node->trait) . '::' : '') . $node->method . ' as' . (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '') - . (null !== $node->newName ? ' ' . $node->newName : '') + . (null !== $node->newName ? ' ' . $node->newName : '') . ';'; } - protected function pStmt_Property(Stmt\Property $node) { + protected function pStmt_Property(Stmt\Property $node): string { return $this->pAttrGroups($node->attrGroups) . (0 === $node->flags ? 'var ' : $this->pModifiers($node->flags)) . ($node->type ? $this->p($node->type) . ' ' : '') - . $this->pCommaSeparated($node->props) . ';'; + . $this->pCommaSeparated($node->props) + . ($node->hooks ? ' {' . $this->pStmts($node->hooks) . $this->nl . '}' : ';'); } - protected function pStmt_PropertyProperty(Stmt\PropertyProperty $node) { + protected function pPropertyItem(Node\PropertyItem $node): string { return '$' . $node->name . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); } - protected function pStmt_ClassMethod(Stmt\ClassMethod $node) { + protected function pPropertyHook(Node\PropertyHook $node): string { + return $this->pAttrGroups($node->attrGroups) + . $this->pModifiers($node->flags) + . ($node->byRef ? '&' : '') . $node->name + . ($node->params ? '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' : '') + . (\is_array($node->body) ? ' {' . $this->pStmts($node->body) . $this->nl . '}' + : ($node->body !== null ? ' => ' . $this->p($node->body) : '') . ';'); + } + + protected function pStmt_ClassMethod(Stmt\ClassMethod $node): string { return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pMaybeMultiline($node->params) . ')' - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' + . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') . (null !== $node->stmts ? $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}' : ';'); } - protected function pStmt_ClassConst(Stmt\ClassConst $node) { + protected function pStmt_ClassConst(Stmt\ClassConst $node): string { return $this->pAttrGroups($node->attrGroups) . $this->pModifiers($node->flags) - . 'const ' . $this->pCommaSeparated($node->consts) . ';'; + . 'const ' + . (null !== $node->type ? $this->p($node->type) . ' ' : '') + . $this->pCommaSeparated($node->consts) . ';'; } - protected function pStmt_Function(Stmt\Function_ $node) { + protected function pStmt_Function(Stmt\Function_ $node): string { return $this->pAttrGroups($node->attrGroups) . 'function ' . ($node->byRef ? '&' : '') . $node->name - . '(' . $this->pCommaSeparated($node->params) . ')' - . (null !== $node->returnType ? ' : ' . $this->p($node->returnType) : '') + . '(' . $this->pMaybeMultiline($node->params, $this->phpVersion->supportsTrailingCommaInParamList()) . ')' + . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '') . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Const(Stmt\Const_ $node) { + protected function pStmt_Const(Stmt\Const_ $node): string { return 'const ' . $this->pCommaSeparated($node->consts) . ';'; } - protected function pStmt_Declare(Stmt\Declare_ $node) { + protected function pStmt_Declare(Stmt\Declare_ $node): string { return 'declare (' . $this->pCommaSeparated($node->declares) . ')' . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';'); } - protected function pStmt_DeclareDeclare(Stmt\DeclareDeclare $node) { + protected function pDeclareItem(Node\DeclareItem $node): string { return $node->key . '=' . $this->p($node->value); } // Control flow - protected function pStmt_If(Stmt\If_ $node) { + protected function pStmt_If(Stmt\If_ $node): string { return 'if (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}' . ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '') . (null !== $node->else ? ' ' . $this->p($node->else) : ''); } - protected function pStmt_ElseIf(Stmt\ElseIf_ $node) { + protected function pStmt_ElseIf(Stmt\ElseIf_ $node): string { return 'elseif (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Else(Stmt\Else_ $node) { + protected function pStmt_Else(Stmt\Else_ $node): string { + if (\count($node->stmts) === 1 && $node->stmts[0] instanceof Stmt\If_) { + // Print as "else if" rather than "else { if }" + return 'else ' . $this->p($node->stmts[0]); + } return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_For(Stmt\For_ $node) { + protected function pStmt_For(Stmt\For_ $node): string { return 'for (' . $this->pCommaSeparated($node->init) . ';' . (!empty($node->cond) ? ' ' : '') . $this->pCommaSeparated($node->cond) . ';' . (!empty($node->loop) ? ' ' : '') @@ -864,116 +920,116 @@ protected function pStmt_For(Stmt\For_ $node) { . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Foreach(Stmt\Foreach_ $node) { + protected function pStmt_Foreach(Stmt\Foreach_ $node): string { return 'foreach (' . $this->p($node->expr) . ' as ' . (null !== $node->keyVar ? $this->p($node->keyVar) . ' => ' : '') . ($node->byRef ? '&' : '') . $this->p($node->valueVar) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_While(Stmt\While_ $node) { + protected function pStmt_While(Stmt\While_ $node): string { return 'while (' . $this->p($node->cond) . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Do(Stmt\Do_ $node) { + protected function pStmt_Do(Stmt\Do_ $node): string { return 'do {' . $this->pStmts($node->stmts) . $this->nl . '} while (' . $this->p($node->cond) . ');'; } - protected function pStmt_Switch(Stmt\Switch_ $node) { + protected function pStmt_Switch(Stmt\Switch_ $node): string { return 'switch (' . $this->p($node->cond) . ') {' . $this->pStmts($node->cases) . $this->nl . '}'; } - protected function pStmt_Case(Stmt\Case_ $node) { + protected function pStmt_Case(Stmt\Case_ $node): string { return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':' . $this->pStmts($node->stmts); } - protected function pStmt_TryCatch(Stmt\TryCatch $node) { + protected function pStmt_TryCatch(Stmt\TryCatch $node): string { return 'try {' . $this->pStmts($node->stmts) . $this->nl . '}' . ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '') . ($node->finally !== null ? ' ' . $this->p($node->finally) : ''); } - protected function pStmt_Catch(Stmt\Catch_ $node) { + protected function pStmt_Catch(Stmt\Catch_ $node): string { return 'catch (' . $this->pImplode($node->types, '|') . ($node->var !== null ? ' ' . $this->p($node->var) : '') . ') {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Finally(Stmt\Finally_ $node) { + protected function pStmt_Finally(Stmt\Finally_ $node): string { return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pStmt_Break(Stmt\Break_ $node) { + protected function pStmt_Break(Stmt\Break_ $node): string { return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; } - protected function pStmt_Continue(Stmt\Continue_ $node) { + protected function pStmt_Continue(Stmt\Continue_ $node): string { return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';'; } - protected function pStmt_Return(Stmt\Return_ $node) { + protected function pStmt_Return(Stmt\Return_ $node): string { return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';'; } - protected function pStmt_Throw(Stmt\Throw_ $node) { - return 'throw ' . $this->p($node->expr) . ';'; - } - - protected function pStmt_Label(Stmt\Label $node) { + protected function pStmt_Label(Stmt\Label $node): string { return $node->name . ':'; } - protected function pStmt_Goto(Stmt\Goto_ $node) { + protected function pStmt_Goto(Stmt\Goto_ $node): string { return 'goto ' . $node->name . ';'; } // Other - protected function pStmt_Expression(Stmt\Expression $node) { + protected function pStmt_Expression(Stmt\Expression $node): string { return $this->p($node->expr) . ';'; } - protected function pStmt_Echo(Stmt\Echo_ $node) { + protected function pStmt_Echo(Stmt\Echo_ $node): string { return 'echo ' . $this->pCommaSeparated($node->exprs) . ';'; } - protected function pStmt_Static(Stmt\Static_ $node) { + protected function pStmt_Static(Stmt\Static_ $node): string { return 'static ' . $this->pCommaSeparated($node->vars) . ';'; } - protected function pStmt_Global(Stmt\Global_ $node) { + protected function pStmt_Global(Stmt\Global_ $node): string { return 'global ' . $this->pCommaSeparated($node->vars) . ';'; } - protected function pStmt_StaticVar(Stmt\StaticVar $node) { + protected function pStaticVar(Node\StaticVar $node): string { return $this->p($node->var) . (null !== $node->default ? ' = ' . $this->p($node->default) : ''); } - protected function pStmt_Unset(Stmt\Unset_ $node) { + protected function pStmt_Unset(Stmt\Unset_ $node): string { return 'unset(' . $this->pCommaSeparated($node->vars) . ');'; } - protected function pStmt_InlineHTML(Stmt\InlineHTML $node) { - $newline = $node->getAttribute('hasLeadingNewline', true) ? "\n" : ''; + protected function pStmt_InlineHTML(Stmt\InlineHTML $node): string { + $newline = $node->getAttribute('hasLeadingNewline', true) ? $this->newline : ''; return '?>' . $newline . $node->value . 'remaining; } - protected function pStmt_Nop(Stmt\Nop $node) { + protected function pStmt_Nop(Stmt\Nop $node): string { return ''; } + protected function pStmt_Block(Stmt\Block $node): string { + return '{' . $this->pStmts($node->stmts) . $this->nl . '}'; + } + // Helpers - protected function pClassCommon(Stmt\Class_ $node, $afterClassToken) { + protected function pClassCommon(Stmt\Class_ $node, string $afterClassToken): string { return $this->pAttrGroups($node->attrGroups, $node->name === null) . $this->pModifiers($node->flags) . 'class' . $afterClassToken @@ -982,18 +1038,20 @@ protected function pClassCommon(Stmt\Class_ $node, $afterClassToken) { . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'; } - protected function pObjectProperty($node) { + protected function pObjectProperty(Node $node): string { if ($node instanceof Expr) { return '{' . $this->p($node) . '}'; } else { - return $node; + assert($node instanceof Node\Identifier); + return $node->name; } } - protected function pEncapsList(array $encapsList, $quote) { + /** @param (Expr|Node\InterpolatedStringPart)[] $encapsList */ + protected function pEncapsList(array $encapsList, ?string $quote): string { $return = ''; foreach ($encapsList as $element) { - if ($element instanceof Scalar\EncapsedStringPart) { + if ($element instanceof Node\InterpolatedStringPart) { $return .= $this->escapeString($element->value, $quote); } else { $return .= '{' . $this->p($element) . '}'; @@ -1003,14 +1061,25 @@ protected function pEncapsList(array $encapsList, $quote) { return $return; } - protected function pSingleQuotedString(string $string) { - return '\'' . addcslashes($string, '\'\\') . '\''; + protected function pSingleQuotedString(string $string): string { + // It is idiomatic to only escape backslashes when necessary, i.e. when followed by ', \ or + // the end of the string ('Foo\Bar' instead of 'Foo\\Bar'). However, we also don't want to + // produce an odd number of backslashes, so '\\\\a' should not get rendered as '\\\a', even + // though that would be legal. + $regex = '/\'|\\\\(?=[\'\\\\]|$)|(?<=\\\\)\\\\/'; + return '\'' . preg_replace($regex, '\\\\$0', $string) . '\''; } - protected function escapeString($string, $quote) { + protected function escapeString(string $string, ?string $quote): string { if (null === $quote) { // For doc strings, don't escape newlines $escaped = addcslashes($string, "\t\f\v$\\"); + // But do escape isolated \r. Combined with the terminating newline, it might get + // interpreted as \r\n and dropped from the string contents. + $escaped = preg_replace('/\r(?!\n)/', '\\r', $escaped); + if ($this->phpVersion->supportsFlexibleHeredoc()) { + $escaped = $this->indentString($escaped); + } } else { $escaped = addcslashes($string, "\n\r\t\f\v$" . $quote . "\\"); } @@ -1032,26 +1101,24 @@ protected function escapeString($string, $quote) { | (?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2}) # Short 4 byte sequence | (?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF]) # Short 4 byte sequence (2) )/x'; - return preg_replace_callback($regex, function ($matches) { + return preg_replace_callback($regex, function ($matches): string { assert(strlen($matches[0]) === 1); - $hex = dechex(ord($matches[0]));; + $hex = dechex(ord($matches[0])); return '\\x' . str_pad($hex, 2, '0', \STR_PAD_LEFT); }, $escaped); } - protected function containsEndLabel($string, $label, $atStart = true, $atEnd = true) { - $start = $atStart ? '(?:^|[\r\n])' : '[\r\n]'; - $end = $atEnd ? '(?:$|[;\r\n])' : '[;\r\n]'; + protected function containsEndLabel(string $string, string $label, bool $atStart = true): bool { + $start = $atStart ? '(?:^|[\r\n])[ \t]*' : '[\r\n][ \t]*'; return false !== strpos($string, $label) - && preg_match('/' . $start . $label . $end . '/', $string); + && preg_match('/' . $start . $label . '(?:$|[^_A-Za-z0-9\x80-\xff])/', $string); } - protected function encapsedContainsEndLabel(array $parts, $label) { + /** @param (Expr|Node\InterpolatedStringPart)[] $parts */ + protected function encapsedContainsEndLabel(array $parts, string $label): bool { foreach ($parts as $i => $part) { - $atStart = $i === 0; - $atEnd = $i === count($parts) - 1; - if ($part instanceof Scalar\EncapsedStringPart - && $this->containsEndLabel($part->value, $label, $atStart, $atEnd) + if ($part instanceof Node\InterpolatedStringPart + && $this->containsEndLabel($this->escapeString($part->value, null), $label, $i === 0) ) { return true; } @@ -1059,32 +1126,42 @@ protected function encapsedContainsEndLabel(array $parts, $label) { return false; } - protected function pDereferenceLhs(Node $node) { + protected function pDereferenceLhs(Node $node): string { if (!$this->dereferenceLhsRequiresParens($node)) { return $this->p($node); - } else { + } else { + return '(' . $this->p($node) . ')'; + } + } + + protected function pStaticDereferenceLhs(Node $node): string { + if (!$this->staticDereferenceLhsRequiresParens($node)) { + return $this->p($node); + } else { return '(' . $this->p($node) . ')'; } } - protected function pCallLhs(Node $node) { + protected function pCallLhs(Node $node): string { if (!$this->callLhsRequiresParens($node)) { return $this->p($node); - } else { + } else { return '(' . $this->p($node) . ')'; } } - protected function pNewVariable(Node $node) { - // TODO: This is not fully accurate. - return $this->pDereferenceLhs($node); + protected function pNewOperand(Node $node): string { + if (!$this->newOperandRequiresParens($node)) { + return $this->p($node); + } else { + return '(' . $this->p($node) . ')'; + } } /** * @param Node[] $nodes - * @return bool */ - protected function hasNodeWithComments(array $nodes) { + protected function hasNodeWithComments(array $nodes): bool { foreach ($nodes as $node) { if ($node && $node->getComments()) { return true; @@ -1093,7 +1170,8 @@ protected function hasNodeWithComments(array $nodes) { return false; } - protected function pMaybeMultiline(array $nodes, bool $trailingComma = false) { + /** @param Node[] $nodes */ + protected function pMaybeMultiline(array $nodes, bool $trailingComma = false): string { if (!$this->hasNodeWithComments($nodes)) { return $this->pCommaSeparated($nodes); } else { @@ -1101,6 +1179,7 @@ protected function pMaybeMultiline(array $nodes, bool $trailingComma = false) { } } + /** @param Node\AttributeGroup[] $nodes */ protected function pAttrGroups(array $nodes, bool $inline = false): string { $result = ''; $sep = $inline ? ' ' : $this->nl; diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php index 6ed936fedd..d32be24817 100644 --- a/api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +++ b/api/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php @@ -3,160 +3,223 @@ namespace PhpParser; use PhpParser\Internal\DiffElem; +use PhpParser\Internal\Differ; use PhpParser\Internal\PrintableNewAnonClassNode; use PhpParser\Internal\TokenStream; +use PhpParser\Node\AttributeGroup; use PhpParser\Node\Expr; use PhpParser\Node\Expr\AssignOp; use PhpParser\Node\Expr\BinaryOp; use PhpParser\Node\Expr\Cast; +use PhpParser\Node\IntersectionType; +use PhpParser\Node\MatchArm; +use PhpParser\Node\Param; +use PhpParser\Node\PropertyHook; use PhpParser\Node\Scalar; use PhpParser\Node\Stmt; - -abstract class PrettyPrinterAbstract -{ - const FIXUP_PREC_LEFT = 0; // LHS operand affected by precedence - const FIXUP_PREC_RIGHT = 1; // RHS operand affected by precedence - const FIXUP_CALL_LHS = 2; // LHS of call - const FIXUP_DEREF_LHS = 3; // LHS of dereferencing operation - const FIXUP_BRACED_NAME = 4; // Name operand that may require bracing - const FIXUP_VAR_BRACED_NAME = 5; // Name operand that may require ${} bracing - const FIXUP_ENCAPSED = 6; // Encapsed string part - - protected $precedenceMap = [ - // [precedence, associativity] - // where for precedence -1 is %left, 0 is %nonassoc and 1 is %right - BinaryOp\Pow::class => [ 0, 1], - Expr\BitwiseNot::class => [ 10, 1], - Expr\PreInc::class => [ 10, 1], - Expr\PreDec::class => [ 10, 1], - Expr\PostInc::class => [ 10, -1], - Expr\PostDec::class => [ 10, -1], - Expr\UnaryPlus::class => [ 10, 1], - Expr\UnaryMinus::class => [ 10, 1], - Cast\Int_::class => [ 10, 1], - Cast\Double::class => [ 10, 1], - Cast\String_::class => [ 10, 1], - Cast\Array_::class => [ 10, 1], - Cast\Object_::class => [ 10, 1], - Cast\Bool_::class => [ 10, 1], - Cast\Unset_::class => [ 10, 1], - Expr\ErrorSuppress::class => [ 10, 1], - Expr\Instanceof_::class => [ 20, 0], - Expr\BooleanNot::class => [ 30, 1], - BinaryOp\Mul::class => [ 40, -1], - BinaryOp\Div::class => [ 40, -1], - BinaryOp\Mod::class => [ 40, -1], - BinaryOp\Plus::class => [ 50, -1], - BinaryOp\Minus::class => [ 50, -1], - BinaryOp\Concat::class => [ 50, -1], - BinaryOp\ShiftLeft::class => [ 60, -1], - BinaryOp\ShiftRight::class => [ 60, -1], - BinaryOp\Smaller::class => [ 70, 0], - BinaryOp\SmallerOrEqual::class => [ 70, 0], - BinaryOp\Greater::class => [ 70, 0], - BinaryOp\GreaterOrEqual::class => [ 70, 0], - BinaryOp\Equal::class => [ 80, 0], - BinaryOp\NotEqual::class => [ 80, 0], - BinaryOp\Identical::class => [ 80, 0], - BinaryOp\NotIdentical::class => [ 80, 0], - BinaryOp\Spaceship::class => [ 80, 0], - BinaryOp\BitwiseAnd::class => [ 90, -1], - BinaryOp\BitwiseXor::class => [100, -1], - BinaryOp\BitwiseOr::class => [110, -1], - BinaryOp\BooleanAnd::class => [120, -1], - BinaryOp\BooleanOr::class => [130, -1], - BinaryOp\Coalesce::class => [140, 1], - Expr\Ternary::class => [150, 0], - // parser uses %left for assignments, but they really behave as %right - Expr\Assign::class => [160, 1], - Expr\AssignRef::class => [160, 1], - AssignOp\Plus::class => [160, 1], - AssignOp\Minus::class => [160, 1], - AssignOp\Mul::class => [160, 1], - AssignOp\Div::class => [160, 1], - AssignOp\Concat::class => [160, 1], - AssignOp\Mod::class => [160, 1], - AssignOp\BitwiseAnd::class => [160, 1], - AssignOp\BitwiseOr::class => [160, 1], - AssignOp\BitwiseXor::class => [160, 1], - AssignOp\ShiftLeft::class => [160, 1], - AssignOp\ShiftRight::class => [160, 1], - AssignOp\Pow::class => [160, 1], - AssignOp\Coalesce::class => [160, 1], - Expr\YieldFrom::class => [165, 1], - Expr\Print_::class => [168, 1], - BinaryOp\LogicalAnd::class => [170, -1], - BinaryOp\LogicalXor::class => [180, -1], - BinaryOp\LogicalOr::class => [190, -1], - Expr\Include_::class => [200, -1], +use PhpParser\Node\UnionType; + +abstract class PrettyPrinterAbstract implements PrettyPrinter { + protected const FIXUP_PREC_LEFT = 0; // LHS operand affected by precedence + protected const FIXUP_PREC_RIGHT = 1; // RHS operand affected by precedence + protected const FIXUP_PREC_UNARY = 2; // Only operand affected by precedence + protected const FIXUP_CALL_LHS = 3; // LHS of call + protected const FIXUP_DEREF_LHS = 4; // LHS of dereferencing operation + protected const FIXUP_STATIC_DEREF_LHS = 5; // LHS of static dereferencing operation + protected const FIXUP_BRACED_NAME = 6; // Name operand that may require bracing + protected const FIXUP_VAR_BRACED_NAME = 7; // Name operand that may require ${} bracing + protected const FIXUP_ENCAPSED = 8; // Encapsed string part + protected const FIXUP_NEW = 9; // New/instanceof operand + + protected const MAX_PRECEDENCE = 1000; + + /** @var array */ + protected array $precedenceMap = [ + // [precedence, precedenceLHS, precedenceRHS] + // Where the latter two are the precedences to use for the LHS and RHS of a binary operator, + // where 1 is added to one of the sides depending on associativity. This information is not + // used for unary operators and set to -1. + Expr\Clone_::class => [-10, 0, 1], + BinaryOp\Pow::class => [ 0, 0, 1], + Expr\BitwiseNot::class => [ 10, -1, -1], + Expr\UnaryPlus::class => [ 10, -1, -1], + Expr\UnaryMinus::class => [ 10, -1, -1], + Cast\Int_::class => [ 10, -1, -1], + Cast\Double::class => [ 10, -1, -1], + Cast\String_::class => [ 10, -1, -1], + Cast\Array_::class => [ 10, -1, -1], + Cast\Object_::class => [ 10, -1, -1], + Cast\Bool_::class => [ 10, -1, -1], + Cast\Unset_::class => [ 10, -1, -1], + Expr\ErrorSuppress::class => [ 10, -1, -1], + Expr\Instanceof_::class => [ 20, -1, -1], + Expr\BooleanNot::class => [ 30, -1, -1], + BinaryOp\Mul::class => [ 40, 41, 40], + BinaryOp\Div::class => [ 40, 41, 40], + BinaryOp\Mod::class => [ 40, 41, 40], + BinaryOp\Plus::class => [ 50, 51, 50], + BinaryOp\Minus::class => [ 50, 51, 50], + BinaryOp\Concat::class => [ 50, 51, 50], + BinaryOp\ShiftLeft::class => [ 60, 61, 60], + BinaryOp\ShiftRight::class => [ 60, 61, 60], + BinaryOp\Smaller::class => [ 70, 70, 70], + BinaryOp\SmallerOrEqual::class => [ 70, 70, 70], + BinaryOp\Greater::class => [ 70, 70, 70], + BinaryOp\GreaterOrEqual::class => [ 70, 70, 70], + BinaryOp\Equal::class => [ 80, 80, 80], + BinaryOp\NotEqual::class => [ 80, 80, 80], + BinaryOp\Identical::class => [ 80, 80, 80], + BinaryOp\NotIdentical::class => [ 80, 80, 80], + BinaryOp\Spaceship::class => [ 80, 80, 80], + BinaryOp\BitwiseAnd::class => [ 90, 91, 90], + BinaryOp\BitwiseXor::class => [100, 101, 100], + BinaryOp\BitwiseOr::class => [110, 111, 110], + BinaryOp\BooleanAnd::class => [120, 121, 120], + BinaryOp\BooleanOr::class => [130, 131, 130], + BinaryOp\Coalesce::class => [140, 140, 141], + Expr\Ternary::class => [150, 150, 150], + Expr\Assign::class => [160, -1, -1], + Expr\AssignRef::class => [160, -1, -1], + AssignOp\Plus::class => [160, -1, -1], + AssignOp\Minus::class => [160, -1, -1], + AssignOp\Mul::class => [160, -1, -1], + AssignOp\Div::class => [160, -1, -1], + AssignOp\Concat::class => [160, -1, -1], + AssignOp\Mod::class => [160, -1, -1], + AssignOp\BitwiseAnd::class => [160, -1, -1], + AssignOp\BitwiseOr::class => [160, -1, -1], + AssignOp\BitwiseXor::class => [160, -1, -1], + AssignOp\ShiftLeft::class => [160, -1, -1], + AssignOp\ShiftRight::class => [160, -1, -1], + AssignOp\Pow::class => [160, -1, -1], + AssignOp\Coalesce::class => [160, -1, -1], + Expr\YieldFrom::class => [170, -1, -1], + Expr\Yield_::class => [175, -1, -1], + Expr\Print_::class => [180, -1, -1], + BinaryOp\LogicalAnd::class => [190, 191, 190], + BinaryOp\LogicalXor::class => [200, 201, 200], + BinaryOp\LogicalOr::class => [210, 211, 210], + Expr\Include_::class => [220, -1, -1], + Expr\ArrowFunction::class => [230, -1, -1], + Expr\Throw_::class => [240, -1, -1], ]; /** @var int Current indentation level. */ - protected $indentLevel; + protected int $indentLevel; + /** @var string String for single level of indentation */ + private string $indent; + /** @var int Width in spaces to indent by. */ + private int $indentWidth; + /** @var bool Whether to use tab indentation. */ + private bool $useTabs; + /** @var int Width in spaces of one tab. */ + private int $tabWidth = 4; + + /** @var string Newline style. Does not include current indentation. */ + protected string $newline; /** @var string Newline including current indentation. */ - protected $nl; - /** @var string Token placed at end of doc string to ensure it is followed by a newline. */ - protected $docStringEndToken; + protected string $nl; + /** @var string|null Token placed at end of doc string to ensure it is followed by a newline. + * Null if flexible doc strings are used. */ + protected ?string $docStringEndToken; /** @var bool Whether semicolon namespaces can be used (i.e. no global namespace is used) */ - protected $canUseSemicolonNamespaces; - /** @var array Pretty printer options */ - protected $options; - - /** @var TokenStream Original tokens for use in format-preserving pretty print */ - protected $origTokens; - /** @var Internal\Differ Differ for node lists */ - protected $nodeListDiffer; - /** @var bool[] Map determining whether a certain character is a label character */ - protected $labelCharMap; + protected bool $canUseSemicolonNamespaces; + /** @var bool Whether to use short array syntax if the node specifies no preference */ + protected bool $shortArraySyntax; + /** @var PhpVersion PHP version to target */ + protected PhpVersion $phpVersion; + + /** @var TokenStream|null Original tokens for use in format-preserving pretty print */ + protected ?TokenStream $origTokens; + /** @var Internal\Differ Differ for node lists */ + protected Differ $nodeListDiffer; + /** @var array Map determining whether a certain character is a label character */ + protected array $labelCharMap; + /** + * @var array> Map from token classes and subnode names to FIXUP_* constants. + * This is used during format-preserving prints to place additional parens/braces if necessary. + */ + protected array $fixupMap; /** - * @var int[][] Map from token classes and subnode names to FIXUP_* constants. This is used - * during format-preserving prints to place additional parens/braces if necessary. + * @var array Map from "{$node->getType()}->{$subNode}" + * to ['left' => $l, 'right' => $r], where $l and $r specify the token type that needs to be stripped + * when removing this node. */ - protected $fixupMap; + protected array $removalMap; /** - * @var int[][] Map from "{$node->getType()}->{$subNode}" to ['left' => $l, 'right' => $r], - * where $l and $r specify the token type that needs to be stripped when removing - * this node. + * @var array Map from + * "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight]. + * $find is an optional token after which the insertion occurs. $extraLeft/Right + * are optionally added before/after the main insertions. */ - protected $removalMap; + protected array $insertionMap; /** - * @var mixed[] Map from "{$node->getType()}->{$subNode}" to [$find, $beforeToken, $extraLeft, $extraRight]. - * $find is an optional token after which the insertion occurs. $extraLeft/Right - * are optionally added before/after the main insertions. + * @var array Map From "{$class}->{$subNode}" to string that should be inserted + * between elements of this list subnode. */ - protected $insertionMap; + protected array $listInsertionMap; + /** - * @var string[] Map From "{$node->getType()}->{$subNode}" to string that should be inserted - * between elements of this list subnode. + * @var array */ - protected $listInsertionMap; - protected $emptyListInsertionMap; - /** @var int[] Map from "{$node->getType()}->{$subNode}" to token before which the modifiers - * should be reprinted. */ - protected $modifierChangeMap; + protected array $emptyListInsertionMap; + /** @var array Map from "{$class}->{$subNode}" to [$printFn, $token] + * where $printFn is the function to print the modifiers and $token is the token before which + * the modifiers should be reprinted. */ + protected array $modifierChangeMap; /** * Creates a pretty printer instance using the given options. * * Supported options: - * * bool $shortArraySyntax = false: Whether to use [] instead of array() as the default array - * syntax, if the node does not specify a format. + * * PhpVersion $phpVersion: The PHP version to target (default to PHP 7.4). This option + * controls compatibility of the generated code with older PHP + * versions in cases where a simple stylistic choice exists (e.g. + * array() vs []). It is safe to pretty-print an AST for a newer + * PHP version while specifying an older target (but the result will + * of course not be compatible with the older version in that case). + * * string $newline: The newline style to use. Should be "\n" (default) or "\r\n". + * * string $indent: The indentation to use. Should either be all spaces or a single + * tab. Defaults to four spaces (" "). + * * bool $shortArraySyntax: Whether to use [] instead of array() as the default array + * syntax, if the node does not specify a format. Defaults to whether + * the phpVersion support short array syntax. * - * @param array $options Dictionary of formatting options + * @param array{ + * phpVersion?: PhpVersion, newline?: string, indent?: string, shortArraySyntax?: bool + * } $options Dictionary of formatting options */ public function __construct(array $options = []) { - $this->docStringEndToken = '_DOC_STRING_END_' . mt_rand(); + $this->phpVersion = $options['phpVersion'] ?? PhpVersion::fromComponents(7, 4); - $defaultOptions = ['shortArraySyntax' => false]; - $this->options = $options + $defaultOptions; + $this->newline = $options['newline'] ?? "\n"; + if ($this->newline !== "\n" && $this->newline != "\r\n") { + throw new \LogicException('Option "newline" must be one of "\n" or "\r\n"'); + } + + $this->shortArraySyntax = + $options['shortArraySyntax'] ?? $this->phpVersion->supportsShortArraySyntax(); + $this->docStringEndToken = + $this->phpVersion->supportsFlexibleHeredoc() ? null : '_DOC_STRING_END_' . mt_rand(); + + $this->indent = $indent = $options['indent'] ?? ' '; + if ($indent === "\t") { + $this->useTabs = true; + $this->indentWidth = $this->tabWidth; + } elseif ($indent === \str_repeat(' ', \strlen($indent))) { + $this->useTabs = false; + $this->indentWidth = \strlen($indent); + } else { + throw new \LogicException('Option "indent" must either be all spaces or a single tab'); + } } /** * Reset pretty printing state. */ - protected function resetState() { + protected function resetState(): void { $this->indentLevel = 0; - $this->nl = "\n"; + $this->nl = $this->newline; $this->origTokens = null; } @@ -165,26 +228,31 @@ protected function resetState() { * * @param int $level Level in number of spaces */ - protected function setIndentLevel(int $level) { + protected function setIndentLevel(int $level): void { $this->indentLevel = $level; - $this->nl = "\n" . \str_repeat(' ', $level); + if ($this->useTabs) { + $tabs = \intdiv($level, $this->tabWidth); + $spaces = $level % $this->tabWidth; + $this->nl = $this->newline . \str_repeat("\t", $tabs) . \str_repeat(' ', $spaces); + } else { + $this->nl = $this->newline . \str_repeat(' ', $level); + } } /** * Increase indentation level. */ - protected function indent() { - $this->indentLevel += 4; - $this->nl .= ' '; + protected function indent(): void { + $this->indentLevel += $this->indentWidth; + $this->nl .= $this->indent; } /** * Decrease indentation level. */ - protected function outdent() { - assert($this->indentLevel >= 4); - $this->indentLevel -= 4; - $this->nl = "\n" . str_repeat(' ', $this->indentLevel); + protected function outdent(): void { + assert($this->indentLevel >= $this->indentWidth); + $this->setIndentLevel($this->indentLevel - $this->indentWidth); } /** @@ -194,7 +262,7 @@ protected function outdent() { * * @return string Pretty printed statements */ - public function prettyPrint(array $stmts) : string { + public function prettyPrint(array $stmts): string { $this->resetState(); $this->preprocessNodes($stmts); @@ -208,7 +276,7 @@ public function prettyPrint(array $stmts) : string { * * @return string Pretty printed node */ - public function prettyPrintExpr(Expr $node) : string { + public function prettyPrintExpr(Expr $node): string { $this->resetState(); return $this->handleMagicTokens($this->p($node)); } @@ -220,15 +288,15 @@ public function prettyPrintExpr(Expr $node) : string { * * @return string Pretty printed statements */ - public function prettyPrintFile(array $stmts) : string { + public function prettyPrintFile(array $stmts): string { if (!$stmts) { - return "newline . $this->newline; } - $p = "prettyPrint($stmts); + $p = "newline . $this->newline . $this->prettyPrint($stmts); if ($stmts[0] instanceof Stmt\InlineHTML) { - $p = preg_replace('/^<\?php\s+\?>\n?/', '', $p); + $p = preg_replace('/^<\?php\s+\?>\r?\n?/', '', $p); } if ($stmts[count($stmts) - 1] instanceof Stmt\InlineHTML) { $p = preg_replace('/<\?php$/', '', rtrim($p)); @@ -242,7 +310,7 @@ public function prettyPrintFile(array $stmts) : string { * * @param Node[] $nodes Array of nodes */ - protected function preprocessNodes(array $nodes) { + protected function preprocessNodes(array $nodes): void { /* We can use semicolon-namespaces unless there is a global namespace declaration */ $this->canUseSemicolonNamespaces = true; foreach ($nodes as $node) { @@ -254,15 +322,17 @@ protected function preprocessNodes(array $nodes) { } /** - * Handles (and removes) no-indent and doc-string-end tokens. - * - * @param string $str - * @return string + * Handles (and removes) doc-string-end tokens. */ - protected function handleMagicTokens(string $str) : string { - // Replace doc-string-end tokens with nothing or a newline - $str = str_replace($this->docStringEndToken . ";\n", ";\n", $str); - $str = str_replace($this->docStringEndToken, "\n", $str); + protected function handleMagicTokens(string $str): string { + if ($this->docStringEndToken !== null) { + // Replace doc-string-end tokens with nothing or a newline + $str = str_replace( + $this->docStringEndToken . ';' . $this->newline, + ';' . $this->newline, + $str); + $str = str_replace($this->docStringEndToken, $this->newline, $str); + } return $str; } @@ -270,12 +340,12 @@ protected function handleMagicTokens(string $str) : string { /** * Pretty prints an array of nodes (statements) and indents them optionally. * - * @param Node[] $nodes Array of nodes - * @param bool $indent Whether to indent the printed nodes + * @param Node[] $nodes Array of nodes + * @param bool $indent Whether to indent the printed nodes * * @return string Pretty printed statements */ - protected function pStmts(array $nodes, bool $indent = true) : string { + protected function pStmts(array $nodes, bool $indent = true): string { if ($indent) { $this->indent(); } @@ -303,84 +373,96 @@ protected function pStmts(array $nodes, bool $indent = true) : string { /** * Pretty-print an infix operation while taking precedence into account. * - * @param string $class Node class of operator - * @param Node $leftNode Left-hand side node + * @param string $class Node class of operator + * @param Node $leftNode Left-hand side node * @param string $operatorString String representation of the operator - * @param Node $rightNode Right-hand side node + * @param Node $rightNode Right-hand side node + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator * * @return string Pretty printed infix operation */ - protected function pInfixOp(string $class, Node $leftNode, string $operatorString, Node $rightNode) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - - return $this->pPrec($leftNode, $precedence, $associativity, -1) - . $operatorString - . $this->pPrec($rightNode, $precedence, $associativity, 1); + protected function pInfixOp( + string $class, Node $leftNode, string $operatorString, Node $rightNode, + int $precedence, int $lhsPrecedence + ): string { + list($opPrecedence, $newPrecedenceLHS, $newPrecedenceRHS) = $this->precedenceMap[$class]; + $prefix = ''; + $suffix = ''; + if ($opPrecedence >= $precedence) { + $prefix = '('; + $suffix = ')'; + $lhsPrecedence = self::MAX_PRECEDENCE; + } + return $prefix . $this->p($leftNode, $newPrecedenceLHS, $newPrecedenceLHS) + . $operatorString . $this->p($rightNode, $newPrecedenceRHS, $lhsPrecedence) . $suffix; } /** * Pretty-print a prefix operation while taking precedence into account. * - * @param string $class Node class of operator + * @param string $class Node class of operator * @param string $operatorString String representation of the operator - * @param Node $node Node + * @param Node $node Node + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator * * @return string Pretty printed prefix operation */ - protected function pPrefixOp(string $class, string $operatorString, Node $node) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - return $operatorString . $this->pPrec($node, $precedence, $associativity, 1); + protected function pPrefixOp(string $class, string $operatorString, Node $node, int $precedence, int $lhsPrecedence): string { + $opPrecedence = $this->precedenceMap[$class][0]; + $prefix = ''; + $suffix = ''; + if ($opPrecedence >= $lhsPrecedence) { + $prefix = '('; + $suffix = ')'; + $lhsPrecedence = self::MAX_PRECEDENCE; + } + $printedArg = $this->p($node, $opPrecedence, $lhsPrecedence); + if (($operatorString === '+' && $printedArg[0] === '+') || + ($operatorString === '-' && $printedArg[0] === '-') + ) { + // Avoid printing +(+$a) as ++$a and similar. + $printedArg = '(' . $printedArg . ')'; + } + return $prefix . $operatorString . $printedArg . $suffix; } /** * Pretty-print a postfix operation while taking precedence into account. * - * @param string $class Node class of operator + * @param string $class Node class of operator * @param string $operatorString String representation of the operator - * @param Node $node Node + * @param Node $node Node + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator * * @return string Pretty printed postfix operation */ - protected function pPostfixOp(string $class, Node $node, string $operatorString) : string { - list($precedence, $associativity) = $this->precedenceMap[$class]; - return $this->pPrec($node, $precedence, $associativity, -1) . $operatorString; - } - - /** - * Prints an expression node with the least amount of parentheses necessary to preserve the meaning. - * - * @param Node $node Node to pretty print - * @param int $parentPrecedence Precedence of the parent operator - * @param int $parentAssociativity Associativity of parent operator - * (-1 is left, 0 is nonassoc, 1 is right) - * @param int $childPosition Position of the node relative to the operator - * (-1 is left, 1 is right) - * - * @return string The pretty printed node - */ - protected function pPrec(Node $node, int $parentPrecedence, int $parentAssociativity, int $childPosition) : string { - $class = \get_class($node); - if (isset($this->precedenceMap[$class])) { - $childPrecedence = $this->precedenceMap[$class][0]; - if ($childPrecedence > $parentPrecedence - || ($parentPrecedence === $childPrecedence && $parentAssociativity !== $childPosition) - ) { - return '(' . $this->p($node) . ')'; - } + protected function pPostfixOp(string $class, Node $node, string $operatorString, int $precedence, int $lhsPrecedence): string { + $opPrecedence = $this->precedenceMap[$class][0]; + $prefix = ''; + $suffix = ''; + if ($opPrecedence >= $precedence) { + $prefix = '('; + $suffix = ')'; + $lhsPrecedence = self::MAX_PRECEDENCE; } - - return $this->p($node); + if ($opPrecedence < $lhsPrecedence) { + $lhsPrecedence = $opPrecedence; + } + return $prefix . $this->p($node, $opPrecedence, $lhsPrecedence) . $operatorString . $suffix; } /** * Pretty prints an array of nodes and implodes the printed values. * * @param Node[] $nodes Array of Nodes to be printed - * @param string $glue Character to implode with + * @param string $glue Character to implode with * - * @return string Imploded pretty printed nodes + * @return string Imploded pretty printed nodes> $pre */ - protected function pImplode(array $nodes, string $glue = '') : string { + protected function pImplode(array $nodes, string $glue = ''): string { $pNodes = []; foreach ($nodes as $node) { if (null === $node) { @@ -400,7 +482,7 @@ protected function pImplode(array $nodes, string $glue = '') : string { * * @return string Comma separated pretty printed nodes */ - protected function pCommaSeparated(array $nodes) : string { + protected function pCommaSeparated(array $nodes): string { return $this->pImplode($nodes, ', '); } @@ -409,12 +491,12 @@ protected function pCommaSeparated(array $nodes) : string { * * The result includes a leading newline and one level of indentation (same as pStmts). * - * @param Node[] $nodes Array of Nodes to be printed - * @param bool $trailingComma Whether to use a trailing comma + * @param Node[] $nodes Array of Nodes to be printed + * @param bool $trailingComma Whether to use a trailing comma * * @return string Comma separated pretty printed nodes in multiline style */ - protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma) : string { + protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma): string { $this->indent(); $result = ''; @@ -446,7 +528,7 @@ protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma) : * * @return string Reformatted text of comments */ - protected function pComments(array $comments) : string { + protected function pComments(array $comments): string { $formattedComments = []; foreach ($comments as $comment) { @@ -467,13 +549,11 @@ protected function pComments(array $comments) : string { * * The CloningVisitor must be run on the AST prior to modification. * * The original tokens must be provided, using the getTokens() method on the lexer. * - * @param Node[] $stmts Modified AST with links to original AST - * @param Node[] $origStmts Original AST with token offset information - * @param array $origTokens Tokens of the original code - * - * @return string + * @param Node[] $stmts Modified AST with links to original AST + * @param Node[] $origStmts Original AST with token offset information + * @param Token[] $origTokens Tokens of the original code */ - public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens) : string { + public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens): string { $this->initializeNodeListDiffer(); $this->initializeLabelCharMap(); $this->initializeFixupMap(); @@ -484,25 +564,25 @@ public function printFormatPreserving(array $stmts, array $origStmts, array $ori $this->initializeModifierChangeMap(); $this->resetState(); - $this->origTokens = new TokenStream($origTokens); + $this->origTokens = new TokenStream($origTokens, $this->tabWidth); $this->preprocessNodes($stmts); $pos = 0; $result = $this->pArray($stmts, $origStmts, $pos, 0, 'File', 'stmts', null); if (null !== $result) { - $result .= $this->origTokens->getTokenCode($pos, count($origTokens), 0); + $result .= $this->origTokens->getTokenCode($pos, count($origTokens) - 1, 0); } else { // Fallback // TODO Add pStmts($stmts, false); + $result = "newline . $this->pStmts($stmts, false); } - return ltrim($this->handleMagicTokens($result)); + return $this->handleMagicTokens($result); } - protected function pFallback(Node $node) { - return $this->{'p' . $node->getType()}($node); + protected function pFallback(Node $node, int $precedence, int $lhsPrecedence): string { + return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence); } /** @@ -511,20 +591,25 @@ protected function pFallback(Node $node) { * This method also handles formatting preservation for nodes. * * @param Node $node Node to be pretty printed + * @param int $precedence Precedence of parent operator + * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator * @param bool $parentFormatPreserved Whether parent node has preserved formatting * * @return string Pretty printed node */ - protected function p(Node $node, $parentFormatPreserved = false) : string { + protected function p( + Node $node, int $precedence = self::MAX_PRECEDENCE, int $lhsPrecedence = self::MAX_PRECEDENCE, + bool $parentFormatPreserved = false + ): string { // No orig tokens means this is a normal pretty print without preservation of formatting if (!$this->origTokens) { - return $this->{'p' . $node->getType()}($node); + return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence); } - /** @var Node $origNode */ + /** @var Node|null $origNode */ $origNode = $node->getAttribute('origNode'); if (null === $origNode) { - return $this->pFallback($node); + return $this->pFallback($node, $precedence, $lhsPrecedence); } $class = \get_class($node); @@ -537,15 +622,17 @@ protected function p(Node $node, $parentFormatPreserved = false) : string { $fallbackNode = $node; if ($node instanceof Expr\New_ && $node->class instanceof Stmt\Class_) { // Normalize node structure of anonymous classes + assert($origNode instanceof Expr\New_); $node = PrintableNewAnonClassNode::fromNewNode($node); $origNode = PrintableNewAnonClassNode::fromNewNode($origNode); + $class = PrintableNewAnonClassNode::class; } // InlineHTML node does not contain closing and opening PHP tags. If the parent formatting // is not preserved, then we need to use the fallback code to make sure the tags are // printed. if ($node instanceof Stmt\InlineHTML && !$parentFormatPreserved) { - return $this->pFallback($fallbackNode); + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); } $indentAdjustment = $this->indentLevel - $this->origTokens->getIndentationBefore($startPos); @@ -570,34 +657,27 @@ protected function p(Node $node, $parentFormatPreserved = false) : string { if (is_array($subNode) && is_array($origSubNode)) { // Array subnode changed, we might be able to reconstruct it $listResult = $this->pArray( - $subNode, $origSubNode, $pos, $indentAdjustment, $type, $subNodeName, + $subNode, $origSubNode, $pos, $indentAdjustment, $class, $subNodeName, $fixupInfo[$subNodeName] ?? null ); if (null === $listResult) { - return $this->pFallback($fallbackNode); + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); } $result .= $listResult; continue; } - if (is_int($subNode) && is_int($origSubNode)) { - // Check if this is a modifier change - $key = $type . '->' . $subNodeName; - if (!isset($this->modifierChangeMap[$key])) { - return $this->pFallback($fallbackNode); - } - - $findToken = $this->modifierChangeMap[$key]; - $result .= $this->pModifiers($subNode); - $pos = $this->origTokens->findRight($pos, $findToken); - continue; + // Check if this is a modifier change + $key = $class . '->' . $subNodeName; + if (!isset($this->modifierChangeMap[$key])) { + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); } - // If a non-node, non-array subnode changed, we don't be able to do a partial - // reconstructions, as we don't have enough offset information. Pretty print the - // whole node instead. - return $this->pFallback($fallbackNode); + [$printFn, $findToken] = $this->modifierChangeMap[$key]; + $result .= $this->$printFn($subNode); + $pos = $this->origTokens->findRight($pos, $findToken); + continue; } $extraLeft = ''; @@ -615,7 +695,7 @@ protected function p(Node $node, $parentFormatPreserved = false) : string { // A node has been inserted, check if we have insertion information for it $key = $type . '->' . $subNodeName; if (!isset($this->insertionMap[$key])) { - return $this->pFallback($fallbackNode); + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); } list($findToken, $beforeToken, $extraLeft, $extraRight) = $this->insertionMap[$key]; @@ -637,7 +717,7 @@ protected function p(Node $node, $parentFormatPreserved = false) : string { // A node has been removed, check if we have removal information for it $key = $type . '->' . $subNodeName; if (!isset($this->removalMap[$key])) { - return $this->pFallback($fallbackNode); + return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence); } // Adjust positions to account for additional tokens that must be skipped @@ -656,7 +736,7 @@ protected function p(Node $node, $parentFormatPreserved = false) : string { $result .= $extraLeft; $origIndentLevel = $this->indentLevel; - $this->setIndentLevel($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment); + $this->setIndentLevel(max($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment, 0)); // If it's the same node that was previously in this position, it certainly doesn't // need fixup. It's important to check this here, because our fixup checks are more @@ -667,7 +747,7 @@ protected function p(Node $node, $parentFormatPreserved = false) : string { $fixup = $fixupInfo[$subNodeName]; $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos); } else { - $res = $this->p($subNode, true); + $res = $this->p($subNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); } $this->safeAppend($result, $res); @@ -686,23 +766,23 @@ protected function p(Node $node, $parentFormatPreserved = false) : string { /** * Perform a format-preserving pretty print of an array. * - * @param array $nodes New nodes - * @param array $origNodes Original nodes - * @param int $pos Current token position (updated by reference) - * @param int $indentAdjustment Adjustment for indentation - * @param string $parentNodeType Type of the containing node. - * @param string $subNodeName Name of array subnode. - * @param null|int $fixup Fixup information for array item nodes + * @param Node[] $nodes New nodes + * @param Node[] $origNodes Original nodes + * @param int $pos Current token position (updated by reference) + * @param int $indentAdjustment Adjustment for indentation + * @param string $parentNodeClass Class of the containing node. + * @param string $subNodeName Name of array subnode. + * @param null|int $fixup Fixup information for array item nodes * * @return null|string Result of pretty print or null if cannot preserve formatting */ protected function pArray( - array $nodes, array $origNodes, int &$pos, int $indentAdjustment, - string $parentNodeType, string $subNodeName, $fixup - ) { + array $nodes, array $origNodes, int &$pos, int $indentAdjustment, + string $parentNodeClass, string $subNodeName, ?int $fixup + ): ?string { $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes); - $mapKey = $parentNodeType . '->' . $subNodeName; + $mapKey = $parentNodeClass . '->' . $subNodeName; $insertStr = $this->listInsertionMap[$mapKey] ?? null; $isStmtList = $subNodeName === 'stmts'; @@ -733,9 +813,9 @@ protected function pArray( $result = ''; foreach ($diff as $i => $diffElem) { $diffType = $diffElem->type; - /** @var Node|null $arrItem */ + /** @var Node|string|null $arrItem */ $arrItem = $diffElem->new; - /** @var Node|null $origArrItem */ + /** @var Node|string|null $origArrItem */ $origArrItem = $diffElem->old; if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) { @@ -759,7 +839,7 @@ protected function pArray( \assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos); $origIndentLevel = $this->indentLevel; - $lastElemIndentLevel = $this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment; + $lastElemIndentLevel = max($this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment, 0); $this->setIndentLevel($lastElemIndentLevel); $comments = $arrItem->getComments(); @@ -774,9 +854,8 @@ protected function pArray( } if ($skipRemovedNode) { - if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || - $this->origTokens->haveTagInRange($pos, $itemStartPos))) { - // We'd remove the brace of a code block. + if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) { + // We'd remove an opening/closing PHP tag. // TODO: Preserve formatting. $this->setIndentLevel($origIndentLevel); return null; @@ -796,7 +875,7 @@ protected function pArray( } } - $this->safeAppend($result, $this->p($delayedAddNode, true)); + $this->safeAppend($result, $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true)); if ($insertNewline) { $result .= $insertStr . $this->nl; @@ -825,10 +904,17 @@ protected function pArray( return null; } + if (!$arrItem instanceof Node) { + // We only support list insertion of nodes. + return null; + } + // We go multiline if the original code was multiline, // or if it's an array item with a comment above it. + // Match always uses multiline formatting. if ($insertStr === ', ' && - ($this->isMultiline($origNodes) || $arrItem->getComments()) + ($this->isMultiline($origNodes) || $arrItem->getComments() || + $parentNodeClass === Expr\Match_::class) ) { $insertStr = ','; $insertNewline = true; @@ -878,9 +964,8 @@ protected function pArray( $pos, $itemStartPos, $indentAdjustment); $skipRemovedNode = true; } else { - if ($isStmtList && ($this->origTokens->haveBracesInRange($pos, $itemStartPos) || - $this->origTokens->haveTagInRange($pos, $itemStartPos))) { - // We'd remove the brace of a code block. + if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) { + // We'd remove an opening/closing PHP tag. // TODO: Preserve formatting. return null; } @@ -895,7 +980,7 @@ protected function pArray( if (null !== $fixup && $arrItem->getAttribute('origNode') !== $origArrItem) { $res = $this->pFixup($fixup, $arrItem, null, $itemStartPos, $itemEndPos); } else { - $res = $this->p($arrItem, true); + $res = $this->p($arrItem, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); } $this->safeAppend($result, $res); @@ -929,7 +1014,7 @@ protected function pArray( $result .= $this->nl; } } - $result .= $this->p($delayedAddNode, true); + $result .= $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true); $first = false; } $result .= $extraRight === "\n" ? $this->nl : $extraRight; @@ -945,22 +1030,33 @@ protected function pArray( * are required to preserve program semantics in a certain context (e.g. to maintain precedence * or because only certain expressions are allowed in certain places). * - * @param int $fixup Fixup type - * @param Node $subNode Subnode to print + * @param int $fixup Fixup type + * @param Node $subNode Subnode to print * @param string|null $parentClass Class of parent node - * @param int $subStartPos Original start pos of subnode - * @param int $subEndPos Original end pos of subnode + * @param int $subStartPos Original start pos of subnode + * @param int $subEndPos Original end pos of subnode * * @return string Result of fixed-up print of subnode */ - protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStartPos, int $subEndPos) : string { + protected function pFixup(int $fixup, Node $subNode, ?string $parentClass, int $subStartPos, int $subEndPos): string { switch ($fixup) { case self::FIXUP_PREC_LEFT: + // We use a conservative approximation where lhsPrecedence == precedence. + if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { + $precedence = $this->precedenceMap[$parentClass][1]; + return $this->p($subNode, $precedence, $precedence); + } + break; case self::FIXUP_PREC_RIGHT: if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { - list($precedence, $associativity) = $this->precedenceMap[$parentClass]; - return $this->pPrec($subNode, $precedence, $associativity, - $fixup === self::FIXUP_PREC_LEFT ? -1 : 1); + $precedence = $this->precedenceMap[$parentClass][2]; + return $this->p($subNode, $precedence, $precedence); + } + break; + case self::FIXUP_PREC_UNARY: + if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) { + $precedence = $this->precedenceMap[$parentClass][0]; + return $this->p($subNode, $precedence, $precedence); } break; case self::FIXUP_CALL_LHS: @@ -977,6 +1073,19 @@ protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStart return '(' . $this->p($subNode) . ')'; } break; + case self::FIXUP_STATIC_DEREF_LHS: + if ($this->staticDereferenceLhsRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos) + ) { + return '(' . $this->p($subNode) . ')'; + } + break; + case self::FIXUP_NEW: + if ($this->newOperandRequiresParens($subNode) + && !$this->origTokens->haveParens($subStartPos, $subEndPos)) { + return '(' . $this->p($subNode) . ')'; + } + break; case self::FIXUP_BRACED_NAME: case self::FIXUP_VAR_BRACED_NAME: if ($subNode instanceof Expr @@ -987,7 +1096,7 @@ protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStart } break; case self::FIXUP_ENCAPSED: - if (!$subNode instanceof Scalar\EncapsedStringPart + if (!$subNode instanceof Node\InterpolatedStringPart && !$this->origTokens->haveBraces($subStartPos, $subEndPos) ) { return '{' . $this->p($subNode) . '}'; @@ -1006,11 +1115,8 @@ protected function pFixup(int $fixup, Node $subNode, $parentClass, int $subStart * * Example: "echo" and "$x" result in "echo$x", but "echo" and "x" result in "echo x". * Without safeAppend the result would be "echox", which does not preserve semantics. - * - * @param string $str - * @param string $append */ - protected function safeAppend(string &$str, string $append) { + protected function safeAppend(string &$str, string $append): void { if ($str === "") { $str = $append; return; @@ -1035,7 +1141,7 @@ protected function safeAppend(string &$str, string $append) { * * @return bool Whether parentheses are required */ - protected function callLhsRequiresParens(Node $node) : bool { + protected function callLhsRequiresParens(Node $node): bool { return !($node instanceof Node\Name || $node instanceof Expr\Variable || $node instanceof Expr\ArrayDimFetch @@ -1047,13 +1153,26 @@ protected function callLhsRequiresParens(Node $node) : bool { } /** - * Determines whether the LHS of a dereferencing operation must be wrapped in parenthesis. + * Determines whether the LHS of an array/object operation must be wrapped in parentheses. * * @param Node $node LHS of dereferencing operation * * @return bool Whether parentheses are required */ - protected function dereferenceLhsRequiresParens(Node $node) : bool { + protected function dereferenceLhsRequiresParens(Node $node): bool { + // A constant can occur on the LHS of an array/object deref, but not a static deref. + return $this->staticDereferenceLhsRequiresParens($node) + && !$node instanceof Expr\ConstFetch; + } + + /** + * Determines whether the LHS of a static operation must be wrapped in parentheses. + * + * @param Node $node LHS of dereferencing operation + * + * @return bool Whether parentheses are required + */ + protected function staticDereferenceLhsRequiresParens(Node $node): bool { return !($node instanceof Expr\Variable || $node instanceof Node\Name || $node instanceof Expr\ArrayDimFetch @@ -1066,10 +1185,31 @@ protected function dereferenceLhsRequiresParens(Node $node) : bool { || $node instanceof Expr\StaticCall || $node instanceof Expr\Array_ || $node instanceof Scalar\String_ - || $node instanceof Expr\ConstFetch || $node instanceof Expr\ClassConstFetch); } + /** + * Determines whether an expression used in "new" or "instanceof" requires parentheses. + * + * @param Node $node New or instanceof operand + * + * @return bool Whether parentheses are required + */ + protected function newOperandRequiresParens(Node $node): bool { + if ($node instanceof Node\Name || $node instanceof Expr\Variable) { + return false; + } + if ($node instanceof Expr\ArrayDimFetch || $node instanceof Expr\PropertyFetch || + $node instanceof Expr\NullsafePropertyFetch + ) { + return $this->newOperandRequiresParens($node->var); + } + if ($node instanceof Expr\StaticPropertyFetch) { + return $this->newOperandRequiresParens($node->class); + } + return true; + } + /** * Print modifiers, including trailing whitespace. * @@ -1077,14 +1217,21 @@ protected function dereferenceLhsRequiresParens(Node $node) : bool { * * @return string Printed modifiers */ - protected function pModifiers(int $modifiers) { - return ($modifiers & Stmt\Class_::MODIFIER_PUBLIC ? 'public ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_PROTECTED ? 'protected ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_PRIVATE ? 'private ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_STATIC ? 'static ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_ABSTRACT ? 'abstract ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_FINAL ? 'final ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_READONLY ? 'readonly ' : ''); + protected function pModifiers(int $modifiers): string { + return ($modifiers & Modifiers::FINAL ? 'final ' : '') + . ($modifiers & Modifiers::ABSTRACT ? 'abstract ' : '') + . ($modifiers & Modifiers::PUBLIC ? 'public ' : '') + . ($modifiers & Modifiers::PROTECTED ? 'protected ' : '') + . ($modifiers & Modifiers::PRIVATE ? 'private ' : '') + . ($modifiers & Modifiers::PUBLIC_SET ? 'public(set) ' : '') + . ($modifiers & Modifiers::PROTECTED_SET ? 'protected(set) ' : '') + . ($modifiers & Modifiers::PRIVATE_SET ? 'private(set) ' : '') + . ($modifiers & Modifiers::STATIC ? 'static ' : '') + . ($modifiers & Modifiers::READONLY ? 'readonly ' : ''); + } + + protected function pStatic(bool $static): string { + return $static ? 'static ' : ''; } /** @@ -1094,7 +1241,7 @@ protected function pModifiers(int $modifiers) { * * @return bool Whether multiline formatting is used */ - protected function isMultiline(array $nodes) : bool { + protected function isMultiline(array $nodes): bool { if (\count($nodes) < 2) { return false; } @@ -1126,15 +1273,19 @@ protected function isMultiline(array $nodes) : bool { * * The label char map determines whether a certain character may occur in a label. */ - protected function initializeLabelCharMap() { - if ($this->labelCharMap) return; + protected function initializeLabelCharMap(): void { + if (isset($this->labelCharMap)) { + return; + } $this->labelCharMap = []; for ($i = 0; $i < 256; $i++) { - // Since PHP 7.1 The lower range is 0x80. However, we also want to support code for - // older versions. $chr = chr($i); - $this->labelCharMap[$chr] = $i >= 0x7f || ctype_alnum($chr); + $this->labelCharMap[$chr] = $i >= 0x80 || ctype_alnum($chr); + } + + if ($this->phpVersion->allowsDelInIdentifiers()) { + $this->labelCharMap["\x7f"] = true; } } @@ -1143,8 +1294,10 @@ protected function initializeLabelCharMap() { * * The node list differ is used to determine differences between two array subnodes. */ - protected function initializeNodeListDiffer() { - if ($this->nodeListDiffer) return; + protected function initializeNodeListDiffer(): void { + if (isset($this->nodeListDiffer)) { + return; + } $this->nodeListDiffer = new Internal\Differ(function ($a, $b) { if ($a instanceof Node && $b instanceof Node) { @@ -1161,28 +1314,30 @@ protected function initializeNodeListDiffer() { * The fixup map is used to determine whether a certain subnode of a certain node may require * some kind of "fixup" operation, e.g. the addition of parenthesis or braces. */ - protected function initializeFixupMap() { - if ($this->fixupMap) return; + protected function initializeFixupMap(): void { + if (isset($this->fixupMap)) { + return; + } $this->fixupMap = [ - Expr\PreInc::class => ['var' => self::FIXUP_PREC_RIGHT], - Expr\PreDec::class => ['var' => self::FIXUP_PREC_RIGHT], - Expr\PostInc::class => ['var' => self::FIXUP_PREC_LEFT], - Expr\PostDec::class => ['var' => self::FIXUP_PREC_LEFT], Expr\Instanceof_::class => [ - 'expr' => self::FIXUP_PREC_LEFT, - 'class' => self::FIXUP_PREC_RIGHT, // TODO: FIXUP_NEW_VARIABLE + 'expr' => self::FIXUP_PREC_UNARY, + 'class' => self::FIXUP_NEW, ], Expr\Ternary::class => [ 'cond' => self::FIXUP_PREC_LEFT, 'else' => self::FIXUP_PREC_RIGHT, ], + Expr\Yield_::class => ['value' => self::FIXUP_PREC_UNARY], Expr\FuncCall::class => ['name' => self::FIXUP_CALL_LHS], - Expr\StaticCall::class => ['class' => self::FIXUP_DEREF_LHS], + Expr\StaticCall::class => ['class' => self::FIXUP_STATIC_DEREF_LHS], Expr\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\ClassConstFetch::class => ['var' => self::FIXUP_DEREF_LHS], - Expr\New_::class => ['class' => self::FIXUP_DEREF_LHS], // TODO: FIXUP_NEW_VARIABLE + Expr\ClassConstFetch::class => [ + 'class' => self::FIXUP_STATIC_DEREF_LHS, + 'name' => self::FIXUP_BRACED_NAME, + ], + Expr\New_::class => ['class' => self::FIXUP_NEW], Expr\MethodCall::class => [ 'var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME, @@ -1192,7 +1347,7 @@ protected function initializeFixupMap() { 'name' => self::FIXUP_BRACED_NAME, ], Expr\StaticPropertyFetch::class => [ - 'class' => self::FIXUP_DEREF_LHS, + 'class' => self::FIXUP_STATIC_DEREF_LHS, 'name' => self::FIXUP_VAR_BRACED_NAME, ], Expr\PropertyFetch::class => [ @@ -1203,7 +1358,7 @@ protected function initializeFixupMap() { 'var' => self::FIXUP_DEREF_LHS, 'name' => self::FIXUP_BRACED_NAME, ], - Scalar\Encapsed::class => [ + Scalar\InterpolatedString::class => [ 'parts' => self::FIXUP_ENCAPSED, ], ]; @@ -1226,27 +1381,19 @@ protected function initializeFixupMap() { ]; } - $assignOps = [ - Expr\Assign::class, Expr\AssignRef::class, AssignOp\Plus::class, AssignOp\Minus::class, - AssignOp\Mul::class, AssignOp\Div::class, AssignOp\Concat::class, AssignOp\Mod::class, - AssignOp\BitwiseAnd::class, AssignOp\BitwiseOr::class, AssignOp\BitwiseXor::class, - AssignOp\ShiftLeft::class, AssignOp\ShiftRight::class, AssignOp\Pow::class, AssignOp\Coalesce::class - ]; - foreach ($assignOps as $assignOp) { - $this->fixupMap[$assignOp] = [ - 'var' => self::FIXUP_PREC_LEFT, - 'expr' => self::FIXUP_PREC_RIGHT, - ]; - } - $prefixOps = [ - Expr\BitwiseNot::class, Expr\BooleanNot::class, Expr\UnaryPlus::class, Expr\UnaryMinus::class, + Expr\Clone_::class, Expr\BitwiseNot::class, Expr\BooleanNot::class, Expr\UnaryPlus::class, Expr\UnaryMinus::class, Cast\Int_::class, Cast\Double::class, Cast\String_::class, Cast\Array_::class, Cast\Object_::class, Cast\Bool_::class, Cast\Unset_::class, Expr\ErrorSuppress::class, Expr\YieldFrom::class, Expr\Print_::class, Expr\Include_::class, + Expr\Assign::class, Expr\AssignRef::class, AssignOp\Plus::class, AssignOp\Minus::class, + AssignOp\Mul::class, AssignOp\Div::class, AssignOp\Concat::class, AssignOp\Mod::class, + AssignOp\BitwiseAnd::class, AssignOp\BitwiseOr::class, AssignOp\BitwiseXor::class, + AssignOp\ShiftLeft::class, AssignOp\ShiftRight::class, AssignOp\Pow::class, AssignOp\Coalesce::class, + Expr\ArrowFunction::class, Expr\Throw_::class, ]; foreach ($prefixOps as $prefixOp) { - $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_RIGHT]; + $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_UNARY]; } } @@ -1256,8 +1403,10 @@ protected function initializeFixupMap() { * The removal map is used to determine which additional tokens should be removed when a * certain node is replaced by null. */ - protected function initializeRemovalMap() { - if ($this->removalMap) return; + protected function initializeRemovalMap(): void { + if (isset($this->removalMap)) { + return; + } $stripBoth = ['left' => \T_WHITESPACE, 'right' => \T_WHITESPACE]; $stripLeft = ['left' => \T_WHITESPACE]; @@ -1267,7 +1416,7 @@ protected function initializeRemovalMap() { $stripEquals = ['left' => '=']; $this->removalMap = [ 'Expr_ArrayDimFetch->dim' => $stripBoth, - 'Expr_ArrayItem->key' => $stripDoubleArrow, + 'ArrayItem->key' => $stripDoubleArrow, 'Expr_ArrowFunction->returnType' => $stripColon, 'Expr_Closure->returnType' => $stripColon, 'Expr_Exit->expr' => $stripBoth, @@ -1278,6 +1427,7 @@ protected function initializeRemovalMap() { 'Param->default' => $stripEquals, 'Stmt_Break->num' => $stripBoth, 'Stmt_Catch->var' => $stripLeft, + 'Stmt_ClassConst->type' => $stripRight, 'Stmt_ClassMethod->returnType' => $stripColon, 'Stmt_Class->extends' => ['left' => \T_EXTENDS], 'Stmt_Enum->scalarType' => $stripColon, @@ -1289,7 +1439,7 @@ protected function initializeRemovalMap() { 'Stmt_If->else' => $stripLeft, 'Stmt_Namespace->name' => $stripLeft, 'Stmt_Property->type' => $stripRight, - 'Stmt_PropertyProperty->default' => $stripEquals, + 'PropertyItem->default' => $stripEquals, 'Stmt_Return->expr' => $stripBoth, 'Stmt_StaticVar->default' => $stripEquals, 'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft, @@ -1301,16 +1451,18 @@ protected function initializeRemovalMap() { ]; } - protected function initializeInsertionMap() { - if ($this->insertionMap) return; + protected function initializeInsertionMap(): void { + if (isset($this->insertionMap)) { + return; + } // TODO: "yield" where both key and value are inserted doesn't work // [$find, $beforeToken, $extraLeft, $extraRight] $this->insertionMap = [ 'Expr_ArrayDimFetch->dim' => ['[', false, null, null], - 'Expr_ArrayItem->key' => [null, false, null, ' => '], - 'Expr_ArrowFunction->returnType' => [')', false, ' : ', null], - 'Expr_Closure->returnType' => [')', false, ' : ', null], + 'ArrayItem->key' => [null, false, null, ' => '], + 'Expr_ArrowFunction->returnType' => [')', false, ': ', null], + 'Expr_Closure->returnType' => [')', false, ': ', null], 'Expr_Ternary->if' => ['?', false, ' ', ' '], 'Expr_Yield->key' => [\T_YIELD, false, null, ' => '], 'Expr_Yield->value' => [\T_YIELD, false, ' ', null], @@ -1318,18 +1470,19 @@ protected function initializeInsertionMap() { 'Param->default' => [null, false, ' = ', null], 'Stmt_Break->num' => [\T_BREAK, false, ' ', null], 'Stmt_Catch->var' => [null, false, ' ', null], - 'Stmt_ClassMethod->returnType' => [')', false, ' : ', null], + 'Stmt_ClassMethod->returnType' => [')', false, ': ', null], + 'Stmt_ClassConst->type' => [\T_CONST, false, ' ', null], 'Stmt_Class->extends' => [null, false, ' extends ', null], 'Stmt_Enum->scalarType' => [null, false, ' : ', null], 'Stmt_EnumCase->expr' => [null, false, ' = ', null], - 'Expr_PrintableNewAnonClass->extends' => [null, ' extends ', null], + 'Expr_PrintableNewAnonClass->extends' => [null, false, ' extends ', null], 'Stmt_Continue->num' => [\T_CONTINUE, false, ' ', null], 'Stmt_Foreach->keyVar' => [\T_AS, false, null, ' => '], - 'Stmt_Function->returnType' => [')', false, ' : ', null], + 'Stmt_Function->returnType' => [')', false, ': ', null], 'Stmt_If->else' => [null, false, ' ', null], 'Stmt_Namespace->name' => [\T_NAMESPACE, false, ' ', null], 'Stmt_Property->type' => [\T_VARIABLE, true, null, ' '], - 'Stmt_PropertyProperty->default' => [null, false, ' = ', null], + 'PropertyItem->default' => [null, false, ' = ', null], 'Stmt_Return->expr' => [\T_RETURN, false, ' ', null], 'Stmt_StaticVar->default' => [null, false, ' = ', null], //'Stmt_TraitUseAdaptation_Alias->newName' => [T_AS, false, ' ', null], // TODO @@ -1343,132 +1496,145 @@ protected function initializeInsertionMap() { ]; } - protected function initializeListInsertionMap() { - if ($this->listInsertionMap) return; + protected function initializeListInsertionMap(): void { + if (isset($this->listInsertionMap)) { + return; + } $this->listInsertionMap = [ // special //'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully - //'Scalar_Encapsed->parts' => '', - 'Stmt_Catch->types' => '|', - 'UnionType->types' => '|', - 'IntersectionType->types' => '&', - 'Stmt_If->elseifs' => ' ', - 'Stmt_TryCatch->catches' => ' ', + //'Scalar_InterpolatedString->parts' => '', + Stmt\Catch_::class . '->types' => '|', + UnionType::class . '->types' => '|', + IntersectionType::class . '->types' => '&', + Stmt\If_::class . '->elseifs' => ' ', + Stmt\TryCatch::class . '->catches' => ' ', // comma-separated lists - 'Expr_Array->items' => ', ', - 'Expr_ArrowFunction->params' => ', ', - 'Expr_Closure->params' => ', ', - 'Expr_Closure->uses' => ', ', - 'Expr_FuncCall->args' => ', ', - 'Expr_Isset->vars' => ', ', - 'Expr_List->items' => ', ', - 'Expr_MethodCall->args' => ', ', - 'Expr_NullsafeMethodCall->args' => ', ', - 'Expr_New->args' => ', ', - 'Expr_PrintableNewAnonClass->args' => ', ', - 'Expr_StaticCall->args' => ', ', - 'Stmt_ClassConst->consts' => ', ', - 'Stmt_ClassMethod->params' => ', ', - 'Stmt_Class->implements' => ', ', - 'Stmt_Enum->implements' => ', ', - 'Expr_PrintableNewAnonClass->implements' => ', ', - 'Stmt_Const->consts' => ', ', - 'Stmt_Declare->declares' => ', ', - 'Stmt_Echo->exprs' => ', ', - 'Stmt_For->init' => ', ', - 'Stmt_For->cond' => ', ', - 'Stmt_For->loop' => ', ', - 'Stmt_Function->params' => ', ', - 'Stmt_Global->vars' => ', ', - 'Stmt_GroupUse->uses' => ', ', - 'Stmt_Interface->extends' => ', ', - 'Stmt_Match->arms' => ', ', - 'Stmt_Property->props' => ', ', - 'Stmt_StaticVar->vars' => ', ', - 'Stmt_TraitUse->traits' => ', ', - 'Stmt_TraitUseAdaptation_Precedence->insteadof' => ', ', - 'Stmt_Unset->vars' => ', ', - 'Stmt_Use->uses' => ', ', - 'MatchArm->conds' => ', ', - 'AttributeGroup->attrs' => ', ', + Expr\Array_::class . '->items' => ', ', + Expr\ArrowFunction::class . '->params' => ', ', + Expr\Closure::class . '->params' => ', ', + Expr\Closure::class . '->uses' => ', ', + Expr\FuncCall::class . '->args' => ', ', + Expr\Isset_::class . '->vars' => ', ', + Expr\List_::class . '->items' => ', ', + Expr\MethodCall::class . '->args' => ', ', + Expr\NullsafeMethodCall::class . '->args' => ', ', + Expr\New_::class . '->args' => ', ', + PrintableNewAnonClassNode::class . '->args' => ', ', + Expr\StaticCall::class . '->args' => ', ', + Stmt\ClassConst::class . '->consts' => ', ', + Stmt\ClassMethod::class . '->params' => ', ', + Stmt\Class_::class . '->implements' => ', ', + Stmt\Enum_::class . '->implements' => ', ', + PrintableNewAnonClassNode::class . '->implements' => ', ', + Stmt\Const_::class . '->consts' => ', ', + Stmt\Declare_::class . '->declares' => ', ', + Stmt\Echo_::class . '->exprs' => ', ', + Stmt\For_::class . '->init' => ', ', + Stmt\For_::class . '->cond' => ', ', + Stmt\For_::class . '->loop' => ', ', + Stmt\Function_::class . '->params' => ', ', + Stmt\Global_::class . '->vars' => ', ', + Stmt\GroupUse::class . '->uses' => ', ', + Stmt\Interface_::class . '->extends' => ', ', + Expr\Match_::class . '->arms' => ', ', + Stmt\Property::class . '->props' => ', ', + Stmt\StaticVar::class . '->vars' => ', ', + Stmt\TraitUse::class . '->traits' => ', ', + Stmt\TraitUseAdaptation\Precedence::class . '->insteadof' => ', ', + Stmt\Unset_::class . '->vars' => ', ', + Stmt\UseUse::class . '->uses' => ', ', + MatchArm::class . '->conds' => ', ', + AttributeGroup::class . '->attrs' => ', ', + PropertyHook::class . '->params' => ', ', // statement lists - 'Expr_Closure->stmts' => "\n", - 'Stmt_Case->stmts' => "\n", - 'Stmt_Catch->stmts' => "\n", - 'Stmt_Class->stmts' => "\n", - 'Stmt_Enum->stmts' => "\n", - 'Expr_PrintableNewAnonClass->stmts' => "\n", - 'Stmt_Interface->stmts' => "\n", - 'Stmt_Trait->stmts' => "\n", - 'Stmt_ClassMethod->stmts' => "\n", - 'Stmt_Declare->stmts' => "\n", - 'Stmt_Do->stmts' => "\n", - 'Stmt_ElseIf->stmts' => "\n", - 'Stmt_Else->stmts' => "\n", - 'Stmt_Finally->stmts' => "\n", - 'Stmt_Foreach->stmts' => "\n", - 'Stmt_For->stmts' => "\n", - 'Stmt_Function->stmts' => "\n", - 'Stmt_If->stmts' => "\n", - 'Stmt_Namespace->stmts' => "\n", - 'Stmt_Class->attrGroups' => "\n", - 'Stmt_Enum->attrGroups' => "\n", - 'Stmt_EnumCase->attrGroups' => "\n", - 'Stmt_Interface->attrGroups' => "\n", - 'Stmt_Trait->attrGroups' => "\n", - 'Stmt_Function->attrGroups' => "\n", - 'Stmt_ClassMethod->attrGroups' => "\n", - 'Stmt_ClassConst->attrGroups' => "\n", - 'Stmt_Property->attrGroups' => "\n", - 'Expr_PrintableNewAnonClass->attrGroups' => ' ', - 'Expr_Closure->attrGroups' => ' ', - 'Expr_ArrowFunction->attrGroups' => ' ', - 'Param->attrGroups' => ' ', - 'Stmt_Switch->cases' => "\n", - 'Stmt_TraitUse->adaptations' => "\n", - 'Stmt_TryCatch->stmts' => "\n", - 'Stmt_While->stmts' => "\n", + Expr\Closure::class . '->stmts' => "\n", + Stmt\Case_::class . '->stmts' => "\n", + Stmt\Catch_::class . '->stmts' => "\n", + Stmt\Class_::class . '->stmts' => "\n", + Stmt\Enum_::class . '->stmts' => "\n", + PrintableNewAnonClassNode::class . '->stmts' => "\n", + Stmt\Interface_::class . '->stmts' => "\n", + Stmt\Trait_::class . '->stmts' => "\n", + Stmt\ClassMethod::class . '->stmts' => "\n", + Stmt\Declare_::class . '->stmts' => "\n", + Stmt\Do_::class . '->stmts' => "\n", + Stmt\ElseIf_::class . '->stmts' => "\n", + Stmt\Else_::class . '->stmts' => "\n", + Stmt\Finally_::class . '->stmts' => "\n", + Stmt\Foreach_::class . '->stmts' => "\n", + Stmt\For_::class . '->stmts' => "\n", + Stmt\Function_::class . '->stmts' => "\n", + Stmt\If_::class . '->stmts' => "\n", + Stmt\Namespace_::class . '->stmts' => "\n", + Stmt\Block::class . '->stmts' => "\n", + + // Attribute groups + Stmt\Class_::class . '->attrGroups' => "\n", + Stmt\Enum_::class . '->attrGroups' => "\n", + Stmt\EnumCase::class . '->attrGroups' => "\n", + Stmt\Interface_::class . '->attrGroups' => "\n", + Stmt\Trait_::class . '->attrGroups' => "\n", + Stmt\Function_::class . '->attrGroups' => "\n", + Stmt\ClassMethod::class . '->attrGroups' => "\n", + Stmt\ClassConst::class . '->attrGroups' => "\n", + Stmt\Property::class . '->attrGroups' => "\n", + PrintableNewAnonClassNode::class . '->attrGroups' => ' ', + Expr\Closure::class . '->attrGroups' => ' ', + Expr\ArrowFunction::class . '->attrGroups' => ' ', + Param::class . '->attrGroups' => ' ', + PropertyHook::class . '->attrGroups' => ' ', + + Stmt\Switch_::class . '->cases' => "\n", + Stmt\TraitUse::class . '->adaptations' => "\n", + Stmt\TryCatch::class . '->stmts' => "\n", + Stmt\While_::class . '->stmts' => "\n", + PropertyHook::class . '->body' => "\n", + Stmt\Property::class . '->hooks' => "\n", + Param::class . '->hooks' => "\n", // dummy for top-level context 'File->stmts' => "\n", ]; } - protected function initializeEmptyListInsertionMap() { - if ($this->emptyListInsertionMap) return; + protected function initializeEmptyListInsertionMap(): void { + if (isset($this->emptyListInsertionMap)) { + return; + } // TODO Insertion into empty statement lists. // [$find, $extraLeft, $extraRight] $this->emptyListInsertionMap = [ - 'Expr_ArrowFunction->params' => ['(', '', ''], - 'Expr_Closure->uses' => [')', ' use(', ')'], - 'Expr_Closure->params' => ['(', '', ''], - 'Expr_FuncCall->args' => ['(', '', ''], - 'Expr_MethodCall->args' => ['(', '', ''], - 'Expr_NullsafeMethodCall->args' => ['(', '', ''], - 'Expr_New->args' => ['(', '', ''], - 'Expr_PrintableNewAnonClass->args' => ['(', '', ''], - 'Expr_PrintableNewAnonClass->implements' => [null, ' implements ', ''], - 'Expr_StaticCall->args' => ['(', '', ''], - 'Stmt_Class->implements' => [null, ' implements ', ''], - 'Stmt_Enum->implements' => [null, ' implements ', ''], - 'Stmt_ClassMethod->params' => ['(', '', ''], - 'Stmt_Interface->extends' => [null, ' extends ', ''], - 'Stmt_Function->params' => ['(', '', ''], - 'Stmt_Interface->attrGroups' => [null, '', "\n"], - 'Stmt_Class->attrGroups' => [null, '', "\n"], - 'Stmt_ClassConst->attrGroups' => [null, '', "\n"], - 'Stmt_ClassMethod->attrGroups' => [null, '', "\n"], - 'Stmt_Function->attrGroups' => [null, '', "\n"], - 'Stmt_Property->attrGroups' => [null, '', "\n"], - 'Stmt_Trait->attrGroups' => [null, '', "\n"], - 'Expr_ArrowFunction->attrGroups' => [null, '', ' '], - 'Expr_Closure->attrGroups' => [null, '', ' '], - 'Expr_PrintableNewAnonClass->attrGroups' => [\T_NEW, ' ', ''], + Expr\ArrowFunction::class . '->params' => ['(', '', ''], + Expr\Closure::class . '->uses' => [')', ' use (', ')'], + Expr\Closure::class . '->params' => ['(', '', ''], + Expr\FuncCall::class . '->args' => ['(', '', ''], + Expr\MethodCall::class . '->args' => ['(', '', ''], + Expr\NullsafeMethodCall::class . '->args' => ['(', '', ''], + Expr\New_::class . '->args' => ['(', '', ''], + PrintableNewAnonClassNode::class . '->args' => ['(', '', ''], + PrintableNewAnonClassNode::class . '->implements' => [null, ' implements ', ''], + Expr\StaticCall::class . '->args' => ['(', '', ''], + Stmt\Class_::class . '->implements' => [null, ' implements ', ''], + Stmt\Enum_::class . '->implements' => [null, ' implements ', ''], + Stmt\ClassMethod::class . '->params' => ['(', '', ''], + Stmt\Interface_::class . '->extends' => [null, ' extends ', ''], + Stmt\Function_::class . '->params' => ['(', '', ''], + Stmt\Interface_::class . '->attrGroups' => [null, '', "\n"], + Stmt\Class_::class . '->attrGroups' => [null, '', "\n"], + Stmt\ClassConst::class . '->attrGroups' => [null, '', "\n"], + Stmt\ClassMethod::class . '->attrGroups' => [null, '', "\n"], + Stmt\Function_::class . '->attrGroups' => [null, '', "\n"], + Stmt\Property::class . '->attrGroups' => [null, '', "\n"], + Stmt\Trait_::class . '->attrGroups' => [null, '', "\n"], + Expr\ArrowFunction::class . '->attrGroups' => [null, '', ' '], + Expr\Closure::class . '->attrGroups' => [null, '', ' '], + PrintableNewAnonClassNode::class . '->attrGroups' => [\T_NEW, ' ', ''], /* These cannot be empty to start with: * Expr_Isset->vars @@ -1500,22 +1666,28 @@ protected function initializeEmptyListInsertionMap() { ]; } - protected function initializeModifierChangeMap() { - if ($this->modifierChangeMap) return; + protected function initializeModifierChangeMap(): void { + if (isset($this->modifierChangeMap)) { + return; + } $this->modifierChangeMap = [ - 'Stmt_ClassConst->flags' => \T_CONST, - 'Stmt_ClassMethod->flags' => \T_FUNCTION, - 'Stmt_Class->flags' => \T_CLASS, - 'Stmt_Property->flags' => \T_VARIABLE, - 'Param->flags' => \T_VARIABLE, - //'Stmt_TraitUseAdaptation_Alias->newModifier' => 0, // TODO + Stmt\ClassConst::class . '->flags' => ['pModifiers', \T_CONST], + Stmt\ClassMethod::class . '->flags' => ['pModifiers', \T_FUNCTION], + Stmt\Class_::class . '->flags' => ['pModifiers', \T_CLASS], + Stmt\Property::class . '->flags' => ['pModifiers', \T_VARIABLE], + PrintableNewAnonClassNode::class . '->flags' => ['pModifiers', \T_CLASS], + Param::class . '->flags' => ['pModifiers', \T_VARIABLE], + PropertyHook::class . '->flags' => ['pModifiers', \T_STRING], + Expr\Closure::class . '->static' => ['pStatic', \T_FUNCTION], + Expr\ArrowFunction::class . '->static' => ['pStatic', \T_FN], + //Stmt\TraitUseAdaptation\Alias::class . '->newModifier' => 0, // TODO ]; // List of integer subnodes that are not modifiers: // Expr_Include->type // Stmt_GroupUse->type // Stmt_Use->type - // Stmt_UseUse->type + // UseItem->type } } diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/Token.php b/api/vendor/nikic/php-parser/lib/PhpParser/Token.php new file mode 100644 index 0000000000..6683310f16 --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/Token.php @@ -0,0 +1,18 @@ +pos + \strlen($this->text); + } + + /** Get 1-based end line number of the token. */ + public function getEndLine(): int { + return $this->line + \substr_count($this->text, "\n"); + } +} diff --git a/api/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php b/api/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php new file mode 100644 index 0000000000..13576c42fa --- /dev/null +++ b/api/vendor/nikic/php-parser/lib/PhpParser/compatibility_tokens.php @@ -0,0 +1,68 @@ +registerCustomFixers([ new \PharIo\CSFixer\PhpdocSingleLineVarFixer() ]) @@ -16,7 +18,7 @@ 'array_syntax' => ['syntax' => 'short'], 'binary_operator_spaces' => [ 'operators' => [ - '=' => 'align_single_space_minimal', + '=' => 'align', '=>' => 'align', ], ], @@ -69,24 +71,26 @@ 'function_declaration' => [ 'closure_function_spacing' => 'one' ], - 'header_comment' => false, + 'global_namespace_import' => [ + 'import_classes' => true, + 'import_constants' => true, + 'import_functions' => true, + ], + 'header_comment' => ['header' => $header, 'separate' => 'none'], 'indentation_type' => true, 'is_null' => true, 'line_ending' => true, 'list_syntax' => ['syntax' => 'short'], 'logical_operators' => true, 'lowercase_cast' => true, - 'lowercase_constants' => true, + 'constant_case' => ['case' => 'lower'], 'lowercase_keywords' => true, 'lowercase_static_reference' => true, 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => true], + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'modernize_types_casting' => true, 'multiline_comment_opening_closing' => true, 'multiline_whitespace_before_semicolons' => true, - 'native_constant_invocation' => true, - 'native_function_casing' => true, - 'native_function_invocation' => true, 'new_with_braces' => false, 'no_alias_functions' => true, 'no_alternative_syntax' => true, @@ -106,7 +110,7 @@ 'no_null_property_initialization' => true, 'no_php4_constructor' => true, 'no_short_bool_cast' => true, - 'no_short_echo_tag' => true, + 'echo_tag_syntax' => ['format' => 'long'], 'no_singleline_whitespace_before_semicolons' => true, 'no_spaces_after_function_name' => true, 'no_spaces_inside_parenthesis' => true, @@ -153,7 +157,13 @@ 'method_private_static', ], ], - 'ordered_imports' => true, + 'ordered_imports' => [ + 'imports_order' => [ + PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CLASS, + PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CONST, + PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_FUNCTION, + ] + ], 'phpdoc_add_missing_param_annotation' => true, 'phpdoc_align' => true, 'phpdoc_annotation_without_dot' => true, @@ -166,7 +176,7 @@ 'phpdoc_scalar' => true, 'phpdoc_separation' => true, 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_to_comment' => false, + 'phpdoc_to_comment' => true, 'phpdoc_trim' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true, 'phpdoc_types' => ['groups' => ['simple', 'meta']], @@ -188,7 +198,7 @@ 'single_quote' => true, 'standardize_not_equals' => true, 'ternary_to_null_coalescing' => true, - 'trailing_comma_in_multiline_array' => false, + 'trailing_comma_in_multiline' => false, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, 'visibility_required' => [ @@ -206,8 +216,8 @@ ->setFinder( PhpCsFixer\Finder::create() ->files() + ->in(__DIR__ . '/build') ->in(__DIR__ . '/src') ->in(__DIR__ . '/tests') - ->notName('*.phpt') ->notName('autoload.php') ); diff --git a/api/vendor/phar-io/manifest/CHANGELOG.md b/api/vendor/phar-io/manifest/CHANGELOG.md index a403e093c3..f363b169b5 100644 --- a/api/vendor/phar-io/manifest/CHANGELOG.md +++ b/api/vendor/phar-io/manifest/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to phar-io/manifest are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [2.0.4] - 03-03-2024 + +### Changed + +- Make `EMail` an optional attribute for author +- Stick with PHP 7.2 compatibilty +- Do not use implict nullable type (thanks @sebastianbergmann), this should make things work on PHP 8.4 + ## [2.0.3] - 20.07.2021 - Fixed PHP 7.2 / PHP 7.3 incompatibility introduced in previous release @@ -26,7 +34,8 @@ This release now requires PHP 7.2+ ### Unreleased -[Unreleased]: https://github.com/phar-io/manifest/compare/2.0.3...HEAD +[Unreleased]: https://github.com/phar-io/manifest/compare/2.1.0...HEAD +[2.1.0]: https://github.com/phar-io/manifest/compare/2.0.3...2.1.0 [2.0.3]: https://github.com/phar-io/manifest/compare/2.0.2...2.0.3 [2.0.2]: https://github.com/phar-io/manifest/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/phar-io/manifest/compare/2.0.0...2.0.1 diff --git a/api/vendor/phar-io/manifest/README.md b/api/vendor/phar-io/manifest/README.md index e6d0b055d1..fae2c9a78c 100644 --- a/api/vendor/phar-io/manifest/README.md +++ b/api/vendor/phar-io/manifest/README.md @@ -2,10 +2,6 @@ Component for reading [phar.io](https://phar.io/) manifest information from a [PHP Archive (PHAR)](http://php.net/phar). -[![Build Status](https://travis-ci.org/phar-io/manifest.svg?branch=master)](https://travis-ci.org/phar-io/manifest) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phar-io/manifest/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phar-io/manifest/?branch=master) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7/mini.png)](https://insight.sensiolabs.com/projects/d8cc6035-69ad-477d-bd1a-ccc605480fd7) - ## Installation You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/): @@ -16,8 +12,9 @@ If you only need this library during development, for instance to run your proje composer require --dev phar-io/manifest -## Usage +## Usage Examples +### Read from `manifest.xml` ```php use PharIo\Manifest\ManifestLoader; use PharIo\Manifest\ManifestSerializer; @@ -28,3 +25,154 @@ var_dump($manifest); echo (new ManifestSerializer)->serializeToString($manifest); ``` + +
+ Output + +```shell +object(PharIo\Manifest\Manifest)#14 (6) { + ["name":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\ApplicationName)#10 (1) { + ["name":"PharIo\Manifest\ApplicationName":private]=> + string(12) "some/library" + } + ["version":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Version\Version)#12 (5) { + ["originalVersionString":"PharIo\Version\Version":private]=> + string(5) "1.0.0" + ["major":"PharIo\Version\Version":private]=> + object(PharIo\Version\VersionNumber)#13 (1) { + ["value":"PharIo\Version\VersionNumber":private]=> + int(1) + } + ["minor":"PharIo\Version\Version":private]=> + object(PharIo\Version\VersionNumber)#23 (1) { + ["value":"PharIo\Version\VersionNumber":private]=> + int(0) + } + ["patch":"PharIo\Version\Version":private]=> + object(PharIo\Version\VersionNumber)#22 (1) { + ["value":"PharIo\Version\VersionNumber":private]=> + int(0) + } + ["preReleaseSuffix":"PharIo\Version\Version":private]=> + NULL + } + ["type":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\Library)#6 (0) { + } + ["copyrightInformation":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\CopyrightInformation)#19 (2) { + ["authors":"PharIo\Manifest\CopyrightInformation":private]=> + object(PharIo\Manifest\AuthorCollection)#9 (1) { + ["authors":"PharIo\Manifest\AuthorCollection":private]=> + array(1) { + [0]=> + object(PharIo\Manifest\Author)#15 (2) { + ["name":"PharIo\Manifest\Author":private]=> + string(13) "Reiner Zufall" + ["email":"PharIo\Manifest\Author":private]=> + object(PharIo\Manifest\Email)#16 (1) { + ["email":"PharIo\Manifest\Email":private]=> + string(16) "reiner@zufall.de" + } + } + } + } + ["license":"PharIo\Manifest\CopyrightInformation":private]=> + object(PharIo\Manifest\License)#11 (2) { + ["name":"PharIo\Manifest\License":private]=> + string(12) "BSD-3-Clause" + ["url":"PharIo\Manifest\License":private]=> + object(PharIo\Manifest\Url)#18 (1) { + ["url":"PharIo\Manifest\Url":private]=> + string(26) "https://domain.tld/LICENSE" + } + } + } + ["requirements":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\RequirementCollection)#17 (1) { + ["requirements":"PharIo\Manifest\RequirementCollection":private]=> + array(1) { + [0]=> + object(PharIo\Manifest\PhpVersionRequirement)#20 (1) { + ["versionConstraint":"PharIo\Manifest\PhpVersionRequirement":private]=> + object(PharIo\Version\SpecificMajorAndMinorVersionConstraint)#24 (3) { + ["originalValue":"PharIo\Version\AbstractVersionConstraint":private]=> + string(3) "7.0" + ["major":"PharIo\Version\SpecificMajorAndMinorVersionConstraint":private]=> + int(7) + ["minor":"PharIo\Version\SpecificMajorAndMinorVersionConstraint":private]=> + int(0) + } + } + } + } + ["bundledComponents":"PharIo\Manifest\Manifest":private]=> + object(PharIo\Manifest\BundledComponentCollection)#8 (1) { + ["bundledComponents":"PharIo\Manifest\BundledComponentCollection":private]=> + array(0) { + } + } +} + + + + + + + + + + + +``` +
+ +### Create via API +```php +$bundled = new \PharIo\Manifest\BundledComponentCollection(); +$bundled->add( + new \PharIo\Manifest\BundledComponent('vendor/packageA', new \PharIo\Version\Version('1.2.3-dev') + ) +); + +$manifest = new PharIo\Manifest\Manifest( + new \PharIo\Manifest\ApplicationName('vendor/package'), + new \PharIo\Version\Version('1.0.0'), + new \PharIo\Manifest\Library(), + new \PharIo\Manifest\CopyrightInformation( + new \PharIo\Manifest\AuthorCollection(), + new \PharIo\Manifest\License( + 'BSD-3-Clause', + new \PharIo\Manifest\Url('https://spdx.org/licenses/BSD-3-Clause.html') + ) + ), + new \PharIo\Manifest\RequirementCollection(), + $bundled +); + +echo (new ManifestSerializer)->serializeToString($manifest); +``` + +
+ Output + +```xml + + + + + + + + + + + + + +``` + +
+ diff --git a/api/vendor/phar-io/manifest/composer.json b/api/vendor/phar-io/manifest/composer.json index a2521193a9..dc5fa4589e 100644 --- a/api/vendor/phar-io/manifest/composer.json +++ b/api/vendor/phar-io/manifest/composer.json @@ -26,6 +26,7 @@ "php": "^7.2 || ^8.0", "ext-dom": "*", "ext-phar": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1" }, diff --git a/api/vendor/phar-io/manifest/composer.lock b/api/vendor/phar-io/manifest/composer.lock index e0e6db76a3..fe18e08b07 100644 --- a/api/vendor/phar-io/manifest/composer.lock +++ b/api/vendor/phar-io/manifest/composer.lock @@ -4,24 +4,24 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2ac4614ce4f7273fd54a64b65fd047a", + "content-hash": "279b3c4fe44357abd924fdcc0cfa5664", "packages": [ { "name": "phar-io/version", - "version": "3.0.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", - "reference": "d06a5000ac1a258a7d035295f0bd4ae7c859bc4f", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": "^7.2" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -51,7 +51,11 @@ } ], "description": "Library for handling version information and constraints", - "time": "2020-05-09T21:27:55+00:00" + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" } ], "packages-dev": [], @@ -61,10 +65,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "ext-dom": "*", "ext-phar": "*", + "ext-libxml": "*", "ext-xmlwriter": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.3.0" } diff --git a/api/vendor/phar-io/manifest/manifest.xsd b/api/vendor/phar-io/manifest/manifest.xsd new file mode 100644 index 0000000000..63e3f1cbd0 --- /dev/null +++ b/api/vendor/phar-io/manifest/manifest.xsd @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/vendor/phar-io/manifest/src/ManifestDocumentMapper.php b/api/vendor/phar-io/manifest/src/ManifestDocumentMapper.php index 8e539d5f1d..3da6403f87 100644 --- a/api/vendor/phar-io/manifest/src/ManifestDocumentMapper.php +++ b/api/vendor/phar-io/manifest/src/ManifestDocumentMapper.php @@ -2,16 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use PharIo\Version\Exception as VersionException; use PharIo\Version\Version; use PharIo\Version\VersionConstraintParser; +use Throwable; +use function sprintf; class ManifestDocumentMapper { public function map(ManifestDocument $document): Manifest { @@ -30,9 +33,7 @@ public function map(ManifestDocument $document): Manifest { $requirements, $bundledComponents ); - } catch (VersionException $e) { - throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); - } catch (Exception $e) { + } catch (Throwable $e) { throw new ManifestDocumentMapperException($e->getMessage(), (int)$e->getCode(), $e); } } @@ -48,7 +49,7 @@ private function mapType(ContainsElement $contains): Type { } throw new ManifestDocumentMapperException( - \sprintf('Unsupported type %s', $contains->getType()) + sprintf('Unsupported type %s', $contains->getType()) ); } @@ -59,7 +60,7 @@ private function mapCopyright(CopyrightElement $copyright): CopyrightInformation $authors->add( new Author( $authorElement->getName(), - new Email($authorElement->getEmail()) + $authorElement->hasEMail() ? new Email($authorElement->getEmail()) : null ) ); } @@ -85,7 +86,7 @@ private function mapRequirements(RequiresElement $requires): RequirementCollecti $versionConstraint = $parser->parse($phpElement->getVersion()); } catch (VersionException $e) { throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), + sprintf('Unsupported version constraint - %s', $e->getMessage()), (int)$e->getCode(), $e ); @@ -141,7 +142,7 @@ private function mapExtension(ExtensionElement $extension): Extension { ); } catch (VersionException $e) { throw new ManifestDocumentMapperException( - \sprintf('Unsupported version constraint - %s', $e->getMessage()), + sprintf('Unsupported version constraint - %s', $e->getMessage()), (int)$e->getCode(), $e ); diff --git a/api/vendor/phar-io/manifest/src/ManifestLoader.php b/api/vendor/phar-io/manifest/src/ManifestLoader.php index ae884e49a0..f467d2d3b2 100644 --- a/api/vendor/phar-io/manifest/src/ManifestLoader.php +++ b/api/vendor/phar-io/manifest/src/ManifestLoader.php @@ -2,13 +2,16 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use function sprintf; + class ManifestLoader { public static function fromFile(string $filename): Manifest { try { @@ -17,7 +20,7 @@ public static function fromFile(string $filename): Manifest { ); } catch (Exception $e) { throw new ManifestLoaderException( - \sprintf('Loading %s failed.', $filename), + sprintf('Loading %s failed.', $filename), (int)$e->getCode(), $e ); diff --git a/api/vendor/phar-io/manifest/src/ManifestSerializer.php b/api/vendor/phar-io/manifest/src/ManifestSerializer.php index e236b5984c..48b8efddf0 100644 --- a/api/vendor/phar-io/manifest/src/ManifestSerializer.php +++ b/api/vendor/phar-io/manifest/src/ManifestSerializer.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; @@ -13,6 +14,9 @@ use PharIo\Version\Version; use PharIo\Version\VersionConstraint; use XMLWriter; +use function count; +use function file_put_contents; +use function str_repeat; /** @psalm-suppress MissingConstructor */ class ManifestSerializer { @@ -20,7 +24,7 @@ class ManifestSerializer { private $xmlWriter; public function serializeToFile(Manifest $manifest, string $filename): void { - \file_put_contents( + file_put_contents( $filename, $this->serializeToString($manifest) ); @@ -41,7 +45,7 @@ private function startDocument(): void { $xmlWriter = new XMLWriter(); $xmlWriter->openMemory(); $xmlWriter->setIndent(true); - $xmlWriter->setIndentString(\str_repeat(' ', 4)); + $xmlWriter->setIndentString(str_repeat(' ', 4)); $xmlWriter->startDocument('1.0', 'UTF-8'); $xmlWriter->startElement('phar'); $xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0'); @@ -144,7 +148,7 @@ private function addRequirements(RequirementCollection $requirementCollection): } private function addBundles(BundledComponentCollection $bundledComponentCollection): void { - if (\count($bundledComponentCollection) === 0) { + if (count($bundledComponentCollection) === 0) { return; } $this->xmlWriter->startElement('bundles'); diff --git a/api/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php b/api/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php index 766fc0e6a1..7528afc895 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/ElementCollectionException.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class ElementCollectionException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class ElementCollectionException extends InvalidArgumentException implements Exception { } diff --git a/api/vendor/phar-io/manifest/src/exceptions/Exception.php b/api/vendor/phar-io/manifest/src/exceptions/Exception.php index e7f1220977..0c135d3c02 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/Exception.php +++ b/api/vendor/phar-io/manifest/src/exceptions/Exception.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -interface Exception extends \Throwable { +use Throwable; + +interface Exception extends Throwable { } diff --git a/api/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php b/api/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php index 952901eb52..ecfe5142a0 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/InvalidApplicationNameException.php @@ -2,13 +2,16 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class InvalidApplicationNameException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class InvalidApplicationNameException extends InvalidArgumentException implements Exception { public const InvalidFormat = 2; } diff --git a/api/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php b/api/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php index 3cbe08223c..242405518b 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/InvalidEmailException.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class InvalidEmailException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class InvalidEmailException extends InvalidArgumentException implements Exception { } diff --git a/api/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php b/api/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php index 8f77e2946e..c8b192b147 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/InvalidUrlException.php @@ -2,12 +2,15 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class InvalidUrlException extends \InvalidArgumentException implements Exception { +use InvalidArgumentException; + +class InvalidUrlException extends InvalidArgumentException implements Exception { } diff --git a/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php b/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php index cf1c314c6f..0a158e6e91 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentException.php @@ -1,5 +1,16 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; -class ManifestDocumentException extends \RuntimeException implements Exception { +use RuntimeException; + +class ManifestDocumentException extends RuntimeException implements Exception { } diff --git a/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php b/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php index 4676e35465..816af1205d 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentLoadingException.php @@ -2,14 +2,16 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use LibXMLError; +use function sprintf; class ManifestDocumentLoadingException extends \Exception implements Exception { /** @var LibXMLError[] */ @@ -25,7 +27,7 @@ public function __construct(array $libxmlErrors) { $first = $this->libxmlErrors[0]; parent::__construct( - \sprintf( + sprintf( '%s (Line: %d / Column: %d / File: %s)', $first->message, $first->line, diff --git a/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php b/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php index 43373bd346..0d1a5f5a2d 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/ManifestDocumentMapperException.php @@ -1,5 +1,16 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; -class ManifestDocumentMapperException extends \RuntimeException implements Exception { +use RuntimeException; + +class ManifestDocumentMapperException extends RuntimeException implements Exception { } diff --git a/api/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php b/api/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php index a4e772369d..46f82e32ea 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/ManifestElementException.php @@ -1,5 +1,16 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; -class ManifestElementException extends \RuntimeException implements Exception { +use RuntimeException; + +class ManifestElementException extends RuntimeException implements Exception { } diff --git a/api/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php b/api/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php index df0971edc7..d00ed190ce 100644 --- a/api/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php +++ b/api/vendor/phar-io/manifest/src/exceptions/ManifestLoaderException.php @@ -1,4 +1,13 @@ , Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace PharIo\Manifest; class ManifestLoaderException extends \Exception implements Exception { diff --git a/api/vendor/phar-io/manifest/src/exceptions/NoEmailAddressException.php b/api/vendor/phar-io/manifest/src/exceptions/NoEmailAddressException.php new file mode 100644 index 0000000000..2791312679 --- /dev/null +++ b/api/vendor/phar-io/manifest/src/exceptions/NoEmailAddressException.php @@ -0,0 +1,16 @@ +, Sebastian Heuer , Sebastian Bergmann and contributors + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ +namespace PharIo\Manifest; + +use InvalidArgumentException; + +class NoEmailAddressException extends InvalidArgumentException implements Exception { +} diff --git a/api/vendor/phar-io/manifest/src/values/Application.php b/api/vendor/phar-io/manifest/src/values/Application.php index 5420bcb8f2..11a44d9cf3 100644 --- a/api/vendor/phar-io/manifest/src/values/Application.php +++ b/api/vendor/phar-io/manifest/src/values/Application.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/ApplicationName.php b/api/vendor/phar-io/manifest/src/values/ApplicationName.php index d71744ab6d..1a0ad1e2f3 100644 --- a/api/vendor/phar-io/manifest/src/values/ApplicationName.php +++ b/api/vendor/phar-io/manifest/src/values/ApplicationName.php @@ -2,13 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use function preg_match; +use function sprintf; + class ApplicationName { /** @var string */ private $name; @@ -27,9 +31,9 @@ public function isEqual(ApplicationName $name): bool { } private function ensureValidFormat(string $name): void { - if (!\preg_match('#\w/\w#', $name)) { + if (!preg_match('#\w/\w#', $name)) { throw new InvalidApplicationNameException( - \sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), + sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name), InvalidApplicationNameException::InvalidFormat ); } diff --git a/api/vendor/phar-io/manifest/src/values/Author.php b/api/vendor/phar-io/manifest/src/values/Author.php index 82b666e7d6..7b243aace1 100644 --- a/api/vendor/phar-io/manifest/src/values/Author.php +++ b/api/vendor/phar-io/manifest/src/values/Author.php @@ -2,27 +2,34 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use function sprintf; + class Author { /** @var string */ private $name; - /** @var Email */ + /** @var null|Email */ private $email; - public function __construct(string $name, Email $email) { + public function __construct(string $name, ?Email $email = null) { $this->name = $name; $this->email = $email; } public function asString(): string { - return \sprintf( + if (!$this->hasEmail()) { + return $this->name; + } + + return sprintf( '%s <%s>', $this->name, $this->email->asString() @@ -33,7 +40,18 @@ public function getName(): string { return $this->name; } + /** + * @psalm-assert-if-true Email $this->email + */ + public function hasEmail(): bool { + return $this->email !== null; + } + public function getEmail(): Email { + if (!$this->hasEmail()) { + throw new NoEmailAddressException(); + } + return $this->email; } } diff --git a/api/vendor/phar-io/manifest/src/values/AuthorCollection.php b/api/vendor/phar-io/manifest/src/values/AuthorCollection.php index 27e50ad845..549876da73 100644 --- a/api/vendor/phar-io/manifest/src/values/AuthorCollection.php +++ b/api/vendor/phar-io/manifest/src/values/AuthorCollection.php @@ -2,14 +2,20 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class AuthorCollection implements \Countable, \IteratorAggregate { +use Countable; +use IteratorAggregate; +use function count; + +/** @template-implements IteratorAggregate */ +class AuthorCollection implements Countable, IteratorAggregate { /** @var Author[] */ private $authors = []; @@ -25,7 +31,7 @@ public function getAuthors(): array { } public function count(): int { - return \count($this->authors); + return count($this->authors); } public function getIterator(): AuthorCollectionIterator { diff --git a/api/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php b/api/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php index 4ff3c39431..36fee9f7f8 100644 --- a/api/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php +++ b/api/vendor/phar-io/manifest/src/values/AuthorCollectionIterator.php @@ -2,14 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class AuthorCollectionIterator implements \Iterator { +use Iterator; +use function count; + +/** @template-implements Iterator */ +class AuthorCollectionIterator implements Iterator { /** @var Author[] */ private $authors; @@ -25,7 +30,7 @@ public function rewind(): void { } public function valid(): bool { - return $this->position < \count($this->authors); + return $this->position < count($this->authors); } public function key(): int { diff --git a/api/vendor/phar-io/manifest/src/values/BundledComponent.php b/api/vendor/phar-io/manifest/src/values/BundledComponent.php index ea77b4402c..5817036892 100644 --- a/api/vendor/phar-io/manifest/src/values/BundledComponent.php +++ b/api/vendor/phar-io/manifest/src/values/BundledComponent.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/BundledComponentCollection.php b/api/vendor/phar-io/manifest/src/values/BundledComponentCollection.php index b628eaa358..28aaa06ca6 100644 --- a/api/vendor/phar-io/manifest/src/values/BundledComponentCollection.php +++ b/api/vendor/phar-io/manifest/src/values/BundledComponentCollection.php @@ -2,14 +2,20 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class BundledComponentCollection implements \Countable, \IteratorAggregate { +use Countable; +use IteratorAggregate; +use function count; + +/** @template-implements IteratorAggregate */ +class BundledComponentCollection implements Countable, IteratorAggregate { /** @var BundledComponent[] */ private $bundledComponents = []; @@ -25,7 +31,7 @@ public function getBundledComponents(): array { } public function count(): int { - return \count($this->bundledComponents); + return count($this->bundledComponents); } public function getIterator(): BundledComponentCollectionIterator { diff --git a/api/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php b/api/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php index 462db45a1f..5c72817dcf 100644 --- a/api/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php +++ b/api/vendor/phar-io/manifest/src/values/BundledComponentCollectionIterator.php @@ -2,14 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class BundledComponentCollectionIterator implements \Iterator { +use Iterator; +use function count; + +/** @template-implements Iterator */ +class BundledComponentCollectionIterator implements Iterator { /** @var BundledComponent[] */ private $bundledComponents; @@ -25,7 +30,7 @@ public function rewind(): void { } public function valid(): bool { - return $this->position < \count($this->bundledComponents); + return $this->position < count($this->bundledComponents); } public function key(): int { diff --git a/api/vendor/phar-io/manifest/src/values/CopyrightInformation.php b/api/vendor/phar-io/manifest/src/values/CopyrightInformation.php index d26f947212..b4468ed717 100644 --- a/api/vendor/phar-io/manifest/src/values/CopyrightInformation.php +++ b/api/vendor/phar-io/manifest/src/values/CopyrightInformation.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/Email.php b/api/vendor/phar-io/manifest/src/values/Email.php index 588348d890..dbaff84a62 100644 --- a/api/vendor/phar-io/manifest/src/values/Email.php +++ b/api/vendor/phar-io/manifest/src/values/Email.php @@ -2,13 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use const FILTER_VALIDATE_EMAIL; +use function filter_var; + class Email { /** @var string */ private $email; @@ -24,7 +28,7 @@ public function asString(): string { } private function ensureEmailIsValid(string $url): void { - if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) { + if (filter_var($url, FILTER_VALIDATE_EMAIL) === false) { throw new InvalidEmailException; } } diff --git a/api/vendor/phar-io/manifest/src/values/Extension.php b/api/vendor/phar-io/manifest/src/values/Extension.php index 4c5726f8a9..abcd2f8912 100644 --- a/api/vendor/phar-io/manifest/src/values/Extension.php +++ b/api/vendor/phar-io/manifest/src/values/Extension.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/Library.php b/api/vendor/phar-io/manifest/src/values/Library.php index 21849e137c..97c292dc0b 100644 --- a/api/vendor/phar-io/manifest/src/values/Library.php +++ b/api/vendor/phar-io/manifest/src/values/Library.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/License.php b/api/vendor/phar-io/manifest/src/values/License.php index 39542fe871..c2d94299c2 100644 --- a/api/vendor/phar-io/manifest/src/values/License.php +++ b/api/vendor/phar-io/manifest/src/values/License.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/Manifest.php b/api/vendor/phar-io/manifest/src/values/Manifest.php index 0140b842b0..36466820d7 100644 --- a/api/vendor/phar-io/manifest/src/values/Manifest.php +++ b/api/vendor/phar-io/manifest/src/values/Manifest.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; @@ -75,7 +76,7 @@ public function isExtension(): bool { return $this->type->isExtension(); } - public function isExtensionFor(ApplicationName $application, Version $version = null): bool { + public function isExtensionFor(ApplicationName $application, ?Version $version = null): bool { if (!$this->isExtension()) { return false; } diff --git a/api/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php b/api/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php index 088f38584c..f81bd2597f 100644 --- a/api/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php +++ b/api/vendor/phar-io/manifest/src/values/PhpExtensionRequirement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php b/api/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php index f8d6f6d131..fb30c3b8f8 100644 --- a/api/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php +++ b/api/vendor/phar-io/manifest/src/values/PhpVersionRequirement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/Requirement.php b/api/vendor/phar-io/manifest/src/values/Requirement.php index 8b845d6a0b..d4b4640156 100644 --- a/api/vendor/phar-io/manifest/src/values/Requirement.php +++ b/api/vendor/phar-io/manifest/src/values/Requirement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/RequirementCollection.php b/api/vendor/phar-io/manifest/src/values/RequirementCollection.php index b82cd955e3..e4fe2a112d 100644 --- a/api/vendor/phar-io/manifest/src/values/RequirementCollection.php +++ b/api/vendor/phar-io/manifest/src/values/RequirementCollection.php @@ -2,14 +2,20 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class RequirementCollection implements \Countable, \IteratorAggregate { +use Countable; +use IteratorAggregate; +use function count; + +/** @template-implements IteratorAggregate */ +class RequirementCollection implements Countable, IteratorAggregate { /** @var Requirement[] */ private $requirements = []; @@ -25,7 +31,7 @@ public function getRequirements(): array { } public function count(): int { - return \count($this->requirements); + return count($this->requirements); } public function getIterator(): RequirementCollectionIterator { diff --git a/api/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php b/api/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php index 5614eaf7fc..a587468c09 100644 --- a/api/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php +++ b/api/vendor/phar-io/manifest/src/values/RequirementCollectionIterator.php @@ -2,14 +2,19 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; -class RequirementCollectionIterator implements \Iterator { +use Iterator; +use function count; + +/** @template-implements Iterator */ +class RequirementCollectionIterator implements Iterator { /** @var Requirement[] */ private $requirements; @@ -25,7 +30,7 @@ public function rewind(): void { } public function valid(): bool { - return $this->position < \count($this->requirements); + return $this->position < count($this->requirements); } public function key(): int { diff --git a/api/vendor/phar-io/manifest/src/values/Type.php b/api/vendor/phar-io/manifest/src/values/Type.php index 23b289805e..231e7fd9ca 100644 --- a/api/vendor/phar-io/manifest/src/values/Type.php +++ b/api/vendor/phar-io/manifest/src/values/Type.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/values/Url.php b/api/vendor/phar-io/manifest/src/values/Url.php index 639525333c..9806155451 100644 --- a/api/vendor/phar-io/manifest/src/values/Url.php +++ b/api/vendor/phar-io/manifest/src/values/Url.php @@ -2,13 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; +use const FILTER_VALIDATE_URL; +use function filter_var; + class Url { /** @var string */ private $url; @@ -24,12 +28,10 @@ public function asString(): string { } /** - * @param string $url - * * @throws InvalidUrlException */ - private function ensureUrlIsValid($url): void { - if (\filter_var($url, \FILTER_VALIDATE_URL) === false) { + private function ensureUrlIsValid(string $url): void { + if (filter_var($url, FILTER_VALIDATE_URL) === false) { throw new InvalidUrlException; } } diff --git a/api/vendor/phar-io/manifest/src/xml/AuthorElement.php b/api/vendor/phar-io/manifest/src/xml/AuthorElement.php index c454b271ac..b33eb3ca03 100644 --- a/api/vendor/phar-io/manifest/src/xml/AuthorElement.php +++ b/api/vendor/phar-io/manifest/src/xml/AuthorElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; @@ -17,4 +18,8 @@ public function getName(): string { public function getEmail(): string { return $this->getAttributeValue('email'); } + + public function hasEMail(): bool { + return $this->hasAttribute('email'); + } } diff --git a/api/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php b/api/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php index a54147eb46..0a2a2a3883 100644 --- a/api/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php +++ b/api/vendor/phar-io/manifest/src/xml/AuthorElementCollection.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/BundlesElement.php b/api/vendor/phar-io/manifest/src/xml/BundlesElement.php index eb2105acd7..ef721a663a 100644 --- a/api/vendor/phar-io/manifest/src/xml/BundlesElement.php +++ b/api/vendor/phar-io/manifest/src/xml/BundlesElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/ComponentElement.php b/api/vendor/phar-io/manifest/src/xml/ComponentElement.php index 7f6a5ec9a4..84373c4704 100644 --- a/api/vendor/phar-io/manifest/src/xml/ComponentElement.php +++ b/api/vendor/phar-io/manifest/src/xml/ComponentElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php b/api/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php index 23bcbd2f1a..cd9ad5dd4d 100644 --- a/api/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php +++ b/api/vendor/phar-io/manifest/src/xml/ComponentElementCollection.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/ContainsElement.php b/api/vendor/phar-io/manifest/src/xml/ContainsElement.php index ebef49d9b1..55a9c605e9 100644 --- a/api/vendor/phar-io/manifest/src/xml/ContainsElement.php +++ b/api/vendor/phar-io/manifest/src/xml/ContainsElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/CopyrightElement.php b/api/vendor/phar-io/manifest/src/xml/CopyrightElement.php index 3debe7dcde..c11415a54d 100644 --- a/api/vendor/phar-io/manifest/src/xml/CopyrightElement.php +++ b/api/vendor/phar-io/manifest/src/xml/CopyrightElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/ElementCollection.php b/api/vendor/phar-io/manifest/src/xml/ElementCollection.php index 26d9250f3d..9e1de56996 100644 --- a/api/vendor/phar-io/manifest/src/xml/ElementCollection.php +++ b/api/vendor/phar-io/manifest/src/xml/ElementCollection.php @@ -2,17 +2,24 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use DOMElement; use DOMNodeList; +use Iterator; +use ReturnTypeWillChange; +use function count; +use function get_class; +use function sprintf; -abstract class ElementCollection implements \Iterator { +/** @template-implements Iterator */ +abstract class ElementCollection implements Iterator { /** @var DOMElement[] */ private $nodes = []; @@ -24,7 +31,7 @@ public function __construct(DOMNodeList $nodeList) { $this->importNodes($nodeList); } - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] abstract public function current(); public function next(): void { @@ -36,7 +43,7 @@ public function key(): int { } public function valid(): bool { - return $this->position < \count($this->nodes); + return $this->position < count($this->nodes); } public function rewind(): void { @@ -51,7 +58,7 @@ private function importNodes(DOMNodeList $nodeList): void { foreach ($nodeList as $node) { if (!$node instanceof DOMElement) { throw new ElementCollectionException( - \sprintf('\DOMElement expected, got \%s', \get_class($node)) + sprintf('\DOMElement expected, got \%s', get_class($node)) ); } diff --git a/api/vendor/phar-io/manifest/src/xml/ExtElement.php b/api/vendor/phar-io/manifest/src/xml/ExtElement.php index 257853c43f..6a88a05d05 100644 --- a/api/vendor/phar-io/manifest/src/xml/ExtElement.php +++ b/api/vendor/phar-io/manifest/src/xml/ExtElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/ExtElementCollection.php b/api/vendor/phar-io/manifest/src/xml/ExtElementCollection.php index 059773490a..3eec9463c8 100644 --- a/api/vendor/phar-io/manifest/src/xml/ExtElementCollection.php +++ b/api/vendor/phar-io/manifest/src/xml/ExtElementCollection.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/ExtensionElement.php b/api/vendor/phar-io/manifest/src/xml/ExtensionElement.php index db067f9963..22016a0174 100644 --- a/api/vendor/phar-io/manifest/src/xml/ExtensionElement.php +++ b/api/vendor/phar-io/manifest/src/xml/ExtensionElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/LicenseElement.php b/api/vendor/phar-io/manifest/src/xml/LicenseElement.php index 658c3d1c25..d9f4cb268e 100644 --- a/api/vendor/phar-io/manifest/src/xml/LicenseElement.php +++ b/api/vendor/phar-io/manifest/src/xml/LicenseElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/ManifestDocument.php b/api/vendor/phar-io/manifest/src/xml/ManifestDocument.php index f88b282936..8745868659 100644 --- a/api/vendor/phar-io/manifest/src/xml/ManifestDocument.php +++ b/api/vendor/phar-io/manifest/src/xml/ManifestDocument.php @@ -2,15 +2,24 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use DOMDocument; use DOMElement; +use Throwable; +use function count; +use function file_get_contents; +use function is_file; +use function libxml_clear_errors; +use function libxml_get_errors; +use function libxml_use_internal_errors; +use function sprintf; class ManifestDocument { public const XMLNS = 'https://phar.io/xml/manifest/1.0'; @@ -19,28 +28,31 @@ class ManifestDocument { private $dom; public static function fromFile(string $filename): ManifestDocument { - if (!\file_exists($filename)) { + if (!is_file($filename)) { throw new ManifestDocumentException( - \sprintf('File "%s" not found', $filename) + sprintf('File "%s" not found', $filename) ); } return self::fromString( - \file_get_contents($filename) + file_get_contents($filename) ); } public static function fromString(string $xmlString): ManifestDocument { - $prev = \libxml_use_internal_errors(true); - \libxml_clear_errors(); - - $dom = new DOMDocument(); - $dom->loadXML($xmlString); - - $errors = \libxml_get_errors(); - \libxml_use_internal_errors($prev); + $prev = libxml_use_internal_errors(true); + libxml_clear_errors(); + + try { + $dom = new DOMDocument(); + $dom->loadXML($xmlString); + $errors = libxml_get_errors(); + libxml_use_internal_errors($prev); + } catch (Throwable $t) { + throw new ManifestDocumentException($t->getMessage(), 0, $t); + } - if (\count($errors) !== 0) { + if (count($errors) !== 0) { throw new ManifestDocumentLoadingException($errors); } @@ -94,7 +106,7 @@ private function fetchElementByName(string $elementName): DOMElement { if (!$element instanceof DOMElement) { throw new ManifestDocumentException( - \sprintf('Element %s missing', $elementName) + sprintf('Element %s missing', $elementName) ); } diff --git a/api/vendor/phar-io/manifest/src/xml/ManifestElement.php b/api/vendor/phar-io/manifest/src/xml/ManifestElement.php index 1f57f547d5..461ba0c94e 100644 --- a/api/vendor/phar-io/manifest/src/xml/ManifestElement.php +++ b/api/vendor/phar-io/manifest/src/xml/ManifestElement.php @@ -2,15 +2,17 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; use DOMElement; use DOMNodeList; +use function sprintf; class ManifestElement { public const XMLNS = 'https://phar.io/xml/manifest/1.0'; @@ -25,7 +27,7 @@ public function __construct(DOMElement $element) { protected function getAttributeValue(string $name): string { if (!$this->element->hasAttribute($name)) { throw new ManifestElementException( - \sprintf( + sprintf( 'Attribute %s not set on element %s', $name, $this->element->localName @@ -36,12 +38,16 @@ protected function getAttributeValue(string $name): string { return $this->element->getAttribute($name); } + protected function hasAttribute(string $name): bool { + return $this->element->hasAttribute($name); + } + protected function getChildByName(string $elementName): DOMElement { $element = $this->element->getElementsByTagNameNS(self::XMLNS, $elementName)->item(0); if (!$element instanceof DOMElement) { throw new ManifestElementException( - \sprintf('Element %s missing', $elementName) + sprintf('Element %s missing', $elementName) ); } @@ -53,7 +59,7 @@ protected function getChildrenByName(string $elementName): DOMNodeList { if ($elementList->length === 0) { throw new ManifestElementException( - \sprintf('Element(s) %s missing', $elementName) + sprintf('Element(s) %s missing', $elementName) ); } diff --git a/api/vendor/phar-io/manifest/src/xml/PhpElement.php b/api/vendor/phar-io/manifest/src/xml/PhpElement.php index c5c906c968..9340c2e667 100644 --- a/api/vendor/phar-io/manifest/src/xml/PhpElement.php +++ b/api/vendor/phar-io/manifest/src/xml/PhpElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/src/xml/RequiresElement.php b/api/vendor/phar-io/manifest/src/xml/RequiresElement.php index b7cd41ef7f..73ba54ca38 100644 --- a/api/vendor/phar-io/manifest/src/xml/RequiresElement.php +++ b/api/vendor/phar-io/manifest/src/xml/RequiresElement.php @@ -2,10 +2,11 @@ /* * This file is part of PharIo\Manifest. * - * (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann + * Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. + * */ namespace PharIo\Manifest; diff --git a/api/vendor/phar-io/manifest/tools/php-cs-fixer.d/PhpdocSingleLineVarFixer.php b/api/vendor/phar-io/manifest/tools/php-cs-fixer.d/PhpdocSingleLineVarFixer.php new file mode 100644 index 0000000000..ea5414e427 --- /dev/null +++ b/api/vendor/phar-io/manifest/tools/php-cs-fixer.d/PhpdocSingleLineVarFixer.php @@ -0,0 +1,72 @@ +isTokenKindFound(T_DOC_COMMENT); + } + + public function isRisky(): bool { + return false; + } + + public function fix(\SplFileInfo $file, Tokens $tokens): void { + foreach($tokens as $index => $token) { + if (!$token->isGivenKind(T_DOC_COMMENT)) { + continue; + } + if (\stripos($token->getContent(), '@var') === false) { + continue; + } + + if (preg_match('#^/\*\*[\s\*]+(@var[^\r\n]+)[\s\*]*\*\/$#u', $token->getContent(), $matches) !== 1) { + continue; + } + $newContent = '/** ' . \rtrim($matches[1]) . ' */'; + if ($newContent === $token->getContent()) { + continue; + } + $tokens[$index] = new Token([T_DOC_COMMENT, $newContent]); + } + } + + public function getPriority(): int { + return 0; + } + + public function getName(): string { + return 'PharIo/phpdoc_single_line_var_fixer'; + } + + public function supports(\SplFileInfo $file): bool { + return true; + } + +} diff --git a/api/vendor/phar-io/manifest/tools/php-cs-fixer.d/header.txt b/api/vendor/phar-io/manifest/tools/php-cs-fixer.d/header.txt new file mode 100644 index 0000000000..dc8c4ffc02 --- /dev/null +++ b/api/vendor/phar-io/manifest/tools/php-cs-fixer.d/header.txt @@ -0,0 +1,6 @@ +This file is part of PharIo\Manifest. + +Copyright (c) Arne Blankerts , Sebastian Heuer , Sebastian Bergmann and contributors + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. diff --git a/api/vendor/phpoption/phpoption/composer.json b/api/vendor/phpoption/phpoption/composer.json index 0106c97716..91dd6fb721 100644 --- a/api/vendor/phpoption/phpoption/composer.json +++ b/api/vendor/phpoption/phpoption/composer.json @@ -19,8 +19,8 @@ "php": "^7.2.5 || ^8.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "phpunit/phpunit": "^8.5.28 || ^9.5.21" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "autoload": { "psr-4": { @@ -41,12 +41,10 @@ "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { "dev-master": "1.9-dev" } - }, - "minimum-stability": "dev", - "prefer-stable": true + } } diff --git a/api/vendor/phpoption/phpoption/src/PhpOption/Option.php b/api/vendor/phpoption/phpoption/src/PhpOption/Option.php index 172924cf4e..91fab9ca6b 100644 --- a/api/vendor/phpoption/phpoption/src/PhpOption/Option.php +++ b/api/vendor/phpoption/phpoption/src/PhpOption/Option.php @@ -62,13 +62,13 @@ public static function fromValue($value, $noneValue = null) * @template S * * @param array|ArrayAccess|null $array A potential array or \ArrayAccess value. - * @param string $key The key to check. + * @param string|int|null $key The key to check. * * @return Option */ public static function fromArraysValue($array, $key) { - if (!(is_array($array) || $array instanceof ArrayAccess) || !isset($array[$key])) { + if ($key === null || !(is_array($array) || $array instanceof ArrayAccess) || !isset($array[$key])) { return None::create(); } diff --git a/api/vendor/phpunit/php-code-coverage/ChangeLog.md b/api/vendor/phpunit/php-code-coverage/ChangeLog-9.2.md similarity index 92% rename from api/vendor/phpunit/php-code-coverage/ChangeLog.md rename to api/vendor/phpunit/php-code-coverage/ChangeLog-9.2.md index cdf28e0a4e..5176ae3331 100644 --- a/api/vendor/phpunit/php-code-coverage/ChangeLog.md +++ b/api/vendor/phpunit/php-code-coverage/ChangeLog-9.2.md @@ -2,6 +2,59 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [9.2.32] - 2024-08-22 + +### Changed + +* Updated dependencies (so that users that install using Composer's `--prefer-lowest` CLI option also get recent versions) + +## [9.2.31] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + +## [9.2.30] - 2023-12-22 + +### Changed + +* This component is now compatible with `nikic/php-parser` 5.0 + +## [9.2.29] - 2023-09-19 + +### Fixed + +* [#1012](https://github.com/sebastianbergmann/php-code-coverage/issues/1012): Cobertura report pulls functions from report scope, not the individual element + +## [9.2.28] - 2023-09-12 + +### Changed + +* [#1011](https://github.com/sebastianbergmann/php-code-coverage/pull/1011): Avoid serialization of cache data in PHP report + +## [9.2.27] - 2023-07-26 + +### Changed + +* The result of `CodeCoverage::getReport()` is now cached + +### Fixed + +* Static analysis cache keys do not include configuration settings that affect source code parsing +* The Clover, Cobertura, Crap4j, and PHP report writers no longer create a `php:` directory when they should write to `php://stdout`, for instance + +## [9.2.26] - 2023-03-06 + +### Changed + +* Improved the legend on the file pages of the HTML code coverage report + +## [9.2.25] - 2023-02-25 + +### Fixed + +* [#981](https://github.com/sebastianbergmann/php-code-coverage/issues/981): `CodeUnitFindingVisitor` does not support DNF types + ## [9.2.24] - 2023-01-26 ### Changed @@ -464,6 +517,14 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.1 +[9.2.32]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.31...9.2.32 +[9.2.31]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.30...9.2.31 +[9.2.30]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.29...9.2.30 +[9.2.29]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.28...9.2.29 +[9.2.28]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.27...9.2.28 +[9.2.27]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.26...9.2.27 +[9.2.26]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.25...9.2.26 +[9.2.25]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.24...9.2.25 [9.2.24]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.23...9.2.24 [9.2.23]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.22...9.2.23 [9.2.22]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.21...9.2.22 diff --git a/api/vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php b/api/vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php new file mode 100644 index 0000000000..390143980d --- /dev/null +++ b/api/vendor/phpunit/php-code-coverage/build/scripts/extract-release-notes.php @@ -0,0 +1,47 @@ +#!/usr/bin/env php +' . PHP_EOL; + + exit(1); +} + +$version = $argv[1]; +$versionSeries = explode('.', $version)[0] . '.' . explode('.', $version)[1]; + +$file = __DIR__ . '/../../ChangeLog-' . $versionSeries . '.md'; + +if (!is_file($file) || !is_readable($file)) { + print $file . ' cannot be read' . PHP_EOL; + + exit(1); +} + +$buffer = ''; +$append = false; + +foreach (file($file) as $line) { + if (str_starts_with($line, '## [' . $version . ']')) { + $append = true; + + continue; + } + + if ($append && (str_starts_with($line, '## ') || str_starts_with($line, '['))) { + break; + } + + if ($append) { + $buffer .= $line; + } +} + +$buffer = trim($buffer); + +if ($buffer === '') { + print 'Unable to extract release notes' . PHP_EOL; + + exit(1); +} + +print $buffer . PHP_EOL; diff --git a/api/vendor/phpunit/php-code-coverage/composer.json b/api/vendor/phpunit/php-code-coverage/composer.json index b09bd64795..f9fd3613e7 100644 --- a/api/vendor/phpunit/php-code-coverage/composer.json +++ b/api/vendor/phpunit/php-code-coverage/composer.json @@ -17,7 +17,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy" }, "config": { "platform": { @@ -32,22 +33,22 @@ "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "autoload": { "classmap": [ @@ -62,7 +63,7 @@ }, "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } } } diff --git a/api/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/api/vendor/phpunit/php-code-coverage/src/CodeCoverage.php index c35f27c8c2..ba4f1f8c3c 100644 --- a/api/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ b/api/vendor/phpunit/php-code-coverage/src/CodeCoverage.php @@ -114,6 +114,11 @@ final class CodeCoverage */ private $cacheDirectory; + /** + * @var ?Directory + */ + private $cachedReport; + public function __construct(Driver $driver, Filter $filter) { $this->driver = $driver; @@ -127,7 +132,11 @@ public function __construct(Driver $driver, Filter $filter) */ public function getReport(): Directory { - return (new Builder($this->analyser()))->build($this); + if ($this->cachedReport === null) { + $this->cachedReport = (new Builder($this->analyser()))->build($this); + } + + return $this->cachedReport; } /** @@ -135,9 +144,18 @@ public function getReport(): Directory */ public function clear(): void { - $this->currentId = null; - $this->data = new ProcessedCodeCoverageData; - $this->tests = []; + $this->currentId = null; + $this->data = new ProcessedCodeCoverageData; + $this->tests = []; + $this->cachedReport = null; + } + + /** + * @internal + */ + public function clearCache(): void + { + $this->cachedReport = null; } /** @@ -202,6 +220,8 @@ public function start($id, bool $clear = false): void $this->currentId = $id; $this->driver->start(); + + $this->cachedReport = null; } /** @@ -220,7 +240,8 @@ public function stop(bool $append = true, $linesToBeCovered = [], array $linesTo $data = $this->driver->stop(); $this->append($data, null, $append, $linesToBeCovered, $linesToBeUsed); - $this->currentId = null; + $this->currentId = null; + $this->cachedReport = null; return $data; } @@ -245,6 +266,8 @@ public function append(RawCodeCoverageData $rawData, $id = null, bool $append = throw new TestIdMissingException; } + $this->cachedReport = null; + $this->applyFilter($rawData); $this->applyExecutableLinesFilter($rawData); @@ -312,6 +335,8 @@ public function merge(self $that): void $this->data->merge($that->data); $this->tests = array_merge($this->tests, $that->getTests()); + + $this->cachedReport = null; } public function enableCheckForUnintentionallyCoveredCode(): void @@ -673,7 +698,9 @@ private function analyser(): FileAnalyser if ($this->cachesStaticAnalysis()) { $this->analyser = new CachingFileAnalyser( $this->cacheDirectory, - $this->analyser + $this->analyser, + $this->useAnnotationsForIgnoringCode, + $this->ignoreDeprecatedCode ); } diff --git a/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php b/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php index 3039e77c03..4ee232d0f4 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php +++ b/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug2NotEnabledException.php @@ -16,6 +16,6 @@ final class Xdebug2NotEnabledException extends RuntimeException implements Excep { public function __construct() { - parent::__construct('xdebug.coverage_enable=On has to be set'); + parent::__construct('xdebug.coverage_enable=On (PHP configuration setting) has to be set'); } } diff --git a/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php b/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php index 5d3b106ce8..6abc01f383 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php +++ b/api/vendor/phpunit/php-code-coverage/src/Exception/Xdebug3NotEnabledException.php @@ -16,6 +16,6 @@ final class Xdebug3NotEnabledException extends RuntimeException implements Excep { public function __construct() { - parent::__construct('XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set'); + parent::__construct('XDEBUG_MODE=coverage (environment variable) or xdebug.mode=coverage (PHP configuration setting) has to be set'); } } diff --git a/api/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php b/api/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php index 60d6391d38..330fb57368 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php +++ b/api/vendor/phpunit/php-code-coverage/src/Node/AbstractNode.php @@ -46,7 +46,7 @@ abstract class AbstractNode implements Countable */ private $id; - public function __construct(string $name, self $parent = null) + public function __construct(string $name, ?self $parent = null) { if (substr($name, -1) === DIRECTORY_SEPARATOR) { $name = substr($name, 0, -1); diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/Clover.php b/api/vendor/phpunit/php-code-coverage/src/Report/Clover.php index 75c731bbe5..d80ab4deea 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/Clover.php +++ b/api/vendor/phpunit/php-code-coverage/src/Report/Clover.php @@ -16,6 +16,7 @@ use function ksort; use function max; use function range; +use function strpos; use function time; use DOMDocument; use SebastianBergmann\CodeCoverage\CodeCoverage; @@ -243,7 +244,9 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string $buffer = $xmlDocument->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!strpos($target, '://') !== false) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php b/api/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php index 0d1dde7608..138a31ebea 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php +++ b/api/vendor/phpunit/php-code-coverage/src/Report/Cobertura.php @@ -16,6 +16,7 @@ use function preg_match; use function range; use function str_replace; +use function strpos; use function time; use DOMImplementation; use SebastianBergmann\CodeCoverage\CodeCoverage; @@ -193,7 +194,7 @@ public function process(CodeCoverage $coverage, ?string $target = null): string } } - if ($report->numberOfFunctions() === 0) { + if ($item->numberOfFunctions() === 0) { $packageElement->setAttribute('complexity', (string) $packageComplexity); continue; @@ -217,7 +218,7 @@ public function process(CodeCoverage $coverage, ?string $target = null): string $classElement->appendChild($classLinesElement); - $functions = $report->functions(); + $functions = $item->functions(); foreach ($functions as $functionName => $function) { if ($function['executableLines'] === 0) { @@ -294,7 +295,9 @@ public function process(CodeCoverage $coverage, ?string $target = null): string $buffer = $document->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!strpos($target, '://') !== false) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php b/api/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php index 91f8ed59d7..2d91567a08 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php +++ b/api/vendor/phpunit/php-code-coverage/src/Report/Crap4j.php @@ -15,6 +15,7 @@ use function htmlspecialchars; use function is_string; use function round; +use function strpos; use DOMDocument; use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; @@ -124,7 +125,9 @@ public function process(CodeCoverage $coverage, ?string $target = null, ?string $buffer = $document->saveXML(); if ($target !== null) { - Filesystem::createDirectory(dirname($target)); + if (!strpos($target, '://') !== false) { + Filesystem::createDirectory(dirname($target)); + } if (@file_put_contents($target, $buffer) === false) { throw new WriteOperationFailedException($target); diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php index 3449eddf40..69935d7347 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php +++ b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php @@ -129,7 +129,7 @@ private function copyFiles(string $target): void copy($this->templatePath . 'js/bootstrap.min.js', $dir . 'bootstrap.min.js'); copy($this->templatePath . 'js/popper.min.js', $dir . 'popper.min.js'); copy($this->templatePath . 'js/d3.min.js', $dir . 'd3.min.js'); - copy($this->templatePath . 'js/jquery-3.7.1.min.js', $dir . 'jquery-3.7.1.min.js'); + copy($this->templatePath . 'js/jquery.min.js', $dir . 'jquery.min.js'); copy($this->templatePath . 'js/nv.d3.min.js', $dir . 'nv.d3.min.js'); copy($this->templatePath . 'js/file.js', $dir . 'file.js'); } diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php index 6672a6ea16..b44870b53d 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php +++ b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Dashboard.php @@ -117,7 +117,7 @@ private function complexity(array $classes, string $baseLink): array private function coverageDistribution(array $classes): array { $result = [ - 'class' => [ + 'class' => [ '0%' => 0, '0-10%' => 0, '10-20%' => 0, diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php index 69fd8b1da5..b59dc89d32 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php +++ b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php @@ -134,7 +134,7 @@ public function render(FileNode $node, string $file): void [ 'items' => $this->renderItems($node), 'lines' => $this->renderSourceWithLineCoverage($node), - 'legend' => '

ExecutedNot ExecutedDead Code

', + 'legend' => '

Covered by small (and larger) testsCovered by medium (and large) testsCovered by large tests (and tests of unknown size)Not coveredNot coverable

', 'structure' => '', ] ); @@ -284,19 +284,19 @@ private function renderTraitOrClassItems(array $items, Template $template, Templ $buffer .= $this->renderItemTemplate( $template, [ - 'name' => $this->abbreviateClassName($name), - 'numClasses' => $numClasses, - 'numTestedClasses' => $numTestedClasses, - 'numMethods' => $numMethods, - 'numTestedMethods' => $numTestedMethods, - 'linesExecutedPercent' => Percentage::fromFractionAndTotal( + 'name' => $this->abbreviateClassName($name), + 'numClasses' => $numClasses, + 'numTestedClasses' => $numTestedClasses, + 'numMethods' => $numMethods, + 'numTestedMethods' => $numTestedMethods, + 'linesExecutedPercent' => Percentage::fromFractionAndTotal( $item['executedLines'], $item['executableLines'], )->asFloat(), - 'linesExecutedPercentAsString' => $linesExecutedPercentAsString, - 'numExecutedLines' => $item['executedLines'], - 'numExecutableLines' => $item['executableLines'], - 'branchesExecutedPercent' => Percentage::fromFractionAndTotal( + 'linesExecutedPercentAsString' => $linesExecutedPercentAsString, + 'numExecutedLines' => $item['executedLines'], + 'numExecutableLines' => $item['executableLines'], + 'branchesExecutedPercent' => Percentage::fromFractionAndTotal( $item['executedBranches'], $item['executableBranches'], )->asFloat(), @@ -307,14 +307,14 @@ private function renderTraitOrClassItems(array $items, Template $template, Templ $item['executedPaths'], $item['executablePaths'] )->asFloat(), - 'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString, - 'numExecutedPaths' => $item['executedPaths'], - 'numExecutablePaths' => $item['executablePaths'], - 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), - 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), - 'testedClassesPercent' => $testedClassesPercentage->asFloat(), - 'testedClassesPercentAsString' => $testedClassesPercentage->asString(), - 'crap' => $item['crap'], + 'pathsExecutedPercentAsString' => $pathsExecutedPercentAsString, + 'numExecutedPaths' => $item['executedPaths'], + 'numExecutablePaths' => $item['executablePaths'], + 'testedMethodsPercent' => $testedMethodsPercentage->asFloat(), + 'testedMethodsPercentAsString' => $testedMethodsPercentage->asString(), + 'testedClassesPercent' => $testedClassesPercentage->asFloat(), + 'testedClassesPercentAsString' => $testedClassesPercentage->asString(), + 'crap' => $item['crap'], ] ); @@ -384,7 +384,7 @@ private function renderFunctionOrMethodItem(Template $template, array $item, str return $this->renderItemTemplate( $template, [ - 'name' => sprintf( + 'name' => sprintf( '%s%s', $indent, $item['startLine'], diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css index 5dc62ccf35..2edd609706 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css +++ b/api/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/css/style.css @@ -120,7 +120,7 @@ svg text { .scrollbox { height:245px; - overflow-x:hidden; + overflow-x:scroll; overflow-y:scroll; } @@ -128,3 +128,31 @@ table + .structure-heading { border-top: 1px solid lightgrey; padding-top: 0.5em; } + +.legend { + font-weight: bold; + margin-right: 2px; + padding-left: 10px; + padding-right: 10px; + text-align: center; +} + +.covered-by-small-tests { + background-color: #99cb84; +} + +.covered-by-medium-tests { + background-color: #c3e3b5; +} + +.covered-by-large-tests { + background-color: #dff0d8; +} + +.not-covered { + background-color: #f2dede; +} + +.not-coverable { + background-color: #fcf8e3; +} diff --git a/api/vendor/phpunit/php-code-coverage/src/Report/PHP.php b/api/vendor/phpunit/php-code-coverage/src/Report/PHP.php index ccb104ce58..1f8186d049 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Report/PHP.php +++ b/api/vendor/phpunit/php-code-coverage/src/Report/PHP.php @@ -12,6 +12,7 @@ use function dirname; use function file_put_contents; use function serialize; +use function strpos; use SebastianBergmann\CodeCoverage\CodeCoverage; use SebastianBergmann\CodeCoverage\Driver\WriteOperationFailedException; use SebastianBergmann\CodeCoverage\Util\Filesystem; @@ -20,11 +21,15 @@ final class PHP { public function process(CodeCoverage $coverage, ?string $target = null): string { + $coverage->clearCache(); + $buffer = " 'UNKNOWN', // PHPUnit_Runner_BaseTestRunner::STATUS_UNKNOWN 0 => 'PASSED', // PHPUnit_Runner_BaseTestRunner::STATUS_PASSED diff --git a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php index 00a6d8df13..6f8a044942 100644 --- a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php +++ b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CacheWarmer.php @@ -20,7 +20,9 @@ public function warmCache(string $cacheDirectory, bool $useAnnotationsForIgnorin new ParsingFileAnalyser( $useAnnotationsForIgnoringCode, $ignoreDeprecatedCode - ) + ), + $useAnnotationsForIgnoringCode, + $ignoreDeprecatedCode, ); foreach ($filter->files() as $file) { diff --git a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php index f53da078af..63e6e22ba9 100644 --- a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php +++ b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CachingFileAnalyser.php @@ -29,27 +29,39 @@ final class CachingFileAnalyser implements FileAnalyser */ private static $cacheVersion; + /** + * @var string + */ + private $directory; + /** * @var FileAnalyser */ private $analyser; /** - * @var array + * @var bool */ - private $cache = []; + private $useAnnotationsForIgnoringCode; /** - * @var string + * @var bool */ - private $directory; + private $ignoreDeprecatedCode; + + /** + * @var array + */ + private $cache = []; - public function __construct(string $directory, FileAnalyser $analyser) + public function __construct(string $directory, FileAnalyser $analyser, bool $useAnnotationsForIgnoringCode, bool $ignoreDeprecatedCode) { Filesystem::createDirectory($directory); - $this->analyser = $analyser; - $this->directory = $directory; + $this->analyser = $analyser; + $this->directory = $directory; + $this->useAnnotationsForIgnoringCode = $useAnnotationsForIgnoringCode; + $this->ignoreDeprecatedCode = $ignoreDeprecatedCode; } public function classesIn(string $filename): array @@ -161,7 +173,20 @@ private function write(string $filename, $data): void private function cacheFile(string $filename): string { - return $this->directory . DIRECTORY_SEPARATOR . md5($filename . "\0" . file_get_contents($filename) . "\0" . self::cacheVersion()); + $cacheKey = md5( + implode( + "\0", + [ + $filename, + file_get_contents($filename), + self::cacheVersion(), + $this->useAnnotationsForIgnoringCode, + $this->ignoreDeprecatedCode, + ] + ) + ); + + return $this->directory . DIRECTORY_SEPARATOR . $cacheKey; } private static function cacheVersion(): string diff --git a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php index 8a2003fa84..cb85cd61e4 100644 --- a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php +++ b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/CodeUnitFindingVisitor.php @@ -26,6 +26,7 @@ use PhpParser\Node\Stmt\Interface_; use PhpParser\Node\Stmt\Trait_; use PhpParser\Node\UnionType; +use PhpParser\NodeAbstract; use PhpParser\NodeTraverser; use PhpParser\NodeVisitorAbstract; use SebastianBergmann\Complexity\CyclomaticComplexityCalculatingVisitor; @@ -180,8 +181,12 @@ private function type(Node $type): string return '?' . $type->type; } - if ($type instanceof UnionType || $type instanceof IntersectionType) { - return $this->unionOrIntersectionAsString($type); + if ($type instanceof UnionType) { + return $this->unionTypeAsString($type); + } + + if ($type instanceof IntersectionType) { + return $this->intersectionTypeAsString($type); } return $type->toString(); @@ -298,29 +303,43 @@ private function namespace(string $namespacedName, string $name): string return trim(rtrim($namespacedName, $name), '\\'); } - /** - * @psalm-param UnionType|IntersectionType $type - */ - private function unionOrIntersectionAsString(ComplexType $type): string + private function unionTypeAsString(UnionType $node): string { - if ($type instanceof UnionType) { - $separator = '|'; - } else { - $separator = '&'; + $types = []; + + foreach ($node->types as $type) { + if ($type instanceof IntersectionType) { + $types[] = '(' . $this->intersectionTypeAsString($type) . ')'; + + continue; + } + + $types[] = $this->typeAsString($type); } + return implode('|', $types); + } + + private function intersectionTypeAsString(IntersectionType $node): string + { $types = []; - foreach ($type->types as $_type) { - if ($_type instanceof Name) { - $types[] = $_type->toCodeString(); - } else { - assert($_type instanceof Identifier); + foreach ($node->types as $type) { + $types[] = $this->typeAsString($type); + } - $types[] = $_type->toString(); - } + return implode('&', $types); + } + + /** + * @psalm-param Identifier|Name $node $node + */ + private function typeAsString(NodeAbstract $node): string + { + if ($node instanceof Name) { + return $node->toCodeString(); } - return implode($separator, $types); + return $node->toString(); } } diff --git a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php index 506f275244..38e64c0b0e 100644 --- a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php +++ b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ExecutableLinesFindingVisitor.php @@ -88,12 +88,20 @@ public function enterNode(Node $node): void return; } + if ($node instanceof Node\Stmt\Interface_) { + foreach (range($node->getStartLine(), $node->getEndLine()) as $line) { + $this->unsets[$line] = true; + } + + return; + } + if ($node instanceof Node\Stmt\Declare_ || $node instanceof Node\Stmt\DeclareDeclare || $node instanceof Node\Stmt\Else_ || $node instanceof Node\Stmt\EnumCase || $node instanceof Node\Stmt\Finally_ || - $node instanceof Node\Stmt\Interface_ || + $node instanceof Node\Stmt\GroupUse || $node instanceof Node\Stmt\Label || $node instanceof Node\Stmt\Namespace_ || $node instanceof Node\Stmt\Nop || @@ -104,6 +112,7 @@ public function enterNode(Node $node): void $node instanceof Node\Expr\ConstFetch || $node instanceof Node\Expr\Match_ || $node instanceof Node\Expr\Variable || + $node instanceof Node\Expr\Throw_ || $node instanceof Node\ComplexType || $node instanceof Node\Const_ || $node instanceof Node\Identifier || @@ -113,12 +122,27 @@ public function enterNode(Node $node): void return; } + /* + * nikic/php-parser ^4.18 represents throw statements + * as Stmt\Throw_ objects + */ if ($node instanceof Node\Stmt\Throw_) { $this->setLineBranch($node->expr->getEndLine(), $node->expr->getEndLine(), ++$this->nextBranch); return; } + /* + * nikic/php-parser ^5 represents throw statements + * as Stmt\Expression objects that contain an + * Expr\Throw_ object + */ + if ($node instanceof Node\Stmt\Expression && $node->expr instanceof Node\Expr\Throw_) { + $this->setLineBranch($node->expr->expr->getEndLine(), $node->expr->expr->getEndLine(), ++$this->nextBranch); + + return; + } + if ($node instanceof Node\Stmt\Enum_ || $node instanceof Node\Stmt\Function_ || $node instanceof Node\Stmt\Class_ || diff --git a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php index e686382190..923b1f50ff 100644 --- a/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php +++ b/api/vendor/phpunit/php-code-coverage/src/StaticAnalysis/ParsingFileAnalyser.php @@ -22,7 +22,6 @@ use function token_get_all; use function trim; use PhpParser\Error; -use PhpParser\Lexer; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor\NameResolver; use PhpParser\NodeVisitor\ParentConnectingVisitor; @@ -142,10 +141,7 @@ private function analyse(string $filename): void $linesOfCode = 1; } - $parser = (new ParserFactory)->create( - ParserFactory::PREFER_PHP7, - new Lexer - ); + $parser = (new ParserFactory)->createForHostVersion(); try { $nodes = $parser->parse($source); diff --git a/api/vendor/phpunit/php-code-coverage/src/Version.php b/api/vendor/phpunit/php-code-coverage/src/Version.php index 8d45b6c6dd..93cf32d94c 100644 --- a/api/vendor/phpunit/php-code-coverage/src/Version.php +++ b/api/vendor/phpunit/php-code-coverage/src/Version.php @@ -22,7 +22,7 @@ final class Version public static function id(): string { if (self::$version === null) { - self::$version = (new VersionId('9.2.24', dirname(__DIR__)))->getVersion(); + self::$version = (new VersionId('9.2.32', dirname(__DIR__)))->getVersion(); } return self::$version; diff --git a/api/vendor/phpunit/phpunit/.phpstorm.meta.php b/api/vendor/phpunit/phpunit/.phpstorm.meta.php deleted file mode 100644 index b69ff78902..0000000000 --- a/api/vendor/phpunit/phpunit/.phpstorm.meta.php +++ /dev/null @@ -1,33 +0,0 @@ -"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createStub(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createConfiguredMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createPartialMock(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::createTestProxy(0), - map([""=>"$0"]) - ); - - override( - \PHPUnit\Framework\TestCase::getMockForAbstractClass(0), - map([""=>"$0"]) - ); -} diff --git a/api/vendor/phpunit/phpunit/ChangeLog-8.5.md b/api/vendor/phpunit/phpunit/ChangeLog-8.5.md deleted file mode 100644 index 6485b8e539..0000000000 --- a/api/vendor/phpunit/phpunit/ChangeLog-8.5.md +++ /dev/null @@ -1,297 +0,0 @@ -# Changes in PHPUnit 8.5 - -All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. - -## [8.5.32] - 2023-01-26 - -### Fixed - -* [#5120](https://github.com/sebastianbergmann/phpunit/issues/5120): Test Runner incorrectly treats `--testsuite` and `--list-tests` as not combinable options - -## [8.5.31] - 2022-10-28 - -### Fixed - -* [#5076](https://github.com/sebastianbergmann/phpunit/issues/5076): Test Runner does not warn about conflicting options - -## [8.5.30] - 2022-09-25 - -### Changed - -* The configuration generator now asks for a cache directory - -### Fixed - -* [#4913](https://github.com/sebastianbergmann/phpunit/issues/4913): Failed `assert()` should show a backtrace -* [#4966](https://github.com/sebastianbergmann/phpunit/issues/4966): `TestCase::assertSame()` (and related exact comparisons) must compare `float` exactly - -## [8.5.29] - 2022-08-22 - -### Changed - -* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy - -## [8.5.28] - 2022-07-29 - -### Fixed - -* [#5015](https://github.com/sebastianbergmann/phpunit/pull/5015): Ukraine banner unreadable on black background -* [#5016](https://github.com/sebastianbergmann/phpunit/issues/5016): PHPUnit 8.5.27 does not work on PHP 7.2.0-7.2.18 and PHP 7.3.0-7.3.5 - -## [8.5.27] - 2022-06-19 - -### Fixed - -* [#4950](https://github.com/sebastianbergmann/phpunit/issues/4950): False error on `atMost()` invocation rule without call -* [#4962](https://github.com/sebastianbergmann/phpunit/issues/4962): Ukraine banner unreadable on white background - -## [8.5.26] - 2022-04-01 - -### Fixed - -* [#4938](https://github.com/sebastianbergmann/phpunit/issues/4938): Test Double code generator does not handle `void` return type declaration on `__clone()` methods - -## [8.5.25] - 2022-03-16 - -### Fixed - -* [#4934](https://github.com/sebastianbergmann/phpunit/issues/4934): Code Coverage does not work with PHPUnit 8.5.24 PHAR on PHP 7 - -## [8.5.24] - 2022-03-05 - #StandWithUkraine - -### Changed - -* [#4874](https://github.com/sebastianbergmann/phpunit/pull/4874): `PHP_FLOAT_EPSILON` is now used instead of hardcoded `0.0000000001` in `PHPUnit\Framework\Constraint\IsIdentical` - -### Fixed - -* When the HTML code coverage report's configured low upper bound is larger than the high lower bound then the default values are used instead - -## [8.5.23] - 2022-01-21 - -### Fixed - -* [#4799](https://github.com/sebastianbergmann/phpunit/pull/4799): Memory leaks in `PHPUnit\Framework\TestSuite` class -* [#4857](https://github.com/sebastianbergmann/phpunit/pull/4857): Result of `debug_backtrace()` is not used correctly - -## [8.5.22] - 2021-12-25 - -### Changed - -* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active -* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2 - -### Fixed - -* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics -* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored - -## [8.5.21] - 2021-09-25 - -### Changed - -* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) -* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` - -### Fixed - -* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings - -## [8.5.20] - 2021-08-31 - -### Fixed - -* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern - -## [8.5.19] - 2021-07-31 - -### Fixed - -* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 - -## [8.5.18] - 2021-07-19 - -### Fixed - -* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements - -## [8.5.17] - 2021-06-23 - -### Changed - -* PHPUnit now errors out on startup when `PHP_VERSION` contains a value that is not compatible with `version_compare()`, for instance `X.Y.Z-(to be removed in future macOS)` - -## [8.5.16] - 2021-06-05 - -### Changed - -* The test result cache (the storage for which is implemented in `PHPUnit\Runner\DefaultTestResultCache`) no longer uses PHP's `serialize()` and `unserialize()` functions for persistence. It now uses a versioned JSON format instead that is independent of PHP implementation details (see [#3581](https://github.com/sebastianbergmann/phpunit/issues/3581) and [#4662](https://github.com/sebastianbergmann/phpunit/pull/4662) for examples why this is a problem). When PHPUnit tries to load the test result cache from a file that does not exist, or from a file that does not contain data in JSON format, or from a file that contains data in a JSON format version other than the one used by the currently running PHPUnit version, then this is considered to be a "cache miss". An empty `DefaultTestResultCache` object is created in this case. This should also prevent PHPUnit from crashing when trying to load a test result cache file created by a different version of PHPUnit (see [#4580](https://github.com/sebastianbergmann/phpunit/issues/4580) for example). - -### Fixed - -* [#4663](https://github.com/sebastianbergmann/phpunit/issues/4663): `TestCase::expectError()` works on PHP 7.3, but not on PHP >= 7.4 -* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default -* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly -* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev - -## [8.5.15] - 2021-03-17 - -### Fixed - -* [#4591](https://github.com/sebastianbergmann/phpunit/issues/4591): TeamCity logger logs warnings as test failures - -## [8.5.14] - 2021-01-17 - -### Fixed - -* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly -* [#4572](https://github.com/sebastianbergmann/phpunit/issues/4572): Schema validation does not work with `%xx` sequences in path to `phpunit.xsd` -* [#4575](https://github.com/sebastianbergmann/phpunit/issues/4575): PHPUnit 8.5 incompatibility with PHP 8.1 - -## [8.5.13] - 2020-12-01 - -### Fixed - -* Running tests in isolated processes did not work with PHP 8 on Windows - -## [8.5.12] - 2020-11-30 - -### Changed - -* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow the installation of PHPUnit 8.5 on PHP 8. Please note that the code coverage functionality is not available for PHPUnit 8.5 on PHP 8. - -### Fixed - -* [#4529](https://github.com/sebastianbergmann/phpunit/issues/4529): Debug mode of Xdebug 2 is not disabled for PHPT tests - -## [8.5.11] - 2020-11-27 - -### Changed - -* Bumped required version of `phpunit/php-code-coverage` - -## [8.5.10] - 2020-11-27 - -### Added - -* Support for Xdebug 3 - -### Fixed - -* [#4516](https://github.com/sebastianbergmann/phpunit/issues/4516): `phpunit/phpunit-selenium` does not work with PHPUnit 8.5.9 - -## [8.5.9] - 2020-11-10 - -### Fixed - -* [#3965](https://github.com/sebastianbergmann/phpunit/issues/3965): Process Isolation throws exceptions when PHPDBG is used -* [#4470](https://github.com/sebastianbergmann/phpunit/pull/4470): Infinite recursion when `--static-backup --strict-global-state` is used - -## [8.5.8] - 2020-06-22 - -### Fixed - -* [#4312](https://github.com/sebastianbergmann/phpunit/issues/4312): Fix for [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299) breaks backward compatibility - -## [8.5.7] - 2020-06-21 - -### Fixed - -* [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299): "No tests executed" does not always result in exit code `1` -* [#4306](https://github.com/sebastianbergmann/phpunit/issues/4306): Exceptions during code coverage driver initialization are not handled correctly - -## [8.5.6] - 2020-06-15 - -### Fixed - -* [#4211](https://github.com/sebastianbergmann/phpunit/issues/4211): `phpdbg_*()` functions are scoped to `PHPUnit\phpdbg_*()` - -## [8.5.5] - 2020-05-22 - -### Fixed - -* [#4033](https://github.com/sebastianbergmann/phpunit/issues/4033): Unexpected behaviour when `$GLOBALS` is deleted - -## [8.5.4] - 2020-04-23 - -### Changed - -* Changed how `PHPUnit\TextUI\Command` passes warnings to `PHPUnit\TextUI\TestRunner` - -## [8.5.3] - 2020-03-31 - -### Fixed - -* [#4017](https://github.com/sebastianbergmann/phpunit/issues/4017): Do not suggest refactoring to something that is also deprecated -* [#4133](https://github.com/sebastianbergmann/phpunit/issues/4133): `expectExceptionMessageRegExp()` has been removed in PHPUnit 9 without a deprecation warning being given in PHPUnit 8 -* [#4139](https://github.com/sebastianbergmann/phpunit/issues/4139): Cannot double interfaces that declare a constructor with PHP 8 -* [#4144](https://github.com/sebastianbergmann/phpunit/issues/4144): Empty objects are converted to empty arrays in JSON comparison failure diff - -## [8.5.2] - 2020-01-08 - -### Removed - -* `eval-stdin.php` has been removed, it was not used anymore since PHPUnit 7.2.7 - -## [8.5.1] - 2019-12-25 - -### Changed - -* `eval-stdin.php` can now only be executed with `cli` and `phpdbg` - -### Fixed - -* [#3983](https://github.com/sebastianbergmann/phpunit/issues/3983): Deprecation warning given too eagerly - -## [8.5.0] - 2019-12-06 - -### Added - -* [#3911](https://github.com/sebastianbergmann/phpunit/issues/3911): Support combined use of `addMethods()` and `onlyMethods()` -* [#3949](https://github.com/sebastianbergmann/phpunit/issues/3949): Introduce specialized assertions `assertFileEqualsCanonicalizing()`, `assertFileEqualsIgnoringCase()`, `assertStringEqualsFileCanonicalizing()`, `assertStringEqualsFileIgnoringCase()`, `assertFileNotEqualsCanonicalizing()`, `assertFileNotEqualsIgnoringCase()`, `assertStringNotEqualsFileCanonicalizing()`, and `assertStringNotEqualsFileIgnoringCase()` as alternative to using `assertFileEquals()` etc. with optional parameters - -### Changed - -* [#3860](https://github.com/sebastianbergmann/phpunit/pull/3860): Deprecate invoking PHPUnit commandline test runner with just a class name -* [#3950](https://github.com/sebastianbergmann/phpunit/issues/3950): Deprecate optional parameters of `assertFileEquals()` etc. -* [#3955](https://github.com/sebastianbergmann/phpunit/issues/3955): Deprecate support for doubling multiple interfaces - -### Fixed - -* [#3953](https://github.com/sebastianbergmann/phpunit/issues/3953): Code Coverage for test executed in isolation does not work when the PHAR is used -* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable` -* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside - -[8.5.32]: https://github.com/sebastianbergmann/phpunit/compare/8.5.31...8.5.32 -[8.5.31]: https://github.com/sebastianbergmann/phpunit/compare/8.5.30...8.5.31 -[8.5.30]: https://github.com/sebastianbergmann/phpunit/compare/8.5.29...8.5.30 -[8.5.29]: https://github.com/sebastianbergmann/phpunit/compare/8.5.28...8.5.29 -[8.5.28]: https://github.com/sebastianbergmann/phpunit/compare/8.5.27...8.5.28 -[8.5.27]: https://github.com/sebastianbergmann/phpunit/compare/8.5.26...8.5.27 -[8.5.26]: https://github.com/sebastianbergmann/phpunit/compare/8.5.25...8.5.26 -[8.5.25]: https://github.com/sebastianbergmann/phpunit/compare/8.5.24...8.5.25 -[8.5.24]: https://github.com/sebastianbergmann/phpunit/compare/8.5.23...8.5.24 -[8.5.23]: https://github.com/sebastianbergmann/phpunit/compare/8.5.22...8.5.23 -[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22 -[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21 -[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20 -[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19 -[8.5.18]: https://github.com/sebastianbergmann/phpunit/compare/8.5.17...8.5.18 -[8.5.17]: https://github.com/sebastianbergmann/phpunit/compare/8.5.16...8.5.17 -[8.5.16]: https://github.com/sebastianbergmann/phpunit/compare/8.5.15...8.5.16 -[8.5.15]: https://github.com/sebastianbergmann/phpunit/compare/8.5.14...8.5.15 -[8.5.14]: https://github.com/sebastianbergmann/phpunit/compare/8.5.13...8.5.14 -[8.5.13]: https://github.com/sebastianbergmann/phpunit/compare/8.5.12...8.5.13 -[8.5.12]: https://github.com/sebastianbergmann/phpunit/compare/8.5.11...8.5.12 -[8.5.11]: https://github.com/sebastianbergmann/phpunit/compare/8.5.10...8.5.11 -[8.5.10]: https://github.com/sebastianbergmann/phpunit/compare/8.5.9...8.5.10 -[8.5.9]: https://github.com/sebastianbergmann/phpunit/compare/8.5.8...8.5.9 -[8.5.8]: https://github.com/sebastianbergmann/phpunit/compare/8.5.7...8.5.8 -[8.5.7]: https://github.com/sebastianbergmann/phpunit/compare/8.5.6...8.5.7 -[8.5.6]: https://github.com/sebastianbergmann/phpunit/compare/8.5.5...8.5.6 -[8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5 -[8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4 -[8.5.3]: https://github.com/sebastianbergmann/phpunit/compare/8.5.2...8.5.3 -[8.5.2]: https://github.com/sebastianbergmann/phpunit/compare/8.5.1...8.5.2 -[8.5.1]: https://github.com/sebastianbergmann/phpunit/compare/8.5.0...8.5.1 -[8.5.0]: https://github.com/sebastianbergmann/phpunit/compare/8.4.3...8.5.0 diff --git a/api/vendor/phpunit/phpunit/ChangeLog-9.6.md b/api/vendor/phpunit/phpunit/ChangeLog-9.6.md index 88fb763bcc..b8ce54ebc0 100644 --- a/api/vendor/phpunit/phpunit/ChangeLog-9.6.md +++ b/api/vendor/phpunit/phpunit/ChangeLog-9.6.md @@ -2,6 +2,157 @@ All notable changes of the PHPUnit 9.6 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [9.6.22] - 2024-12-05 + +### Fixed + +* [#6071](https://github.com/sebastianbergmann/phpunit/issues/6071): PHP Archives (PHARs) of PHPUnit 8.5 and PHPUnit 9.6 bundle outdated versions of Prophecy + +## [9.6.21] - 2024-09-19 + +### Changed + +* [#5956](https://github.com/sebastianbergmann/phpunit/issues/5956): Deprecation of the `E_STRICT` constant in PHP 8.4 +* Removed `.phpstorm.meta.php` file as methods such as `TestCase::createStub()` use generics / template types for their return types and PhpStorm, for example, uses that information + +## [9.6.20] - 2024-07-10 + +### Changed + +* Updated dependencies (so that users that install using Composer's `--prefer-lowest` CLI option also get recent versions) + +## [9.6.19] - 2024-04-05 + +### Changed + +* The namespaces of dependencies are now prefixed with `PHPUnitPHAR` instead of just `PHPUnit` for the PHAR distribution of PHPUnit + +## [9.6.18] - 2024-03-21 + +### Changed + +* [#5763](https://github.com/sebastianbergmann/phpunit/issues/5763): Release nullable type changes for PHPUnit 9.6 + +## [9.6.17] - 2024-02-23 + +### Changed + +* Improve output of `--check-version` CLI option +* Improve description of `--check-version` CLI option +* Show help for `--manifest`, `--sbom`, and `--composer-lock` when the PHAR is used + +### Fixed + +* [#5712](https://github.com/sebastianbergmann/phpunit/issues/5712): Update dependencies for PHAR distribution of PHPUnit 9.6 + +## [9.6.16] - 2024-01-19 + +### Changed + +* Make PHAR build reproducible (the only remaining differences were in the timestamps for the files in the PHAR) + +### Fixed + +* [#5516](https://github.com/sebastianbergmann/phpunit/issues/5516): Assertions that use the `LogicalNot` constraint (`assertNotEquals()`, `assertStringNotContainsString()`, ...) can generate confusing failure messages +* [#5666](https://github.com/sebastianbergmann/phpunit/issues/5666): `--no-extensions` CLI option does not work +* [#5673](https://github.com/sebastianbergmann/phpunit/issues/5673): Confusing error message when migration of a configuration is requested that does not need to be migrated + +## [9.6.15] - 2023-12-01 + +### Fixed + +* [#5596](https://github.com/sebastianbergmann/phpunit/issues/5596): `PHPUnit\Framework\TestCase` has `@internal` annotation in PHAR + +## [9.6.14] - 2023-12-01 + +### Added + +* [#5577](https://github.com/sebastianbergmann/phpunit/issues/5577): `--composer-lock` CLI option for PHAR binary that displays the `composer.lock` used to build the PHAR + +## [9.6.13] - 2023-09-19 + +### Changed + +* The child processes used for process isolation now use temporary files to communicate their result to the parent process + +## [9.6.12] - 2023-09-12 + +### Changed + +* [#5508](https://github.com/sebastianbergmann/phpunit/pull/5508): Generate code coverage report in PHP format as first in list to avoid serializing cache data + +## [9.6.11] - 2023-08-19 + +### Added + +* [#5478](https://github.com/sebastianbergmann/phpunit/pull/5478): `assertObjectHasProperty()` and `assertObjectNotHasProperty()` + +## [9.6.10] - 2023-07-10 + +### Changed + +* [#5419](https://github.com/sebastianbergmann/phpunit/pull/5419): Allow empty `` element in XML configuration + +## [9.6.9] - 2023-06-11 + +### Fixed + +* [#5405](https://github.com/sebastianbergmann/phpunit/issues/5405): XML configuration migration does not migrate `whitelist/file` elements +* Always use `X.Y.Z` version number (and not just `X.Y`) of PHPUnit's version when checking whether a PHAR-distributed extension is compatible + +## [9.6.8] - 2023-05-11 + +### Fixed + +* [#5345](https://github.com/sebastianbergmann/phpunit/issues/5345): No stack trace shown for previous exceptions during bootstrap + +## [9.6.7] - 2023-04-14 + +### Fixed + +* Tests that have `@doesNotPerformAssertions` do not contribute to code coverage + +## [9.6.6] - 2023-03-27 + +### Fixed + +* [#5270](https://github.com/sebastianbergmann/phpunit/issues/5270): `GlobalState::getIniSettingsAsString()` generates code that triggers warnings + +## [9.6.5] - 2023-03-09 + +### Changed + +* Backported the HTML and CSS improvements made to the `--testdox-html` from PHPUnit 10 + +### Fixed + +* [#5205](https://github.com/sebastianbergmann/phpunit/issues/5205): Wrong default value for optional parameter of `PHPUnit\Util\Test::parseTestMethodAnnotations()` causes `ReflectionException` + +## [9.6.4] - 2023-02-27 + +### Fixed + +* [#5186](https://github.com/sebastianbergmann/phpunit/issues/5186): SBOM does not validate + +## [9.6.3] - 2023-02-04 + +### Fixed + +* [#5164](https://github.com/sebastianbergmann/phpunit/issues/5164): `markTestSkipped()` not handled correctly when called in "before first test" method + +## [9.6.2] - 2023-02-04 + +### Fixed + +* [#4618](https://github.com/sebastianbergmann/phpunit/issues/4618): Support for generators in `assertCount()` etc. is not marked as deprecated in PHPUnit 9.6 + +## [9.6.1] - 2023-02-03 + +### Fixed + +* [#5073](https://github.com/sebastianbergmann/phpunit/issues/5073): `--no-extensions` CLI option only prevents extension PHARs from being loaded +* [#5160](https://github.com/sebastianbergmann/phpunit/issues/5160): Deprecate `assertClassHasAttribute()`, `assertClassNotHasAttribute()`, `assertClassHasStaticAttribute()`, `assertClassNotHasStaticAttribute()`, `assertObjectHasAttribute()`, `assertObjectNotHasAttribute()`, `classHasAttribute()`, `classHasStaticAttribute()`, and `objectHasAttribute()` + ## [9.6.0] - 2023-02-03 ### Changed @@ -11,4 +162,26 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil * [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064): Deprecate `PHPUnit\Framework\TestCase::getMockClass()` * [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132): Deprecate `Test` suffix for abstract test case classes +[9.6.22]: https://github.com/sebastianbergmann/phpunit/compare/9.6.21...9.6.22 +[9.6.21]: https://github.com/sebastianbergmann/phpunit/compare/9.6.20...9.6.21 +[9.6.20]: https://github.com/sebastianbergmann/phpunit/compare/9.6.19...9.6.20 +[9.6.19]: https://github.com/sebastianbergmann/phpunit/compare/9.6.18...9.6.19 +[9.6.18]: https://github.com/sebastianbergmann/phpunit/compare/9.6.17...9.6.18 +[9.6.17]: https://github.com/sebastianbergmann/phpunit/compare/9.6.16...9.6.17 +[9.6.16]: https://github.com/sebastianbergmann/phpunit/compare/9.6.15...9.6.16 +[9.6.15]: https://github.com/sebastianbergmann/phpunit/compare/9.6.14...9.6.15 +[9.6.14]: https://github.com/sebastianbergmann/phpunit/compare/9.6.13...9.6.14 +[9.6.13]: https://github.com/sebastianbergmann/phpunit/compare/9.6.12...9.6.13 +[9.6.12]: https://github.com/sebastianbergmann/phpunit/compare/9.6.11...9.6.12 +[9.6.11]: https://github.com/sebastianbergmann/phpunit/compare/9.6.10...9.6.11 +[9.6.10]: https://github.com/sebastianbergmann/phpunit/compare/9.6.9...9.6.10 +[9.6.9]: https://github.com/sebastianbergmann/phpunit/compare/9.6.8...9.6.9 +[9.6.8]: https://github.com/sebastianbergmann/phpunit/compare/9.6.7...9.6.8 +[9.6.7]: https://github.com/sebastianbergmann/phpunit/compare/9.6.6...9.6.7 +[9.6.6]: https://github.com/sebastianbergmann/phpunit/compare/9.6.5...9.6.6 +[9.6.5]: https://github.com/sebastianbergmann/phpunit/compare/9.6.4...9.6.5 +[9.6.4]: https://github.com/sebastianbergmann/phpunit/compare/9.6.3...9.6.4 +[9.6.3]: https://github.com/sebastianbergmann/phpunit/compare/9.6.2...9.6.3 +[9.6.2]: https://github.com/sebastianbergmann/phpunit/compare/9.6.1...9.6.2 +[9.6.1]: https://github.com/sebastianbergmann/phpunit/compare/9.6.0...9.6.1 [9.6.0]: https://github.com/sebastianbergmann/phpunit/compare/9.5.28...9.6.0 diff --git a/api/vendor/phpunit/phpunit/DEPRECATIONS.md b/api/vendor/phpunit/phpunit/DEPRECATIONS.md new file mode 100644 index 0000000000..b8349592b5 --- /dev/null +++ b/api/vendor/phpunit/phpunit/DEPRECATIONS.md @@ -0,0 +1,89 @@ +# Deprecations + +## Soft Deprecations + +This functionality is currently [soft-deprecated](https://phpunit.de/backward-compatibility.html#soft-deprecation): + +### Writing Tests + +#### Test Double API + +| Issue | Description | Since | Replacement | +|-------------------------------------------------------------------|-----------------------------------|-------|-------------| +| [#3687](https://github.com/sebastianbergmann/phpunit/issues/3687) | `MockBuilder::setMethods()` | 8.3.0 | | +| [#3687](https://github.com/sebastianbergmann/phpunit/issues/3687) | `MockBuilder::setMethodsExcept()` | 9.6.0 | | + +## Hard Deprecations + +This functionality is currently [hard-deprecated](https://phpunit.de/backward-compatibility.html#hard-deprecation): + +### Writing Tests + +#### Assertions, Constraints, and Expectations + +| Issue | Description | Since | Replacement | +|-------------------------------------------------------------------|------------------------------------------------|-------|---------------------------------------------------| +| [#4062](https://github.com/sebastianbergmann/phpunit/issues/4062) | `TestCase::assertNotIsReadable()` | 9.1.0 | `TestCase::assertIsNotReadable()` | +| [#4065](https://github.com/sebastianbergmann/phpunit/issues/4065) | `TestCase::assertNotIsWritable()` | 9.1.0 | `TestCase::assertIsNotWritable()` | +| [#4068](https://github.com/sebastianbergmann/phpunit/issues/4068) | `TestCase::assertDirectoryNotExists()` | 9.1.0 | `TestCase::assertDirectoryDoesNotExist()` | +| [#4071](https://github.com/sebastianbergmann/phpunit/issues/4071) | `TestCase::assertDirectoryNotIsReadable()` | 9.1.0 | `TestCase::assertDirectoryIsNotReadable()` | +| [#4074](https://github.com/sebastianbergmann/phpunit/issues/4074) | `TestCase::assertDirectoryNotIsWritable()` | 9.1.0 | `TestCase::assertDirectoryIsNotWritable()` | +| [#4077](https://github.com/sebastianbergmann/phpunit/issues/4077) | `TestCase::assertFileNotExists()` | 9.1.0 | `TestCase::assertFileDoesNotExist()` | +| [#4080](https://github.com/sebastianbergmann/phpunit/issues/4080) | `TestCase::assertFileNotIsReadable()` | 9.1.0 | `TestCase::assertFileIsNotReadable()` | +| [#4083](https://github.com/sebastianbergmann/phpunit/issues/4083) | `TestCase::assertFileNotIsWritable()` | 9.1.0 | `TestCase::assertFileIsNotWritable()` | +| [#4086](https://github.com/sebastianbergmann/phpunit/issues/4086) | `TestCase::assertRegExp()` | 9.1.0 | `TestCase::assertMatchesRegularExpression()` | +| [#4089](https://github.com/sebastianbergmann/phpunit/issues/4089) | `TestCase::assertNotRegExp()` | 9.1.0 | `TestCase::assertDoesNotMatchRegularExpression()` | +| [#4091](https://github.com/sebastianbergmann/phpunit/issues/4091) | `TestCase::assertEqualXMLStructure()` | 9.1.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectDeprecation()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectDeprecationMessage()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectDeprecationMessageMatches()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectError()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectErrorMessage()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectErrorMessageMatches()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectNotice()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectNoticeMessage()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectNoticeMessageMatches()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectWarning()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectWarningMessage()` | 9.6.0 | | +| [#5062](https://github.com/sebastianbergmann/phpunit/issues/5062) | `TestCase::expectWarningMessageMatches()` | 9.6.0 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassHasAttribute()` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassNotHasAttribute()` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassHasStaticAttribute()` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertClassNotHasStaticAttribute()` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertObjectHasAttribute()` | 9.6.1 | `TestCase::assertObjectHasProperty()` | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::assertObjectNotHasAttribute()` | 9.6.1 | `TestCase::assertObjectNotHasProperty()` | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::classHasAttribute()` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::classHasStaticAttribute()` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `TestCase::objectHasAttribute()` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `ClassHasAttribute` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `ClassHasStaticAttribute` | 9.6.1 | | +| [#4601](https://github.com/sebastianbergmann/phpunit/issues/4601) | `ObjectHasAttribute` | 9.6.1 | `ObjectHasProperty` | + +#### Test Double API + +| Issue | Description | Since | Replacement | +|-------------------------------------------------------------------|---------------------------------------|-------|-------------------------------------------------------------------------| +| [#4141](https://github.com/sebastianbergmann/phpunit/issues/4141) | `TestCase::prophesize()` | 9.1.0 | [phpspec/prophecy-phpunit](https://github.com/phpspec/prophecy-phpunit) | +| [#4297](https://github.com/sebastianbergmann/phpunit/issues/4297) | `TestCase::at()` | 9.3.0 | | +| [#4297](https://github.com/sebastianbergmann/phpunit/issues/4297) | `InvokedAtIndex` | 9.3.0 | | +| [#5063](https://github.com/sebastianbergmann/phpunit/issues/5063) | `InvocationMocker::withConsecutive()` | 9.6.0 | | +| [#5063](https://github.com/sebastianbergmann/phpunit/issues/5063) | `ConsecutiveParameters` | 9.6.0 | | +| [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064) | `TestCase::getMockClass()` | 9.6.0 | | + +#### Miscellaneous + +| Issue | Description | Since | Replacement | +|-------------------------------------------------------------------|----------------------------------------------|-------|------------------------------------------------| +| [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132) | `Test` suffix for abstract test case classes | | | +| | `TestCase::$backupGlobalsBlacklist` | 9.3.0 | `TestCase::$backupGlobalsExcludeList` | +| | `TestCase::$backupStaticAttributesBlacklist` | 9.3.0 | `TestCase::$backupStaticAttributesExcludeList` | + +### Extending PHPUnit + +| Issue | Description | Since | Replacement | +|-------------------------------------------------------------------|--------------------------------------|-------|-------------------------------------------------------------| +| [#4676](https://github.com/sebastianbergmann/phpunit/issues/4676) | `TestListener` | 8.0.0 | [Event System](https://docs.phpunit.de/en/10.3/events.html) | +| [#4039](https://github.com/sebastianbergmann/phpunit/issues/4039) | `Command::handleLoader()` | 9.1.0 | | +| [#4039](https://github.com/sebastianbergmann/phpunit/issues/4039) | `TestSuiteLoader` | 9.1.0 | | +| [#4039](https://github.com/sebastianbergmann/phpunit/issues/4039) | `StandardTestSuiteLoader` | 9.1.0 | | +| [#4676](https://github.com/sebastianbergmann/phpunit/issues/4676) | `TestListenerDefaultImplementation` | 8.2.4 | [Event System](https://docs.phpunit.de/en/10.3/events.html) | diff --git a/api/vendor/phpunit/phpunit/LICENSE b/api/vendor/phpunit/phpunit/LICENSE index 73e955128f..bdb57ec66f 100644 --- a/api/vendor/phpunit/phpunit/LICENSE +++ b/api/vendor/phpunit/phpunit/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2001-2023, Sebastian Bergmann +Copyright (c) 2001-2024, Sebastian Bergmann All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/api/vendor/phpunit/phpunit/README.md b/api/vendor/phpunit/phpunit/README.md index ffc8bf323a..8aff034536 100644 --- a/api/vendor/phpunit/phpunit/README.md +++ b/api/vendor/phpunit/phpunit/README.md @@ -1,10 +1,7 @@ -

🇺🇦 UKRAINE NEEDS YOUR HELP NOW!

- # PHPUnit -[![Latest Stable Version](https://poser.pugx.org/phpunit/phpunit/v/stable.png)](https://packagist.org/packages/phpunit/phpunit) +[![Latest Stable Version](https://poser.pugx.org/phpunit/phpunit/v)](https://packagist.org/packages/phpunit/phpunit) [![CI Status](https://github.com/sebastianbergmann/phpunit/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/phpunit/actions) -[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/phpunit/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/phpunit) [![codecov](https://codecov.io/gh/sebastianbergmann/phpunit/branch/9.6/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/phpunit) PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks. @@ -21,11 +18,11 @@ $ php phpunit-X.Y.phar --version Please replace `X.Y` with the version of PHPUnit you are interested in. -Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the "[Getting Started](https://phpunit.de/getting-started-with-phpunit.html)" guide for details on how to install PHPUnit. +Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the [documentation](https://phpunit.de/documentation.html) for details on how to install PHPUnit. ## Contribute -Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. +Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/main/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects. ## List of Contributors diff --git a/api/vendor/phpunit/phpunit/SECURITY.md b/api/vendor/phpunit/phpunit/SECURITY.md index dcc153859a..5f55c41947 100644 --- a/api/vendor/phpunit/phpunit/SECURITY.md +++ b/api/vendor/phpunit/phpunit/SECURITY.md @@ -1,11 +1,33 @@ # Security Policy -PHPUnit is a framework for writing as well as a commandline tool for running tests. Writing and running tests is a development-time activity. There is no reason why PHPUnit should be installed on a webserver. +If you believe you have found a security vulnerability in PHPUnit, please report it to us through coordinated disclosure. + +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** + +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +PHPUnit is a framework for writing as well as a command-line tool for running tests. Writing and running tests is a development-time activity. There is no reason why PHPUnit should be installed on a webserver and/or in a production environment. **If you upload PHPUnit to a webserver then your deployment process is broken. On a more general note, if your `vendor` directory is publicly accessible on your webserver then your deployment process is also broken.** -Please note that if you upload PHPUnit to a webserver "bad things" may happen. [You have been warned.](https://thephp.cc/articles/phpunit-a-security-risk) +Please note that if you upload PHPUnit to a webserver "bad things" may happen. [You have been warned.](https://thephp.cc/articles/phpunit-a-security-risk?ref=phpunit) + +PHPUnit is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using PHPUnit in an HTTP or web context or with untrusted input data is performed. PHPUnit might also contain functionality that intentionally exposes internal application data for debugging purposes. -## Security Contact Information +If PHPUnit is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. -After the above, if you still would like to report a security vulnerability, please email `sebastian@phpunit.de`. +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. diff --git a/api/vendor/phpunit/phpunit/composer.json b/api/vendor/phpunit/phpunit/composer.json index 38117ea1eb..fbee5d8bc2 100644 --- a/api/vendor/phpunit/phpunit/composer.json +++ b/api/vendor/phpunit/phpunit/composer.json @@ -17,7 +17,8 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy" }, "prefer-stable": true, "require": { @@ -28,25 +29,25 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "doctrine/instantiator": "^1.3.1 || ^2", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", + "doctrine/instantiator": "^1.5.0 || ^2", + "myclabs/deep-copy": "^1.12.1", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "config": { @@ -57,8 +58,8 @@ "sort-packages": true }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "bin": [ "phpunit" diff --git a/api/vendor/phpunit/phpunit/composer.lock b/api/vendor/phpunit/phpunit/composer.lock new file mode 100644 index 0000000000..08fedc1433 --- /dev/null +++ b/api/vendor/phpunit/phpunit/composer.lock @@ -0,0 +1,1666 @@ +{ + "_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": "c2c8f2f519c0a987a4a2c8d3ffd9b3ce", + "packages": [ + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "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%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.12.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-11-08T17:47:46+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.19.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.1" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + }, + "time": "2024-09-29T15:01:53+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.32", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:23:01+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "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": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.3", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*" + }, + "platform-dev": {}, + "platform-overrides": { + "php": "7.3.0" + }, + "plugin-api-version": "2.6.0" +} diff --git a/api/vendor/phpunit/phpunit/phpunit b/api/vendor/phpunit/phpunit/phpunit index c802956689..b9f5cf29d4 100644 --- a/api/vendor/phpunit/phpunit/phpunit +++ b/api/vendor/phpunit/phpunit/phpunit @@ -38,22 +38,31 @@ if (version_compare('7.3.0', PHP_VERSION, '>')) { die(1); } -foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) { - if (extension_loaded($extension)) { - continue; +$requiredExtensions = ['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter']; + +$unavailableExtensions = array_filter( + $requiredExtensions, + static function ($extension) { + return !extension_loaded($extension); } +); +if ([] !== $unavailableExtensions) { fwrite( STDERR, sprintf( - 'PHPUnit requires the "%s" extension.' . PHP_EOL, - $extension + 'PHPUnit requires the "%s" extensions, but the "%s" %s not available.' . PHP_EOL, + implode('", "', $requiredExtensions), + implode('", "', $unavailableExtensions), + count($unavailableExtensions) === 1 ? 'extension is' : 'extensions are' ) ); die(1); } +unset($requiredExtensions, $unavailableExtensions); + if (!ini_get('date.timezone')) { ini_set('date.timezone', 'UTC'); } diff --git a/api/vendor/phpunit/phpunit/phpunit.xsd b/api/vendor/phpunit/phpunit/phpunit.xsd index 7fa2f6b678..619434ef8a 100644 --- a/api/vendor/phpunit/phpunit/phpunit.xsd +++ b/api/vendor/phpunit/phpunit/phpunit.xsd @@ -57,7 +57,7 @@ - + diff --git a/api/vendor/phpunit/phpunit/schema/8.5.xsd b/api/vendor/phpunit/phpunit/schema/8.5.xsd index 5881bafec6..75e2228947 100644 --- a/api/vendor/phpunit/phpunit/schema/8.5.xsd +++ b/api/vendor/phpunit/phpunit/schema/8.5.xsd @@ -244,7 +244,7 @@ - + @@ -309,8 +309,10 @@ - - + + + + diff --git a/api/vendor/phpunit/phpunit/schema/9.0.xsd b/api/vendor/phpunit/phpunit/schema/9.0.xsd new file mode 100644 index 0000000000..6db04c0978 --- /dev/null +++ b/api/vendor/phpunit/phpunit/schema/9.0.xsd @@ -0,0 +1,315 @@ + + + + + This Schema file defines the rules by which the XML configuration file of PHPUnit 9.0 may be structured. + + + + + + Root Element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The main type specifying the document structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/vendor/phpunit/phpunit/schema/9.1.xsd b/api/vendor/phpunit/phpunit/schema/9.1.xsd new file mode 100644 index 0000000000..b10d30b461 --- /dev/null +++ b/api/vendor/phpunit/phpunit/schema/9.1.xsd @@ -0,0 +1,317 @@ + + + + + This Schema file defines the rules by which the XML configuration file of PHPUnit 9.0 may be structured. + + + + + + Root Element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The main type specifying the document structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/vendor/phpunit/phpunit/schema/9.2.xsd b/api/vendor/phpunit/phpunit/schema/9.2.xsd index 883f21bc0d..d770e8b03b 100644 --- a/api/vendor/phpunit/phpunit/schema/9.2.xsd +++ b/api/vendor/phpunit/phpunit/schema/9.2.xsd @@ -163,7 +163,7 @@ - + @@ -248,7 +248,7 @@ - + @@ -282,7 +282,7 @@ - + @@ -310,7 +310,7 @@ - + diff --git a/api/vendor/phpunit/phpunit/schema/9.3.xsd b/api/vendor/phpunit/phpunit/schema/9.3.xsd new file mode 100644 index 0000000000..638f663ac7 --- /dev/null +++ b/api/vendor/phpunit/phpunit/schema/9.3.xsd @@ -0,0 +1,327 @@ + + + + + This Schema file defines the rules by which the XML configuration file of PHPUnit 9.3 may be structured. + + + + + + Root Element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The main type specifying the document structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/vendor/phpunit/phpunit/schema/9.4.xsd b/api/vendor/phpunit/phpunit/schema/9.4.xsd new file mode 100644 index 0000000000..75a91e832f --- /dev/null +++ b/api/vendor/phpunit/phpunit/schema/9.4.xsd @@ -0,0 +1,328 @@ + + + + + This Schema file defines the rules by which the XML configuration file of PHPUnit 9.4 may be structured. + + + + + + Root Element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The main type specifying the document structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/vendor/phpunit/phpunit/schema/9.5.xsd b/api/vendor/phpunit/phpunit/schema/9.5.xsd new file mode 100644 index 0000000000..eabefac30b --- /dev/null +++ b/api/vendor/phpunit/phpunit/schema/9.5.xsd @@ -0,0 +1,330 @@ + + + + + This Schema file defines the rules by which the XML configuration file of PHPUnit 9.5 may be structured. + + + + + + Root Element + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The main type specifying the document structure + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/vendor/phpunit/phpunit/src/Framework/Assert.php b/api/vendor/phpunit/phpunit/src/Framework/Assert.php index 97321e35f5..ea8f17d285 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Assert.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Assert.php @@ -37,6 +37,7 @@ use DOMAttr; use DOMDocument; use DOMElement; +use Generator; use PHPUnit\Framework\Constraint\ArrayHasKey; use PHPUnit\Framework\Constraint\Callback; use PHPUnit\Framework\Constraint\ClassHasAttribute; @@ -72,6 +73,7 @@ use PHPUnit\Framework\Constraint\LogicalXor; use PHPUnit\Framework\Constraint\ObjectEquals; use PHPUnit\Framework\Constraint\ObjectHasAttribute; +use PHPUnit\Framework\Constraint\ObjectHasProperty; use PHPUnit\Framework\Constraint\RegularExpression; use PHPUnit\Framework\Constraint\SameSize; use PHPUnit\Framework\Constraint\StringContains; @@ -110,14 +112,14 @@ public static function assertArrayHasKey($key, $array, string $message = ''): vo if (!(is_int($key) || is_string($key))) { throw InvalidArgumentException::create( 1, - 'integer or string' + 'integer or string', ); } if (!(is_array($array) || $array instanceof ArrayAccess)) { throw InvalidArgumentException::create( 2, - 'array or ArrayAccess' + 'array or ArrayAccess', ); } @@ -141,19 +143,19 @@ public static function assertArrayNotHasKey($key, $array, string $message = ''): if (!(is_int($key) || is_string($key))) { throw InvalidArgumentException::create( 1, - 'integer or string' + 'integer or string', ); } if (!(is_array($array) || $array instanceof ArrayAccess)) { throw InvalidArgumentException::create( 2, - 'array or ArrayAccess' + 'array or ArrayAccess', ); } $constraint = new LogicalNot( - new ArrayHasKey($key) + new ArrayHasKey($key), ); static::assertThat($array, $constraint, $message); @@ -190,7 +192,7 @@ public static function assertContainsEquals($needle, iterable $haystack, string public static function assertNotContains($needle, iterable $haystack, string $message = ''): void { $constraint = new LogicalNot( - new TraversableContainsIdentical($needle) + new TraversableContainsIdentical($needle), ); static::assertThat($haystack, $constraint, $message); @@ -219,9 +221,9 @@ public static function assertContainsOnly(string $type, iterable $haystack, ?boo $haystack, new TraversableContainsOnly( $type, - $isNativeType + $isNativeType, ), - $message + $message, ); } @@ -237,9 +239,9 @@ public static function assertContainsOnlyInstancesOf(string $className, iterable $haystack, new TraversableContainsOnly( $className, - false + false, ), - $message + $message, ); } @@ -260,10 +262,10 @@ public static function assertNotContainsOnly(string $type, iterable $haystack, ? new LogicalNot( new TraversableContainsOnly( $type, - $isNativeType - ) + $isNativeType, + ), ), - $message + $message, ); } @@ -278,6 +280,10 @@ public static function assertNotContainsOnly(string $type, iterable $haystack, ? */ public static function assertCount(int $expectedCount, $haystack, string $message = ''): void { + if ($haystack instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $haystack parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + if (!$haystack instanceof Countable && !is_iterable($haystack)) { throw InvalidArgumentException::create(2, 'countable or iterable'); } @@ -285,7 +291,7 @@ public static function assertCount(int $expectedCount, $haystack, string $messag static::assertThat( $haystack, new Count($expectedCount), - $message + $message, ); } @@ -300,12 +306,16 @@ public static function assertCount(int $expectedCount, $haystack, string $messag */ public static function assertNotCount(int $expectedCount, $haystack, string $message = ''): void { + if ($haystack instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $haystack parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + if (!$haystack instanceof Countable && !is_iterable($haystack)) { throw InvalidArgumentException::create(2, 'countable or iterable'); } $constraint = new LogicalNot( - new Count($expectedCount) + new Count($expectedCount), ); static::assertThat($haystack, $constraint, $message); @@ -360,7 +370,7 @@ public static function assertEqualsWithDelta($expected, $actual, float $delta, s { $constraint = new IsEqualWithDelta( $expected, - $delta + $delta, ); static::assertThat($actual, $constraint, $message); @@ -375,7 +385,7 @@ public static function assertEqualsWithDelta($expected, $actual, float $delta, s public static function assertNotEquals($expected, $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqual($expected) + new IsEqual($expected), ); static::assertThat($actual, $constraint, $message); @@ -390,7 +400,7 @@ public static function assertNotEquals($expected, $actual, string $message = '') public static function assertNotEqualsCanonicalizing($expected, $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqualCanonicalizing($expected) + new IsEqualCanonicalizing($expected), ); static::assertThat($actual, $constraint, $message); @@ -405,7 +415,7 @@ public static function assertNotEqualsCanonicalizing($expected, $actual, string public static function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): void { $constraint = new LogicalNot( - new IsEqualIgnoringCase($expected) + new IsEqualIgnoringCase($expected), ); static::assertThat($actual, $constraint, $message); @@ -422,8 +432,8 @@ public static function assertNotEqualsWithDelta($expected, $actual, float $delta $constraint = new LogicalNot( new IsEqualWithDelta( $expected, - $delta - ) + $delta, + ), ); static::assertThat($actual, $constraint, $message); @@ -437,7 +447,7 @@ public static function assertObjectEquals(object $expected, object $actual, stri static::assertThat( $actual, static::objectEquals($expected, $method), - $message + $message, ); } @@ -451,6 +461,10 @@ public static function assertObjectEquals(object $expected, object $actual, stri */ public static function assertEmpty($actual, string $message = ''): void { + if ($actual instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $actual parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + static::assertThat($actual, static::isEmpty(), $message); } @@ -464,6 +478,10 @@ public static function assertEmpty($actual, string $message = ''): void */ public static function assertNotEmpty($actual, string $message = ''): void { + if ($actual instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $actual parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + static::assertThat($actual, static::logicalNot(static::isEmpty()), $message); } @@ -489,7 +507,7 @@ public static function assertGreaterThanOrEqual($expected, $actual, string $mess static::assertThat( $actual, static::greaterThanOrEqual($expected), - $message + $message, ); } @@ -545,7 +563,7 @@ public static function assertFileEqualsCanonicalizing(string $expected, string $ static::assertFileExists($actual, $message); $constraint = new IsEqualCanonicalizing( - file_get_contents($expected) + file_get_contents($expected), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -581,7 +599,7 @@ public static function assertFileNotEquals(string $expected, string $actual, str static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqual(file_get_contents($expected)) + new IsEqual(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -600,7 +618,7 @@ public static function assertFileNotEqualsCanonicalizing(string $expected, strin static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expected)) + new IsEqualCanonicalizing(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -619,7 +637,7 @@ public static function assertFileNotEqualsIgnoringCase(string $expected, string static::assertFileExists($actual, $message); $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expected)) + new IsEqualIgnoringCase(file_get_contents($expected)), ); static::assertThat(file_get_contents($actual), $constraint, $message); @@ -685,7 +703,7 @@ public static function assertStringNotEqualsFile(string $expectedFile, string $a static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqual(file_get_contents($expectedFile)) + new IsEqual(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -703,7 +721,7 @@ public static function assertStringNotEqualsFileCanonicalizing(string $expectedF static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqualCanonicalizing(file_get_contents($expectedFile)) + new IsEqualCanonicalizing(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -721,7 +739,7 @@ public static function assertStringNotEqualsFileIgnoringCase(string $expectedFil static::assertFileExists($expectedFile, $message); $constraint = new LogicalNot( - new IsEqualIgnoringCase(file_get_contents($expectedFile)) + new IsEqualIgnoringCase(file_get_contents($expectedFile)), ); static::assertThat($actualString, $constraint, $message); @@ -1168,9 +1186,13 @@ public static function assertNan($actual, string $message = ''): void * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ public static function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void { + self::createWarning('assertClassHasAttribute() is deprecated and will be removed in PHPUnit 10.'); + if (!self::isValidClassAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); } @@ -1188,9 +1210,13 @@ public static function assertClassHasAttribute(string $attributeName, string $cl * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ public static function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void { + self::createWarning('assertClassNotHasAttribute() is deprecated and will be removed in PHPUnit 10.'); + if (!self::isValidClassAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); } @@ -1202,9 +1228,9 @@ public static function assertClassNotHasAttribute(string $attributeName, string static::assertThat( $className, new LogicalNot( - new ClassHasAttribute($attributeName) + new ClassHasAttribute($attributeName), ), - $message + $message, ); } @@ -1214,9 +1240,13 @@ public static function assertClassNotHasAttribute(string $attributeName, string * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ public static function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void { + self::createWarning('assertClassHasStaticAttribute() is deprecated and will be removed in PHPUnit 10.'); + if (!self::isValidClassAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); } @@ -1228,7 +1258,7 @@ public static function assertClassHasStaticAttribute(string $attributeName, stri static::assertThat( $className, new ClassHasStaticAttribute($attributeName), - $message + $message, ); } @@ -1238,9 +1268,13 @@ public static function assertClassHasStaticAttribute(string $attributeName, stri * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ public static function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void { + self::createWarning('assertClassNotHasStaticAttribute() is deprecated and will be removed in PHPUnit 10.'); + if (!self::isValidClassAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); } @@ -1252,9 +1286,9 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s static::assertThat( $className, new LogicalNot( - new ClassHasStaticAttribute($attributeName) + new ClassHasStaticAttribute($attributeName), ), - $message + $message, ); } @@ -1266,9 +1300,13 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ public static function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void { + self::createWarning('assertObjectHasAttribute() is deprecated and will be removed in PHPUnit 10. Refactor your test to use assertObjectHasProperty() instead.'); + if (!self::isValidObjectAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); } @@ -1280,7 +1318,7 @@ public static function assertObjectHasAttribute(string $attributeName, $object, static::assertThat( $object, new ObjectHasAttribute($attributeName), - $message + $message, ); } @@ -1292,9 +1330,13 @@ public static function assertObjectHasAttribute(string $attributeName, $object, * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception * @throws ExpectationFailedException + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ public static function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void { + self::createWarning('assertObjectNotHasAttribute() is deprecated and will be removed in PHPUnit 10. Refactor your test to use assertObjectNotHasProperty() instead.'); + if (!self::isValidObjectAttributeName($attributeName)) { throw InvalidArgumentException::create(1, 'valid attribute name'); } @@ -1306,9 +1348,39 @@ public static function assertObjectNotHasAttribute(string $attributeName, $objec static::assertThat( $object, new LogicalNot( - new ObjectHasAttribute($attributeName) + new ObjectHasAttribute($attributeName), ), - $message + $message, + ); + } + + /** + * Asserts that an object has a specified property. + * + * @throws ExpectationFailedException + */ + final public static function assertObjectHasProperty(string $propertyName, object $object, string $message = ''): void + { + static::assertThat( + $object, + new ObjectHasProperty($propertyName), + $message, + ); + } + + /** + * Asserts that an object does not have a specified property. + * + * @throws ExpectationFailedException + */ + final public static function assertObjectNotHasProperty(string $propertyName, object $object, string $message = ''): void + { + static::assertThat( + $object, + new LogicalNot( + new ObjectHasProperty($propertyName), + ), + $message, ); } @@ -1331,7 +1403,7 @@ public static function assertSame($expected, $actual, string $message = ''): voi static::assertThat( $actual, new IsIdentical($expected), - $message + $message, ); } @@ -1352,9 +1424,9 @@ public static function assertNotSame($expected, $actual, string $message = ''): static::assertThat( $actual, new LogicalNot( - new IsIdentical($expected) + new IsIdentical($expected), ), - $message + $message, ); } @@ -1380,7 +1452,7 @@ public static function assertInstanceOf(string $expected, $actual, string $messa static::assertThat( $actual, new IsInstanceOf($expected), - $message + $message, ); } @@ -1406,9 +1478,9 @@ public static function assertNotInstanceOf(string $expected, $actual, string $me static::assertThat( $actual, new LogicalNot( - new IsInstanceOf($expected) + new IsInstanceOf($expected), ), - $message + $message, ); } @@ -1425,7 +1497,7 @@ public static function assertIsArray($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_ARRAY), - $message + $message, ); } @@ -1442,7 +1514,7 @@ public static function assertIsBool($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_BOOL), - $message + $message, ); } @@ -1459,7 +1531,7 @@ public static function assertIsFloat($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_FLOAT), - $message + $message, ); } @@ -1476,7 +1548,7 @@ public static function assertIsInt($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_INT), - $message + $message, ); } @@ -1493,7 +1565,7 @@ public static function assertIsNumeric($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_NUMERIC), - $message + $message, ); } @@ -1510,7 +1582,7 @@ public static function assertIsObject($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_OBJECT), - $message + $message, ); } @@ -1527,7 +1599,7 @@ public static function assertIsResource($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_RESOURCE), - $message + $message, ); } @@ -1544,7 +1616,7 @@ public static function assertIsClosedResource($actual, string $message = ''): vo static::assertThat( $actual, new IsType(IsType::TYPE_CLOSED_RESOURCE), - $message + $message, ); } @@ -1561,7 +1633,7 @@ public static function assertIsString($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_STRING), - $message + $message, ); } @@ -1578,7 +1650,7 @@ public static function assertIsScalar($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_SCALAR), - $message + $message, ); } @@ -1595,7 +1667,7 @@ public static function assertIsCallable($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_CALLABLE), - $message + $message, ); } @@ -1612,7 +1684,7 @@ public static function assertIsIterable($actual, string $message = ''): void static::assertThat( $actual, new IsType(IsType::TYPE_ITERABLE), - $message + $message, ); } @@ -1629,7 +1701,7 @@ public static function assertIsNotArray($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_ARRAY)), - $message + $message, ); } @@ -1646,7 +1718,7 @@ public static function assertIsNotBool($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_BOOL)), - $message + $message, ); } @@ -1663,7 +1735,7 @@ public static function assertIsNotFloat($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_FLOAT)), - $message + $message, ); } @@ -1680,7 +1752,7 @@ public static function assertIsNotInt($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_INT)), - $message + $message, ); } @@ -1697,7 +1769,7 @@ public static function assertIsNotNumeric($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_NUMERIC)), - $message + $message, ); } @@ -1714,7 +1786,7 @@ public static function assertIsNotObject($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_OBJECT)), - $message + $message, ); } @@ -1731,7 +1803,7 @@ public static function assertIsNotResource($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_RESOURCE)), - $message + $message, ); } @@ -1748,7 +1820,7 @@ public static function assertIsNotClosedResource($actual, string $message = ''): static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_CLOSED_RESOURCE)), - $message + $message, ); } @@ -1765,7 +1837,7 @@ public static function assertIsNotString($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_STRING)), - $message + $message, ); } @@ -1782,7 +1854,7 @@ public static function assertIsNotScalar($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_SCALAR)), - $message + $message, ); } @@ -1799,7 +1871,7 @@ public static function assertIsNotCallable($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_CALLABLE)), - $message + $message, ); } @@ -1816,7 +1888,7 @@ public static function assertIsNotIterable($actual, string $message = ''): void static::assertThat( $actual, new LogicalNot(new IsType(IsType::TYPE_ITERABLE)), - $message + $message, ); } @@ -1859,9 +1931,9 @@ public static function assertDoesNotMatchRegularExpression(string $pattern, stri static::assertThat( $string, new LogicalNot( - new RegularExpression($pattern) + new RegularExpression($pattern), ), - $message + $message, ); } @@ -1882,9 +1954,9 @@ public static function assertNotRegExp(string $pattern, string $string, string $ static::assertThat( $string, new LogicalNot( - new RegularExpression($pattern) + new RegularExpression($pattern), ), - $message + $message, ); } @@ -1901,6 +1973,14 @@ public static function assertNotRegExp(string $pattern, string $string, string $ */ public static function assertSameSize($expected, $actual, string $message = ''): void { + if ($expected instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $expected parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + + if ($actual instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $actual parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + if (!$expected instanceof Countable && !is_iterable($expected)) { throw InvalidArgumentException::create(1, 'countable or iterable'); } @@ -1912,7 +1992,7 @@ public static function assertSameSize($expected, $actual, string $message = ''): static::assertThat( $actual, new SameSize($expected), - $message + $message, ); } @@ -1929,6 +2009,14 @@ public static function assertSameSize($expected, $actual, string $message = ''): */ public static function assertNotSameSize($expected, $actual, string $message = ''): void { + if ($expected instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $expected parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + + if ($actual instanceof Generator) { + self::createWarning('Passing an argument of type Generator for the $actual parameter is deprecated. Support for this will be removed in PHPUnit 10.'); + } + if (!$expected instanceof Countable && !is_iterable($expected)) { throw InvalidArgumentException::create(1, 'countable or iterable'); } @@ -1940,9 +2028,9 @@ public static function assertNotSameSize($expected, $actual, string $message = ' static::assertThat( $actual, new LogicalNot( - new SameSize($expected) + new SameSize($expected), ), - $message + $message, ); } @@ -1968,9 +2056,9 @@ public static function assertStringNotMatchesFormat(string $format, string $stri static::assertThat( $string, new LogicalNot( - new StringMatchesFormatDescription($format) + new StringMatchesFormatDescription($format), ), - $message + $message, ); } @@ -1987,9 +2075,9 @@ public static function assertStringMatchesFormatFile(string $formatFile, string static::assertThat( $string, new StringMatchesFormatDescription( - file_get_contents($formatFile) + file_get_contents($formatFile), ), - $message + $message, ); } @@ -2007,10 +2095,10 @@ public static function assertStringNotMatchesFormatFile(string $formatFile, stri $string, new LogicalNot( new StringMatchesFormatDescription( - file_get_contents($formatFile) - ) + file_get_contents($formatFile), + ), ), - $message + $message, ); } @@ -2039,9 +2127,9 @@ public static function assertStringStartsNotWith($prefix, $string, string $messa static::assertThat( $string, new LogicalNot( - new StringStartsWith($prefix) + new StringStartsWith($prefix), ), - $message + $message, ); } @@ -2111,9 +2199,9 @@ public static function assertStringEndsNotWith(string $suffix, string $string, s static::assertThat( $string, new LogicalNot( - new StringEndsWith($suffix) + new StringEndsWith($suffix), ), - $message + $message, ); } @@ -2152,9 +2240,9 @@ public static function assertXmlFileNotEqualsXmlFile(string $expectedFile, strin * * @param DOMDocument|string $actualXml * - * @throws \PHPUnit\Util\Xml\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws Xml\Exception */ public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void { @@ -2176,9 +2264,9 @@ public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actua * * @param DOMDocument|string $actualXml * - * @throws \PHPUnit\Util\Xml\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws Xml\Exception */ public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void { @@ -2201,9 +2289,9 @@ public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $ac * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml * - * @throws \PHPUnit\Util\Xml\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws Xml\Exception */ public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = ''): void { @@ -2232,9 +2320,9 @@ public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml * - * @throws \PHPUnit\Util\Xml\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws Xml\Exception */ public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = ''): void { @@ -2278,7 +2366,7 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME static::assertSame( $expectedElement->tagName, $actualElement->tagName, - $message + $message, ); if ($checkAttributes) { @@ -2289,8 +2377,8 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME '%s%sNumber of attributes on node "%s" does not match', $message, !empty($message) ? "\n" : '', - $expectedElement->tagName - ) + $expectedElement->tagName, + ), ); for ($i = 0; $i < $expectedElement->attributes->length; $i++) { @@ -2306,8 +2394,8 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME $message, !empty($message) ? "\n" : '', $expectedAttribute->name, - $expectedElement->tagName - ) + $expectedElement->tagName, + ), ); } } @@ -2323,8 +2411,8 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME '%s%sNumber of child nodes of "%s" differs', $message, !empty($message) ? "\n" : '', - $expectedElement->tagName - ) + $expectedElement->tagName, + ), ); for ($i = 0; $i < $expectedElement->childNodes->length; $i++) { @@ -2332,7 +2420,7 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME $expectedElement->childNodes->item($i), $actualElement->childNodes->item($i), $checkAttributes, - $message + $message, ); } } @@ -2392,9 +2480,9 @@ public static function assertJsonStringNotEqualsJsonString($expectedJson, $actua static::assertThat( $actualJson, new LogicalNot( - new JsonMatches($expectedJson) + new JsonMatches($expectedJson), ), - $message + $message, ); } @@ -2432,9 +2520,9 @@ public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, s static::assertThat( $actualJson, new LogicalNot( - new JsonMatches($expectedJson) + new JsonMatches($expectedJson), ), - $message + $message, ); } @@ -2456,7 +2544,7 @@ public static function assertJsonFileEqualsJsonFile(string $expectedFile, string static::assertJson($actualJson, $message); $constraintExpected = new JsonMatches( - $expectedJson + $expectedJson, ); $constraintActual = new JsonMatches($actualJson); @@ -2483,7 +2571,7 @@ public static function assertJsonFileNotEqualsJsonFile(string $expectedFile, str static::assertJson($actualJson, $message); $constraintExpected = new JsonMatches( - $expectedJson + $expectedJson, ); $constraintActual = new JsonMatches($actualJson); @@ -2664,22 +2752,37 @@ public static function greaterThanOrEqual($value): LogicalOr { return static::logicalOr( new IsEqual($value), - new GreaterThan($value) + new GreaterThan($value), ); } + /** + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 + */ public static function classHasAttribute(string $attributeName): ClassHasAttribute { + self::createWarning('classHasAttribute() is deprecated and will be removed in PHPUnit 10.'); + return new ClassHasAttribute($attributeName); } + /** + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 + */ public static function classHasStaticAttribute(string $attributeName): ClassHasStaticAttribute { + self::createWarning('classHasStaticAttribute() is deprecated and will be removed in PHPUnit 10.'); + return new ClassHasStaticAttribute($attributeName); } + /** + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 + */ public static function objectHasAttribute($attributeName): ObjectHasAttribute { + self::createWarning('objectHasAttribute() is deprecated and will be removed in PHPUnit 10.'); + return new ObjectHasAttribute($attributeName); } @@ -2707,7 +2810,7 @@ public static function lessThanOrEqual($value): LogicalOr { return static::logicalOr( new IsEqual($value), - new LessThan($value) + new LessThan($value), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php b/api/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php index 5b8c50ed98..5b6cc850c3 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Assert/Functions.php @@ -70,6 +70,7 @@ use PHPUnit\Framework\MockObject\Stub\ReturnSelf as ReturnSelfStub; use PHPUnit\Framework\MockObject\Stub\ReturnStub; use PHPUnit\Framework\MockObject\Stub\ReturnValueMap as ReturnValueMapStub; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use Throwable; if (!function_exists('PHPUnit\Framework\assertArrayHasKey')) { @@ -80,7 +81,7 @@ * @param array|ArrayAccess $array * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -101,7 +102,7 @@ function assertArrayHasKey($key, $array, string $message = ''): void * @param array|ArrayAccess $array * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -119,7 +120,7 @@ function assertArrayNotHasKey($key, $array, string $message = ''): void * Asserts that a haystack contains a needle. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -144,7 +145,7 @@ function assertContainsEquals($needle, iterable $haystack, string $message = '') * Asserts that a haystack does not contain a needle. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -169,7 +170,7 @@ function assertNotContainsEquals($needle, iterable $haystack, string $message = * Asserts that a haystack contains only values of a given type. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -186,7 +187,7 @@ function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeTyp * Asserts that a haystack contains only instances of a given class name. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -203,7 +204,7 @@ function assertContainsOnlyInstancesOf(string $className, iterable $haystack, st * Asserts that a haystack does not contain only values of a given type. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -222,7 +223,7 @@ function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNative * @param Countable|iterable $haystack * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -242,7 +243,7 @@ function assertCount(int $expectedCount, $haystack, string $message = ''): void * @param Countable|iterable $haystack * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -260,7 +261,7 @@ function assertNotCount(int $expectedCount, $haystack, string $message = ''): vo * Asserts that two variables are equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -277,7 +278,7 @@ function assertEquals($expected, $actual, string $message = ''): void * Asserts that two variables are equal (canonicalizing). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -294,7 +295,7 @@ function assertEqualsCanonicalizing($expected, $actual, string $message = ''): v * Asserts that two variables are equal (ignoring case). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -311,7 +312,7 @@ function assertEqualsIgnoringCase($expected, $actual, string $message = ''): voi * Asserts that two variables are equal (with delta). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -328,7 +329,7 @@ function assertEqualsWithDelta($expected, $actual, float $delta, string $message * Asserts that two variables are not equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -345,7 +346,7 @@ function assertNotEquals($expected, $actual, string $message = ''): void * Asserts that two variables are not equal (canonicalizing). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -362,7 +363,7 @@ function assertNotEqualsCanonicalizing($expected, $actual, string $message = '') * Asserts that two variables are not equal (ignoring case). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -379,7 +380,7 @@ function assertNotEqualsIgnoringCase($expected, $actual, string $message = ''): * Asserts that two variables are not equal (with delta). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -410,7 +411,7 @@ function assertObjectEquals(object $expected, object $actual, string $method = ' * Asserts that a variable is empty. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert empty $actual * @@ -429,7 +430,7 @@ function assertEmpty($actual, string $message = ''): void * Asserts that a variable is not empty. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !empty $actual * @@ -448,7 +449,7 @@ function assertNotEmpty($actual, string $message = ''): void * Asserts that a value is greater than another value. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -465,7 +466,7 @@ function assertGreaterThan($expected, $actual, string $message = ''): void * Asserts that a value is greater than or equal to another value. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -482,7 +483,7 @@ function assertGreaterThanOrEqual($expected, $actual, string $message = ''): voi * Asserts that a value is smaller than another value. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -499,7 +500,7 @@ function assertLessThan($expected, $actual, string $message = ''): void * Asserts that a value is smaller than or equal to another value. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -517,7 +518,7 @@ function assertLessThanOrEqual($expected, $actual, string $message = ''): void * file. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -535,7 +536,7 @@ function assertFileEquals(string $expected, string $actual, string $message = '' * file (canonicalizing). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -553,7 +554,7 @@ function assertFileEqualsCanonicalizing(string $expected, string $actual, string * file (ignoring case). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -571,7 +572,7 @@ function assertFileEqualsIgnoringCase(string $expected, string $actual, string $ * another file. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -589,7 +590,7 @@ function assertFileNotEquals(string $expected, string $actual, string $message = * file (canonicalizing). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -607,7 +608,7 @@ function assertFileNotEqualsCanonicalizing(string $expected, string $actual, str * file (ignoring case). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -625,7 +626,7 @@ function assertFileNotEqualsIgnoringCase(string $expected, string $actual, strin * to the contents of a file. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -643,7 +644,7 @@ function assertStringEqualsFile(string $expectedFile, string $actualString, stri * to the contents of a file (canonicalizing). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -661,7 +662,7 @@ function assertStringEqualsFileCanonicalizing(string $expectedFile, string $actu * to the contents of a file (ignoring case). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -679,7 +680,7 @@ function assertStringEqualsFileIgnoringCase(string $expectedFile, string $actual * to the contents of a file. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -697,7 +698,7 @@ function assertStringNotEqualsFile(string $expectedFile, string $actualString, s * to the contents of a file (canonicalizing). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -715,7 +716,7 @@ function assertStringNotEqualsFileCanonicalizing(string $expectedFile, string $a * to the contents of a file (ignoring case). * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -732,7 +733,7 @@ function assertStringNotEqualsFileIgnoringCase(string $expectedFile, string $act * Asserts that a file/dir is readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -749,7 +750,7 @@ function assertIsReadable(string $filename, string $message = ''): void * Asserts that a file/dir exists and is not readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -766,7 +767,7 @@ function assertIsNotReadable(string $filename, string $message = ''): void * Asserts that a file/dir exists and is not readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -787,7 +788,7 @@ function assertNotIsReadable(string $filename, string $message = ''): void * Asserts that a file/dir exists and is writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -804,7 +805,7 @@ function assertIsWritable(string $filename, string $message = ''): void * Asserts that a file/dir exists and is not writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -821,7 +822,7 @@ function assertIsNotWritable(string $filename, string $message = ''): void * Asserts that a file/dir exists and is not writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -842,7 +843,7 @@ function assertNotIsWritable(string $filename, string $message = ''): void * Asserts that a directory exists. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -859,7 +860,7 @@ function assertDirectoryExists(string $directory, string $message = ''): void * Asserts that a directory does not exist. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -876,7 +877,7 @@ function assertDirectoryDoesNotExist(string $directory, string $message = ''): v * Asserts that a directory does not exist. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -897,7 +898,7 @@ function assertDirectoryNotExists(string $directory, string $message = ''): void * Asserts that a directory exists and is readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -914,7 +915,7 @@ function assertDirectoryIsReadable(string $directory, string $message = ''): voi * Asserts that a directory exists and is not readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -931,7 +932,7 @@ function assertDirectoryIsNotReadable(string $directory, string $message = ''): * Asserts that a directory exists and is not readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -952,7 +953,7 @@ function assertDirectoryNotIsReadable(string $directory, string $message = ''): * Asserts that a directory exists and is writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -969,7 +970,7 @@ function assertDirectoryIsWritable(string $directory, string $message = ''): voi * Asserts that a directory exists and is not writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -986,7 +987,7 @@ function assertDirectoryIsNotWritable(string $directory, string $message = ''): * Asserts that a directory exists and is not writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -1007,7 +1008,7 @@ function assertDirectoryNotIsWritable(string $directory, string $message = ''): * Asserts that a file exists. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1024,7 +1025,7 @@ function assertFileExists(string $filename, string $message = ''): void * Asserts that a file does not exist. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1041,7 +1042,7 @@ function assertFileDoesNotExist(string $filename, string $message = ''): void * Asserts that a file does not exist. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -1062,7 +1063,7 @@ function assertFileNotExists(string $filename, string $message = ''): void * Asserts that a file exists and is readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1079,7 +1080,7 @@ function assertFileIsReadable(string $file, string $message = ''): void * Asserts that a file exists and is not readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1096,7 +1097,7 @@ function assertFileIsNotReadable(string $file, string $message = ''): void * Asserts that a file exists and is not readable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -1117,7 +1118,7 @@ function assertFileNotIsReadable(string $file, string $message = ''): void * Asserts that a file exists and is writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1134,7 +1135,7 @@ function assertFileIsWritable(string $file, string $message = ''): void * Asserts that a file exists and is not writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1151,7 +1152,7 @@ function assertFileIsNotWritable(string $file, string $message = ''): void * Asserts that a file exists and is not writable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -1172,7 +1173,7 @@ function assertFileNotIsWritable(string $file, string $message = ''): void * Asserts that a condition is true. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert true $condition * @@ -1191,7 +1192,7 @@ function assertTrue($condition, string $message = ''): void * Asserts that a condition is not true. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !true $condition * @@ -1210,7 +1211,7 @@ function assertNotTrue($condition, string $message = ''): void * Asserts that a condition is false. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert false $condition * @@ -1229,7 +1230,7 @@ function assertFalse($condition, string $message = ''): void * Asserts that a condition is not false. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !false $condition * @@ -1248,7 +1249,7 @@ function assertNotFalse($condition, string $message = ''): void * Asserts that a variable is null. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert null $actual * @@ -1267,7 +1268,7 @@ function assertNull($actual, string $message = ''): void * Asserts that a variable is not null. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !null $actual * @@ -1286,7 +1287,7 @@ function assertNotNull($actual, string $message = ''): void * Asserts that a variable is finite. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1303,7 +1304,7 @@ function assertFinite($actual, string $message = ''): void * Asserts that a variable is infinite. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1320,7 +1321,7 @@ function assertInfinite($actual, string $message = ''): void * Asserts that a variable is nan. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1337,7 +1338,7 @@ function assertNan($actual, string $message = ''): void * Asserts that a class has a specified attribute. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1355,7 +1356,7 @@ function assertClassHasAttribute(string $attributeName, string $className, strin * Asserts that a class does not have a specified attribute. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1373,7 +1374,7 @@ function assertClassNotHasAttribute(string $attributeName, string $className, st * Asserts that a class has a specified static attribute. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1391,7 +1392,7 @@ function assertClassHasStaticAttribute(string $attributeName, string $className, * Asserts that a class does not have a specified static attribute. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1411,7 +1412,7 @@ function assertClassNotHasStaticAttribute(string $attributeName, string $classNa * @param object $object * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1431,7 +1432,7 @@ function assertObjectHasAttribute(string $attributeName, $object, string $messag * @param object $object * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -1444,6 +1445,42 @@ function assertObjectNotHasAttribute(string $attributeName, $object, string $mes } } +if (!function_exists('PHPUnit\Framework\assertObjectHasProperty')) { + /** + * Asserts that an object has a specified property. + * + * @throws ExpectationFailedException + * @throws InvalidArgumentException + * @throws Exception + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @see Assert::assertObjectHasProperty + */ + function assertObjectHasProperty(string $attributeName, object $object, string $message = ''): void + { + Assert::assertObjectHasProperty(...func_get_args()); + } +} + +if (!function_exists('PHPUnit\Framework\assertObjectNotHasProperty')) { + /** + * Asserts that an object does not have a specified property. + * + * @throws ExpectationFailedException + * @throws InvalidArgumentException + * @throws Exception + * + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @see Assert::assertObjectNotHasProperty + */ + function assertObjectNotHasProperty(string $attributeName, object $object, string $message = ''): void + { + Assert::assertObjectNotHasProperty(...func_get_args()); + } +} + if (!function_exists('PHPUnit\Framework\assertSame')) { /** * Asserts that two variables have the same type and value. @@ -1451,7 +1488,7 @@ function assertObjectNotHasAttribute(string $attributeName, $object, string $mes * the same object. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-template ExpectedType * @@ -1476,7 +1513,7 @@ function assertSame($expected, $actual, string $message = ''): void * the same object. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -1493,7 +1530,7 @@ function assertNotSame($expected, $actual, string $message = ''): void * Asserts that a variable is of a given type. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @psalm-template ExpectedType of object @@ -1517,7 +1554,7 @@ function assertInstanceOf(string $expected, $actual, string $message = ''): void * Asserts that a variable is not of a given type. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @psalm-template ExpectedType of object @@ -1541,7 +1578,7 @@ function assertNotInstanceOf(string $expected, $actual, string $message = ''): v * Asserts that a variable is of type array. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert array $actual * @@ -1560,7 +1597,7 @@ function assertIsArray($actual, string $message = ''): void * Asserts that a variable is of type bool. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert bool $actual * @@ -1579,7 +1616,7 @@ function assertIsBool($actual, string $message = ''): void * Asserts that a variable is of type float. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert float $actual * @@ -1598,7 +1635,7 @@ function assertIsFloat($actual, string $message = ''): void * Asserts that a variable is of type int. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert int $actual * @@ -1617,7 +1654,7 @@ function assertIsInt($actual, string $message = ''): void * Asserts that a variable is of type numeric. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert numeric $actual * @@ -1636,7 +1673,7 @@ function assertIsNumeric($actual, string $message = ''): void * Asserts that a variable is of type object. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert object $actual * @@ -1655,7 +1692,7 @@ function assertIsObject($actual, string $message = ''): void * Asserts that a variable is of type resource. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert resource $actual * @@ -1674,7 +1711,7 @@ function assertIsResource($actual, string $message = ''): void * Asserts that a variable is of type resource and is closed. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert resource $actual * @@ -1693,7 +1730,7 @@ function assertIsClosedResource($actual, string $message = ''): void * Asserts that a variable is of type string. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert string $actual * @@ -1712,7 +1749,7 @@ function assertIsString($actual, string $message = ''): void * Asserts that a variable is of type scalar. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert scalar $actual * @@ -1731,7 +1768,7 @@ function assertIsScalar($actual, string $message = ''): void * Asserts that a variable is of type callable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert callable $actual * @@ -1750,7 +1787,7 @@ function assertIsCallable($actual, string $message = ''): void * Asserts that a variable is of type iterable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert iterable $actual * @@ -1769,7 +1806,7 @@ function assertIsIterable($actual, string $message = ''): void * Asserts that a variable is not of type array. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !array $actual * @@ -1788,7 +1825,7 @@ function assertIsNotArray($actual, string $message = ''): void * Asserts that a variable is not of type bool. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !bool $actual * @@ -1807,7 +1844,7 @@ function assertIsNotBool($actual, string $message = ''): void * Asserts that a variable is not of type float. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !float $actual * @@ -1826,7 +1863,7 @@ function assertIsNotFloat($actual, string $message = ''): void * Asserts that a variable is not of type int. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !int $actual * @@ -1845,7 +1882,7 @@ function assertIsNotInt($actual, string $message = ''): void * Asserts that a variable is not of type numeric. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !numeric $actual * @@ -1864,7 +1901,7 @@ function assertIsNotNumeric($actual, string $message = ''): void * Asserts that a variable is not of type object. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !object $actual * @@ -1883,7 +1920,7 @@ function assertIsNotObject($actual, string $message = ''): void * Asserts that a variable is not of type resource. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !resource $actual * @@ -1902,7 +1939,7 @@ function assertIsNotResource($actual, string $message = ''): void * Asserts that a variable is not of type resource. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !resource $actual * @@ -1921,7 +1958,7 @@ function assertIsNotClosedResource($actual, string $message = ''): void * Asserts that a variable is not of type string. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !string $actual * @@ -1940,7 +1977,7 @@ function assertIsNotString($actual, string $message = ''): void * Asserts that a variable is not of type scalar. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !scalar $actual * @@ -1959,7 +1996,7 @@ function assertIsNotScalar($actual, string $message = ''): void * Asserts that a variable is not of type callable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !callable $actual * @@ -1978,7 +2015,7 @@ function assertIsNotCallable($actual, string $message = ''): void * Asserts that a variable is not of type iterable. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @psalm-assert !iterable $actual * @@ -1997,7 +2034,7 @@ function assertIsNotIterable($actual, string $message = ''): void * Asserts that a string matches a given regular expression. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2014,7 +2051,7 @@ function assertMatchesRegularExpression(string $pattern, string $string, string * Asserts that a string matches a given regular expression. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -2035,7 +2072,7 @@ function assertRegExp(string $pattern, string $string, string $message = ''): vo * Asserts that a string does not match a given regular expression. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2052,7 +2089,7 @@ function assertDoesNotMatchRegularExpression(string $pattern, string $string, st * Asserts that a string does not match a given regular expression. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -2077,7 +2114,7 @@ function assertNotRegExp(string $pattern, string $string, string $message = ''): * @param Countable|iterable $actual * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2099,7 +2136,7 @@ function assertSameSize($expected, $actual, string $message = ''): void * @param Countable|iterable $actual * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2117,7 +2154,7 @@ function assertNotSameSize($expected, $actual, string $message = ''): void * Asserts that a string matches a given format string. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2134,7 +2171,7 @@ function assertStringMatchesFormat(string $format, string $string, string $messa * Asserts that a string does not match a given format string. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2151,7 +2188,7 @@ function assertStringNotMatchesFormat(string $format, string $string, string $me * Asserts that a string matches a given format file. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2168,7 +2205,7 @@ function assertStringMatchesFormatFile(string $formatFile, string $string, strin * Asserts that a string does not match a given format string. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2185,7 +2222,7 @@ function assertStringNotMatchesFormatFile(string $formatFile, string $string, st * Asserts that a string starts with a given prefix. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2205,7 +2242,7 @@ function assertStringStartsWith(string $prefix, string $string, string $message * @param string $string * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2220,7 +2257,7 @@ function assertStringStartsNotWith($prefix, $string, string $message = ''): void if (!function_exists('PHPUnit\Framework\assertStringContainsString')) { /** * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2235,7 +2272,7 @@ function assertStringContainsString(string $needle, string $haystack, string $me if (!function_exists('PHPUnit\Framework\assertStringContainsStringIgnoringCase')) { /** * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2250,7 +2287,7 @@ function assertStringContainsStringIgnoringCase(string $needle, string $haystack if (!function_exists('PHPUnit\Framework\assertStringNotContainsString')) { /** * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2265,7 +2302,7 @@ function assertStringNotContainsString(string $needle, string $haystack, string if (!function_exists('PHPUnit\Framework\assertStringNotContainsStringIgnoringCase')) { /** * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2282,7 +2319,7 @@ function assertStringNotContainsStringIgnoringCase(string $needle, string $hayst * Asserts that a string ends with a given suffix. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2299,7 +2336,7 @@ function assertStringEndsWith(string $suffix, string $string, string $message = * Asserts that a string ends not with a given suffix. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2316,7 +2353,7 @@ function assertStringEndsNotWith(string $suffix, string $string, string $message * Asserts that two XML files are equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2334,7 +2371,7 @@ function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, st * Asserts that two XML files are not equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws \PHPUnit\Util\Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2354,7 +2391,7 @@ function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, * @param DOMDocument|string $actualXml * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2374,7 +2411,7 @@ function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $ * @param DOMDocument|string $actualXml * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2395,7 +2432,7 @@ function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, strin * @param DOMDocument|string $actualXml * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2416,7 +2453,7 @@ function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $messag * @param DOMDocument|string $actualXml * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws \PHPUnit\Util\Xml\Exception * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -2435,7 +2472,7 @@ function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $mes * * @throws AssertionFailedError * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @codeCoverageIgnore * @@ -2456,7 +2493,7 @@ function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actual * Evaluates a PHPUnit\Framework\Constraint matcher object. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2473,7 +2510,7 @@ function assertThat($value, Constraint $constraint, string $message = ''): void * Asserts that a string is a valid JSON string. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2490,7 +2527,7 @@ function assertJson(string $actualJson, string $message = ''): void * Asserts that two given JSON encoded objects or arrays are equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2510,7 +2547,7 @@ function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJs * @param string $actualJson * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2527,7 +2564,7 @@ function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string * Asserts that the generated JSON encoded object and the content of the given file are equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2544,7 +2581,7 @@ function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson * Asserts that the generated JSON encoded object and the content of the given file are not equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2561,7 +2598,7 @@ function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJ * Asserts that two JSON files are equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2578,7 +2615,7 @@ function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, * Asserts that two JSON files are not equal. * * @throws ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit * @@ -2927,7 +2964,7 @@ function never(): InvokedCountMatcher function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher { return new InvokedAtLeastCountMatcher( - $requiredInvocations + $requiredInvocations, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php index 8e27fbfd41..ff04a69812 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/Count.php @@ -40,7 +40,7 @@ public function toString(): string { return sprintf( 'count matches %d', - $this->expectedCount + $this->expectedCount, ); } @@ -76,7 +76,7 @@ protected function getCountOf($other): ?int throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } } @@ -136,7 +136,7 @@ protected function failureDescription($other): string return sprintf( 'actual size %d matches expected size %d', (int) $this->getCountOf($other), - $this->expectedCount + $this->expectedCount, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php index 31df502017..7d079f5087 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/GreaterThan.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Framework\Constraint; +use SebastianBergmann\RecursionContext\InvalidArgumentException; + /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ @@ -30,7 +32,7 @@ public function __construct($value) /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php index e6371d536c..ee01e93da2 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/IsEmpty.php @@ -64,7 +64,7 @@ protected function failureDescription($other): string '%s %s %s', strpos($type, 'a') === 0 || strpos($type, 'o') === 0 ? 'an' : 'a', $type, - $this->toString() + $this->toString(), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php index c7884ba1d2..4d0184a256 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Cardinality/LessThan.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Framework\Constraint; +use SebastianBergmann\RecursionContext\InvalidArgumentException; + /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ @@ -30,7 +32,7 @@ public function __construct($value) /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php index 5f772b4d18..2ee73973c8 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php @@ -15,6 +15,7 @@ use PHPUnit\Framework\SelfDescribing; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Exporter\Exporter; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -36,8 +37,8 @@ abstract class Constraint implements Countable, SelfDescribing * a boolean value instead: true in case of success, false in case of a * failure. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException */ public function evaluate($other, string $description = '', bool $returnResult = false): ?bool { @@ -93,20 +94,19 @@ protected function matches($other): bool /** * Throws an exception for the given compared value and test description. * - * @param mixed $other evaluated value or object - * @param string $description Additional information about the test - * @param ComparisonFailure $comparisonFailure + * @param mixed $other evaluated value or object + * @param string $description Additional information about the test * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException * * @psalm-return never-return */ - protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void + protected function fail($other, $description, ?ComparisonFailure $comparisonFailure = null): void { $failureDescription = sprintf( 'Failed asserting that %s.', - $this->failureDescription($other) + $this->failureDescription($other), ); $additionalFailureDescription = $this->additionalFailureDescription($other); @@ -121,7 +121,7 @@ protected function fail($other, $description, ComparisonFailure $comparisonFailu throw new ExpectationFailedException( $failureDescription, - $comparisonFailure + $comparisonFailure, ); } @@ -149,7 +149,7 @@ protected function additionalFailureDescription($other): string * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php index 6a61ebfba9..04bfe4e862 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\ExpectationFailedException; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -61,8 +62,6 @@ public function __construct($value, float $delta = 0.0, bool $canonicalize = fal * failure. * * @throws ExpectationFailedException - * - * @return bool */ public function evaluate($other, string $description = '', bool $returnResult = false): ?bool { @@ -78,7 +77,7 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -86,7 +85,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $other, $this->delta, $this->canonicalize, - $this->ignoreCase + $this->ignoreCase, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -95,7 +94,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -105,7 +104,7 @@ public function evaluate($other, string $description = '', bool $returnResult = /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { @@ -118,21 +117,21 @@ public function toString(): string return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } if ($this->delta != 0) { $delta = sprintf( ' with delta <%F>', - $this->delta + $this->delta, ); } return sprintf( 'is equal to %s%s', $this->exporter()->export($this->value), - $delta + $delta, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php index 57bb91ca1f..6d49c350e0 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualCanonicalizing.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\ExpectationFailedException; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -58,7 +59,7 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -66,7 +67,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $other, 0.0, true, - false + false, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -75,7 +76,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -85,7 +86,7 @@ public function evaluate($other, string $description = '', bool $returnResult = /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { @@ -96,13 +97,13 @@ public function toString(): string return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } return sprintf( 'is equal to %s', - $this->exporter()->export($this->value) + $this->exporter()->export($this->value), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php index d657e96a22..932b7318d1 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualIgnoringCase.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\ExpectationFailedException; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -58,7 +59,7 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( @@ -66,7 +67,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $other, 0.0, false, - true + true, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -75,7 +76,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -85,7 +86,7 @@ public function evaluate($other, string $description = '', bool $returnResult = /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { @@ -96,13 +97,13 @@ public function toString(): string return sprintf( "is equal to '%s'", - $this->value + $this->value, ); } return sprintf( 'is equal to %s', - $this->exporter()->export($this->value) + $this->exporter()->export($this->value), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php index 0370b5118f..0a04ffc8bf 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqualWithDelta.php @@ -14,6 +14,7 @@ use PHPUnit\Framework\ExpectationFailedException; use SebastianBergmann\Comparator\ComparisonFailure; use SebastianBergmann\Comparator\Factory as ComparatorFactory; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -62,13 +63,13 @@ public function evaluate($other, string $description = '', bool $returnResult = try { $comparator = $comparatorFactory->getComparatorFor( $this->value, - $other + $other, ); $comparator->assertEquals( $this->value, $other, - $this->delta + $this->delta, ); } catch (ComparisonFailure $f) { if ($returnResult) { @@ -77,7 +78,7 @@ public function evaluate($other, string $description = '', bool $returnResult = throw new ExpectationFailedException( trim($description . "\n" . $f->getMessage()), - $f + $f, ); } @@ -87,14 +88,14 @@ public function evaluate($other, string $description = '', bool $returnResult = /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { return sprintf( - 'is equal to %s with delta <%F>>', + 'is equal to %s with delta <%F>', $this->exporter()->export($this->value), - $this->delta + $this->delta, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php index 860c0030f6..bbaab4af5c 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/Exception.php @@ -36,7 +36,7 @@ public function toString(): string { return sprintf( 'exception of type "%s"', - $this->className + $this->className, ); } @@ -73,13 +73,13 @@ protected function failureDescription($other): string 'exception of type "%s" matches expected exception "%s"%s', get_class($other), $this->className, - $message + $message, ); } return sprintf( 'exception of type "%s" is thrown', - $this->className + $this->className, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php index b8054a949f..4d65e03b9b 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionCode.php @@ -10,6 +10,7 @@ namespace PHPUnit\Framework\Constraint; use function sprintf; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use Throwable; /** @@ -54,14 +55,14 @@ protected function matches($other): bool * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { return sprintf( '%s is equal to expected exception code %s', $this->exporter()->export($other->getCode()), - $this->exporter()->export($this->expectedCode) + $this->exporter()->export($this->expectedCode), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php index 030beff986..5139e7200a 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessage.php @@ -65,14 +65,14 @@ protected function failureDescription($other): string if ($this->expectedMessage === '') { return sprintf( "exception message is empty but is '%s'", - $other->getMessage() + $other->getMessage(), ); } return sprintf( "exception message '%s' contains '%s'", $other->getMessage(), - $this->expectedMessage + $this->expectedMessage, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php index fd0db1c8fc..bc73770916 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Exception/ExceptionMessageRegularExpression.php @@ -48,7 +48,7 @@ protected function matches($other): bool if ($match === false) { throw new \PHPUnit\Framework\Exception( - "Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'" + "Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'", ); } @@ -68,7 +68,7 @@ protected function failureDescription($other): string return sprintf( "exception message '%s' matches '%s'", $other->getMessage(), - $this->expectedMessageRegExp + $this->expectedMessageRegExp, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php index ef4b2baf01..24268c7d31 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/DirectoryExists.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( 'directory "%s" exists', - $other + $other, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php index 41b3136e99..6cae950245 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/FileExists.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( 'file "%s" exists', - $other + $other, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php index e33d7e0451..1243693865 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsReadable.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( '"%s" is readable', - $other + $other, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php index 93981224a1..8da0207649 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Filesystem/IsWritable.php @@ -48,7 +48,7 @@ protected function failureDescription($other): string { return sprintf( '"%s" is writable', - $other + $other, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php index fde43d9e5c..9eb44a9921 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php @@ -16,6 +16,7 @@ use function sprintf; use PHPUnit\Framework\ExpectationFailedException; use SebastianBergmann\Comparator\ComparisonFailure; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -42,8 +43,8 @@ public function __construct($value) * a boolean value instead: true in case of success, false in case of a * failure. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException */ public function evaluate($other, string $description = '', bool $returnResult = false): ?bool { @@ -62,7 +63,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $this->value, $other, sprintf("'%s'", $this->value), - sprintf("'%s'", $other) + sprintf("'%s'", $other), ); } @@ -72,7 +73,7 @@ public function evaluate($other, string $description = '', bool $returnResult = $this->value, $other, $this->exporter()->export($this->value), - $this->exporter()->export($other) + $this->exporter()->export($other), ); } @@ -85,7 +86,7 @@ public function evaluate($other, string $description = '', bool $returnResult = /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { @@ -105,7 +106,7 @@ public function toString(): string * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php index 23a4de7e99..6fbd38c3b1 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php @@ -11,9 +11,11 @@ use function json_decode; use function sprintf; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Util\Json; use SebastianBergmann\Comparator\ComparisonFailure; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -37,7 +39,7 @@ public function toString(): string { return sprintf( 'matches JSON string "%s"', - $this->value + $this->value, ); } @@ -69,17 +71,16 @@ protected function matches($other): bool /** * Throws an exception for the given compared value and test description. * - * @param mixed $other evaluated value or object - * @param string $description Additional information about the test - * @param ComparisonFailure $comparisonFailure + * @param mixed $other evaluated value or object + * @param string $description Additional information about the test * - * @throws \PHPUnit\Framework\Exception - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws Exception * @throws ExpectationFailedException + * @throws InvalidArgumentException * * @psalm-return never-return */ - protected function fail($other, $description, ComparisonFailure $comparisonFailure = null): void + protected function fail($other, $description, ?ComparisonFailure $comparisonFailure = null): void { if ($comparisonFailure === null) { [$error, $recodedOther] = Json::canonicalize($other); @@ -100,7 +101,7 @@ protected function fail($other, $description, ComparisonFailure $comparisonFailu Json::prettify($recodedValue), Json::prettify($recodedOther), false, - 'Failed asserting that two json values are equal.' + 'Failed asserting that two json values are equal.', ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php index 8df92712e6..40e1d614e0 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasAttribute.php @@ -18,6 +18,8 @@ /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ class ClassHasAttribute extends Constraint { @@ -38,7 +40,7 @@ public function toString(): string { return sprintf( 'has attribute "%s"', - $this->attributeName + $this->attributeName, ); } @@ -57,7 +59,7 @@ protected function matches($other): bool throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -77,7 +79,7 @@ protected function failureDescription($other): string '%sclass "%s" %s', is_object($other) ? 'object of ' : '', is_object($other) ? get_class($other) : $other, - $this->toString() + $this->toString(), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php index c2c94109e7..bd5eefe498 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ClassHasStaticAttribute.php @@ -16,6 +16,8 @@ /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ final class ClassHasStaticAttribute extends ClassHasAttribute { @@ -26,7 +28,7 @@ public function toString(): string { return sprintf( 'has static attribute "%s"', - $this->attributeName() + $this->attributeName(), ); } @@ -49,7 +51,7 @@ protected function matches($other): bool throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php index 30f3a330ca..b837b4cd16 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectEquals.php @@ -65,7 +65,7 @@ protected function matches($other): bool if (!$object->hasMethod($this->method)) { throw new ComparisonMethodDoesNotExistException( get_class($other), - $this->method + $this->method, ); } @@ -75,7 +75,7 @@ protected function matches($other): bool if (!$method->hasReturnType()) { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } @@ -84,28 +84,28 @@ protected function matches($other): bool if (!$returnType instanceof ReflectionNamedType) { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } if ($returnType->allowsNull()) { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } if ($returnType->getName() !== 'bool') { throw new ComparisonMethodDoesNotDeclareBoolReturnTypeException( get_class($other), - $this->method + $this->method, ); } if ($method->getNumberOfParameters() !== 1 || $method->getNumberOfRequiredParameters() !== 1) { throw new ComparisonMethodDoesNotDeclareExactlyOneParameterException( get_class($other), - $this->method + $this->method, ); } @@ -114,7 +114,7 @@ protected function matches($other): bool if (!$parameter->hasType()) { throw new ComparisonMethodDoesNotDeclareParameterTypeException( get_class($other), - $this->method + $this->method, ); } @@ -123,7 +123,7 @@ protected function matches($other): bool if (!$type instanceof ReflectionNamedType) { throw new ComparisonMethodDoesNotDeclareParameterTypeException( get_class($other), - $this->method + $this->method, ); } @@ -137,7 +137,7 @@ protected function matches($other): bool throw new ComparisonMethodDoesNotAcceptParameterTypeException( get_class($other), $this->method, - get_class($this->expected) + get_class($this->expected), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php index 5fbc0888c3..602cb05de2 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasAttribute.php @@ -13,6 +13,8 @@ /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + * + * @deprecated https://github.com/sebastianbergmann/phpunit/issues/4601 */ final class ObjectHasAttribute extends ClassHasAttribute { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php new file mode 100644 index 0000000000..c41d21a142 --- /dev/null +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Object/ObjectHasProperty.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace PHPUnit\Framework\Constraint; + +use function get_class; +use function gettype; +use function is_object; +use function sprintf; +use ReflectionObject; + +/** + * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit + */ +final class ObjectHasProperty extends Constraint +{ + /** + * @var string + */ + private $propertyName; + + public function __construct(string $propertyName) + { + $this->propertyName = $propertyName; + } + + /** + * Returns a string representation of the constraint. + */ + public function toString(): string + { + return sprintf( + 'has property "%s"', + $this->propertyName, + ); + } + + /** + * Evaluates the constraint for parameter $other. Returns true if the + * constraint is met, false otherwise. + * + * @param mixed $other value or object to evaluate + */ + protected function matches($other): bool + { + if (!is_object($other)) { + return false; + } + + return (new ReflectionObject($other))->hasProperty($this->propertyName); + } + + /** + * Returns the description of the failure. + * + * The beginning of failure messages is "Failed asserting that" in most + * cases. This method should return the second part of that sentence. + * + * @param mixed $other evaluated value or object + */ + protected function failureDescription($other): string + { + if (is_object($other)) { + return sprintf( + 'object of class "%s" %s', + get_class($other), + $this->toString(), + ); + } + + return sprintf( + '"%s" (%s) %s', + $other, + gettype($other), + $this->toString(), + ); + } +} diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php index 7560ce2a18..586abc5053 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php @@ -50,10 +50,17 @@ public static function negate(string $string): string preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches); - $positives = array_map(static function (string $s) - { - return '/\\b' . preg_quote($s, '/') . '/'; - }, $positives); + if (count($matches) === 0) { + preg_match('/(\'[\w\W]*\')([\w\W]*)(\'[\w\W]*\')/i', $string, $matches); + } + + $positives = array_map( + static function (string $s) + { + return '/\\b' . preg_quote($s, '/') . '/'; + }, + $positives, + ); if (count($matches) > 0) { $nonInput = $matches[2]; @@ -63,15 +70,15 @@ public static function negate(string $string): string preg_replace( $positives, $negatives, - $nonInput + $nonInput, ), - $string + $string, ); } else { $negatedString = preg_replace( $positives, $negatives, - $string + $string, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php index fbdb479bcf..ee1b1c2937 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php @@ -57,7 +57,7 @@ static function (bool $matches, Constraint $constraint) use ($other): bool { return $matches xor $constraint->evaluate($other, '', true); }, - $initial->evaluate($other, '', true) + $initial->evaluate($other, '', true), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php index 0a7a5fa2f9..f8c24a52ab 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php @@ -10,6 +10,7 @@ namespace PHPUnit\Framework\Constraint; use function count; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -79,7 +80,7 @@ public function count(): int * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { @@ -105,7 +106,7 @@ protected function failureDescription($other): string } /** - * Transforms string returned by the memeber constraint's toString() or + * Transforms string returned by the member constraint's toString() or * failureDescription() such that it reflects constraint's participation in * this expression. * diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php index 97b294617f..bdf363326b 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php @@ -12,6 +12,7 @@ use function json_decode; use function json_last_error; use function sprintf; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -55,7 +56,7 @@ protected function matches($other): bool * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { @@ -65,13 +66,13 @@ protected function failureDescription($other): string json_decode($other); $error = (string) JsonMatchesErrorMessageProvider::determineJsonError( - (string) json_last_error() + (string) json_last_error(), ); return sprintf( '%s is valid JSON (%s)', $this->exporter()->shortenedExport($other), - $error + $error, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php index 8e609e7958..9ccfb9bd59 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/RegularExpression.php @@ -34,7 +34,7 @@ public function toString(): string { return sprintf( 'matches PCRE pattern "%s"', - $this->pattern + $this->pattern, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php index 6279f37ba4..5aa2c8e5ae 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringContains.php @@ -48,7 +48,7 @@ public function toString(): string return sprintf( 'contains "%s"', - $string + $string, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php index c4f7324ec5..9c01ecb9cd 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringMatchesFormatDescription.php @@ -33,8 +33,8 @@ public function __construct(string $string) { parent::__construct( $this->createPatternFromFormat( - $this->convertNewlines($string) - ) + $this->convertNewlines($string), + ), ); $this->string = $string; @@ -49,7 +49,7 @@ public function __construct(string $string) protected function matches($other): bool { return parent::matches( - $this->convertNewlines($other) + $this->convertNewlines($other), ); } @@ -96,7 +96,7 @@ private function createPatternFromFormat(string $string): string '%x' => '[0-9a-fA-F]+', '%f' => '[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?', '%c' => '.', - ] + ], ); return '/^' . $string . '$/s'; diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php index 089545c122..8683e27221 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/String/StringStartsWith.php @@ -9,7 +9,6 @@ */ namespace PHPUnit\Framework\Constraint; -use function strlen; use function strpos; use PHPUnit\Framework\InvalidArgumentException; @@ -25,7 +24,7 @@ final class StringStartsWith extends Constraint public function __construct(string $prefix) { - if (strlen($prefix) === 0) { + if ($prefix === '') { throw InvalidArgumentException::create(1, 'non-empty string'); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php index 44cada3a7d..98a757a737 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/ArrayHasKey.php @@ -12,6 +12,7 @@ use function array_key_exists; use function is_array; use ArrayAccess; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -34,7 +35,7 @@ public function __construct($key) /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { @@ -68,7 +69,7 @@ protected function matches($other): bool * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php index 39660a9857..0f934396e7 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php @@ -11,6 +11,7 @@ use function is_array; use function sprintf; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -30,7 +31,7 @@ public function __construct($value) /** * Returns a string representation of the constraint. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { @@ -45,14 +46,14 @@ public function toString(): string * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { return sprintf( '%s %s', is_array($other) ? 'an array' : 'a traversable', - $this->toString() + $this->toString(), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php index cf4a46b422..4f34f72a39 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContainsOnly.php @@ -9,7 +9,9 @@ */ namespace PHPUnit\Framework\Constraint; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\ExpectationFailedException; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use Traversable; /** @@ -28,7 +30,7 @@ final class TraversableContainsOnly extends Constraint private $type; /** - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public function __construct(string $type, bool $isNativeType = true) { @@ -36,7 +38,7 @@ public function __construct(string $type, bool $isNativeType = true) $this->constraint = new IsType($type); } else { $this->constraint = new IsInstanceOf( - $type + $type, ); } @@ -55,8 +57,8 @@ public function __construct(string $type, bool $isNativeType = true) * * @param mixed|Traversable $other * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException */ public function evaluate($other, string $description = '', bool $returnResult = false): ?bool { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php index f0fa02b999..c1b73a8370 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsInstanceOf.php @@ -12,6 +12,7 @@ use function sprintf; use ReflectionClass; use ReflectionException; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -36,7 +37,7 @@ public function toString(): string return sprintf( 'is instance of %s "%s"', $this->getType(), - $this->className + $this->className, ); } @@ -59,7 +60,7 @@ protected function matches($other): bool * * @param mixed $other evaluated value or object * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function failureDescription($other): string { @@ -67,7 +68,7 @@ protected function failureDescription($other): string '%s is an instance of %s "%s"', $this->exporter()->shortenedExport($other), $this->getType(), - $this->className + $this->className, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php index 5bc691d746..285b74a77e 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php @@ -21,6 +21,7 @@ use function is_scalar; use function is_string; use function sprintf; +use PHPUnit\Framework\Exception; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit @@ -121,17 +122,17 @@ final class IsType extends Constraint private $type; /** - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public function __construct(string $type) { if (!isset(self::KNOWN_TYPES[$type])) { - throw new \PHPUnit\Framework\Exception( + throw new Exception( sprintf( 'Type specified for PHPUnit\Framework\Constraint\IsType <%s> ' . 'is not a valid type.', - $type - ) + $type, + ), ); } @@ -145,7 +146,7 @@ public function toString(): string { return sprintf( 'is of type "%s"', - $this->type + $this->type, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php b/api/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php index 18b5499965..4d7ab85975 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php +++ b/api/vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php @@ -11,6 +11,7 @@ use function explode; use PHPUnit\Util\Test as TestUtil; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -64,7 +65,7 @@ public function requires(): array /** * Returns the size of the each test created using the data provider(s). * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function getSize(): int { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Error/Error.php b/api/vendor/phpunit/phpunit/src/Framework/Error/Error.php index 2990b360e3..3163a86701 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Error/Error.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Error/Error.php @@ -16,7 +16,7 @@ */ class Error extends Exception { - public function __construct(string $message, int $code, string $file, int $line, \Exception $previous = null) + public function __construct(string $message, int $code, string $file, int $line, ?\Exception $previous = null) { parent::__construct($message, $code, $previous); diff --git a/api/vendor/phpunit/phpunit/src/Framework/ErrorTestCase.php b/api/vendor/phpunit/phpunit/src/Framework/ErrorTestCase.php index 841247d720..245f0336c5 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/ErrorTestCase.php +++ b/api/vendor/phpunit/phpunit/src/Framework/ErrorTestCase.php @@ -15,17 +15,17 @@ final class ErrorTestCase extends TestCase { /** - * @var bool + * @var ?bool */ protected $backupGlobals = false; /** - * @var bool + * @var ?bool */ protected $backupStaticAttributes = false; /** - * @var bool + * @var ?bool */ protected $runTestInSeparateProcess = false; diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php index adae282943..4364788cfe 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php @@ -21,7 +21,7 @@ public function __construct() parent::__construct( 'Actual value is not an object', 0, - null + null, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php index ebd68f34c8..0c2c1afe6f 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotAcceptParameterTypeException.php @@ -24,10 +24,10 @@ public function __construct(string $className, string $methodName, string $type) '%s is not an accepted argument type for comparison method %s::%s().', $type, $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php index 20189cde4d..4eb9a2fde3 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Comparison method %s::%s() does not declare bool return type.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php index bd09d87ccf..e8cd9787bb 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Comparison method %s::%s() does not declare exactly one parameter.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php index 9bbb112eaf..68616ba18b 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotDeclareParameterTypeException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Parameter of comparison method %s::%s() does not have a declared type.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php index ad0e2d0889..0f1adcbcc0 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/ComparisonMethodDoesNotExistException.php @@ -23,10 +23,10 @@ public function __construct(string $className, string $methodName) sprintf( 'Comparison method %s::%s() does not exist.', $className, - $methodName + $methodName, ), 0, - null + null, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php index 0b21e6de30..3ed049274e 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/Exception.php @@ -44,7 +44,7 @@ class Exception extends RuntimeException implements \PHPUnit\Exception */ protected $serializableTrace; - public function __construct($message = '', $code = 0, Throwable $previous = null) + public function __construct($message = '', $code = 0, ?Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php index b9a595a88c..a81d7535f6 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/ExpectationFailedException.php @@ -28,7 +28,7 @@ final class ExpectationFailedException extends AssertionFailedError */ protected $comparisonFailure; - public function __construct(string $message, ComparisonFailure $comparisonFailure = null, Exception $previous = null) + public function __construct(string $message, ?ComparisonFailure $comparisonFailure = null, ?Exception $previous = null) { $this->comparisonFailure = $comparisonFailure; diff --git a/api/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php b/api/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php index 77f5807996..4181b3206d 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Exception/InvalidArgumentException.php @@ -34,12 +34,12 @@ public static function create(int $argument, string $type): self $argument, $function, in_array(lcfirst($type)[0], ['a', 'e', 'i', 'o', 'u'], true) ? 'an' : 'a', - $type - ) + $type, + ), ); } - private function __construct(string $message = '', int $code = 0, \Exception $previous = null) + private function __construct(string $message = '', int $code = 0, ?\Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php b/api/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php index 00d40353a3..d30e90b2fa 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php +++ b/api/vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php @@ -114,7 +114,7 @@ public function getOriginalException(): ?Throwable * * Approach works both for var_dump() and var_export() and print_r(). */ - private function originalException(Throwable $exceptionToStore = null): ?Throwable + private function originalException(?Throwable $exceptionToStore = null): ?Throwable { // drop once PHP 7.3 support is removed if (PHP_VERSION_ID < 70400) { diff --git a/api/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php b/api/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php index 09c343c166..89ecc5e2e4 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php +++ b/api/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php @@ -77,8 +77,8 @@ public static function filterInvalid(array $dependencies): array static function (self $d) { return $d->isValid(); - } - ) + }, + ), ); } @@ -95,7 +95,7 @@ static function ($dependency) { return $dependency->getTarget(); }, - $existing + $existing, ); foreach ($additional as $dependency) { @@ -132,7 +132,7 @@ static function ($dependency) { return $dependency->getTarget(); }, - $right + $right, ); foreach ($left as $dependency) { diff --git a/api/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php b/api/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php index ee1e3e9fe0..8da567942a 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php +++ b/api/vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php @@ -9,23 +9,25 @@ */ namespace PHPUnit\Framework; +use SebastianBergmann\RecursionContext\InvalidArgumentException; + /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class IncompleteTestCase extends TestCase { /** - * @var bool + * @var ?bool */ protected $backupGlobals = false; /** - * @var bool + * @var ?bool */ protected $backupStaticAttributes = false; /** - * @var bool + * @var ?bool */ protected $runTestInSeparateProcess = false; @@ -49,7 +51,7 @@ public function getMessage(): string /** * Returns a string representation of the test case. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php index e2f0a2802d..56e6b69bb5 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Api.php @@ -42,7 +42,7 @@ public static function __phpunit_initConfigurableMethods(ConfigurableMethod ...$ { if (isset(static::$__phpunit_configurableMethods)) { throw new ConfigurableMethodsAlreadyInitializedException( - 'Configurable methods is already initialized and can not be reinitialized' + 'Configurable methods is already initialized and can not be reinitialized', ); } @@ -67,7 +67,7 @@ public function __phpunit_getInvocationHandler(): InvocationHandler if ($this->__phpunit_invocationMocker === null) { $this->__phpunit_invocationMocker = new InvocationHandler( static::$__phpunit_configurableMethods, - $this->__phpunit_returnValueGeneration + $this->__phpunit_returnValueGeneration, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php index f6df7533c1..f8be3808cb 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Api/Method.php @@ -24,7 +24,7 @@ public function method() return call_user_func_array( [$expects, 'method'], - func_get_args() + func_get_args(), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php index bc3c9236f0..b23e5e389a 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php @@ -16,6 +16,7 @@ use function is_string; use function strtolower; use PHPUnit\Framework\Constraint\Constraint; +use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\MockObject\ConfigurableMethod; use PHPUnit\Framework\MockObject\IncompatibleReturnValueException; use PHPUnit\Framework\MockObject\InvocationHandler; @@ -224,7 +225,7 @@ public function withAnyParameters(): self /** * @param Constraint|string $constraint * - * @throws \PHPUnit\Framework\InvalidArgumentException + * @throws InvalidArgumentException * @throws MethodCannotBeConfiguredException * @throws MethodNameAlreadyConfiguredException * @@ -241,7 +242,7 @@ static function (ConfigurableMethod $configurable) { return strtolower($configurable->getName()); }, - $this->configurableMethods + $this->configurableMethods, ); if (is_string($constraint) && !in_array(strtolower($constraint), $configurableMethodNames, true)) { @@ -300,7 +301,7 @@ private function ensureTypeOfReturnValues(array $values): void if (!$configuredMethod->mayReturn($value)) { throw new IncompatibleReturnValueException( $configuredMethod, - $value + $value, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php index f32ff0e7c2..1756cfc0a4 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationStubber.php @@ -20,46 +20,46 @@ interface InvocationStubber public function will(Stub $stub): Identity; /** @return self */ - public function willReturn($value, ...$nextValues)/*: self */; + public function willReturn($value, ...$nextValues)/* : self */; /** * @param mixed $reference * * @return self */ - public function willReturnReference(&$reference)/*: self */; + public function willReturnReference(&$reference)/* : self */; /** * @param array> $valueMap * * @return self */ - public function willReturnMap(array $valueMap)/*: self */; + public function willReturnMap(array $valueMap)/* : self */; /** * @param int $argumentIndex * * @return self */ - public function willReturnArgument($argumentIndex)/*: self */; + public function willReturnArgument($argumentIndex)/* : self */; /** * @param callable $callback * * @return self */ - public function willReturnCallback($callback)/*: self */; + public function willReturnCallback($callback)/* : self */; /** @return self */ - public function willReturnSelf()/*: self */; + public function willReturnSelf()/* : self */; /** * @param mixed $values * * @return self */ - public function willReturnOnConsecutiveCalls(...$values)/*: self */; + public function willReturnOnConsecutiveCalls(...$values)/* : self */; /** @return self */ - public function willThrowException(Throwable $exception)/*: self */; + public function willThrowException(Throwable $exception)/* : self */; } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php index 543d596ccf..a71caf7975 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/MethodNameMatch.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Framework\MockObject\Builder; +use PHPUnit\Framework\Constraint\Constraint; + /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ @@ -18,7 +20,7 @@ interface MethodNameMatch extends ParametersMatch * Adds a new method name match and returns the parameter match object for * further matching possibilities. * - * @param \PHPUnit\Framework\Constraint\Constraint $constraint Constraint for matching method, if a string is passed it will use the PHPUnit_Framework_Constraint_IsEqual + * @param Constraint $constraint Constraint for matching method, if a string is passed it will use the PHPUnit_Framework_Constraint_IsEqual * * @return ParametersMatch */ diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php index 0698870bce..848746b523 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php @@ -22,8 +22,8 @@ public function __construct(string $type, string $methodName) sprintf( 'Trying to configure method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', $methodName, - $type - ) + $type, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php index 35a29b731e..0efcd02a32 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php @@ -22,8 +22,8 @@ public function __construct(string $type, string $methodName) sprintf( 'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', $methodName, - $type - ) + $type, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php index 0ba9a187d0..8c9c0a5239 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassAlreadyExistsException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" already exists', - $className - ) + $className, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php index e648f0263e..2bce2d882e 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" is declared "final" and cannot be doubled', - $className - ) + $className, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php index aa1a74510d..f73570e1df 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsReadonlyException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" is declared "readonly" and cannot be doubled', - $className - ) + $className, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php index 1216b45d3f..f96a04ac96 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php @@ -28,8 +28,8 @@ public function __construct(array $methods) sprintf( 'Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")', implode(', ', $methods), - implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))) - ) + implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php index eec792132a..1ca8e9c94c 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php @@ -29,8 +29,8 @@ public function __construct(ConfigurableMethod $method, $value) 'Method %s may not return value of type %s, its declared return type is "%s"', $method->getName(), is_object($value) ? get_class($value) : gettype($value), - $method->getReturnTypeDeclaration() - ) + $method->getReturnTypeDeclaration(), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php index d2444cf121..0ab74cbb68 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php @@ -21,8 +21,8 @@ public function __construct(string $method) parent::__construct( sprintf( 'Cannot double method with invalid name "%s"', - $method - ) + $method, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php index c05b2bce69..f2e1a31e8e 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php @@ -21,8 +21,8 @@ public function __construct(string $id) parent::__construct( sprintf( 'No builder found for match builder identification <%s>', - $id - ) + $id, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php index efcc13ed96..0972ffaf85 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php @@ -21,8 +21,8 @@ public function __construct(string $id) parent::__construct( sprintf( 'Matcher with id <%s> is already registered', - $id - ) + $id, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php index 707290439a..2f0bb5a65a 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php @@ -21,8 +21,8 @@ public function __construct(string $method) parent::__construct( sprintf( 'Trying to configure method "%s" which cannot be configured because it does not exist, has not been specified, is final, or is static', - $method - ) + $method, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php index 2c16c1dcc8..2bc4e8829f 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php @@ -22,8 +22,8 @@ public function __construct(Invocation $invocation) sprintf( 'Return value inference disabled and no expectation set up for %s::%s()', $invocation->getClassName(), - $invocation->getMethodName() - ) + $invocation->getMethodName(), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php index 98837c9542..6ec5057ab4 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/SoapExtensionNotAvailableException.php @@ -17,7 +17,7 @@ final class SoapExtensionNotAvailableException extends \PHPUnit\Framework\Except public function __construct() { parent::__construct( - 'The SOAP extension is required to generate a test double from WSDL' + 'The SOAP extension is required to generate a test double from WSDL', ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php index e124f9b18a..b08dead05f 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownClassException.php @@ -21,8 +21,8 @@ public function __construct(string $className) parent::__construct( sprintf( 'Class "%s" does not exist', - $className - ) + $className, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php index 90fc8d8482..c689dae920 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTraitException.php @@ -21,8 +21,8 @@ public function __construct(string $traitName) parent::__construct( sprintf( 'Trait "%s" does not exist', - $traitName - ) + $traitName, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php index b1a70edd6d..c50b691165 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/UnknownTypeException.php @@ -21,8 +21,8 @@ public function __construct(string $type) parent::__construct( sprintf( 'Class or interface "%s" does not exist', - $type - ) + $type, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php index 17e3312c57..49211ad7e1 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Generator.php @@ -72,7 +72,6 @@ public function __clone(): void } } EOT; - private const MOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -84,7 +83,6 @@ public function __clone() } } EOT; - private const UNMOCKED_CLONE_METHOD_WITH_VOID_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -98,7 +96,6 @@ public function __clone(): void } } EOT; - private const UNMOCKED_CLONE_METHOD_WITHOUT_RETURN_TYPE_TRAIT = <<<'EOT' namespace PHPUnit\Framework\MockObject; @@ -144,18 +141,18 @@ public function __clone() * * @param null|array $methods * - * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException * @throws ClassIsFinalException * @throws ClassIsReadonlyException * @throws DuplicateMethodException + * @throws InvalidArgumentException * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException * @throws ReflectionException * @throws RuntimeException * @throws UnknownTypeException */ - public function getMock(string $type, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject + public function getMock(string $type, $methods = [], array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false, ?object $proxyTarget = null, bool $allowMockingUnknownTypes = true, bool $returnValueGeneration = true): MockObject { if (!is_array($methods) && null !== $methods) { throw InvalidArgumentException::create(2, 'array'); @@ -189,7 +186,7 @@ public function getMock(string $type, $methods = [], array $arguments = [], stri throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -210,7 +207,7 @@ public function getMock(string $type, $methods = [], array $arguments = [], stri $callOriginalClone, $callAutoload, $cloneArguments, - $callOriginalMethods + $callOriginalMethods, ); return $this->getObject( @@ -221,7 +218,7 @@ public function getMock(string $type, $methods = [], array $arguments = [], stri $arguments, $callOriginalMethods, $proxyTarget, - $returnValueGeneration + $returnValueGeneration, ); } @@ -268,7 +265,7 @@ public function getMockForInterfaces(array $interfaces, bool $callAutoload = tru $intersectionName = sprintf( 'Intersection_%s_%s', implode('_', $unqualifiedNames), - substr(md5((string) mt_rand()), 0, 8) + substr(md5((string) mt_rand()), 0, 8), ); } while (interface_exists($intersectionName, false)); @@ -278,7 +275,7 @@ public function getMockForInterfaces(array $interfaces, bool $callAutoload = tru [ 'intersection' => $intersectionName, 'interfaces' => implode(', ', $interfaces), - ] + ], ); eval($template->render()); @@ -298,11 +295,11 @@ public function getMockForInterfaces(array $interfaces, bool $callAutoload = tru * * @psalm-return MockObject&RealInstanceType * - * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException * @throws ClassIsFinalException * @throws ClassIsReadonlyException * @throws DuplicateMethodException + * @throws InvalidArgumentException * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException * @throws ReflectionException @@ -310,7 +307,7 @@ public function getMockForInterfaces(array $interfaces, bool $callAutoload = tru * @throws UnknownClassException * @throws UnknownTypeException */ - public function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject + public function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, ?array $mockedMethods = null, bool $cloneArguments = true): MockObject { if (class_exists($originalClassName, $callAutoload) || interface_exists($originalClassName, $callAutoload)) { @@ -321,7 +318,7 @@ interface_exists($originalClassName, $callAutoload)) { throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -346,7 +343,7 @@ interface_exists($originalClassName, $callAutoload)) { $callOriginalConstructor, $callOriginalClone, $callAutoload, - $cloneArguments + $cloneArguments, ); } @@ -360,11 +357,11 @@ interface_exists($originalClassName, $callAutoload)) { * * @psalm-param trait-string $traitName * - * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException * @throws ClassIsFinalException * @throws ClassIsReadonlyException * @throws DuplicateMethodException + * @throws InvalidArgumentException * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException * @throws ReflectionException @@ -373,7 +370,7 @@ interface_exists($originalClassName, $callAutoload)) { * @throws UnknownTraitException * @throws UnknownTypeException */ - public function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = null, bool $cloneArguments = true): MockObject + public function getMockForTrait(string $traitName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, ?array $mockedMethods = null, bool $cloneArguments = true): MockObject { if (!trait_exists($traitName, $callAutoload)) { throw new UnknownTraitException($traitName); @@ -382,7 +379,7 @@ public function getMockForTrait(string $traitName, array $arguments = [], string $className = $this->generateClassName( $traitName, '', - 'Trait_' + 'Trait_', ); $classTemplate = $this->getTemplate('trait_class.tpl'); @@ -392,7 +389,7 @@ public function getMockForTrait(string $traitName, array $arguments = [], string 'prologue' => 'abstract ', 'class_name' => $className['className'], 'trait_name' => $traitName, - ] + ], ); $mockTrait = new MockTrait($classTemplate->render(), $className['className']); @@ -419,7 +416,7 @@ public function getObjectForTrait(string $traitName, string $traitClassName = '' $className = $this->generateClassName( $traitName, $traitClassName, - 'Trait_' + 'Trait_', ); $classTemplate = $this->getTemplate('trait_class.tpl'); @@ -429,18 +426,18 @@ public function getObjectForTrait(string $traitName, string $traitClassName = '' 'prologue' => '', 'class_name' => $className['className'], 'trait_name' => $traitName, - ] + ], ); return $this->getObject( new MockTrait( $classTemplate->render(), - $className['className'] + $className['className'], ), '', $callOriginalConstructor, $callAutoload, - $arguments + $arguments, ); } @@ -450,7 +447,7 @@ public function getObjectForTrait(string $traitName, string $traitClassName = '' * @throws ReflectionException * @throws RuntimeException */ - public function generate(string $type, array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass + public function generate(string $type, ?array $methods = null, string $mockClassName = '', bool $callOriginalClone = true, bool $callAutoload = true, bool $cloneArguments = true, bool $callOriginalMethods = false): MockClass { if ($mockClassName !== '') { return $this->generateMock( @@ -460,7 +457,7 @@ public function generate(string $type, array $methods = null, string $mockClassN $callOriginalClone, $callAutoload, $cloneArguments, - $callOriginalMethods + $callOriginalMethods, ); } @@ -469,7 +466,7 @@ public function generate(string $type, array $methods = null, string $mockClassN serialize($methods) . serialize($callOriginalClone) . serialize($cloneArguments) . - serialize($callOriginalMethods) + serialize($callOriginalMethods), ); if (!isset(self::$cache[$key])) { @@ -480,7 +477,7 @@ public function generate(string $type, array $methods = null, string $mockClassN $callOriginalClone, $callAutoload, $cloneArguments, - $callOriginalMethods + $callOriginalMethods, ); } @@ -507,7 +504,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -526,7 +523,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array if (empty($methods) || in_array($name, $methods, true)) { $args = explode( ',', - str_replace(')', '', substr($method, $nameEnd + 1)) + str_replace(')', '', substr($method, $nameEnd + 1)), ); foreach (range(0, count($args) - 1) as $i) { @@ -543,7 +540,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array [ 'method_name' => $name, 'arguments' => implode(', ', $args), - ] + ], ); $methodsBuffer .= $methodTemplate->render(); @@ -574,7 +571,7 @@ public function generateClassFromWsdl(string $wsdlFile, string $className, array 'wsdl' => $wsdlFile, 'options' => $optionsBuffer, 'methods' => $methodsBuffer, - ] + ], ); return $classTemplate->render(); @@ -594,7 +591,7 @@ public function getClassMethods(string $className): array throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -624,7 +621,7 @@ public function mockClassMethods(string $className, bool $callOriginalMethods, b throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -654,7 +651,7 @@ public function mockInterfaceMethods(string $interfaceName, bool $cloneArguments throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -684,7 +681,7 @@ private function userDefinedInterfaceMethods(string $interfaceName): array throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -706,7 +703,7 @@ private function userDefinedInterfaceMethods(string $interfaceName): array * @throws ReflectionException * @throws RuntimeException */ - private function getObject(MockType $mockClass, $type = '', bool $callOriginalConstructor = false, bool $callAutoload = false, array $arguments = [], bool $callOriginalMethods = false, object $proxyTarget = null, bool $returnValueGeneration = true) + private function getObject(MockType $mockClass, $type = '', bool $callOriginalConstructor = false, bool $callAutoload = false, array $arguments = [], bool $callOriginalMethods = false, ?object $proxyTarget = null, bool $returnValueGeneration = true) { $className = $mockClass->generate(); @@ -721,7 +718,7 @@ private function getObject(MockType $mockClass, $type = '', bool $callOriginalCo throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -748,7 +745,7 @@ private function getObject(MockType $mockClass, $type = '', bool $callOriginalCo throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -787,7 +784,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc $_mockClassName = $this->generateClassName( $type, $mockClassName, - 'Mock_' + 'Mock_', ); if (class_exists($_mockClassName['fullClassName'], $callAutoload)) { @@ -816,7 +813,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -842,7 +839,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -858,7 +855,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -869,14 +866,14 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc } $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) + MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments), ); } $_mockClassName = $this->generateClassName( $actualClassName, $_mockClassName['className'], - 'Mock_' + 'Mock_', ); } @@ -887,7 +884,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc $additionalInterfaces[] = Iterator::class; $mockMethods->addMethods( - ...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments) + ...$this->mockClassMethods(Iterator::class, $callOriginalMethods, $cloneArguments), ); } @@ -899,7 +896,7 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -918,13 +915,13 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc if ($isClass && $explicitMethods === []) { $mockMethods->addMethods( - ...$this->mockClassMethods($_mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments) + ...$this->mockClassMethods($_mockClassName['fullClassName'], $callOriginalMethods, $cloneArguments), ); } if ($isInterface && ($explicitMethods === [] || $explicitMethods === null)) { $mockMethods->addMethods( - ...$this->mockInterfaceMethods($_mockClassName['fullClassName'], $cloneArguments) + ...$this->mockInterfaceMethods($_mockClassName['fullClassName'], $cloneArguments), ); } @@ -938,14 +935,14 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd if ($this->canMockMethod($method)) { $mockMethods->addMethods( - MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments) + MockMethod::fromReflection($method, $callOriginalMethods, $cloneArguments), ); } } else { @@ -953,8 +950,8 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc MockMethod::fromName( $_mockClassName['fullClassName'], $methodName, - $cloneArguments - ) + $cloneArguments, + ), ); } } @@ -991,19 +988,19 @@ private function generateMock(string $type, ?array $explicitMethods, string $moc 'class_declaration' => $this->generateMockClassDeclaration( $_mockClassName, $isInterface, - $additionalInterfaces + $additionalInterfaces, ), 'clone' => $cloneTrait, 'mock_class_name' => $_mockClassName['className'], 'mocked_methods' => $mockedMethods, 'method' => $method, - ] + ], ); return new MockClass( $classTemplate->render(), $_mockClassName['className'], - $configurable + $configurable, ); } @@ -1050,7 +1047,7 @@ private function generateMockClassDeclaration(array $mockClassName, bool $isInte $buffer .= sprintf( '%s implements %s', $mockClassName['className'], - $interfaces + $interfaces, ); if (!in_array($mockClassName['originalClassName'], $additionalInterfaces, true)) { @@ -1068,7 +1065,7 @@ private function generateMockClassDeclaration(array $mockClassName, bool $isInte $mockClassName['className'], !empty($mockClassName['namespaceName']) ? $mockClassName['namespaceName'] . '\\' : '', $mockClassName['originalClassName'], - $interfaces + $interfaces, ); } @@ -1099,7 +1096,7 @@ private function getTemplate(string $template): Template throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php index 418d6a077c..ed8c4e92d6 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php @@ -183,7 +183,7 @@ public function generateReturnValue() throw new RuntimeException( $t->getMessage(), (int) $t->getCode(), - $t + $t, ); } } @@ -221,7 +221,7 @@ public function generateReturnValue() throw new RuntimeException( $t->getMessage(), (int) $t->getCode(), - $t + $t, ); } } @@ -256,8 +256,8 @@ public function generateReturnValue() 'Return value for %s::%s() cannot be generated%s, please configure a return value for this method', $this->className, $this->methodName, - $reason - ) + $reason, + ), ); } @@ -273,10 +273,10 @@ public function toString(): string ', ', array_map( [$exporter, 'shortenedExport'], - $this->parameters - ) + $this->parameters, + ), ), - $this->returnType ? sprintf(': %s', $this->returnType) : '' + $this->returnType ? sprintf(': %s', $this->returnType) : '', ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php index b9d62610ae..f8ee16e0c9 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/InvocationHandler.php @@ -102,7 +102,7 @@ public function expects(InvocationOrder $rule): InvocationMocker return new InvocationMocker( $this, $matcher, - ...$this->configurableMethods + ...$this->configurableMethods, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php index 7c81a0ea03..cc8be05857 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Matcher.php @@ -22,6 +22,7 @@ use PHPUnit\Framework\MockObject\Rule\ParametersRule; use PHPUnit\Framework\MockObject\Stub\Stub; use PHPUnit\Framework\TestFailure; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -117,8 +118,8 @@ public function invoked(Invocation $invocation) if ($this->afterMatchBuilderId !== null) { $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); + ->__phpunit_getInvocationHandler() + ->lookupMatcher($this->afterMatchBuilderId); if (!$matcher) { throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); @@ -143,9 +144,9 @@ public function invoked(Invocation $invocation) "Expectation failed for %s when %s\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), - $e->getMessage() + $e->getMessage(), ), - $e->getComparisonFailure() + $e->getComparisonFailure(), ); } @@ -157,8 +158,8 @@ public function invoked(Invocation $invocation) } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException * @throws MatchBuilderNotFoundException * @throws MethodNameNotConfiguredException * @throws RuntimeException @@ -167,8 +168,8 @@ public function matches(Invocation $invocation): bool { if ($this->afterMatchBuilderId !== null) { $matcher = $invocation->getObject() - ->__phpunit_getInvocationHandler() - ->lookupMatcher($this->afterMatchBuilderId); + ->__phpunit_getInvocationHandler() + ->lookupMatcher($this->afterMatchBuilderId); if (!$matcher) { throw new MatchBuilderNotFoundException($this->afterMatchBuilderId); @@ -199,9 +200,9 @@ public function matches(Invocation $invocation): bool "Expectation failed for %s when %s\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), - $e->getMessage() + $e->getMessage(), ), - $e->getComparisonFailure() + $e->getComparisonFailure(), ); } @@ -209,8 +210,8 @@ public function matches(Invocation $invocation): bool } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException * @throws MethodNameNotConfiguredException */ public function verify(): void @@ -239,8 +240,8 @@ public function verify(): void "Expectation failed for %s when %s.\n%s", $this->methodNameRule->toString(), $this->invocationRule->toString(), - TestFailure::exceptionToString($e) - ) + TestFailure::exceptionToString($e), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php index 3082ab384c..e5c955d3d6 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MethodNameConstraint.php @@ -33,7 +33,7 @@ public function toString(): string { return sprintf( 'is "%s"', - $this->methodName + $this->methodName, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php index 4007a9f13d..487ea16ad2 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php @@ -11,6 +11,8 @@ use function array_diff; use function array_merge; +use PHPUnit\Framework\Exception; +use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\TestCase; use ReflectionClass; @@ -111,11 +113,11 @@ public function __construct(TestCase $testCase, $type) /** * Creates a mock object using a fluent interface. * - * @throws \PHPUnit\Framework\InvalidArgumentException * @throws ClassAlreadyExistsException * @throws ClassIsFinalException * @throws ClassIsReadonlyException * @throws DuplicateMethodException + * @throws InvalidArgumentException * @throws InvalidMethodNameException * @throws OriginalConstructorInvocationRequiredException * @throws ReflectionException @@ -138,7 +140,7 @@ public function getMock(): MockObject $this->callOriginalMethods, $this->proxyTarget, $this->allowMockingUnknownTypes, - $this->returnValueGeneration + $this->returnValueGeneration, ); $this->testCase->registerMockObject($object); @@ -151,7 +153,7 @@ public function getMock(): MockObject * * @psalm-return MockObject&MockedType * - * @throws \PHPUnit\Framework\Exception + * @throws Exception * @throws ReflectionException * @throws RuntimeException */ @@ -165,7 +167,7 @@ public function getMockForAbstractClass(): MockObject $this->originalClone, $this->autoload, $this->methods, - $this->cloneArguments + $this->cloneArguments, ); $this->testCase->registerMockObject($object); @@ -178,7 +180,7 @@ public function getMockForAbstractClass(): MockObject * * @psalm-return MockObject&MockedType * - * @throws \PHPUnit\Framework\Exception + * @throws Exception * @throws ReflectionException * @throws RuntimeException */ @@ -192,7 +194,7 @@ public function getMockForTrait(): MockObject $this->originalClone, $this->autoload, $this->methods, - $this->cloneArguments + $this->cloneArguments, ); $this->testCase->registerMockObject($object); @@ -243,7 +245,7 @@ public function onlyMethods(array $methods): self throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -285,7 +287,7 @@ public function addMethods(array $methods): self throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -313,8 +315,8 @@ public function setMethodsExcept(array $methods = []): self return $this->setMethods( array_diff( $this->generator->getClassMethods($this->type), - $methods - ) + $methods, + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php index 253d784605..8f5c276d50 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockClass.php @@ -55,7 +55,7 @@ public function generate(): string $this->mockName, '__phpunit_initConfigurableMethods', ], - ...$this->configurableMethods + ...$this->configurableMethods, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php index 2cf149ad65..88462dfe0b 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/MockMethod.php @@ -140,7 +140,7 @@ public static function fromReflection(ReflectionMethod $method, bool $callOrigin $reference, $callOriginalMethod, $method->isStatic(), - $deprecation + $deprecation, ); } @@ -157,7 +157,7 @@ public static function fromName(string $fullClassName, string $methodName, bool '', false, false, - null + null, ); } @@ -191,12 +191,12 @@ public function generateCode(): string } elseif ($this->returnType->isNever() || $this->returnType->isVoid()) { $templateFile = sprintf( '%s_method_never_or_void.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' + $this->callOriginalMethod ? 'proxied' : 'mocked', ); } else { $templateFile = sprintf( '%s_method.tpl', - $this->callOriginalMethod ? 'proxied' : 'mocked' + $this->callOriginalMethod ? 'proxied' : 'mocked', ); } @@ -209,7 +209,7 @@ public function generateCode(): string $deprecationTemplate->setVar( [ 'deprecation' => var_export($deprecation, true), - ] + ], ); $deprecation = $deprecationTemplate->render(); @@ -230,7 +230,7 @@ public function generateCode(): string 'reference' => $this->reference, 'clone_arguments' => $this->cloneArguments ? 'true' : 'false', 'deprecation' => $deprecation, - ] + ], ); return $template->render(); @@ -255,7 +255,7 @@ private function getTemplate(string $template): Template throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } @@ -361,18 +361,18 @@ private static function exportDefaultValue(ReflectionParameter $parameter): stri substr( substr( $parameterAsString, - strpos($parameterAsString, ' ') + strlen(' ') + strpos($parameterAsString, ' ') + strlen(' '), ), 0, - -2 - ) + -2, + ), )[1]; // @codeCoverageIgnoreStart } catch (\ReflectionException $e) { throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php index 2188ea0ffc..9d3ab72030 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/ConsecutiveParameters.php @@ -15,9 +15,11 @@ use function sprintf; use PHPUnit\Framework\Constraint\Constraint; use PHPUnit\Framework\Constraint\IsEqual; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\InvalidParameterGroupException; use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -37,7 +39,7 @@ final class ConsecutiveParameters implements ParametersRule private $invocations = []; /** - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public function __construct(array $parameterGroups) { @@ -47,8 +49,8 @@ public function __construct(array $parameterGroups) sprintf( 'Parameter group #%d must be an array or Traversable, got %s', $index, - gettype($parameters) - ) + gettype($parameters), + ), ); } @@ -68,8 +70,8 @@ public function toString(): string } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException */ public function apply(BaseInvocation $invocation): void { @@ -80,8 +82,8 @@ public function apply(BaseInvocation $invocation): void } /** - * @throws \PHPUnit\Framework\ExpectationFailedException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException + * @throws InvalidArgumentException */ public function verify(): void { @@ -95,8 +97,8 @@ public function verify(): void * * @param int $callIndex * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException */ private function verifyInvocation(BaseInvocation $invocation, $callIndex): void { @@ -111,8 +113,8 @@ private function verifyInvocation(BaseInvocation $invocation, $callIndex): void throw new ExpectationFailedException( sprintf( 'Parameter count for invocation %s is too low.', - $invocation->toString() - ) + $invocation->toString(), + ), ); } @@ -124,8 +126,8 @@ private function verifyInvocation(BaseInvocation $invocation, $callIndex): void 'value.', $i, $callIndex, - $invocation->toString() - ) + $invocation->toString(), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php index 9b51f4ef7d..d56618cbcb 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtIndex.php @@ -64,8 +64,8 @@ public function verify(): void throw new ExpectationFailedException( sprintf( 'The expected invocation at index %s was never reached.', - $this->sequenceIndex - ) + $this->sequenceIndex, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php index a84aa65590..afc880e1fa 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastCount.php @@ -48,7 +48,7 @@ public function verify(): void if ($count < $this->requiredInvocations) { throw new ExpectationFailedException( 'Expected invocation at least ' . $this->requiredInvocations . - ' times but it occurred ' . $count . ' time(s).' + ' times but it occurred ' . $count . ' time(s).', ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php index d0ad1f8015..645ed309ad 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtLeastOnce.php @@ -34,7 +34,7 @@ public function verify(): void if ($count < 1) { throw new ExpectationFailedException( - 'Expected invocation at least once but it never occurred.' + 'Expected invocation at least once but it never occurred.', ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php index c3b815aa45..df81a61318 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedAtMostCount.php @@ -48,7 +48,7 @@ public function verify(): void if ($count > $this->allowedInvocations) { throw new ExpectationFailedException( 'Expected invocation at most ' . $this->allowedInvocations . - ' times but it occurred ' . $count . ' time(s).' + ' times but it occurred ' . $count . ' time(s).', ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php index 188326c91f..a962118ebc 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/InvokedCount.php @@ -62,8 +62,8 @@ public function verify(): void 'Method was expected to be called %d times, ' . 'actually called %d times.', $this->expectedCount, - $count - ) + $count, + ), ); } } @@ -92,7 +92,7 @@ protected function invokedDo(BaseInvocation $invocation): void default: $message .= sprintf( 'was not expected to be called more than %d times.', - $this->expectedCount + $this->expectedCount, ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php index 83ba3b8da3..53c638876f 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/MethodName.php @@ -11,6 +11,7 @@ use function is_string; use PHPUnit\Framework\Constraint\Constraint; +use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\InvalidArgumentException; use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; use PHPUnit\Framework\MockObject\MethodNameConstraint; @@ -49,8 +50,8 @@ public function toString(): string } /** - * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function matches(BaseInvocation $invocation): bool { @@ -58,8 +59,8 @@ public function matches(BaseInvocation $invocation): bool } /** - * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws ExpectationFailedException */ public function matchesName(string $methodName): bool { diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php index 3f1cc53ae0..c03671c728 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Rule/Parameters.php @@ -18,6 +18,7 @@ use PHPUnit\Framework\Constraint\IsEqual; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\MockObject\Invocation as BaseInvocation; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -47,7 +48,7 @@ public function __construct(array $parameters) foreach ($parameters as $parameter) { if (!($parameter instanceof Constraint)) { $parameter = new IsEqual( - $parameter + $parameter, ); } @@ -92,8 +93,8 @@ public function apply(BaseInvocation $invocation): void * does the rule will get the invoked() method called which should check * if an expectation is met. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException */ public function verify(): void { @@ -101,8 +102,8 @@ public function verify(): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws ExpectationFailedException + * @throws InvalidArgumentException */ private function doVerify(): bool { @@ -127,7 +128,7 @@ private function doVerify(): bool } throw new ExpectationFailedException( - sprintf($message, $this->invocation->toString()) + sprintf($message, $this->invocation->toString()), ); } @@ -138,8 +139,8 @@ private function doVerify(): bool 'Parameter %s for invocation %s does not match expected ' . 'value.', $i, - $this->invocation->toString() - ) + $this->invocation->toString(), + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php index 0dcf386b3f..8b01656f6d 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ConsecutiveCalls.php @@ -51,7 +51,7 @@ public function toString(): string return sprintf( 'return user-specified value %s', - $exporter->export($this->value) + $exporter->export($this->value), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php index 5d64c96a50..aa9074eb64 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/Exception.php @@ -40,7 +40,7 @@ public function toString(): string return sprintf( 'raise user-specified exception %s', - $exporter->export($this->exception) + $exporter->export($this->exception), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php index e02181e90b..0f24aafc5c 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php @@ -49,7 +49,7 @@ public function toString(): string 'passed arguments', $class, $type, - $this->callback[1] + $this->callback[1], ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php index 0d288cebe0..ea2bb735a8 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnReference.php @@ -39,7 +39,7 @@ public function toString(): string return sprintf( 'return user-specified reference %s', - $exporter->export($this->reference) + $exporter->export($this->reference), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php index fbcd0a07a8..4ecbc3b924 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php +++ b/api/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnStub.php @@ -39,7 +39,7 @@ public function toString(): string return sprintf( 'return user-specified value %s', - $exporter->export($this->value) + $exporter->export($this->value), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php b/api/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php index 51c00619c5..49d73759b9 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php +++ b/api/vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php @@ -9,23 +9,25 @@ */ namespace PHPUnit\Framework; +use SebastianBergmann\RecursionContext\InvalidArgumentException; + /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SkippedTestCase extends TestCase { /** - * @var bool + * @var ?bool */ protected $backupGlobals = false; /** - * @var bool + * @var ?bool */ protected $backupStaticAttributes = false; /** - * @var bool + * @var ?bool */ protected $runTestInSeparateProcess = false; @@ -49,7 +51,7 @@ public function getMessage(): string /** * Returns a string representation of the test case. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function toString(): string { diff --git a/api/vendor/phpunit/phpunit/src/Framework/Test.php b/api/vendor/phpunit/phpunit/src/Framework/Test.php index be0dcd0ef4..2f218ad9f5 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/Test.php +++ b/api/vendor/phpunit/phpunit/src/Framework/Test.php @@ -19,5 +19,5 @@ interface Test extends Countable /** * Runs a test and collects its result in a TestResult instance. */ - public function run(TestResult $result = null): TestResult; + public function run(?TestResult $result = null): TestResult; } diff --git a/api/vendor/phpunit/phpunit/src/Framework/TestBuilder.php b/api/vendor/phpunit/phpunit/src/Framework/TestBuilder.php index 5dd91e2196..77404df084 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/TestBuilder.php +++ b/api/vendor/phpunit/phpunit/src/Framework/TestBuilder.php @@ -31,28 +31,28 @@ public function build(ReflectionClass $theClass, string $methodName): Test if (!$theClass->isInstantiable()) { return new ErrorTestCase( - sprintf('Cannot instantiate class "%s".', $className) + sprintf('Cannot instantiate class "%s".', $className), ); } $backupSettings = TestUtil::getBackupSettings( $className, - $methodName + $methodName, ); $preserveGlobalState = TestUtil::getPreserveGlobalStateSettings( $className, - $methodName + $methodName, ); $runTestInSeparateProcess = TestUtil::getProcessIsolationSettings( $className, - $methodName + $methodName, ); $runClassInSeparateProcess = TestUtil::getClassProcessIsolationSettings( $className, - $methodName + $methodName, ); $constructor = $theClass->getConstructor(); @@ -71,14 +71,14 @@ public function build(ReflectionClass $theClass, string $methodName): Test try { $data = TestUtil::getProvidedData( $className, - $methodName + $methodName, ); } catch (IncompleteTestError $e) { $message = sprintf( "Test for %s::%s marked incomplete by data provider\n%s", $className, $methodName, - $this->throwableToString($e) + $this->throwableToString($e), ); $data = new IncompleteTestCase($className, $methodName, $message); @@ -87,7 +87,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test "Test for %s::%s skipped by data provider\n%s", $className, $methodName, - $this->throwableToString($e) + $this->throwableToString($e), ); $data = new SkippedTestCase($className, $methodName, $message); @@ -96,7 +96,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test "The data provider specified for %s::%s is invalid.\n%s", $className, $methodName, - $this->throwableToString($t) + $this->throwableToString($t), ); $data = new ErrorTestCase($message); @@ -111,7 +111,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, - $backupSettings + $backupSettings, ); } else { $test = $this->buildTestWithoutData($className); @@ -125,7 +125,7 @@ public function build(ReflectionClass $theClass, string $methodName): Test $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, - $backupSettings + $backupSettings, ); } @@ -149,7 +149,7 @@ private function buildDataProviderTestSuite( array $backupSettings ): DataProviderTestSuite { $dataProviderTestSuite = new DataProviderTestSuite( - $className . '::' . $methodName + $className . '::' . $methodName, ); $groups = TestUtil::getGroups($className, $methodName); @@ -169,7 +169,7 @@ private function buildDataProviderTestSuite( $runTestInSeparateProcess, $preserveGlobalState, $runClassInSeparateProcess, - $backupSettings + $backupSettings, ); $dataProviderTestSuite->addTest($_test, $groups); @@ -208,7 +208,7 @@ private function configureTestCase( if ($backupSettings['backupStaticAttributes'] !== null) { $test->setBackupStaticAttributes( - $backupSettings['backupStaticAttributes'] + $backupSettings['backupStaticAttributes'], ); } } @@ -225,7 +225,7 @@ private function throwableToString(Throwable $t): string return sprintf( "%s\n%s", $message, - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); } @@ -233,7 +233,7 @@ private function throwableToString(Throwable $t): string "%s: %s\n%s", get_class($t), $message, - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/TestCase.php b/api/vendor/phpunit/phpunit/src/Framework/TestCase.php index 2d83fe0182..30dd5b954d 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ b/api/vendor/phpunit/phpunit/src/Framework/TestCase.php @@ -60,6 +60,8 @@ use function sprintf; use function strpos; use function substr; +use function sys_get_temp_dir; +use function tempnam; use function trim; use function var_export; use DeepCopy\DeepCopy; @@ -96,12 +98,16 @@ use PHPUnit\Util\GlobalState; use PHPUnit\Util\PHP\AbstractPhpProcess; use PHPUnit\Util\Test as TestUtil; +use Prophecy\Exception\Doubler\ClassNotFoundException; +use Prophecy\Exception\Doubler\DoubleException; +use Prophecy\Exception\Doubler\InterfaceNotFoundException; use Prophecy\Exception\Prediction\PredictionException; use Prophecy\Prophecy\MethodProphecy; use Prophecy\Prophecy\ObjectProphecy; use Prophecy\Prophet; use ReflectionClass; use ReflectionException; +use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use SebastianBergmann\Comparator\Comparator; use SebastianBergmann\Comparator\Factory as ComparatorFactory; use SebastianBergmann\Diff\Differ; @@ -110,6 +116,7 @@ use SebastianBergmann\GlobalState\Restorer; use SebastianBergmann\GlobalState\Snapshot; use SebastianBergmann\ObjectEnumerator\Enumerator; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use SebastianBergmann\Template\Template; use SoapClient; use Throwable; @@ -139,7 +146,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T protected $backupGlobalsBlacklist = []; /** - * @var bool + * @var ?bool */ protected $backupStaticAttributes; @@ -156,7 +163,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T protected $backupStaticAttributesBlacklist = []; /** - * @var bool + * @var ?bool */ protected $runTestInSeparateProcess; @@ -171,7 +178,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T protected $providedTests = []; /** - * @var bool + * @var ?bool */ private $runClassInSeparateProcess; @@ -311,7 +318,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T private $snapshot; /** - * @var \Prophecy\Prophet + * @var Prophet */ private $prophet; @@ -374,7 +381,7 @@ public static function never(): InvokedCountMatcher public static function atLeast(int $requiredInvocations): InvokedAtLeastCountMatcher { return new InvokedAtLeastCountMatcher( - $requiredInvocations + $requiredInvocations, ); } @@ -429,7 +436,7 @@ public static function at(int $index): InvokedAtIndexMatcher if (isset($frame['object']) && $frame['object'] instanceof self) { $frame['object']->addWarning( - 'The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.' + 'The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.', ); break; @@ -543,8 +550,8 @@ protected function tearDown(): void /** * Returns a string representation of the test case. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws InvalidArgumentException */ public function toString(): string { @@ -555,7 +562,7 @@ public function toString(): string throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -563,7 +570,7 @@ public function toString(): string $buffer = sprintf( '%s::%s', $class->name, - $this->getName(false) + $this->getName(false), ); return $buffer . $this->getDataSetAsString(); @@ -592,7 +599,7 @@ public function expectOutputString(string $expectedString): void } /** - * @psalm-param class-string<\Throwable> $exception + * @psalm-param class-string $exception */ public function expectException(string $exception): void { @@ -805,12 +812,12 @@ public function hasFailed(): bool * If no TestResult object is passed a new one will be created. * * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws CodeCoverageException + * @throws InvalidArgumentException + * @throws UnintentionallyCoveredCodeException * @throws UtilException */ - public function run(TestResult $result = null): TestResult + public function run(?TestResult $result = null): TestResult { if ($result === null) { $result = $this->createResult(); @@ -837,18 +844,18 @@ public function run(TestResult $result = null): TestResult throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd if ($runEntireClass) { $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl' + __DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl', ); } else { $template = new Template( - __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl' + __DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl', ); } @@ -924,6 +931,7 @@ public function run(TestResult $result = null): TestResult $codeCoverageCacheDirectory = "'." . $codeCoverageCacheDirectory . ".'"; $configurationFilePath = $GLOBALS['__PHPUNIT_CONFIGURATION_FILE'] ?? ''; + $processResultFile = tempnam(sys_get_temp_dir(), 'phpunit_'); $var = [ 'composerAutoload' => $composerAutoload, @@ -950,6 +958,7 @@ public function run(TestResult $result = null): TestResult 'codeCoverageFilter' => $codeCoverageFilter, 'configurationFilePath' => $configurationFilePath, 'name' => $this->getName(false), + 'processResultFile' => $processResultFile, ]; if (!$runEntireClass) { @@ -959,7 +968,7 @@ public function run(TestResult $result = null): TestResult $template->setVar($var); $php = AbstractPhpProcess::factory(); - $php->runTestJob($template->render(), $this, $result); + $php->runTestJob($template->render(), $this, $result, $processResultFile); } else { $result->run($this); } @@ -1019,7 +1028,7 @@ public function setGroups(array $groups): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @internal This method is not covered by the backward compatibility promise for PHPUnit */ @@ -1035,7 +1044,7 @@ public function getName(bool $withDataSet = true): string /** * Returns the size of the test. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @internal This method is not covered by the backward compatibility promise for PHPUnit */ @@ -1043,12 +1052,12 @@ public function getSize(): int { return TestUtil::getSize( static::class, - $this->getName(false) + $this->getName(false), ); } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @internal This method is not covered by the backward compatibility promise for PHPUnit */ @@ -1058,7 +1067,7 @@ public function hasSize(): bool } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @internal This method is not covered by the backward compatibility promise for PHPUnit */ @@ -1068,7 +1077,7 @@ public function isSmall(): bool } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @internal This method is not covered by the backward compatibility promise for PHPUnit */ @@ -1078,7 +1087,7 @@ public function isMedium(): bool } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * * @internal This method is not covered by the backward compatibility promise for PHPUnit */ @@ -1222,8 +1231,8 @@ public function runBare(): void throw new Warning( implode( "\n", - array_unique($this->warnings) - ) + array_unique($this->warnings), + ), ); } @@ -1596,7 +1605,7 @@ protected function runTest() { if (trim($this->name) === '') { throw new Exception( - 'PHPUnit\Framework\TestCase::$name must be a non-blank string.' + 'PHPUnit\Framework\TestCase::$name must be a non-blank string.', ); } @@ -1617,15 +1626,15 @@ protected function runTest() $exception, LogicalOr::fromConstraints( new ExceptionConstraint(Error::class), - new ExceptionConstraint(\Error::class) - ) + new ExceptionConstraint(\Error::class), + ), ); } else { $this->assertThat( $exception, new ExceptionConstraint( - $this->expectedException - ) + $this->expectedException, + ), ); } } @@ -1634,8 +1643,8 @@ protected function runTest() $this->assertThat( $exception, new ExceptionMessage( - $this->expectedExceptionMessage - ) + $this->expectedExceptionMessage, + ), ); } @@ -1643,8 +1652,8 @@ protected function runTest() $this->assertThat( $exception, new ExceptionMessageRegularExpression( - $this->expectedExceptionMessageRegExp - ) + $this->expectedExceptionMessageRegExp, + ), ); } @@ -1652,8 +1661,8 @@ protected function runTest() $this->assertThat( $exception, new ExceptionCode( - $this->expectedExceptionCode - ) + $this->expectedExceptionCode, + ), ); } @@ -1664,8 +1673,8 @@ protected function runTest() $this->assertThat( null, new ExceptionConstraint( - $this->expectedException - ) + $this->expectedException, + ), ); } elseif ($this->expectedExceptionMessage !== null) { $this->numAssertions++; @@ -1673,8 +1682,8 @@ protected function runTest() throw new AssertionFailedError( sprintf( 'Failed asserting that exception with message "%s" is thrown', - $this->expectedExceptionMessage - ) + $this->expectedExceptionMessage, + ), ); } elseif ($this->expectedExceptionMessageRegExp !== null) { $this->numAssertions++; @@ -1682,8 +1691,8 @@ protected function runTest() throw new AssertionFailedError( sprintf( 'Failed asserting that exception with message matching "%s" is thrown', - $this->expectedExceptionMessageRegExp - ) + $this->expectedExceptionMessageRegExp, + ), ); } elseif ($this->expectedExceptionCode !== null) { $this->numAssertions++; @@ -1691,8 +1700,8 @@ protected function runTest() throw new AssertionFailedError( sprintf( 'Failed asserting that exception with code "%s" is thrown', - $this->expectedExceptionCode - ) + $this->expectedExceptionCode, + ), ); } @@ -1717,8 +1726,8 @@ protected function iniSet(string $varName, string $newValue): void sprintf( 'INI setting "%s" could not be set to "%s".', $varName, - $newValue - ) + $newValue, + ), ); } } @@ -1753,7 +1762,7 @@ protected function setLocale(...$args): void throw new Exception( 'The locale functionality is not implemented on your platform, ' . 'the specified locale does not exist or the category name is ' . - 'invalid.' + 'invalid.', ); } } @@ -1826,7 +1835,7 @@ protected function createPartialMock(string $originalClassName, array $methods): throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -1836,7 +1845,7 @@ protected function createPartialMock(string $originalClassName, array $methods): static function (string $method) use ($reflector) { return !$reflector->hasMethod($method); - } + }, ); if ($mockedMethodsThatDontExist) { @@ -1844,18 +1853,18 @@ static function (string $method) use ($reflector) sprintf( 'createPartialMock() called with method(s) %s that do not exist in %s. This will not be allowed in future versions of PHPUnit.', implode(', ', $mockedMethodsThatDontExist), - $originalClassName - ) + $originalClassName, + ), ); } return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->setMethods(empty($methods) ? null : $methods) - ->getMock(); + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->setMethods(empty($methods) ? null : $methods) + ->getMock(); } /** @@ -1870,9 +1879,9 @@ static function (string $method) use ($reflector) protected function createTestProxy(string $originalClassName, array $constructorArguments = []): MockObject { return $this->getMockBuilder($originalClassName) - ->setConstructorArgs($constructorArguments) - ->enableProxyingToOriginalMethods() - ->getMock(); + ->setConstructorArgs($constructorArguments) + ->enableProxyingToOriginalMethods() + ->getMock(); } /** @@ -1902,7 +1911,7 @@ protected function getMockClass(string $originalClassName, $methods = [], array $callOriginalConstructor, $callOriginalClone, $callAutoload, - $cloneArguments + $cloneArguments, ); return get_class($mock); @@ -1931,7 +1940,7 @@ protected function getMockForAbstractClass(string $originalClassName, array $arg $callOriginalClone, $callAutoload, $mockedMethods, - $cloneArguments + $cloneArguments, ); $this->registerMockObject($mockObject); @@ -1963,7 +1972,7 @@ protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = $wsdlFile, $originalClassName, $methods, - $options + $options, ) ); } @@ -1975,7 +1984,7 @@ protected function getMockFromWsdl(string $wsdlFile, string $originalClassName = $mockClassName, $callOriginalConstructor, false, - false + false, ); $this->registerMockObject($mockObject); @@ -2002,7 +2011,7 @@ protected function getMockForTrait(string $traitName, array $arguments = [], str $callOriginalClone, $callAutoload, $mockedMethods, - $cloneArguments + $cloneArguments, ); $this->registerMockObject($mockObject); @@ -2024,14 +2033,14 @@ protected function getObjectForTrait(string $traitName, array $arguments = [], s $traitClassName, $callAutoload, $callOriginalConstructor, - $arguments + $arguments, ); } /** - * @throws \Prophecy\Exception\Doubler\ClassNotFoundException - * @throws \Prophecy\Exception\Doubler\DoubleException - * @throws \Prophecy\Exception\Doubler\InterfaceNotFoundException + * @throws ClassNotFoundException + * @throws DoubleException + * @throws InterfaceNotFoundException * * @psalm-param class-string|null $classOrInterface * @@ -2088,7 +2097,7 @@ private function verifyMockObjects(): void } $mockObject->__phpunit_verify( - $this->shouldInvocationMockerBeReset($mockObject) + $this->shouldInvocationMockerBeReset($mockObject), ); } @@ -2121,7 +2130,7 @@ private function checkRequirements(): void $missingRequirements = TestUtil::getMissingRequirements( static::class, - $this->name + $this->name, ); if (!empty($missingRequirements)) { @@ -2181,15 +2190,15 @@ private function handleDependencies(): bool } if (isset($passed[$dependencyTarget])) { - if ($passed[$dependencyTarget]['size'] != \PHPUnit\Util\Test::UNKNOWN && - $this->getSize() != \PHPUnit\Util\Test::UNKNOWN && + if ($passed[$dependencyTarget]['size'] != TestUtil::UNKNOWN && + $this->getSize() != TestUtil::UNKNOWN && $passed[$dependencyTarget]['size'] > $this->getSize()) { $this->result->addError( $this, new SkippedTestError( - 'This test depends on a test that is larger than itself.' + 'This test depends on a test that is larger than itself.', ), - 0 + 0, ); return false; @@ -2222,9 +2231,9 @@ private function markSkippedForNotSpecifyingDependency(): void $this->result->addError( $this, new SkippedTestError( - 'This method has an invalid @depends annotation.' + 'This method has an invalid @depends annotation.', ), - 0 + 0, ); $this->result->endTest($this, 0); @@ -2241,10 +2250,10 @@ private function markSkippedForMissingDependency(ExecutionOrderDependency $depen new SkippedTestError( sprintf( 'This test depends on "%s" to pass.', - $dependency->getTarget() - ) + $dependency->getTarget(), + ), ), - 0 + 0, ); $this->result->endTest($this, 0); @@ -2261,10 +2270,10 @@ private function markWarningForUncallableDependency(ExecutionOrderDependency $de new Warning( sprintf( 'This test depends on "%s" which does not exist.', - $dependency->getTarget() - ) + $dependency->getTarget(), + ), ), - 0 + 0, ); $this->result->endTest($this, 0); @@ -2301,7 +2310,7 @@ private function stopOutputBuffering(): void } throw new RiskyTestError( - 'Test code or tested code did not (only) close its own output buffers' + 'Test code or tested code did not (only) close its own output buffers', ); } @@ -2328,7 +2337,7 @@ private function snapshotGlobalState(): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws RiskyTestError */ private function restoreGlobalState(): void @@ -2341,7 +2350,7 @@ private function restoreGlobalState(): void try { $this->compareGlobalStateSnapshots( $this->snapshot, - $this->createGlobalStateSnapshot($this->backupGlobals === true) + $this->createGlobalStateSnapshot($this->backupGlobals === true), ); } catch (RiskyTestError $rte) { // Intentionally left empty @@ -2419,12 +2428,12 @@ private function createGlobalStateSnapshot(bool $backupGlobals): Snapshot false, false, false, - false + false, ); } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException * @throws RiskyTestError */ private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): void @@ -2435,13 +2444,13 @@ private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): $this->compareGlobalStateSnapshotPart( $before->globalVariables(), $after->globalVariables(), - "--- Global variables before the test\n+++ Global variables after the test\n" + "--- Global variables before the test\n+++ Global variables after the test\n", ); $this->compareGlobalStateSnapshotPart( $before->superGlobalVariables(), $after->superGlobalVariables(), - "--- Super-global variables before the test\n+++ Super-global variables after the test\n" + "--- Super-global variables before the test\n+++ Super-global variables after the test\n", ); } @@ -2449,7 +2458,7 @@ private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): $this->compareGlobalStateSnapshotPart( $before->staticAttributes(), $after->staticAttributes(), - "--- Static attributes before the test\n+++ Static attributes after the test\n" + "--- Static attributes before the test\n+++ Static attributes after the test\n", ); } } @@ -2465,11 +2474,11 @@ private function compareGlobalStateSnapshotPart(array $before, array $after, str $diff = $differ->diff( $exporter->export($before), - $exporter->export($after) + $exporter->export($after), ); throw new RiskyTestError( - $diff + $diff, ); } } @@ -2506,7 +2515,7 @@ private function shouldInvocationMockerBeReset(MockObject $mock): bool /** * @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException * @throws \SebastianBergmann\ObjectReflector\InvalidArgumentException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function registerMockObjectsFromTestArguments(array $testArguments, array &$visited = []): void { @@ -2527,7 +2536,7 @@ private function registerMockObjectsFromTestArguments(array $testArguments, arra $this->registerMockObjectsFromTestArguments( $testArgument, - $visited + $visited, ); } } @@ -2538,7 +2547,7 @@ private function setDoesNotPerformAssertionsFromAnnotation(): void { $annotations = TestUtil::parseTestMethodAnnotations( static::class, - $this->name + $this->name, ); if (isset($annotations['method']['doesNotPerformAssertions'])) { @@ -2598,7 +2607,7 @@ private function checkExceptionExpectations(Throwable $throwable): bool throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -2660,10 +2669,10 @@ private function isCallableTestMethod(string $dependency): bool private function createMockObject(string $originalClassName): MockObject { return $this->getMockBuilder($originalClassName) - ->disableOriginalConstructor() - ->disableOriginalClone() - ->disableArgumentCloning() - ->disallowMockingUnknownTypes() - ->getMock(); + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->getMock(); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/TestFailure.php b/api/vendor/phpunit/phpunit/src/Framework/TestFailure.php index 0764bc7896..f49dfc355a 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/TestFailure.php +++ b/api/vendor/phpunit/phpunit/src/Framework/TestFailure.php @@ -95,7 +95,7 @@ public function toString(): string return sprintf( '%s: %s', $this->testName, - $this->thrownException->getMessage() + $this->thrownException->getMessage(), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/TestResult.php b/api/vendor/phpunit/phpunit/src/Framework/TestResult.php index 4fde29facb..0049117d1a 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/TestResult.php +++ b/api/vendor/phpunit/phpunit/src/Framework/TestResult.php @@ -34,6 +34,7 @@ use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use SebastianBergmann\Invoker\Invoker; use SebastianBergmann\Invoker\TimeoutException; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use SebastianBergmann\ResourceOperations\ResourceOperations; use SebastianBergmann\Timer\Timer; use Throwable; @@ -444,7 +445,7 @@ public function startTest(Test $test): void /** * Informs the result that a test was completed. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function endTest(Test $test, float $time): void { @@ -460,7 +461,7 @@ public function endTest(Test $test, float $time): void 'result' => $test->getResult(), 'size' => TestUtil::getSize( $class, - $test->getName(false) + $test->getName(false), ), ]; @@ -634,8 +635,8 @@ public function getCollectCodeCoverageInformation(): bool * Runs a TestCase. * * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws CodeCoverageException + * @throws InvalidArgumentException * @throws UnintentionallyCoveredCodeException */ public function run(Test $test): void @@ -646,7 +647,7 @@ public function run(Test $test): void if ($test instanceof TestCase) { $test->setRegisterMockObjectsFromTestArgumentsRecursively( - $this->registerMockObjectsFromTestArgumentsRecursively + $this->registerMockObjectsFromTestArgumentsRecursively, ); $isAnyCoverageRequired = TestUtil::requiresCodeCoverageDataCollection($test); @@ -667,7 +668,7 @@ public function run(Test $test): void $this->convertDeprecationsToExceptions, $this->convertErrorsToExceptions, $this->convertNoticesToExceptions, - $this->convertWarningsToExceptions + $this->convertWarningsToExceptions, ); $errorHandler->register(); @@ -731,9 +732,9 @@ function_exists('xdebug_start_function_monitor'); $this->addFailure( $test, new RiskyTestError( - $e->getMessage() + $e->getMessage(), ), - $_timeout + $_timeout, ); $risky = true; @@ -758,10 +759,10 @@ function_exists('xdebug_start_function_monitor'); '%s in %s:%s', $e->getMessage(), $frame['file'] ?? $e->getFile(), - $frame['line'] ?? $e->getLine() + $frame['line'] ?? $e->getLine(), ), 0, - $e + $e, ); } catch (Warning $e) { $warning = true; @@ -794,16 +795,17 @@ function_exists('xdebug_start_function_monitor'); '%s() used in %s:%s', $function['function'], $function['filename'], - $function['lineno'] - ) + $function['lineno'], + ), ), - $time + $time, ); } } } if ($this->beStrictAboutTestsThatDoNotTestAnything && + !$test->doesNotPerformAssertions() && $test->getNumAssertions() === 0) { $risky = true; } @@ -811,7 +813,7 @@ function_exists('xdebug_start_function_monitor'); if ($this->forceCoversAnnotation && !$error && !$failure && !$warning && !$incomplete && !$skipped && !$risky) { $annotations = TestUtil::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); if (!isset($annotations['class']['covers']) && @@ -821,9 +823,9 @@ function_exists('xdebug_start_function_monitor'); $this->addFailure( $test, new MissingCoversAnnotationException( - 'This test does not have a @covers annotation but is expected to have one' + 'This test does not have a @covers annotation but is expected to have one', ), - $time + $time, ); $risky = true; @@ -839,20 +841,20 @@ function_exists('xdebug_start_function_monitor'); try { $linesToBeCovered = TestUtil::getLinesToBeCovered( get_class($test), - $test->getName(false) + $test->getName(false), ); $linesToBeUsed = TestUtil::getLinesToBeUsed( get_class($test), - $test->getName(false) + $test->getName(false), ); } catch (InvalidCoversTargetException $cce) { $this->addWarning( $test, new Warning( - $cce->getMessage() + $cce->getMessage(), ), - $time + $time, ); } } @@ -861,12 +863,12 @@ function_exists('xdebug_start_function_monitor'); $this->codeCoverage->stop( $append, $linesToBeCovered, - $linesToBeUsed + $linesToBeUsed, ); } catch (UnintentionallyCoveredCodeException $cce) { $unintentionallyCoveredCodeError = new UnintentionallyCoveredCodeError( 'This test executed code that is not listed as code to be covered or used:' . - PHP_EOL . $cce->getMessage() + PHP_EOL . $cce->getMessage(), ); } catch (OriginalCodeCoverageException $cce) { $error = true; @@ -891,7 +893,7 @@ function_exists('xdebug_start_function_monitor'); $this->addFailure( $test, $unintentionallyCoveredCodeError, - $time + $time, ); } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && !$test->doesNotPerformAssertions() && @@ -903,7 +905,7 @@ function_exists('xdebug_start_function_monitor'); throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -918,7 +920,7 @@ function_exists('xdebug_start_function_monitor'); throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -930,10 +932,10 @@ function_exists('xdebug_start_function_monitor'); sprintf( "This test did not perform any assertions\n\n%s:%d", $reflected->getFileName(), - $reflected->getStartLine() - ) + $reflected->getStartLine(), + ), ), - $time + $time, ); } elseif ($this->beStrictAboutTestsThatDoNotTestAnything && $test->doesNotPerformAssertions() && @@ -943,10 +945,10 @@ function_exists('xdebug_start_function_monitor'); new RiskyTestError( sprintf( 'This test is annotated with "@doesNotPerformAssertions" but performed %d assertions', - $test->getNumAssertions() - ) + $test->getNumAssertions(), + ), ), - $time + $time, ); } elseif ($this->beStrictAboutOutputDuringTests && $test->hasOutput()) { $this->addFailure( @@ -954,24 +956,24 @@ function_exists('xdebug_start_function_monitor'); new OutputError( sprintf( 'This test printed output: %s', - $test->getActualOutput() - ) + $test->getActualOutput(), + ), ), - $time + $time, ); } elseif ($this->beStrictAboutTodoAnnotatedTests && $test instanceof TestCase) { $annotations = TestUtil::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); if (isset($annotations['method']['todo'])) { $this->addFailure( $test, new RiskyTestError( - 'Test method is annotated with @todo' + 'Test method is annotated with @todo', ), - $time + $time, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Framework/TestSuite.php b/api/vendor/phpunit/phpunit/src/Framework/TestSuite.php index a51538b18d..3fa0ba525b 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/TestSuite.php +++ b/api/vendor/phpunit/phpunit/src/Framework/TestSuite.php @@ -44,6 +44,7 @@ use ReflectionClass; use ReflectionException; use ReflectionMethod; +use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use Throwable; /** @@ -166,7 +167,7 @@ public function __construct($theClass = '', string $name = '') if (!is_string($theClass) && !$theClass instanceof ReflectionClass) { throw InvalidArgumentException::create( 1, - 'ReflectionClass object or string' + 'ReflectionClass object or string', ); } @@ -184,7 +185,7 @@ public function __construct($theClass = '', string $name = '') throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -215,9 +216,9 @@ public function __construct($theClass = '', string $name = '') new WarningTestCase( sprintf( 'Class "%s" has no public constructor.', - $theClass->getName() - ) - ) + $theClass->getName(), + ), + ), ); return; @@ -236,9 +237,9 @@ public function __construct($theClass = '', string $name = '') new WarningTestCase( sprintf( 'No tests found in class "%s".', - $theClass->getName() - ) - ) + $theClass->getName(), + ), + ), ); } @@ -267,7 +268,7 @@ public function addTest(Test $test, $groups = []): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -310,7 +311,7 @@ public function addTestSuite($testClass): void if (!(is_object($testClass) || (is_string($testClass) && class_exists($testClass)))) { throw InvalidArgumentException::create( 1, - 'class name or object' + 'class name or object', ); } @@ -322,7 +323,7 @@ public function addTestSuite($testClass): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -336,21 +337,21 @@ public function addTestSuite($testClass): void if (!$testClass->isAbstract() && $testClass->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { try { $method = $testClass->getMethod( - BaseTestRunner::SUITE_METHODNAME + BaseTestRunner::SUITE_METHODNAME, ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd if ($method->isStatic()) { $this->addTest( - $method->invoke(null, $testClass->getName()) + $method->invoke(null, $testClass->getName()), ); $suiteMethod = true; @@ -425,7 +426,7 @@ public function addTestFile(string $filename): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -447,7 +448,7 @@ public function addTestFile(string $filename): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -460,8 +461,8 @@ public function addTestFile(string $filename): void $this->addWarning( sprintf( 'Abstract test case classes with "Test" suffix are deprecated (%s)', - $class->getName() - ) + $class->getName(), + ), ); } @@ -469,14 +470,14 @@ public function addTestFile(string $filename): void if ($class->hasMethod(BaseTestRunner::SUITE_METHODNAME)) { try { $method = $class->getMethod( - BaseTestRunner::SUITE_METHODNAME + BaseTestRunner::SUITE_METHODNAME, ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -493,7 +494,7 @@ public function addTestFile(string $filename): void $expectedClassName = substr( $expectedClassName, 0, - $pos + $pos, ); } @@ -503,8 +504,8 @@ public function addTestFile(string $filename): void "Test case class not matching filename is deprecated\n in %s\n Class name was '%s', expected '%s'", $filename, $class->getShortName(), - $expectedClassName - ) + $expectedClassName, + ), ); } @@ -517,8 +518,8 @@ public function addTestFile(string $filename): void $this->addWarning( sprintf( "Multiple test case classes per file is deprecated\n in %s", - $filename - ) + $filename, + ), ); } @@ -573,7 +574,7 @@ static function ($key): string { return (string) $key; }, - array_keys($this->groups) + array_keys($this->groups), ); } @@ -593,13 +594,13 @@ public function setGroupDetails(array $groups): void /** * Runs the tests and collects their result in a TestResult. * - * @throws \PHPUnit\Framework\CodeCoverageException * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws CodeCoverageException + * @throws UnintentionallyCoveredCodeException * @throws Warning */ - public function run(TestResult $result = null): TestResult + public function run(?TestResult $result = null): TestResult { if ($result === null) { $result = $this->createResult(); @@ -628,7 +629,7 @@ public function run(TestResult $result = null): TestResult call_user_func([$this->name, $beforeClassMethod]); } } - } catch (SkippedTestSuiteError $error) { + } catch (SkippedTestError|SkippedTestSuiteError $error) { foreach ($this->tests() as $test) { $result->startTest($test); $result->addFailure($test, $error, 0); @@ -656,7 +657,7 @@ public function run(TestResult $result = null): TestResult $result->addFailure( $test, new SkippedTestError('Test skipped because of an error in hook method'), - 0 + 0, ); } @@ -857,7 +858,7 @@ public function requires(): array } $this->requiredTests = ExecutionOrderDependency::mergeUnique( ExecutionOrderDependency::filterInvalid($this->requiredTests), - $test->requires() + $test->requires(), ); } @@ -891,13 +892,13 @@ protected function addTestMethod(ReflectionClass $class, ReflectionMethod $metho if ($test instanceof TestCase || $test instanceof DataProviderTestSuite) { $test->setDependencies( - TestUtil::getDependencies($class->getName(), $methodName) + TestUtil::getDependencies($class->getName(), $methodName), ); } $this->addTest( $test, - TestUtil::getGroups($class->getName(), $methodName) + TestUtil::getGroups($class->getName(), $methodName), ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php b/api/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php index 76b12fcfb0..27c9d8b4c8 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php +++ b/api/vendor/phpunit/phpunit/src/Framework/TestSuiteIterator.php @@ -67,7 +67,7 @@ public function getChildren(): self { if (!$this->hasChildren()) { throw new NoChildTestSuiteException( - 'The current item is not a TestSuite instance and therefore does not have any children.' + 'The current item is not a TestSuite instance and therefore does not have any children.', ); } diff --git a/api/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php b/api/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php index e1e41bc44b..d27c6b5777 100644 --- a/api/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php +++ b/api/vendor/phpunit/phpunit/src/Framework/WarningTestCase.php @@ -15,17 +15,17 @@ final class WarningTestCase extends TestCase { /** - * @var bool + * @var ?bool */ protected $backupGlobals = false; /** - * @var bool + * @var ?bool */ protected $backupStaticAttributes = false; /** - * @var bool + * @var ?bool */ protected $runTestInSeparateProcess = false; diff --git a/api/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php b/api/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php index 75a70ca5fc..bbef329fcb 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php +++ b/api/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php @@ -91,7 +91,7 @@ public function getTest(string $suiteClassFile, $suffixes = ''): ?TestSuite /** @var string[] $files */ $files = (new FileIteratorFacade)->getFilesAsArray( $suiteClassFile, - $suffixes + $suffixes, ); $suite = new TestSuite($suiteClassFile); @@ -109,7 +109,7 @@ public function getTest(string $suiteClassFile, $suffixes = ''): ?TestSuite try { $testClass = $this->loadSuiteClass( - $suiteClassFile + $suiteClassFile, ); } catch (\PHPUnit\Exception $e) { $this->runFailed($e->getMessage()); @@ -122,7 +122,7 @@ public function getTest(string $suiteClassFile, $suffixes = ''): ?TestSuite if (!$suiteMethod->isStatic()) { $this->runFailed( - 'suite() method must be static.' + 'suite() method must be static.', ); return null; diff --git a/api/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php b/api/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php index cc22b2508f..f9d8a90d18 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php +++ b/api/vendor/phpunit/phpunit/src/Runner/DefaultTestResultCache.php @@ -107,7 +107,7 @@ public function load(): void $data = json_decode( file_get_contents($this->cacheFilename), - true + true, ); if ($data === null) { @@ -138,8 +138,8 @@ public function persist(): void throw new Exception( sprintf( 'Cannot create directory "%s" for result cache file', - $this->cacheFilename - ) + $this->cacheFilename, + ), ); } @@ -150,9 +150,9 @@ public function persist(): void 'version' => self::VERSION, 'defects' => $this->defects, 'times' => $this->times, - ] + ], ), - LOCK_EX + LOCK_EX, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php b/api/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php index 88f7ccad0c..c57e70e72d 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php +++ b/api/vendor/phpunit/phpunit/src/Runner/Extension/ExtensionHandler.php @@ -35,8 +35,8 @@ public function registerExtension(Extension $extensionConfiguration, TestRunner throw new Exception( sprintf( 'Class "%s" does not implement a PHPUnit\Runner\Hook interface', - $extensionConfiguration->className() - ) + $extensionConfiguration->className(), + ), ); } @@ -56,8 +56,8 @@ public function createTestListenerInstance(Extension $listenerConfiguration): Te throw new Exception( sprintf( 'Class "%s" does not implement the PHPUnit\Framework\TestListener interface', - $listenerConfiguration->className() - ) + $listenerConfiguration->className(), + ), ); } @@ -77,7 +77,7 @@ private function createInstance(Extension $extensionConfiguration): object throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -110,8 +110,8 @@ private function ensureClassExists(Extension $extensionConfiguration): void throw new Exception( sprintf( 'Class "%s" does not exist', - $extensionConfiguration->className() - ) + $extensionConfiguration->className(), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php b/api/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php index e76e12ceb4..c65b194828 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php +++ b/api/vendor/phpunit/phpunit/src/Runner/Extension/PharLoader.php @@ -9,7 +9,11 @@ */ namespace PHPUnit\Runner\Extension; +use function count; +use function explode; +use function implode; use function is_file; +use function strpos; use PharIo\Manifest\ApplicationName; use PharIo\Manifest\Exception as ManifestException; use PharIo\Manifest\ManifestLoader; @@ -39,7 +43,7 @@ public function loadPharExtensionsInDirectory(string $directory): array try { $applicationName = new ApplicationName('phpunit/phpunit'); - $version = new PharIoVersion(Version::series()); + $version = new PharIoVersion($this->phpunitVersion()); $manifest = ManifestLoader::fromFile('phar://' . $file . '/manifest.xml'); if (!$manifest->isExtensionFor($applicationName)) { @@ -74,4 +78,21 @@ public function loadPharExtensionsInDirectory(string $directory): array 'notLoadedExtensions' => $notLoadedExtensions, ]; } + + private function phpunitVersion(): string + { + $version = Version::id(); + + if (strpos($version, '-') === false) { + return $version; + } + + $parts = explode('.', explode('-', $version)[0]); + + if (count($parts) === 2) { + $parts[] = 0; + } + + return implode('.', $parts); + } } diff --git a/api/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php b/api/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php index 3f79da5412..4880470eaf 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php +++ b/api/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php @@ -24,7 +24,7 @@ final class Factory { /** - * @psalm-var array + * @psalm-var array */ private $filters = []; @@ -39,8 +39,8 @@ public function addFilter(ReflectionClass $filter, $args): void throw new Exception( sprintf( 'Class "%s" does not extend RecursiveFilterIterator', - $filter->name - ) + $filter->name, + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php b/api/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php index 42ca77a381..b203c19609 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php +++ b/api/vendor/phpunit/phpunit/src/Runner/Filter/GroupFilterIterator.php @@ -35,7 +35,7 @@ public function __construct(RecursiveIterator $iterator, array $groups, TestSuit if (in_array((string) $group, $groups, true)) { $testHashes = array_map( 'spl_object_hash', - $tests + $tests, ); $this->groupTests = array_merge($this->groupTests, $testHashes); diff --git a/api/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php b/api/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php index 7057e1c470..80ab5817df 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php +++ b/api/vendor/phpunit/phpunit/src/Runner/Filter/NameFilterIterator.php @@ -19,8 +19,10 @@ use PHPUnit\Framework\TestSuite; use PHPUnit\Framework\WarningTestCase; use PHPUnit\Util\RegularExpression; +use PHPUnit\Util\Test; use RecursiveFilterIterator; use RecursiveIterator; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -53,7 +55,7 @@ public function __construct(RecursiveIterator $iterator, string $filter) } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function accept(): bool { @@ -63,7 +65,7 @@ public function accept(): bool return true; } - $tmp = \PHPUnit\Util\Test::describe($test); + $tmp = Test::describe($test); if ($test instanceof ErrorTestCase || $test instanceof WarningTestCase) { $name = $test->getMessage(); @@ -96,7 +98,7 @@ private function setFilter(string $filter): void if (isset($matches[3]) && $matches[2] < $matches[3]) { $filter = sprintf( '%s.*with data set #(\d+)$', - $matches[1] + $matches[1], ); $this->filterMin = (int) $matches[2]; @@ -105,7 +107,7 @@ private function setFilter(string $filter): void $filter = sprintf( '%s.*with data set #%s$', $matches[1], - $matches[2] + $matches[2], ); } } // Handles: @@ -115,7 +117,7 @@ private function setFilter(string $filter): void $filter = sprintf( '%s.*with data set "%s"$', $matches[1], - $matches[2] + $matches[2], ); } @@ -126,8 +128,8 @@ private function setFilter(string $filter): void str_replace( '/', '\\/', - $filter - ) + $filter, + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php b/api/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php index 6590102d71..b345dfc4ff 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php +++ b/api/vendor/phpunit/phpunit/src/Runner/PhptTestCase.php @@ -55,7 +55,9 @@ use PHPUnit\Framework\Test; use PHPUnit\Framework\TestResult; use PHPUnit\Util\PHP\AbstractPhpProcess; +use SebastianBergmann\CodeCoverage\InvalidArgumentException; use SebastianBergmann\CodeCoverage\RawCodeCoverageData; +use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException; use SebastianBergmann\Template\Template; use SebastianBergmann\Timer\Timer; use Throwable; @@ -85,14 +87,14 @@ final class PhptTestCase implements Reorderable, SelfDescribing, Test * * @throws Exception */ - public function __construct(string $filename, AbstractPhpProcess $phpUtil = null) + public function __construct(string $filename, ?AbstractPhpProcess $phpUtil = null) { if (!is_file($filename)) { throw new Exception( sprintf( 'File "%s" does not exist.', - $filename - ) + $filename, + ), ); } @@ -111,12 +113,12 @@ public function count(): int /** * Runs a test and collects its result in a TestResult instance. * - * @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException - * @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws InvalidArgumentException + * @throws UnintentionallyCoveredCodeException */ - public function run(TestResult $result = null): TestResult + public function run(?TestResult $result = null): TestResult { if ($result === null) { $result = new TestResult; @@ -223,7 +225,7 @@ public function run(TestResult $result = null): TestResult $trace[0]['file'], $trace[0]['line'], $trace, - $comparisonFailure ? $diff : '' + $comparisonFailure ? $diff : '', ); } @@ -343,7 +345,7 @@ private function parseEnvSection(string $content): array foreach (explode("\n", trim($content)) as $e) { $e = explode('=', trim($e), 2); - if (!empty($e[0]) && isset($e[1])) { + if ($e[0] !== '' && isset($e[1])) { $env[$e[0]] = $e[1]; } } @@ -408,7 +410,7 @@ private function runSkip(array &$sections, TestResult $result, array $settings): $result->addFailure( $this, new SyntheticSkippedError($message, 0, $trace[0]['file'], $trace[0]['line'], $trace), - 0 + 0, ); $result->endTest($this, 0); @@ -489,7 +491,7 @@ private function parse(): array foreach ($unsupportedSections as $section) { if (isset($sections[$section])) { throw new Exception( - "PHPUnit does not support PHPT {$section} sections" + "PHPUnit does not support PHPT {$section} sections", ); } } @@ -520,8 +522,8 @@ private function parseExternal(array &$sections): void sprintf( 'Could not load --%s-- %s for PHPT file', $section . '_EXTERNAL', - $testDirectory . $externalFilename - ) + $testDirectory . $externalFilename, + ), ); } @@ -579,7 +581,7 @@ private function render(string $code): string "'" . dirname($this->filename) . "'", "'" . $this->filename . "'", ], - $code + $code, ); } @@ -599,7 +601,7 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co $files = $this->getCoverageFiles(); $template = new Template( - __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl' + __DIR__ . '/../Util/PHP/Template/PhptTestCase.tpl', ); $composerAutoload = '\'\''; @@ -619,7 +621,7 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co if (!empty($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { $globals = '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = ' . var_export( $GLOBALS['__PHPUNIT_BOOTSTRAP'], - true + true, ) . ";\n"; } @@ -638,7 +640,7 @@ private function renderForCoverage(string &$job, bool $pathCoverage, ?string $co 'coverageFile' => $files['coverage'], 'driverMethod' => $pathCoverage ? 'forLineAndPathCoverage' : 'forLineCoverage', 'codeCoverageCacheDirectory' => $codeCoverageCacheDirectory, - ] + ], ); file_put_contents($files['job'], $job); diff --git a/api/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php b/api/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php index 0ed8330eda..f957e81ace 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php +++ b/api/vendor/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php @@ -43,7 +43,7 @@ public function load(string $suiteClassFile): ReflectionClass FileLoader::checkAndLoad($suiteClassFile); $loadedClasses = array_values( - array_diff(get_declared_classes(), $loadedClasses) + array_diff(get_declared_classes(), $loadedClasses), ); if (empty($loadedClasses)) { @@ -51,8 +51,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Class %s could not be found in %s', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } } @@ -76,8 +76,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Class %s could not be found in %s', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -88,7 +88,7 @@ public function load(string $suiteClassFile): ReflectionClass throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -99,8 +99,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Class %s declared in %s is abstract', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -116,8 +116,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Method %s::suite() declared in %s is abstract', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -126,8 +126,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Method %s::suite() declared in %s is not public', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } @@ -136,8 +136,8 @@ public function load(string $suiteClassFile): ReflectionClass sprintf( 'Method %s::suite() declared in %s is not static', $suiteClassName, - $suiteClassFile - ) + $suiteClassFile, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php b/api/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php index 64ad845cfd..a48a7db618 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php +++ b/api/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php @@ -24,6 +24,7 @@ use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestSuite; use PHPUnit\Util\Test as TestUtil; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -108,8 +109,8 @@ public function __construct(?TestResultCache $cache = null) } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException * @throws Exception + * @throws InvalidArgumentException */ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDependencies, int $orderDefects, bool $isRootTestSuite = true): void { @@ -123,7 +124,7 @@ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDepend if (!in_array($order, $allowedOrders, true)) { throw new Exception( - '$order must be one of TestSuiteSorter::ORDER_[DEFAULT|REVERSED|RANDOMIZED|DURATION|SIZE]' + '$order must be one of TestSuiteSorter::ORDER_[DEFAULT|REVERSED|RANDOMIZED|DURATION|SIZE]', ); } @@ -134,7 +135,7 @@ public function reorderTestsInSuite(Test $suite, int $order, bool $resolveDepend if (!in_array($orderDefects, $allowedOrderDefects, true)) { throw new Exception( - '$orderDefects must be one of TestSuiteSorter::ORDER_DEFAULT, TestSuiteSorter::ORDER_DEFECTS_FIRST' + '$orderDefects must be one of TestSuiteSorter::ORDER_DEFAULT, TestSuiteSorter::ORDER_DEFECTS_FIRST', ); } @@ -198,7 +199,7 @@ private function sort(TestSuite $suite, int $order, bool $resolveDependencies, i } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function addSuiteToDefectSortOrder(TestSuite $suite): void { @@ -235,12 +236,12 @@ private function sortDefectsFirst(array $tests): array usort( $tests, /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ function ($left, $right) { return $this->cmpDefectPriorityAndTime($left, $right); - } + }, ); return $tests; @@ -251,12 +252,12 @@ private function sortByDuration(array $tests): array usort( $tests, /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ function ($left, $right) { return $this->cmpDuration($left, $right); - } + }, ); return $tests; @@ -267,12 +268,12 @@ private function sortBySize(array $tests): array usort( $tests, /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ function ($left, $right) { return $this->cmpSize($left, $right); - } + }, ); return $tests; @@ -285,7 +286,7 @@ function ($left, $right) * 2. when tests are equally defective, sort the fastest to the front * 3. do not reorder successful tests * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function cmpDefectPriorityAndTime(Test $a, Test $b): int { @@ -312,7 +313,7 @@ private function cmpDefectPriorityAndTime(Test $a, Test $b): int /** * Compares test duration for sorting tests by duration ascending. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function cmpDuration(Test $a, Test $b): int { @@ -373,7 +374,7 @@ private function resolveDependencies(array $tests): array } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function calculateTestExecutionOrder(Test $suite): array { diff --git a/api/vendor/phpunit/phpunit/src/Runner/Version.php b/api/vendor/phpunit/phpunit/src/Runner/Version.php index ae22304040..0e8638cb9b 100644 --- a/api/vendor/phpunit/phpunit/src/Runner/Version.php +++ b/api/vendor/phpunit/phpunit/src/Runner/Version.php @@ -10,6 +10,7 @@ namespace PHPUnit\Runner; use function array_slice; +use function assert; use function dirname; use function explode; use function implode; @@ -33,6 +34,8 @@ final class Version /** * Returns the current version of PHPUnit. + * + * @psalm-return non-empty-string */ public static function id(): string { @@ -41,12 +44,17 @@ public static function id(): string } if (self::$version === '') { - self::$version = (new VersionId('9.6.0', dirname(__DIR__, 2)))->getVersion(); + self::$version = (new VersionId('9.6.22', dirname(__DIR__, 2)))->getVersion(); + + assert(!empty(self::$version)); } return self::$version; } + /** + * @psalm-return non-empty-string + */ public static function series(): string { if (strpos(self::id(), '-')) { @@ -58,6 +66,9 @@ public static function series(): string return implode('.', array_slice(explode('.', $version), 0, 2)); } + /** + * @psalm-return non-empty-string + */ public static function getVersionString(): string { return 'PHPUnit ' . self::id() . ' by Sebastian Bergmann and contributors.'; diff --git a/api/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php b/api/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php index 9030b1dbe7..51f0a51311 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php @@ -121,7 +121,6 @@ final class Builder 'whitelist=', 'dump-xdebug-filter=', ]; - private const SHORT_OPTIONS = 'd:c:hv'; public function fromParameters(array $parameters, array $additionalLongOptions): Configuration @@ -130,13 +129,13 @@ public function fromParameters(array $parameters, array $additionalLongOptions): $options = (new CliParser)->parse( $parameters, self::SHORT_OPTIONS, - array_merge(self::LONG_OPTIONS, $additionalLongOptions) + array_merge(self::LONG_OPTIONS, $additionalLongOptions), ); } catch (CliParserException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -881,7 +880,7 @@ public function fromParameters(array $parameters, array $additionalLongOptions): $verbose, $version, $coverageFilter, - $xdebugFilterFile + $xdebugFilterFile, ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/Command.php b/api/vendor/phpunit/phpunit/src/TextUI/Command.php index 48243caa8c..7b963f0a79 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/Command.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/Command.php @@ -16,6 +16,7 @@ use function assert; use function class_exists; use function copy; +use function explode; use function extension_loaded; use function fgets; use function file_get_contents; @@ -60,6 +61,7 @@ use ReflectionClass; use SebastianBergmann\CodeCoverage\Filter; use SebastianBergmann\CodeCoverage\StaticAnalysis\CacheWarmer; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use SebastianBergmann\Timer\Timer; use Throwable; @@ -99,7 +101,7 @@ public static function main(bool $exit = true): int throw new RuntimeException( $t->getMessage(), (int) $t->getCode(), - $t + $t, ); } } @@ -118,7 +120,7 @@ public function run(array $argv, bool $exit = true): int } else { $suite = $runner->getTest( $this->arguments['test'], - $this->arguments['testSuffixes'] + $this->arguments['testSuffixes'], ); } @@ -256,8 +258,8 @@ protected function handleArguments(array $argv): void $this->exitWithErrorMessage( sprintf( 'unrecognized --order-by option: %s', - $arguments->unrecognizedOrderBy() - ) + $arguments->unrecognizedOrderBy(), + ), ); } @@ -270,7 +272,7 @@ protected function handleArguments(array $argv): void if ($arguments->hasIncludePath()) { ini_set( 'include_path', - $arguments->includePath() . PATH_SEPARATOR . ini_get('include_path') + $arguments->includePath() . PATH_SEPARATOR . ini_get('include_path'), ); } @@ -290,8 +292,8 @@ protected function handleArguments(array $argv): void $this->exitWithErrorMessage( sprintf( 'Cannot open file "%s".', - $arguments->argument() - ) + $arguments->argument(), + ), ); } } @@ -367,7 +369,7 @@ protected function handleArguments(array $argv): void $this->arguments['printer'] = $this->handlePrinter( $phpunitConfiguration->printerClass(), - $file + $file, ); } @@ -376,7 +378,7 @@ protected function handleArguments(array $argv): void $this->arguments['loader'] = $this->handleLoader( $phpunitConfiguration->testSuiteLoaderClass(), - $file + $file, ); } @@ -388,7 +390,7 @@ protected function handleArguments(array $argv): void try { $this->arguments['test'] = (new TestSuiteMapper)->map( $this->arguments['configurationObject']->testSuite(), - $this->arguments['testsuite'] ?? '' + $this->arguments['testsuite'] ?? '', ); } catch (Exception $e) { $this->printVersionString(); @@ -429,7 +431,7 @@ protected function handleLoader(string $loaderClass, string $loaderFile = ''): ? if (!class_exists($loaderClass, false)) { if ($loaderFile == '') { $loaderFile = Filesystem::classNameToFilename( - $loaderClass + $loaderClass, ); } @@ -453,7 +455,7 @@ protected function handleLoader(string $loaderClass, string $loaderFile = ''): ? throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -474,8 +476,8 @@ protected function handleLoader(string $loaderClass, string $loaderFile = ''): ? $this->exitWithErrorMessage( sprintf( 'Could not use "%s" as loader.', - $loaderClass - ) + $loaderClass, + ), ); return null; @@ -491,7 +493,7 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') if (!class_exists($printerClass, false)) { if ($printerFile === '') { $printerFile = Filesystem::classNameToFilename( - $printerClass + $printerClass, ); } @@ -511,8 +513,8 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') $this->exitWithErrorMessage( sprintf( 'Could not use "%s" as printer: class does not exist', - $printerClass - ) + $printerClass, + ), ); } @@ -523,7 +525,7 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') throw new ReflectionException( $e->getMessage(), $e->getCode(), - $e + $e, ); // @codeCoverageIgnoreEnd } @@ -533,8 +535,8 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') sprintf( 'Could not use "%s" as printer: class does not implement %s', $printerClass, - ResultPrinter::class - ) + ResultPrinter::class, + ), ); } @@ -542,8 +544,8 @@ protected function handlePrinter(string $printerClass, string $printerFile = '') $this->exitWithErrorMessage( sprintf( 'Could not use "%s" as printer: class cannot be instantiated', - $printerClass - ) + $printerClass, + ), ); } @@ -568,16 +570,29 @@ protected function handleBootstrap(string $filename): void $this->exitWithErrorMessage($t->getMessage()); } - $this->exitWithErrorMessage( - sprintf( - 'Error in bootstrap script: %s:%s%s%s%s', + $message = sprintf( + 'Error in bootstrap script: %s:%s%s%s%s', + get_class($t), + PHP_EOL, + $t->getMessage(), + PHP_EOL, + $t->getTraceAsString(), + ); + + while ($t = $t->getPrevious()) { + $message .= sprintf( + '%s%sPrevious error: %s:%s%s%s%s', + PHP_EOL, + PHP_EOL, get_class($t), PHP_EOL, $t->getMessage(), PHP_EOL, - $t->getTraceAsString() - ) - ); + $t->getTraceAsString(), + ); + } + + $this->exitWithErrorMessage($message); } } @@ -585,17 +600,31 @@ protected function handleVersionCheck(): void { $this->printVersionString(); - $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit'); - $isOutdated = version_compare($latestVersion, Version::id(), '>'); + $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit'); + $latestCompatibleVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit-' . explode('.', Version::series())[0]); - if ($isOutdated) { + $notLatest = version_compare($latestVersion, Version::id(), '>'); + $notLatestCompatible = version_compare($latestCompatibleVersion, Version::id(), '>'); + + if ($notLatest || $notLatestCompatible) { + print 'You are not using the latest version of PHPUnit.' . PHP_EOL; + } else { + print 'You are using the latest version of PHPUnit.' . PHP_EOL; + } + + if ($notLatestCompatible) { + printf( + 'The latest version compatible with PHPUnit %s is PHPUnit %s.' . PHP_EOL, + Version::id(), + $latestCompatibleVersion, + ); + } + + if ($notLatest) { printf( - 'You are not using the latest version of PHPUnit.' . PHP_EOL . 'The latest version is PHPUnit %s.' . PHP_EOL, - $latestVersion + $latestVersion, ); - } else { - print 'You are using the latest version of PHPUnit.' . PHP_EOL; } exit(TestRunner::SUCCESS_EXIT); @@ -648,7 +677,7 @@ private function handleListGroups(TestSuite $suite, bool $exit): int 'groups', 'excludeGroups', 'testsuite', - ] + ], ); print 'Available test group(s):' . PHP_EOL; @@ -663,7 +692,7 @@ private function handleListGroups(TestSuite $suite, bool $exit): int printf( ' - %s' . PHP_EOL, - $group + $group, ); } @@ -676,7 +705,7 @@ private function handleListGroups(TestSuite $suite, bool $exit): int /** * @throws \PHPUnit\Framework\Exception - * @throws \PHPUnit\TextUI\XmlConfiguration\Exception + * @throws XmlConfiguration\Exception */ private function handleListSuites(bool $exit): int { @@ -689,7 +718,7 @@ private function handleListSuites(bool $exit): int 'groups', 'excludeGroups', 'testsuite', - ] + ], ); print 'Available test suite(s):' . PHP_EOL; @@ -697,7 +726,7 @@ private function handleListSuites(bool $exit): int foreach ($this->arguments['configurationObject']->testSuite() as $testSuite) { printf( ' - %s' . PHP_EOL, - $testSuite->name() + $testSuite->name(), ); } @@ -709,7 +738,7 @@ private function handleListSuites(bool $exit): int } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function handleListTests(TestSuite $suite, bool $exit): int { @@ -721,7 +750,7 @@ private function handleListTests(TestSuite $suite, bool $exit): int 'filter', 'groups', 'excludeGroups', - ] + ], ); $renderer = new TextTestListRenderer; @@ -736,7 +765,7 @@ private function handleListTests(TestSuite $suite, bool $exit): int } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function handleListTestsXml(TestSuite $suite, string $target, bool $exit): int { @@ -748,7 +777,7 @@ private function handleListTestsXml(TestSuite $suite, string $target, bool $exit 'filter', 'groups', 'excludeGroups', - ] + ], ); $renderer = new XmlTestListRenderer; @@ -757,7 +786,7 @@ private function handleListTestsXml(TestSuite $suite, string $target, bool $exit printf( 'Wrote list of tests that would have been run to %s' . PHP_EOL, - $target + $target, ); if ($exit) { @@ -813,8 +842,8 @@ private function generateConfiguration(): void $bootstrapScript, $testsDirectory, $src, - $cacheDirectory - ) + $cacheDirectory, + ), ); print PHP_EOL . 'Generated phpunit.xml in ' . getcwd() . '.' . PHP_EOL; @@ -827,7 +856,16 @@ private function migrateConfiguration(string $filename): void { $this->printVersionString(); - if (!(new SchemaDetector)->detect($filename)->detected()) { + $result = (new SchemaDetector)->detect($filename); + + if (!$result->detected()) { + print $filename . ' does not validate against any known schema.' . PHP_EOL; + + exit(TestRunner::EXCEPTION_EXIT); + } + + /** @psalm-suppress MissingThrowsDocblock */ + if ($result->version() === Version::series()) { print $filename . ' does not need to be migrated.' . PHP_EOL; exit(TestRunner::EXCEPTION_EXIT); @@ -840,7 +878,7 @@ private function migrateConfiguration(string $filename): void try { file_put_contents( $filename, - (new Migrator)->migrate($filename) + (new Migrator)->migrate($filename), ); print 'Migrated configuration: ' . $filename . PHP_EOL; @@ -893,7 +931,7 @@ private function handleWarmCoverageCache(XmlConfiguration\Configuration $configu if ($configuration->codeCoverage()->hasNonEmptyListOfFilesToBeIncludedInCodeCoverageReport()) { (new FilterMapper)->map( $filter, - $configuration->codeCoverage() + $configuration->codeCoverage(), ); } elseif (isset($this->arguments['coverageFilter'])) { if (!is_array($this->arguments['coverageFilter'])) { @@ -920,7 +958,7 @@ private function handleWarmCoverageCache(XmlConfiguration\Configuration $configu $cacheDirectory, !$configuration->codeCoverage()->disableCodeCoverageIgnore(), $configuration->codeCoverage()->ignoreDeprecatedCodeUnits(), - $filter + $filter, ); print 'done [' . $timer->stop()->asString() . ']' . PHP_EOL; @@ -958,7 +996,7 @@ private function warnAboutConflictingOptions(string $key, array $keys): void 'The %s and %s options cannot be combined, %s is ignored' . PHP_EOL, $this->mapKeyToOptionForWarning($_key), $this->mapKeyToOptionForWarning($key), - $this->mapKeyToOptionForWarning($_key) + $this->mapKeyToOptionForWarning($_key), ); $warningPrinted = true; diff --git a/api/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php b/api/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php index 99f0fa9d62..09de8588a0 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/DefaultResultPrinter.php @@ -47,23 +47,15 @@ */ class DefaultResultPrinter extends Printer implements ResultPrinter { - public const EVENT_TEST_START = 0; - - public const EVENT_TEST_END = 1; - + public const EVENT_TEST_START = 0; + public const EVENT_TEST_END = 1; public const EVENT_TESTSUITE_START = 2; - - public const EVENT_TESTSUITE_END = 3; - - public const COLOR_NEVER = 'never'; - - public const COLOR_AUTO = 'auto'; - - public const COLOR_ALWAYS = 'always'; - - public const COLOR_DEFAULT = self::COLOR_NEVER; - - private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; + public const EVENT_TESTSUITE_END = 3; + public const COLOR_NEVER = 'never'; + public const COLOR_AUTO = 'auto'; + public const COLOR_ALWAYS = 'always'; + public const COLOR_DEFAULT = self::COLOR_NEVER; + private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; /** * @var int @@ -150,7 +142,7 @@ public function __construct($out = null, bool $verbose = false, string $colors = if (!in_array($colors, self::AVAILABLE_COLORS, true)) { throw InvalidArgumentException::create( 3, - vsprintf('value from "%s", "%s" or "%s"', self::AVAILABLE_COLORS) + vsprintf('value from "%s", "%s" or "%s"', self::AVAILABLE_COLORS), ); } @@ -279,8 +271,8 @@ public function startTest(Test $test): void $this->write( sprintf( "Test '%s' started\n", - \PHPUnit\Util\Test::describeAsString($test) - ) + \PHPUnit\Util\Test::describeAsString($test), + ), ); } } @@ -294,8 +286,8 @@ public function endTest(Test $test, float $time): void $this->write( sprintf( "Test '%s' ended\n", - \PHPUnit\Util\Test::describeAsString($test) - ) + \PHPUnit\Util\Test::describeAsString($test), + ), ); } @@ -334,8 +326,8 @@ protected function printDefects(array $defects, string $type): void ($count == 1) ? 'was' : 'were', $count, $type, - ($count == 1) ? '' : 's' - ) + ($count == 1) ? '' : 's', + ), ); $i = 1; @@ -363,8 +355,8 @@ protected function printDefectHeader(TestFailure $defect, int $count): void sprintf( "\n%d) %s\n", $count, - $defect->getTestName() - ) + $defect->getTestName(), + ), ); } @@ -421,7 +413,7 @@ protected function printFooter(TestResult $result): void if (count($result) === 0) { $this->writeWithColor( 'fg-black, bg-yellow', - 'No tests executed!' + 'No tests executed!', ); return; @@ -435,8 +427,8 @@ protected function printFooter(TestResult $result): void count($result), (count($result) === 1) ? '' : 's', $this->numAssertions, - ($this->numAssertions === 1) ? '' : 's' - ) + ($this->numAssertions === 1) ? '' : 's', + ), ); return; @@ -451,7 +443,7 @@ protected function printFooter(TestResult $result): void $this->writeWithColor( $color, - 'OK, but incomplete, skipped, or risky tests!' + 'OK, but incomplete, skipped, or risky tests!', ); } else { $this->write("\n"); @@ -461,21 +453,21 @@ protected function printFooter(TestResult $result): void $this->writeWithColor( $color, - 'ERRORS!' + 'ERRORS!', ); } elseif ($result->failureCount()) { $color = 'fg-white, bg-red'; $this->writeWithColor( $color, - 'FAILURES!' + 'FAILURES!', ); } elseif ($result->warningCount()) { $color = 'fg-black, bg-yellow'; $this->writeWithColor( $color, - 'WARNINGS!' + 'WARNINGS!', ); } } @@ -512,8 +504,8 @@ protected function writeProgress(string $progress): void $this->numTestsWidth . 'd (%3s%%)', $this->numTestsRun, $this->numTests, - floor(($this->numTestsRun / $this->numTests) * 100) - ) + floor(($this->numTestsRun / $this->numTests) * 100), + ), ); if ($this->column == $this->maxColumn) { @@ -582,9 +574,9 @@ private function writeCountString(int $count, string $name, string $color, bool '%s%s: %d', !$first ? ', ' : '', $name, - $count + $count, ), - false + false, ); $first = false; diff --git a/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php b/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php index 770ad87429..af387beae3 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestDirectoryNotFoundException.php @@ -22,8 +22,8 @@ public function __construct(string $path) parent::__construct( sprintf( 'Test directory "%s" not found', - $path - ) + $path, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php b/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php index 7ffd2c78c0..3b534f7e75 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/Exception/TestFileNotFoundException.php @@ -22,8 +22,8 @@ public function __construct(string $path) parent::__construct( sprintf( 'Test file "%s" not found', - $path - ) + $path, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/Help.php b/api/vendor/phpunit/phpunit/src/TextUI/Help.php index 084f2a2187..cfa51acb18 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/Help.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/Help.php @@ -11,6 +11,7 @@ use const PHP_EOL; use function count; +use function defined; use function explode; use function max; use function preg_replace_callback; @@ -28,125 +29,6 @@ final class Help { private const LEFT_MARGIN = ' '; - private const HELP_TEXT = [ - 'Usage' => [ - ['text' => 'phpunit [options] UnitTest.php'], - ['text' => 'phpunit [options] '], - ], - - 'Code Coverage Options' => [ - ['arg' => '--coverage-clover ', 'desc' => 'Generate code coverage report in Clover XML format'], - ['arg' => '--coverage-cobertura ', 'desc' => 'Generate code coverage report in Cobertura XML format'], - ['arg' => '--coverage-crap4j ', 'desc' => 'Generate code coverage report in Crap4J XML format'], - ['arg' => '--coverage-html
', 'desc' => 'Generate code coverage report in HTML format'], - ['arg' => '--coverage-php ', 'desc' => 'Export PHP_CodeCoverage object to file'], - ['arg' => '--coverage-text=', 'desc' => 'Generate code coverage report in text format [default: standard output]'], - ['arg' => '--coverage-xml ', 'desc' => 'Generate code coverage report in PHPUnit XML format'], - ['arg' => '--coverage-cache ', 'desc' => 'Cache static analysis results'], - ['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'], - ['arg' => '--coverage-filter ', 'desc' => 'Include in code coverage analysis'], - ['arg' => '--path-coverage', 'desc' => 'Perform path coverage analysis'], - ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable annotations for ignoring code coverage'], - ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage configuration'], - ], - - 'Logging Options' => [ - ['arg' => '--log-junit ', 'desc' => 'Log test execution in JUnit XML format to file'], - ['arg' => '--log-teamcity ', 'desc' => 'Log test execution in TeamCity format to file'], - ['arg' => '--testdox-html ', 'desc' => 'Write agile documentation in HTML format to file'], - ['arg' => '--testdox-text ', 'desc' => 'Write agile documentation in Text format to file'], - ['arg' => '--testdox-xml ', 'desc' => 'Write agile documentation in XML format to file'], - ['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'], - ['arg' => '--no-logging', 'desc' => 'Ignore logging configuration'], - ], - - 'Test Selection Options' => [ - ['arg' => '--list-suites', 'desc' => 'List available test suites'], - ['arg' => '--testsuite ', 'desc' => 'Filter which testsuite to run'], - ['arg' => '--list-groups', 'desc' => 'List available test groups'], - ['arg' => '--group ', 'desc' => 'Only runs tests from the specified group(s)'], - ['arg' => '--exclude-group ', 'desc' => 'Exclude tests from the specified group(s)'], - ['arg' => '--covers ', 'desc' => 'Only runs tests annotated with "@covers "'], - ['arg' => '--uses ', 'desc' => 'Only runs tests annotated with "@uses "'], - ['arg' => '--list-tests', 'desc' => 'List available tests'], - ['arg' => '--list-tests-xml ', 'desc' => 'List available tests in XML format'], - ['arg' => '--filter ', 'desc' => 'Filter which tests to run'], - ['arg' => '--test-suffix ', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'], - ], - - 'Test Execution Options' => [ - ['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'], - ['arg' => '--strict-coverage', 'desc' => 'Be strict about @covers annotation usage'], - ['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'], - ['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'], - ['arg' => '--disallow-resource-usage', 'desc' => 'Be strict about resource usage during small tests'], - ['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'], - ['arg' => '--default-time-limit ', 'desc' => 'Timeout in seconds for tests without @small, @medium or @large'], - ['arg' => '--disallow-todo-tests', 'desc' => 'Disallow @todo-annotated tests'], - ['spacer' => ''], - - ['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'], - ['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'], - ['arg' => '--static-backup', 'desc' => 'Backup and restore static attributes for each test'], - ['spacer' => ''], - - ['arg' => '--colors ', 'desc' => 'Use colors in output ("never", "auto" or "always")'], - ['arg' => '--columns ', 'desc' => 'Number of columns to use for progress output'], - ['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'], - ['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'], - ['arg' => '--stop-on-defect', 'desc' => 'Stop execution upon first not-passed test'], - ['arg' => '--stop-on-error', 'desc' => 'Stop execution upon first error'], - ['arg' => '--stop-on-failure', 'desc' => 'Stop execution upon first error or failure'], - ['arg' => '--stop-on-warning', 'desc' => 'Stop execution upon first warning'], - ['arg' => '--stop-on-risky', 'desc' => 'Stop execution upon first risky test'], - ['arg' => '--stop-on-skipped', 'desc' => 'Stop execution upon first skipped test'], - ['arg' => '--stop-on-incomplete', 'desc' => 'Stop execution upon first incomplete test'], - ['arg' => '--fail-on-incomplete', 'desc' => 'Treat incomplete tests as failures'], - ['arg' => '--fail-on-risky', 'desc' => 'Treat risky tests as failures'], - ['arg' => '--fail-on-skipped', 'desc' => 'Treat skipped tests as failures'], - ['arg' => '--fail-on-warning', 'desc' => 'Treat tests with warnings as failures'], - ['arg' => '-v|--verbose', 'desc' => 'Output more verbose information'], - ['arg' => '--debug', 'desc' => 'Display debugging information'], - ['spacer' => ''], - - ['arg' => '--repeat ', 'desc' => 'Runs the test(s) repeatedly'], - ['arg' => '--teamcity', 'desc' => 'Report test execution progress in TeamCity format'], - ['arg' => '--testdox', 'desc' => 'Report test execution progress in TestDox format'], - ['arg' => '--testdox-group', 'desc' => 'Only include tests from the specified group(s)'], - ['arg' => '--testdox-exclude-group', 'desc' => 'Exclude tests from the specified group(s)'], - ['arg' => '--no-interaction', 'desc' => 'Disable TestDox progress animation'], - ['arg' => '--printer ', 'desc' => 'TestListener implementation to use'], - ['spacer' => ''], - - ['arg' => '--order-by ', 'desc' => 'Run tests in order: default|defects|duration|no-depends|random|reverse|size'], - ['arg' => '--random-order-seed ', 'desc' => 'Use a specific random seed for random order'], - ['arg' => '--cache-result', 'desc' => 'Write test results to cache file'], - ['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'], - ], - - 'Configuration Options' => [ - ['arg' => '--prepend ', 'desc' => 'A PHP script that is included as early as possible'], - ['arg' => '--bootstrap ', 'desc' => 'A PHP script that is included before the tests run'], - ['arg' => '-c|--configuration ', 'desc' => 'Read configuration from XML file'], - ['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'], - ['arg' => '--extensions ', 'desc' => 'A comma separated list of PHPUnit extensions to load'], - ['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'], - ['arg' => '--include-path ', 'desc' => 'Prepend PHP\'s include_path with given path(s)'], - ['arg' => '-d ', 'desc' => 'Sets a php.ini value'], - ['arg' => '--cache-result-file ', 'desc' => 'Specify result cache path and filename'], - ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'], - ['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format'], - ], - - 'Miscellaneous Options' => [ - ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], - ['arg' => '--version', 'desc' => 'Prints the version and exits'], - ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than min and exits'], - ['arg' => '--check-version', 'desc' => 'Check whether PHPUnit is the latest version'], - ], - - ]; - /** * @var int Number of columns required to write the longest option name to the console */ @@ -174,7 +56,7 @@ public function __construct(?int $width = null, ?bool $withColor = null) $this->hasColor = $withColor; } - foreach (self::HELP_TEXT as $options) { + foreach ($this->elements() as $options) { foreach ($options as $option) { if (isset($option['arg'])) { $this->maxArgLength = max($this->maxArgLength, isset($option['arg']) ? strlen($option['arg']) : 0); @@ -199,7 +81,7 @@ public function writeToConsole(): void private function writePlaintext(): void { - foreach (self::HELP_TEXT as $section => $options) { + foreach ($this->elements() as $section => $options) { print "{$section}:" . PHP_EOL; if ($section !== 'Usage') { @@ -227,7 +109,7 @@ private function writePlaintext(): void private function writeWithColor(): void { - foreach (self::HELP_TEXT as $section => $options) { + foreach ($this->elements() as $section => $options) { print Color::colorize('fg-yellow', "{$section}:") . PHP_EOL; foreach ($options as $option) { @@ -247,7 +129,7 @@ static function ($matches) { return Color::colorize('fg-cyan', $matches[0]); }, - $arg + $arg, ); $desc = explode(PHP_EOL, wordwrap($option['desc'], $this->maxDescLength, PHP_EOL)); @@ -262,4 +144,138 @@ static function ($matches) print PHP_EOL; } } + + /** + * @psalm-return array> + */ + private function elements(): array + { + $elements = [ + 'Usage' => [ + ['text' => 'phpunit [options] UnitTest.php'], + ['text' => 'phpunit [options] '], + ], + + 'Code Coverage Options' => [ + ['arg' => '--coverage-clover ', 'desc' => 'Generate code coverage report in Clover XML format'], + ['arg' => '--coverage-cobertura ', 'desc' => 'Generate code coverage report in Cobertura XML format'], + ['arg' => '--coverage-crap4j ', 'desc' => 'Generate code coverage report in Crap4J XML format'], + ['arg' => '--coverage-html ', 'desc' => 'Generate code coverage report in HTML format'], + ['arg' => '--coverage-php ', 'desc' => 'Export PHP_CodeCoverage object to file'], + ['arg' => '--coverage-text=', 'desc' => 'Generate code coverage report in text format [default: standard output]'], + ['arg' => '--coverage-xml ', 'desc' => 'Generate code coverage report in PHPUnit XML format'], + ['arg' => '--coverage-cache ', 'desc' => 'Cache static analysis results'], + ['arg' => '--warm-coverage-cache', 'desc' => 'Warm static analysis cache'], + ['arg' => '--coverage-filter ', 'desc' => 'Include in code coverage analysis'], + ['arg' => '--path-coverage', 'desc' => 'Perform path coverage analysis'], + ['arg' => '--disable-coverage-ignore', 'desc' => 'Disable annotations for ignoring code coverage'], + ['arg' => '--no-coverage', 'desc' => 'Ignore code coverage configuration'], + ], + + 'Logging Options' => [ + ['arg' => '--log-junit ', 'desc' => 'Log test execution in JUnit XML format to file'], + ['arg' => '--log-teamcity ', 'desc' => 'Log test execution in TeamCity format to file'], + ['arg' => '--testdox-html ', 'desc' => 'Write agile documentation in HTML format to file'], + ['arg' => '--testdox-text ', 'desc' => 'Write agile documentation in Text format to file'], + ['arg' => '--testdox-xml ', 'desc' => 'Write agile documentation in XML format to file'], + ['arg' => '--reverse-list', 'desc' => 'Print defects in reverse order'], + ['arg' => '--no-logging', 'desc' => 'Ignore logging configuration'], + ], + + 'Test Selection Options' => [ + ['arg' => '--list-suites', 'desc' => 'List available test suites'], + ['arg' => '--testsuite ', 'desc' => 'Filter which testsuite to run'], + ['arg' => '--list-groups', 'desc' => 'List available test groups'], + ['arg' => '--group ', 'desc' => 'Only runs tests from the specified group(s)'], + ['arg' => '--exclude-group ', 'desc' => 'Exclude tests from the specified group(s)'], + ['arg' => '--covers ', 'desc' => 'Only runs tests annotated with "@covers "'], + ['arg' => '--uses ', 'desc' => 'Only runs tests annotated with "@uses "'], + ['arg' => '--list-tests', 'desc' => 'List available tests'], + ['arg' => '--list-tests-xml ', 'desc' => 'List available tests in XML format'], + ['arg' => '--filter ', 'desc' => 'Filter which tests to run'], + ['arg' => '--test-suffix ', 'desc' => 'Only search for test in files with specified suffix(es). Default: Test.php,.phpt'], + ], + + 'Test Execution Options' => [ + ['arg' => '--dont-report-useless-tests', 'desc' => 'Do not report tests that do not test anything'], + ['arg' => '--strict-coverage', 'desc' => 'Be strict about @covers annotation usage'], + ['arg' => '--strict-global-state', 'desc' => 'Be strict about changes to global state'], + ['arg' => '--disallow-test-output', 'desc' => 'Be strict about output during tests'], + ['arg' => '--disallow-resource-usage', 'desc' => 'Be strict about resource usage during small tests'], + ['arg' => '--enforce-time-limit', 'desc' => 'Enforce time limit based on test size'], + ['arg' => '--default-time-limit ', 'desc' => 'Timeout in seconds for tests without @small, @medium or @large'], + ['arg' => '--disallow-todo-tests', 'desc' => 'Disallow @todo-annotated tests'], + ['spacer' => ''], + + ['arg' => '--process-isolation', 'desc' => 'Run each test in a separate PHP process'], + ['arg' => '--globals-backup', 'desc' => 'Backup and restore $GLOBALS for each test'], + ['arg' => '--static-backup', 'desc' => 'Backup and restore static attributes for each test'], + ['spacer' => ''], + + ['arg' => '--colors ', 'desc' => 'Use colors in output ("never", "auto" or "always")'], + ['arg' => '--columns ', 'desc' => 'Number of columns to use for progress output'], + ['arg' => '--columns max', 'desc' => 'Use maximum number of columns for progress output'], + ['arg' => '--stderr', 'desc' => 'Write to STDERR instead of STDOUT'], + ['arg' => '--stop-on-defect', 'desc' => 'Stop execution upon first not-passed test'], + ['arg' => '--stop-on-error', 'desc' => 'Stop execution upon first error'], + ['arg' => '--stop-on-failure', 'desc' => 'Stop execution upon first error or failure'], + ['arg' => '--stop-on-warning', 'desc' => 'Stop execution upon first warning'], + ['arg' => '--stop-on-risky', 'desc' => 'Stop execution upon first risky test'], + ['arg' => '--stop-on-skipped', 'desc' => 'Stop execution upon first skipped test'], + ['arg' => '--stop-on-incomplete', 'desc' => 'Stop execution upon first incomplete test'], + ['arg' => '--fail-on-incomplete', 'desc' => 'Treat incomplete tests as failures'], + ['arg' => '--fail-on-risky', 'desc' => 'Treat risky tests as failures'], + ['arg' => '--fail-on-skipped', 'desc' => 'Treat skipped tests as failures'], + ['arg' => '--fail-on-warning', 'desc' => 'Treat tests with warnings as failures'], + ['arg' => '-v|--verbose', 'desc' => 'Output more verbose information'], + ['arg' => '--debug', 'desc' => 'Display debugging information'], + ['spacer' => ''], + + ['arg' => '--repeat ', 'desc' => 'Runs the test(s) repeatedly'], + ['arg' => '--teamcity', 'desc' => 'Report test execution progress in TeamCity format'], + ['arg' => '--testdox', 'desc' => 'Report test execution progress in TestDox format'], + ['arg' => '--testdox-group', 'desc' => 'Only include tests from the specified group(s)'], + ['arg' => '--testdox-exclude-group', 'desc' => 'Exclude tests from the specified group(s)'], + ['arg' => '--no-interaction', 'desc' => 'Disable TestDox progress animation'], + ['arg' => '--printer ', 'desc' => 'TestListener implementation to use'], + ['spacer' => ''], + + ['arg' => '--order-by ', 'desc' => 'Run tests in order: default|defects|duration|no-depends|random|reverse|size'], + ['arg' => '--random-order-seed ', 'desc' => 'Use a specific random seed for random order'], + ['arg' => '--cache-result', 'desc' => 'Write test results to cache file'], + ['arg' => '--do-not-cache-result', 'desc' => 'Do not write test results to cache file'], + ], + + 'Configuration Options' => [ + ['arg' => '--prepend ', 'desc' => 'A PHP script that is included as early as possible'], + ['arg' => '--bootstrap ', 'desc' => 'A PHP script that is included before the tests run'], + ['arg' => '-c|--configuration ', 'desc' => 'Read configuration from XML file'], + ['arg' => '--no-configuration', 'desc' => 'Ignore default configuration file (phpunit.xml)'], + ['arg' => '--extensions ', 'desc' => 'A comma separated list of PHPUnit extensions to load'], + ['arg' => '--no-extensions', 'desc' => 'Do not load PHPUnit extensions'], + ['arg' => '--include-path ', 'desc' => 'Prepend PHP\'s include_path with given path(s)'], + ['arg' => '-d ', 'desc' => 'Sets a php.ini value'], + ['arg' => '--cache-result-file ', 'desc' => 'Specify result cache path and filename'], + ['arg' => '--generate-configuration', 'desc' => 'Generate configuration file with suggested settings'], + ['arg' => '--migrate-configuration', 'desc' => 'Migrate configuration file to current format'], + ], + ]; + + if (defined('__PHPUNIT_PHAR__')) { + $elements['PHAR Options'] = [ + ['arg' => '--manifest', 'desc' => 'Print Software Bill of Materials (SBOM) in plain-text format'], + ['arg' => '--sbom', 'desc' => 'Print Software Bill of Materials (SBOM) in CycloneDX XML format'], + ['arg' => '--composer-lock', 'desc' => 'Print composer.lock file used to build the PHAR'], + ]; + } + + $elements['Miscellaneous Options'] = [ + ['arg' => '-h|--help', 'desc' => 'Prints this usage information'], + ['arg' => '--version', 'desc' => 'Prints the version and exits'], + ['arg' => '--atleast-version ', 'desc' => 'Checks that version is greater than min and exits'], + ['arg' => '--check-version', 'desc' => 'Checks whether PHPUnit is the latest version and exits'], + ]; + + return $elements; + } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/api/vendor/phpunit/phpunit/src/TextUI/TestRunner.php index 5135c36bc7..1b23a3dcfb 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/TestRunner.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/TestRunner.php @@ -88,10 +88,8 @@ */ final class TestRunner extends BaseTestRunner { - public const SUCCESS_EXIT = 0; - - public const FAILURE_EXIT = 1; - + public const SUCCESS_EXIT = 0; + public const FAILURE_EXIT = 1; public const EXCEPTION_EXIT = 2; /** @@ -124,7 +122,7 @@ final class TestRunner extends BaseTestRunner */ private $timer; - public function __construct(TestSuiteLoader $loader = null, CodeCoverageFilter $filter = null) + public function __construct(?TestSuiteLoader $loader = null, ?CodeCoverageFilter $filter = null) { if ($filter === null) { $filter = new CodeCoverageFilter; @@ -137,8 +135,8 @@ public function __construct(TestSuiteLoader $loader = null, CodeCoverageFilter $ /** * @throws \PHPUnit\Runner\Exception - * @throws \PHPUnit\TextUI\XmlConfiguration\Exception * @throws Exception + * @throws XmlConfiguration\Exception */ public function run(TestSuite $suite, array $arguments = [], array $warnings = [], bool $exit = true): TestResult { @@ -309,7 +307,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -343,8 +341,8 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ new HtmlResultPrinter( $arguments['testdoxHTMLFile'], $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) + $arguments['testdoxExcludeGroups'], + ), ); } @@ -353,22 +351,22 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ new TextResultPrinter( $arguments['testdoxTextFile'], $arguments['testdoxGroups'], - $arguments['testdoxExcludeGroups'] - ) + $arguments['testdoxExcludeGroups'], + ), ); } if (isset($arguments['testdoxXMLFile'])) { $result->addListener( new XmlResultPrinter( - $arguments['testdoxXMLFile'] - ) + $arguments['testdoxXMLFile'], + ), ); } if (isset($arguments['teamcityLogfile'])) { $result->addListener( - new TeamCity($arguments['teamcityLogfile']) + new TeamCity($arguments['teamcityLogfile']), ); } @@ -376,8 +374,8 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $result->addListener( new JUnit( $arguments['junitLogfile'], - $arguments['reportUselessTests'] - ) + $arguments['reportUselessTests'], + ), ); } @@ -434,7 +432,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ (new FilterMapper)->map( $this->codeCoverageFilter, - $codeCoverageConfiguration + $codeCoverageConfiguration, ); } } @@ -451,7 +449,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $codeCoverage = new CodeCoverage( $codeCoverageDriver, - $this->codeCoverageFilter + $this->codeCoverageFilter, ); if (isset($codeCoverageConfiguration) && $codeCoverageConfiguration->hasCacheDirectory()) { @@ -534,21 +532,21 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $this->writeMessage( 'Configuration', - $arguments['configurationObject']->filename() + $arguments['configurationObject']->filename(), ); } foreach ($arguments['loadedExtensions'] as $extension) { $this->writeMessage( 'Extension', - $extension + $extension, ); } foreach ($arguments['notLoadedExtensions'] as $extension) { $this->writeMessage( 'Extension', - $extension + $extension, ); } } @@ -556,7 +554,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ if ($arguments['executionOrder'] === TestSuiteSorter::ORDER_RANDOMIZED) { $this->writeMessage( 'Random Seed', - (string) $arguments['randomOrderSeed'] + (string) $arguments['randomOrderSeed'], ); } @@ -588,7 +586,7 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $this->writeMessage('Suggestion', 'Migrate your XML configuration using "--migrate-configuration"!'); } else { $this->write( - "\n Warning - The configuration file did not pass validation!\n The following problems have been detected:\n" + "\n Warning - The configuration file did not pass validation!\n The following problems have been detected:\n", ); $this->write($arguments['configurationObject']->validationErrors()); @@ -662,6 +660,21 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $this->printer->printResult($result); if (isset($codeCoverage)) { + if (isset($arguments['coveragePHP'])) { + $this->codeCoverageGenerationStart('PHP'); + + try { + $writer = new PhpReport; + $writer->process($codeCoverage, $arguments['coveragePHP']); + + $this->codeCoverageGenerationSucceeded(); + + unset($writer); + } catch (CodeCoverageException $e) { + $this->codeCoverageGenerationFailed($e); + } + } + if (isset($arguments['coverageClover'])) { $this->codeCoverageGenerationStart('Clover XML'); @@ -716,8 +729,8 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $arguments['reportHighLowerBound'], sprintf( ' and PHPUnit %s', - Version::id() - ) + Version::id(), + ), ); $writer->process($codeCoverage, $arguments['coverageHtml']); @@ -730,21 +743,6 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ } } - if (isset($arguments['coveragePHP'])) { - $this->codeCoverageGenerationStart('PHP'); - - try { - $writer = new PhpReport; - $writer->process($codeCoverage, $arguments['coveragePHP']); - - $this->codeCoverageGenerationSucceeded(); - - unset($writer); - } catch (CodeCoverageException $e) { - $this->codeCoverageGenerationFailed($e); - } - } - if (isset($arguments['coverageText'])) { if ($arguments['coverageText'] === 'php://stdout') { $outputStream = $this->printer; @@ -758,11 +756,11 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ $arguments['reportLowUpperBound'], $arguments['reportHighLowerBound'], $arguments['coverageTextShowUncoveredFiles'], - $arguments['coverageTextShowOnlySummary'] + $arguments['coverageTextShowOnlySummary'], ); $outputStream->write( - $processor->process($codeCoverage, $colors) + $processor->process($codeCoverage, $colors), ); } @@ -866,8 +864,8 @@ private function write(string $buffer): void } /** - * @throws \PHPUnit\TextUI\XmlConfiguration\Exception * @throws Exception + * @throws XmlConfiguration\Exception */ private function handleConfiguration(array &$arguments): void { @@ -1008,22 +1006,24 @@ private function handleConfiguration(array &$arguments): void $arguments['excludeGroups'] = array_diff($groupConfiguration->exclude()->asArrayOfStrings(), $groupCliArgs); } - $extensionHandler = new ExtensionHandler; + if (!isset($arguments['noExtensions'])) { + $extensionHandler = new ExtensionHandler; - foreach ($arguments['configurationObject']->extensions() as $extension) { - $extensionHandler->registerExtension($extension, $this); - } + foreach ($arguments['configurationObject']->extensions() as $extension) { + $extensionHandler->registerExtension($extension, $this); + } - foreach ($arguments['configurationObject']->listeners() as $listener) { - $arguments['listeners'][] = $extensionHandler->createTestListenerInstance($listener); - } + foreach ($arguments['configurationObject']->listeners() as $listener) { + $arguments['listeners'][] = $extensionHandler->createTestListenerInstance($listener); + } - unset($extensionHandler); + unset($extensionHandler); + } foreach ($arguments['unavailableExtensions'] as $extension) { $arguments['warnings'][] = sprintf( 'Extension "%s" is not available', - $extension + $extension, ); } @@ -1033,7 +1033,7 @@ private function handleConfiguration(array &$arguments): void if ($loggingConfiguration->hasText()) { $arguments['listeners'][] = new DefaultResultPrinter( $loggingConfiguration->text()->target()->path(), - true + true, ); } @@ -1147,14 +1147,14 @@ private function processSuiteFilters(TestSuite $suite, array $arguments): void if (!empty($arguments['excludeGroups'])) { $filterFactory->addFilter( new ReflectionClass(ExcludeGroupFilterIterator::class), - $arguments['excludeGroups'] + $arguments['excludeGroups'], ); } if (!empty($arguments['groups'])) { $filterFactory->addFilter( new ReflectionClass(IncludeGroupFilterIterator::class), - $arguments['groups'] + $arguments['groups'], ); } @@ -1166,8 +1166,8 @@ static function (string $name): string { return '__phpunit_covers_' . $name; }, - $arguments['testsCovering'] - ) + $arguments['testsCovering'], + ), ); } @@ -1179,15 +1179,15 @@ static function (string $name): string { return '__phpunit_uses_' . $name; }, - $arguments['testsUsing'] - ) + $arguments['testsUsing'], + ), ); } if ($arguments['filter']) { $filterFactory->addFilter( new ReflectionClass(NameFilterIterator::class), - $arguments['filter'] + $arguments['filter'], ); } @@ -1204,8 +1204,8 @@ private function writeMessage(string $type, string $message): void sprintf( "%-15s%s\n", $type . ':', - $message - ) + $message, + ), ); $this->messagePrinted = true; @@ -1219,7 +1219,7 @@ private function createPrinter(string $class, array $arguments): ResultPrinter $arguments['colors'], $arguments['debug'], $arguments['columns'], - $arguments['reverseList'] + $arguments['reverseList'], ); assert($object instanceof ResultPrinter); @@ -1232,8 +1232,8 @@ private function codeCoverageGenerationStart(string $format): void $this->write( sprintf( "\nGenerating code coverage report in %s format ... ", - $format - ) + $format, + ), ); $this->timer->start(); @@ -1244,8 +1244,8 @@ private function codeCoverageGenerationSucceeded(): void $this->write( sprintf( "done [%s]\n", - $this->timer->stop()->asString() - ) + $this->timer->stop()->asString(), + ), ); } @@ -1255,8 +1255,8 @@ private function codeCoverageGenerationFailed(\Exception $e): void sprintf( "failed [%s]\n%s\n", $this->timer->stop()->asString(), - $e->getMessage() - ) + $e->getMessage(), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php b/api/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php index 170e6602b4..a0ea593ae9 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/TestSuiteMapper.php @@ -60,7 +60,7 @@ public function map(TestSuiteCollection $configuration, string $filter): TestSui $directory->path(), $directory->suffix(), $directory->prefix(), - $exclude + $exclude, ); if (!empty($files)) { @@ -96,7 +96,7 @@ public function map(TestSuiteCollection $configuration, string $filter): TestSui throw new RuntimeException( $e->getMessage(), $e->getCode(), - $e + $e, ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php index 80abfac7db..191113c6e2 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/CodeCoverage.php @@ -150,7 +150,7 @@ public function cacheDirectory(): Directory { if (!$this->hasCacheDirectory()) { throw new Exception( - 'No cache directory has been configured' + 'No cache directory has been configured', ); } @@ -222,7 +222,7 @@ public function clover(): Clover { if (!$this->hasClover()) { throw new Exception( - 'Code Coverage report "Clover XML" has not been configured' + 'Code Coverage report "Clover XML" has not been configured', ); } @@ -244,7 +244,7 @@ public function cobertura(): Cobertura { if (!$this->hasCobertura()) { throw new Exception( - 'Code Coverage report "Cobertura XML" has not been configured' + 'Code Coverage report "Cobertura XML" has not been configured', ); } @@ -266,7 +266,7 @@ public function crap4j(): Crap4j { if (!$this->hasCrap4j()) { throw new Exception( - 'Code Coverage report "Crap4J" has not been configured' + 'Code Coverage report "Crap4J" has not been configured', ); } @@ -288,7 +288,7 @@ public function html(): Html { if (!$this->hasHtml()) { throw new Exception( - 'Code Coverage report "HTML" has not been configured' + 'Code Coverage report "HTML" has not been configured', ); } @@ -310,7 +310,7 @@ public function php(): Php { if (!$this->hasPhp()) { throw new Exception( - 'Code Coverage report "PHP" has not been configured' + 'Code Coverage report "PHP" has not been configured', ); } @@ -332,7 +332,7 @@ public function text(): Text { if (!$this->hasText()) { throw new Exception( - 'Code Coverage report "Text" has not been configured' + 'Code Coverage report "Text" has not been configured', ); } @@ -354,7 +354,7 @@ public function xml(): Xml { if (!$this->hasXml()) { throw new Exception( - 'Code Coverage report "XML" has not been configured' + 'Code Coverage report "XML" has not been configured', ); } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php index 102c96ebc6..82be60323a 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/CodeCoverage/FilterMapper.php @@ -22,7 +22,7 @@ public function map(Filter $filter, CodeCoverage $configuration): void $filter->includeDirectory( $directory->path(), $directory->suffix(), - $directory->prefix() + $directory->prefix(), ); } @@ -34,7 +34,7 @@ public function map(Filter $filter, CodeCoverage $configuration): void $filter->excludeDirectory( $directory->path(), $directory->suffix(), - $directory->prefix() + $directory->prefix(), ); } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php index cc77b1a3c4..9f6a812a41 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php @@ -67,7 +67,7 @@ public function generateDefaultConfiguration(string $phpunitVersion, string $boo $srcDirectory, $cacheDirectory, ], - self::TEMPLATE + self::TEMPLATE, ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php index c1877317dd..fa677212cd 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php @@ -26,6 +26,7 @@ use function trim; use DOMDocument; use DOMElement; +use DOMNode; use DOMNodeList; use DOMXPath; use PHPUnit\Runner\TestSuiteSorter; @@ -49,6 +50,7 @@ use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Xml as TestDoxXml; use PHPUnit\TextUI\XmlConfiguration\Logging\Text; use PHPUnit\TextUI\XmlConfiguration\TestSuite as TestSuiteConfiguration; +use PHPUnit\TextUI\XmlConfigurationTest; use PHPUnit\Util\TestDox\CliTestDoxPrinter; use PHPUnit\Util\VersionComparisonOperator; use PHPUnit\Util\Xml; @@ -73,7 +75,7 @@ public function load(string $filename): Configuration throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -85,7 +87,7 @@ public function load(string $filename): Configuration throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } @@ -100,7 +102,7 @@ public function load(string $filename): Configuration $this->logging($filename, $xpath), $this->php($filename, $xpath), $this->phpunit($filename, $document), - $this->testSuite($filename, $xpath) + $this->testSuite($filename, $xpath), ); } @@ -118,9 +120,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -132,9 +134,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -146,9 +148,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -160,9 +162,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -174,9 +176,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -188,9 +190,9 @@ public function logging(string $filename, DOMXPath $xpath): Logging new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -200,7 +202,7 @@ public function logging(string $filename, DOMXPath $xpath): Logging $teamCity, $testDoxHtml, $testDoxText, - $testDoxXml + $testDoxXml, ); } @@ -228,42 +230,42 @@ public function legacyLogging(string $filename, DOMXPath $xpath): Logging switch ($type) { case 'plain': $text = new Text( - new File($target) + new File($target), ); break; case 'junit': $junit = new Junit( - new File($target) + new File($target), ); break; case 'teamcity': $teamCity = new TeamCity( - new File($target) + new File($target), ); break; case 'testdox-html': $testDoxHtml = new TestDoxHtml( - new File($target) + new File($target), ); break; case 'testdox-text': $testDoxText = new TestDoxText( - new File($target) + new File($target), ); break; case 'testdox-xml': $testDoxXml = new TestDoxXml( - new File($target) + new File($target), ); break; @@ -276,7 +278,7 @@ public function legacyLogging(string $filename, DOMXPath $xpath): Logging $teamCity, $testDoxHtml, $testDoxText, - $testDoxXml + $testDoxXml, ); } @@ -304,7 +306,7 @@ private function getElementConfigurationParameters(string $filename, DOMElement $file = $this->toAbsolutePath( $filename, (string) $element->getAttribute('file'), - true + true, ); } @@ -402,38 +404,38 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do if ($cacheDirectory !== null) { $cacheDirectory = new Directory( - $this->toAbsolutePath($filename, $cacheDirectory) + $this->toAbsolutePath($filename, $cacheDirectory), ); } $pathCoverage = $this->getBooleanAttribute( $element, 'pathCoverage', - false + false, ); $includeUncoveredFiles = $this->getBooleanAttribute( $element, 'includeUncoveredFiles', - true + true, ); $processUncoveredFiles = $this->getBooleanAttribute( $element, 'processUncoveredFiles', - false + false, ); $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute( $element, 'ignoreDeprecatedCodeUnits', - false + false, ); $disableCodeCoverageIgnore = $this->getBooleanAttribute( $element, 'disableCodeCoverageIgnore', - false + false, ); } @@ -445,9 +447,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -459,9 +461,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -473,10 +475,10 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), ), - $this->getIntegerAttribute($element, 'threshold', 30) + $this->getIntegerAttribute($element, 'threshold', 30), ); } @@ -488,11 +490,11 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new Directory( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) + (string) $this->getStringAttribute($element, 'outputDirectory'), + ), ), $this->getIntegerAttribute($element, 'lowUpperBound', 50), - $this->getIntegerAttribute($element, 'highLowerBound', 90) + $this->getIntegerAttribute($element, 'highLowerBound', 90), ); } @@ -504,9 +506,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), + ), ); } @@ -518,11 +520,11 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new File( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputFile') - ) + (string) $this->getStringAttribute($element, 'outputFile'), + ), ), $this->getBooleanAttribute($element, 'showUncoveredFiles', false), - $this->getBooleanAttribute($element, 'showOnlySummary', false) + $this->getBooleanAttribute($element, 'showOnlySummary', false), ); } @@ -534,9 +536,9 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do new Directory( $this->toAbsolutePath( $filename, - (string) $this->getStringAttribute($element, 'outputDirectory') - ) - ) + (string) $this->getStringAttribute($element, 'outputDirectory'), + ), + ), ); } @@ -557,7 +559,7 @@ private function codeCoverage(string $filename, DOMXPath $xpath, DOMDocument $do $html, $php, $text, - $xml + $xml, ); } @@ -569,13 +571,13 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $ignoreDeprecatedCodeUnits = $this->getBooleanAttribute( $document->documentElement, 'ignoreDeprecatedCodeUnitsFromCodeCoverage', - false + false, ); $disableCodeCoverageIgnore = $this->getBooleanAttribute( $document->documentElement, 'disableCodeCoverageIgnore', - false + false, ); $includeUncoveredFiles = true; @@ -587,14 +589,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume if ($element->hasAttribute('addUncoveredFilesFromWhitelist')) { $includeUncoveredFiles = (bool) $this->getBoolean( (string) $element->getAttribute('addUncoveredFilesFromWhitelist'), - true + true, ); } if ($element->hasAttribute('processUncoveredFilesFromWhitelist')) { $processUncoveredFiles = (bool) $this->getBoolean( (string) $element->getAttribute('processUncoveredFilesFromWhitelist'), - false + false, ); } } @@ -622,14 +624,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume switch ($type) { case 'coverage-clover': $clover = new Clover( - new File($target) + new File($target), ); break; case 'coverage-cobertura': $cobertura = new Cobertura( - new File($target) + new File($target), ); break; @@ -637,7 +639,7 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume case 'coverage-crap4j': $crap4j = new Crap4j( new File($target), - $this->getIntegerAttribute($log, 'threshold', 30) + $this->getIntegerAttribute($log, 'threshold', 30), ); break; @@ -646,14 +648,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $html = new CodeCoverageHtml( new Directory($target), $this->getIntegerAttribute($log, 'lowUpperBound', 50), - $this->getIntegerAttribute($log, 'highLowerBound', 90) + $this->getIntegerAttribute($log, 'highLowerBound', 90), ); break; case 'coverage-php': $php = new CodeCoveragePhp( - new File($target) + new File($target), ); break; @@ -662,14 +664,14 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $text = new CodeCoverageText( new File($target), $this->getBooleanAttribute($log, 'showUncoveredFiles', false), - $this->getBooleanAttribute($log, 'showOnlySummary', false) + $this->getBooleanAttribute($log, 'showOnlySummary', false), ); break; case 'coverage-xml': $xml = new CodeCoverageXml( - new Directory($target) + new Directory($target), ); break; @@ -693,7 +695,7 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume $html, $php, $text, - $xml + $xml, ); } @@ -701,7 +703,7 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume * If $value is 'false' or 'true', this returns the value that $value represents. * Otherwise, returns $default, which may be a string in rare cases. * - * @see \PHPUnit\TextUI\XmlConfigurationTest::testPHPConfigurationIsReadCorrectly + * @see XmlConfigurationTest::testPHPConfigurationIsReadCorrectly * * @param bool|string $default * @@ -737,7 +739,7 @@ private function readFilterDirectories(string $filename, DOMXPath $xpath, string $this->toAbsolutePath($filename, $directoryPath), $directoryNode->hasAttribute('prefix') ? (string) $directoryNode->getAttribute('prefix') : '', $directoryNode->hasAttribute('suffix') ? (string) $directoryNode->getAttribute('suffix') : '.php', - $directoryNode->hasAttribute('group') ? (string) $directoryNode->getAttribute('group') : 'DEFAULT' + $directoryNode->hasAttribute('group') ? (string) $directoryNode->getAttribute('group') : 'DEFAULT', ); } @@ -749,6 +751,8 @@ private function readFilterFiles(string $filename, DOMXPath $xpath, string $quer $files = []; foreach ($xpath->query($query) as $file) { + assert($file instanceof DOMNode); + $filePath = (string) $file->textContent; if ($filePath) { @@ -775,16 +779,20 @@ private function parseGroupConfiguration(DOMXPath $xpath, string $root): Groups $exclude = []; foreach ($xpath->query($root . '/include/group') as $group) { + assert($group instanceof DOMNode); + $include[] = new Group((string) $group->textContent); } foreach ($xpath->query($root . '/exclude/group') as $group) { + assert($group instanceof DOMNode); + $exclude[] = new Group((string) $group->textContent); } return new Groups( GroupCollection::fromArray($include), - GroupCollection::fromArray($exclude) + GroupCollection::fromArray($exclude), ); } @@ -809,7 +817,7 @@ private function getBooleanAttribute(DOMElement $element, string $attribute, boo return (bool) $this->getBoolean( (string) $element->getAttribute($attribute), - false + false, ); } @@ -821,7 +829,7 @@ private function getIntegerAttribute(DOMElement $element, string $attribute, int return $this->getInteger( (string) $element->getAttribute($attribute), - $default + $default, ); } @@ -848,6 +856,8 @@ private function php(string $filename, DOMXPath $xpath): Php $includePaths = []; foreach ($xpath->query('php/includePath') as $includePath) { + assert($includePath instanceof DOMNode); + $path = (string) $includePath->textContent; if ($path) { @@ -862,7 +872,7 @@ private function php(string $filename, DOMXPath $xpath): Php $iniSettings[] = new IniSetting( (string) $ini->getAttribute('name'), - (string) $ini->getAttribute('value') + (string) $ini->getAttribute('value'), ); } @@ -875,7 +885,7 @@ private function php(string $filename, DOMXPath $xpath): Php $constants[] = new Constant( (string) $const->getAttribute('name'), - $this->getBoolean($value, $value) + $this->getBoolean($value, $value), ); } @@ -1077,7 +1087,7 @@ private function phpunit(string $filename, DOMDocument $document): PHPUnit $this->getBooleanAttribute($document->documentElement, 'backupGlobals', false), $this->getBooleanAttribute($document->documentElement, 'backupStaticAttributes', false), $this->getBooleanAttribute($document->documentElement, 'registerMockObjectsFromTestArgumentsRecursively', false), - $conflictBetweenPrinterClassAndTestdox + $conflictBetweenPrinterClassAndTestdox, ); } @@ -1171,7 +1181,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti $prefix, $suffix, $phpVersion, - $phpVersionOperator + $phpVersionOperator, ); } @@ -1201,7 +1211,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti $files[] = new TestFile( $this->toAbsolutePath($filename, $file), $phpVersion, - $phpVersionOperator + $phpVersionOperator, ); } @@ -1209,7 +1219,7 @@ private function testSuite(string $filename, DOMXPath $xpath): TestSuiteCollecti (string) $element->getAttribute('name'), TestDirectoryCollection::fromArray($directories), TestFileCollection::fromArray($files), - FileCollection::fromArray($exclude) + FileCollection::fromArray($exclude), ); } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php index abef49f10c..a6b2642316 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilder.php @@ -9,8 +9,6 @@ */ namespace PHPUnit\TextUI\XmlConfiguration; -use function array_key_exists; -use function sprintf; use function version_compare; /** @@ -28,7 +26,7 @@ final class MigrationBuilder IntroduceCoverageElement::class, MoveAttributesFromRootToCoverage::class, MoveAttributesFromFilterWhitelistToCoverage::class, - MoveWhitelistDirectoriesToCoverage::class, + MoveWhitelistIncludesToCoverage::class, MoveWhitelistExcludesToCoverage::class, RemoveEmptyFilter::class, CoverageCloverToReport::class, @@ -47,15 +45,6 @@ final class MigrationBuilder */ public function build(string $fromVersion): array { - if (!array_key_exists($fromVersion, self::AVAILABLE_MIGRATIONS)) { - throw new MigrationBuilderException( - sprintf( - 'Migration from schema version %s is not supported', - $fromVersion - ) - ); - } - $stack = []; foreach (self::AVAILABLE_MIGRATIONS as $version => $migrations) { diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php index 3d3c767af5..ebee6e9179 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationBuilderException.php @@ -9,11 +9,12 @@ */ namespace PHPUnit\TextUI\XmlConfiguration; +use PHPUnit\Exception; use RuntimeException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class MigrationBuilderException extends RuntimeException implements \PHPUnit\Exception +final class MigrationBuilderException extends RuntimeException implements Exception { } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php index f92b2db303..9fa4068ce5 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/MigrationException.php @@ -9,11 +9,12 @@ */ namespace PHPUnit\TextUI\XmlConfiguration; +use PHPUnit\Exception; use RuntimeException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class MigrationException extends RuntimeException implements \PHPUnit\Exception +final class MigrationException extends RuntimeException implements Exception { } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php index 867a844170..de52857ee4 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/IntroduceCoverageElement.php @@ -22,7 +22,7 @@ public function migrate(DOMDocument $document): void $document->documentElement->insertBefore( $coverage, - $document->documentElement->firstChild + $document->documentElement->firstChild, ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php index e987308b73..c07de0ec7f 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/LogToReportMigration.php @@ -67,7 +67,7 @@ abstract protected function toReportFormat(DOMElement $logNode): DOMElement; private function findLogNode(DOMDocument $document): ?DOMElement { $logNode = (new DOMXPath($document))->query( - sprintf('//logging/log[@type="%s"]', $this->forType()) + sprintf('//logging/log[@type="%s"]', $this->forType()), )->item(0); if (!$logNode instanceof DOMElement) { diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php index c55315fa0d..17d5f4db00 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php @@ -47,7 +47,7 @@ public function migrate(DOMDocument $document): void if ($targetExclude === null) { $targetExclude = $coverage->appendChild( - $document->createElement('exclude') + $document->createElement('exclude'), ); } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php similarity index 83% rename from api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php rename to api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php index 14e6cec83a..c75a6d84f9 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistDirectoriesToCoverage.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistIncludesToCoverage.php @@ -16,7 +16,7 @@ /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class MoveWhitelistDirectoriesToCoverage implements Migration +final class MoveWhitelistIncludesToCoverage implements Migration { /** * @throws MigrationException @@ -39,7 +39,11 @@ public function migrate(DOMDocument $document): void $coverage->appendChild($include); foreach (SnapshotNodeList::fromNodeList($whitelist->childNodes) as $child) { - if (!$child instanceof DOMElement || $child->nodeName !== 'directory') { + if (!$child instanceof DOMElement) { + continue; + } + + if (!($child->nodeName === 'directory' || $child->nodeName === 'file')) { continue; } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php index 2e86ab6e9f..ddcfcf0719 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrations/UpdateSchemaLocationTo93.php @@ -21,7 +21,7 @@ public function migrate(DOMDocument $document): void $document->documentElement->setAttributeNS( 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation', - 'https://schema.phpunit.de/9.3/phpunit.xsd' + 'https://schema.phpunit.de/9.3/phpunit.xsd', ); } } diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php index d173e7af24..57bc9f2ebe 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Migration/Migrator.php @@ -34,7 +34,7 @@ public function migrate(string $filename): string sprintf( '"%s" is not a valid PHPUnit XML configuration file that can be migrated', $filename, - ) + ), ); } @@ -42,7 +42,7 @@ public function migrate(string $filename): string $filename, false, true, - true + true, ); foreach ((new MigrationBuilder)->build($origin->version()) as $migration) { diff --git a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php index 5fb0c72b21..f5969945b0 100644 --- a/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php +++ b/api/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/PHP/PhpHandler.php @@ -52,7 +52,7 @@ private function handleIncludePaths(DirectoryCollection $includePaths): void 'include_path', implode(PATH_SEPARATOR, $includePathsAsStrings) . PATH_SEPARATOR . - ini_get('include_path') + ini_get('include_path'), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php b/api/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php index 648f9edc69..764bbbfb47 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php +++ b/api/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php @@ -67,17 +67,12 @@ final class DocBlock */ public const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'; - private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; - + private const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; private const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[\d\t \-.|~^]+)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; - - private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; - - private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; - - private const REGEX_TEST_WITH = '/@testWith\s+/'; + private const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; + private const REGEX_REQUIRES_SETTING = '/@requires\s+(?Psetting)\s+(?P([^ ]+?))\s*(?P[\w\.-]+[\w\.]?)?[ \t]*\r?$/m'; + private const REGEX_REQUIRES = '/@requires\s+(?Pfunction|extension)\s+(?P([^\s<>=!]+))\s*(?P[<>=!]{0,2})\s*(?P[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'; + private const REGEX_TEST_WITH = '/@testWith\s+/'; /** @var string */ private $docComment; @@ -133,7 +128,7 @@ public static function ofClass(ReflectionClass $class): self $class->getEndLine(), $class->getFileName(), $className, - $className + $className, ); } @@ -150,7 +145,7 @@ public static function ofMethod(ReflectionMethod $method, string $classNameInHie $method->getEndLine(), $method->getFileName(), $method->getName(), - $classNameInHierarchy + $classNameInHierarchy, ); } @@ -268,7 +263,7 @@ public function requirements(): array array_filter([ 'setting' => $recordedSettings, 'extension_versions' => $extensionVersions, - ]) + ]), ); } @@ -295,8 +290,8 @@ public function getProvidedData(): ?array throw new InvalidDataSetException( sprintf( 'Data set %s is invalid.', - is_int($key) ? '#' . $key : '"' . $key . '"' - ) + is_int($key) ? '#' . $key : '"' . $key . '"', + ), ); } } @@ -404,14 +399,14 @@ private function getDataFromDataProviderAnnotation(string $docComment): ?array $dataProviderClass = new ReflectionClass($dataProviderClassName); $dataProviderMethod = $dataProviderClass->getMethod( - $dataProviderMethodName + $dataProviderMethodName, ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); // @codeCoverageIgnoreEnd } @@ -440,8 +435,8 @@ private function getDataFromDataProviderAnnotation(string $docComment): ?array sprintf( 'The key "%s" has already been defined in the data provider "%s".', $key, - $match - ) + $match, + ), ); } else { $data[$key] = $value; @@ -483,7 +478,7 @@ private function getDataFromTestWithAnnotation(string $docComment): ?array if (json_last_error() !== JSON_ERROR_NONE) { throw new Exception( - 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg() + 'The data set for the @testWith annotation cannot be parsed: ' . json_last_error_msg(), ); } @@ -499,9 +494,9 @@ private function getDataFromTestWithAnnotation(string $docComment): ?array private function cleanUpMultiLineAnnotation(string $docComment): string { - //removing initial ' * ' for docComment + // removing initial ' * ' for docComment $docComment = str_replace("\r\n", "\n", $docComment); - $docComment = preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); + $docComment = preg_replace('/\n\s*\*\s?/', "\n", $docComment); $docComment = (string) substr($docComment, 0, -1); return rtrim($docComment, "\n"); @@ -538,14 +533,14 @@ static function (ReflectionClass $trait): array { return self::parseDocBlock((string) $trait->getDocComment()); }, - array_values($reflector->getTraits()) - ) + array_values($reflector->getTraits()), + ), ); } return array_merge( $annotations, - self::parseDocBlock((string) $reflector->getDocComment()) + self::parseDocBlock((string) $reflector->getDocComment()), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php b/api/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php index 8ee6c83959..a34cb9ade5 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php +++ b/api/vendor/phpunit/phpunit/src/Util/Annotation/Registry.php @@ -59,7 +59,7 @@ public function forClassName(string $class): DocBlock throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -85,7 +85,7 @@ public function forMethod(string $classInHierarchy, string $method): DocBlock throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/api/vendor/phpunit/phpunit/src/Util/Color.php b/api/vendor/phpunit/phpunit/src/Util/Color.php index b96eb4747b..ee0f412df6 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Color.php +++ b/api/vendor/phpunit/phpunit/src/Util/Color.php @@ -120,7 +120,7 @@ static function ($matches) { return self::dim($matches[0]); }, - $path[$last] + $path[$last], ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/ErrorHandler.php b/api/vendor/phpunit/phpunit/src/Util/ErrorHandler.php index f8566347e8..9fdb85d957 100644 --- a/api/vendor/phpunit/phpunit/src/Util/ErrorHandler.php +++ b/api/vendor/phpunit/phpunit/src/Util/ErrorHandler.php @@ -16,6 +16,7 @@ use const E_USER_NOTICE; use const E_USER_WARNING; use const E_WARNING; +use function defined; use function error_reporting; use function restore_error_handler; use function set_error_handler; @@ -64,7 +65,7 @@ static function ($errorNumber, $errorString) } return false; - } + }, ); $result = $callable(); @@ -93,10 +94,18 @@ public function __invoke(int $errorNumber, string $errorString, string $errorFil return false; } + /** + * E_STRICT is deprecated since PHP 8.4. + * + * @see https://github.com/sebastianbergmann/phpunit/issues/5956 + */ + if (defined('E_STRICT') && $errorNumber === @E_STRICT) { + $errorNumber = E_NOTICE; + } + switch ($errorNumber) { case E_NOTICE: case E_USER_NOTICE: - case E_STRICT: if (!$this->convertNoticesToExceptions) { return false; } diff --git a/api/vendor/phpunit/phpunit/src/Util/ExcludeList.php b/api/vendor/phpunit/phpunit/src/Util/ExcludeList.php index 778eb30912..d539ec5719 100644 --- a/api/vendor/phpunit/phpunit/src/Util/ExcludeList.php +++ b/api/vendor/phpunit/phpunit/src/Util/ExcludeList.php @@ -40,6 +40,7 @@ use SebastianBergmann\Invoker\Invoker; use SebastianBergmann\LinesOfCode\Counter; use SebastianBergmann\ObjectEnumerator\Enumerator; +use SebastianBergmann\ObjectReflector\ObjectReflector; use SebastianBergmann\RecursionContext\Context; use SebastianBergmann\ResourceOperations\ResourceOperations; use SebastianBergmann\Template\Template; @@ -129,6 +130,9 @@ final class ExcludeList // sebastian/object-enumerator Enumerator::class => 1, + // sebastian/object-reflector + ObjectReflector::class => 1, + // sebastian/recursion-context Context::class => 1, @@ -161,8 +165,8 @@ public static function addDirectory(string $directory): void throw new Exception( sprintf( '"%s" is not a directory', - $directory - ) + $directory, + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/FileLoader.php b/api/vendor/phpunit/phpunit/src/Util/FileLoader.php index 8abdc91cf6..e0a665061c 100644 --- a/api/vendor/phpunit/phpunit/src/Util/FileLoader.php +++ b/api/vendor/phpunit/phpunit/src/Util/FileLoader.php @@ -42,7 +42,7 @@ public static function checkAndLoad(string $filename): string $includePathFilename === $localFile || !self::isReadable($includePathFilename)) { throw new Exception( - sprintf('Cannot open file "%s".' . "\n", $filename) + sprintf('Cannot open file "%s".' . "\n", $filename), ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/Filesystem.php b/api/vendor/phpunit/phpunit/src/Util/Filesystem.php index 35b2690b12..886829d2dc 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Filesystem.php +++ b/api/vendor/phpunit/phpunit/src/Util/Filesystem.php @@ -30,7 +30,7 @@ public static function classNameToFilename(string $className): string return str_replace( ['_', '\\'], DIRECTORY_SEPARATOR, - $className + $className, ) . '.php'; } diff --git a/api/vendor/phpunit/phpunit/src/Util/Filter.php b/api/vendor/phpunit/phpunit/src/Util/Filter.php index 42563937d7..94b7e77d92 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Filter.php +++ b/api/vendor/phpunit/phpunit/src/Util/Filter.php @@ -53,7 +53,7 @@ public static function getFilteredStacktrace(Throwable $t): string if (!self::frameExists($eTrace, $eFile, $eLine)) { array_unshift( $eTrace, - ['file' => $eFile, 'line' => $eLine] + ['file' => $eFile, 'line' => $eLine], ); } @@ -65,7 +65,7 @@ public static function getFilteredStacktrace(Throwable $t): string $filteredStacktrace .= sprintf( "%s:%s\n", $frame['file'], - $frame['line'] ?? '?' + $frame['line'] ?? '?', ); } } diff --git a/api/vendor/phpunit/phpunit/src/Util/GlobalState.php b/api/vendor/phpunit/phpunit/src/Util/GlobalState.php index cc5c222864..18b5a6466c 100644 --- a/api/vendor/phpunit/phpunit/src/Util/GlobalState.php +++ b/api/vendor/phpunit/phpunit/src/Util/GlobalState.php @@ -9,6 +9,8 @@ */ namespace PHPUnit\Util; +use const PHP_MAJOR_VERSION; +use const PHP_MINOR_VERSION; use function array_keys; use function array_reverse; use function array_shift; @@ -47,6 +49,79 @@ final class GlobalState '_REQUEST', ]; + /** + * @psalm-var array> + */ + private const DEPRECATED_INI_SETTINGS = [ + '7.3' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.func_overload' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'string.strip_tags' => true, + ], + + '7.4' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.func_overload' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'pdo_odbc.db2_instance_name' => true, + 'string.strip_tags' => true, + ], + + '8.0' => [ + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + ], + + '8.1' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.2' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + + '8.3' => [ + 'auto_detect_line_endings' => true, + 'filter.default' => true, + 'iconv.input_encoding' => true, + 'iconv.output_encoding' => true, + 'iconv.internal_encoding' => true, + 'mbstring.http_input' => true, + 'mbstring.http_output' => true, + 'mbstring.internal_encoding' => true, + 'oci8.old_oci_close_semantics' => true, + ], + ]; + /** * @throws Exception */ @@ -106,10 +181,14 @@ public static function getIniSettingsAsString(): string $result = ''; foreach (ini_get_all(null, false) as $key => $value) { + if (self::isIniSettingDeprecated($key)) { + continue; + } + $result .= sprintf( '@ini_set(%s, %s);' . "\n", self::exportVariable($key), - self::exportVariable((string) $value) + self::exportVariable((string) $value), ); } @@ -127,7 +206,7 @@ public static function getConstantsAsString(): string 'if (!defined(\'%s\')) define(\'%s\', %s);' . "\n", $name, $name, - self::exportVariable($value) + self::exportVariable($value), ); } } @@ -150,7 +229,7 @@ public static function getGlobalsAsString(): string '$GLOBALS[\'%s\'][\'%s\'] = %s;' . "\n", $superGlobalArray, $key, - self::exportVariable($GLOBALS[$superGlobalArray][$key]) + self::exportVariable($GLOBALS[$superGlobalArray][$key]), ); } } @@ -164,7 +243,7 @@ public static function getGlobalsAsString(): string $result .= sprintf( '$GLOBALS[\'%s\'] = %s;' . "\n", $key, - self::exportVariable($GLOBALS[$key]) + self::exportVariable($GLOBALS[$key]), ); } } @@ -200,4 +279,9 @@ private static function arrayOnlyContainsScalars(array $array): bool return $result; } + + private static function isIniSettingDeprecated(string $iniSetting): bool + { + return isset(self::DEPRECATED_INI_SETTINGS[PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION][$iniSetting]); + } } diff --git a/api/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php b/api/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php index 3493d113aa..13dcc0e096 100644 --- a/api/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php +++ b/api/vendor/phpunit/phpunit/src/Util/InvalidDataSetException.php @@ -9,11 +9,12 @@ */ namespace PHPUnit\Util; +use PHPUnit\Exception; use RuntimeException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ -final class InvalidDataSetException extends RuntimeException implements \PHPUnit\Exception +final class InvalidDataSetException extends RuntimeException implements Exception { } diff --git a/api/vendor/phpunit/phpunit/src/Util/Json.php b/api/vendor/phpunit/phpunit/src/Util/Json.php index 752c1fd600..0428bc0378 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Json.php +++ b/api/vendor/phpunit/phpunit/src/Util/Json.php @@ -29,7 +29,7 @@ final class Json /** * Prettify json string. * - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public static function prettify(string $json): string { @@ -37,7 +37,7 @@ public static function prettify(string $json): string if (json_last_error()) { throw new Exception( - 'Cannot prettify invalid json' + 'Cannot prettify invalid json', ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/Log/JUnit.php b/api/vendor/phpunit/phpunit/src/Util/Log/JUnit.php index 3ceb5e8450..c7ba4fc56e 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Log/JUnit.php +++ b/api/vendor/phpunit/phpunit/src/Util/Log/JUnit.php @@ -226,37 +226,37 @@ public function endTestSuite(TestSuite $suite): void { $this->testSuites[$this->testSuiteLevel]->setAttribute( 'tests', - (string) $this->testSuiteTests[$this->testSuiteLevel] + (string) $this->testSuiteTests[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'assertions', - (string) $this->testSuiteAssertions[$this->testSuiteLevel] + (string) $this->testSuiteAssertions[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'errors', - (string) $this->testSuiteErrors[$this->testSuiteLevel] + (string) $this->testSuiteErrors[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'warnings', - (string) $this->testSuiteWarnings[$this->testSuiteLevel] + (string) $this->testSuiteWarnings[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'failures', - (string) $this->testSuiteFailures[$this->testSuiteLevel] + (string) $this->testSuiteFailures[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'skipped', - (string) $this->testSuiteSkipped[$this->testSuiteLevel] + (string) $this->testSuiteSkipped[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'time', - sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]) + sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]), ); if ($this->testSuiteLevel > 1) { @@ -293,7 +293,7 @@ public function startTest(Test $test): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -308,7 +308,7 @@ public function startTest(Test $test): void throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -337,16 +337,16 @@ public function endTest(Test $test, float $time): void $this->currentTestCase->setAttribute( 'assertions', - (string) $numAssertions + (string) $numAssertions, ); $this->currentTestCase->setAttribute( 'time', - sprintf('%F', $time) + sprintf('%F', $time), ); $this->testSuites[$this->testSuiteLevel]->appendChild( - $this->currentTestCase + $this->currentTestCase, ); $this->testSuiteTests[$this->testSuiteLevel]++; @@ -361,7 +361,7 @@ public function endTest(Test $test, float $time): void if (!empty($testOutput)) { $systemOut = $this->document->createElement( 'system-out', - Xml::prepareString($testOutput) + Xml::prepareString($testOutput), ); $this->currentTestCase->appendChild($systemOut); @@ -392,12 +392,12 @@ private function doAddFault(Test $test, Throwable $t, string $type): void $buffer .= trim( TestFailure::exceptionToString($t) . "\n" . - Filter::getFilteredStacktrace($t) + Filter::getFilteredStacktrace($t), ); $fault = $this->document->createElement( $type, - Xml::prepareString($buffer) + Xml::prepareString($buffer), ); if ($t instanceof ExceptionWrapper) { diff --git a/api/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php b/api/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php index 0efe3438aa..3ba687a11c 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php +++ b/api/vendor/phpunit/phpunit/src/Util/Log/TeamCity.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Util\Log; +use const PHP_EOL; use function class_exists; use function count; use function explode; @@ -77,7 +78,7 @@ public function addError(Test $test, Throwable $t, float $time): void 'message' => self::getMessage($t), 'details' => self::getDetails($t), 'duration' => self::toMilliseconds($time), - ] + ], ); } @@ -169,7 +170,7 @@ public function printIgnoredTest(string $testName, Throwable $t, float $time): v 'message' => self::getMessage($t), 'details' => self::getDetails($t), 'duration' => self::toMilliseconds($time), - ] + ], ); } @@ -189,7 +190,7 @@ public function startTestSuite(TestSuite $suite): void $this->printEvent( 'testCount', - ['count' => count($suite)] + ['count' => count($suite)], ); } @@ -271,7 +272,7 @@ public function endTest(Test $test, float $time): void [ 'name' => $test->getName(), 'duration' => self::toMilliseconds($time), - ] + ], ); } @@ -351,7 +352,7 @@ private static function escapeValue(string $text): string return str_replace( ['|', "'", "\n", "\r", ']', '['], ['||', "|'", '|n', '|r', '|]', '|['], - $text + $text, ); } @@ -367,7 +368,7 @@ private static function getFileName($className): string throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/api/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php b/api/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php index 8706ae1a11..9620846a63 100644 --- a/api/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php +++ b/api/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php @@ -15,6 +15,8 @@ use function array_merge; use function assert; use function escapeshellarg; +use function file_exists; +use function file_get_contents; use function ini_get_all; use function restore_error_handler; use function set_error_handler; @@ -24,6 +26,7 @@ use function strrpos; use function substr; use function trim; +use function unlink; use function unserialize; use __PHP_Incomplete_Class; use ErrorException; @@ -35,6 +38,7 @@ use PHPUnit\Framework\TestFailure; use PHPUnit\Framework\TestResult; use SebastianBergmann\Environment\Runtime; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -172,26 +176,33 @@ public function getTimeout(): int /** * Runs a single test in a separate PHP process. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ - public function runTestJob(string $job, Test $test, TestResult $result): void + public function runTestJob(string $job, Test $test, TestResult $result, string $processResultFile): void { $result->startTest($test); - $_result = $this->runJob($job); + $processResult = ''; + $_result = $this->runJob($job); + + if (file_exists($processResultFile)) { + $processResult = file_get_contents($processResultFile); + + @unlink($processResultFile); + } $this->processChildResult( $test, $result, - $_result['stdout'], - $_result['stderr'] + $processResult, + $_result['stderr'], ); } /** * Returns the command based into the configurations. */ - public function getCommand(array $settings, string $file = null): string + public function getCommand(array $settings, ?string $file = null): string { $command = $this->runtime->getBinary(); @@ -199,15 +210,15 @@ public function getCommand(array $settings, string $file = null): string $settings = array_merge( $settings, $this->runtime->getCurrentSettings( - array_keys(ini_get_all('pcov')) - ) + array_keys(ini_get_all('pcov')), + ), ); } elseif ($this->runtime->hasXdebug()) { $settings = array_merge( $settings, $this->runtime->getCurrentSettings( - array_keys(ini_get_all('xdebug')) - ) + array_keys(ini_get_all('xdebug')), + ), ); } @@ -258,7 +269,7 @@ protected function settingsToParameters(array $settings): string /** * Processes the TestResult object from an isolated process. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function processChildResult(Test $test, TestResult $result, string $stdout, string $stderr): void { @@ -268,7 +279,7 @@ private function processChildResult(Test $test, TestResult $result, string $stdo $result->addError( $test, new Exception(trim($stderr)), - $time + $time, ); } else { set_error_handler( @@ -278,7 +289,7 @@ private function processChildResult(Test $test, TestResult $result, string $stdo static function ($errno, $errstr, $errfile, $errline): void { throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); - } + }, ); try { @@ -293,7 +304,7 @@ static function ($errno, $errstr, $errfile, $errline): void $result->addFailure( $test, new AssertionFailedError('Test was run in child process and ended unexpectedly'), - $time + $time, ); } } catch (ErrorException $e) { @@ -303,7 +314,7 @@ static function ($errno, $errstr, $errfile, $errline): void $result->addError( $test, new Exception(trim($stdout), 0, $e), - $time + $time, ); } @@ -322,7 +333,7 @@ static function ($errno, $errstr, $errfile, $errline): void if ($result->getCollectCodeCoverageInformation()) { $result->getCodeCoverage()->merge( - $childResult->getCodeCoverage() + $childResult->getCodeCoverage(), ); } @@ -338,37 +349,37 @@ static function ($errno, $errstr, $errfile, $errline): void $result->addError( $test, $this->getException($notImplemented[0]), - $time + $time, ); } elseif (!empty($risky)) { $result->addError( $test, $this->getException($risky[0]), - $time + $time, ); } elseif (!empty($skipped)) { $result->addError( $test, $this->getException($skipped[0]), - $time + $time, ); } elseif (!empty($errors)) { $result->addError( $test, $this->getException($errors[0]), - $time + $time, ); } elseif (!empty($warnings)) { $result->addWarning( $test, $this->getException($warnings[0]), - $time + $time, ); } elseif (!empty($failures)) { $result->addFailure( $test, $this->getException($failures[0]), - $time + $time, ); } } @@ -402,12 +413,12 @@ private function getException(TestFailure $error): Exception sprintf( '%s: %s', $exceptionArray['_PHP_Incomplete_Class_Name'], - $exceptionArray['message'] + $exceptionArray['message'], ), $exceptionArray['code'], $exceptionArray['file'], $exceptionArray['line'], - $exceptionArray['trace'] + $exceptionArray['trace'], ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php b/api/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php index c4dc11146a..64974f1dff 100644 --- a/api/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php +++ b/api/vendor/phpunit/phpunit/src/Util/PHP/DefaultPhpProcess.php @@ -49,7 +49,7 @@ public function runJob(string $job, array $settings = []): array if (!($this->tempFile = tempnam(sys_get_temp_dir(), 'PHPUnit')) || file_put_contents($this->tempFile, $job) === false) { throw new Exception( - 'Unable to write temporary file' + 'Unable to write temporary file', ); } @@ -101,12 +101,12 @@ protected function runProcess(string $job, array $settings): array $pipeSpec, $pipes, null, - $env + $env, ); if (!is_resource($process)) { throw new Exception( - 'Unable to spawn worker process' + 'Unable to spawn worker process', ); } @@ -138,8 +138,8 @@ protected function runProcess(string $job, array $settings): array throw new Exception( sprintf( 'Job execution aborted after %d seconds', - $this->timeout - ) + $this->timeout, + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl b/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl index 95035e5052..0486d11643 100644 --- a/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl +++ b/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseClass.tpl @@ -58,7 +58,7 @@ function __phpunit_run_isolated_test() $test = new {className}('{name}', unserialize('{data}'), '{dataName}'); $test->setDependencyInput(unserialize('{dependencyInput}')); - $test->setInIsolation(TRUE); + $test->setInIsolation(true); ob_end_clean(); $test->run($result); @@ -68,6 +68,7 @@ function __phpunit_run_isolated_test() } ini_set('xdebug.scream', '0'); + @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ if ($stdout = @stream_get_contents(STDOUT)) { $output = $stdout . $output; @@ -78,13 +79,16 @@ function __phpunit_run_isolated_test() } } - print serialize( - [ - 'testResult' => $test->getResult(), - 'numAssertions' => $test->getNumAssertions(), - 'result' => $result, - 'output' => $output - ] + file_put_contents( + '{processResultFile}', + serialize( + [ + 'testResult' => $test->getResult(), + 'numAssertions' => $test->getNumAssertions(), + 'result' => $result, + 'output' => $output + ] + ) ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl b/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl index da824e7206..067934dbcf 100644 --- a/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl +++ b/api/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl @@ -71,6 +71,7 @@ function __phpunit_run_isolated_test() } ini_set('xdebug.scream', '0'); + @rewind(STDOUT); /* @ as not every STDOUT target stream is rewindable */ if ($stdout = @stream_get_contents(STDOUT)) { $output = $stdout . $output; @@ -81,13 +82,16 @@ function __phpunit_run_isolated_test() } } - print serialize( - [ - 'testResult' => $test->getResult(), - 'numAssertions' => $test->getNumAssertions(), - 'result' => $result, - 'output' => $output - ] + file_put_contents( + '{processResultFile}', + serialize( + [ + 'testResult' => $test->getResult(), + 'numAssertions' => $test->getNumAssertions(), + 'result' => $result, + 'output' => $output + ] + ) ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php b/api/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php index 9ef9255567..338fea7171 100644 --- a/api/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php +++ b/api/vendor/phpunit/phpunit/src/Util/PHP/WindowsPhpProcess.php @@ -20,7 +20,7 @@ */ final class WindowsPhpProcess extends DefaultPhpProcess { - public function getCommand(array $settings, string $file = null): string + public function getCommand(array $settings, ?string $file = null): string { if (PHP_MAJOR_VERSION < 8) { return '"' . parent::getCommand($settings, $file) . '"'; @@ -36,7 +36,7 @@ protected function getHandles(): array { if (false === $stdout_handle = tmpfile()) { throw new Exception( - 'A temporary file could not be created; verify that your TEMP environment variable is writable' + 'A temporary file could not be created; verify that your TEMP environment variable is writable', ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/Printer.php b/api/vendor/phpunit/phpunit/src/Util/Printer.php index 77b5745ad9..311d49433b 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Printer.php +++ b/api/vendor/phpunit/phpunit/src/Util/Printer.php @@ -67,8 +67,8 @@ public function __construct($out = null) throw new Exception( sprintf( '"%s" does not match "socket://hostname:port" format', - $out - ) + $out, + ), ); } @@ -81,8 +81,8 @@ public function __construct($out = null) throw new Exception( sprintf( 'Directory "%s" was not created', - dirname($out) - ) + dirname($out), + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/RegularExpression.php b/api/vendor/phpunit/phpunit/src/Util/RegularExpression.php index db1dae922e..1e97d6c2fb 100644 --- a/api/vendor/phpunit/phpunit/src/Util/RegularExpression.php +++ b/api/vendor/phpunit/phpunit/src/Util/RegularExpression.php @@ -25,7 +25,7 @@ public static function safeMatch(string $pattern, string $subject) static function () use ($pattern, $subject) { return preg_match($pattern, $subject); - } + }, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Util/Test.php b/api/vendor/phpunit/phpunit/src/Util/Test.php index f089f6d43a..4d6319b9de 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Test.php +++ b/api/vendor/phpunit/phpunit/src/Util/Test.php @@ -52,6 +52,7 @@ use SebastianBergmann\CodeUnit\InvalidCodeUnitException; use SebastianBergmann\CodeUnit\Mapper; use SebastianBergmann\Environment\OperatingSystem; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -84,7 +85,7 @@ final class Test private static $hookMethods = []; /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public static function describe(\PHPUnit\Framework\Test $test): array { @@ -119,7 +120,7 @@ public static function getLinesToBeCovered(string $className, string $methodName { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); if (!self::shouldCoversAnnotationBeUsed($annotations)) { @@ -145,7 +146,7 @@ public static function requiresCodeCoverageDataCollection(TestCase $test): bool { $annotations = self::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); // If there is no @covers annotation but a @coversNothing annotation on @@ -182,7 +183,7 @@ public static function getRequirements(string $className, string $methodName): a { return self::mergeArraysRecursively( Registry::getInstance()->forClassName($className)->requirements(), - Registry::getInstance()->forMethod($className, $methodName)->requirements() + Registry::getInstance()->forMethod($className, $methodName)->requirements(), ); } @@ -213,7 +214,7 @@ public static function getMissingRequirements(string $className, string $methodN if (!$required['PHP_constraint']['constraint']->complies($version)) { $missing[] = sprintf( 'PHP version does not match the required constraint %s.', - $required['PHP_constraint']['constraint']->asString() + $required['PHP_constraint']['constraint']->asString(), ); $hint = 'PHP_constraint'; @@ -235,7 +236,7 @@ public static function getMissingRequirements(string $className, string $methodN if (!$required['PHPUnit_constraint']['constraint']->complies($phpunitVersion)) { $missing[] = sprintf( 'PHPUnit version does not match the required constraint %s.', - $required['PHPUnit_constraint']['constraint']->asString() + $required['PHPUnit_constraint']['constraint']->asString(), ); $hint = $hint ?? 'PHPUnit_constraint'; @@ -331,7 +332,7 @@ public static function getProvidedData(string $className, string $methodName): ? /** * @psalm-param class-string $className */ - public static function parseTestMethodAnnotations(string $className, ?string $methodName = ''): array + public static function parseTestMethodAnnotations(string $className, ?string $methodName = null): array { $registry = Registry::getInstance(); @@ -367,12 +368,12 @@ public static function getBackupSettings(string $className, string $methodName): 'backupGlobals' => self::getBooleanAnnotationSetting( $className, $methodName, - 'backupGlobals' + 'backupGlobals', ), 'backupStaticAttributes' => self::getBooleanAnnotationSetting( $className, $methodName, - 'backupStaticAttributes' + 'backupStaticAttributes', ), ]; } @@ -386,7 +387,7 @@ public static function getDependencies(string $className, string $methodName): a { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); $dependsAnnotations = $annotations['class']['depends'] ?? []; @@ -394,7 +395,7 @@ public static function getDependencies(string $className, string $methodName): a if (isset($annotations['method']['depends'])) { $dependsAnnotations = array_merge( $dependsAnnotations, - $annotations['method']['depends'] + $annotations['method']['depends'], ); } @@ -413,7 +414,7 @@ public static function getGroups(string $className, ?string $methodName = ''): a { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); $groups = []; @@ -492,7 +493,7 @@ public static function getProcessIsolationSettings(string $className, string $me { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); return isset($annotations['class']['runTestsInSeparateProcesses']) || isset($annotations['method']['runInSeparateProcess']); @@ -503,7 +504,7 @@ public static function getClassProcessIsolationSettings(string $className, strin { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); return isset($annotations['class']['runClassInSeparateProcess']); @@ -515,7 +516,7 @@ public static function getPreserveGlobalStateSettings(string $className, string return self::getBooleanAnnotationSetting( $className, $methodName, - 'preserveGlobalState' + 'preserveGlobalState', ); } @@ -537,7 +538,7 @@ public static function getHookMethods(string $className): array if ($docBlock->isHookToBeExecutedBeforeClass()) { array_unshift( self::$hookMethods[$className]['beforeClass'], - $method->getName() + $method->getName(), ); } @@ -549,14 +550,14 @@ public static function getHookMethods(string $className): array if ($docBlock->isToBeExecutedBeforeTest()) { array_unshift( self::$hookMethods[$className]['before'], - $method->getName() + $method->getName(), ); } if ($docBlock->isToBeExecutedAsPreCondition()) { array_unshift( self::$hookMethods[$className]['preCondition'], - $method->getName() + $method->getName(), ); } @@ -589,9 +590,9 @@ public static function isTestMethod(ReflectionMethod $method): bool 'test', Registry::getInstance()->forMethod( $method->getDeclaringClass()->getName(), - $method->getName() + $method->getName(), ) - ->symbolAnnotations() + ->symbolAnnotations(), ); } @@ -604,7 +605,7 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); $classShortcut = null; @@ -615,8 +616,8 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met sprintf( 'More than one @%sClass annotation in class or interface "%s".', $mode, - $className - ) + $className, + ), ); } @@ -645,8 +646,8 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met throw new InvalidCoversTargetException( sprintf( 'Trying to @cover interface "%s".', - $element - ) + $element, + ), ); } @@ -657,10 +658,10 @@ private static function getLinesToBeCoveredOrUsed(string $className, string $met sprintf( '"@%s %s" is invalid', $mode, - $element + $element, ), $e->getCode(), - $e + $e, ); } } @@ -685,7 +686,7 @@ private static function getBooleanAnnotationSetting(string $className, ?string $ { $annotations = self::parseTestMethodAnnotations( $className, - $methodName + $methodName, ); if (isset($annotations['method'][$settingName])) { @@ -720,7 +721,7 @@ private static function sanitizeVersionNumber(string $version) return preg_replace( '/^(\d+\.\d+(?:.\d+)?).*$/', '$1', - $version + $version, ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php b/api/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php index def16c3982..3348957de8 100644 --- a/api/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php +++ b/api/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php @@ -21,12 +21,16 @@ use function strlen; use function strpos; use function trim; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\TestFailure; use PHPUnit\Framework\TestResult; use PHPUnit\Runner\BaseTestRunner; use PHPUnit\Runner\PhptTestCase; use PHPUnit\Util\Color; +use PHPUnit\Util\Filter; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use SebastianBergmann\Timer\ResourceUsageFormatter; use SebastianBergmann\Timer\Timer; use Throwable; @@ -66,7 +70,6 @@ class CliTestDoxPrinter extends TestDoxPrinter " \e[36m◑\e[0m running tests", " \e[36m◒\e[0m running tests", ]; - private const STATUS_STYLES = [ BaseTestRunner::STATUS_PASSED => [ 'symbol' => '✔', @@ -123,7 +126,7 @@ class CliTestDoxPrinter extends TestDoxPrinter * @param null|resource|string $out * @param int|string $numberOfColumns * - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public function __construct($out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, $numberOfColumns = 80, bool $reverse = false) { @@ -158,7 +161,7 @@ protected function formatClassName(Test $test): string } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose): void { @@ -170,7 +173,7 @@ protected function registerTestResult(Test $test, ?Throwable $t, int $status, fl } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function formatTestName(Test $test): string { @@ -206,7 +209,7 @@ protected function writeTestResult(array $prevResult, array $result): void ' %s %s%s' . PHP_EOL, $this->colorizeTextBox($style['color'], $style['symbol']), $testName, - $this->verbose ? ' ' . $this->formatRuntime($result['time'], $style['color']) : '' + $this->verbose ? ' ' . $this->formatRuntime($result['time'], $style['color']) : '', ); $this->write($line); @@ -217,7 +220,7 @@ protected function writeTestResult(array $prevResult, array $result): void protected function formatThrowable(Throwable $t, ?int $status = null): string { - return trim(\PHPUnit\Framework\TestFailure::exceptionToString($t)); + return trim(TestFailure::exceptionToString($t)); } protected function colorizeMessageAndDiff(string $style, string $buffer): array @@ -256,7 +259,7 @@ protected function colorizeMessageAndDiff(string $style, string $buffer): array protected function formatStacktrace(Throwable $t): string { - $trace = \PHPUnit\Util\Filter::getFilteredStacktrace($t); + $trace = Filter::getFilteredStacktrace($t); if (!$this->colors) { return $trace; diff --git a/api/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php b/api/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php index 90e596fb21..d08bfad49b 100644 --- a/api/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php +++ b/api/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php @@ -21,7 +21,7 @@ final class HtmlResultPrinter extends ResultPrinter * @var string */ private const PAGE_HEADER = <<<'EOT' - + @@ -29,26 +29,47 @@ final class HtmlResultPrinter extends ResultPrinter @@ -60,7 +81,7 @@ final class HtmlResultPrinter extends ResultPrinter */ private const CLASS_HEADER = <<<'EOT' -

%s

+

%s

    EOT; @@ -101,9 +122,8 @@ protected function startClass(string $name): void $this->write( sprintf( self::CLASS_HEADER, - $name, - $this->currentTestClassPrettified - ) + $this->currentTestClassPrettified, + ), ); } @@ -114,11 +134,10 @@ protected function onTest(string $name, bool $success = true): void { $this->write( sprintf( - "
  • %s %s
  • \n", - $success ? '#555753' : '#ef2929', - $success ? '✓' : '❌', - $name - ) + "
  • %s
  • \n", + $success ? 'success' : 'defect', + $name, + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php b/api/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php index 7420714989..f67cff68b5 100644 --- a/api/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php +++ b/api/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php @@ -46,6 +46,7 @@ use ReflectionMethod; use ReflectionObject; use SebastianBergmann\Exporter\Exporter; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -118,13 +119,13 @@ public function prettifyTestClass(string $className): string } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function prettifyTestCase(TestCase $test): string { $annotations = Test::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); $annotationWithPlaceholders = false; @@ -232,7 +233,7 @@ public function prettifyTestMethod(string $name): string } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test): array { @@ -243,7 +244,7 @@ private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test) throw new UtilException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd @@ -263,7 +264,7 @@ private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test) throw new UtilException( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/api/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php b/api/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php index c4b63644fa..841279e8e7 100644 --- a/api/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php +++ b/api/vendor/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php @@ -13,6 +13,7 @@ use function in_array; use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\ErrorTestCase; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\Test; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestSuite; @@ -21,6 +22,7 @@ use PHPUnit\Runner\BaseTestRunner; use PHPUnit\TextUI\ResultPrinter as ResultPrinterInterface; use PHPUnit\Util\Printer; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use Throwable; /** @@ -101,7 +103,7 @@ abstract class ResultPrinter extends Printer implements ResultPrinterInterface /** * @param resource $out * - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public function __construct($out = null, array $groups = [], array $excludeGroups = []) { @@ -220,7 +222,7 @@ public function endTestSuite(TestSuite $suite): void /** * A test started. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function startTest(Test $test): void { diff --git a/api/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php b/api/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php index bd64785c9c..9e1fdab1ad 100644 --- a/api/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php +++ b/api/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php @@ -17,15 +17,19 @@ use function preg_split; use function trim; use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\Reorderable; use PHPUnit\Framework\Test; use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\TestFailure; use PHPUnit\Framework\TestResult; use PHPUnit\Framework\TestSuite; use PHPUnit\Framework\Warning; use PHPUnit\Runner\BaseTestRunner; use PHPUnit\Runner\PhptTestCase; use PHPUnit\TextUI\DefaultResultPrinter; +use PHPUnit\Util\Filter; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use Throwable; /** @@ -82,7 +86,7 @@ class TestDoxPrinter extends DefaultResultPrinter * @param null|resource|string $out * @param int|string $numberOfColumns * - * @throws \PHPUnit\Framework\Exception + * @throws Exception */ public function __construct($out = null, bool $verbose = false, string $colors = self::COLOR_DEFAULT, bool $debug = false, $numberOfColumns = 80, bool $reverse = false) { @@ -107,7 +111,7 @@ public function printResult(TestResult $result): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function endTest(Test $test, float $time): void { @@ -127,7 +131,7 @@ public function endTest(Test $test, float $time): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function addError(Test $test, Throwable $t, float $time): void { @@ -135,7 +139,7 @@ public function addError(Test $test, Throwable $t, float $time): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function addWarning(Test $test, Warning $e, float $time): void { @@ -143,7 +147,7 @@ public function addWarning(Test $test, Warning $e, float $time): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function addFailure(Test $test, AssertionFailedError $e, float $time): void { @@ -151,7 +155,7 @@ public function addFailure(Test $test, AssertionFailedError $e, float $time): vo } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function addIncompleteTest(Test $test, Throwable $t, float $time): void { @@ -159,7 +163,7 @@ public function addIncompleteTest(Test $test, Throwable $t, float $time): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function addRiskyTest(Test $test, Throwable $t, float $time): void { @@ -167,7 +171,7 @@ public function addRiskyTest(Test $test, Throwable $t, float $time): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function addSkippedTest(Test $test, Throwable $t, float $time): void { @@ -185,7 +189,7 @@ public function flush(): void } /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ protected function registerTestResult(Test $test, ?Throwable $t, int $status, float $time, bool $verbose): void { @@ -339,7 +343,7 @@ protected function getTestResultByName(?string $testName): array protected function formatThrowable(Throwable $t, ?int $status = null): string { - $message = trim(\PHPUnit\Framework\TestFailure::exceptionToString($t)); + $message = trim(TestFailure::exceptionToString($t)); if ($message) { $message .= PHP_EOL . PHP_EOL . $this->formatStacktrace($t); @@ -352,7 +356,7 @@ protected function formatThrowable(Throwable $t, ?int $status = null): string protected function formatStacktrace(Throwable $t): string { - return \PHPUnit\Util\Filter::getFilteredStacktrace($t); + return Filter::getFilteredStacktrace($t); } protected function formatTestResultMessage(Throwable $t, array $result, string $prefix = '│'): string @@ -381,8 +385,8 @@ static function (string $text) use ($prefix) { return ' ' . $prefix . ($text ? ' ' . $text : ''); }, - preg_split('/\r\n|\r|\n/', $message) - ) + preg_split('/\r\n|\r|\n/', $message), + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php b/api/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php index 265fe41f38..10b7bff76c 100644 --- a/api/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php +++ b/api/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php @@ -27,6 +27,7 @@ use PHPUnit\Util\Test as TestUtil; use ReflectionClass; use ReflectionException; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use Throwable; /** @@ -151,7 +152,7 @@ public function startTest(Test $test): void /** * A test ended. * - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function endTest(Test $test, float $time): void { @@ -164,7 +165,7 @@ public function endTest(Test $test, float $time): void static function ($group) { return !($group === 'small' || $group === 'medium' || $group === 'large' || strpos($group, '__phpunit_') === 0); - } + }, ); $testNode = $this->document->createElement('test'); @@ -188,7 +189,7 @@ static function ($group) $annotations = TestUtil::parseTestMethodAnnotations( get_class($test), - $test->getName(false) + $test->getName(false), ); foreach (['class', 'method'] as $type) { @@ -215,7 +216,7 @@ static function ($group) $testNode->appendChild($testDoubleNode); } - $inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(get_class($test), $test->getName(false)); + $inlineAnnotations = TestUtil::getInlineAnnotations(get_class($test), $test->getName(false)); if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) { $testNode->setAttribute('given', $inlineAnnotations['given']['value']); @@ -240,7 +241,7 @@ static function ($group) throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/api/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php b/api/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php index 67168a67f3..c9f8af16ba 100644 --- a/api/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php +++ b/api/vendor/phpunit/phpunit/src/Util/TextTestListRenderer.php @@ -17,6 +17,7 @@ use PHPUnit\Framework\TestSuite; use PHPUnit\Runner\PhptTestCase; use RecursiveIteratorIterator; +use SebastianBergmann\RecursionContext\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -24,7 +25,7 @@ final class TextTestListRenderer { /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function render(TestSuite $suite): string { @@ -35,7 +36,7 @@ public function render(TestSuite $suite): string $name = sprintf( '%s::%s', get_class($test), - str_replace(' with data set ', '', $test->getName()) + str_replace(' with data set ', '', $test->getName()), ); } elseif ($test instanceof PhptTestCase) { $name = $test->getName(); @@ -45,7 +46,7 @@ public function render(TestSuite $suite): string $buffer .= sprintf( ' - %s' . PHP_EOL, - $name + $name, ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php b/api/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php index 77e6747071..57ca7c320b 100644 --- a/api/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php +++ b/api/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php @@ -50,8 +50,8 @@ private function ensureOperatorIsValid(string $operator): void throw new Exception( sprintf( '"%s" is not a valid version_compare() operator', - $operator - ) + $operator, + ), ); } } diff --git a/api/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php b/api/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php index 8b10d4152a..d6366eaaad 100644 --- a/api/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php +++ b/api/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php @@ -32,10 +32,10 @@ static function ($item) { return sprintf( " '%s'", - $item + $item, ); }, - $this->getItems($filter) + $this->getItems($filter), ); $files = implode(",\n", $files); @@ -67,7 +67,7 @@ private function getItems(FilterConfiguration $filter): array if (is_string($path)) { $files[] = sprintf( addslashes('%s' . DIRECTORY_SEPARATOR), - $path + $path, ); } } diff --git a/api/vendor/phpunit/phpunit/src/Util/Xml.php b/api/vendor/phpunit/phpunit/src/Util/Xml.php index 54d7215626..efdd56efff 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Xml.php +++ b/api/vendor/phpunit/phpunit/src/Util/Xml.php @@ -68,8 +68,8 @@ public static function prepareString(string $string): string '', htmlspecialchars( self::convertToUtf8($string), - ENT_QUOTES - ) + ENT_QUOTES, + ), ); } @@ -127,7 +127,7 @@ public static function xmlToVariable(DOMElement $element) throw new Exception( $e->getMessage(), $e->getCode(), - $e + $e, ); } // @codeCoverageIgnoreEnd diff --git a/api/vendor/phpunit/phpunit/src/Util/Xml/Loader.php b/api/vendor/phpunit/phpunit/src/Util/Xml/Loader.php index 8d43d3278d..2ba5ace34c 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Xml/Loader.php +++ b/api/vendor/phpunit/phpunit/src/Util/Xml/Loader.php @@ -38,8 +38,8 @@ public function loadFile(string $filename, bool $isHtml = false, bool $xinclude throw new Exception( sprintf( 'Could not read "%s".', - $filename - ) + $filename, + ), ); } @@ -100,8 +100,8 @@ public function load(string $actual, bool $isHtml = false, string $filename = '' sprintf( 'Could not load "%s".%s', $filename, - $message !== '' ? "\n" . $message : '' - ) + $message !== '' ? "\n" . $message : '', + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php b/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php index 442aae49ce..3ae4572311 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php +++ b/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetectionResult.php @@ -16,6 +16,9 @@ */ abstract class SchemaDetectionResult { + /** + * @psalm-assert-if-true SuccessfulSchemaDetectionResult $this + */ public function detected(): bool { return false; diff --git a/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php b/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php index 5864695b45..1877a9a1f9 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php +++ b/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaDetector.php @@ -23,10 +23,12 @@ public function detect(string $filename): SchemaDetectionResult $filename, false, true, - true + true, ); - foreach (['9.2', '8.5'] as $candidate) { + $schemaFinder = new SchemaFinder; + + foreach ($schemaFinder->available() as $candidate) { $schema = (new SchemaFinder)->find($candidate); if (!(new Validator)->validate($document, $schema)->hasValidationErrors()) { diff --git a/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php b/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php index 1e7b73c59d..eb5f4f1551 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php +++ b/api/vendor/phpunit/phpunit/src/Util/Xml/SchemaFinder.php @@ -9,9 +9,12 @@ */ namespace PHPUnit\Util\Xml; +use function assert; use function defined; use function is_file; +use function rsort; use function sprintf; +use DirectoryIterator; use PHPUnit\Runner\Version; /** @@ -19,6 +22,30 @@ */ final class SchemaFinder { + /** + * @psalm-return non-empty-list + */ + public function available(): array + { + $result = [Version::series()]; + + foreach ((new DirectoryIterator($this->path() . 'schema')) as $file) { + if ($file->isDot()) { + continue; + } + + $version = $file->getBasename('.xsd'); + + assert(!empty($version)); + + $result[] = $version; + } + + rsort($result); + + return $result; + } + /** * @throws Exception */ @@ -34,8 +61,8 @@ public function find(string $version): string throw new Exception( sprintf( 'Schema for PHPUnit %s is not available', - $version - ) + $version, + ), ); } diff --git a/api/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php b/api/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php index 8b517e29ab..77202c352b 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php +++ b/api/vendor/phpunit/phpunit/src/Util/Xml/SuccessfulSchemaDetectionResult.php @@ -17,20 +17,29 @@ final class SuccessfulSchemaDetectionResult extends SchemaDetectionResult { /** - * @var string + * @psalm-var non-empty-string */ private $version; + /** + * @psalm-param non-empty-string $version + */ public function __construct(string $version) { $this->version = $version; } + /** + * @psalm-assert-if-true SuccessfulSchemaDetectionResult $this + */ public function detected(): bool { return true; } + /** + * @psalm-return non-empty-string + */ public function version(): string { return $this->version; diff --git a/api/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php b/api/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php index 3292267bd4..a44b309ca8 100644 --- a/api/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php +++ b/api/vendor/phpunit/phpunit/src/Util/Xml/ValidationResult.php @@ -9,6 +9,7 @@ */ namespace PHPUnit\Util\Xml; +use const PHP_EOL; use function sprintf; use function trim; diff --git a/api/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php b/api/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php index b16ef0b70a..2ed6559fef 100644 --- a/api/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php +++ b/api/vendor/phpunit/phpunit/src/Util/XmlTestListRenderer.php @@ -16,6 +16,7 @@ use PHPUnit\Framework\TestSuite; use PHPUnit\Runner\PhptTestCase; use RecursiveIteratorIterator; +use SebastianBergmann\RecursionContext\InvalidArgumentException; use XMLWriter; /** @@ -24,7 +25,7 @@ final class XmlTestListRenderer { /** - * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException + * @throws InvalidArgumentException */ public function render(TestSuite $suite): string { @@ -60,8 +61,8 @@ public function render(TestSuite $suite): string str_replace( ' with data set ', '', - $test->getDataSetAsString(false) - ) + $test->getDataSetAsString(false), + ), ); } diff --git a/api/vendor/psr/clock/CHANGELOG.md b/api/vendor/psr/clock/CHANGELOG.md new file mode 100644 index 0000000000..3cd6b9b755 --- /dev/null +++ b/api/vendor/psr/clock/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.0.0 + +First stable release after PSR-20 acceptance + +## 0.1.0 + +First release diff --git a/api/vendor/symfony/polyfill-php72/LICENSE b/api/vendor/psr/clock/LICENSE similarity index 83% rename from api/vendor/symfony/polyfill-php72/LICENSE rename to api/vendor/psr/clock/LICENSE index 4cd8bdd300..be68342123 100644 --- a/api/vendor/symfony/polyfill-php72/LICENSE +++ b/api/vendor/psr/clock/LICENSE @@ -1,14 +1,14 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2017 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: +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/api/vendor/psr/clock/README.md b/api/vendor/psr/clock/README.md new file mode 100644 index 0000000000..6ca877eeb1 --- /dev/null +++ b/api/vendor/psr/clock/README.md @@ -0,0 +1,61 @@ +# PSR Clock + +This repository holds the interface for [PSR-20][psr-url]. + +Note that this is not a clock of its own. It is merely an interface that +describes a clock. See the specification for more details. + +## Installation + +```bash +composer require psr/clock +``` + +## Usage + +If you need a clock, you can use the interface like this: + +```php +clock = $clock; + } + + public function doSomething() + { + /** @var DateTimeImmutable $currentDateAndTime */ + $currentDateAndTime = $this->clock->now(); + // do something useful with that information + } +} +``` + +You can then pick one of the [implementations][implementation-url] of the interface to get a clock. + +If you want to implement the interface, you can require this package and +implement `Psr\Clock\ClockInterface` in your code. + +Don't forget to add `psr/clock-implementation` to your `composer.json`s `provides`-section like this: + +```json +{ + "provides": { + "psr/clock-implementation": "1.0" + } +} +``` + +And please read the [specification text][specification-url] for details on the interface. + +[psr-url]: https://www.php-fig.org/psr/psr-20 +[package-url]: https://packagist.org/packages/psr/clock +[implementation-url]: https://packagist.org/providers/psr/clock-implementation +[specification-url]: https://github.com/php-fig/fig-standards/blob/master/proposed/clock.md diff --git a/api/vendor/psr/clock/composer.json b/api/vendor/psr/clock/composer.json new file mode 100644 index 0000000000..77992eda75 --- /dev/null +++ b/api/vendor/psr/clock/composer.json @@ -0,0 +1,21 @@ +{ + "name": "psr/clock", + "description": "Common interface for reading the clock.", + "keywords": ["psr", "psr-20", "time", "clock", "now"], + "homepage": "https://github.com/php-fig/clock", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "require": { + "php": "^7.0 || ^8.0" + }, + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + } +} diff --git a/api/vendor/psr/clock/src/ClockInterface.php b/api/vendor/psr/clock/src/ClockInterface.php new file mode 100644 index 0000000000..7b6d8d8aae --- /dev/null +++ b/api/vendor/psr/clock/src/ClockInterface.php @@ -0,0 +1,13 @@ +data[$offset]); } @@ -82,13 +80,12 @@ public function offsetExists($offset): bool * * @param array-key $offset The offset for which a value should be returned. * - * @return T|null the value stored at the offset, or null if the offset + * @return T the value stored at the offset, or null if the offset * does not exist. */ - #[\ReturnTypeWillChange] // phpcs:ignore - public function offsetGet($offset) + public function offsetGet(mixed $offset): mixed { - return $this->data[$offset] ?? null; + return $this->data[$offset]; } /** @@ -96,12 +93,11 @@ public function offsetGet($offset) * * @link http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet() * - * @param array-key|null $offset The offset to set. If `null`, the value may be - * set at a numerically-indexed offset. + * @param array-key | null $offset The offset to set. If `null`, the value + * may be set at a numerically-indexed offset. * @param T $value The value to set at the given offset. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { if ($offset === null) { $this->data[] = $value; @@ -117,25 +113,11 @@ public function offsetSet($offset, $value): void * * @param array-key $offset The offset to remove from the array. */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->data[$offset]); } - /** - * Returns a serialized string representation of this array object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.serialize.php Serializable::serialize() - * - * @return string a PHP serialized string. - */ - public function serialize(): string - { - return serialize($this->data); - } - /** * Returns data suitable for PHP serialization. * @@ -149,25 +131,6 @@ public function __serialize(): array return $this->data; } - /** - * Converts a serialized string representation into an instance object. - * - * @deprecated The Serializable interface will go away in PHP 9. - * - * @link http://php.net/manual/en/serializable.unserialize.php Serializable::unserialize() - * - * @param string $serialized A PHP serialized string to unserialize. - * - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, ['allowed_classes' => false]); - - $this->data = $data; - } - /** * Adds unserialized data to the object. * @@ -203,6 +166,6 @@ public function toArray(): array public function isEmpty(): bool { - return count($this->data) === 0; + return $this->data === []; } } diff --git a/api/vendor/ramsey/collection/src/AbstractCollection.php b/api/vendor/ramsey/collection/src/AbstractCollection.php index 38ef7144c1..8cb21ec022 100644 --- a/api/vendor/ramsey/collection/src/AbstractCollection.php +++ b/api/vendor/ramsey/collection/src/AbstractCollection.php @@ -17,27 +17,27 @@ use Closure; use Ramsey\Collection\Exception\CollectionMismatchException; use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\InvalidSortOrderException; -use Ramsey\Collection\Exception\OutOfBoundsException; +use Ramsey\Collection\Exception\InvalidPropertyOrMethod; +use Ramsey\Collection\Exception\NoSuchElementException; +use Ramsey\Collection\Exception\UnsupportedOperationException; use Ramsey\Collection\Tool\TypeTrait; use Ramsey\Collection\Tool\ValueExtractorTrait; use Ramsey\Collection\Tool\ValueToStringTrait; use function array_filter; +use function array_key_first; +use function array_key_last; use function array_map; use function array_merge; +use function array_reduce; use function array_search; use function array_udiff; use function array_uintersect; -use function current; -use function end; use function in_array; use function is_int; use function is_object; -use function reset; use function spl_object_id; use function sprintf; -use function unserialize; use function usort; /** @@ -55,27 +55,24 @@ abstract class AbstractCollection extends AbstractArray implements CollectionInt use ValueExtractorTrait; /** - * @inheritDoc + * @throws InvalidArgumentException if $element is of the wrong type. */ - public function add($element): bool + public function add(mixed $element): bool { $this[] = $element; return true; } - /** - * @inheritDoc - */ - public function contains($element, bool $strict = true): bool + public function contains(mixed $element, bool $strict = true): bool { return in_array($element, $this->data, $strict); } /** - * @inheritDoc + * @throws InvalidArgumentException if $element is of the wrong type. */ - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { if ($this->checkType($this->getType(), $value) === false) { throw new InvalidArgumentException( @@ -91,10 +88,7 @@ public function offsetSet($offset, $value): void } } - /** - * @inheritDoc - */ - public function remove($element): bool + public function remove(mixed $element): bool { if (($position = array_search($element, $this->data, true)) !== false) { unset($this[$position]); @@ -106,6 +100,11 @@ public function remove($element): bool } /** + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call column() on this + * collection. + * * @inheritDoc */ public function column(string $propertyOrMethod): array @@ -113,55 +112,55 @@ public function column(string $propertyOrMethod): array $temp = []; foreach ($this->data as $item) { - /** @var mixed $value */ - $value = $this->extractValue($item, $propertyOrMethod); - /** @psalm-suppress MixedAssignment */ - $temp[] = $value; + $temp[] = $this->extractValue($item, $propertyOrMethod); } return $temp; } /** - * @inheritDoc + * @return T + * + * @throws NoSuchElementException if this collection is empty. */ - public function first() + public function first(): mixed { - if ($this->isEmpty()) { - throw new OutOfBoundsException('Can\'t determine first item. Collection is empty'); - } - - reset($this->data); + $firstIndex = array_key_first($this->data); - /** @var T $first */ - $first = current($this->data); + if ($firstIndex === null) { + throw new NoSuchElementException('Can\'t determine first item. Collection is empty'); + } - return $first; + return $this->data[$firstIndex]; } /** - * @inheritDoc + * @return T + * + * @throws NoSuchElementException if this collection is empty. */ - public function last() + public function last(): mixed { - if ($this->isEmpty()) { - throw new OutOfBoundsException('Can\'t determine last item. Collection is empty'); - } + $lastIndex = array_key_last($this->data); - /** @var T $item */ - $item = end($this->data); - reset($this->data); + if ($lastIndex === null) { + throw new NoSuchElementException('Can\'t determine last item. Collection is empty'); + } - return $item; + return $this->data[$lastIndex]; } - public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): CollectionInterface + /** + * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call sort() on this + * collection. + */ + public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascending): CollectionInterface { - if (!in_array($order, [self::SORT_ASC, self::SORT_DESC], true)) { - throw new InvalidSortOrderException('Invalid sort order given: ' . $order); - } - $collection = clone $this; usort( @@ -170,20 +169,25 @@ public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): * @param T $a * @param T $b */ - function ($a, $b) use ($propertyOrMethod, $order): int { + function (mixed $a, mixed $b) use ($propertyOrMethod, $order): int { /** @var mixed $aValue */ $aValue = $this->extractValue($a, $propertyOrMethod); /** @var mixed $bValue */ $bValue = $this->extractValue($b, $propertyOrMethod); - return ($aValue <=> $bValue) * ($order === self::SORT_DESC ? -1 : 1); + return ($aValue <=> $bValue) * ($order === Sort::Descending ? -1 : 1); }, ); return $collection; } + /** + * @param callable(T): bool $callback A callable to use for filtering elements. + * + * @return CollectionInterface + */ public function filter(callable $callback): CollectionInterface { $collection = clone $this; @@ -193,23 +197,66 @@ public function filter(callable $callback): CollectionInterface } /** - * {@inheritdoc} + * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call where() on this + * collection. */ - public function where(string $propertyOrMethod, $value): CollectionInterface + public function where(?string $propertyOrMethod, mixed $value): CollectionInterface { - return $this->filter(function ($item) use ($propertyOrMethod, $value) { - /** @var mixed $accessorValue */ - $accessorValue = $this->extractValue($item, $propertyOrMethod); + return $this->filter( + /** + * @param T $item + */ + function (mixed $item) use ($propertyOrMethod, $value): bool { + /** @var mixed $accessorValue */ + $accessorValue = $this->extractValue($item, $propertyOrMethod); - return $accessorValue === $value; - }); + return $accessorValue === $value; + }, + ); } + /** + * @param callable(T): TCallbackReturn $callback A callable to apply to each + * item of the collection. + * + * @return CollectionInterface + * + * @template TCallbackReturn + */ public function map(callable $callback): CollectionInterface { + /** @var Collection */ return new Collection('mixed', array_map($callback, $this->data)); } + /** + * @param callable(TCarry, T): TCarry $callback A callable to apply to each + * item of the collection to reduce it to a single value. + * @param TCarry $initial This is the initial value provided to the callback. + * + * @return TCarry + * + * @template TCarry + */ + public function reduce(callable $callback, mixed $initial): mixed + { + /** @var TCarry */ + return array_reduce($this->data, $callback, $initial); + } + + /** + * @param CollectionInterface $other The collection to check for divergent + * items. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. + */ public function diff(CollectionInterface $other): CollectionInterface { $this->compareCollectionTypes($other); @@ -226,6 +273,15 @@ public function diff(CollectionInterface $other): CollectionInterface return $collection; } + /** + * @param CollectionInterface $other The collection to check for + * intersecting items. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. + */ public function intersect(CollectionInterface $other): CollectionInterface { $this->compareCollectionTypes($other); @@ -239,6 +295,15 @@ public function intersect(CollectionInterface $other): CollectionInterface return $collection; } + /** + * @param CollectionInterface ...$collections The collections to merge. + * + * @return CollectionInterface + * + * @throws CollectionMismatchException if unable to merge any of the given + * collections or items within the given collections due to type + * mismatch errors. + */ public function merge(CollectionInterface ...$collections): CollectionInterface { $mergedCollection = clone $this; @@ -274,19 +339,10 @@ public function merge(CollectionInterface ...$collections): CollectionInterface return $mergedCollection; } - /** - * @inheritDoc - */ - public function unserialize($serialized): void - { - /** @var array $data */ - $data = unserialize($serialized, ['allowed_classes' => [$this->getType()]]); - - $this->data = $data; - } - /** * @param CollectionInterface $other + * + * @throws CollectionMismatchException */ private function compareCollectionTypes(CollectionInterface $other): void { @@ -307,7 +363,7 @@ private function getComparator(): Closure * @param T $a * @param T $b */ - function ($a, $b): int { + function (mixed $a, mixed $b): int { // If the two values are object, we convert them to unique scalars. // If the collection contains mixed values (unlikely) where some are objects // and some are not, we leave them as they are. @@ -327,15 +383,11 @@ function ($a, $b): int { */ private function getUniformType(CollectionInterface $collection): string { - switch ($collection->getType()) { - case 'integer': - return 'int'; - case 'boolean': - return 'bool'; - case 'double': - return 'float'; - default: - return $collection->getType(); - } + return match ($collection->getType()) { + 'integer' => 'int', + 'boolean' => 'bool', + 'double' => 'float', + default => $collection->getType(), + }; } } diff --git a/api/vendor/ramsey/collection/src/AbstractSet.php b/api/vendor/ramsey/collection/src/AbstractSet.php index 1126ccb0ab..7186939d7e 100644 --- a/api/vendor/ramsey/collection/src/AbstractSet.php +++ b/api/vendor/ramsey/collection/src/AbstractSet.php @@ -24,10 +24,7 @@ */ abstract class AbstractSet extends AbstractCollection { - /** - * @inheritDoc - */ - public function add($element): bool + public function add(mixed $element): bool { if ($this->contains($element)) { return false; @@ -36,10 +33,7 @@ public function add($element): bool return parent::add($element); } - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { if ($this->contains($value)) { return; diff --git a/api/vendor/ramsey/collection/src/ArrayInterface.php b/api/vendor/ramsey/collection/src/ArrayInterface.php index 27af6102b1..bc7f6f4240 100644 --- a/api/vendor/ramsey/collection/src/ArrayInterface.php +++ b/api/vendor/ramsey/collection/src/ArrayInterface.php @@ -17,7 +17,6 @@ use ArrayAccess; use Countable; use IteratorAggregate; -use Serializable; /** * `ArrayInterface` provides traversable array functionality to data types. @@ -29,8 +28,7 @@ interface ArrayInterface extends ArrayAccess, Countable, - IteratorAggregate, - Serializable + IteratorAggregate { /** * Removes all items from this array. diff --git a/api/vendor/ramsey/collection/src/Collection.php b/api/vendor/ramsey/collection/src/Collection.php index 532b971b68..44d26bf2e9 100644 --- a/api/vendor/ramsey/collection/src/Collection.php +++ b/api/vendor/ramsey/collection/src/Collection.php @@ -75,25 +75,16 @@ */ class Collection extends AbstractCollection { - /** - * The type of elements stored in this collection. - * - * A collection's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $collectionType; - /** * Constructs a collection object of the specified type, optionally with the * specified data. * - * @param string $collectionType The type (FQCN) associated with this + * @param string $collectionType The type or class name associated with this * collection. * @param array $data The initial items to store in the collection. */ - public function __construct(string $collectionType, array $data = []) + public function __construct(private readonly string $collectionType, array $data = []) { - $this->collectionType = $collectionType; parent::__construct($data); } diff --git a/api/vendor/ramsey/collection/src/CollectionInterface.php b/api/vendor/ramsey/collection/src/CollectionInterface.php index 9f86a28372..e3ad014701 100644 --- a/api/vendor/ramsey/collection/src/CollectionInterface.php +++ b/api/vendor/ramsey/collection/src/CollectionInterface.php @@ -14,8 +14,14 @@ namespace Ramsey\Collection; +use Ramsey\Collection\Exception\CollectionMismatchException; +use Ramsey\Collection\Exception\InvalidArgumentException; +use Ramsey\Collection\Exception\InvalidPropertyOrMethod; +use Ramsey\Collection\Exception\NoSuchElementException; +use Ramsey\Collection\Exception\UnsupportedOperationException; + /** - * A collection represents a group of objects, known as its elements. + * A collection represents a group of values, known as its elements. * * Some collections allow duplicate elements and others do not. Some are ordered * and others unordered. @@ -25,16 +31,6 @@ */ interface CollectionInterface extends ArrayInterface { - /** - * Ascending sort type. - */ - public const SORT_ASC = 'asc'; - - /** - * Descending sort type. - */ - public const SORT_DESC = 'desc'; - /** * Ensures that this collection contains the specified element (optional * operation). @@ -58,9 +54,11 @@ interface CollectionInterface extends ArrayInterface * @param T $element The element to add to the collection. * * @return bool `true` if this collection changed as a result of the call. + * + * @throws InvalidArgumentException if the collection refuses to add the + * $element for any reason other than that it already contains the element. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function add($element): bool; + public function add(mixed $element): bool; /** * Returns `true` if this collection contains the specified element. @@ -68,8 +66,7 @@ public function add($element): bool; * @param T $element The element to check whether the collection contains. * @param bool $strict Whether to perform a strict type check on the value. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function contains($element, bool $strict = true): bool; + public function contains(mixed $element, bool $strict = true): bool; /** * Returns the type associated with this collection. @@ -84,15 +81,20 @@ public function getType(): string; * * @return bool `true` if an element was removed as a result of this call. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function remove($element): bool; + public function remove(mixed $element): bool; /** - * Returns the values from the given property or method. + * Returns the values from the given property, method, or array key. + * + * @param string $propertyOrMethod The name of the property, method, or + * array key to evaluate and return. * - * @param string $propertyOrMethod The property or method name to filter by. + * @return array * - * @return list + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call column() on this + * collection. */ public function column(string $propertyOrMethod): array; @@ -100,29 +102,41 @@ public function column(string $propertyOrMethod): array; * Returns the first item of the collection. * * @return T + * + * @throws NoSuchElementException if this collection is empty. */ - public function first(); + public function first(): mixed; /** * Returns the last item of the collection. * * @return T + * + * @throws NoSuchElementException if this collection is empty. */ - public function last(); + public function last(): mixed; /** - * Sort the collection by a property or method with the given sort order. + * Sort the collection by a property, method, or array key with the given + * sort order. + * + * If $propertyOrMethod is `null`, this will sort by comparing each element. * * This will always leave the original collection untouched and will return * a new one. * - * @param string $propertyOrMethod The property or method to sort by. - * @param string $order The sort order for the resulting collection (one of - * this interface's `SORT_*` constants). + * @param string | null $propertyOrMethod The property, method, or array key + * to sort by. + * @param Sort $order The sort order for the resulting collection. * * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call sort() on this + * collection. */ - public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): self; + public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascending): self; /** * Filter out items of the collection which don't match the criteria of @@ -134,25 +148,31 @@ public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): * See the {@link http://php.net/manual/en/function.array-filter.php PHP array_filter() documentation} * for examples of how the `$callback` parameter works. * - * @param callable(T):bool $callback A callable to use for filtering elements. + * @param callable(T): bool $callback A callable to use for filtering elements. * * @return CollectionInterface */ public function filter(callable $callback): self; /** - * Create a new collection where items match the criteria of given callback. + * Create a new collection where the result of the given property, method, + * or array key of each item in the collection equals the given value. * * This will always leave the original collection untouched and will return * a new one. * - * @param string $propertyOrMethod The property or method to evaluate. + * @param string | null $propertyOrMethod The property, method, or array key + * to evaluate. If `null`, the element itself is compared to $value. * @param mixed $value The value to match. * * @return CollectionInterface + * + * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist + * on the elements in this collection. + * @throws UnsupportedOperationException if unable to call where() on this + * collection. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function where(string $propertyOrMethod, $value): self; + public function where(?string $propertyOrMethod, mixed $value): self; /** * Apply a given callback method on each item of the collection. @@ -164,7 +184,7 @@ public function where(string $propertyOrMethod, $value): self; * See the {@link http://php.net/manual/en/function.array-map.php PHP array_map() documentation} * for examples of how the `$callback` parameter works. * - * @param callable(T):TCallbackReturn $callback A callable to apply to each + * @param callable(T): TCallbackReturn $callback A callable to apply to each * item of the collection. * * @return CollectionInterface @@ -173,6 +193,23 @@ public function where(string $propertyOrMethod, $value): self; */ public function map(callable $callback): self; + /** + * Apply a given callback method on each item of the collection + * to reduce it to a single value. + * + * See the {@link http://php.net/manual/en/function.array-reduce.php PHP array_reduce() documentation} + * for examples of how the `$callback` and `$initial` parameters work. + * + * @param callable(TCarry, T): TCarry $callback A callable to apply to each + * item of the collection to reduce it to a single value. + * @param TCarry $initial This is the initial value provided to the callback. + * + * @return TCarry + * + * @template TCarry + */ + public function reduce(callable $callback, mixed $initial): mixed; + /** * Create a new collection with divergent items between current and given * collection. @@ -181,6 +218,9 @@ public function map(callable $callback): self; * items. * * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. */ public function diff(CollectionInterface $other): self; @@ -192,6 +232,9 @@ public function diff(CollectionInterface $other): self; * intersecting items. * * @return CollectionInterface + * + * @throws CollectionMismatchException if the compared collections are of + * differing types. */ public function intersect(CollectionInterface $other): self; @@ -201,6 +244,10 @@ public function intersect(CollectionInterface $other): self; * @param CollectionInterface ...$collections The collections to merge. * * @return CollectionInterface + * + * @throws CollectionMismatchException if unable to merge any of the given + * collections or items within the given collections due to type + * mismatch errors. */ public function merge(CollectionInterface ...$collections): self; } diff --git a/api/vendor/ramsey/collection/src/DoubleEndedQueue.php b/api/vendor/ramsey/collection/src/DoubleEndedQueue.php index 4d1f71ea46..62947a24f7 100644 --- a/api/vendor/ramsey/collection/src/DoubleEndedQueue.php +++ b/api/vendor/ramsey/collection/src/DoubleEndedQueue.php @@ -17,6 +17,10 @@ use Ramsey\Collection\Exception\InvalidArgumentException; use Ramsey\Collection\Exception\NoSuchElementException; +use function array_key_last; +use function array_pop; +use function array_unshift; + /** * This class provides a basic implementation of `DoubleEndedQueueInterface`, to * minimize the effort required to implement this interface. @@ -28,33 +32,21 @@ class DoubleEndedQueue extends Queue implements DoubleEndedQueueInterface { /** - * Index of the last element in the queue. - */ - private int $tail = -1; - - /** - * @inheritDoc + * Constructs a double-ended queue (dequeue) object of the specified type, + * optionally with the specified data. + * + * @param string $queueType The type or class name associated with this dequeue. + * @param array $data The initial items to store in the dequeue. */ - public function offsetSet($offset, $value): void + public function __construct(private readonly string $queueType, array $data = []) { - if ($this->checkType($this->getType(), $value) === false) { - throw new InvalidArgumentException( - 'Value must be of type ' . $this->getType() . '; value is ' - . $this->toolValueToString($value), - ); - } - - $this->tail++; - - $this->data[$this->tail] = $value; + parent::__construct($this->queueType, $data); } /** * @throws InvalidArgumentException if $element is of the wrong type - * - * @inheritDoc */ - public function addFirst($element): bool + public function addFirst(mixed $element): bool { if ($this->checkType($this->getType(), $element) === false) { throw new InvalidArgumentException( @@ -63,125 +55,112 @@ public function addFirst($element): bool ); } - $this->index--; - - $this->data[$this->index] = $element; + array_unshift($this->data, $element); return true; } /** - * @inheritDoc + * @throws InvalidArgumentException if $element is of the wrong type */ - public function addLast($element): bool + public function addLast(mixed $element): bool { return $this->add($element); } - /** - * @inheritDoc - */ - public function offerFirst($element): bool + public function offerFirst(mixed $element): bool { try { return $this->addFirst($element); - } catch (InvalidArgumentException $e) { + } catch (InvalidArgumentException) { return false; } } - /** - * @inheritDoc - */ - public function offerLast($element): bool + public function offerLast(mixed $element): bool { return $this->offer($element); } /** - * @inheritDoc + * @return T the first element in this queue. + * + * @throws NoSuchElementException if the queue is empty */ - public function removeFirst() + public function removeFirst(): mixed { return $this->remove(); } /** - * @inheritDoc + * @return T the last element in this queue. + * + * @throws NoSuchElementException if this queue is empty. */ - public function removeLast() + public function removeLast(): mixed { - $tail = $this->pollLast(); - - if ($tail === null) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $tail; + return $this->pollLast() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); } /** - * @inheritDoc + * @return T | null the head of this queue, or `null` if this queue is empty. */ - public function pollFirst() + public function pollFirst(): mixed { return $this->poll(); } /** - * @inheritDoc + * @return T | null the tail of this queue, or `null` if this queue is empty. */ - public function pollLast() + public function pollLast(): mixed { - if ($this->count() === 0) { - return null; - } - - $tail = $this[$this->tail]; - - unset($this[$this->tail]); - $this->tail--; - - return $tail; + return array_pop($this->data); } /** - * @inheritDoc + * @return T the head of this queue. + * + * @throws NoSuchElementException if this queue is empty. */ - public function firstElement() + public function firstElement(): mixed { return $this->element(); } /** - * @inheritDoc + * @return T the tail of this queue. + * + * @throws NoSuchElementException if this queue is empty. */ - public function lastElement() + public function lastElement(): mixed { - if ($this->count() === 0) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $this->data[$this->tail]; + return $this->peekLast() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); } /** - * @inheritDoc + * @return T | null the head of this queue, or `null` if this queue is empty. */ - public function peekFirst() + public function peekFirst(): mixed { return $this->peek(); } /** - * @inheritDoc + * @return T | null the tail of this queue, or `null` if this queue is empty. */ - public function peekLast() + public function peekLast(): mixed { - if ($this->count() === 0) { + $lastIndex = array_key_last($this->data); + + if ($lastIndex === null) { return null; } - return $this->data[$this->tail]; + return $this->data[$lastIndex]; } } diff --git a/api/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php b/api/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php index 3fa4ecab8c..15cc0e97b7 100644 --- a/api/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php +++ b/api/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php @@ -181,8 +181,7 @@ interface DoubleEndedQueueInterface extends QueueInterface * Implementations should use a more-specific exception that extends * `\RuntimeException`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function addFirst($element): bool; + public function addFirst(mixed $element): bool; /** * Inserts the specified element at the end of this queue if it is possible @@ -202,8 +201,7 @@ public function addFirst($element): bool; * Implementations should use a more-specific exception that extends * `\RuntimeException`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function addLast($element): bool; + public function addLast(mixed $element): bool; /** * Inserts the specified element at the front of this queue if it is @@ -217,8 +215,7 @@ public function addLast($element): bool; * * @return bool `true` if the element was added to this queue, else `false`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offerFirst($element): bool; + public function offerFirst(mixed $element): bool; /** * Inserts the specified element at the end of this queue if it is possible @@ -232,8 +229,7 @@ public function offerFirst($element): bool; * * @return bool `true` if the element was added to this queue, else `false`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offerLast($element): bool; + public function offerLast(mixed $element): bool; /** * Retrieves and removes the head of this queue. @@ -245,7 +241,7 @@ public function offerLast($element): bool; * * @throws NoSuchElementException if this queue is empty. */ - public function removeFirst(); + public function removeFirst(): mixed; /** * Retrieves and removes the tail of this queue. @@ -257,23 +253,23 @@ public function removeFirst(); * * @throws NoSuchElementException if this queue is empty. */ - public function removeLast(); + public function removeLast(): mixed; /** * Retrieves and removes the head of this queue, or returns `null` if this * queue is empty. * - * @return T|null the head of this queue, or `null` if this queue is empty. + * @return T | null the head of this queue, or `null` if this queue is empty. */ - public function pollFirst(); + public function pollFirst(): mixed; /** * Retrieves and removes the tail of this queue, or returns `null` if this * queue is empty. * - * @return T|null the tail of this queue, or `null` if this queue is empty. + * @return T | null the tail of this queue, or `null` if this queue is empty. */ - public function pollLast(); + public function pollLast(): mixed; /** * Retrieves, but does not remove, the head of this queue. @@ -285,7 +281,7 @@ public function pollLast(); * * @throws NoSuchElementException if this queue is empty. */ - public function firstElement(); + public function firstElement(): mixed; /** * Retrieves, but does not remove, the tail of this queue. @@ -297,21 +293,21 @@ public function firstElement(); * * @throws NoSuchElementException if this queue is empty. */ - public function lastElement(); + public function lastElement(): mixed; /** * Retrieves, but does not remove, the head of this queue, or returns `null` * if this queue is empty. * - * @return T|null the head of this queue, or `null` if this queue is empty. + * @return T | null the head of this queue, or `null` if this queue is empty. */ - public function peekFirst(); + public function peekFirst(): mixed; /** * Retrieves, but does not remove, the tail of this queue, or returns `null` * if this queue is empty. * - * @return T|null the tail of this queue, or `null` if this queue is empty. + * @return T | null the tail of this queue, or `null` if this queue is empty. */ - public function peekLast(); + public function peekLast(): mixed; } diff --git a/api/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php b/api/vendor/ramsey/collection/src/Exception/CollectionException.php similarity index 70% rename from api/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php rename to api/vendor/ramsey/collection/src/Exception/CollectionException.php index 4491429c78..4aa92bed8d 100644 --- a/api/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php +++ b/api/vendor/ramsey/collection/src/Exception/CollectionException.php @@ -14,11 +14,8 @@ namespace Ramsey\Collection\Exception; -use RuntimeException; +use Throwable; -/** - * Thrown when attempting to use a sort order that is not recognized. - */ -class InvalidSortOrderException extends RuntimeException +interface CollectionException extends Throwable { } diff --git a/api/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php b/api/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php index 7058bcf6ea..42f5be2dfa 100644 --- a/api/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php +++ b/api/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php @@ -19,6 +19,6 @@ /** * Thrown when attempting to operate on collections of differing types. */ -class CollectionMismatchException extends RuntimeException +class CollectionMismatchException extends RuntimeException implements CollectionException { } diff --git a/api/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php b/api/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php index dcc3eac601..7b41b4a7c6 100644 --- a/api/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php +++ b/api/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php @@ -14,9 +14,11 @@ namespace Ramsey\Collection\Exception; +use InvalidArgumentException as PhpInvalidArgumentException; + /** * Thrown to indicate an argument is not of the expected type. */ -class InvalidArgumentException extends \InvalidArgumentException +class InvalidArgumentException extends PhpInvalidArgumentException implements CollectionException { } diff --git a/api/vendor/ramsey/collection/src/Exception/ValueExtractionException.php b/api/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php similarity index 62% rename from api/vendor/ramsey/collection/src/Exception/ValueExtractionException.php rename to api/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php index 32f2a175f0..a53be14aab 100644 --- a/api/vendor/ramsey/collection/src/Exception/ValueExtractionException.php +++ b/api/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php @@ -17,8 +17,10 @@ use RuntimeException; /** - * Thrown when attempting to extract a value for a method or property that does not exist. + * Thrown when attempting to evaluate a property, method, or array key + * that doesn't exist on an element or cannot otherwise be evaluated in the + * current context. */ -class ValueExtractionException extends RuntimeException +class InvalidPropertyOrMethod extends RuntimeException implements CollectionException { } diff --git a/api/vendor/ramsey/collection/src/Exception/NoSuchElementException.php b/api/vendor/ramsey/collection/src/Exception/NoSuchElementException.php index cabcb9d889..cd98f0c0f9 100644 --- a/api/vendor/ramsey/collection/src/Exception/NoSuchElementException.php +++ b/api/vendor/ramsey/collection/src/Exception/NoSuchElementException.php @@ -19,6 +19,6 @@ /** * Thrown when attempting to access an element that does not exist. */ -class NoSuchElementException extends RuntimeException +class NoSuchElementException extends RuntimeException implements CollectionException { } diff --git a/api/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php b/api/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php index 4e9d16fa3f..c75294e53b 100644 --- a/api/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php +++ b/api/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php @@ -14,9 +14,11 @@ namespace Ramsey\Collection\Exception; +use OutOfBoundsException as PhpOutOfBoundsException; + /** * Thrown when attempting to access an element out of the range of the collection. */ -class OutOfBoundsException extends \OutOfBoundsException +class OutOfBoundsException extends PhpOutOfBoundsException implements CollectionException { } diff --git a/api/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php b/api/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php index 9b62289712..d074f45fda 100644 --- a/api/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php +++ b/api/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php @@ -19,6 +19,6 @@ /** * Thrown to indicate that the requested operation is not supported. */ -class UnsupportedOperationException extends RuntimeException +class UnsupportedOperationException extends RuntimeException implements CollectionException { } diff --git a/api/vendor/ramsey/collection/src/Map/AbstractMap.php b/api/vendor/ramsey/collection/src/Map/AbstractMap.php index 3788072899..7a851a80f5 100644 --- a/api/vendor/ramsey/collection/src/Map/AbstractMap.php +++ b/api/vendor/ramsey/collection/src/Map/AbstractMap.php @@ -16,6 +16,7 @@ use Ramsey\Collection\AbstractArray; use Ramsey\Collection\Exception\InvalidArgumentException; +use Traversable; use function array_key_exists; use function array_keys; @@ -26,16 +27,37 @@ * This class provides a basic implementation of `MapInterface`, to minimize the * effort required to implement this interface. * + * @template K of array-key * @template T * @extends AbstractArray - * @implements MapInterface + * @implements MapInterface */ abstract class AbstractMap extends AbstractArray implements MapInterface { /** + * @param array $data The initial items to add to this map. + */ + public function __construct(array $data = []) + { + parent::__construct($data); + } + + /** + * @return Traversable + */ + public function getIterator(): Traversable + { + return parent::getIterator(); + } + + /** + * @param K $offset The offset to set + * @param T $value The value to set at the given offset. + * * @inheritDoc + * @psalm-suppress MoreSpecificImplementedParamType,DocblockTypeContradiction */ - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { if ($offset === null) { throw new InvalidArgumentException( @@ -47,18 +69,12 @@ public function offsetSet($offset, $value): void $this->data[$offset] = $value; } - /** - * @inheritDoc - */ - public function containsKey($key): bool + public function containsKey(int | string $key): bool { return array_key_exists($key, $this->data); } - /** - * @inheritDoc - */ - public function containsValue($value): bool + public function containsValue(mixed $value): bool { return in_array($value, $this->data, true); } @@ -72,21 +88,24 @@ public function keys(): array } /** - * @inheritDoc + * @param K $key The key to return from the map. + * @param T | null $defaultValue The default value to use if `$key` is not found. + * + * @return T | null the value or `null` if the key could not be found. */ - public function get($key, $defaultValue = null) + public function get(int | string $key, mixed $defaultValue = null): mixed { - if (!$this->containsKey($key)) { - return $defaultValue; - } - - return $this[$key]; + return $this[$key] ?? $defaultValue; } /** - * @inheritDoc + * @param K $key The key to put or replace in the map. + * @param T $value The value to store at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. */ - public function put($key, $value) + public function put(int | string $key, mixed $value): mixed { $previousValue = $this->get($key); $this[$key] = $value; @@ -95,9 +114,13 @@ public function put($key, $value) } /** - * @inheritDoc + * @param K $key The key to put in the map. + * @param T $value The value to store at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. */ - public function putIfAbsent($key, $value) + public function putIfAbsent(int | string $key, mixed $value): mixed { $currentValue = $this->get($key); @@ -109,9 +132,12 @@ public function putIfAbsent($key, $value) } /** - * @inheritDoc + * @param K $key The key to remove from the map. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. */ - public function remove($key) + public function remove(int | string $key): mixed { $previousValue = $this->get($key); unset($this[$key]); @@ -119,10 +145,7 @@ public function remove($key) return $previousValue; } - /** - * @inheritDoc - */ - public function removeIf($key, $value): bool + public function removeIf(int | string $key, mixed $value): bool { if ($this->get($key) === $value) { unset($this[$key]); @@ -134,9 +157,13 @@ public function removeIf($key, $value): bool } /** - * @inheritDoc + * @param K $key The key to replace. + * @param T $value The value to set at `$key`. + * + * @return T | null the previous value associated with key, or `null` if + * there was no mapping for `$key`. */ - public function replace($key, $value) + public function replace(int | string $key, mixed $value): mixed { $currentValue = $this->get($key); @@ -147,10 +174,7 @@ public function replace($key, $value) return $currentValue; } - /** - * @inheritDoc - */ - public function replaceIf($key, $oldValue, $newValue): bool + public function replaceIf(int | string $key, mixed $oldValue, mixed $newValue): bool { if ($this->get($key) === $oldValue) { $this[$key] = $newValue; @@ -160,4 +184,20 @@ public function replaceIf($key, $oldValue, $newValue): bool return false; } + + /** + * @return array + */ + public function __serialize(): array + { + return parent::__serialize(); + } + + /** + * @return array + */ + public function toArray(): array + { + return parent::toArray(); + } } diff --git a/api/vendor/ramsey/collection/src/Map/AbstractTypedMap.php b/api/vendor/ramsey/collection/src/Map/AbstractTypedMap.php index 486dc2e29c..92fdcd54c7 100644 --- a/api/vendor/ramsey/collection/src/Map/AbstractTypedMap.php +++ b/api/vendor/ramsey/collection/src/Map/AbstractTypedMap.php @@ -18,16 +18,14 @@ use Ramsey\Collection\Tool\TypeTrait; use Ramsey\Collection\Tool\ValueToStringTrait; -use function var_export; - /** * This class provides a basic implementation of `TypedMapInterface`, to * minimize the effort required to implement this interface. * * @template K of array-key * @template T - * @extends AbstractMap - * @implements TypedMapInterface + * @extends AbstractMap + * @implements TypedMapInterface */ abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface { @@ -35,20 +33,14 @@ abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface use ValueToStringTrait; /** - * @param K|null $offset + * @param K $offset * @param T $value * * @inheritDoc + * @psalm-suppress MoreSpecificImplementedParamType */ - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true), - ); - } - if ($this->checkType($this->getKeyType(), $offset) === false) { throw new InvalidArgumentException( 'Key must be of type ' . $this->getKeyType() . '; key is ' diff --git a/api/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php b/api/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php index 79a314d968..34e4e853bd 100644 --- a/api/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php +++ b/api/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php @@ -17,8 +17,7 @@ /** * `AssociativeArrayMap` represents a standard associative array object. * - * @template T - * @extends AbstractMap + * @extends AbstractMap */ class AssociativeArrayMap extends AbstractMap { diff --git a/api/vendor/ramsey/collection/src/Map/MapInterface.php b/api/vendor/ramsey/collection/src/Map/MapInterface.php index 6ed0b2967d..22ba1bdd14 100644 --- a/api/vendor/ramsey/collection/src/Map/MapInterface.php +++ b/api/vendor/ramsey/collection/src/Map/MapInterface.php @@ -21,6 +21,7 @@ * * A map cannot contain duplicate keys; each key can map to at most one value. * + * @template K of array-key * @template T * @extends ArrayInterface */ @@ -29,9 +30,9 @@ interface MapInterface extends ArrayInterface /** * Returns `true` if this map contains a mapping for the specified key. * - * @param array-key $key The key to check in the map. + * @param K $key The key to check in the map. */ - public function containsKey($key): bool; + public function containsKey(int | string $key): bool; /** * Returns `true` if this map maps one or more keys to the specified value. @@ -40,13 +41,12 @@ public function containsKey($key): bool; * * @param T $value The value to check in the map. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function containsValue($value): bool; + public function containsValue(mixed $value): bool; /** * Return an array of the keys contained in this map. * - * @return list + * @return list */ public function keys(): array; @@ -55,13 +55,12 @@ public function keys(): array; * map contains no mapping for the key, or (optionally) `$defaultValue` if * this map contains no mapping for the key. * - * @param array-key $key The key to return from the map. - * @param T|null $defaultValue The default value to use if `$key` is not found. + * @param K $key The key to return from the map. + * @param T | null $defaultValue The default value to use if `$key` is not found. * - * @return T|null the value or `null` if the key could not be found. + * @return T | null the value or `null` if the key could not be found. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function get($key, $defaultValue = null); + public function get(int | string $key, mixed $defaultValue = null): mixed; /** * Associates the specified value with the specified key in this map. @@ -69,14 +68,13 @@ public function get($key, $defaultValue = null); * If the map previously contained a mapping for the key, the old value is * replaced by the specified value. * - * @param array-key $key The key to put or replace in the map. + * @param K $key The key to put or replace in the map. * @param T $value The value to store at `$key`. * - * @return T|null the previous value associated with key, or `null` if + * @return T | null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function put($key, $value); + public function put(int | string $key, mixed $value): mixed; /** * Associates the specified value with the specified key in this map only if @@ -85,25 +83,23 @@ public function put($key, $value); * If there is already a value associated with `$key`, this returns that * value without replacing it. * - * @param array-key $key The key to put in the map. + * @param K $key The key to put in the map. * @param T $value The value to store at `$key`. * - * @return T|null the previous value associated with key, or `null` if + * @return T | null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function putIfAbsent($key, $value); + public function putIfAbsent(int | string $key, mixed $value): mixed; /** * Removes the mapping for a key from this map if it is present. * - * @param array-key $key The key to remove from the map. + * @param K $key The key to remove from the map. * - * @return T|null the previous value associated with key, or `null` if + * @return T | null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function remove($key); + public function remove(int | string $key): mixed; /** * Removes the entry for the specified key only if it is currently mapped to @@ -111,26 +107,24 @@ public function remove($key); * * This performs a strict type check on the value. * - * @param array-key $key The key to remove from the map. + * @param K $key The key to remove from the map. * @param T $value The value to match. * * @return bool true if the value was removed. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function removeIf($key, $value): bool; + public function removeIf(int | string $key, mixed $value): bool; /** * Replaces the entry for the specified key only if it is currently mapped * to some value. * - * @param array-key $key The key to replace. + * @param K $key The key to replace. * @param T $value The value to set at `$key`. * - * @return T|null the previous value associated with key, or `null` if + * @return T | null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function replace($key, $value); + public function replace(int | string $key, mixed $value): mixed; /** * Replaces the entry for the specified key only if currently mapped to the @@ -138,12 +132,11 @@ public function replace($key, $value); * * This performs a strict type check on the value. * - * @param array-key $key The key to remove from the map. + * @param K $key The key to remove from the map. * @param T $oldValue The value to match. * @param T $newValue The value to use as a replacement. * * @return bool true if the value was replaced. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function replaceIf($key, $oldValue, $newValue): bool; + public function replaceIf(int | string $key, mixed $oldValue, mixed $newValue): bool; } diff --git a/api/vendor/ramsey/collection/src/Map/NamedParameterMap.php b/api/vendor/ramsey/collection/src/Map/NamedParameterMap.php index 6e391e9708..f948e476ce 100644 --- a/api/vendor/ramsey/collection/src/Map/NamedParameterMap.php +++ b/api/vendor/ramsey/collection/src/Map/NamedParameterMap.php @@ -21,13 +21,12 @@ use function array_combine; use function array_key_exists; use function is_int; -use function var_export; /** * `NamedParameterMap` represents a mapping of values to a set of named keys * that may optionally be typed * - * @extends AbstractMap + * @extends AbstractMap */ class NamedParameterMap extends AbstractMap { @@ -39,13 +38,13 @@ class NamedParameterMap extends AbstractMap * * @var array */ - protected array $namedParameters; + private readonly array $namedParameters; /** * Constructs a new `NamedParameterMap`. * * @param array $namedParameters The named parameters defined for this map. - * @param array $data An initial set of data to set on this map. + * @param array $data An initial set of data to set on this map. */ public function __construct(array $namedParameters, array $data = []) { @@ -63,22 +62,12 @@ public function getNamedParameters(): array return $this->namedParameters; } - /** - * @inheritDoc - */ - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { - if ($offset === null) { - throw new InvalidArgumentException( - 'Map elements are key/value pairs; a key must be provided for ' - . 'value ' . var_export($value, true), - ); - } - if (!array_key_exists($offset, $this->namedParameters)) { throw new InvalidArgumentException( 'Attempting to set value for unconfigured parameter \'' - . $offset . '\'', + . $this->toolValueToString($offset) . '\'', ); } diff --git a/api/vendor/ramsey/collection/src/Map/TypedMap.php b/api/vendor/ramsey/collection/src/Map/TypedMap.php index 77ef8d3142..f914d9c702 100644 --- a/api/vendor/ramsey/collection/src/Map/TypedMap.php +++ b/api/vendor/ramsey/collection/src/Map/TypedMap.php @@ -14,8 +14,6 @@ namespace Ramsey\Collection\Map; -use Ramsey\Collection\Tool\TypeTrait; - /** * A `TypedMap` represents a map of elements where key and value are typed. * @@ -86,24 +84,6 @@ */ class TypedMap extends AbstractTypedMap { - use TypeTrait; - - /** - * The data type of keys stored in this collection. - * - * A map key's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $keyType; - - /** - * The data type of values stored in this collection. - * - * A map value's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $valueType; - /** * Constructs a map object of the specified key and value types, * optionally with the specified data. @@ -112,11 +92,11 @@ class TypedMap extends AbstractTypedMap * @param string $valueType The data type of the map's values. * @param array $data The initial data to set for this map. */ - public function __construct(string $keyType, string $valueType, array $data = []) - { - $this->keyType = $keyType; - $this->valueType = $valueType; - + public function __construct( + private readonly string $keyType, + private readonly string $valueType, + array $data = [], + ) { parent::__construct($data); } diff --git a/api/vendor/ramsey/collection/src/Map/TypedMapInterface.php b/api/vendor/ramsey/collection/src/Map/TypedMapInterface.php index 0308109cca..5a44f0647c 100644 --- a/api/vendor/ramsey/collection/src/Map/TypedMapInterface.php +++ b/api/vendor/ramsey/collection/src/Map/TypedMapInterface.php @@ -18,8 +18,9 @@ * A `TypedMapInterface` represents a map of elements where key and value are * typed. * + * @template K of array-key * @template T - * @extends MapInterface + * @extends MapInterface */ interface TypedMapInterface extends MapInterface { diff --git a/api/vendor/ramsey/collection/src/Queue.php b/api/vendor/ramsey/collection/src/Queue.php index bc8c24e1c5..0f5b337409 100644 --- a/api/vendor/ramsey/collection/src/Queue.php +++ b/api/vendor/ramsey/collection/src/Queue.php @@ -19,6 +19,8 @@ use Ramsey\Collection\Tool\TypeTrait; use Ramsey\Collection\Tool\ValueToStringTrait; +use function array_key_first; + /** * This class provides a basic implementation of `QueueInterface`, to minimize * the effort required to implement this interface. @@ -32,29 +34,15 @@ class Queue extends AbstractArray implements QueueInterface use TypeTrait; use ValueToStringTrait; - /** - * The type of elements stored in this queue. - * - * A queue's type is immutable once it is set. For this reason, this - * property is set private. - */ - private string $queueType; - - /** - * The index of the head of the queue. - */ - protected int $index = 0; - /** * Constructs a queue object of the specified type, optionally with the * specified data. * - * @param string $queueType The type (FQCN) associated with this queue. - * @param array $data The initial items to store in the collection. + * @param string $queueType The type or class name associated with this queue. + * @param array $data The initial items to store in the queue. */ - public function __construct(string $queueType, array $data = []) + public function __construct(private readonly string $queueType, array $data = []) { - $this->queueType = $queueType; parent::__construct($data); } @@ -65,9 +53,9 @@ public function __construct(string $queueType, array $data = []) * serves only to fulfill the `ArrayAccess` interface requirements. It is * invoked by other operations when adding values to the queue. * - * @throws InvalidArgumentException if $value is of the wrong type + * @throws InvalidArgumentException if $value is of the wrong type. */ - public function offsetSet($offset, $value): void + public function offsetSet(mixed $offset, mixed $value): void { if ($this->checkType($this->getType(), $value) === false) { throw new InvalidArgumentException( @@ -80,11 +68,9 @@ public function offsetSet($offset, $value): void } /** - * @throws InvalidArgumentException if $value is of the wrong type - * - * @inheritDoc + * @throws InvalidArgumentException if $value is of the wrong type. */ - public function add($element): bool + public function add(mixed $element): bool { $this[] = $element; @@ -92,74 +78,67 @@ public function add($element): bool } /** - * @inheritDoc + * @return T + * + * @throws NoSuchElementException if this queue is empty. */ - public function element() + public function element(): mixed { - $element = $this->peek(); - - if ($element === null) { - throw new NoSuchElementException( - 'Can\'t return element from Queue. Queue is empty.', - ); - } - - return $element; + return $this->peek() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); } - /** - * @inheritDoc - */ - public function offer($element): bool + public function offer(mixed $element): bool { try { return $this->add($element); - } catch (InvalidArgumentException $e) { + } catch (InvalidArgumentException) { return false; } } /** - * @inheritDoc + * @return T | null */ - public function peek() + public function peek(): mixed { - if ($this->count() === 0) { + $index = array_key_first($this->data); + + if ($index === null) { return null; } - return $this[$this->index]; + return $this[$index]; } /** - * @inheritDoc + * @return T | null */ - public function poll() + public function poll(): mixed { - if ($this->count() === 0) { + $index = array_key_first($this->data); + + if ($index === null) { return null; } - $head = $this[$this->index]; - - unset($this[$this->index]); - $this->index++; + $head = $this[$index]; + unset($this[$index]); return $head; } /** - * @inheritDoc + * @return T + * + * @throws NoSuchElementException if this queue is empty. */ - public function remove() + public function remove(): mixed { - $head = $this->poll(); - - if ($head === null) { - throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); - } - - return $head; + return $this->poll() ?? throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); } public function getType(): string diff --git a/api/vendor/ramsey/collection/src/QueueInterface.php b/api/vendor/ramsey/collection/src/QueueInterface.php index 4f91487fad..f29ce43abd 100644 --- a/api/vendor/ramsey/collection/src/QueueInterface.php +++ b/api/vendor/ramsey/collection/src/QueueInterface.php @@ -129,8 +129,7 @@ interface QueueInterface extends ArrayInterface * Implementations should use a more-specific exception that extends * `\RuntimeException`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function add($element): bool; + public function add(mixed $element): bool; /** * Retrieves, but does not remove, the head of this queue. @@ -144,7 +143,7 @@ public function add($element): bool; * * @throws NoSuchElementException if this queue is empty. */ - public function element(); + public function element(): mixed; /** * Inserts the specified element into this queue if it is possible to do so @@ -160,8 +159,7 @@ public function element(); * * @return bool `true` if the element was added to this queue, else `false`. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - public function offer($element): bool; + public function offer(mixed $element): bool; /** * Retrieves, but does not remove, the head of this queue, or returns `null` @@ -169,9 +167,9 @@ public function offer($element): bool; * * @see self::element() * - * @return T|null the head of this queue, or `null` if this queue is empty. + * @return T | null the head of this queue, or `null` if this queue is empty. */ - public function peek(); + public function peek(): mixed; /** * Retrieves and removes the head of this queue, or returns `null` @@ -179,9 +177,9 @@ public function peek(); * * @see self::remove() * - * @return T|null the head of this queue, or `null` if this queue is empty. + * @return T | null the head of this queue, or `null` if this queue is empty. */ - public function poll(); + public function poll(): mixed; /** * Retrieves and removes the head of this queue. @@ -195,7 +193,7 @@ public function poll(); * * @throws NoSuchElementException if this queue is empty. */ - public function remove(); + public function remove(): mixed; /** * Returns the type associated with this queue. diff --git a/api/vendor/ramsey/collection/src/Set.php b/api/vendor/ramsey/collection/src/Set.php index c1d37cccad..aa93351c46 100644 --- a/api/vendor/ramsey/collection/src/Set.php +++ b/api/vendor/ramsey/collection/src/Set.php @@ -28,7 +28,7 @@ * $foo = new \My\Foo(); * $set = new Set(\My\Foo::class); * - * $set->add($foo); // returns TRUE, the element don't exists + * $set->add($foo); // returns TRUE, the element doesn't exist * $set->add($foo); // returns FALSE, the element already exists * * $bar = new \My\Foo(); @@ -40,23 +40,15 @@ */ class Set extends AbstractSet { - /** - * The type of elements stored in this set - * - * A set's type is immutable. For this reason, this property is private. - */ - private string $setType; - /** * Constructs a set object of the specified type, optionally with the * specified data. * - * @param string $setType The type (FQCN) associated with this set. + * @param string $setType The type or class name associated with this set. * @param array $data The initial items to store in the set. */ - public function __construct(string $setType, array $data = []) + public function __construct(private readonly string $setType, array $data = []) { - $this->setType = $setType; parent::__construct($data); } diff --git a/api/vendor/ramsey/collection/src/Sort.php b/api/vendor/ramsey/collection/src/Sort.php new file mode 100644 index 0000000000..0c3c192131 --- /dev/null +++ b/api/vendor/ramsey/collection/src/Sort.php @@ -0,0 +1,31 @@ + + * @license http://opensource.org/licenses/MIT MIT + */ + +declare(strict_types=1); + +namespace Ramsey\Collection; + +/** + * Collection sorting + */ +enum Sort: string +{ + /** + * Sort items in a collection in ascending order. + */ + case Ascending = 'asc'; + + /** + * Sort items in a collection in descending order. + */ + case Descending = 'desc'; +} diff --git a/api/vendor/ramsey/collection/src/Tool/TypeTrait.php b/api/vendor/ramsey/collection/src/Tool/TypeTrait.php index 728d44b657..ac51b7f101 100644 --- a/api/vendor/ramsey/collection/src/Tool/TypeTrait.php +++ b/api/vendor/ramsey/collection/src/Tool/TypeTrait.php @@ -36,39 +36,22 @@ trait TypeTrait * @param string $type The type to check the value against. * @param mixed $value The value to check. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - protected function checkType(string $type, $value): bool + protected function checkType(string $type, mixed $value): bool { - switch ($type) { - case 'array': - return is_array($value); - case 'bool': - case 'boolean': - return is_bool($value); - case 'callable': - return is_callable($value); - case 'float': - case 'double': - return is_float($value); - case 'int': - case 'integer': - return is_int($value); - case 'null': - return $value === null; - case 'numeric': - return is_numeric($value); - case 'object': - return is_object($value); - case 'resource': - return is_resource($value); - case 'scalar': - return is_scalar($value); - case 'string': - return is_string($value); - case 'mixed': - return true; - default: - return $value instanceof $type; - } + return match ($type) { + 'array' => is_array($value), + 'bool', 'boolean' => is_bool($value), + 'callable' => is_callable($value), + 'float', 'double' => is_float($value), + 'int', 'integer' => is_int($value), + 'null' => $value === null, + 'numeric' => is_numeric($value), + 'object' => is_object($value), + 'resource' => is_resource($value), + 'scalar' => is_scalar($value), + 'string' => is_string($value), + 'mixed' => true, + default => $value instanceof $type, + }; } } diff --git a/api/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php b/api/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php index e108242837..44c422252b 100644 --- a/api/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php +++ b/api/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php @@ -14,9 +14,10 @@ namespace Ramsey\Collection\Tool; -use Ramsey\Collection\Exception\ValueExtractionException; +use Ramsey\Collection\Exception\InvalidPropertyOrMethod; +use Ramsey\Collection\Exception\UnsupportedOperationException; -use function get_class; +use function is_array; use function is_object; use function method_exists; use function property_exists; @@ -28,34 +29,53 @@ trait ValueExtractorTrait { /** - * Extracts the value of the given property or method from the object. + * Extracts the value of the given property, method, or array key from the + * element. * - * @param mixed $object The object to extract the value from. - * @param string $propertyOrMethod The property or method for which the + * If `$propertyOrMethod` is `null`, we return the element as-is. + * + * @param mixed $element The element to extract the value from. + * @param string | null $propertyOrMethod The property or method for which the * value should be extracted. * - * @return mixed the value extracted from the specified property or method. + * @return mixed the value extracted from the specified property, method, + * or array key, or the element itself. * - * @throws ValueExtractionException if the method or property is not defined. + * @throws InvalidPropertyOrMethod + * @throws UnsupportedOperationException */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - protected function extractValue($object, string $propertyOrMethod) + protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed { - if (!is_object($object)) { - throw new ValueExtractionException('Unable to extract a value from a non-object'); + if ($propertyOrMethod === null) { + return $element; + } + + if (!is_object($element) && !is_array($element)) { + throw new UnsupportedOperationException(sprintf( + 'The collection type "%s" does not support the $propertyOrMethod parameter', + $this->getType(), + )); + } + + if (is_array($element)) { + return $element[$propertyOrMethod] ?? throw new InvalidPropertyOrMethod(sprintf( + 'Key or index "%s" not found in collection elements', + $propertyOrMethod, + )); } - if (property_exists($object, $propertyOrMethod)) { - return $object->$propertyOrMethod; + if (property_exists($element, $propertyOrMethod)) { + return $element->$propertyOrMethod; } - if (method_exists($object, $propertyOrMethod)) { - return $object->{$propertyOrMethod}(); + if (method_exists($element, $propertyOrMethod)) { + return $element->{$propertyOrMethod}(); } - throw new ValueExtractionException( - // phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall - sprintf('Method or property "%s" not defined in %s', $propertyOrMethod, get_class($object)), - ); + throw new InvalidPropertyOrMethod(sprintf( + 'Method or property "%s" not defined in %s', + $propertyOrMethod, + $element::class, + )); } } diff --git a/api/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php b/api/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php index cacefc8b64..64fc5fa42c 100644 --- a/api/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php +++ b/api/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php @@ -16,7 +16,7 @@ use DateTimeInterface; -use function get_class; +use function assert; use function get_resource_type; use function is_array; use function is_bool; @@ -24,7 +24,6 @@ use function is_object; use function is_resource; use function is_scalar; -use function var_export; /** * Provides functionality to express a value as string @@ -46,8 +45,7 @@ trait ValueToStringTrait * * @param mixed $value the value to return as a string. */ - // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint - protected function toolValueToString($value): string + protected function toolValueToString(mixed $value): string { // null if ($value === null) { @@ -74,12 +72,8 @@ protected function toolValueToString($value): string return '(' . get_resource_type($value) . ' resource #' . (int) $value . ')'; } - // If we don't know what it is, use var_export(). - if (!is_object($value)) { - return '(' . var_export($value, true) . ')'; - } - // From here, $value should be an object. + assert(is_object($value)); // __toString() is implemented if (is_callable([$value, '__toString'])) { @@ -92,7 +86,6 @@ protected function toolValueToString($value): string } // unknown type - // phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall - return '(' . get_class($value) . ' Object)'; + return '(' . $value::class . ' Object)'; } } diff --git a/api/vendor/ramsey/uuid/composer.json b/api/vendor/ramsey/uuid/composer.json index 86bccac1dd..8139b54e33 100644 --- a/api/vendor/ramsey/uuid/composer.json +++ b/api/vendor/ramsey/uuid/composer.json @@ -11,7 +11,7 @@ "require": { "php": "^8.0", "ext-json": "*", - "brick/math": "^0.8.8 || ^0.9 || ^0.10", + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11 || ^0.12", "ramsey/collection": "^1.2 || ^2.0" }, "require-dev": { diff --git a/api/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php b/api/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php index af94decf2d..d7c8ed4eee 100644 --- a/api/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php +++ b/api/vendor/ramsey/uuid/src/Generator/UnixTimeGenerator.php @@ -142,7 +142,7 @@ private function increment(): string self::$seedIndex = 21; } - self::$rand[5] = 0xffff & $carry = self::$rand[5] + (self::$seedParts[self::$seedIndex--] & 0xffffff); + self::$rand[5] = 0xffff & $carry = self::$rand[5] + 1 + (self::$seedParts[self::$seedIndex--] & 0xffffff); self::$rand[4] = 0xffff & $carry = self::$rand[4] + ($carry >> 16); self::$rand[3] = 0xffff & $carry = self::$rand[3] + ($carry >> 16); self::$rand[2] = 0xffff & $carry = self::$rand[2] + ($carry >> 16); diff --git a/api/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php b/api/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php index f2d86788cd..f065acd469 100644 --- a/api/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php +++ b/api/vendor/ramsey/uuid/src/Math/BrickMathCalculator.php @@ -136,9 +136,11 @@ public function toInteger(Hexadecimal $value): IntegerObject /** * Maps ramsey/uuid rounding modes to those used by brick/math + * + * @return BrickMathRounding::* */ - private function getBrickRoundingMode(int $roundingMode): int + private function getBrickRoundingMode(int $roundingMode) { - return self::ROUNDING_MODE_MAP[$roundingMode] ?? 0; + return self::ROUNDING_MODE_MAP[$roundingMode] ?? BrickMathRounding::UNNECESSARY; } } diff --git a/api/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php b/api/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php index 1a7bbaf75f..7497dd1014 100644 --- a/api/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php +++ b/api/vendor/ramsey/uuid/src/Nonstandard/UuidV6.php @@ -23,7 +23,7 @@ use Ramsey\Uuid\Rfc4122\TimeTrait; use Ramsey\Uuid\Rfc4122\UuidInterface; use Ramsey\Uuid\Rfc4122\UuidV1; -use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Uuid as BaseUuid; /** * Reordered time, or version 6, UUIDs include timestamp, clock sequence, and @@ -36,7 +36,7 @@ * * @psalm-immutable */ -class UuidV6 extends Uuid implements UuidInterface +class UuidV6 extends BaseUuid implements UuidInterface { use TimeTrait; diff --git a/api/vendor/ramsey/uuid/src/Uuid.php b/api/vendor/ramsey/uuid/src/Uuid.php index 6fb1e5b75e..e0384a50c1 100644 --- a/api/vendor/ramsey/uuid/src/Uuid.php +++ b/api/vendor/ramsey/uuid/src/Uuid.php @@ -293,7 +293,7 @@ public function jsonSerialize(): string */ public function serialize(): string { - return $this->getFields()->getBytes(); + return $this->codec->encode($this); } /** @@ -446,20 +446,20 @@ public static function setFactory(UuidFactoryInterface $factory): void */ public static function fromBytes(string $bytes): UuidInterface { - if (! self::$factoryReplaced && strlen($bytes) === 16) { + if (!self::$factoryReplaced && strlen($bytes) === 16) { $base16Uuid = bin2hex($bytes); // Note: we are calling `fromString` internally because we don't know if the given `$bytes` is a valid UUID return self::fromString( substr($base16Uuid, 0, 8) - . '-' - . substr($base16Uuid, 8, 4) - . '-' - . substr($base16Uuid, 12, 4) - . '-' - . substr($base16Uuid, 16, 4) - . '-' - . substr($base16Uuid, 20, 12) + . '-' + . substr($base16Uuid, 8, 4) + . '-' + . substr($base16Uuid, 12, 4) + . '-' + . substr($base16Uuid, 16, 4) + . '-' + . substr($base16Uuid, 20, 12) ); } @@ -485,7 +485,7 @@ public static function fromBytes(string $bytes): UuidInterface public static function fromString(string $uuid): UuidInterface { $uuid = strtolower($uuid); - if (! self::$factoryReplaced && preg_match(LazyUuidFromString::VALID_REGEX, $uuid) === 1) { + if (!self::$factoryReplaced && preg_match(LazyUuidFromString::VALID_REGEX, $uuid) === 1) { assert($uuid !== ''); return new LazyUuidFromString($uuid); diff --git a/api/vendor/ramsey/uuid/src/UuidInterface.php b/api/vendor/ramsey/uuid/src/UuidInterface.php index 5f41675bfa..cac9457de1 100644 --- a/api/vendor/ramsey/uuid/src/UuidInterface.php +++ b/api/vendor/ramsey/uuid/src/UuidInterface.php @@ -19,6 +19,7 @@ use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Type\Integer as IntegerObject; use Serializable; +use Stringable; /** * A UUID is a universally unique identifier adhering to an agreed-upon @@ -29,7 +30,8 @@ interface UuidInterface extends DeprecatedUuidInterface, JsonSerializable, - Serializable + Serializable, + Stringable { /** * Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than @@ -44,7 +46,7 @@ interface UuidInterface extends * * @param UuidInterface $other The UUID to compare * - * @return int -1, 0, or 1 if the UUID is less than, equal to, or greater than $other + * @return int<-1,1> -1, 0, or 1 if the UUID is less than, equal to, or greater than $other */ public function compareTo(UuidInterface $other): int; diff --git a/api/vendor/ramsey/uuid/src/functions.php b/api/vendor/ramsey/uuid/src/functions.php index 2adf214c4d..1b3ce00f7f 100644 --- a/api/vendor/ramsey/uuid/src/functions.php +++ b/api/vendor/ramsey/uuid/src/functions.php @@ -150,7 +150,7 @@ function v7(?DateTimeInterface $dateTime = null): string * field, and bits 64 and 65 will be replaced with the UUID variant. You * MUST NOT rely on these bits for your application needs. * - * @return non-empty-string Version 7 UUID as a string + * @return non-empty-string Version 8 UUID as a string */ function v8(string $bytes): string { diff --git a/api/vendor/sebastian/cli-parser/ChangeLog.md b/api/vendor/sebastian/cli-parser/ChangeLog.md index 9431ec5943..9ecd241def 100644 --- a/api/vendor/sebastian/cli-parser/ChangeLog.md +++ b/api/vendor/sebastian/cli-parser/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [1.0.2] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + ## [1.0.1] - 2020-09-28 ### Changed @@ -12,4 +18,6 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Initial release +[1.0.2]: https://github.com/sebastianbergmann/cli-parser/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/sebastianbergmann/cli-parser/compare/1.0.0...1.0.1 [1.0.0]: https://github.com/sebastianbergmann/cli-parser/compare/bb7bb3297957927962b0a3335befe7b66f7462e9...1.0.0 diff --git a/api/vendor/sebastian/cli-parser/src/Parser.php b/api/vendor/sebastian/cli-parser/src/Parser.php index a4f728bc67..67d8909f54 100644 --- a/api/vendor/sebastian/cli-parser/src/Parser.php +++ b/api/vendor/sebastian/cli-parser/src/Parser.php @@ -41,7 +41,7 @@ final class Parser * @throws OptionDoesNotAllowArgumentException * @throws UnknownOptionException */ - public function parse(array $argv, string $shortOptions, array $longOptions = null): array + public function parse(array $argv, string $shortOptions, ?array $longOptions = null): array { if (empty($argv)) { return [[], []]; diff --git a/api/vendor/sebastian/complexity/ChangeLog.md b/api/vendor/sebastian/complexity/ChangeLog.md index cb93ff6201..51deba71ce 100644 --- a/api/vendor/sebastian/complexity/ChangeLog.md +++ b/api/vendor/sebastian/complexity/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [2.0.3] - 2023-12-22 + +### Changed + +* This component is now compatible with `nikic/php-parser` 5.0 + ## [2.0.2] - 2020-10-26 ### Fixed @@ -24,6 +30,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Initial release +[2.0.3]: https://github.com/sebastianbergmann/complexity/compare/2.0.2...2.0.3 [2.0.2]: https://github.com/sebastianbergmann/complexity/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/sebastianbergmann/complexity/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/sebastianbergmann/complexity/compare/1.0.0...2.0.0 diff --git a/api/vendor/sebastian/complexity/composer.json b/api/vendor/sebastian/complexity/composer.json index 7aa38314ec..592e418505 100644 --- a/api/vendor/sebastian/complexity/composer.json +++ b/api/vendor/sebastian/complexity/composer.json @@ -14,9 +14,10 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues" }, + "prefer-stable": true, "require": { "php": ">=7.3", - "nikic/php-parser": "^4.7" + "nikic/php-parser": "^4.18 || ^5.0" }, "require-dev": { "phpunit/phpunit": "^9.3" diff --git a/api/vendor/sebastian/complexity/src/Calculator.php b/api/vendor/sebastian/complexity/src/Calculator.php index 9abdcd1691..f538190352 100644 --- a/api/vendor/sebastian/complexity/src/Calculator.php +++ b/api/vendor/sebastian/complexity/src/Calculator.php @@ -10,12 +10,10 @@ namespace SebastianBergmann\Complexity; use PhpParser\Error; -use PhpParser\Lexer; use PhpParser\Node; use PhpParser\NodeTraverser; use PhpParser\NodeVisitor\NameResolver; use PhpParser\NodeVisitor\ParentConnectingVisitor; -use PhpParser\Parser; use PhpParser\ParserFactory; final class Calculator @@ -34,7 +32,7 @@ public function calculateForSourceFile(string $sourceFile): ComplexityCollection public function calculateForSourceString(string $source): ComplexityCollection { try { - $nodes = $this->parser()->parse($source); + $nodes = (new ParserFactory)->createForHostVersion()->parse($source); assert($nodes !== null); @@ -80,9 +78,4 @@ public function calculateForAbstractSyntaxTree(array $nodes): ComplexityCollecti return $complexityCalculatingVisitor->result(); } - - private function parser(): Parser - { - return (new ParserFactory)->create(ParserFactory::PREFER_PHP7, new Lexer); - } } diff --git a/api/vendor/sebastian/diff/ChangeLog.md b/api/vendor/sebastian/diff/ChangeLog.md index 9bdcc5b6d7..e62d8f9577 100644 --- a/api/vendor/sebastian/diff/ChangeLog.md +++ b/api/vendor/sebastian/diff/ChangeLog.md @@ -2,6 +2,19 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [4.0.6] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + +## [4.0.5] - 2023-05-07 + +### Changed + +* [#118](https://github.com/sebastianbergmann/diff/pull/118): Improve performance of `MemoryEfficientLongestCommonSubsequenceCalculator` +* [#119](https://github.com/sebastianbergmann/diff/pull/119): Improve performance of `TimeEfficientLongestCommonSubsequenceCalculator` + ## [4.0.4] - 2020-10-26 ### Fixed @@ -76,6 +89,8 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 5.6 +[4.0.6]: https://github.com/sebastianbergmann/diff/compare/4.0.5...4.0.6 +[4.0.5]: https://github.com/sebastianbergmann/diff/compare/4.0.4...4.0.5 [4.0.4]: https://github.com/sebastianbergmann/diff/compare/4.0.3...4.0.4 [4.0.3]: https://github.com/sebastianbergmann/diff/compare/4.0.2...4.0.3 [4.0.2]: https://github.com/sebastianbergmann/diff/compare/4.0.1...4.0.2 diff --git a/api/vendor/sebastian/diff/src/Differ.php b/api/vendor/sebastian/diff/src/Differ.php index 5a4d9d1024..98c7a9b29a 100644 --- a/api/vendor/sebastian/diff/src/Differ.php +++ b/api/vendor/sebastian/diff/src/Differ.php @@ -82,7 +82,7 @@ public function __construct($outputBuilder = null) * @param array|string $from * @param array|string $to */ - public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null): string + public function diff($from, $to, ?LongestCommonSubsequenceCalculator $lcs = null): string { $diff = $this->diffToArray( $this->normalizeDiffInput($from), @@ -108,7 +108,7 @@ public function diff($from, $to, LongestCommonSubsequenceCalculator $lcs = null) * @param array|string $to * @param LongestCommonSubsequenceCalculator $lcs */ - public function diffToArray($from, $to, LongestCommonSubsequenceCalculator $lcs = null): array + public function diffToArray($from, $to, ?LongestCommonSubsequenceCalculator $lcs = null): array { if (is_string($from)) { $from = $this->splitStringByLines($from); diff --git a/api/vendor/sebastian/diff/src/Exception/ConfigurationException.php b/api/vendor/sebastian/diff/src/Exception/ConfigurationException.php index b767b2194a..8847a2e586 100644 --- a/api/vendor/sebastian/diff/src/Exception/ConfigurationException.php +++ b/api/vendor/sebastian/diff/src/Exception/ConfigurationException.php @@ -22,7 +22,7 @@ public function __construct( string $expected, $value, int $code = 0, - Exception $previous = null + ?Exception $previous = null ) { parent::__construct( sprintf( diff --git a/api/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php b/api/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php index 0b626eaff9..489113b6bb 100644 --- a/api/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php +++ b/api/vendor/sebastian/diff/src/MemoryEfficientLongestCommonSubsequenceCalculator.php @@ -78,7 +78,12 @@ private function length(array $from, array $to): array if ($from[$i] === $to[$j]) { $current[$j + 1] = $prev[$j] + 1; } else { - $current[$j + 1] = max($current[$j], $prev[$j + 1]); + // don't use max() to avoid function call overhead + if ($current[$j] > $prev[$j + 1]) { + $current[$j + 1] = $current[$j]; + } else { + $current[$j + 1] = $prev[$j + 1]; + } } } } diff --git a/api/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php b/api/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php index fd19cac763..4e8d951d4b 100644 --- a/api/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php +++ b/api/vendor/sebastian/diff/src/TimeEfficientLongestCommonSubsequenceCalculator.php @@ -37,12 +37,24 @@ public function calculate(array $from, array $to): array for ($i = 1; $i <= $fromLength; ++$i) { for ($j = 1; $j <= $toLength; ++$j) { - $o = ($j * $width) + $i; - $matrix[$o] = max( - $matrix[$o - 1], - $matrix[$o - $width], - $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0 - ); + $o = ($j * $width) + $i; + + // don't use max() to avoid function call overhead + $firstOrLast = $from[$i - 1] === $to[$j - 1] ? $matrix[$o - $width - 1] + 1 : 0; + + if ($matrix[$o - 1] > $matrix[$o - $width]) { + if ($firstOrLast > $matrix[$o - 1]) { + $matrix[$o] = $firstOrLast; + } else { + $matrix[$o] = $matrix[$o - 1]; + } + } else { + if ($firstOrLast > $matrix[$o - $width]) { + $matrix[$o] = $firstOrLast; + } else { + $matrix[$o] = $matrix[$o - $width]; + } + } } } diff --git a/api/vendor/sebastian/exporter/ChangeLog.md b/api/vendor/sebastian/exporter/ChangeLog.md index 91a4220d59..32ab7051f0 100644 --- a/api/vendor/sebastian/exporter/ChangeLog.md +++ b/api/vendor/sebastian/exporter/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [4.0.6] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + ## [4.0.5] - 2022-09-14 ### Fixed @@ -66,6 +72,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Remove HHVM-specific code that is no longer needed +[4.0.6]: https://github.com/sebastianbergmann/exporter/compare/4.0.5...4.0.6 [4.0.5]: https://github.com/sebastianbergmann/exporter/compare/4.0.4...4.0.5 [4.0.4]: https://github.com/sebastianbergmann/exporter/compare/4.0.3...4.0.4 [4.0.3]: https://github.com/sebastianbergmann/exporter/compare/4.0.2...4.0.3 diff --git a/api/vendor/sebastian/exporter/src/Exporter.php b/api/vendor/sebastian/exporter/src/Exporter.php index ca006ad6db..5d85b13a7e 100644 --- a/api/vendor/sebastian/exporter/src/Exporter.php +++ b/api/vendor/sebastian/exporter/src/Exporter.php @@ -77,7 +77,7 @@ public function export($value, $indentation = 0) * * @return string */ - public function shortenedRecursiveExport(&$data, Context $context = null) + public function shortenedRecursiveExport(&$data, ?Context $context = null) { $result = []; $exporter = new self(); diff --git a/api/vendor/sebastian/global-state/ChangeLog.md b/api/vendor/sebastian/global-state/ChangeLog.md index a27a5cf168..e76f84b8ff 100644 --- a/api/vendor/sebastian/global-state/ChangeLog.md +++ b/api/vendor/sebastian/global-state/ChangeLog.md @@ -2,6 +2,18 @@ All notable changes in `sebastian/global-state` are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [5.0.7] - 2024-03-02 + +### Changed + +* Do not use implicitly nullable parameters + +## [5.0.6] - 2023-08-02 + +### Changed + +* Changed usage of `ReflectionProperty::setValue()` to be compatible with PHP 8.3 + ## [5.0.5] - 2022-02-14 ### Fixed @@ -66,6 +78,8 @@ All notable changes in `sebastian/global-state` are documented in this file usin * This component is no longer supported on PHP 7.0 and PHP 7.1 +[5.0.7]: https://github.com/sebastianbergmann/global-state/compare/5.0.6...5.0.7 +[5.0.6]: https://github.com/sebastianbergmann/global-state/compare/5.0.5...5.0.6 [5.0.5]: https://github.com/sebastianbergmann/global-state/compare/5.0.4...5.0.5 [5.0.4]: https://github.com/sebastianbergmann/global-state/compare/5.0.3...5.0.4 [5.0.3]: https://github.com/sebastianbergmann/global-state/compare/5.0.2...5.0.3 diff --git a/api/vendor/sebastian/global-state/src/Restorer.php b/api/vendor/sebastian/global-state/src/Restorer.php index 1633fcc11c..ab145ce231 100644 --- a/api/vendor/sebastian/global-state/src/Restorer.php +++ b/api/vendor/sebastian/global-state/src/Restorer.php @@ -85,7 +85,7 @@ public function restoreStaticAttributes(Snapshot $snapshot): void foreach ($staticAttributes as $name => $value) { $reflector = new ReflectionProperty($className, $name); $reflector->setAccessible(true); - $reflector->setValue($value); + $reflector->setValue(null, $value); } } @@ -109,7 +109,7 @@ public function restoreStaticAttributes(Snapshot $snapshot): void } $attribute->setAccessible(true); - $attribute->setValue($defaults[$name]); + $attribute->setValue(null, $defaults[$name]); } } } diff --git a/api/vendor/sebastian/global-state/src/Snapshot.php b/api/vendor/sebastian/global-state/src/Snapshot.php index e33264eb06..61219cacd1 100644 --- a/api/vendor/sebastian/global-state/src/Snapshot.php +++ b/api/vendor/sebastian/global-state/src/Snapshot.php @@ -101,7 +101,7 @@ class Snapshot /** * Creates a snapshot of the current global state. */ - public function __construct(ExcludeList $excludeList = null, bool $includeGlobalVariables = true, bool $includeStaticAttributes = true, bool $includeConstants = true, bool $includeFunctions = true, bool $includeClasses = true, bool $includeInterfaces = true, bool $includeTraits = true, bool $includeIniSettings = true, bool $includeIncludedFiles = true) + public function __construct(?ExcludeList $excludeList = null, bool $includeGlobalVariables = true, bool $includeStaticAttributes = true, bool $includeConstants = true, bool $includeFunctions = true, bool $includeClasses = true, bool $includeInterfaces = true, bool $includeTraits = true, bool $includeIniSettings = true, bool $includeIncludedFiles = true) { $this->excludeList = $excludeList ?: new ExcludeList; diff --git a/api/vendor/sebastian/lines-of-code/ChangeLog.md b/api/vendor/sebastian/lines-of-code/ChangeLog.md index 39bcaad490..2c96070588 100644 --- a/api/vendor/sebastian/lines-of-code/ChangeLog.md +++ b/api/vendor/sebastian/lines-of-code/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [1.0.4] - 2023-12-22 + +### Changed + +* This component is now compatible with `nikic/php-parser` 5.0 + ## [1.0.3] - 2020-11-28 ### Fixed @@ -28,6 +34,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Initial release +[1.0.4]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.3...1.0.4 [1.0.3]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.2...1.0.3 [1.0.2]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.1...1.0.2 [1.0.1]: https://github.com/sebastianbergmann/lines-of-code/compare/1.0.0...1.0.1 diff --git a/api/vendor/sebastian/lines-of-code/composer.json b/api/vendor/sebastian/lines-of-code/composer.json index 95bb9e3632..3f28786577 100644 --- a/api/vendor/sebastian/lines-of-code/composer.json +++ b/api/vendor/sebastian/lines-of-code/composer.json @@ -17,7 +17,7 @@ "prefer-stable": true, "require": { "php": ">=7.3", - "nikic/php-parser": "^4.6" + "nikic/php-parser": "^4.18 || ^5.0" }, "require-dev": { "phpunit/phpunit": "^9.3" diff --git a/api/vendor/sebastian/lines-of-code/src/Counter.php b/api/vendor/sebastian/lines-of-code/src/Counter.php index cfe5e20a78..8153a7b245 100644 --- a/api/vendor/sebastian/lines-of-code/src/Counter.php +++ b/api/vendor/sebastian/lines-of-code/src/Counter.php @@ -11,10 +11,8 @@ use function substr_count; use PhpParser\Error; -use PhpParser\Lexer; use PhpParser\Node; use PhpParser\NodeTraverser; -use PhpParser\Parser; use PhpParser\ParserFactory; final class Counter @@ -39,7 +37,7 @@ public function countInSourceString(string $source): LinesOfCode } try { - $nodes = $this->parser()->parse($source); + $nodes = (new ParserFactory)->createForHostVersion()->parse($source); assert($nodes !== null); @@ -83,9 +81,4 @@ public function countInAbstractSyntaxTree(int $linesOfCode, array $nodes): Lines return $visitor->result(); } - - private function parser(): Parser - { - return (new ParserFactory)->create(ParserFactory::PREFER_PHP7, new Lexer); - } } diff --git a/api/vendor/sebastian/resource-operations/.gitattributes b/api/vendor/sebastian/resource-operations/.gitattributes deleted file mode 100644 index 85e55ebcaa..0000000000 --- a/api/vendor/sebastian/resource-operations/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/.github export-ignore -/.php_cs.dist export-ignore -/build.xml export-ignore -/phpunit.xml export-ignore -/tests export-ignore - -*.php diff=php diff --git a/api/vendor/sebastian/resource-operations/.gitignore b/api/vendor/sebastian/resource-operations/.gitignore deleted file mode 100644 index a086c78190..0000000000 --- a/api/vendor/sebastian/resource-operations/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/.idea -/.php_cs.cache -/build/FunctionSignatureMap.php -/composer.lock -/vendor -/.phpunit.result.cache diff --git a/api/vendor/sebastian/resource-operations/ChangeLog.md b/api/vendor/sebastian/resource-operations/ChangeLog.md index e6dc739226..eae062908b 100644 --- a/api/vendor/sebastian/resource-operations/ChangeLog.md +++ b/api/vendor/sebastian/resource-operations/ChangeLog.md @@ -2,6 +2,10 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [3.0.4] - 2024-03-14 + +No functional changes. + ## [3.0.3] - 2020-09-28 ### Changed @@ -46,6 +50,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Initial release +[3.0.4]: https://github.com/sebastianbergmann/comparator/resource-operations/3.0.3...3.0.4 [3.0.3]: https://github.com/sebastianbergmann/comparator/resource-operations/3.0.2...3.0.3 [3.0.2]: https://github.com/sebastianbergmann/comparator/resource-operations/3.0.1...3.0.2 [3.0.1]: https://github.com/sebastianbergmann/comparator/resource-operations/3.0.0...3.0.1 diff --git a/api/vendor/sebastian/resource-operations/SECURITY.md b/api/vendor/sebastian/resource-operations/SECURITY.md new file mode 100644 index 0000000000..d88ff0019a --- /dev/null +++ b/api/vendor/sebastian/resource-operations/SECURITY.md @@ -0,0 +1,30 @@ +# Security Policy + +If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure. + +**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** + +Instead, please email `sebastian@phpunit.de`. + +Please include as much of the information listed below as you can to help us better understand and resolve the issue: + +* The type of issue +* Full paths of source file(s) related to the manifestation of the issue +* The location of the affected source code (tag/branch/commit or direct URL) +* Any special configuration required to reproduce the issue +* Step-by-step instructions to reproduce the issue +* Proof-of-concept or exploit code (if possible) +* Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +## Web Context + +The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit. + +The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes. + +If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context. + +Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes. + diff --git a/api/vendor/sebastian/resource-operations/composer.json b/api/vendor/sebastian/resource-operations/composer.json index 870be3c122..77e4baee90 100644 --- a/api/vendor/sebastian/resource-operations/composer.json +++ b/api/vendor/sebastian/resource-operations/composer.json @@ -30,8 +30,9 @@ }, "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } - } + }, + "abandoned": false } diff --git a/api/vendor/symfony/console/Application.php b/api/vendor/symfony/console/Application.php index 29951e9c1a..1a7e50388d 100644 --- a/api/vendor/symfony/console/Application.php +++ b/api/vendor/symfony/console/Application.php @@ -134,7 +134,7 @@ public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) * * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. */ - public function run(InputInterface $input = null, OutputInterface $output = null) + public function run(?InputInterface $input = null, ?OutputInterface $output = null) { if (\function_exists('putenv')) { @putenv('LINES='.$this->terminal->getHeight()); @@ -165,9 +165,9 @@ public function run(InputInterface $input = null, OutputInterface $output = null } } - $this->configureIO($input, $output); - try { + $this->configureIO($input, $output); + $exitCode = $this->doRun($input, $output); } catch (\Exception $e) { if (!$this->catchExceptions) { @@ -778,7 +778,7 @@ public function find(string $name) * * @return Command[] */ - public function all(string $namespace = null) + public function all(?string $namespace = null) { $this->init(); @@ -858,7 +858,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo } 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) { + $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); } @@ -1147,7 +1147,7 @@ private function getAbbreviationSuggestions(array $abbrevs): string * * @return string */ - public function extractNamespace(string $name, int $limit = null) + public function extractNamespace(string $name, ?int $limit = null) { $parts = explode(':', $name, -1); diff --git a/api/vendor/symfony/console/CI/GithubActionReporter.php b/api/vendor/symfony/console/CI/GithubActionReporter.php index a15c1ff18b..065717854a 100644 --- a/api/vendor/symfony/console/CI/GithubActionReporter.php +++ b/api/vendor/symfony/console/CI/GithubActionReporter.php @@ -57,7 +57,7 @@ public static function isGithubActionEnvironment(): bool * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message */ - public function error(string $message, string $file = null, int $line = null, int $col = null): void + public function error(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('error', $message, $file, $line, $col); } @@ -67,7 +67,7 @@ public function error(string $message, string $file = null, int $line = null, in * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message */ - public function warning(string $message, string $file = null, int $line = null, int $col = null): void + public function warning(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('warning', $message, $file, $line, $col); } @@ -77,12 +77,12 @@ public function warning(string $message, string $file = null, int $line = null, * * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message */ - public function debug(string $message, string $file = null, int $line = null, int $col = null): void + public function debug(string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { $this->log('debug', $message, $file, $line, $col); } - private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void + private function log(string $type, string $message, ?string $file = null, ?int $line = null, ?int $col = null): void { // Some values must be encoded. $message = strtr($message, self::ESCAPED_DATA); diff --git a/api/vendor/symfony/console/Command/Command.php b/api/vendor/symfony/console/Command/Command.php index e0593e17a7..d181036709 100644 --- a/api/vendor/symfony/console/Command/Command.php +++ b/api/vendor/symfony/console/Command/Command.php @@ -96,7 +96,7 @@ public static function getDefaultDescription(): ?string * * @throws LogicException When the command name is empty */ - public function __construct(string $name = null) + public function __construct(?string $name = null) { $this->definition = new InputDefinition(); @@ -132,7 +132,7 @@ public function ignoreValidationErrors() $this->ignoreValidationErrors = true; } - public function setApplication(Application $application = null) + public function setApplication(?Application $application = null) { $this->application = $application; if ($application) { @@ -429,11 +429,11 @@ public function getNativeDefinition() * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) * - * @throws InvalidArgumentException When argument mode is not valid - * * @return $this + * + * @throws InvalidArgumentException When argument mode is not valid */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null) + public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null) { $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); if (null !== $this->fullDefinition) { @@ -450,11 +450,11 @@ public function addArgument(string $name, int $mode = null, string $description * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) * - * @throws InvalidArgumentException If option mode is invalid or incompatible - * * @return $this + * + * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) + public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null) { $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); if (null !== $this->fullDefinition) { diff --git a/api/vendor/symfony/console/Command/CompleteCommand.php b/api/vendor/symfony/console/Command/CompleteCommand.php index 11ada4e448..0e35143c33 100644 --- a/api/vendor/symfony/console/Command/CompleteCommand.php +++ b/api/vendor/symfony/console/Command/CompleteCommand.php @@ -155,10 +155,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int throw $e; } - return self::FAILURE; + return 2; } - return self::SUCCESS; + return 0; } private function createCompletionInput(InputInterface $input): CompletionInput diff --git a/api/vendor/symfony/console/Command/DumpCompletionCommand.php b/api/vendor/symfony/console/Command/DumpCompletionCommand.php index 518d606a0c..eaf22be1a9 100644 --- a/api/vendor/symfony/console/Command/DumpCompletionCommand.php +++ b/api/vendor/symfony/console/Command/DumpCompletionCommand.php @@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getOption('debug')) { $this->tailDebugLog($commandName, $output); - return self::SUCCESS; + return 0; } $shell = $input->getArgument('shell') ?? self::guessShell(); @@ -102,12 +102,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); } - return self::INVALID; + return 2; } $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, $this->getApplication()->getVersion()], file_get_contents($completionFile))); - return self::SUCCESS; + return 0; } private static function guessShell(): string @@ -132,8 +132,14 @@ private function tailDebugLog(string $commandName, OutputInterface $output): voi */ private function getSupportedShells(): array { - return array_map(function ($f) { - return pathinfo($f, \PATHINFO_EXTENSION); - }, glob(__DIR__.'/../Resources/completion.*')); + $shells = []; + + foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { + if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { + $shells[] = $file->getExtension(); + } + } + + return $shells; } } diff --git a/api/vendor/symfony/console/Command/LazyCommand.php b/api/vendor/symfony/console/Command/LazyCommand.php index e576ad03fe..302a0809e8 100644 --- a/api/vendor/symfony/console/Command/LazyCommand.php +++ b/api/vendor/symfony/console/Command/LazyCommand.php @@ -43,7 +43,7 @@ public function ignoreValidationErrors(): void $this->getCommand()->ignoreValidationErrors(); } - public function setApplication(Application $application = null): void + public function setApplication(?Application $application = null): void { if ($this->command instanceof parent) { $this->command->setApplication($application); @@ -117,7 +117,7 @@ public function getNativeDefinition(): InputDefinition /** * @return $this */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self + public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null): self { $this->getCommand()->addArgument($name, $mode, $description, $default); @@ -127,7 +127,7 @@ public function addArgument(string $name, int $mode = null, string $description /** * @return $this */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self + public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): self { $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default); diff --git a/api/vendor/symfony/console/Command/LockableTrait.php b/api/vendor/symfony/console/Command/LockableTrait.php index b1856dca7c..d21edc2c0e 100644 --- a/api/vendor/symfony/console/Command/LockableTrait.php +++ b/api/vendor/symfony/console/Command/LockableTrait.php @@ -30,7 +30,7 @@ trait LockableTrait /** * Locks a command. */ - private function lock(string $name = null, bool $blocking = false): bool + 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.'); diff --git a/api/vendor/symfony/console/Completion/CompletionInput.php b/api/vendor/symfony/console/Completion/CompletionInput.php index 368b945079..2f631bcd84 100644 --- a/api/vendor/symfony/console/Completion/CompletionInput.php +++ b/api/vendor/symfony/console/Completion/CompletionInput.php @@ -53,7 +53,7 @@ public static function fromString(string $inputStr, int $currentIndex): self * Create an input based on an COMP_WORDS token list. * * @param string[] $tokens the set of split tokens (e.g. COMP_WORDS or argv) - * @param $currentIndex the index of the cursor (e.g. COMP_CWORD) + * @param int $currentIndex the index of the cursor (e.g. COMP_CWORD) */ public static function fromTokens(array $tokens, int $currentIndex): self { diff --git a/api/vendor/symfony/console/Descriptor/ApplicationDescription.php b/api/vendor/symfony/console/Descriptor/ApplicationDescription.php index 2a3acc99b7..eb11b4f91c 100644 --- a/api/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/api/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -43,7 +43,7 @@ class ApplicationDescription */ private $aliases; - public function __construct(Application $application, string $namespace = null, bool $showHidden = false) + public function __construct(Application $application, ?string $namespace = null, bool $showHidden = false) { $this->application = $application; $this->namespace = $namespace; diff --git a/api/vendor/symfony/console/Descriptor/XmlDescriptor.php b/api/vendor/symfony/console/Descriptor/XmlDescriptor.php index 4f7cd8b3e0..f17e5f1f2b 100644 --- a/api/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ b/api/vendor/symfony/console/Descriptor/XmlDescriptor.php @@ -79,7 +79,7 @@ public function getCommandDocument(Command $command, bool $short = false): \DOMD return $dom; } - public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument + public function getApplicationDocument(Application $application, ?string $namespace = null, bool $short = false): \DOMDocument { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->appendChild($rootXml = $dom->createElement('symfony')); diff --git a/api/vendor/symfony/console/Event/ConsoleCommandEvent.php b/api/vendor/symfony/console/Event/ConsoleCommandEvent.php index 08bd18fd1f..1b4f9f9b13 100644 --- a/api/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ b/api/vendor/symfony/console/Event/ConsoleCommandEvent.php @@ -12,7 +12,10 @@ namespace Symfony\Component\Console\Event; /** - * Allows to do things before the command is executed, like skipping the command or changing the input. + * Allows to do things before the command is executed, like skipping the command or executing code before the command is + * going to be executed. + * + * Changing the input arguments will have no effect. * * @author Fabien Potencier */ diff --git a/api/vendor/symfony/console/Event/ConsoleErrorEvent.php b/api/vendor/symfony/console/Event/ConsoleErrorEvent.php index 57d9b38ba0..d4c26493f4 100644 --- a/api/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ b/api/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -25,7 +25,7 @@ final class ConsoleErrorEvent extends ConsoleEvent private $error; private $exitCode; - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) + public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, ?Command $command = null) { parent::__construct($command, $input, $output); diff --git a/api/vendor/symfony/console/EventListener/ErrorListener.php b/api/vendor/symfony/console/EventListener/ErrorListener.php index 897d9853f2..e9c9e3ea47 100644 --- a/api/vendor/symfony/console/EventListener/ErrorListener.php +++ b/api/vendor/symfony/console/EventListener/ErrorListener.php @@ -26,7 +26,7 @@ class ErrorListener implements EventSubscriberInterface { private $logger; - public function __construct(LoggerInterface $logger = null) + public function __construct(?LoggerInterface $logger = null) { $this->logger = $logger; } diff --git a/api/vendor/symfony/console/Exception/CommandNotFoundException.php b/api/vendor/symfony/console/Exception/CommandNotFoundException.php index 910ae19286..81ec318abf 100644 --- a/api/vendor/symfony/console/Exception/CommandNotFoundException.php +++ b/api/vendor/symfony/console/Exception/CommandNotFoundException.php @@ -26,7 +26,7 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce * @param int $code Exception code * @param \Throwable|null $previous Previous exception used for the exception chaining */ - public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null) + public function __construct(string $message, array $alternatives = [], int $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/api/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/api/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php index 9232510f4a..afd3d00435 100644 --- a/api/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ b/api/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php @@ -27,7 +27,7 @@ public function apply(string $text): string /** * {@inheritdoc} */ - public function setBackground(string $color = null): void + public function setBackground(?string $color = null): void { // do nothing } @@ -35,7 +35,7 @@ public function setBackground(string $color = null): void /** * {@inheritdoc} */ - public function setForeground(string $color = null): void + public function setForeground(?string $color = null): void { // do nothing } diff --git a/api/vendor/symfony/console/Formatter/OutputFormatter.php b/api/vendor/symfony/console/Formatter/OutputFormatter.php index 603e5dca0b..4ec600244d 100644 --- a/api/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/api/vendor/symfony/console/Formatter/OutputFormatter.php @@ -13,6 +13,8 @@ use Symfony\Component\Console\Exception\InvalidArgumentException; +use function Symfony\Component\String\b; + /** * Formatter class for console output. * @@ -258,7 +260,7 @@ private function applyCurrentStyle(string $text, string $current, int $width, in } preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text); + $text = $prefix.$this->addLineBreaks($text, $width); $text = rtrim($text, "\n").($matches[1] ?? ''); if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) { @@ -282,4 +284,11 @@ private function applyCurrentStyle(string $text, string $current, int $width, in return implode("\n", $lines); } + + private function addLineBreaks(string $text, int $width): string + { + $encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8'; + + return b($text)->toCodePointString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding); + } } diff --git a/api/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/api/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 0fb36ac632..d7ae66494d 100644 --- a/api/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/api/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -33,7 +33,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface * @param string|null $foreground The style foreground color name * @param string|null $background The style background color name */ - public function __construct(string $foreground = null, string $background = null, array $options = []) + public function __construct(?string $foreground = null, ?string $background = null, array $options = []) { $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); } @@ -41,7 +41,7 @@ public function __construct(string $foreground = null, string $background = null /** * {@inheritdoc} */ - public function setForeground(string $color = null) + public function setForeground(?string $color = null) { $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); } @@ -49,7 +49,7 @@ public function setForeground(string $color = null) /** * {@inheritdoc} */ - public function setBackground(string $color = null) + public function setBackground(?string $color = null) { $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); } @@ -96,7 +96,8 @@ public function apply(string $text) { if (null === $this->handlesHrefGracefully) { $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) + && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); } if (null !== $this->href && $this->handlesHrefGracefully) { diff --git a/api/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/api/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php index b30560d22e..89e4d24381 100644 --- a/api/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ b/api/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php @@ -21,12 +21,12 @@ interface OutputFormatterStyleInterface /** * Sets style foreground color. */ - public function setForeground(string $color = null); + public function setForeground(?string $color = null); /** * Sets style background color. */ - public function setBackground(string $color = null); + public function setBackground(?string $color = null); /** * Sets some specific style option. diff --git a/api/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/api/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php index fc48dc0e15..1b9356301e 100644 --- a/api/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ b/api/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php @@ -26,7 +26,7 @@ class OutputFormatterStyleStack implements ResetInterface private $emptyStyle; - public function __construct(OutputFormatterStyleInterface $emptyStyle = null) + public function __construct(?OutputFormatterStyleInterface $emptyStyle = null) { $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); $this->reset(); @@ -55,7 +55,7 @@ public function push(OutputFormatterStyleInterface $style) * * @throws InvalidArgumentException When style tags incorrectly nested */ - public function pop(OutputFormatterStyleInterface $style = null) + public function pop(?OutputFormatterStyleInterface $style = null) { if (empty($this->styles)) { return $this->emptyStyle; diff --git a/api/vendor/symfony/console/Helper/Dumper.php b/api/vendor/symfony/console/Helper/Dumper.php index b013b6c527..605e4d70b7 100644 --- a/api/vendor/symfony/console/Helper/Dumper.php +++ b/api/vendor/symfony/console/Helper/Dumper.php @@ -26,7 +26,7 @@ final class Dumper private $cloner; private $handler; - public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) + public function __construct(OutputInterface $output, ?CliDumper $dumper = null, ?ClonerInterface $cloner = null) { $this->output = $output; $this->dumper = $dumper; diff --git a/api/vendor/symfony/console/Helper/Helper.php b/api/vendor/symfony/console/Helper/Helper.php index c7d3e25d0e..6b3f7f43ad 100644 --- a/api/vendor/symfony/console/Helper/Helper.php +++ b/api/vendor/symfony/console/Helper/Helper.php @@ -26,7 +26,7 @@ abstract class Helper implements HelperInterface /** * {@inheritdoc} */ - public function setHelperSet(HelperSet $helperSet = null) + public function setHelperSet(?HelperSet $helperSet = null) { $this->helperSet = $helperSet; } @@ -96,7 +96,7 @@ public static function length(?string $string): int * * @return string */ - public static function substr(?string $string, int $from, int $length = null) + public static function substr(?string $string, int $from, ?int $length = null) { $string ?? $string = ''; diff --git a/api/vendor/symfony/console/Helper/HelperInterface.php b/api/vendor/symfony/console/Helper/HelperInterface.php index fc952b4861..5bf4d63271 100644 --- a/api/vendor/symfony/console/Helper/HelperInterface.php +++ b/api/vendor/symfony/console/Helper/HelperInterface.php @@ -21,7 +21,7 @@ interface HelperInterface /** * Sets the helper set associated with this helper. */ - public function setHelperSet(HelperSet $helperSet = null); + public function setHelperSet(?HelperSet $helperSet = null); /** * Gets the helper set associated with this helper. diff --git a/api/vendor/symfony/console/Helper/HelperSet.php b/api/vendor/symfony/console/Helper/HelperSet.php index 719762d242..c870ab997e 100644 --- a/api/vendor/symfony/console/Helper/HelperSet.php +++ b/api/vendor/symfony/console/Helper/HelperSet.php @@ -37,7 +37,7 @@ public function __construct(array $helpers = []) } } - public function set(HelperInterface $helper, string $alias = null) + public function set(HelperInterface $helper, ?string $alias = null) { $this->helpers[$helper->getName()] = $helper; if (null !== $alias) { @@ -76,7 +76,7 @@ public function get(string $name) /** * @deprecated since Symfony 5.4 */ - public function setCommand(Command $command = null) + public function setCommand(?Command $command = null) { trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); diff --git a/api/vendor/symfony/console/Helper/ProcessHelper.php b/api/vendor/symfony/console/Helper/ProcessHelper.php index 4ea3d724d8..86a250b27f 100644 --- a/api/vendor/symfony/console/Helper/ProcessHelper.php +++ b/api/vendor/symfony/console/Helper/ProcessHelper.php @@ -32,7 +32,7 @@ class ProcessHelper extends Helper * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR */ - public function run(OutputInterface $output, $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process + public function run(OutputInterface $output, $cmd, ?string $error = null, ?callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process { 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".'); @@ -98,7 +98,7 @@ public function run(OutputInterface $output, $cmd, string $error = null, callabl * * @see run() */ - public function mustRun(OutputInterface $output, $cmd, string $error = null, callable $callback = null): Process + public function mustRun(OutputInterface $output, $cmd, ?string $error = null, ?callable $callback = null): Process { $process = $this->run($output, $cmd, $error, $callback); @@ -112,7 +112,7 @@ public function mustRun(OutputInterface $output, $cmd, string $error = null, cal /** * Wraps a Process callback to add debugging output. */ - public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null): callable + public function wrapCallback(OutputInterface $output, Process $process, ?callable $callback = null): callable { if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); diff --git a/api/vendor/symfony/console/Helper/ProgressBar.php b/api/vendor/symfony/console/Helper/ProgressBar.php index eb6aacb1a4..6250732eba 100644 --- a/api/vendor/symfony/console/Helper/ProgressBar.php +++ b/api/vendor/symfony/console/Helper/ProgressBar.php @@ -169,9 +169,12 @@ public function setMessage(string $message, string $name = 'message') $this->messages[$name] = $message; } + /** + * @return string|null + */ public function getMessage(string $name = 'message') { - return $this->messages[$name]; + return $this->messages[$name] ?? null; } public function getStartTime(): int @@ -293,7 +296,7 @@ public function maxSecondsBetweenRedraws(float $seconds): void * * @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 + public function iterate(iterable $iterable, ?int $max = null): iterable { $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); @@ -311,7 +314,7 @@ public function iterate(iterable $iterable, int $max = null): iterable * * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged */ - public function start(int $max = null) + public function start(?int $max = null) { $this->startTime = time(); $this->step = 0; diff --git a/api/vendor/symfony/console/Helper/ProgressIndicator.php b/api/vendor/symfony/console/Helper/ProgressIndicator.php index 3482343fcd..3cc0e1451a 100644 --- a/api/vendor/symfony/console/Helper/ProgressIndicator.php +++ b/api/vendor/symfony/console/Helper/ProgressIndicator.php @@ -50,7 +50,7 @@ class ProgressIndicator * @param int $indicatorChangeInterval Change interval in milliseconds * @param array|null $indicatorValues Animated indicator characters */ - public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) + public function __construct(OutputInterface $output, ?string $format = null, int $indicatorChangeInterval = 100, ?array $indicatorValues = null) { $this->output = $output; @@ -129,8 +129,6 @@ public function advance() /** * Finish the indicator with message. - * - * @param $message */ public function finish(string $message) { diff --git a/api/vendor/symfony/console/Helper/QuestionHelper.php b/api/vendor/symfony/console/Helper/QuestionHelper.php index 10602038c2..7b9de92291 100644 --- a/api/vendor/symfony/console/Helper/QuestionHelper.php +++ b/api/vendor/symfony/console/Helper/QuestionHelper.php @@ -128,7 +128,18 @@ private function doAsk(OutputInterface $output, Question $question) } if (false === $ret) { + $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; + + if (!$isBlocked) { + stream_set_blocking($inputStream, true); + } + $ret = $this->readInput($inputStream, $question); + + if (!$isBlocked) { + stream_set_blocking($inputStream, false); + } + if (false === $ret) { throw new MissingInputException('Aborted.'); } @@ -492,21 +503,7 @@ private function isInteractiveInput($inputStream): bool return self::$stdinIsInteractive; } - if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); - } - - 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; + return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); } /** diff --git a/api/vendor/symfony/console/Helper/Table.php b/api/vendor/symfony/console/Helper/Table.php index 3f2d991453..698f9693bf 100644 --- a/api/vendor/symfony/console/Helper/Table.php +++ b/api/vendor/symfony/console/Helper/Table.php @@ -451,7 +451,7 @@ public function render() * * +-----+-----------+-------+ */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) + private function renderRowSeparator(int $type = self::SEPARATOR_MID, ?string $title = null, ?string $titleFormat = null) { if (0 === $count = $this->numberOfColumns) { return; @@ -516,7 +516,7 @@ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string * * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) + private function renderRow(array $row, string $cellFormat, ?string $firstCellFormat = null) { $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); $columns = $this->getRowColumns($row); @@ -621,9 +621,10 @@ private function buildTableRows(array $rows): TableRows if (!strstr($cell ?? '', "\n")) { continue; } - $escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell))); + $eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n"; + $escaped = implode($eol, array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode($eol, $cell))); $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode("\n", str_replace("\n", "\n", $cell)); + $lines = explode($eol, str_replace($eol, ''.$eol, $cell)); foreach ($lines as $lineKey => $line) { if ($colspan > 1) { $line = new TableCell($line, ['colspan' => $colspan]); @@ -685,8 +686,9 @@ private function fillNextRows(array $rows, int $line): array $nbLines = $cell->getRowspan() - 1; $lines = [$cell]; if (strstr($cell, "\n")) { - $lines = explode("\n", str_replace("\n", "\n", $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; + $eol = str_contains($cell, "\r\n") ? "\r\n" : "\n"; + $lines = explode($eol, str_replace($eol, ''.$eol.'', $cell)); + $nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines; $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); unset($lines[0]); @@ -805,7 +807,7 @@ private function calculateColumnsWidth(iterable $groups) $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); $textLength = Helper::width($textContent); if ($textLength > 0) { - $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); + $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); foreach ($contentColumns as $position => $content) { $row[$i + $position] = $content; } diff --git a/api/vendor/symfony/console/Helper/TableStyle.php b/api/vendor/symfony/console/Helper/TableStyle.php index dfc41e6a4c..0643c79eb9 100644 --- a/api/vendor/symfony/console/Helper/TableStyle.php +++ b/api/vendor/symfony/console/Helper/TableStyle.php @@ -90,7 +90,7 @@ public function getPaddingChar() * * @return $this */ - public function setHorizontalBorderChars(string $outside, string $inside = null): self + public function setHorizontalBorderChars(string $outside, ?string $inside = null): self { $this->horizontalOutsideBorderChar = $outside; $this->horizontalInsideBorderChar = $inside ?? $outside; @@ -115,7 +115,7 @@ public function setHorizontalBorderChars(string $outside, string $inside = null) * * @return $this */ - public function setVerticalBorderChars(string $outside, string $inside = null): self + public function setVerticalBorderChars(string $outside, ?string $inside = null): self { $this->verticalOutsideBorderChar = $outside; $this->verticalInsideBorderChar = $inside ?? $outside; @@ -169,7 +169,7 @@ public function getBorderChars(): array * * @return $this */ - 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 + 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; diff --git a/api/vendor/symfony/console/Input/ArgvInput.php b/api/vendor/symfony/console/Input/ArgvInput.php index 675b9ef589..0c4b2d25bd 100644 --- a/api/vendor/symfony/console/Input/ArgvInput.php +++ b/api/vendor/symfony/console/Input/ArgvInput.php @@ -43,7 +43,7 @@ class ArgvInput extends Input private $tokens; private $parsed; - public function __construct(array $argv = null, InputDefinition $definition = null) + public function __construct(?array $argv = null, ?InputDefinition $definition = null) { $argv = $argv ?? $_SERVER['argv'] ?? []; diff --git a/api/vendor/symfony/console/Input/ArrayInput.php b/api/vendor/symfony/console/Input/ArrayInput.php index c65161484e..21a517cfb6 100644 --- a/api/vendor/symfony/console/Input/ArrayInput.php +++ b/api/vendor/symfony/console/Input/ArrayInput.php @@ -27,7 +27,7 @@ class ArrayInput extends Input { private $parameters; - public function __construct(array $parameters, InputDefinition $definition = null) + public function __construct(array $parameters, ?InputDefinition $definition = null) { $this->parameters = $parameters; diff --git a/api/vendor/symfony/console/Input/Input.php b/api/vendor/symfony/console/Input/Input.php index d37460ed3a..0faab2cf12 100644 --- a/api/vendor/symfony/console/Input/Input.php +++ b/api/vendor/symfony/console/Input/Input.php @@ -33,7 +33,7 @@ abstract class Input implements InputInterface, StreamableInputInterface protected $arguments = []; protected $interactive = true; - public function __construct(InputDefinition $definition = null) + public function __construct(?InputDefinition $definition = null) { if (null === $definition) { $this->definition = new InputDefinition(); diff --git a/api/vendor/symfony/console/Input/InputArgument.php b/api/vendor/symfony/console/Input/InputArgument.php index ecfcdad58b..1a8bf44b73 100644 --- a/api/vendor/symfony/console/Input/InputArgument.php +++ b/api/vendor/symfony/console/Input/InputArgument.php @@ -32,13 +32,13 @@ class InputArgument /** * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL + * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY * @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(string $name, int $mode = null, string $description = '', $default = null) + public function __construct(string $name, ?int $mode = null, string $description = '', $default = null) { if (null === $mode) { $mode = self::OPTIONAL; diff --git a/api/vendor/symfony/console/Input/InputOption.php b/api/vendor/symfony/console/Input/InputOption.php index 2bec34fe1a..99807f59e6 100644 --- a/api/vendor/symfony/console/Input/InputOption.php +++ b/api/vendor/symfony/console/Input/InputOption.php @@ -59,7 +59,7 @@ class InputOption * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) + public function __construct(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null) { if (str_starts_with($name, '--')) { $name = substr($name, 2); @@ -69,7 +69,7 @@ public function __construct(string $name, $shortcut = null, int $mode = null, st throw new InvalidArgumentException('An option name cannot be empty.'); } - if (empty($shortcut)) { + if ('' === $shortcut || [] === $shortcut || false === $shortcut) { $shortcut = null; } @@ -78,10 +78,10 @@ public function __construct(string $name, $shortcut = null, int $mode = null, st $shortcut = implode('|', $shortcut); } $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts); + $shortcuts = array_filter($shortcuts, 'strlen'); $shortcut = implode('|', $shortcuts); - if (empty($shortcut)) { + if ('' === $shortcut) { throw new InvalidArgumentException('An option shortcut cannot be empty.'); } } diff --git a/api/vendor/symfony/console/LICENSE b/api/vendor/symfony/console/LICENSE index 0083704572..0138f8f071 100644 --- a/api/vendor/symfony/console/LICENSE +++ b/api/vendor/symfony/console/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present 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/api/vendor/symfony/console/Output/ConsoleOutput.php b/api/vendor/symfony/console/Output/ConsoleOutput.php index f19f9ebf44..560aeb5814 100644 --- a/api/vendor/symfony/console/Output/ConsoleOutput.php +++ b/api/vendor/symfony/console/Output/ConsoleOutput.php @@ -37,7 +37,7 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface * @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(int $verbosity = self::VERBOSITY_NORMAL, bool $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); diff --git a/api/vendor/symfony/console/Output/ConsoleSectionOutput.php b/api/vendor/symfony/console/Output/ConsoleSectionOutput.php index 8f16497583..70d70c50bb 100644 --- a/api/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ b/api/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -43,7 +43,7 @@ public function __construct($stream, array &$sections, int $verbosity, bool $dec * * @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) + public function clear(?int $lines = null) { if (empty($this->content) || !$this->isDecorated()) { return; diff --git a/api/vendor/symfony/console/Output/Output.php b/api/vendor/symfony/console/Output/Output.php index d7c5fb2d11..28c40bb3e6 100644 --- a/api/vendor/symfony/console/Output/Output.php +++ b/api/vendor/symfony/console/Output/Output.php @@ -37,7 +37,7 @@ abstract class Output implements OutputInterface * @param bool $decorated Whether to decorate messages * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, ?OutputFormatterInterface $formatter = null) { $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; $this->formatter = $formatter ?? new OutputFormatter(); diff --git a/api/vendor/symfony/console/Output/StreamOutput.php b/api/vendor/symfony/console/Output/StreamOutput.php index 7f5551827d..b53955269a 100644 --- a/api/vendor/symfony/console/Output/StreamOutput.php +++ b/api/vendor/symfony/console/Output/StreamOutput.php @@ -39,7 +39,7 @@ class StreamOutput extends Output * * @throws InvalidArgumentException When first argument is not a real stream */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $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)) { throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); @@ -64,9 +64,6 @@ public function getStream() return $this->stream; } - /** - * {@inheritdoc} - */ protected function doWrite(string $message, bool $newline) { if ($newline) { @@ -94,22 +91,33 @@ protected function doWrite(string $message, bool $newline) protected function hasColorSupport() { // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) { + return false; + } + + // Detect msysgit/mingw and assume this is a tty because detection + // does not work correctly, see https://github.com/composer/composer/issues/9690 + if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) { return false; } - if ('Hyper' === getenv('TERM_PROGRAM')) { + if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) { 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'); + if ('Hyper' === getenv('TERM_PROGRAM') + || false !== getenv('COLORTERM') + || false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + ) { + return true; + } + + if ('dumb' === $term = (string) getenv('TERM')) { + return false; } - return stream_isatty($this->stream); + // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157 + return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term); } } diff --git a/api/vendor/symfony/console/Output/TrimmedBufferOutput.php b/api/vendor/symfony/console/Output/TrimmedBufferOutput.php index 3f4d375f42..b08503b3ab 100644 --- a/api/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ b/api/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -24,7 +24,7 @@ class TrimmedBufferOutput extends Output private $maxLength; private $buffer = ''; - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) + 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)); diff --git a/api/vendor/symfony/console/Question/Question.php b/api/vendor/symfony/console/Question/Question.php index 3a73f04b23..ba57442837 100644 --- a/api/vendor/symfony/console/Question/Question.php +++ b/api/vendor/symfony/console/Question/Question.php @@ -186,7 +186,7 @@ public function getAutocompleterCallback(): ?callable * * @return $this */ - public function setAutocompleterCallback(callable $callback = null): self + public function setAutocompleterCallback(?callable $callback = null): self { if ($this->hidden && null !== $callback) { throw new LogicException('A hidden question cannot use the autocompleter.'); @@ -202,7 +202,7 @@ public function setAutocompleterCallback(callable $callback = null): self * * @return $this */ - public function setValidator(callable $validator = null) + public function setValidator(?callable $validator = null) { $this->validator = $validator; diff --git a/api/vendor/symfony/console/Resources/completion.bash b/api/vendor/symfony/console/Resources/completion.bash index 64b87ccf7c..bb44037b0c 100644 --- a/api/vendor/symfony/console/Resources/completion.bash +++ b/api/vendor/symfony/console/Resources/completion.bash @@ -7,7 +7,7 @@ _sf_{{ COMMAND_NAME }}() { # Use newline as only separator to allow space in completion values - IFS=$'\n' + local IFS=$'\n' local sf_cmd="${COMP_WORDS[0]}" # for an alias, get the real script behind it diff --git a/api/vendor/symfony/console/SingleCommandApplication.php b/api/vendor/symfony/console/SingleCommandApplication.php index e93c1821b8..774e5d8c44 100644 --- a/api/vendor/symfony/console/SingleCommandApplication.php +++ b/api/vendor/symfony/console/SingleCommandApplication.php @@ -46,7 +46,7 @@ public function setAutoExit(bool $autoExit): self return $this; } - public function run(InputInterface $input = null, OutputInterface $output = null): int + public function run(?InputInterface $input = null, ?OutputInterface $output = null): int { if ($this->running) { return parent::run($input, $output); diff --git a/api/vendor/symfony/console/Style/StyleInterface.php b/api/vendor/symfony/console/Style/StyleInterface.php index 38d23b77eb..9f25a43f6c 100644 --- a/api/vendor/symfony/console/Style/StyleInterface.php +++ b/api/vendor/symfony/console/Style/StyleInterface.php @@ -85,14 +85,14 @@ public function table(array $headers, array $rows); * * @return mixed */ - public function ask(string $question, string $default = null, callable $validator = null); + public function ask(string $question, ?string $default = null, ?callable $validator = null); /** * Asks a question with the user input hidden. * * @return mixed */ - public function askHidden(string $question, callable $validator = null); + public function askHidden(string $question, ?callable $validator = null); /** * Asks for confirmation. diff --git a/api/vendor/symfony/console/Style/SymfonyStyle.php b/api/vendor/symfony/console/Style/SymfonyStyle.php index e3c5ac8e74..00edf38827 100644 --- a/api/vendor/symfony/console/Style/SymfonyStyle.php +++ b/api/vendor/symfony/console/Style/SymfonyStyle.php @@ -61,7 +61,7 @@ public function __construct(InputInterface $input, OutputInterface $output) * * @param string|array $messages The message to write in the block */ - public function block($messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + public function block($messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) { $messages = \is_array($messages) ? array_values($messages) : [$messages]; @@ -250,7 +250,7 @@ public function definitionList(...$list) /** * {@inheritdoc} */ - public function ask(string $question, string $default = null, callable $validator = null) + public function ask(string $question, ?string $default = null, ?callable $validator = null) { $question = new Question($question, $default); $question->setValidator($validator); @@ -261,7 +261,7 @@ public function ask(string $question, string $default = null, callable $validato /** * {@inheritdoc} */ - public function askHidden(string $question, callable $validator = null) + public function askHidden(string $question, ?callable $validator = null) { $question = new Question($question); @@ -338,7 +338,7 @@ public function createProgressBar(int $max = 0) /** * @see ProgressBar::iterate() */ - public function progressIterate(iterable $iterable, int $max = null): iterable + public function progressIterate(iterable $iterable, ?int $max = null): iterable { yield from $this->createProgressBar()->iterate($iterable, $max); @@ -463,7 +463,7 @@ private function writeBuffer(string $message, bool $newLine, int $type): void $this->bufferedOutput->write($message, $newLine, $type); } - private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array + private function createBlock(iterable $messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array { $indentLength = 0; $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); diff --git a/api/vendor/symfony/console/Terminal.php b/api/vendor/symfony/console/Terminal.php index 08c53535b1..ee178327a5 100644 --- a/api/vendor/symfony/console/Terminal.php +++ b/api/vendor/symfony/console/Terminal.php @@ -64,20 +64,19 @@ public static function hasSttyAvailable(): bool return self::$stty; } - // skip check if exec function is disabled - if (!\function_exists('exec')) { + // skip check if shell_exec function is disabled + if (!\function_exists('shell_exec')) { return false; } - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; + return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); } private static function initDimensions() { if ('\\' === \DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) { + $ansicon = getenv('ANSICON'); + if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { // extract [w, H] from "wxh (WxH)" // or [w, h] from "wxh" self::$width = (int) $matches[1]; @@ -157,8 +156,9 @@ private static function readFromProcess(string $command): ?string 2 => ['pipe', 'w'], ]; - $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (!\is_resource($process)) { + $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; + + if (!$process = @proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true])) { return null; } @@ -167,6 +167,10 @@ private static function readFromProcess(string $command): ?string fclose($pipes[2]); proc_close($process); + if ($cp) { + sapi_windows_cp_set($cp); + } + return $info; } } diff --git a/api/vendor/symfony/console/Tester/TesterTrait.php b/api/vendor/symfony/console/Tester/TesterTrait.php index 40bc581771..f454bbf9d7 100644 --- a/api/vendor/symfony/console/Tester/TesterTrait.php +++ b/api/vendor/symfony/console/Tester/TesterTrait.php @@ -35,9 +35,9 @@ trait TesterTrait /** * Gets the display returned by the last execution of the command or application. * - * @throws \RuntimeException If it's called before the execute method - * * @return string + * + * @throws \RuntimeException If it's called before the execute method */ public function getDisplay(bool $normalize = false) { @@ -103,9 +103,9 @@ public function getOutput() /** * Gets the status code returned by the last execution of the command or application. * - * @throws \RuntimeException If it's called before the execute method - * * @return int + * + * @throws \RuntimeException If it's called before the execute method */ public function getStatusCode() { diff --git a/api/vendor/symfony/console/composer.json b/api/vendor/symfony/console/composer.json index 9a565068cd..4fa4964a1d 100644 --- a/api/vendor/symfony/console/composer.json +++ b/api/vendor/symfony/console/composer.json @@ -2,7 +2,7 @@ "name": "symfony/console", "type": "library", "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": ["console", "cli", "command line", "terminal"], + "keywords": ["console", "cli", "command-line", "terminal"], "homepage": "https://symfony.com", "license": "MIT", "authors": [ diff --git a/api/vendor/symfony/deprecation-contracts/.gitignore b/api/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8df5..0000000000 --- a/api/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/api/vendor/symfony/deprecation-contracts/LICENSE b/api/vendor/symfony/deprecation-contracts/LICENSE index 406242ff28..0ed3a24655 100644 --- a/api/vendor/symfony/deprecation-contracts/LICENSE +++ b/api/vendor/symfony/deprecation-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-2022 Fabien Potencier +Copyright (c) 2020-present 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/api/vendor/symfony/deprecation-contracts/README.md b/api/vendor/symfony/deprecation-contracts/README.md index 4957933a6c..9814864c03 100644 --- a/api/vendor/symfony/deprecation-contracts/README.md +++ b/api/vendor/symfony/deprecation-contracts/README.md @@ -22,5 +22,5 @@ trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use 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 +While not recommended, the deprecation notices can be completely ignored by declaring an empty `function trigger_deprecation() {}` in your application. diff --git a/api/vendor/symfony/deprecation-contracts/composer.json b/api/vendor/symfony/deprecation-contracts/composer.json index 1c1b4ba0e9..ceb6c07961 100644 --- a/api/vendor/symfony/deprecation-contracts/composer.json +++ b/api/vendor/symfony/deprecation-contracts/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "autoload": { "files": [ @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/api/vendor/symfony/error-handler/Debug.php b/api/vendor/symfony/error-handler/Debug.php index 343a35a77b..60ddb452c0 100644 --- a/api/vendor/symfony/error-handler/Debug.php +++ b/api/vendor/symfony/error-handler/Debug.php @@ -31,7 +31,6 @@ public static function enable(): ErrorHandler @ini_set('zend.assertions', 1); ini_set('assert.active', 1); - ini_set('assert.warning', 0); ini_set('assert.exception', 1); DebugClassLoader::enable(); diff --git a/api/vendor/symfony/error-handler/DebugClassLoader.php b/api/vendor/symfony/error-handler/DebugClassLoader.php index 746e8d44a5..5db2f30a1c 100644 --- a/api/vendor/symfony/error-handler/DebugClassLoader.php +++ b/api/vendor/symfony/error-handler/DebugClassLoader.php @@ -21,6 +21,7 @@ use Prophecy\Prophecy\ProphecySubjectInterface; use ProxyManager\Proxy\ProxyInterface; use Symfony\Component\ErrorHandler\Internal\TentativeTypes; +use Symfony\Component\HttpClient\HttplugClient; /** * Autoloader checking if the class is really defined in the file found. @@ -300,7 +301,7 @@ public function loadClass(string $class): void $this->checkClass($class, $file); } - private function checkClass(string $class, string $file = null): void + private function checkClass(string $class, ?string $file = null): void { $exists = null === $file || class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false); @@ -414,7 +415,9 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array if (!isset(self::$checkedClasses[$use])) { $this->checkClass($use); } - if (isset(self::$deprecated[$use]) && strncmp($vendor, str_replace('_', '\\', $use), $vendorLen) && !isset(self::$deprecated[$class])) { + if (isset(self::$deprecated[$use]) && strncmp($vendor, str_replace('_', '\\', $use), $vendorLen) && !isset(self::$deprecated[$class]) + && !(HttplugClient::class === $class && \in_array($use, [\Http\Client\HttpClient::class, \Http\Message\RequestFactory::class, \Http\Message\StreamFactory::class, \Http\Message\UriFactory::class], true)) + ) { $type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait'); $verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses'); @@ -760,7 +763,7 @@ private function getOwnInterfaces(string $class, ?string $parent): array return $ownInterfaces; } - private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, \ReflectionType $returnType = null): void + private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, ?\ReflectionType $returnType = null): void { if ('__construct' === $method) { return; @@ -1090,7 +1093,20 @@ private function fixReturnStatements(\ReflectionMethod $method, string $returnTy } $end = $method->isGenerator() ? $i : $method->getEndLine(); + $inClosure = false; + $braces = 0; for (; $i < $end; ++$i) { + if (!$inClosure) { + $inClosure = false !== strpos($code[$i], 'function ('); + } + + if ($inClosure) { + $braces += substr_count($code[$i], '{') - substr_count($code[$i], '}'); + $inClosure = $braces > 0; + + continue; + } + if ('void' === $returnType) { $fixedCode[$i] = str_replace(' return null;', ' return;', $code[$i]); } elseif ('mixed' === $returnType || '?' === $returnType[0]) { diff --git a/api/vendor/symfony/error-handler/Error/FatalError.php b/api/vendor/symfony/error-handler/Error/FatalError.php index 57fc690e26..210daba865 100644 --- a/api/vendor/symfony/error-handler/Error/FatalError.php +++ b/api/vendor/symfony/error-handler/Error/FatalError.php @@ -20,7 +20,7 @@ class FatalError extends \Error * * @param array $error An array as returned by error_get_last() */ - public function __construct(string $message, int $code, array $error, int $traceOffset = null, bool $traceArgs = true, array $trace = null) + public function __construct(string $message, int $code, array $error, ?int $traceOffset = null, bool $traceArgs = true, ?array $trace = null) { parent::__construct($message, $code); @@ -33,7 +33,7 @@ public function __construct(string $message, int $code, array $error, int $trace } } } elseif (null !== $traceOffset) { - if (\function_exists('xdebug_get_function_stack') && $trace = @xdebug_get_function_stack()) { + if (\function_exists('xdebug_get_function_stack') && \in_array(\ini_get('xdebug.mode'), ['develop', false], true) && $trace = @xdebug_get_function_stack()) { if (0 < $traceOffset) { array_splice($trace, -$traceOffset); } diff --git a/api/vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php b/api/vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php index f85d275151..4e1ae8e86a 100644 --- a/api/vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php +++ b/api/vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php @@ -21,9 +21,6 @@ */ class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface { - /** - * {@inheritdoc} - */ public function enhance(\Throwable $error): ?\Throwable { // Some specific versions of PHP produce a fatal error when extending a not found class. @@ -110,7 +107,8 @@ private function getClassCandidates(string $class): array private function findClassInPath(string $path, string $class, string $prefix): array { - if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) { + $path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path); + if (!$path || !is_dir($path)) { return []; } diff --git a/api/vendor/symfony/error-handler/ErrorHandler.php b/api/vendor/symfony/error-handler/ErrorHandler.php index 003040242f..4107baeca5 100644 --- a/api/vendor/symfony/error-handler/ErrorHandler.php +++ b/api/vendor/symfony/error-handler/ErrorHandler.php @@ -55,7 +55,6 @@ class ErrorHandler \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', @@ -73,7 +72,6 @@ class ErrorHandler \E_USER_DEPRECATED => [null, LogLevel::INFO], \E_NOTICE => [null, LogLevel::WARNING], \E_USER_NOTICE => [null, LogLevel::WARNING], - \E_STRICT => [null, LogLevel::WARNING], \E_WARNING => [null, LogLevel::WARNING], \E_USER_WARNING => [null, LogLevel::WARNING], \E_COMPILE_WARNING => [null, LogLevel::WARNING], @@ -108,7 +106,7 @@ class ErrorHandler /** * Registers the error handler. */ - public static function register(self $handler = null, bool $replace = true): self + public static function register(?self $handler = null, bool $replace = true): self { if (null === self::$reservedMemory) { self::$reservedMemory = str_repeat('x', 32768); @@ -181,8 +179,13 @@ public static function call(callable $function, ...$arguments) } } - public function __construct(BufferingLogger $bootstrappingLogger = null, bool $debug = false) + public function __construct(?BufferingLogger $bootstrappingLogger = null, bool $debug = false) { + if (\PHP_VERSION_ID < 80400) { + $this->levels[\E_STRICT] = 'Runtime Notice'; + $this->loggers[\E_STRICT] = [null, LogLevel::WARNING]; + } + if ($bootstrappingLogger) { $this->bootstrappingLogger = $bootstrappingLogger; $this->setDefaultLogger($bootstrappingLogger); @@ -457,7 +460,7 @@ public function handleError(int $type, string $message, string $file, int $line) return true; } } else { - if (false !== strpos($message, '@anonymous')) { + if (PHP_VERSION_ID < 80303 && false !== strpos($message, '@anonymous')) { $backtrace = debug_backtrace(false, 5); for ($i = 1; isset($backtrace[$i]); ++$i) { @@ -465,8 +468,7 @@ public function handleError(int $type, string $message, string $file, int $line) && ('trigger_error' === $backtrace[$i]['function'] || 'user_error' === $backtrace[$i]['function']) ) { if ($backtrace[$i]['args'][0] !== $message) { - $message = $this->parseAnonymousClass($backtrace[$i]['args'][0]); - $logMessage = $this->levels[$type].': '.$message; + $message = $backtrace[$i]['args'][0]; } break; @@ -474,6 +476,11 @@ public function handleError(int $type, string $message, string $file, int $line) } } + if (false !== strpos($message, "@anonymous\0")) { + $message = $this->parseAnonymousClass($message); + $logMessage = $this->levels[$type].': '.$message; + } + $errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line); if ($throw || $this->tracedErrors & $type) { @@ -513,7 +520,12 @@ public function handleError(int $type, string $message, string $file, int $line) } // Display the original error message instead of the default one. - $this->handleException($errorAsException); + $exitCode = self::$exitCode; + try { + $this->handleException($errorAsException); + } finally { + self::$exitCode = $exitCode; + } // Stop the process by giving back the error to the native handler. return false; @@ -633,7 +645,7 @@ public function handleException(\Throwable $exception) * * @internal */ - public static function handleFatalError(array $error = null): void + public static function handleFatalError(?array $error = null): void { if (null === self::$reservedMemory) { return; @@ -665,6 +677,10 @@ public static function handleFatalError(array $error = null): void set_exception_handler($h); } if (!$handler) { + if (null === $error && $exitCode = self::$exitCode) { + register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); }); + } + return; } if ($handler !== $h) { @@ -700,8 +716,7 @@ public static function handleFatalError(array $error = null): void // Ignore this re-throw } - if ($exit && self::$exitCode) { - $exitCode = self::$exitCode; + if ($exit && $exitCode = self::$exitCode) { register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); }); } } @@ -791,7 +806,7 @@ private function cleanTrace(array $backtrace, int $type, string &$file, int &$li */ private function parseAnonymousClass(string $message): string { - return preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', static function ($m) { + return preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)?[0-9a-fA-F]++/', static function ($m) { return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; }, $message); } diff --git a/api/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php b/api/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php index b8a9aeda61..0602ea4bdb 100644 --- a/api/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php +++ b/api/vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php @@ -47,7 +47,7 @@ class HtmlErrorRenderer implements ErrorRendererInterface * @param string|FileLinkFormatter|null $fileLinkFormat * @param bool|callable $outputBuffer The output buffer as a string or a callable that should return it */ - public function __construct($debug = false, string $charset = null, $fileLinkFormat = null, string $projectDir = null, $outputBuffer = '', LoggerInterface $logger = null) + public function __construct($debug = false, ?string $charset = null, $fileLinkFormat = null, ?string $projectDir = null, $outputBuffer = '', ?LoggerInterface $logger = null) { if (!\is_bool($debug) && !\is_callable($debug)) { throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a boolean or a callable, "%s" given.', __METHOD__, \gettype($debug))); @@ -72,7 +72,7 @@ public function render(\Throwable $exception): FlattenException { $headers = ['Content-Type' => 'text/html; charset='.$this->charset]; if (\is_bool($this->debug) ? $this->debug : ($this->debug)($exception)) { - $headers['X-Debug-Exception'] = rawurlencode($exception->getMessage()); + $headers['X-Debug-Exception'] = rawurlencode(substr($exception->getMessage(), 0, 2000)); $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); } @@ -173,6 +173,8 @@ private function formatArgs(array $args): string $formattedValue = ''.strtolower(var_export($item[1], true)).''; } elseif ('resource' === $item[0]) { $formattedValue = 'resource'; + } elseif (preg_match('/[^\x07-\x0D\x1B\x20-\xFF]/', $item[1])) { + $formattedValue = 'binary string'; } else { $formattedValue = str_replace("\n", '', $this->escape(var_export($item[1], true))); } @@ -233,7 +235,7 @@ private function getFileLink(string $file, int $line) * @param int $line The line number * @param string $text Use this text for the link rather than the file path */ - private function formatFile(string $file, int $line, string $text = null): string + private function formatFile(string $file, int $line, ?string $text = null): string { $file = trim($file); @@ -269,13 +271,23 @@ private function fileExcerpt(string $file, int $line, int $srcContext = 3): stri // highlight_file could throw warnings // see https://bugs.php.net/25725 $code = @highlight_file($file, true); - // remove main code/span tags - $code = preg_replace('#^\s*(.*)\s*#s', '\\1', $code); - // split multiline spans - $code = preg_replace_callback('#]++)>((?:[^<]*+
    )++[^<]*+)
    #', function ($m) { - return "".str_replace('
    ', "

    ", $m[2]).''; - }, $code); - $content = explode('
    ', $code); + if (\PHP_VERSION_ID >= 80300) { + // remove main pre/code tags + $code = preg_replace('#^\s*(.*)
    \s*#s', '\\1', $code); + // split multiline span tags + $code = preg_replace_callback('#]++)>((?:[^<\\n]*+\\n)++[^<]*+)#', function ($m) { + return "".str_replace("\n", "\n", $m[2]).''; + }, $code); + $content = explode("\n", $code); + } else { + // remove main code/span tags + $code = preg_replace('#^\s*(.*)\s*#s', '\\1', $code); + // split multiline spans + $code = preg_replace_callback('#]++)>((?:[^<]*+
    )++[^<]*+)
    #', function ($m) { + return "".str_replace('
    ', "

    ", $m[2]).''; + }, $code); + $content = explode('
    ', $code); + } $lines = []; if (0 > $srcContext) { @@ -315,7 +327,7 @@ private function formatFileFromText(string $text) { return preg_replace_callback('/in ("|")?(.+?)\1(?: +(?:on|at))? +line (\d+)/s', function ($match) { return 'in '.$this->formatFile($match[2], $match[3]); - }, $text); + }, $text) ?? $text; } private function formatLogMessage(string $message, array $context) diff --git a/api/vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php b/api/vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php index cec8e4d413..69ec52cc8c 100644 --- a/api/vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php +++ b/api/vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php @@ -34,7 +34,7 @@ class SerializerErrorRenderer implements ErrorRendererInterface * formats not supported by Request::getMimeTypes() should be given as mime types * @param bool|callable $debug The debugging mode as a boolean or a callable that should return it */ - public function __construct(SerializerInterface $serializer, $format, ErrorRendererInterface $fallbackErrorRenderer = null, $debug = false) + public function __construct(SerializerInterface $serializer, $format, ?ErrorRendererInterface $fallbackErrorRenderer = null, $debug = false) { if (!\is_string($format) && !\is_callable($format)) { throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be a string or a callable, "%s" given.', __METHOD__, \gettype($format))); @@ -55,10 +55,10 @@ public function __construct(SerializerInterface $serializer, $format, ErrorRende */ public function render(\Throwable $exception): FlattenException { - $headers = []; + $headers = ['Vary' => 'Accept']; $debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($exception); if ($debug) { - $headers['X-Debug-Exception'] = rawurlencode($exception->getMessage()); + $headers['X-Debug-Exception'] = rawurlencode(substr($exception->getMessage(), 0, 2000)); $headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine(); } @@ -66,19 +66,17 @@ public function render(\Throwable $exception): FlattenException try { $format = \is_string($this->format) ? $this->format : ($this->format)($flattenException); - $headers = [ - 'Content-Type' => Request::getMimeTypes($format)[0] ?? $format, - 'Vary' => 'Accept', - ]; + $headers['Content-Type'] = Request::getMimeTypes($format)[0] ?? $format; - return $flattenException->setAsString($this->serializer->serialize($flattenException, $format, [ + $flattenException->setAsString($this->serializer->serialize($flattenException, $format, [ 'exception' => $exception, 'debug' => $debug, - ])) - ->setHeaders($flattenException->getHeaders() + $headers); + ])); } catch (NotEncodableValueException $e) { - return $this->fallbackErrorRenderer->render($exception); + $flattenException = $this->fallbackErrorRenderer->render($exception); } + + return $flattenException->setHeaders($flattenException->getHeaders() + $headers); } public static function getPreferredFormat(RequestStack $requestStack): \Closure diff --git a/api/vendor/symfony/error-handler/Exception/FlattenException.php b/api/vendor/symfony/error-handler/Exception/FlattenException.php index 262dae62bc..2532b8c33f 100644 --- a/api/vendor/symfony/error-handler/Exception/FlattenException.php +++ b/api/vendor/symfony/error-handler/Exception/FlattenException.php @@ -63,7 +63,7 @@ class FlattenException /** * @return static */ - public static function create(\Exception $exception, int $statusCode = null, array $headers = []): self + public static function create(\Exception $exception, ?int $statusCode = null, array $headers = []): self { return static::createFromThrowable($exception, $statusCode, $headers); } @@ -71,7 +71,7 @@ public static function create(\Exception $exception, int $statusCode = null, arr /** * @return static */ - public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = []): self + public static function createFromThrowable(\Throwable $exception, ?int $statusCode = null, array $headers = []): self { $e = new static(); $e->setMessage($exception->getMessage()); @@ -226,7 +226,7 @@ public function getMessage(): string public function setMessage(string $message): self { if (false !== strpos($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) { + $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); } diff --git a/api/vendor/symfony/error-handler/LICENSE b/api/vendor/symfony/error-handler/LICENSE index 5c7ba0551c..f37c76b591 100644 --- a/api/vendor/symfony/error-handler/LICENSE +++ b/api/vendor/symfony/error-handler/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019-2023 Fabien Potencier +Copyright (c) 2019-present 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/api/vendor/symfony/error-handler/Resources/assets/css/exception.css b/api/vendor/symfony/error-handler/Resources/assets/css/exception.css index 7cb3206da2..2d05a5e6a6 100644 --- a/api/vendor/symfony/error-handler/Resources/assets/css/exception.css +++ b/api/vendor/symfony/error-handler/Resources/assets/css/exception.css @@ -242,7 +242,7 @@ header .container { display: flex; justify-content: space-between; } .trace-code li { color: #969896; margin: 0; padding-left: 10px; float: left; width: 100%; } .trace-code li + li { margin-top: 5px; } .trace-code li.selected { background: var(--trace-selected-background); margin-top: 2px; } -.trace-code li code { color: var(--base-6); white-space: nowrap; } +.trace-code li code { color: var(--base-6); white-space: pre; } .trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; } diff --git a/api/vendor/symfony/error-handler/Resources/assets/js/exception.js b/api/vendor/symfony/error-handler/Resources/assets/js/exception.js index a85409da3c..95b8ea1719 100644 --- a/api/vendor/symfony/error-handler/Resources/assets/js/exception.js +++ b/api/vendor/symfony/error-handler/Resources/assets/js/exception.js @@ -1,297 +1,285 @@ /* This file is based on WebProfilerBundle/Resources/views/Profiler/base_js.html.twig. If you make any change in this file, verify the same change is needed in the other file. */ /* .tab'); + var tabNavigation = document.createElement('ul'); + tabNavigation.className = 'tab-navigation'; + + var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */ + for (var j = 0; j < tabs.length; j++) { + var tabId = 'tab-' + i + '-' + j; + var tabTitle = tabs[j].querySelector('.tab-title').innerHTML; + + var tabNavigationItem = document.createElement('li'); + tabNavigationItem.setAttribute('data-tab-id', tabId); + if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; } + if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); } + tabNavigationItem.innerHTML = tabTitle; + tabNavigation.appendChild(tabNavigationItem); + + var tabContent = tabs[j].querySelector('.tab-content'); + tabContent.parentElement.setAttribute('id', tabId); + } - if (navigator.clipboard) { - document.querySelectorAll('[data-clipboard-text]').forEach(function(element) { - removeClass(element, 'hidden'); - element.addEventListener('click', function() { - navigator.clipboard.writeText(element.getAttribute('data-clipboard-text')); - }) - }); + tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild); + addClass(document.querySelector('[data-tab-id="' + selectedTabId + '"]'), 'active'); } - return { - addEventListener: addEventListener, + /* display the active tab and add the 'click' event listeners */ + for (i = 0; i < tabGroups.length; i++) { + tabNavigation = tabGroups[i].querySelectorAll(':scope >.tab-navigation li'); - createTabs: function() { - var tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])'); + for (j = 0; j < tabNavigation.length; j++) { + tabId = tabNavigation[j].getAttribute('data-tab-id'); + document.getElementById(tabId).querySelector('.tab-title').className = 'hidden'; - /* create the tab navigation for each group of tabs */ - for (var i = 0; i < tabGroups.length; i++) { - var tabs = tabGroups[i].querySelectorAll(':scope > .tab'); - var tabNavigation = document.createElement('ul'); - tabNavigation.className = 'tab-navigation'; - - var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */ - for (var j = 0; j < tabs.length; j++) { - var tabId = 'tab-' + i + '-' + j; - var tabTitle = tabs[j].querySelector('.tab-title').innerHTML; + if (hasClass(tabNavigation[j], 'active')) { + document.getElementById(tabId).className = 'block'; + } else { + document.getElementById(tabId).className = 'hidden'; + } - var tabNavigationItem = document.createElement('li'); - tabNavigationItem.setAttribute('data-tab-id', tabId); - if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; } - if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); } - tabNavigationItem.innerHTML = tabTitle; - tabNavigation.appendChild(tabNavigationItem); + tabNavigation[j].addEventListener('click', function(e) { + var activeTab = e.target || e.srcElement; - var tabContent = tabs[j].querySelector('.tab-content'); - tabContent.parentElement.setAttribute('id', tabId); + /* needed because when the tab contains HTML contents, user can click */ + /* on any of those elements instead of their parent '
  • ' element */ + while (activeTab.tagName.toLowerCase() !== 'li') { + activeTab = activeTab.parentNode; } - tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild); - addClass(document.querySelector('[data-tab-id="' + selectedTabId + '"]'), 'active'); - } + /* get the full list of tabs through the parent of the active tab element */ + var tabNavigation = activeTab.parentNode.children; + for (var k = 0; k < tabNavigation.length; k++) { + var tabId = tabNavigation[k].getAttribute('data-tab-id'); + document.getElementById(tabId).className = 'hidden'; + removeClass(tabNavigation[k], 'active'); + } - /* display the active tab and add the 'click' event listeners */ - for (i = 0; i < tabGroups.length; i++) { - tabNavigation = tabGroups[i].querySelectorAll(':scope >.tab-navigation li'); + addClass(activeTab, 'active'); + var activeTabId = activeTab.getAttribute('data-tab-id'); + document.getElementById(activeTabId).className = 'block'; + }); + } - for (j = 0; j < tabNavigation.length; j++) { - tabId = tabNavigation[j].getAttribute('data-tab-id'); - document.getElementById(tabId).querySelector('.tab-title').className = 'hidden'; + tabGroups[i].setAttribute('data-processed', 'true'); + } + })(); - if (hasClass(tabNavigation[j], 'active')) { - document.getElementById(tabId).className = 'block'; - } else { - document.getElementById(tabId).className = 'hidden'; - } + (function createToggles() { + var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])'); - tabNavigation[j].addEventListener('click', function(e) { - var activeTab = e.target || e.srcElement; + for (var i = 0; i < toggles.length; i++) { + var elementSelector = toggles[i].getAttribute('data-toggle-selector'); + var element = document.querySelector(elementSelector); - /* needed because when the tab contains HTML contents, user can click */ - /* on any of those elements instead of their parent '
  • ' element */ - while (activeTab.tagName.toLowerCase() !== 'li') { - activeTab = activeTab.parentNode; - } + addClass(element, 'sf-toggle-content'); - /* get the full list of tabs through the parent of the active tab element */ - var tabNavigation = activeTab.parentNode.children; - for (var k = 0; k < tabNavigation.length; k++) { - var tabId = tabNavigation[k].getAttribute('data-tab-id'); - document.getElementById(tabId).className = 'hidden'; - removeClass(tabNavigation[k], 'active'); - } + if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') { + addClass(toggles[i], 'sf-toggle-on'); + addClass(element, 'sf-toggle-visible'); + } else { + addClass(toggles[i], 'sf-toggle-off'); + addClass(element, 'sf-toggle-hidden'); + } - addClass(activeTab, 'active'); - var activeTabId = activeTab.getAttribute('data-tab-id'); - document.getElementById(activeTabId).className = 'block'; - }); - } + addEventListener(toggles[i], 'click', function(e) { + e.preventDefault(); - tabGroups[i].setAttribute('data-processed', 'true'); + if ('' !== window.getSelection().toString()) { + /* Don't do anything on text selection */ + return; } - }, - - createToggles: function() { - var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])'); - - for (var i = 0; i < toggles.length; i++) { - var elementSelector = toggles[i].getAttribute('data-toggle-selector'); - var element = document.querySelector(elementSelector); - - addClass(element, 'sf-toggle-content'); - - if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') { - addClass(toggles[i], 'sf-toggle-on'); - addClass(element, 'sf-toggle-visible'); - } else { - addClass(toggles[i], 'sf-toggle-off'); - addClass(element, 'sf-toggle-hidden'); - } - - addEventListener(toggles[i], 'click', function(e) { - e.preventDefault(); - if ('' !== window.getSelection().toString()) { - /* Don't do anything on text selection */ - return; - } + var toggle = e.target || e.srcElement; - var toggle = e.target || e.srcElement; + /* needed because when the toggle contains HTML contents, user can click */ + /* on any of those elements instead of their parent '.sf-toggle' element */ + while (!hasClass(toggle, 'sf-toggle')) { + toggle = toggle.parentNode; + } - /* needed because when the toggle contains HTML contents, user can click */ - /* on any of those elements instead of their parent '.sf-toggle' element */ - while (!hasClass(toggle, 'sf-toggle')) { - toggle = toggle.parentNode; - } + var element = document.querySelector(toggle.getAttribute('data-toggle-selector')); - var element = document.querySelector(toggle.getAttribute('data-toggle-selector')); + toggleClass(toggle, 'sf-toggle-on'); + toggleClass(toggle, 'sf-toggle-off'); + toggleClass(element, 'sf-toggle-hidden'); + toggleClass(element, 'sf-toggle-visible'); - toggleClass(toggle, 'sf-toggle-on'); - toggleClass(toggle, 'sf-toggle-off'); - toggleClass(element, 'sf-toggle-hidden'); - toggleClass(element, 'sf-toggle-visible'); + /* the toggle doesn't change its contents when clicking on it */ + if (!toggle.hasAttribute('data-toggle-alt-content')) { + return; + } - /* the toggle doesn't change its contents when clicking on it */ - if (!toggle.hasAttribute('data-toggle-alt-content')) { - return; - } + if (!toggle.hasAttribute('data-toggle-original-content')) { + toggle.setAttribute('data-toggle-original-content', toggle.innerHTML); + } - if (!toggle.hasAttribute('data-toggle-original-content')) { - toggle.setAttribute('data-toggle-original-content', toggle.innerHTML); - } + var currentContent = toggle.innerHTML; + var originalContent = toggle.getAttribute('data-toggle-original-content'); + var altContent = toggle.getAttribute('data-toggle-alt-content'); + toggle.innerHTML = currentContent !== altContent ? altContent : originalContent; + }); - var currentContent = toggle.innerHTML; - var originalContent = toggle.getAttribute('data-toggle-original-content'); - var altContent = toggle.getAttribute('data-toggle-alt-content'); - toggle.innerHTML = currentContent !== altContent ? altContent : originalContent; - }); + /* Prevents from disallowing clicks on links inside toggles */ + var toggleLinks = toggles[i].querySelectorAll('a'); + for (var j = 0; j < toggleLinks.length; j++) { + addEventListener(toggleLinks[j], 'click', function(e) { + e.stopPropagation(); + }); + } - /* Prevents from disallowing clicks on links inside toggles */ - var toggleLinks = toggles[i].querySelectorAll('a'); - for (var j = 0; j < toggleLinks.length; j++) { - addEventListener(toggleLinks[j], 'click', function(e) { - e.stopPropagation(); - }); - } + /* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */ + var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]'); + for (var k = 0; k < copyToClipboardElements.length; k++) { + addEventListener(copyToClipboardElements[k], 'click', function(e) { + e.stopPropagation(); + }); + } - /* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */ - var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]'); - for (var k = 0; k < copyToClipboardElements.length; k++) { - addEventListener(copyToClipboardElements[k], 'click', function(e) { - e.stopPropagation(); - }); - } + toggles[i].setAttribute('data-processed', 'true'); + } + })(); - toggles[i].setAttribute('data-processed', 'true'); + (function createFilters() { + document.querySelectorAll('[data-filters] [data-filter]').forEach(function (filter) { + var filters = filter.closest('[data-filters]'), + type = 'choice', + name = filter.dataset.filter, + ucName = name.charAt(0).toUpperCase()+name.slice(1), + list = document.createElement('ul'), + values = filters.dataset['filter'+ucName] || filters.querySelectorAll('[data-filter-'+name+']'), + labels = {}, + defaults = null, + indexed = {}, + processed = {}; + if (typeof values === 'string') { + type = 'level'; + labels = values.split(','); + values = values.toLowerCase().split(','); + defaults = values.length - 1; + } + addClass(list, 'filter-list'); + addClass(list, 'filter-list-'+type); + values.forEach(function (value, i) { + if (value instanceof HTMLElement) { + value = value.dataset['filter'+ucName]; } - }, - - createFilters: function() { - document.querySelectorAll('[data-filters] [data-filter]').forEach(function (filter) { - var filters = filter.closest('[data-filters]'), - type = 'choice', - name = filter.dataset.filter, - ucName = name.charAt(0).toUpperCase()+name.slice(1), - list = document.createElement('ul'), - values = filters.dataset['filter'+ucName] || filters.querySelectorAll('[data-filter-'+name+']'), - labels = {}, - defaults = null, - indexed = {}, - processed = {}; - if (typeof values === 'string') { - type = 'level'; - labels = values.split(','); - values = values.toLowerCase().split(','); - defaults = values.length - 1; - } - addClass(list, 'filter-list'); - addClass(list, 'filter-list-'+type); - values.forEach(function (value, i) { - if (value instanceof HTMLElement) { - value = value.dataset['filter'+ucName]; - } - if (value in processed) { + if (value in processed) { + return; + } + var option = document.createElement('li'), + label = i in labels ? labels[i] : value, + active = false, + matches; + if ('' === label) { + option.innerHTML = '(none)'; + } else { + option.innerText = label; + } + option.dataset.filter = value; + option.setAttribute('title', 1 === (matches = filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').length) ? 'Matches 1 row' : 'Matches '+matches+' rows'); + indexed[value] = i; + list.appendChild(option); + addEventListener(option, 'click', function () { + if ('choice' === type) { + filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) { + if (option.dataset.filter === row.dataset['filter'+ucName]) { + toggleClass(row, 'filter-hidden-'+name); + } + }); + toggleClass(option, 'active'); + } else if ('level' === type) { + if (i === this.parentNode.querySelectorAll('.active').length - 1) { return; } - var option = document.createElement('li'), - label = i in labels ? labels[i] : value, - active = false, - matches; - if ('' === label) { - option.innerHTML = '(none)'; - } else { - option.innerText = label; - } - option.dataset.filter = value; - option.setAttribute('title', 1 === (matches = filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').length) ? 'Matches 1 row' : 'Matches '+matches+' rows'); - indexed[value] = i; - list.appendChild(option); - addEventListener(option, 'click', function () { - if ('choice' === type) { - filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) { - if (option.dataset.filter === row.dataset['filter'+ucName]) { - toggleClass(row, 'filter-hidden-'+name); - } - }); - toggleClass(option, 'active'); - } else if ('level' === type) { - if (i === this.parentNode.querySelectorAll('.active').length - 1) { - return; + this.parentNode.querySelectorAll('li').forEach(function (currentOption, j) { + if (j <= i) { + addClass(currentOption, 'active'); + if (i === j) { + addClass(currentOption, 'last-active'); + } else { + removeClass(currentOption, 'last-active'); } - this.parentNode.querySelectorAll('li').forEach(function (currentOption, j) { - if (j <= i) { - addClass(currentOption, 'active'); - if (i === j) { - addClass(currentOption, 'last-active'); - } else { - removeClass(currentOption, 'last-active'); - } - } else { - removeClass(currentOption, 'active'); - removeClass(currentOption, 'last-active'); - } - }); - filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) { - if (i < indexed[row.dataset['filter'+ucName]]) { - addClass(row, 'filter-hidden-'+name); - } else { - removeClass(row, 'filter-hidden-'+name); - } - }); + } else { + removeClass(currentOption, 'active'); + removeClass(currentOption, 'last-active'); } }); - if ('choice' === type) { - active = null === defaults || 0 <= defaults.indexOf(value); - } else if ('level' === type) { - active = i <= defaults; - if (active && i === defaults) { - addClass(option, 'last-active'); + filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) { + if (i < indexed[row.dataset['filter'+ucName]]) { + addClass(row, 'filter-hidden-'+name); + } else { + removeClass(row, 'filter-hidden-'+name); } - } - if (active) { - addClass(option, 'active'); - } else { - filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').forEach(function (row) { - toggleClass(row, 'filter-hidden-'+name); - }); - } - processed[value] = true; - }); - - if (1 < list.childNodes.length) { - filter.appendChild(list); - filter.dataset.filtered = ''; + }); } }); + if ('choice' === type) { + active = null === defaults || 0 <= defaults.indexOf(value); + } else if ('level' === type) { + active = i <= defaults; + if (active && i === defaults) { + addClass(option, 'last-active'); + } + } + if (active) { + addClass(option, 'active'); + } else { + filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').forEach(function (row) { + toggleClass(row, 'filter-hidden-'+name); + }); + } + processed[value] = true; + }); + + if (1 < list.childNodes.length) { + filter.appendChild(list); + filter.dataset.filtered = ''; } - }; + }); })(); - - Sfjs.addEventListener(document, 'DOMContentLoaded', function() { - Sfjs.createTabs(); - Sfjs.createToggles(); - Sfjs.createFilters(); - }); -} +})(); /*]]>*/ diff --git a/api/vendor/symfony/error-handler/Resources/views/error.html.php b/api/vendor/symfony/error-handler/Resources/views/error.html.php index 5416d03c8c..dcd30c295f 100644 --- a/api/vendor/symfony/error-handler/Resources/views/error.html.php +++ b/api/vendor/symfony/error-handler/Resources/views/error.html.php @@ -1,5 +1,5 @@ - + diff --git a/api/vendor/symfony/event-dispatcher-contracts/.gitignore b/api/vendor/symfony/event-dispatcher-contracts/.gitignore deleted file mode 100644 index c49a5d8df5..0000000000 --- a/api/vendor/symfony/event-dispatcher-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/api/vendor/symfony/event-dispatcher-contracts/Event.php b/api/vendor/symfony/event-dispatcher-contracts/Event.php index 384a650b8a..2e7f998903 100644 --- a/api/vendor/symfony/event-dispatcher-contracts/Event.php +++ b/api/vendor/symfony/event-dispatcher-contracts/Event.php @@ -32,9 +32,6 @@ class Event implements StoppableEventInterface { private bool $propagationStopped = false; - /** - * {@inheritdoc} - */ public function isPropagationStopped(): bool { return $this->propagationStopped; diff --git a/api/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php b/api/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php index 351dc51312..2d7840d32d 100644 --- a/api/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php +++ b/api/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php @@ -21,11 +21,13 @@ interface EventDispatcherInterface extends PsrEventDispatcherInterface /** * Dispatches an event to all registered listeners. * - * @param object $event The event to pass to the event handlers/listeners + * @template T of object + * + * @param T $event The event to pass to the event handlers/listeners * @param string|null $eventName The name of the event to dispatch. If not supplied, * the class of $event should be used instead. * - * @return object The passed $event MUST be returned + * @return T The passed $event MUST be returned */ - public function dispatch(object $event, string $eventName = null): object; + public function dispatch(object $event, ?string $eventName = null): object; } diff --git a/api/vendor/symfony/event-dispatcher-contracts/LICENSE b/api/vendor/symfony/event-dispatcher-contracts/LICENSE index 74cdc2dbf6..7536caeae8 100644 --- a/api/vendor/symfony/event-dispatcher-contracts/LICENSE +++ b/api/vendor/symfony/event-dispatcher-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2022 Fabien Potencier +Copyright (c) 2018-present 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/api/vendor/symfony/event-dispatcher-contracts/README.md b/api/vendor/symfony/event-dispatcher-contracts/README.md index b1ab4c00ce..332b961cb8 100644 --- a/api/vendor/symfony/event-dispatcher-contracts/README.md +++ b/api/vendor/symfony/event-dispatcher-contracts/README.md @@ -3,7 +3,7 @@ Symfony EventDispatcher 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 +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/api/vendor/symfony/event-dispatcher-contracts/composer.json b/api/vendor/symfony/event-dispatcher-contracts/composer.json index b4c3933bae..35956eb807 100644 --- a/api/vendor/symfony/event-dispatcher-contracts/composer.json +++ b/api/vendor/symfony/event-dispatcher-contracts/composer.json @@ -16,19 +16,16 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "autoload": { "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/api/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/api/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php index 67bc6322ff..5ba83dad4b 100644 --- a/api/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php +++ b/api/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php @@ -13,6 +13,7 @@ use Psr\EventDispatcher\StoppableEventInterface; use Psr\Log\LoggerInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; @@ -36,13 +37,13 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa * @var \SplObjectStorage|null */ private ?\SplObjectStorage $callStack = null; - private $dispatcher; + private EventDispatcherInterface $dispatcher; private array $wrappedListeners = []; private array $orphanedEvents = []; - private $requestStack; + private ?RequestStack $requestStack; private string $currentRequestHash = ''; - public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null) + public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null, ?RequestStack $requestStack = null) { $this->dispatcher = $dispatcher; $this->stopwatch = $stopwatch; @@ -51,7 +52,7 @@ public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $sto } /** - * {@inheritdoc} + * @return void */ public function addListener(string $eventName, callable|array $listener, int $priority = 0) { @@ -59,7 +60,7 @@ public function addListener(string $eventName, callable|array $listener, int $pr } /** - * {@inheritdoc} + * @return void */ public function addSubscriber(EventSubscriberInterface $subscriber) { @@ -67,7 +68,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber) } /** - * {@inheritdoc} + * @return void */ public function removeListener(string $eventName, callable|array $listener) { @@ -81,28 +82,22 @@ public function removeListener(string $eventName, callable|array $listener) } } - return $this->dispatcher->removeListener($eventName, $listener); + $this->dispatcher->removeListener($eventName, $listener); } /** - * {@inheritdoc} + * @return void */ public function removeSubscriber(EventSubscriberInterface $subscriber) { - return $this->dispatcher->removeSubscriber($subscriber); + $this->dispatcher->removeSubscriber($subscriber); } - /** - * {@inheritdoc} - */ - public function getListeners(string $eventName = null): array + public function getListeners(?string $eventName = null): array { return $this->dispatcher->getListeners($eventName); } - /** - * {@inheritdoc} - */ public function getListenerPriority(string $eventName, callable|array $listener): ?int { // we might have wrapped listeners for the event (if called while dispatching) @@ -118,24 +113,16 @@ public function getListenerPriority(string $eventName, callable|array $listener) return $this->dispatcher->getListenerPriority($eventName, $listener); } - /** - * {@inheritdoc} - */ - public function hasListeners(string $eventName = null): bool + public function hasListeners(?string $eventName = null): bool { return $this->dispatcher->hasListeners($eventName); } - /** - * {@inheritdoc} - */ - public function dispatch(object $event, string $eventName = null): object + public function dispatch(object $event, ?string $eventName = null): object { - $eventName = $eventName ?? \get_class($event); + $eventName ??= $event::class; - if (null === $this->callStack) { - $this->callStack = new \SplObjectStorage(); - } + $this->callStack ??= new \SplObjectStorage(); $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : ''; @@ -166,7 +153,7 @@ public function dispatch(object $event, string $eventName = null): object return $event; } - public function getCalledListeners(Request $request = null): array + public function getCalledListeners(?Request $request = null): array { if (null === $this->callStack) { return []; @@ -184,14 +171,12 @@ public function getCalledListeners(Request $request = null): array return $called; } - public function getNotCalledListeners(Request $request = null): array + public function getNotCalledListeners(?Request $request = null): array { try { - $allListeners = $this->getListeners(); + $allListeners = $this->dispatcher instanceof EventDispatcher ? $this->getListenersWithPriority() : $this->getListenersWithoutPriority(); } catch (\Exception $e) { - if (null !== $this->logger) { - $this->logger->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]); - } + $this->logger?->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]); // unable to retrieve the uncalled listeners return []; @@ -211,23 +196,24 @@ public function getNotCalledListeners(Request $request = null): array } $notCalled = []; + foreach ($allListeners as $eventName => $listeners) { - foreach ($listeners as $listener) { + foreach ($listeners as [$listener, $priority]) { if (!\in_array($listener, $calledListeners, true)) { if (!$listener instanceof WrappedListener) { - $listener = new WrappedListener($listener, null, $this->stopwatch, $this); + $listener = new WrappedListener($listener, null, $this->stopwatch, $this, $priority); } $notCalled[] = $listener->getInfo($eventName); } } } - uasort($notCalled, [$this, 'sortNotCalledListeners']); + uasort($notCalled, $this->sortNotCalledListeners(...)); return $notCalled; } - public function getOrphanedEvents(Request $request = null): array + public function getOrphanedEvents(?Request $request = null): array { if ($request) { return $this->orphanedEvents[spl_object_hash($request)] ?? []; @@ -240,6 +226,9 @@ public function getOrphanedEvents(Request $request = null): array return array_merge(...array_values($this->orphanedEvents)); } + /** + * @return void + */ public function reset() { $this->callStack = null; @@ -260,6 +249,8 @@ public function __call(string $method, array $arguments): mixed /** * Called before dispatching the event. + * + * @return void */ protected function beforeDispatch(string $eventName, object $event) { @@ -267,6 +258,8 @@ protected function beforeDispatch(string $eventName, object $event) /** * Called after dispatching the event. + * + * @return void */ protected function afterDispatch(string $eventName, object $event) { @@ -308,9 +301,7 @@ private function postProcess(string $eventName): void } if ($listener->wasCalled()) { - if (null !== $this->logger) { - $this->logger->debug('Notified event "{event}" to listener "{listener}".', $context); - } + $this->logger?->debug('Notified event "{event}" to listener "{listener}".', $context); } else { $this->callStack->detach($listener); } @@ -320,16 +311,14 @@ private function postProcess(string $eventName): void } if ($listener->stoppedPropagation()) { - if (null !== $this->logger) { - $this->logger->debug('Listener "{listener}" stopped propagation of the event "{event}".', $context); - } + $this->logger?->debug('Listener "{listener}" stopped propagation of the event "{event}".', $context); $skipped = true; } } } - private function sortNotCalledListeners(array $a, array $b) + private function sortNotCalledListeners(array $a, array $b): int { if (0 !== $cmp = strcmp($a['event'], $b['event'])) { return $cmp; @@ -353,4 +342,34 @@ private function sortNotCalledListeners(array $a, array $b) return 1; } + + private function getListenersWithPriority(): array + { + $result = []; + + $allListeners = new \ReflectionProperty(EventDispatcher::class, 'listeners'); + + foreach ($allListeners->getValue($this->dispatcher) as $eventName => $listenersByPriority) { + foreach ($listenersByPriority as $priority => $listeners) { + foreach ($listeners as $listener) { + $result[$eventName][] = [$listener, $priority]; + } + } + } + + return $result; + } + + private function getListenersWithoutPriority(): array + { + $result = []; + + foreach ($this->getListeners() as $eventName => $listeners) { + foreach ($listeners as $listener) { + $result[$eventName][] = [$listener, null]; + } + } + + return $result; + } } diff --git a/api/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/api/vendor/symfony/event-dispatcher/Debug/WrappedListener.php index 11bd0c8048..59f7c13629 100644 --- a/api/vendor/symfony/event-dispatcher/Debug/WrappedListener.php +++ b/api/vendor/symfony/event-dispatcher/Debug/WrappedListener.php @@ -26,26 +26,29 @@ final class WrappedListener private string $name; private bool $called = false; private bool $stoppedPropagation = false; - private $stopwatch; - private $dispatcher; + private Stopwatch $stopwatch; + private ?EventDispatcherInterface $dispatcher; private string $pretty; - private $stub; + private string $callableRef; + private ClassStub|string $stub; private ?int $priority = null; private static bool $hasClassStub; - public function __construct(callable|array $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) + public function __construct(callable|array $listener, ?string $name, Stopwatch $stopwatch, ?EventDispatcherInterface $dispatcher = null, ?int $priority = null) { $this->listener = $listener; - $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? \Closure::fromCallable($listener) : null); + $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? $listener(...) : null); $this->stopwatch = $stopwatch; $this->dispatcher = $dispatcher; + $this->priority = $priority; if (\is_array($listener)) { - $this->name = \is_object($listener[0]) ? get_debug_type($listener[0]) : $listener[0]; + [$this->name, $this->callableRef] = $this->parseListener($listener); $this->pretty = $this->name.'::'.$listener[1]; + $this->callableRef .= '::'.$listener[1]; } elseif ($listener instanceof \Closure) { $r = new \ReflectionFunction($listener); - if (str_contains($r->name, '{closure}')) { + if (str_contains($r->name, '{closure')) { $this->pretty = $this->name = 'closure'; } elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { $this->name = $class->name; @@ -58,6 +61,7 @@ public function __construct(callable|array $listener, ?string $name, Stopwatch $ } else { $this->name = get_debug_type($listener); $this->pretty = $this->name.'::__invoke'; + $this->callableRef = $listener::class.'::__invoke'; } if (null !== $name) { @@ -89,11 +93,11 @@ public function getPretty(): string public function getInfo(string $eventName): array { - $this->stub ??= self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()'; + $this->stub ??= self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->callableRef ?? $this->listener) : $this->pretty.'()'; return [ 'event' => $eventName, - 'priority' => null !== $this->priority ? $this->priority : (null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null), + 'priority' => $this->priority ??= $this->dispatcher?->getListenerPriority($eventName, $this->listener), 'pretty' => $this->pretty, 'stub' => $this->stub, ]; @@ -104,18 +108,37 @@ public function __invoke(object $event, string $eventName, EventDispatcherInterf $dispatcher = $this->dispatcher ?: $dispatcher; $this->called = true; - $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener); + $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); - ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); - - if ($e->isStarted()) { - $e->stop(); + try { + ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); + } finally { + if ($e->isStarted()) { + $e->stop(); + } } if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { $this->stoppedPropagation = true; } } + + private function parseListener(array $listener): array + { + if ($listener[0] instanceof \Closure) { + foreach ((new \ReflectionFunction($listener[0]))->getAttributes(\Closure::class) as $attribute) { + if ($name = $attribute->getArguments()['name'] ?? false) { + return [$name, $attribute->getArguments()['class'] ?? $name]; + } + } + } + + if (\is_object($listener[0])) { + return [get_debug_type($listener[0]), $listener[0]::class]; + } + + return [$listener[0], $listener[0]]; + } } diff --git a/api/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/api/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php index 90bdeb4fb2..866f4e64ff 100644 --- a/api/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php +++ b/api/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php @@ -48,6 +48,9 @@ public function setNoPreloadEvents(array $noPreloadEvents): static return $this; } + /** + * @return void + */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition('event_dispatcher') && !$container->hasAlias('event_dispatcher')) { @@ -73,7 +76,7 @@ public function process(ContainerBuilder $container) continue; } - $event['method'] = $event['method'] ?? '__invoke'; + $event['method'] ??= '__invoke'; $event['event'] = $this->getEventFromTypeDeclaration($container, $id, $event['method']); } @@ -83,17 +86,21 @@ public function process(ContainerBuilder $container) $event['method'] = 'on'.preg_replace_callback([ '/(?<=\b|_)[a-z]/i', '/[^a-z0-9]/i', - ], function ($matches) { return strtoupper($matches[0]); }, $event['event']); + ], fn ($matches) => strtoupper($matches[0]), $event['event']); $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); - if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) { + if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) { + if (!$r->hasMethod('__invoke')) { + throw new InvalidArgumentException(sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "kernel.event_listener" tags.', $event['method'], $id)); + } + $event['method'] = '__invoke'; } } $dispatcherDefinition = $globalDispatcherDefinition; if (isset($event['dispatcher'])) { - $dispatcherDefinition = $container->getDefinition($event['dispatcher']); + $dispatcherDefinition = $container->findDefinition($event['dispatcher']); } $dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]); @@ -132,7 +139,7 @@ public function process(ContainerBuilder $container) continue; } - $dispatcherDefinitions[$attributes['dispatcher']] = $container->getDefinition($attributes['dispatcher']); + $dispatcherDefinitions[$attributes['dispatcher']] = $container->findDefinition($attributes['dispatcher']); } if (!$dispatcherDefinitions) { @@ -191,7 +198,7 @@ class ExtractingEventDispatcher extends EventDispatcher implements EventSubscrib public static array $aliases = []; public static string $subscriber; - public function addListener(string $eventName, callable|array $listener, int $priority = 0) + public function addListener(string $eventName, callable|array $listener, int $priority = 0): void { $this->listeners[] = [$eventName, $listener[1], $priority]; } diff --git a/api/vendor/symfony/event-dispatcher/EventDispatcher.php b/api/vendor/symfony/event-dispatcher/EventDispatcher.php index 1812c9873d..605298926b 100644 --- a/api/vendor/symfony/event-dispatcher/EventDispatcher.php +++ b/api/vendor/symfony/event-dispatcher/EventDispatcher.php @@ -42,12 +42,9 @@ public function __construct() } } - /** - * {@inheritdoc} - */ - public function dispatch(object $event, string $eventName = null): object + public function dispatch(object $event, ?string $eventName = null): object { - $eventName = $eventName ?? \get_class($event); + $eventName ??= $event::class; if (isset($this->optimized)) { $listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName)); @@ -62,10 +59,7 @@ public function dispatch(object $event, string $eventName = null): object return $event; } - /** - * {@inheritdoc} - */ - public function getListeners(string $eventName = null): array + public function getListeners(?string $eventName = null): array { if (null !== $eventName) { if (empty($this->listeners[$eventName])) { @@ -88,9 +82,6 @@ public function getListeners(string $eventName = null): array return array_filter($this->sorted); } - /** - * {@inheritdoc} - */ public function getListenerPriority(string $eventName, callable|array $listener): ?int { if (empty($this->listeners[$eventName])) { @@ -99,14 +90,14 @@ public function getListenerPriority(string $eventName, callable|array $listener) if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; + $listener[1] ??= '__invoke'; } foreach ($this->listeners[$eventName] as $priority => &$listeners) { foreach ($listeners as &$v) { if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { $v[0] = $v[0](); - $v[1] = $v[1] ?? '__invoke'; + $v[1] ??= '__invoke'; } if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { return $priority; @@ -117,10 +108,7 @@ public function getListenerPriority(string $eventName, callable|array $listener) return null; } - /** - * {@inheritdoc} - */ - public function hasListeners(string $eventName = null): bool + public function hasListeners(?string $eventName = null): bool { if (null !== $eventName) { return !empty($this->listeners[$eventName]); @@ -136,7 +124,7 @@ public function hasListeners(string $eventName = null): bool } /** - * {@inheritdoc} + * @return void */ public function addListener(string $eventName, callable|array $listener, int $priority = 0) { @@ -145,7 +133,7 @@ public function addListener(string $eventName, callable|array $listener, int $pr } /** - * {@inheritdoc} + * @return void */ public function removeListener(string $eventName, callable|array $listener) { @@ -155,14 +143,14 @@ public function removeListener(string $eventName, callable|array $listener) if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; + $listener[1] ??= '__invoke'; } foreach ($this->listeners[$eventName] as $priority => &$listeners) { foreach ($listeners as $k => &$v) { if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) { $v[0] = $v[0](); - $v[1] = $v[1] ?? '__invoke'; + $v[1] ??= '__invoke'; } if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { unset($listeners[$k], $this->sorted[$eventName], $this->optimized[$eventName]); @@ -176,7 +164,7 @@ public function removeListener(string $eventName, callable|array $listener) } /** - * {@inheritdoc} + * @return void */ public function addSubscriber(EventSubscriberInterface $subscriber) { @@ -194,7 +182,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber) } /** - * {@inheritdoc} + * @return void */ public function removeSubscriber(EventSubscriberInterface $subscriber) { @@ -218,6 +206,8 @@ public function removeSubscriber(EventSubscriberInterface $subscriber) * @param callable[] $listeners The event listeners * @param string $eventName The name of the event to dispatch * @param object $event The event object to pass to the event handlers/listeners + * + * @return void */ protected function callListeners(iterable $listeners, string $eventName, object $event) { @@ -234,16 +224,16 @@ protected function callListeners(iterable $listeners, string $eventName, object /** * Sorts the internal list of listeners for the given event by priority. */ - private function sortListeners(string $eventName) + private function sortListeners(string $eventName): void { krsort($this->listeners[$eventName]); $this->sorted[$eventName] = []; foreach ($this->listeners[$eventName] as &$listeners) { - foreach ($listeners as $k => &$listener) { + foreach ($listeners as &$listener) { if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) { $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; + $listener[1] ??= '__invoke'; } $this->sorted[$eventName][] = $listener; } @@ -265,12 +255,12 @@ private function optimizeListeners(string $eventName): array $closure = static function (...$args) use (&$listener, &$closure) { if ($listener[0] instanceof \Closure) { $listener[0] = $listener[0](); - $listener[1] = $listener[1] ?? '__invoke'; + $listener[1] ??= '__invoke'; } - ($closure = \Closure::fromCallable($listener))(...$args); + ($closure = $listener(...))(...$args); }; } else { - $closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener); + $closure = $listener instanceof WrappedListener ? $listener : $listener(...); } } } diff --git a/api/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/api/vendor/symfony/event-dispatcher/EventDispatcherInterface.php index 97a3017a44..e95a7b11df 100644 --- a/api/vendor/symfony/event-dispatcher/EventDispatcherInterface.php +++ b/api/vendor/symfony/event-dispatcher/EventDispatcherInterface.php @@ -27,6 +27,8 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface * * @param int $priority The higher this value, the earlier an event * listener will be triggered in the chain (defaults to 0) + * + * @return void */ public function addListener(string $eventName, callable $listener, int $priority = 0); @@ -35,14 +37,21 @@ public function addListener(string $eventName, callable $listener, int $priority * * The subscriber is asked for all the events it is * interested in and added as a listener for these events. + * + * @return void */ public function addSubscriber(EventSubscriberInterface $subscriber); /** * Removes an event listener from the specified events. + * + * @return void */ public function removeListener(string $eventName, callable $listener); + /** + * @return void + */ public function removeSubscriber(EventSubscriberInterface $subscriber); /** @@ -50,7 +59,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber); * * @return array */ - public function getListeners(string $eventName = null): array; + public function getListeners(?string $eventName = null): array; /** * Gets the listener priority for a specific event. @@ -62,5 +71,5 @@ public function getListenerPriority(string $eventName, callable $listener): ?int /** * Checks whether an event has any registered listeners. */ - public function hasListeners(string $eventName = null): bool; + public function hasListeners(?string $eventName = null): bool; } diff --git a/api/vendor/symfony/event-dispatcher/GenericEvent.php b/api/vendor/symfony/event-dispatcher/GenericEvent.php index 68a2030633..0ccbbd8104 100644 --- a/api/vendor/symfony/event-dispatcher/GenericEvent.php +++ b/api/vendor/symfony/event-dispatcher/GenericEvent.php @@ -29,7 +29,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate protected $arguments; /** - * Encapsulate an event with $subject and $args. + * Encapsulate an event with $subject and $arguments. * * @param mixed $subject The subject of the event, usually an object or a callable * @param array $arguments Arguments to store in the event diff --git a/api/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php b/api/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php index 655ae3de45..301a805cb1 100644 --- a/api/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php +++ b/api/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php @@ -18,23 +18,20 @@ */ class ImmutableEventDispatcher implements EventDispatcherInterface { - private $dispatcher; + private EventDispatcherInterface $dispatcher; public function __construct(EventDispatcherInterface $dispatcher) { $this->dispatcher = $dispatcher; } - /** - * {@inheritdoc} - */ - public function dispatch(object $event, string $eventName = null): object + public function dispatch(object $event, ?string $eventName = null): object { return $this->dispatcher->dispatch($event, $eventName); } /** - * {@inheritdoc} + * @return never */ public function addListener(string $eventName, callable|array $listener, int $priority = 0) { @@ -42,7 +39,7 @@ public function addListener(string $eventName, callable|array $listener, int $pr } /** - * {@inheritdoc} + * @return never */ public function addSubscriber(EventSubscriberInterface $subscriber) { @@ -50,7 +47,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber) } /** - * {@inheritdoc} + * @return never */ public function removeListener(string $eventName, callable|array $listener) { @@ -58,33 +55,24 @@ public function removeListener(string $eventName, callable|array $listener) } /** - * {@inheritdoc} + * @return never */ public function removeSubscriber(EventSubscriberInterface $subscriber) { throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.'); } - /** - * {@inheritdoc} - */ - public function getListeners(string $eventName = null): array + public function getListeners(?string $eventName = null): array { return $this->dispatcher->getListeners($eventName); } - /** - * {@inheritdoc} - */ public function getListenerPriority(string $eventName, callable|array $listener): ?int { return $this->dispatcher->getListenerPriority($eventName, $listener); } - /** - * {@inheritdoc} - */ - public function hasListeners(string $eventName = null): bool + public function hasListeners(?string $eventName = null): bool { return $this->dispatcher->hasListeners($eventName); } diff --git a/api/vendor/symfony/event-dispatcher/LICENSE b/api/vendor/symfony/event-dispatcher/LICENSE index 0083704572..0138f8f071 100644 --- a/api/vendor/symfony/event-dispatcher/LICENSE +++ b/api/vendor/symfony/event-dispatcher/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present 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/api/vendor/symfony/event-dispatcher/composer.json b/api/vendor/symfony/event-dispatcher/composer.json index 53a86ee9df..ff281afd6c 100644 --- a/api/vendor/symfony/event-dispatcher/composer.json +++ b/api/vendor/symfony/event-dispatcher/composer.json @@ -16,30 +16,27 @@ } ], "require": { - "php": ">=8.0.2", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.1", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "require-dev": { - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^5.4|^6.0|^7.0", "psr/log": "^1|^2|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<5.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", "symfony/event-dispatcher-implementation": "2.0|3.0" }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, "autoload": { "psr-4": { "Symfony\\Component\\EventDispatcher\\": "" }, "exclude-from-classmap": [ diff --git a/api/vendor/symfony/finder/Comparator/Comparator.php b/api/vendor/symfony/finder/Comparator/Comparator.php index 3af551f4cc..23cf94ecc7 100644 --- a/api/vendor/symfony/finder/Comparator/Comparator.php +++ b/api/vendor/symfony/finder/Comparator/Comparator.php @@ -19,7 +19,7 @@ class Comparator private $target; private $operator = '=='; - public function __construct(string $target = null, string $operator = '==') + public function __construct(?string $target = null, string $operator = '==') { if (null === $target) { trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__); diff --git a/api/vendor/symfony/finder/Comparator/NumberComparator.php b/api/vendor/symfony/finder/Comparator/NumberComparator.php index ff85d9677b..dd3082077a 100644 --- a/api/vendor/symfony/finder/Comparator/NumberComparator.php +++ b/api/vendor/symfony/finder/Comparator/NumberComparator.php @@ -35,7 +35,7 @@ class NumberComparator extends Comparator { /** - * @param string|int $test A comparison string or an integer + * @param string|null $test A comparison string or null * * @throws \InvalidArgumentException If the test is not understood */ diff --git a/api/vendor/symfony/finder/Finder.php b/api/vendor/symfony/finder/Finder.php index 8cc564cd67..0b569655cc 100644 --- a/api/vendor/symfony/finder/Finder.php +++ b/api/vendor/symfony/finder/Finder.php @@ -164,8 +164,8 @@ public function date($dates) * * You can use patterns (delimited with / sign), globs or simple strings. * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above + * $finder->name('/\.php$/') + * $finder->name('*.php') // same as above, without dot files * $finder->name('test.php') * $finder->name(['test.py', 'test.php']) * diff --git a/api/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/api/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php index d9e182c17a..39797c82ca 100644 --- a/api/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ b/api/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -17,6 +17,7 @@ * @author Fabien Potencier * * @extends \FilterIterator + * * @implements \RecursiveIterator */ class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator diff --git a/api/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/api/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php index 27589cdd5f..ac5d720efd 100644 --- a/api/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ b/api/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -29,7 +29,7 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator /** * @var bool */ - private $rewindable; + private $ignoreFirstRewind = true; // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations private $rootPath; @@ -70,8 +70,9 @@ public function current() $subPathname .= $this->directorySeparator; } $subPathname .= $this->getFilename(); + $basePath = $this->rootPath; - if ('/' !== $basePath = $this->rootPath) { + if ('/' !== $basePath && !str_ends_with($basePath, $this->directorySeparator) && !str_ends_with($basePath, '/')) { $basePath .= $this->directorySeparator; } @@ -118,7 +119,6 @@ public function getChildren() $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; $children->rootPath = $this->rootPath; } @@ -129,40 +129,30 @@ public function getChildren() } /** - * Do nothing for non rewindable stream. - * * @return void */ #[\ReturnTypeWillChange] - public function rewind() + public function next() { - if (false === $this->isRewindable()) { - return; - } + $this->ignoreFirstRewind = false; - parent::rewind(); + parent::next(); } /** - * Checks if the stream is rewindable. - * - * @return bool + * @return void */ - public function isRewindable() + #[\ReturnTypeWillChange] + public function rewind() { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); + // some streams like FTP are not rewindable, ignore the first rewind after creation, + // as newly created DirectoryIterator does not need to be rewound + if ($this->ignoreFirstRewind) { + $this->ignoreFirstRewind = false; - if ($infos['seekable']) { - return $this->rewindable = true; - } + return; } - return $this->rewindable = false; + parent::rewind(); } } diff --git a/api/vendor/symfony/finder/LICENSE b/api/vendor/symfony/finder/LICENSE index 0083704572..0138f8f071 100644 --- a/api/vendor/symfony/finder/LICENSE +++ b/api/vendor/symfony/finder/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present 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/api/vendor/symfony/http-foundation/BinaryFileResponse.php b/api/vendor/symfony/http-foundation/BinaryFileResponse.php index 6d7b80ad12..ccfd6389af 100644 --- a/api/vendor/symfony/http-foundation/BinaryFileResponse.php +++ b/api/vendor/symfony/http-foundation/BinaryFileResponse.php @@ -34,7 +34,7 @@ class BinaryFileResponse extends Response protected $offset = 0; protected $maxlen = -1; protected $deleteFileAfterSend = false; - protected $chunkSize = 8 * 1024; + protected $chunkSize = 16 * 1024; /** * @param \SplFileInfo|string $file The file to stream @@ -45,7 +45,7 @@ class BinaryFileResponse extends Response * @param bool $autoEtag Whether the ETag header should be automatically set * @param bool $autoLastModified Whether the Last-Modified header should be automatically set */ - public function __construct($file, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) + public function __construct($file, int $status = 200, array $headers = [], bool $public = true, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) { parent::__construct(null, $status, $headers); @@ -69,7 +69,7 @@ public function __construct($file, int $status = 200, array $headers = [], bool * * @deprecated since Symfony 5.2, use __construct() instead. */ - public static function create($file = null, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) + public static function create($file = null, int $status = 200, array $headers = [], bool $public = true, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) { trigger_deprecation('symfony/http-foundation', '5.2', 'The "%s()" method is deprecated, use "new %s()" instead.', __METHOD__, static::class); @@ -85,7 +85,7 @@ public static function create($file = null, int $status = 200, array $headers = * * @throws FileException */ - public function setFile($file, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) + public function setFile($file, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) { if (!$file instanceof File) { if ($file instanceof \SplFileInfo) { @@ -244,8 +244,12 @@ public function prepare(Request $request) } if ('x-accel-redirect' === strtolower($type)) { // Do X-Accel-Mapping substitutions. - // @link https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/#x-accel-redirect - $parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping', ''), ',='); + // @link https://github.com/rack/rack/blob/main/lib/rack/sendfile.rb + // @link https://mattbrictson.com/blog/accelerated-rails-downloads + if (!$request->headers->has('X-Accel-Mapping')) { + throw new \LogicException('The "X-Accel-Mapping" header must be set when "X-Sendfile-Type" is set to "X-Accel-Redirect".'); + } + $parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping'), ',='); foreach ($parts as $part) { [$pathPrefix, $location] = $part; if (substr($path, 0, \strlen($pathPrefix)) === $pathPrefix) { @@ -267,7 +271,7 @@ public function prepare(Request $request) $range = $request->headers->get('Range'); if (str_starts_with($range, 'bytes=')) { - [$start, $end] = explode('-', substr($range, 6), 2) + [0]; + [$start, $end] = explode('-', substr($range, 6), 2) + [1 => 0]; $end = ('' === $end) ? $fileSize - 1 : (int) $end; @@ -341,14 +345,21 @@ public function sendContent() $length = $this->maxlen; while ($length && !feof($file)) { - $read = ($length > $this->chunkSize) ? $this->chunkSize : $length; - $length -= $read; - - stream_copy_to_stream($file, $out, $read); + $read = $length > $this->chunkSize || 0 > $length ? $this->chunkSize : $length; - if (connection_aborted()) { + if (false === $data = fread($file, $read)) { break; } + while ('' !== $data) { + $read = fwrite($out, $data); + if (false === $read || connection_aborted()) { + break 2; + } + if (0 < $length) { + $length -= $read; + } + $data = substr($data, $read); + } } fclose($out); diff --git a/api/vendor/symfony/http-foundation/Cookie.php b/api/vendor/symfony/http-foundation/Cookie.php index b4b26c0151..3ff93b9c12 100644 --- a/api/vendor/symfony/http-foundation/Cookie.php +++ b/api/vendor/symfony/http-foundation/Cookie.php @@ -71,7 +71,7 @@ public static function fromString(string $cookie, bool $decode = false) return new static($name, $value, $data['expires'], $data['path'], $data['domain'], $data['secure'], $data['httponly'], $data['raw'], $data['samesite']); } - public static function create(string $name, string $value = null, $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX): self + public static function create(string $name, ?string $value = null, $expire = 0, ?string $path = '/', ?string $domain = null, ?bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX): self { return new self($name, $value, $expire, $path, $domain, $secure, $httpOnly, $raw, $sameSite); } @@ -80,7 +80,7 @@ public static function create(string $name, string $value = null, $expire = 0, ? * @param string $name The name of the cookie * @param string|null $value The value of the cookie * @param int|string|\DateTimeInterface $expire The time the cookie expires - * @param string $path The path on the server in which the cookie will be available on + * @param string|null $path The path on the server in which the cookie will be available on * @param string|null $domain The domain that the cookie is available to * @param bool|null $secure Whether the client should send back the cookie only over HTTPS or null to auto-enable this when the request is already using HTTPS * @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol @@ -89,7 +89,7 @@ public static function create(string $name, string $value = null, $expire = 0, ? * * @throws \InvalidArgumentException */ - public function __construct(string $name, string $value = null, $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = 'lax') + public function __construct(string $name, ?string $value = null, $expire = 0, ?string $path = '/', ?string $domain = null, ?bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = 'lax') { // from PHP source code if ($raw && false !== strpbrk($name, self::RESERVED_CHARS_LIST)) { diff --git a/api/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php b/api/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php index 94b0cb69aa..80a21bf151 100644 --- a/api/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php +++ b/api/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php @@ -20,7 +20,7 @@ */ class SessionNotFoundException extends \LogicException implements RequestExceptionInterface { - public function __construct(string $message = 'There is currently no session available.', int $code = 0, \Throwable $previous = null) + public function __construct(string $message = 'There is currently no session available.', int $code = 0, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/api/vendor/symfony/http-foundation/File/File.php b/api/vendor/symfony/http-foundation/File/File.php index d941577d25..2deb53d6dd 100644 --- a/api/vendor/symfony/http-foundation/File/File.php +++ b/api/vendor/symfony/http-foundation/File/File.php @@ -88,7 +88,7 @@ public function getMimeType() * * @throws FileException if the target file could not be created */ - public function move(string $directory, string $name = null) + public function move(string $directory, ?string $name = null) { $target = $this->getTargetFile($directory, $name); @@ -121,7 +121,7 @@ public function getContent(): string /** * @return self */ - protected function getTargetFile(string $directory, string $name = null) + protected function getTargetFile(string $directory, ?string $name = null) { if (!is_dir($directory)) { if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { diff --git a/api/vendor/symfony/http-foundation/File/UploadedFile.php b/api/vendor/symfony/http-foundation/File/UploadedFile.php index fcc6299138..6ff6e51a84 100644 --- a/api/vendor/symfony/http-foundation/File/UploadedFile.php +++ b/api/vendor/symfony/http-foundation/File/UploadedFile.php @@ -60,7 +60,7 @@ class UploadedFile extends File * @throws FileException If file_uploads is disabled * @throws FileNotFoundException If the file does not exist */ - public function __construct(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false) + public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $error = null, bool $test = false) { $this->originalName = $this->getName($originalName); $this->mimeType = $mimeType ?: 'application/octet-stream'; @@ -74,7 +74,7 @@ public function __construct(string $path, string $originalName, string $mimeType * Returns the original file name. * * It is extracted from the request from which the file has been uploaded. - * Then it should not be considered as a safe value. + * This should not be considered as a safe value to use for a file name on your servers. * * @return string */ @@ -87,7 +87,7 @@ public function getClientOriginalName() * Returns the original file extension. * * It is extracted from the original file name that was uploaded. - * Then it should not be considered as a safe value. + * This should not be considered as a safe value to use for a file name on your servers. * * @return string */ @@ -172,7 +172,7 @@ public function isValid() * * @throws FileException if, for any reason, the file could not have been moved */ - public function move(string $directory, string $name = null) + public function move(string $directory, ?string $name = null) { if ($this->isValid()) { if ($this->test) { diff --git a/api/vendor/symfony/http-foundation/HeaderBag.php b/api/vendor/symfony/http-foundation/HeaderBag.php index 4683a68409..43d5f6327e 100644 --- a/api/vendor/symfony/http-foundation/HeaderBag.php +++ b/api/vendor/symfony/http-foundation/HeaderBag.php @@ -67,7 +67,7 @@ public function __toString() * * @return array>|array */ - public function all(string $key = null) + public function all(?string $key = null) { if (null !== $key) { return $this->headers[strtr($key, self::UPPER, self::LOWER)] ?? []; @@ -110,7 +110,7 @@ public function add(array $headers) * * @return string|null */ - public function get(string $key, string $default = null) + public function get(string $key, ?string $default = null) { $headers = $this->all($key); @@ -197,7 +197,7 @@ public function remove(string $key) * * @throws \RuntimeException When the HTTP header is not parseable */ - public function getDate(string $key, \DateTime $default = null) + public function getDate(string $key, ?\DateTime $default = null) { if (null === $value = $this->get($key)) { return $default; diff --git a/api/vendor/symfony/http-foundation/HeaderUtils.php b/api/vendor/symfony/http-foundation/HeaderUtils.php index 1d56be0805..110896e177 100644 --- a/api/vendor/symfony/http-foundation/HeaderUtils.php +++ b/api/vendor/symfony/http-foundation/HeaderUtils.php @@ -33,17 +33,21 @@ private function __construct() * * Example: * - * HeaderUtils::split("da, en-gb;q=0.8", ",;") + * HeaderUtils::split('da, en-gb;q=0.8', ',;') * // => ['da'], ['en-gb', 'q=0.8']] * * @param string $separators List of characters to split on, ordered by - * precedence, e.g. ",", ";=", or ",;=" + * precedence, e.g. ',', ';=', or ',;=' * * @return array Nested array with as many levels as there are characters in * $separators */ public static function split(string $header, string $separators): array { + if ('' === $separators) { + throw new \InvalidArgumentException('At least one separator must be specified.'); + } + $quotedSeparators = preg_quote($separators, '/'); preg_match_all(' @@ -77,8 +81,8 @@ public static function split(string $header, string $separators): array * * Example: * - * HeaderUtils::combine([["foo", "abc"], ["bar"]]) - * // => ["foo" => "abc", "bar" => true] + * HeaderUtils::combine([['foo', 'abc'], ['bar']]) + * // => ['foo' => 'abc', 'bar' => true] */ public static function combine(array $parts): array { @@ -95,13 +99,13 @@ public static function combine(array $parts): array /** * Joins an associative array into a string for use in an HTTP header. * - * The key and value of each entry are joined with "=", and all entries + * The key and value of each entry are joined with '=', and all entries * are joined with the specified separator and an additional space (for * readability). Values are quoted if necessary. * * Example: * - * HeaderUtils::toString(["foo" => "abc", "bar" => true, "baz" => "a b c"], ",") + * HeaderUtils::toString(['foo' => 'abc', 'bar' => true, 'baz' => 'a b c'], ',') * // => 'foo=abc, bar, baz="a b c"' */ public static function toString(array $assoc, string $separator): string @@ -138,7 +142,7 @@ public static function quote(string $s): string * Decodes a quoted string. * * If passed an unquoted string that matches the "token" construct (as - * defined in the HTTP specification), it is passed through verbatimly. + * defined in the HTTP specification), it is passed through verbatim. */ public static function unquote(string $s): string { @@ -252,39 +256,40 @@ public static function parseQuery(string $query, bool $ignoreBrackets = false, s private static function groupParts(array $matches, string $separators, bool $first = true): array { $separator = $separators[0]; - $partSeparators = substr($separators, 1); - + $separators = substr($separators, 1) ?: ''; $i = 0; + + if ('' === $separators && !$first) { + $parts = ['']; + + foreach ($matches as $match) { + if (!$i && isset($match['separator'])) { + $i = 1; + $parts[1] = ''; + } else { + $parts[$i] .= self::unquote($match[0]); + } + } + + return $parts; + } + + $parts = []; $partMatches = []; - $previousMatchWasSeparator = false; + foreach ($matches as $match) { - if (!$first && $previousMatchWasSeparator && isset($match['separator']) && $match['separator'] === $separator) { - $previousMatchWasSeparator = true; - $partMatches[$i][] = $match; - } elseif (isset($match['separator']) && $match['separator'] === $separator) { - $previousMatchWasSeparator = true; + if (($match['separator'] ?? null) === $separator) { ++$i; } else { - $previousMatchWasSeparator = false; $partMatches[$i][] = $match; } } - $parts = []; - if ($partSeparators) { - foreach ($partMatches as $matches) { - $parts[] = self::groupParts($matches, $partSeparators, false); - } - } else { - foreach ($partMatches as $matches) { - $parts[] = self::unquote($matches[0][0]); - } - - if (!$first && 2 < \count($parts)) { - $parts = [ - $parts[0], - implode($separator, \array_slice($parts, 1)), - ]; + foreach ($partMatches as $matches) { + if ('' === $separators && '' !== $unquoted = self::unquote($matches[0][0])) { + $parts[] = $unquoted; + } elseif ($groupedParts = self::groupParts($matches, $separators, false)) { + $parts[] = $groupedParts; } } diff --git a/api/vendor/symfony/http-foundation/InputBag.php b/api/vendor/symfony/http-foundation/InputBag.php index a9d3cd82af..356fbbc6f5 100644 --- a/api/vendor/symfony/http-foundation/InputBag.php +++ b/api/vendor/symfony/http-foundation/InputBag.php @@ -45,7 +45,7 @@ public function get(string $key, $default = null) /** * {@inheritdoc} */ - public function all(string $key = null): array + public function all(?string $key = null): array { return parent::all($key); } diff --git a/api/vendor/symfony/http-foundation/IpUtils.php b/api/vendor/symfony/http-foundation/IpUtils.php index 2f31284e36..49d9a9d74c 100644 --- a/api/vendor/symfony/http-foundation/IpUtils.php +++ b/api/vendor/symfony/http-foundation/IpUtils.php @@ -73,7 +73,7 @@ public static function checkIp4(?string $requestIp, string $ip) return false; } - $cacheKey = $requestIp.'-'.$ip; + $cacheKey = $requestIp.'-'.$ip.'-v4'; if (isset(self::$checkedIps[$cacheKey])) { return self::$checkedIps[$cacheKey]; } @@ -126,7 +126,7 @@ public static function checkIp6(?string $requestIp, string $ip) return false; } - $cacheKey = $requestIp.'-'.$ip; + $cacheKey = $requestIp.'-'.$ip.'-v6'; if (isset(self::$checkedIps[$cacheKey])) { return self::$checkedIps[$cacheKey]; } diff --git a/api/vendor/symfony/http-foundation/JsonResponse.php b/api/vendor/symfony/http-foundation/JsonResponse.php index 501a6387d9..51bdf1976e 100644 --- a/api/vendor/symfony/http-foundation/JsonResponse.php +++ b/api/vendor/symfony/http-foundation/JsonResponse.php @@ -105,7 +105,7 @@ public static function fromJsonString(string $data, int $status = 200, array $he * * @throws \InvalidArgumentException When the callback name is not valid */ - public function setCallback(string $callback = null) + public function setCallback(?string $callback = null) { if (null !== $callback) { // partially taken from https://geekality.net/2011/08/03/valid-javascript-identifier/ diff --git a/api/vendor/symfony/http-foundation/LICENSE b/api/vendor/symfony/http-foundation/LICENSE index 0083704572..0138f8f071 100644 --- a/api/vendor/symfony/http-foundation/LICENSE +++ b/api/vendor/symfony/http-foundation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present 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/api/vendor/symfony/http-foundation/ParameterBag.php b/api/vendor/symfony/http-foundation/ParameterBag.php index e1f89d69ea..b542292bc8 100644 --- a/api/vendor/symfony/http-foundation/ParameterBag.php +++ b/api/vendor/symfony/http-foundation/ParameterBag.php @@ -39,7 +39,7 @@ public function __construct(array $parameters = []) * * @return array */ - public function all(/* string $key = null */) + public function all(/* ?string $key = null */) { $key = \func_num_args() > 0 ? func_get_arg(0) : null; diff --git a/api/vendor/symfony/http-foundation/RedirectResponse.php b/api/vendor/symfony/http-foundation/RedirectResponse.php index 2103280c60..7b89f0faf6 100644 --- a/api/vendor/symfony/http-foundation/RedirectResponse.php +++ b/api/vendor/symfony/http-foundation/RedirectResponse.php @@ -103,6 +103,7 @@ public function setTargetUrl(string $url) ', htmlspecialchars($url, \ENT_QUOTES, 'UTF-8'))); $this->headers->set('Location', $url); + $this->headers->set('Content-Type', 'text/html; charset=utf-8'); return $this; } diff --git a/api/vendor/symfony/http-foundation/Request.php b/api/vendor/symfony/http-foundation/Request.php index 10f779d279..d1103cf8a0 100644 --- a/api/vendor/symfony/http-foundation/Request.php +++ b/api/vendor/symfony/http-foundation/Request.php @@ -11,6 +11,7 @@ namespace Symfony\Component\HttpFoundation; +use Symfony\Component\HttpFoundation\Exception\BadRequestException; use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; use Symfony\Component\HttpFoundation\Exception\JsonException; use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; @@ -191,7 +192,7 @@ class Request protected $session; /** - * @var string + * @var string|null */ protected $locale; @@ -246,6 +247,9 @@ class Request self::HEADER_X_FORWARDED_PREFIX => 'X_FORWARDED_PREFIX', ]; + /** @var bool */ + private $isIisRewrite = false; + /** * @param array $query The GET parameters * @param array $request The POST parameters @@ -330,6 +334,8 @@ public static function createFromGlobals() * @param string|resource|null $content The raw body data * * @return static + * + * @throws BadRequestException When the URI is invalid */ public static function create(string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], $content = null) { @@ -352,7 +358,20 @@ public static function create(string $uri, string $method = 'GET', array $parame $server['PATH_INFO'] = ''; $server['REQUEST_METHOD'] = strtoupper($method); - $components = parse_url($uri); + if (false === $components = parse_url(\strlen($uri) !== strcspn($uri, '?#') ? $uri : $uri.'#')) { + throw new BadRequestException('Invalid URI.'); + } + + if (false !== ($i = strpos($uri, '\\')) && $i < strcspn($uri, '?#')) { + throw new BadRequestException('Invalid URI: A URI cannot contain a backslash.'); + } + if (\strlen($uri) !== strcspn($uri, "\r\n\t")) { + throw new BadRequestException('Invalid URI: A URI cannot contain CR/LF/TAB characters.'); + } + if ('' !== $uri && (\ord($uri[0]) <= 32 || \ord($uri[-1]) <= 32)) { + throw new BadRequestException('Invalid URI: A URI must not start nor end with ASCII control characters or spaces.'); + } + if (isset($components['host'])) { $server['SERVER_NAME'] = $components['host']; $server['HTTP_HOST'] = $components['host']; @@ -439,16 +458,16 @@ public static function setFactory(?callable $callable) /** * Clones a request and overrides some of its parameters. * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters + * @param array|null $query The GET parameters + * @param array|null $request The POST parameters + * @param array|null $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array|null $cookies The COOKIE parameters + * @param array|null $files The FILES parameters + * @param array|null $server The SERVER parameters * * @return static */ - public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) + public function duplicate(?array $query = null, ?array $request = null, ?array $attributes = null, ?array $cookies = null, ?array $files = null, ?array $server = null) { $dup = clone $this; if (null !== $query) { @@ -1287,7 +1306,7 @@ public function getMethod() } if (!preg_match('/^[A-Z]++$/D', $method)) { - throw new SuspiciousOperationException(sprintf('Invalid method override "%s".', $method)); + throw new SuspiciousOperationException('Invalid HTTP method override.'); } return $this->method = $method; @@ -1452,7 +1471,7 @@ public function setLocale(string $locale) */ public function getLocale() { - return null === $this->locale ? $this->defaultLocale : $this->locale; + return $this->locale ?? $this->defaultLocale; } /** @@ -1573,9 +1592,9 @@ public function getContent(bool $asResource = false) /** * Gets the request body decoded as array, typically from a JSON payload. * - * @throws JsonException When the body cannot be decoded to an array - * * @return array + * + * @throws JsonException When the body cannot be decoded to an array */ public function toArray() { @@ -1648,7 +1667,7 @@ public function getPreferredFormat(?string $default = 'html'): ?string * * @return string|null */ - public function getPreferredLanguage(array $locales = null) + public function getPreferredLanguage(?array $locales = null) { $preferredLanguages = $this->getLanguages(); @@ -1805,11 +1824,10 @@ protected function prepareRequestUri() { $requestUri = ''; - if ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) { + if ($this->isIisRewrite() && '' != $this->server->get('UNENCODED_URL')) { // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem) $requestUri = $this->server->get('UNENCODED_URL'); $this->server->remove('UNENCODED_URL'); - $this->server->remove('IIS_WasUrlRewritten'); } elseif ($this->server->has('REQUEST_URI')) { $requestUri = $this->server->get('REQUEST_URI'); @@ -2012,7 +2030,13 @@ private function setPhpDefaultLocale(string $locale): void */ private function getUrlencodedPrefix(string $string, string $prefix): ?string { - if (!str_starts_with(rawurldecode($string), $prefix)) { + if ($this->isIisRewrite()) { + // ISS with UrlRewriteModule might report SCRIPT_NAME/PHP_SELF with wrong case + // see https://github.com/php/php-src/issues/11981 + if (0 !== stripos(rawurldecode($string), $prefix)) { + return null; + } + } elseif (!str_starts_with(rawurldecode($string), $prefix)) { return null; } @@ -2053,7 +2077,7 @@ public function isFromTrustedProxy() return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR', ''), self::$trustedProxies); } - private function getTrustedValues(int $type, string $ip = null): array + private function getTrustedValues(int $type, ?string $ip = null): array { $clientValues = []; $forwardedValues = []; @@ -2145,4 +2169,20 @@ private function normalizeAndFilterClientIps(array $clientIps, string $ip): arra // Now the IP chain contains only untrusted proxies and the client IP return $clientIps ? array_reverse($clientIps) : [$firstTrustedIp]; } + + /** + * Is this IIS with UrlRewriteModule? + * + * This method consumes, caches and removed the IIS_WasUrlRewritten env var, + * so we don't inherit it to sub-requests. + */ + private function isIisRewrite(): bool + { + if (1 === $this->server->getInt('IIS_WasUrlRewritten')) { + $this->isIisRewrite = true; + $this->server->remove('IIS_WasUrlRewritten'); + } + + return $this->isIisRewrite; + } } diff --git a/api/vendor/symfony/http-foundation/RequestMatcher.php b/api/vendor/symfony/http-foundation/RequestMatcher.php index f2645f9ae9..03ccee97ed 100644 --- a/api/vendor/symfony/http-foundation/RequestMatcher.php +++ b/api/vendor/symfony/http-foundation/RequestMatcher.php @@ -58,7 +58,7 @@ class RequestMatcher implements RequestMatcherInterface * @param string|string[]|null $ips * @param string|string[]|null $schemes */ - public function __construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = [], $schemes = null, int $port = null) + public function __construct(?string $path = null, ?string $host = null, $methods = null, $ips = null, array $attributes = [], $schemes = null, ?int $port = null) { $this->matchPath($path); $this->matchHost($host); @@ -91,7 +91,7 @@ public function matchHost(?string $regexp) } /** - * Adds a check for the the URL port. + * Adds a check for the URL port. * * @param int|null $port The port number to connect to */ diff --git a/api/vendor/symfony/http-foundation/Response.php b/api/vendor/symfony/http-foundation/Response.php index d5c8cb45cd..6798a04c83 100644 --- a/api/vendor/symfony/http-foundation/Response.php +++ b/api/vendor/symfony/http-foundation/Response.php @@ -298,7 +298,7 @@ public function prepare(Request $request) $charset = $this->charset ?: 'UTF-8'; if (!$headers->has('Content-Type')) { $headers->set('Content-Type', 'text/html; charset='.$charset); - } elseif (0 === stripos($headers->get('Content-Type'), 'text/') && false === stripos($headers->get('Content-Type'), 'charset')) { + } elseif (0 === stripos($headers->get('Content-Type') ?? '', 'text/') && false === stripos($headers->get('Content-Type') ?? '', 'charset')) { // add the charset $headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); } @@ -463,7 +463,7 @@ public function getProtocolVersion(): string * * @final */ - public function setStatusCode(int $code, string $text = null): object + public function setStatusCode(int $code, ?string $text = null): object { $this->statusCode = $code; if ($this->isInvalid()) { @@ -737,7 +737,7 @@ public function getExpires(): ?\DateTimeInterface * * @final */ - public function setExpires(\DateTimeInterface $date = null): object + public function setExpires(?\DateTimeInterface $date = null): object { if (null === $date) { $this->headers->remove('Expires'); @@ -774,8 +774,10 @@ public function getMaxAge(): ?int return (int) $this->headers->getCacheControlDirective('max-age'); } - if (null !== $this->getExpires()) { - return (int) $this->getExpires()->format('U') - (int) $this->getDate()->format('U'); + if (null !== $expires = $this->getExpires()) { + $maxAge = (int) $expires->format('U') - (int) $this->getDate()->format('U'); + + return max($maxAge, 0); } return null; @@ -819,7 +821,7 @@ public function setSharedMaxAge(int $value): object * * It returns null when no freshness information is present in the response. * - * When the responses TTL is <= 0, the response may not be served from cache without first + * When the response's TTL is 0, the response may not be served from cache without first * revalidating with the origin. * * @final @@ -828,7 +830,7 @@ public function getTtl(): ?int { $maxAge = $this->getMaxAge(); - return null !== $maxAge ? $maxAge - $this->getAge() : null; + return null !== $maxAge ? max($maxAge - $this->getAge(), 0) : null; } /** @@ -884,7 +886,7 @@ public function getLastModified(): ?\DateTimeInterface * * @final */ - public function setLastModified(\DateTimeInterface $date = null): object + public function setLastModified(?\DateTimeInterface $date = null): object { if (null === $date) { $this->headers->remove('Last-Modified'); @@ -922,7 +924,7 @@ public function getEtag(): ?string * * @final */ - public function setEtag(string $etag = null, bool $weak = false): object + public function setEtag(?string $etag = null, bool $weak = false): object { if (null === $etag) { $this->headers->remove('Etag'); @@ -1215,7 +1217,7 @@ public function isNotFound(): bool * * @final */ - public function isRedirect(string $location = null): bool + public function isRedirect(?string $location = null): bool { return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location')); } diff --git a/api/vendor/symfony/http-foundation/ResponseHeaderBag.php b/api/vendor/symfony/http-foundation/ResponseHeaderBag.php index 1df13fa21b..d4c4f393f8 100644 --- a/api/vendor/symfony/http-foundation/ResponseHeaderBag.php +++ b/api/vendor/symfony/http-foundation/ResponseHeaderBag.php @@ -88,7 +88,7 @@ public function replace(array $headers = []) /** * {@inheritdoc} */ - public function all(string $key = null) + public function all(?string $key = null) { $headers = parent::all(); @@ -186,7 +186,7 @@ public function setCookie(Cookie $cookie) /** * Removes a cookie from the array, but does not unset it in the browser. */ - public function removeCookie(string $name, ?string $path = '/', string $domain = null) + public function removeCookie(string $name, ?string $path = '/', ?string $domain = null) { if (null === $path) { $path = '/'; @@ -239,7 +239,7 @@ public function getCookies(string $format = self::COOKIES_FLAT) /** * Clears a cookie in the browser. */ - public function clearCookie(string $name, ?string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, string $sameSite = null) + public function clearCookie(string $name, ?string $path = '/', ?string $domain = null, bool $secure = false, bool $httpOnly = true, ?string $sameSite = null) { $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite)); } diff --git a/api/vendor/symfony/http-foundation/ServerBag.php b/api/vendor/symfony/http-foundation/ServerBag.php index 25688d5230..831caa67e6 100644 --- a/api/vendor/symfony/http-foundation/ServerBag.php +++ b/api/vendor/symfony/http-foundation/ServerBag.php @@ -31,7 +31,7 @@ public function getHeaders() foreach ($this->parameters as $key => $value) { if (str_starts_with($key, 'HTTP_')) { $headers[substr($key, 5)] = $value; - } elseif (\in_array($key, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true)) { + } elseif (\in_array($key, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true) && '' !== $value) { $headers[$key] = $value; } } @@ -51,7 +51,7 @@ public function getHeaders() * RewriteCond %{HTTP:Authorization} .+ * RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0] * RewriteCond %{REQUEST_FILENAME} !-f - * RewriteRule ^(.*)$ app.php [QSA,L] + * RewriteRule ^(.*)$ index.php [QSA,L] */ $authorizationHeader = null; diff --git a/api/vendor/symfony/http-foundation/Session/Session.php b/api/vendor/symfony/http-foundation/Session/Session.php index 022e3986fe..917920a46c 100644 --- a/api/vendor/symfony/http-foundation/Session/Session.php +++ b/api/vendor/symfony/http-foundation/Session/Session.php @@ -39,7 +39,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable private $usageIndex = 0; private $usageReporter; - public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null, callable $usageReporter = null) + public function __construct(?SessionStorageInterface $storage = null, ?AttributeBagInterface $attributes = null, ?FlashBagInterface $flashes = null, ?callable $usageReporter = null) { $this->storage = $storage ?? new NativeSessionStorage(); $this->usageReporter = $usageReporter; @@ -175,7 +175,7 @@ public function isEmpty(): bool /** * {@inheritdoc} */ - public function invalidate(int $lifetime = null) + public function invalidate(?int $lifetime = null) { $this->storage->clear(); @@ -185,7 +185,7 @@ public function invalidate(int $lifetime = null) /** * {@inheritdoc} */ - public function migrate(bool $destroy = false, int $lifetime = null) + public function migrate(bool $destroy = false, ?int $lifetime = null) { return $this->storage->regenerate($destroy, $lifetime); } diff --git a/api/vendor/symfony/http-foundation/Session/SessionFactory.php b/api/vendor/symfony/http-foundation/Session/SessionFactory.php index 04c4b06a04..bd79282ee1 100644 --- a/api/vendor/symfony/http-foundation/Session/SessionFactory.php +++ b/api/vendor/symfony/http-foundation/Session/SessionFactory.php @@ -26,7 +26,7 @@ class SessionFactory implements SessionFactoryInterface private $storageFactory; private $usageReporter; - public function __construct(RequestStack $requestStack, SessionStorageFactoryInterface $storageFactory, callable $usageReporter = null) + public function __construct(RequestStack $requestStack, SessionStorageFactoryInterface $storageFactory, ?callable $usageReporter = null) { $this->requestStack = $requestStack; $this->storageFactory = $storageFactory; diff --git a/api/vendor/symfony/http-foundation/Session/SessionInterface.php b/api/vendor/symfony/http-foundation/Session/SessionInterface.php index b2f09fd0dc..b73dfd0c38 100644 --- a/api/vendor/symfony/http-foundation/Session/SessionInterface.php +++ b/api/vendor/symfony/http-foundation/Session/SessionInterface.php @@ -59,28 +59,28 @@ public function setName(string $name); * Clears all session attributes and flashes and regenerates the * session and deletes the old session from persistence. * - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. * * @return bool */ - public function invalidate(int $lifetime = null); + public function invalidate(?int $lifetime = null); /** * Migrates the current session to a new session id while maintaining all * session attributes. * - * @param bool $destroy Whether to delete the old session or leave it to garbage collection - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. + * @param bool $destroy Whether to delete the old session or leave it to garbage collection + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. * * @return bool */ - public function migrate(bool $destroy = false, int $lifetime = null); + public function migrate(bool $destroy = false, ?int $lifetime = null); /** * Force the session to be saved and closed. diff --git a/api/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php b/api/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php index 1ca4bfeb08..570d4f4278 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php @@ -19,16 +19,16 @@ class NativeFileSessionHandler extends \SessionHandler { /** - * @param string $savePath Path of directory to save session files - * Default null will leave setting as defined by PHP. - * '/path', 'N;/path', or 'N;octal-mode;/path + * @param string|null $savePath Path of directory to save session files + * Default null will leave setting as defined by PHP. + * '/path', 'N;/path', or 'N;octal-mode;/path * * @see https://php.net/session.configuration#ini.session.save-path for further details. * * @throws \InvalidArgumentException On invalid $savePath * @throws \RuntimeException When failing to create the save directory */ - public function __construct(string $savePath = null) + public function __construct(?string $savePath = null) { if (null === $savePath) { $savePath = \ini_get('session.save_path'); @@ -49,7 +49,11 @@ public function __construct(string $savePath = null) throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s".', $baseDir)); } - ini_set('session.save_path', $savePath); - ini_set('session.save_handler', 'files'); + if ($savePath !== \ini_get('session.save_path')) { + ini_set('session.save_path', $savePath); + } + if ('files' !== \ini_get('session.save_handler')) { + ini_set('session.save_handler', 'files'); + } } } diff --git a/api/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/api/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php index 24c98940dc..f9c5d9b59d 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php @@ -112,16 +112,16 @@ class PdoSessionHandler extends AbstractSessionHandler /** * Username when lazy-connect. * - * @var string + * @var string|null */ - private $username = ''; + private $username = null; /** * Password when lazy-connect. * - * @var string + * @var string|null */ - private $password = ''; + private $password = null; /** * Connection options when lazy-connect. @@ -397,8 +397,8 @@ public function updateTimestamp($sessionId, $data) $updateStmt = $this->pdo->prepare( "UPDATE $this->table SET $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id" ); - $updateStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); - $updateStmt->bindParam(':expiry', $expiry, \PDO::PARAM_INT); + $updateStmt->bindValue(':id', $sessionId, \PDO::PARAM_STR); + $updateStmt->bindValue(':expiry', $expiry, \PDO::PARAM_INT); $updateStmt->bindValue(':time', time(), \PDO::PARAM_INT); $updateStmt->execute(); } catch (\PDOException $e) { @@ -530,8 +530,8 @@ private function buildDsnFromUrl(string $dsnOrUrl): string return $dsn; } } - // If "unix_socket" is not in the query, we continue with the same process as pgsql - // no break + // If "unix_socket" is not in the query, we continue with the same process as pgsql + // no break case 'pgsql': $dsn ?? $dsn = 'pgsql:'; diff --git a/api/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php b/api/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php index f3f7b201d9..76e4373f83 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php @@ -11,7 +11,10 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; +use Doctrine\DBAL\Configuration; use Doctrine\DBAL\DriverManager; +use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory; +use Doctrine\DBAL\Tools\DsnParser; use Symfony\Component\Cache\Adapter\AbstractAdapter; use Symfony\Component\Cache\Traits\RedisClusterProxy; use Symfony\Component\Cache\Traits\RedisProxy; @@ -60,7 +63,7 @@ public static function createHandler($connection): AbstractSessionHandler case str_starts_with($connection, 'rediss:'): case str_starts_with($connection, 'memcached:'): if (!class_exists(AbstractAdapter::class)) { - throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require symfony/cache".', $connection)); + throw new \InvalidArgumentException('Unsupported Redis or Memcached DSN. Try running "composer require symfony/cache".'); } $handlerClass = str_starts_with($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class; $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]); @@ -69,9 +72,18 @@ public static function createHandler($connection): AbstractSessionHandler case str_starts_with($connection, 'pdo_oci://'): if (!class_exists(DriverManager::class)) { - throw new \InvalidArgumentException(sprintf('Unsupported DSN "%s". Try running "composer require doctrine/dbal".', $connection)); + throw new \InvalidArgumentException('Unsupported PDO OCI DSN. Try running "composer require doctrine/dbal".'); } - $connection = DriverManager::getConnection(['url' => $connection])->getWrappedConnection(); + $connection[3] = '-'; + $params = class_exists(DsnParser::class) ? (new DsnParser())->parse($connection) : ['url' => $connection]; + $config = new Configuration(); + if (class_exists(DefaultSchemaManagerFactory::class)) { + $config->setSchemaManagerFactory(new DefaultSchemaManagerFactory()); + } + + $connection = DriverManager::getConnection($params, $config); + // The condition should be removed once support for DBAL <3.3 is dropped + $connection = method_exists($connection, 'getNativeConnection') ? $connection->getNativeConnection() : $connection->getWrappedConnection(); // no break; case str_starts_with($connection, 'mssql://'): diff --git a/api/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/api/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php index 595a9e23c2..3e10f6dbcd 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php @@ -95,12 +95,12 @@ public function getLifetime() /** * Stamps a new session's metadata. * - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. */ - public function stampNew(int $lifetime = null) + public function stampNew(?int $lifetime = null) { $this->stampCreated($lifetime); } @@ -158,7 +158,7 @@ public function setName(string $name) $this->name = $name; } - private function stampCreated(int $lifetime = null): void + private function stampCreated(?int $lifetime = null): void { $timeStamp = time(); $this->meta[self::CREATED] = $this->meta[self::UPDATED] = $this->lastUsed = $timeStamp; diff --git a/api/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/api/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php index c5c2bb0731..c6a28b1a4c 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php @@ -62,7 +62,7 @@ class MockArraySessionStorage implements SessionStorageInterface */ protected $bags = []; - public function __construct(string $name = 'MOCKSESSID', MetadataBag $metaBag = null) + public function __construct(string $name = 'MOCKSESSID', ?MetadataBag $metaBag = null) { $this->name = $name; $this->setMetadataBag($metaBag); @@ -94,7 +94,7 @@ public function start() /** * {@inheritdoc} */ - public function regenerate(bool $destroy = false, int $lifetime = null) + public function regenerate(bool $destroy = false, ?int $lifetime = null) { if (!$this->started) { $this->start(); @@ -204,7 +204,7 @@ public function isStarted() return $this->started; } - public function setMetadataBag(MetadataBag $bag = null) + public function setMetadataBag(?MetadataBag $bag = null) { if (null === $bag) { $bag = new MetadataBag(); @@ -226,14 +226,11 @@ public function getMetadataBag() /** * Generates a session ID. * - * This doesn't need to be particularly cryptographically secure since this is just - * a mock. - * * @return string */ protected function generateId() { - return hash('sha256', uniqid('ss_mock_', true)); + return bin2hex(random_bytes(16)); } protected function loadSession() diff --git a/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php b/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php index 8e32a45e38..8aeb9724c1 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php @@ -30,7 +30,7 @@ class MockFileSessionStorage extends MockArraySessionStorage /** * @param string|null $savePath Path of directory to save session files */ - public function __construct(string $savePath = null, string $name = 'MOCKSESSID', MetadataBag $metaBag = null) + public function __construct(?string $savePath = null, string $name = 'MOCKSESSID', ?MetadataBag $metaBag = null) { if (null === $savePath) { $savePath = sys_get_temp_dir(); @@ -68,7 +68,7 @@ public function start() /** * {@inheritdoc} */ - public function regenerate(bool $destroy = false, int $lifetime = null) + public function regenerate(bool $destroy = false, ?int $lifetime = null) { if (!$this->started) { $this->start(); diff --git a/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php b/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php index d0da1e1692..900fa7cfa0 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php @@ -28,7 +28,7 @@ class MockFileSessionStorageFactory implements SessionStorageFactoryInterface /** * @see MockFileSessionStorage constructor. */ - public function __construct(string $savePath = null, string $name = 'MOCKSESSID', MetadataBag $metaBag = null) + public function __construct(?string $savePath = null, string $name = 'MOCKSESSID', ?MetadataBag $metaBag = null) { $this->savePath = $savePath; $this->name = $name; diff --git a/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php index a50c8270fe..e7b42ed0b9 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php @@ -97,7 +97,7 @@ class NativeSessionStorage implements SessionStorageInterface * * @param AbstractProxy|\SessionHandlerInterface|null $handler */ - public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null) + public function __construct(array $options = [], $handler = null, ?MetadataBag $metaBag = null) { if (!\extension_loaded('session')) { throw new \LogicException('PHP extension "session" is required.'); @@ -233,7 +233,7 @@ public function setName(string $name) /** * {@inheritdoc} */ - public function regenerate(bool $destroy = false, int $lifetime = null) + public function regenerate(bool $destroy = false, ?int $lifetime = null) { // Cannot regenerate the session ID for non-active sessions. if (\PHP_SESSION_ACTIVE !== session_status()) { @@ -355,7 +355,7 @@ public function getBag(string $name) return $this->bags[$name]; } - public function setMetadataBag(MetadataBag $metaBag = null) + public function setMetadataBag(?MetadataBag $metaBag = null) { if (null === $metaBag) { $metaBag = new MetadataBag(); @@ -455,9 +455,10 @@ public function setOptions(array $options) */ public function setSaveHandler($saveHandler = null) { - if (!$saveHandler instanceof AbstractProxy && - !$saveHandler instanceof \SessionHandlerInterface && - null !== $saveHandler) { + if (!$saveHandler instanceof AbstractProxy + && !$saveHandler instanceof \SessionHandlerInterface + && null !== $saveHandler + ) { throw new \InvalidArgumentException('Must be instance of AbstractProxy; implement \SessionHandlerInterface; or be null.'); } @@ -486,7 +487,7 @@ public function setSaveHandler($saveHandler = null) * PHP takes the return value from the read() handler, unserializes it * and populates $_SESSION with the result automatically. */ - protected function loadSession(array &$session = null) + protected function loadSession(?array &$session = null) { if (null === $session) { $session = &$_SESSION; diff --git a/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php b/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php index a7d7411ff3..48e65267ed 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php @@ -29,7 +29,7 @@ class NativeSessionStorageFactory implements SessionStorageFactoryInterface /** * @see NativeSessionStorage constructor. */ - public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null, bool $secure = false) + public function __construct(array $options = [], $handler = null, ?MetadataBag $metaBag = null, bool $secure = false) { $this->options = $options; $this->handler = $handler; diff --git a/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php b/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php index 72dbef1346..855d5e111b 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php @@ -23,7 +23,7 @@ class PhpBridgeSessionStorage extends NativeSessionStorage /** * @param AbstractProxy|\SessionHandlerInterface|null $handler */ - public function __construct($handler = null, MetadataBag $metaBag = null) + public function __construct($handler = null, ?MetadataBag $metaBag = null) { if (!\extension_loaded('session')) { throw new \LogicException('PHP extension "session" is required.'); diff --git a/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php b/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php index 173ef71dea..aa9326322f 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php @@ -28,7 +28,7 @@ class PhpBridgeSessionStorageFactory implements SessionStorageFactoryInterface /** * @see PhpBridgeSessionStorage constructor. */ - public function __construct($handler = null, MetadataBag $metaBag = null, bool $secure = false) + public function __construct($handler = null, ?MetadataBag $metaBag = null, bool $secure = false) { $this->handler = $handler; $this->metaBag = $metaBag; diff --git a/api/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php b/api/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php index b7f66e7c73..70b7c6a159 100644 --- a/api/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php +++ b/api/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php @@ -80,17 +80,17 @@ public function setName(string $name); * Otherwise session data could get lost again for concurrent requests with the * new ID. One result could be that you get logged out after just logging in. * - * @param bool $destroy Destroy session when regenerating? - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value - * will leave the system settings unchanged, 0 sets the cookie - * to expire with browser session. Time is in seconds, and is - * not a Unix timestamp. + * @param bool $destroy Destroy session when regenerating? + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. * * @return bool * * @throws \RuntimeException If an error occurs while regenerating this storage */ - public function regenerate(bool $destroy = false, int $lifetime = null); + public function regenerate(bool $destroy = false, ?int $lifetime = null); /** * Force the session to be saved and closed. diff --git a/api/vendor/symfony/http-foundation/StreamedResponse.php b/api/vendor/symfony/http-foundation/StreamedResponse.php index 676cd66875..b42330dcd4 100644 --- a/api/vendor/symfony/http-foundation/StreamedResponse.php +++ b/api/vendor/symfony/http-foundation/StreamedResponse.php @@ -30,7 +30,7 @@ class StreamedResponse extends Response protected $streamed; private $headersSent; - public function __construct(callable $callback = null, int $status = 200, array $headers = []) + public function __construct(?callable $callback = null, int $status = 200, array $headers = []) { parent::__construct(null, $status, $headers); @@ -114,9 +114,9 @@ public function sendContent() /** * {@inheritdoc} * - * @throws \LogicException when the content is not null - * * @return $this + * + * @throws \LogicException when the content is not null */ public function setContent(?string $content) { diff --git a/api/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php b/api/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php index eb9c26a3b7..939925b981 100644 --- a/api/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php +++ b/api/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php @@ -22,7 +22,7 @@ final class ResponseCookieValueSame extends Constraint private $path; private $domain; - public function __construct(string $name, string $value, string $path = '/', string $domain = null) + public function __construct(string $name, string $value, string $path = '/', ?string $domain = null) { $this->name = $name; $this->value = $value; diff --git a/api/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php b/api/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php index eae9e271bc..9d6e58c8d0 100644 --- a/api/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php +++ b/api/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php @@ -21,7 +21,7 @@ final class ResponseHasCookie extends Constraint private $path; private $domain; - public function __construct(string $name, string $path = '/', string $domain = null) + public function __construct(string $name, string $path = '/', ?string $domain = null) { $this->name = $name; $this->path = $path; diff --git a/api/vendor/symfony/http-foundation/UrlHelper.php b/api/vendor/symfony/http-foundation/UrlHelper.php index c15f101cdf..90659947db 100644 --- a/api/vendor/symfony/http-foundation/UrlHelper.php +++ b/api/vendor/symfony/http-foundation/UrlHelper.php @@ -12,6 +12,7 @@ namespace Symfony\Component\HttpFoundation; use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\RequestContextAwareInterface; /** * A helper service for manipulating URLs within and outside the request scope. @@ -23,8 +24,15 @@ final class UrlHelper private $requestStack; private $requestContext; - public function __construct(RequestStack $requestStack, RequestContext $requestContext = null) + /** + * @param RequestContextAwareInterface|RequestContext|null $requestContext + */ + public function __construct(RequestStack $requestStack, $requestContext = null) { + if (null !== $requestContext && !$requestContext instanceof RequestContext && !$requestContext instanceof RequestContextAwareInterface) { + throw new \TypeError(__METHOD__.': Argument #2 ($requestContext) must of type Symfony\Component\Routing\RequestContextAwareInterface|Symfony\Component\Routing\RequestContext|null, '.get_debug_type($requestContext).' given.'); + } + $this->requestStack = $requestStack; $this->requestContext = $requestContext; } @@ -73,28 +81,36 @@ public function getRelativePath(string $path): string private function getAbsoluteUrlFromContext(string $path): string { - if (null === $this->requestContext || '' === $host = $this->requestContext->getHost()) { + if (null === $context = $this->requestContext) { + return $path; + } + + if ($context instanceof RequestContextAwareInterface) { + $context = $context->getContext(); + } + + if ('' === $host = $context->getHost()) { return $path; } - $scheme = $this->requestContext->getScheme(); + $scheme = $context->getScheme(); $port = ''; - if ('http' === $scheme && 80 !== $this->requestContext->getHttpPort()) { - $port = ':'.$this->requestContext->getHttpPort(); - } elseif ('https' === $scheme && 443 !== $this->requestContext->getHttpsPort()) { - $port = ':'.$this->requestContext->getHttpsPort(); + if ('http' === $scheme && 80 !== $context->getHttpPort()) { + $port = ':'.$context->getHttpPort(); + } elseif ('https' === $scheme && 443 !== $context->getHttpsPort()) { + $port = ':'.$context->getHttpsPort(); } if ('#' === $path[0]) { - $queryString = $this->requestContext->getQueryString(); - $path = $this->requestContext->getPathInfo().($queryString ? '?'.$queryString : '').$path; + $queryString = $context->getQueryString(); + $path = $context->getPathInfo().($queryString ? '?'.$queryString : '').$path; } elseif ('?' === $path[0]) { - $path = $this->requestContext->getPathInfo().$path; + $path = $context->getPathInfo().$path; } if ('/' !== $path[0]) { - $path = rtrim($this->requestContext->getBaseUrl(), '/').'/'.$path; + $path = rtrim($context->getBaseUrl(), '/').'/'.$path; } return $scheme.'://'.$host.$port.$path; diff --git a/api/vendor/symfony/http-foundation/composer.json b/api/vendor/symfony/http-foundation/composer.json index cb8d59ffed..a2e43a99cf 100644 --- a/api/vendor/symfony/http-foundation/composer.json +++ b/api/vendor/symfony/http-foundation/composer.json @@ -22,7 +22,7 @@ "symfony/polyfill-php80": "^1.16" }, "require-dev": { - "predis/predis": "~1.0", + "predis/predis": "^1.0|^2.0", "symfony/cache": "^4.4|^5.0|^6.0", "symfony/dependency-injection": "^5.4|^6.0", "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", diff --git a/api/vendor/symfony/mime/Crypto/SMimeEncrypter.php b/api/vendor/symfony/mime/Crypto/SMimeEncrypter.php index 9081860d80..e92b37b19a 100644 --- a/api/vendor/symfony/mime/Crypto/SMimeEncrypter.php +++ b/api/vendor/symfony/mime/Crypto/SMimeEncrypter.php @@ -26,7 +26,7 @@ final class SMimeEncrypter extends SMime * @param string|string[] $certificate The path (or array of paths) of the file(s) containing the X.509 certificate(s) * @param int|null $cipher A set of algorithms used to encrypt the message. Must be one of these PHP constants: https://www.php.net/manual/en/openssl.ciphers.php */ - public function __construct($certificate, int $cipher = null) + public function __construct($certificate, ?int $cipher = null) { if (!\extension_loaded('openssl')) { throw new \LogicException('PHP extension "openssl" is required to use SMime.'); diff --git a/api/vendor/symfony/mime/Crypto/SMimeSigner.php b/api/vendor/symfony/mime/Crypto/SMimeSigner.php index 5b94a454e8..94c2bbd672 100644 --- a/api/vendor/symfony/mime/Crypto/SMimeSigner.php +++ b/api/vendor/symfony/mime/Crypto/SMimeSigner.php @@ -31,7 +31,7 @@ final class SMimeSigner extends SMime * @param string|null $extraCerts The path of the file containing intermediate certificates (in PEM format) needed by the signing certificate * @param int|null $signOptions Bitwise operator options for openssl_pkcs7_sign() (@see https://secure.php.net/manual/en/openssl.pkcs7.flags.php) */ - public function __construct(string $certificate, string $privateKey, string $privateKeyPassphrase = null, string $extraCerts = null, int $signOptions = null) + public function __construct(string $certificate, string $privateKey, ?string $privateKeyPassphrase = null, ?string $extraCerts = null, ?int $signOptions = null) { if (!\extension_loaded('openssl')) { throw new \LogicException('PHP extension "openssl" is required to use SMime.'); diff --git a/api/vendor/symfony/mime/Email.php b/api/vendor/symfony/mime/Email.php index bd0a476c4f..5365294a4d 100644 --- a/api/vendor/symfony/mime/Email.php +++ b/api/vendor/symfony/mime/Email.php @@ -121,6 +121,10 @@ public function addFrom(...$addresses) */ public function from(...$addresses) { + if (!$addresses) { + throw new LogicException('"from()" must be called with at least one address.'); + } + return $this->setListAddressHeaderBody('From', $addresses); } @@ -342,7 +346,7 @@ public function getHtmlCharset(): ?string * * @return $this */ - public function attach($body, string $name = null, string $contentType = null) + public function attach($body, ?string $name = null, ?string $contentType = null) { if (!\is_string($body) && !\is_resource($body)) { throw new \TypeError(sprintf('The body must be a string or a resource (got "%s").', get_debug_type($body))); @@ -357,7 +361,7 @@ public function attach($body, string $name = null, string $contentType = null) /** * @return $this */ - public function attachFromPath(string $path, string $name = null, string $contentType = null) + public function attachFromPath(string $path, ?string $name = null, ?string $contentType = null) { $this->cachedBody = null; $this->attachments[] = ['path' => $path, 'name' => $name, 'content-type' => $contentType, 'inline' => false]; @@ -370,7 +374,7 @@ public function attachFromPath(string $path, string $name = null, string $conten * * @return $this */ - public function embed($body, string $name = null, string $contentType = null) + public function embed($body, ?string $name = null, ?string $contentType = null) { if (!\is_string($body) && !\is_resource($body)) { throw new \TypeError(sprintf('The body must be a string or a resource (got "%s").', get_debug_type($body))); @@ -385,7 +389,7 @@ public function embed($body, string $name = null, string $contentType = null) /** * @return $this */ - public function embedFromPath(string $path, string $name = null, string $contentType = null) + public function embedFromPath(string $path, ?string $name = null, ?string $contentType = null) { $this->cachedBody = null; $this->attachments[] = ['path' => $path, 'name' => $name, 'content-type' => $contentType, 'inline' => true]; diff --git a/api/vendor/symfony/mime/FileinfoMimeTypeGuesser.php b/api/vendor/symfony/mime/FileinfoMimeTypeGuesser.php index c6c7559af1..1208976bab 100644 --- a/api/vendor/symfony/mime/FileinfoMimeTypeGuesser.php +++ b/api/vendor/symfony/mime/FileinfoMimeTypeGuesser.php @@ -24,11 +24,11 @@ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface private $magicFile; /** - * @param string $magicFile A magic file to use with the finfo instance + * @param string|null $magicFile A magic file to use with the finfo instance * * @see http://www.php.net/manual/en/function.finfo-open.php */ - public function __construct(string $magicFile = null) + public function __construct(?string $magicFile = null) { $this->magicFile = $magicFile; } diff --git a/api/vendor/symfony/mime/Header/AbstractHeader.php b/api/vendor/symfony/mime/Header/AbstractHeader.php index 5de9066873..2670367531 100644 --- a/api/vendor/symfony/mime/Header/AbstractHeader.php +++ b/api/vendor/symfony/mime/Header/AbstractHeader.php @@ -180,6 +180,20 @@ protected function getEncodableWordTokens(string $string): array $tokens[] = $encodedToken; } + foreach ($tokens as $i => $token) { + // whitespace(s) between 2 encoded tokens + if ( + 0 < $i + && isset($tokens[$i + 1]) + && preg_match('~^[\t ]+$~', $token) + && $this->tokenNeedsEncoding($tokens[$i - 1]) + && $this->tokenNeedsEncoding($tokens[$i + 1]) + ) { + $tokens[$i - 1] .= $token.$tokens[$i + 1]; + array_splice($tokens, $i, 2); + } + } + return $tokens; } @@ -231,7 +245,7 @@ protected function generateTokenLines(string $token): array /** * Generate a list of all tokens in the final header. */ - protected function toTokens(string $string = null): array + protected function toTokens(?string $string = null): array { if (null === $string) { $string = $this->getBodyAsString(); diff --git a/api/vendor/symfony/mime/Header/Headers.php b/api/vendor/symfony/mime/Header/Headers.php index 8db912520a..b1ebf9a2c0 100644 --- a/api/vendor/symfony/mime/Header/Headers.php +++ b/api/vendor/symfony/mime/Header/Headers.php @@ -190,7 +190,7 @@ public function get(string $name): ?HeaderInterface return array_shift($values); } - public function all(string $name = null): iterable + public function all(?string $name = null): iterable { if (null === $name) { foreach ($this->headers as $name => $collection) { diff --git a/api/vendor/symfony/mime/Header/MailboxListHeader.php b/api/vendor/symfony/mime/Header/MailboxListHeader.php index 1d00fdb12c..ee2a26cf2f 100644 --- a/api/vendor/symfony/mime/Header/MailboxListHeader.php +++ b/api/vendor/symfony/mime/Header/MailboxListHeader.php @@ -44,9 +44,9 @@ public function setBody($body) } /** - * @throws RfcComplianceException - * * @return Address[] + * + * @throws RfcComplianceException */ public function getBody(): array { @@ -99,9 +99,9 @@ public function getAddresses(): array /** * Gets the full mailbox list of this Header as an array of valid RFC 2822 strings. * - * @throws RfcComplianceException - * * @return string[] + * + * @throws RfcComplianceException */ public function getAddressStrings(): array { diff --git a/api/vendor/symfony/mime/Header/ParameterizedHeader.php b/api/vendor/symfony/mime/Header/ParameterizedHeader.php index e5d4238b47..22f46a8fac 100644 --- a/api/vendor/symfony/mime/Header/ParameterizedHeader.php +++ b/api/vendor/symfony/mime/Header/ParameterizedHeader.php @@ -85,7 +85,7 @@ public function getBodyAsString(): string * This doesn't need to be overridden in theory, but it is for implementation * reasons to prevent potential breakage of attributes. */ - protected function toTokens(string $string = null): array + protected function toTokens(?string $string = null): array { $tokens = parent::toTokens(parent::getBodyAsString()); diff --git a/api/vendor/symfony/mime/LICENSE b/api/vendor/symfony/mime/LICENSE index 58b42bc8a9..4dd83ce0f1 100644 --- a/api/vendor/symfony/mime/LICENSE +++ b/api/vendor/symfony/mime/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2010-2023 Fabien Potencier +Copyright (c) 2010-present 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/api/vendor/symfony/mime/Message.php b/api/vendor/symfony/mime/Message.php index 651ffd4529..df7ed1b794 100644 --- a/api/vendor/symfony/mime/Message.php +++ b/api/vendor/symfony/mime/Message.php @@ -24,7 +24,7 @@ class Message extends RawMessage private $headers; private $body; - public function __construct(Headers $headers = null, AbstractPart $body = null) + public function __construct(?Headers $headers = null, ?AbstractPart $body = null) { $this->headers = $headers ? clone $headers : new Headers(); $this->body = $body; @@ -42,7 +42,7 @@ public function __clone() /** * @return $this */ - public function setBody(AbstractPart $body = null) + public function setBody(?AbstractPart $body = null) { $this->body = $body; @@ -124,11 +124,18 @@ public function toIterable(): iterable public function ensureValidity() { - if (!$this->headers->has('To') && !$this->headers->has('Cc') && !$this->headers->has('Bcc')) { + $to = (null !== $header = $this->headers->get('To')) ? $header->getBody() : null; + $cc = (null !== $header = $this->headers->get('Cc')) ? $header->getBody() : null; + $bcc = (null !== $header = $this->headers->get('Bcc')) ? $header->getBody() : null; + + if (!$to && !$cc && !$bcc) { throw new LogicException('An email must have a "To", "Cc", or "Bcc" header.'); } - if (!$this->headers->has('From') && !$this->headers->has('Sender')) { + $from = (null !== $header = $this->headers->get('From')) ? $header->getBody() : null; + $sender = (null !== $header = $this->headers->get('Sender')) ? $header->getBody() : null; + + if (!$from && !$sender) { throw new LogicException('An email must have a "From" or a "Sender" header.'); } @@ -140,7 +147,10 @@ public function generateMessageId(): string if ($this->headers->has('Sender')) { $sender = $this->headers->get('Sender')->getAddress(); } elseif ($this->headers->has('From')) { - $sender = $this->headers->get('From')->getAddresses()[0]; + if (!$froms = $this->headers->get('From')->getAddresses()) { + throw new LogicException('A "From" header must have at least one email address.'); + } + $sender = $froms[0]; } else { throw new LogicException('An email must have a "From" or a "Sender" header.'); } diff --git a/api/vendor/symfony/mime/Part/DataPart.php b/api/vendor/symfony/mime/Part/DataPart.php index 4247ce798d..3219df404e 100644 --- a/api/vendor/symfony/mime/Part/DataPart.php +++ b/api/vendor/symfony/mime/Part/DataPart.php @@ -33,7 +33,7 @@ class DataPart extends TextPart /** * @param resource|string $body */ - public function __construct($body, string $filename = null, string $contentType = null, string $encoding = null) + public function __construct($body, ?string $filename = null, ?string $contentType = null, ?string $encoding = null) { unset($this->_parent); @@ -51,7 +51,7 @@ public function __construct($body, string $filename = null, string $contentType $this->setDisposition('attachment'); } - public static function fromPath(string $path, string $name = null, string $contentType = null): self + public static function fromPath(string $path, ?string $name = null, ?string $contentType = null): self { if (null === $contentType) { $ext = strtolower(substr($path, strrpos($path, '.') + 1)); diff --git a/api/vendor/symfony/mime/Part/Multipart/FormDataPart.php b/api/vendor/symfony/mime/Part/Multipart/FormDataPart.php index ff6df818f4..e3c9afc045 100644 --- a/api/vendor/symfony/mime/Part/Multipart/FormDataPart.php +++ b/api/vendor/symfony/mime/Part/Multipart/FormDataPart.php @@ -58,7 +58,7 @@ private function prepareFields(array $fields): array $values = []; $prepare = function ($item, $key, $root = null) use (&$values, &$prepare) { - if (\is_int($key) && \is_array($item)) { + if (null === $root && \is_int($key) && \is_array($item)) { if (1 !== \count($item)) { throw new InvalidArgumentException(sprintf('Form field values with integer keys can only have one array element, the key being the field name and the value being the field value, %d provided.', \count($item))); } diff --git a/api/vendor/symfony/mime/Part/TextPart.php b/api/vendor/symfony/mime/Part/TextPart.php index bfe41c0aab..fe9ca02225 100644 --- a/api/vendor/symfony/mime/Part/TextPart.php +++ b/api/vendor/symfony/mime/Part/TextPart.php @@ -42,7 +42,7 @@ class TextPart extends AbstractPart /** * @param resource|string $body */ - public function __construct($body, ?string $charset = 'utf-8', string $subtype = 'plain', string $encoding = null) + public function __construct($body, ?string $charset = 'utf-8', string $subtype = 'plain', ?string $encoding = null) { unset($this->_headers); diff --git a/api/vendor/symfony/mime/RawMessage.php b/api/vendor/symfony/mime/RawMessage.php index d2a311daeb..ace19601ea 100644 --- a/api/vendor/symfony/mime/RawMessage.php +++ b/api/vendor/symfony/mime/RawMessage.php @@ -18,6 +18,9 @@ */ class RawMessage implements \Serializable { + /** + * @var iterable|string + */ private $message; /** diff --git a/api/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php b/api/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php index c0adbe3a0c..3243ec608a 100644 --- a/api/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php +++ b/api/vendor/symfony/mime/Test/Constraint/EmailAttachmentCount.php @@ -20,7 +20,7 @@ final class EmailAttachmentCount extends Constraint private $expectedValue; private $transport; - public function __construct(int $expectedValue, string $transport = null) + public function __construct(int $expectedValue, ?string $transport = null) { $this->expectedValue = $expectedValue; $this->transport = $transport; diff --git a/api/vendor/symfony/mime/composer.json b/api/vendor/symfony/mime/composer.json index 5472deab1a..3bb6095582 100644 --- a/api/vendor/symfony/mime/composer.json +++ b/api/vendor/symfony/mime/composer.json @@ -26,16 +26,17 @@ "egulias/email-validator": "^2.1.10|^3.1|^4", "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/process": "^5.4|^6.4", "symfony/property-access": "^4.4|^5.1|^6.0", "symfony/property-info": "^4.4|^5.1|^6.0", - "symfony/serializer": "^5.4.14|~6.0.14|^6.1.6" + "symfony/serializer": "^5.4.35|~6.3.12|^6.4.3" }, "conflict": { "egulias/email-validator": "~3.0.0", "phpdocumentor/reflection-docblock": "<3.2.2", "phpdocumentor/type-resolver": "<1.4.0", "symfony/mailer": "<4.4", - "symfony/serializer": "<5.4.14|>=6.0,<6.0.14|>=6.1,<6.1.6" + "symfony/serializer": "<5.4.35|>=6,<6.3.12|>=6.4,<6.4.3" }, "autoload": { "psr-4": { "Symfony\\Component\\Mime\\": "" }, diff --git a/api/vendor/symfony/polyfill-ctype/LICENSE b/api/vendor/symfony/polyfill-ctype/LICENSE index 3f853aaf35..7536caeae8 100644 --- a/api/vendor/symfony/polyfill-ctype/LICENSE +++ b/api/vendor/symfony/polyfill-ctype/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present 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/api/vendor/symfony/polyfill-ctype/composer.json b/api/vendor/symfony/polyfill-ctype/composer.json index 1b3efff572..131ca7adba 100644 --- a/api/vendor/symfony/polyfill-ctype/composer.json +++ b/api/vendor/symfony/polyfill-ctype/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -30,9 +30,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/api/vendor/symfony/polyfill-intl-grapheme/LICENSE b/api/vendor/symfony/polyfill-intl-grapheme/LICENSE index 4cd8bdd300..6e3afce692 100644 --- a/api/vendor/symfony/polyfill-intl-grapheme/LICENSE +++ b/api/vendor/symfony/polyfill-intl-grapheme/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present 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/api/vendor/symfony/polyfill-intl-grapheme/composer.json b/api/vendor/symfony/polyfill-intl-grapheme/composer.json index fde5537fc0..0eea417d74 100644 --- a/api/vendor/symfony/polyfill-intl-grapheme/composer.json +++ b/api/vendor/symfony/polyfill-intl-grapheme/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, @@ -27,9 +27,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/api/vendor/symfony/polyfill-intl-idn/Idn.php b/api/vendor/symfony/polyfill-intl-idn/Idn.php index 86710b94e5..334f8ee70b 100644 --- a/api/vendor/symfony/polyfill-intl-idn/Idn.php +++ b/api/vendor/symfony/polyfill-intl-idn/Idn.php @@ -11,8 +11,6 @@ namespace Symfony\Polyfill\Intl\Idn; -use Exception; -use Normalizer; use Symfony\Polyfill\Intl\Idn\Resources\unidata\DisallowedRanges; use Symfony\Polyfill\Intl\Idn\Resources\unidata\Regex; @@ -147,7 +145,7 @@ final class Idn */ public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { + if (self::INTL_IDNA_VARIANT_2003 === $variant) { @trigger_error('idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); } @@ -167,7 +165,7 @@ public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, if (1 === preg_match('/[^\x00-\x7F]/', $label)) { try { $label = 'xn--'.self::punycodeEncode($label); - } catch (Exception $e) { + } catch (\Exception $e) { $info->errors |= self::ERROR_PUNYCODE; } @@ -200,7 +198,7 @@ public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, */ public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::INTL_IDNA_VARIANT_UTS46, &$idna_info = []) { - if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) { + if (self::INTL_IDNA_VARIANT_2003 === $variant) { @trigger_error('idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated', \E_USER_DEPRECATED); } @@ -282,10 +280,6 @@ private static function mapCodePoints($input, array $options, Info $info) switch ($data['status']) { case 'disallowed': - $info->errors |= self::ERROR_DISALLOWED; - - // no break. - case 'valid': $str .= mb_chr($codePoint, 'utf-8'); @@ -296,7 +290,7 @@ private static function mapCodePoints($input, array $options, Info $info) break; case 'mapped': - $str .= $data['mapping']; + $str .= $transitional && 0x1E9E === $codePoint ? 'ss' : $data['mapping']; break; @@ -335,8 +329,8 @@ private static function process($domain, array $options, Info $info) $domain = self::mapCodePoints($domain, $options, $info); // Step 2. Normalize the domain name string to Unicode Normalization Form C. - if (!Normalizer::isNormalized($domain, Normalizer::FORM_C)) { - $domain = Normalizer::normalize($domain, Normalizer::FORM_C); + if (!\Normalizer::isNormalized($domain, \Normalizer::FORM_C)) { + $domain = \Normalizer::normalize($domain, \Normalizer::FORM_C); } // Step 3. Break the string into labels at U+002E (.) FULL STOP. @@ -348,9 +342,21 @@ private static function process($domain, array $options, Info $info) $validationOptions = $options; if ('xn--' === substr($label, 0, 4)) { + // Step 4.1. If the label contains any non-ASCII code point (i.e., a code point greater than U+007F), + // record that there was an error, and continue with the next label. + if (preg_match('/[^\x00-\x7F]/', $label)) { + $info->errors |= self::ERROR_PUNYCODE; + + continue; + } + + // Step 4.2. Attempt to convert the rest of the label to Unicode according to Punycode [RFC3492]. If + // that conversion fails, record that there was an error, and continue + // with the next label. Otherwise replace the original label in the string by the results of the + // conversion. try { $label = self::punycodeDecode(substr($label, 4)); - } catch (Exception $e) { + } catch (\Exception $e) { $info->errors |= self::ERROR_PUNYCODE; continue; @@ -496,7 +502,7 @@ private static function validateLabel($label, Info $info, array $options, $canBe } // Step 1. The label must be in Unicode Normalization Form C. - if (!Normalizer::isNormalized($label, Normalizer::FORM_C)) { + if (!\Normalizer::isNormalized($label, \Normalizer::FORM_C)) { $info->errors |= self::ERROR_INVALID_ACE_LABEL; } @@ -518,6 +524,8 @@ private static function validateLabel($label, Info $info, array $options, $canBe if ('-' === substr($label, -1, 1)) { $info->errors |= self::ERROR_TRAILING_HYPHEN; } + } elseif ('xn--' === substr($label, 0, 4)) { + $info->errors |= self::ERROR_PUNYCODE; } // Step 4. The label must not contain a U+002E (.) FULL STOP. @@ -583,7 +591,7 @@ private static function punycodeDecode($input) for ($j = 0; $j < $b; ++$j) { if ($bytes[$j] > 0x7F) { - throw new Exception('Invalid input'); + throw new \Exception('Invalid input'); } $output[$out++] = $input[$j]; @@ -599,17 +607,17 @@ private static function punycodeDecode($input) for ($k = self::BASE; /* no condition */; $k += self::BASE) { if ($in >= $inputLength) { - throw new Exception('Invalid input'); + throw new \Exception('Invalid input'); } $digit = self::$basicToDigit[$bytes[$in++] & 0xFF]; if ($digit < 0) { - throw new Exception('Invalid input'); + throw new \Exception('Invalid input'); } if ($digit > intdiv(self::MAX_INT - $i, $w)) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $i += $digit * $w; @@ -629,7 +637,7 @@ private static function punycodeDecode($input) $baseMinusT = self::BASE - $t; if ($w > intdiv(self::MAX_INT, $baseMinusT)) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $w *= $baseMinusT; @@ -639,7 +647,7 @@ private static function punycodeDecode($input) $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi); if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $n += intdiv($i, $outPlusOne); @@ -694,7 +702,7 @@ private static function punycodeEncode($input) } if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } $delta += ($m - $n) * ($h + 1); @@ -702,7 +710,7 @@ private static function punycodeEncode($input) foreach ($iter as $codePoint) { if ($codePoint < $n && 0 === ++$delta) { - throw new Exception('Integer overflow'); + throw new \Exception('Integer overflow'); } if ($codePoint === $n) { diff --git a/api/vendor/symfony/polyfill-intl-idn/LICENSE b/api/vendor/symfony/polyfill-intl-idn/LICENSE index 03c5e25774..fd0a0626a3 100644 --- a/api/vendor/symfony/polyfill-intl-idn/LICENSE +++ b/api/vendor/symfony/polyfill-intl-idn/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier and Trevor Rowbotham +Copyright (c) 2018-present Fabien Potencier and Trevor Rowbotham 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/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php b/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php index 5bb70e48ac..d285acd13e 100644 --- a/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php +++ b/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Polyfill\Intl\Idn\Resources\unidata; /** diff --git a/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php b/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php index 5c1c51ddee..3c6af0c132 100644 --- a/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php +++ b/api/vendor/symfony/polyfill-intl-idn/Resources/unidata/Regex.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Polyfill\Intl\Idn\Resources\unidata; /** diff --git a/api/vendor/symfony/polyfill-intl-idn/composer.json b/api/vendor/symfony/polyfill-intl-idn/composer.json index 105e3d06cc..760debcd2f 100644 --- a/api/vendor/symfony/polyfill-intl-idn/composer.json +++ b/api/vendor/symfony/polyfill-intl-idn/composer.json @@ -20,9 +20,8 @@ } ], "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" }, @@ -33,9 +32,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/api/vendor/symfony/polyfill-intl-normalizer/LICENSE b/api/vendor/symfony/polyfill-intl-normalizer/LICENSE index 4cd8bdd300..6e3afce692 100644 --- a/api/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ b/api/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present 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/api/vendor/symfony/polyfill-intl-normalizer/composer.json b/api/vendor/symfony/polyfill-intl-normalizer/composer.json index 65f72d645d..9bd04e8879 100644 --- a/api/vendor/symfony/polyfill-intl-normalizer/composer.json +++ b/api/vendor/symfony/polyfill-intl-normalizer/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, @@ -28,9 +28,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/api/vendor/symfony/polyfill-mbstring/LICENSE b/api/vendor/symfony/polyfill-mbstring/LICENSE index 4cd8bdd300..6e3afce692 100644 --- a/api/vendor/symfony/polyfill-mbstring/LICENSE +++ b/api/vendor/symfony/polyfill-mbstring/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present 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/api/vendor/symfony/polyfill-mbstring/Mbstring.php b/api/vendor/symfony/polyfill-mbstring/Mbstring.php index bce5c4a84a..3d45c9d9af 100644 --- a/api/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/api/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -48,6 +48,11 @@ * - 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 + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase + * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string + * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string + * - mb_rtrim - Strip whitespace (or other characters) from the end of a string * * Not implemented: * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) @@ -69,7 +74,7 @@ final class Mbstring { public const MB_CASE_FOLD = \PHP_INT_MAX; - private const CASE_FOLD = [ + private const SIMPLE_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", 'ι'], ]; @@ -80,6 +85,15 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { + if (\is_array($s)) { + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { @@ -301,7 +315,11 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); } static $lower = null; @@ -413,7 +431,20 @@ public static function mb_check_encoding($var = null, $encoding = null) $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -638,8 +669,10 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); return self::mb_strpos($haystack, $needle, $offset, $encoding); } @@ -674,8 +707,11 @@ public static function mb_strrichr($haystack, $needle, $part = false, $encoding public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); return self::mb_strrpos($haystack, $needle, $offset, $encoding); } @@ -798,6 +834,69 @@ public static function mb_ord($s, $encoding = null) return $code; } + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { @@ -871,4 +970,76 @@ private static function getEncoding($encoding) return $encoding; } + + public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{[%s]+$}D', $string, $characters, $encoding, __FUNCTION__); + } + + private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given'); + } + + if ('' === $characters) { + return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); + } + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $string)) { + $string = @iconv('UTF-8', 'UTF-8//IGNORE', $string); + } + if (null !== $characters && !preg_match('//u', $characters)) { + $characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters); + } + } else { + $string = iconv($encoding, 'UTF-8//IGNORE', $string); + + if (null !== $characters) { + $characters = iconv($encoding, 'UTF-8//IGNORE', $characters); + } + } + + if (null === $characters) { + $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; + } else { + $characters = preg_quote($characters); + } + + $string = preg_replace(sprintf($regex, $characters), '', $string); + + if (null === $encoding) { + return $string; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $string); + } + + private static function assertEncoding(string $encoding, string $errorFormat): void + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + } } diff --git a/api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 0000000000..512bba0bfd --- /dev/null +++ b/api/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ + 'i̇', + 'µ' => 'μ', + 'ſ' => 's', + 'ͅ' => 'ι', + 'ς' => 'σ', + 'ϐ' => 'β', + 'ϑ' => 'θ', + 'ϕ' => 'φ', + 'ϖ' => 'π', + 'ϰ' => 'κ', + 'ϱ' => 'ρ', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'ι' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'ǰ' => 'ǰ', + 'ΐ' => 'ΐ', + 'ΰ' => 'ΰ', + 'և' => 'եւ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'ὐ' => 'ὐ', + 'ὒ' => 'ὒ', + 'ὔ' => 'ὔ', + 'ὖ' => 'ὖ', + 'ᾀ' => 'ἀι', + 'ᾁ' => 'ἁι', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'ᾅ' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'ἁι', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'ᾍ' => 'ἅι', + 'ᾎ' => 'ἆι', + 'ᾏ' => 'ἇι', + 'ᾐ' => 'ἠι', + 'ᾑ' => 'ἡι', + 'ᾒ' => 'ἢι', + 'ᾓ' => 'ἣι', + 'ᾔ' => 'ἤι', + 'ᾕ' => 'ἥι', + 'ᾖ' => 'ἦι', + 'ᾗ' => 'ἧι', + 'ᾘ' => 'ἠι', + 'ᾙ' => 'ἡι', + 'ᾚ' => 'ἢι', + 'ᾛ' => 'ἣι', + 'ᾜ' => 'ἤι', + 'ᾝ' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'ᾠ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'ᾢ' => 'ὢι', + 'ᾣ' => 'ὣι', + 'ᾤ' => 'ὤι', + 'ᾥ' => 'ὥι', + 'ᾦ' => 'ὦι', + 'ᾧ' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'ᾭ' => 'ὥι', + 'ᾮ' => 'ὦι', + 'ᾯ' => 'ὧι', + 'ᾲ' => 'ὰι', + 'ᾳ' => 'αι', + 'ᾴ' => 'άι', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾶι', + 'ᾼ' => 'αι', + 'ῂ' => 'ὴι', + 'ῃ' => 'ηι', + 'ῄ' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'ῌ' => 'ηι', + 'ῒ' => 'ῒ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'ῢ' => 'ῢ', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'ῴ' => 'ώι', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'fi' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'մն', + 'ﬔ' => 'մե', + 'ﬕ' => 'մի', + 'ﬖ' => 'վն', + 'ﬗ' => 'մխ', +]; diff --git a/api/vendor/symfony/polyfill-mbstring/bootstrap.php b/api/vendor/symfony/polyfill-mbstring/bootstrap.php index 1fedd1f7c8..ff51ae0796 100644 --- a/api/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/api/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -132,6 +132,31 @@ function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + + if (extension_loaded('mbstring')) { return; } diff --git a/api/vendor/symfony/polyfill-mbstring/bootstrap80.php b/api/vendor/symfony/polyfill-mbstring/bootstrap80.php index 82f5ac4d0f..5be7d2018f 100644 --- a/api/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ b/api/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -93,7 +93,7 @@ function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?strin 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); } + function mb_get_info(?string $type = 'all'): array|string|int|false|null { 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); } @@ -128,6 +128,30 @@ function mb_scrub(?string $string, ?string $encoding = null): string { $encoding 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 (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/api/vendor/symfony/polyfill-mbstring/composer.json b/api/vendor/symfony/polyfill-mbstring/composer.json index 44895536ba..4ed241a33b 100644 --- a/api/vendor/symfony/polyfill-mbstring/composer.json +++ b/api/vendor/symfony/polyfill-mbstring/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -30,9 +30,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/api/vendor/symfony/polyfill-php72/Php72.php b/api/vendor/symfony/polyfill-php72/Php72.php deleted file mode 100644 index 7bf96c9969..0000000000 --- a/api/vendor/symfony/polyfill-php72/Php72.php +++ /dev/null @@ -1,217 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php72; - -/** - * @author Nicolas Grekas - * @author Dariusz Rumiński - * - * @internal - */ -final class Php72 -{ - private static $hashMask; - - public static function utf8_encode($s) - { - $s .= $s; - $len = \strlen($s); - - for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) { - switch (true) { - case $s[$i] < "\x80": $s[$j] = $s[$i]; break; - case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break; - default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break; - } - } - - return substr($s, 0, $j); - } - - public static function utf8_decode($s) - { - $s = (string) $s; - $len = \strlen($s); - - for ($i = 0, $j = 0; $i < $len; ++$i, ++$j) { - switch ($s[$i] & "\xF0") { - case "\xC0": - case "\xD0": - $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F"); - $s[$j] = $c < 256 ? \chr($c) : '?'; - break; - - case "\xF0": - ++$i; - // no break - - case "\xE0": - $s[$j] = '?'; - $i += 2; - break; - - default: - $s[$j] = $s[$i]; - } - } - - return substr($s, 0, $j); - } - - public static function php_os_family() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return 'Windows'; - } - - $map = [ - 'Darwin' => 'Darwin', - 'DragonFly' => 'BSD', - 'FreeBSD' => 'BSD', - 'NetBSD' => 'BSD', - 'OpenBSD' => 'BSD', - 'Linux' => 'Linux', - 'SunOS' => 'Solaris', - ]; - - return $map[\PHP_OS] ?? 'Unknown'; - } - - public static function spl_object_id($object) - { - if (null === self::$hashMask) { - self::initHashMask(); - } - if (null === $hash = spl_object_hash($object)) { - return; - } - - // On 32-bit systems, PHP_INT_SIZE is 4, - return self::$hashMask ^ hexdec(substr($hash, 16 - (\PHP_INT_SIZE * 2 - 1), \PHP_INT_SIZE * 2 - 1)); - } - - public static function sapi_windows_vt100_support($stream, $enable = null) - { - if (!\is_resource($stream)) { - trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); - - return false; - } - - $meta = stream_get_meta_data($stream); - - if ('STDIO' !== $meta['stream_type']) { - trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', \E_USER_WARNING); - - return false; - } - - // We cannot actually disable vt100 support if it is set - if (false === $enable || !self::stream_isatty($stream)) { - return false; - } - - // The native function does not apply to stdin - $meta = array_map('strtolower', $meta); - $stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri']; - - return !$stdin - && (false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM') - || 'Hyper' === getenv('TERM_PROGRAM')); - } - - public static function stream_isatty($stream) - { - if (!\is_resource($stream)) { - trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING); - - return false; - } - - if ('\\' === \DIRECTORY_SEPARATOR) { - $stat = @fstat($stream); - // Check if formatted mode is S_IFCHR - return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; - } - - return \function_exists('posix_isatty') && @posix_isatty($stream); - } - - private static function initHashMask() - { - $obj = (object) []; - self::$hashMask = -1; - - // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below - $obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush']; - foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? \DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { - if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) { - $frame['line'] = 0; - break; - } - } - if (!empty($frame['line'])) { - ob_start(); - debug_zval_dump($obj); - self::$hashMask = (int) substr(ob_get_clean(), 17); - } - - self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - (\PHP_INT_SIZE * 2 - 1), \PHP_INT_SIZE * 2 - 1)); - } - - 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 = $encoding ?? mb_internal_encoding()) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if (null === $encoding) { - $s = mb_convert_encoding($s, 'UTF-8'); - } elseif ('UTF-8' !== $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; - } -} diff --git a/api/vendor/symfony/polyfill-php72/README.md b/api/vendor/symfony/polyfill-php72/README.md deleted file mode 100644 index ed1905055d..0000000000 --- a/api/vendor/symfony/polyfill-php72/README.md +++ /dev/null @@ -1,35 +0,0 @@ -Symfony Polyfill / Php72 -======================== - -This component provides functions added to PHP 7.2 core: - -- [`spl_object_id`](https://php.net/spl_object_id) -- [`stream_isatty`](https://php.net/stream_isatty) - -And also functions added to PHP 7.2 mbstring: - -- [`mb_ord`](https://php.net/mb_ord) -- [`mb_chr`](https://php.net/mb_chr) -- [`mb_scrub`](https://php.net/mb_scrub) - -On Windows only: - -- [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support) - -Moved to core since 7.2 (was in the optional XML extension earlier): - -- [`utf8_encode`](https://php.net/utf8_encode) -- [`utf8_decode`](https://php.net/utf8_decode) - -Also, it provides constants added to PHP 7.2: - -- [`PHP_FLOAT_*`](https://php.net/reserved.constants#constant.php-float-dig) -- [`PHP_OS_FAMILY`](https://php.net/reserved.constants#constant.php-os-family) - -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/api/vendor/symfony/polyfill-php72/bootstrap.php b/api/vendor/symfony/polyfill-php72/bootstrap.php deleted file mode 100644 index b5c92d4c7c..0000000000 --- a/api/vendor/symfony/polyfill-php72/bootstrap.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php72 as p; - -if (\PHP_VERSION_ID >= 70200) { - return; -} - -if (!defined('PHP_FLOAT_DIG')) { - define('PHP_FLOAT_DIG', 15); -} -if (!defined('PHP_FLOAT_EPSILON')) { - define('PHP_FLOAT_EPSILON', 2.2204460492503E-16); -} -if (!defined('PHP_FLOAT_MIN')) { - define('PHP_FLOAT_MIN', 2.2250738585072E-308); -} -if (!defined('PHP_FLOAT_MAX')) { - define('PHP_FLOAT_MAX', 1.7976931348623157E+308); -} -if (!defined('PHP_OS_FAMILY')) { - define('PHP_OS_FAMILY', p\Php72::php_os_family()); -} - -if ('\\' === \DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) { - function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); } -} -if (!function_exists('stream_isatty')) { - function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } -} -if (!function_exists('utf8_encode')) { - function utf8_encode($string) { return p\Php72::utf8_encode($string); } -} -if (!function_exists('utf8_decode')) { - function utf8_decode($string) { return p\Php72::utf8_decode($string); } -} -if (!function_exists('spl_object_id')) { - function spl_object_id($object) { return p\Php72::spl_object_id($object); } -} -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Php72::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); } -} diff --git a/api/vendor/symfony/polyfill-php72/composer.json b/api/vendor/symfony/polyfill-php72/composer.json deleted file mode 100644 index 5f17af3438..0000000000 --- a/api/vendor/symfony/polyfill-php72/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/polyfill-php72", - "type": "library", - "description": "Symfony polyfill backporting some PHP 7.2+ 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\\Php72\\": "" }, - "files": [ "bootstrap.php" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/api/vendor/symfony/polyfill-php73/LICENSE b/api/vendor/symfony/polyfill-php73/LICENSE index 3f853aaf35..7536caeae8 100644 --- a/api/vendor/symfony/polyfill-php73/LICENSE +++ b/api/vendor/symfony/polyfill-php73/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present 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/api/vendor/symfony/polyfill-php73/composer.json b/api/vendor/symfony/polyfill-php73/composer.json index b5c58ec193..09d98cb873 100644 --- a/api/vendor/symfony/polyfill-php73/composer.json +++ b/api/vendor/symfony/polyfill-php73/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, @@ -25,9 +25,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/api/vendor/symfony/polyfill-php80/LICENSE b/api/vendor/symfony/polyfill-php80/LICENSE index 5593b1d84f..0ed3a24655 100644 --- a/api/vendor/symfony/polyfill-php80/LICENSE +++ b/api/vendor/symfony/polyfill-php80/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Fabien Potencier +Copyright (c) 2020-present 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/api/vendor/symfony/polyfill-php80/composer.json b/api/vendor/symfony/polyfill-php80/composer.json index bd9a3262a9..a503b039ad 100644 --- a/api/vendor/symfony/polyfill-php80/composer.json +++ b/api/vendor/symfony/polyfill-php80/composer.json @@ -20,7 +20,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=7.2" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, @@ -29,9 +29,6 @@ }, "minimum-stability": "dev", "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" diff --git a/api/vendor/symfony/polyfill-php81/Php81.php b/api/vendor/symfony/polyfill-php81/Php81.php deleted file mode 100644 index f0507b765c..0000000000 --- a/api/vendor/symfony/polyfill-php81/Php81.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php81; - -/** - * @author Nicolas Grekas - * - * @internal - */ -final class Php81 -{ - public static function array_is_list(array $array): bool - { - if ([] === $array || $array === array_values($array)) { - return true; - } - - $nextKey = -1; - - foreach ($array as $k => $v) { - if ($k !== ++$nextKey) { - return false; - } - } - - return true; - } -} diff --git a/api/vendor/symfony/polyfill-php81/README.md b/api/vendor/symfony/polyfill-php81/README.md deleted file mode 100644 index 7d8dd19078..0000000000 --- a/api/vendor/symfony/polyfill-php81/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Symfony Polyfill / Php81 -======================== - -This component provides features added to PHP 8.1 core: - -- [`array_is_list`](https://php.net/array_is_list) -- [`enum_exists`](https://php.net/enum-exists) -- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant -- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) - -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/api/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/api/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php deleted file mode 100644 index cb7720a8da..0000000000 --- a/api/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80100) { - #[Attribute(Attribute::TARGET_METHOD)] - final class ReturnTypeWillChange - { - public function __construct() - { - } - } -} diff --git a/api/vendor/symfony/polyfill-php81/bootstrap.php b/api/vendor/symfony/polyfill-php81/bootstrap.php deleted file mode 100644 index 9f872e02f0..0000000000 --- a/api/vendor/symfony/polyfill-php81/bootstrap.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php81 as p; - -if (\PHP_VERSION_ID >= 80100) { - return; -} - -if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { - define('MYSQLI_REFRESH_REPLICA', 64); -} - -if (!function_exists('array_is_list')) { - function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } -} - -if (!function_exists('enum_exists')) { - function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } -} diff --git a/api/vendor/symfony/polyfill-php81/composer.json b/api/vendor/symfony/polyfill-php81/composer.json deleted file mode 100644 index 149b598215..0000000000 --- a/api/vendor/symfony/polyfill-php81/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "symfony/polyfill-php81", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.1+ 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\\Php81\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/api/vendor/symfony/process/ExecutableFinder.php b/api/vendor/symfony/process/ExecutableFinder.php index eb8f062924..89edd22fb2 100644 --- a/api/vendor/symfony/process/ExecutableFinder.php +++ b/api/vendor/symfony/process/ExecutableFinder.php @@ -19,7 +19,15 @@ */ class ExecutableFinder { - private $suffixes = ['.exe', '.bat', '.cmd', '.com']; + private const CMD_BUILTINS = [ + 'assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', + 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', + 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', + 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', + 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol', + ]; + + private $suffixes = []; /** * Replaces default suffixes of executable. @@ -46,41 +54,50 @@ public function addSuffix(string $suffix) * * @return string|null */ - public function find(string $name, string $default = null, array $extraDirs = []) + public function find(string $name, ?string $default = null, array $extraDirs = []) { - if (\ini_get('open_basedir')) { - $searchPath = array_merge(explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs); - $dirs = []; - foreach ($searchPath as $path) { - // Silencing against https://bugs.php.net/69240 - if (@is_dir($path)) { - $dirs[] = $path; - } else { - if (basename($path) == $name && @is_executable($path)) { - return $path; - } - } - } - } else { - $dirs = array_merge( - explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), - $extraDirs - ); + // windows built-in commands that are present in cmd.exe should not be resolved using PATH as they do not exist as exes + if ('\\' === \DIRECTORY_SEPARATOR && \in_array(strtolower($name), self::CMD_BUILTINS, true)) { + return $name; } - $suffixes = ['']; + $dirs = array_merge( + explode(\PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), + $extraDirs + ); + + $suffixes = []; if ('\\' === \DIRECTORY_SEPARATOR) { $pathExt = getenv('PATHEXT'); - $suffixes = array_merge($pathExt ? explode(\PATH_SEPARATOR, $pathExt) : $this->suffixes, $suffixes); + $suffixes = $this->suffixes; + $suffixes = array_merge($suffixes, $pathExt ? explode(\PATH_SEPARATOR, $pathExt) : ['.exe', '.bat', '.cmd', '.com']); } + $suffixes = '' !== pathinfo($name, PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']); foreach ($suffixes as $suffix) { foreach ($dirs as $dir) { + if ('' === $dir) { + $dir = '.'; + } if (@is_file($file = $dir.\DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === \DIRECTORY_SEPARATOR || @is_executable($file))) { return $file; } + + if (!@is_dir($dir) && basename($dir) === $name.$suffix && @is_executable($dir)) { + return $dir; + } } } + if ('\\' === \DIRECTORY_SEPARATOR || !\function_exists('exec') || \strlen($name) !== strcspn($name, '/'.\DIRECTORY_SEPARATOR)) { + return $default; + } + + $execResult = exec('command -v -- '.escapeshellarg($name)); + + if (($executablePath = substr($execResult, 0, strpos($execResult, \PHP_EOL) ?: null)) && @is_executable($executablePath)) { + return $executablePath; + } + return $default; } } diff --git a/api/vendor/symfony/process/InputStream.php b/api/vendor/symfony/process/InputStream.php index 240665f32a..0c45b5245c 100644 --- a/api/vendor/symfony/process/InputStream.php +++ b/api/vendor/symfony/process/InputStream.php @@ -30,7 +30,7 @@ class InputStream implements \IteratorAggregate /** * Sets a callback that is called when the write buffer becomes empty. */ - public function onEmpty(callable $onEmpty = null) + public function onEmpty(?callable $onEmpty = null) { $this->onEmpty = $onEmpty; } diff --git a/api/vendor/symfony/process/LICENSE b/api/vendor/symfony/process/LICENSE index 0083704572..0138f8f071 100644 --- a/api/vendor/symfony/process/LICENSE +++ b/api/vendor/symfony/process/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present 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/api/vendor/symfony/process/PhpExecutableFinder.php b/api/vendor/symfony/process/PhpExecutableFinder.php index 998808b66f..c3a9680d75 100644 --- a/api/vendor/symfony/process/PhpExecutableFinder.php +++ b/api/vendor/symfony/process/PhpExecutableFinder.php @@ -34,15 +34,8 @@ public function __construct() public function find(bool $includeArgs = true) { if ($php = getenv('PHP_BINARY')) { - if (!is_executable($php)) { - $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v'; - if ($php = strtok(exec($command.' '.escapeshellarg($php)), \PHP_EOL)) { - if (!is_executable($php)) { - return false; - } - } else { - return false; - } + if (!is_executable($php) && !$php = $this->executableFinder->find($php)) { + return false; } if (@is_dir($php)) { @@ -56,7 +49,7 @@ public function find(bool $includeArgs = true) $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; // PHP_BINARY return the current sapi executable - if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true)) { + if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) { return \PHP_BINARY.$args; } diff --git a/api/vendor/symfony/process/PhpProcess.php b/api/vendor/symfony/process/PhpProcess.php index 2bc338e5e2..3a1d147c87 100644 --- a/api/vendor/symfony/process/PhpProcess.php +++ b/api/vendor/symfony/process/PhpProcess.php @@ -32,7 +32,7 @@ class PhpProcess extends Process * @param int $timeout The timeout in seconds * @param array|null $php Path to the PHP binary to use with any additional arguments */ - public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null) + public function __construct(string $script, ?string $cwd = null, ?array $env = null, int $timeout = 60, ?array $php = null) { if (null === $php) { $executableFinder = new PhpExecutableFinder(); @@ -53,7 +53,7 @@ public function __construct(string $script, string $cwd = null, array $env = nul /** * {@inheritdoc} */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) + public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, $input = null, ?float $timeout = 60) { throw new LogicException(sprintf('The "%s()" method cannot be called when using "%s".', __METHOD__, self::class)); } @@ -61,7 +61,7 @@ public static function fromShellCommandline(string $command, string $cwd = null, /** * {@inheritdoc} */ - public function start(callable $callback = null, array $env = []) + public function start(?callable $callback = null, array $env = []) { if (null === $this->getCommandLine()) { throw new RuntimeException('Unable to find the PHP executable.'); diff --git a/api/vendor/symfony/process/Pipes/WindowsPipes.php b/api/vendor/symfony/process/Pipes/WindowsPipes.php index bca84f574d..968dd02629 100644 --- a/api/vendor/symfony/process/Pipes/WindowsPipes.php +++ b/api/vendor/symfony/process/Pipes/WindowsPipes.php @@ -149,7 +149,7 @@ public function readAndWrite(bool $blocking, bool $close = false): array if ($w) { @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); } elseif ($this->fileHandles) { - usleep(Process::TIMEOUT_PRECISION * 1E6); + usleep((int) (Process::TIMEOUT_PRECISION * 1E6)); } } foreach ($this->fileHandles as $type => $fileHandle) { diff --git a/api/vendor/symfony/process/Process.php b/api/vendor/symfony/process/Process.php index 14e1777465..91f9e8fee3 100644 --- a/api/vendor/symfony/process/Process.php +++ b/api/vendor/symfony/process/Process.php @@ -80,6 +80,7 @@ class Process implements \IteratorAggregate private $processPipes; private $latestSignal; + private $cachedExitCode; private static $sigchild; @@ -140,7 +141,7 @@ class Process implements \IteratorAggregate * * @throws LogicException When proc_open is not installed */ - public function __construct(array $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) + public function __construct(array $command, ?string $cwd = null, ?array $env = null, $input = null, ?float $timeout = 60) { if (!\function_exists('proc_open')) { throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.'); @@ -189,7 +190,7 @@ public function __construct(array $command, string $cwd = null, array $env = nul * * @throws LogicException When proc_open is not installed */ - public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) + public static function fromShellCommandline(string $command, ?string $cwd = null, ?array $env = null, $input = null, ?float $timeout = 60) { $process = new static([], $cwd, $env, $input, $timeout); $process->commandline = $command; @@ -247,7 +248,7 @@ public function __clone() * * @final */ - public function run(callable $callback = null, array $env = []): int + public function run(?callable $callback = null, array $env = []): int { $this->start($callback, $env); @@ -266,7 +267,7 @@ public function run(callable $callback = null, array $env = []): int * * @final */ - public function mustRun(callable $callback = null, array $env = []): self + public function mustRun(?callable $callback = null, array $env = []): self { if (0 !== $this->run($callback, $env)) { throw new ProcessFailedException($this); @@ -294,7 +295,7 @@ public function mustRun(callable $callback = null, array $env = []): self * @throws RuntimeException When process is already running * @throws LogicException In case a callback is provided and output has been disabled */ - public function start(callable $callback = null, array $env = []) + public function start(?callable $callback = null, array $env = []) { if ($this->isRunning()) { throw new RuntimeException('Process is already running.'); @@ -331,7 +332,7 @@ public function start(callable $callback = null, array $env = []) // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; - $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code'; + $commandline .= 'pid=$!; echo $pid >&3; wait $pid 2>/dev/null; code=$?; echo $code >&3; exit $code'; // Workaround for the bug, when PTS functionality is enabled. // @see : https://bugs.php.net/69442 @@ -351,7 +352,7 @@ public function start(callable $callback = null, array $env = []) $this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options); - if (!\is_resource($this->process)) { + if (!$this->process) { throw new RuntimeException('Unable to launch a new process.'); } $this->status = self::STATUS_STARTED; @@ -385,7 +386,7 @@ public function start(callable $callback = null, array $env = []) * * @final */ - public function restart(callable $callback = null, array $env = []): self + public function restart(?callable $callback = null, array $env = []): self { if ($this->isRunning()) { throw new RuntimeException('Process is already running.'); @@ -412,7 +413,7 @@ public function restart(callable $callback = null, array $env = []): self * @throws ProcessSignaledException When process stopped after receiving signal * @throws LogicException When process is not yet started */ - public function wait(callable $callback = null) + public function wait(?callable $callback = null) { $this->requireProcessIsStarted(__FUNCTION__); @@ -428,7 +429,7 @@ public function wait(callable $callback = null) do { $this->checkTimeout(); - $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen(); + $running = $this->isRunning() && ('\\' === \DIRECTORY_SEPARATOR || $this->processPipes->areOpen()); $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running); } while ($running); @@ -617,10 +618,10 @@ public function getIncrementalOutput() * * @param int $flags A bit field of Process::ITER_* flags * + * @return \Generator + * * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started - * - * @return \Generator */ #[\ReturnTypeWillChange] public function getIterator(int $flags = 0) @@ -910,11 +911,11 @@ public function getStatus() * Stops the process. * * @param int|float $timeout The timeout in seconds - * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) + * @param int|null $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) * * @return int|null The exit-code of the process or null if it's not running */ - public function stop(float $timeout = 10, int $signal = null) + public function stop(float $timeout = 10, ?int $signal = null) { $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { @@ -1310,7 +1311,7 @@ private function getDescriptors(): array * * @return \Closure */ - protected function buildCallback(callable $callback = null) + protected function buildCallback(?callable $callback = null) { if ($this->outputDisabled) { return function ($type, $data) use ($callback): bool { @@ -1345,6 +1346,19 @@ protected function updateStatus(bool $blocking) $this->processInformation = proc_get_status($this->process); $running = $this->processInformation['running']; + // In PHP < 8.3, "proc_get_status" only returns the correct exit status on the first call. + // Subsequent calls return -1 as the process is discarded. This workaround caches the first + // retrieved exit status for consistent results in later calls, mimicking PHP 8.3 behavior. + if (\PHP_VERSION_ID < 80300) { + if (!isset($this->cachedExitCode) && !$running && -1 !== $this->processInformation['exitcode']) { + $this->cachedExitCode = $this->processInformation['exitcode']; + } + + if (isset($this->cachedExitCode) && !$running && -1 === $this->processInformation['exitcode']) { + $this->processInformation['exitcode'] = $this->cachedExitCode; + } + } + $this->readPipes($running && $blocking, '\\' !== \DIRECTORY_SEPARATOR || !$running); if ($this->fallbackStatus && $this->isSigchildEnabled()) { @@ -1442,8 +1456,9 @@ private function readPipes(bool $blocking, bool $close) private function close(): int { $this->processPipes->close(); - if (\is_resource($this->process)) { + if ($this->process) { proc_close($this->process); + $this->process = null; } $this->exitcode = $this->processInformation['exitcode']; $this->status = self::STATUS_TERMINATED; @@ -1577,7 +1592,14 @@ function ($m) use (&$env, &$varCache, &$varCount, $uid) { $cmd ); - $cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; + static $comSpec; + + if (!$comSpec && $comSpec = (new ExecutableFinder())->find('cmd.exe')) { + // Escape according to CommandLineToArgvW rules + $comSpec = '"'.preg_replace('{(\\\\*+)"}', '$1$1\"', $comSpec) .'"'; + } + + $cmd = ($comSpec ?? 'cmd').' /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; foreach ($this->processPipes->getFiles() as $offset => $filename) { $cmd .= ' '.$offset.'>"'.$filename.'"'; } @@ -1623,7 +1645,7 @@ private function escapeArgument(?string $argument): string if (str_contains($argument, "\0")) { $argument = str_replace("\0", '?', $argument); } - if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { + if (!preg_match('/[()%!^"<>&|\s]/', $argument)) { return $argument; } $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); diff --git a/api/vendor/symfony/service-contracts/.gitignore b/api/vendor/symfony/service-contracts/.gitignore deleted file mode 100644 index c49a5d8df5..0000000000 --- a/api/vendor/symfony/service-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/api/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/api/vendor/symfony/service-contracts/Attribute/SubscribedService.php index 10d1bc38e8..f850b8401f 100644 --- a/api/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ b/api/vendor/symfony/service-contracts/Attribute/SubscribedService.php @@ -11,10 +11,15 @@ namespace Symfony\Contracts\Service\Attribute; -use Symfony\Contracts\Service\ServiceSubscriberTrait; +use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait; +use Symfony\Contracts\Service\ServiceSubscriberInterface; /** - * Use with {@see ServiceSubscriberTrait} to mark a method's return type + * For use as the return value for {@see ServiceSubscriberInterface}. + * + * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi')) + * + * Use with {@see ServiceMethodsSubscriberTrait} to mark a method's return type * as a subscribed service. * * @author Kevin Bond @@ -22,12 +27,21 @@ #[\Attribute(\Attribute::TARGET_METHOD)] final class SubscribedService { + /** @var object[] */ + public array $attributes; + /** - * @param string|null $key The key to use for the service - * If null, use "ClassName::methodName" + * @param string|null $key The key to use for the service + * @param class-string|null $type The service class + * @param bool $nullable Whether the service is optional + * @param object|object[] $attributes One or more dependency injection attributes to use */ public function __construct( - public ?string $key = null + public ?string $key = null, + public ?string $type = null, + public bool $nullable = false, + array|object $attributes = [], ) { + $this->attributes = \is_array($attributes) ? $attributes : [$attributes]; } } diff --git a/api/vendor/symfony/service-contracts/LICENSE b/api/vendor/symfony/service-contracts/LICENSE index 74cdc2dbf6..7536caeae8 100644 --- a/api/vendor/symfony/service-contracts/LICENSE +++ b/api/vendor/symfony/service-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2022 Fabien Potencier +Copyright (c) 2018-present 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/api/vendor/symfony/service-contracts/README.md b/api/vendor/symfony/service-contracts/README.md index 41e054a101..42841a57d0 100644 --- a/api/vendor/symfony/service-contracts/README.md +++ b/api/vendor/symfony/service-contracts/README.md @@ -3,7 +3,7 @@ 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 +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/api/vendor/symfony/service-contracts/ResetInterface.php b/api/vendor/symfony/service-contracts/ResetInterface.php index 1af1075eee..a4f389b01f 100644 --- a/api/vendor/symfony/service-contracts/ResetInterface.php +++ b/api/vendor/symfony/service-contracts/ResetInterface.php @@ -26,5 +26,8 @@ */ interface ResetInterface { + /** + * @return void + */ public function reset(); } diff --git a/api/vendor/symfony/service-contracts/ServiceCollectionInterface.php b/api/vendor/symfony/service-contracts/ServiceCollectionInterface.php new file mode 100644 index 0000000000..2333139ce7 --- /dev/null +++ b/api/vendor/symfony/service-contracts/ServiceCollectionInterface.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Service; + +/** + * A ServiceProviderInterface that is also countable and iterable. + * + * @author Kevin Bond + * + * @template-covariant T of mixed + * + * @extends ServiceProviderInterface + * @extends \IteratorAggregate + */ +interface ServiceCollectionInterface extends ServiceProviderInterface, \Countable, \IteratorAggregate +{ +} diff --git a/api/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/api/vendor/symfony/service-contracts/ServiceLocatorTrait.php index 74dfa4362e..b62ec3e531 100644 --- a/api/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ b/api/vendor/symfony/service-contracts/ServiceLocatorTrait.php @@ -26,34 +26,24 @@ class_exists(NotFoundExceptionInterface::class); */ trait ServiceLocatorTrait { - private $factories; - private $loading = []; - private $providedTypes; + private array $factories; + private array $loading = []; + private array $providedTypes; /** - * @param callable[] $factories + * @param array $factories */ public function __construct(array $factories) { $this->factories = $factories; } - /** - * {@inheritdoc} - * - * @return bool - */ - public function has(string $id) + public function has(string $id): bool { return isset($this->factories[$id]); } - /** - * {@inheritdoc} - * - * @return mixed - */ - public function get(string $id) + public function get(string $id): mixed { if (!isset($this->factories[$id])) { throw $this->createNotFoundException($id); @@ -75,12 +65,9 @@ public function get(string $id) } } - /** - * {@inheritdoc} - */ public function getProvidedServices(): array { - if (null === $this->providedTypes) { + if (!isset($this->providedTypes)) { $this->providedTypes = []; foreach ($this->factories as $name => $factory) { diff --git a/api/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php b/api/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php new file mode 100644 index 0000000000..0d89d9f25e --- /dev/null +++ b/api/vendor/symfony/service-contracts/ServiceMethodsSubscriberTrait.php @@ -0,0 +1,80 @@ + + * + * 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\Required; +use Symfony\Contracts\Service\Attribute\SubscribedService; + +/** + * Implementation of ServiceSubscriberInterface that determines subscribed services + * from methods that have the #[SubscribedService] attribute. + * + * Service ids are available as "ClassName::methodName" so that the implementation + * of subscriber methods can be just `return $this->container->get(__METHOD__);`. + * + * @author Kevin Bond + */ +trait ServiceMethodsSubscriberTrait +{ + protected ContainerInterface $container; + + public static function getSubscribedServices(): array + { + $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; + + 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)); + } + + /* @var SubscribedService $attribute */ + $attribute = $attribute->newInstance(); + $attribute->key ??= self::class.'::'.$method->name; + $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; + $attribute->nullable = $returnType->allowsNull(); + + if ($attribute->attributes) { + $services[] = $attribute; + } else { + $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; + } + } + + return $services; + } + + #[Required] + public function setContainer(ContainerInterface $container): ?ContainerInterface + { + $ret = null; + if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { + $ret = parent::setContainer($container); + } + + $this->container = $container; + + return $ret; + } +} diff --git a/api/vendor/symfony/service-contracts/ServiceProviderInterface.php b/api/vendor/symfony/service-contracts/ServiceProviderInterface.php index c60ad0bd4b..2e71f00c67 100644 --- a/api/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ b/api/vendor/symfony/service-contracts/ServiceProviderInterface.php @@ -18,9 +18,18 @@ * * @author Nicolas Grekas * @author Mateusz Sip + * + * @template-covariant T of mixed */ interface ServiceProviderInterface extends ContainerInterface { + /** + * @return T + */ + public function get(string $id): mixed; + + public function has(string $id): bool; + /** * Returns an associative array of service types keyed by the identifiers provided by the current container. * @@ -30,7 +39,7 @@ interface ServiceProviderInterface extends ContainerInterface * * ['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 + * @return array The provided service types, keyed by service names */ public function getProvidedServices(): array; } diff --git a/api/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/api/vendor/symfony/service-contracts/ServiceSubscriberInterface.php index 098ab908cd..3da19169b0 100644 --- a/api/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ b/api/vendor/symfony/service-contracts/ServiceSubscriberInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Contracts\Service; +use Symfony\Contracts\Service\Attribute\SubscribedService; + /** * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. * @@ -29,7 +31,8 @@ interface ServiceSubscriberInterface { /** - * Returns an array of service types required by such instances, optionally keyed by the service names used internally. + * Returns an array of service types (or {@see SubscribedService} objects) required + * by such instances, optionally keyed by the service names used internally. * * For mandatory dependencies: * @@ -47,7 +50,13 @@ interface ServiceSubscriberInterface * * ['?Psr\Log\LoggerInterface'] is a shortcut for * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] * - * @return string[] The required service types, optionally keyed by service names + * additionally, an array of {@see SubscribedService}'s can be returned: + * + * * [new SubscribedService('logger', Psr\Log\LoggerInterface::class)] + * * [new SubscribedService(type: Psr\Log\LoggerInterface::class, nullable: true)] + * * [new SubscribedService('http_client', HttpClientInterface::class, attributes: new Target('githubApi'))] + * + * @return string[]|SubscribedService[] The required service types, optionally keyed by service names */ - public static function getSubscribedServices(); + public static function getSubscribedServices(): array; } diff --git a/api/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/api/vendor/symfony/service-contracts/ServiceSubscriberTrait.php index 16e3eb2c19..cc3bc321aa 100644 --- a/api/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ b/api/vendor/symfony/service-contracts/ServiceSubscriberTrait.php @@ -12,98 +12,73 @@ namespace Symfony\Contracts\Service; use Psr\Container\ContainerInterface; +use Symfony\Contracts\Service\Attribute\Required; use Symfony\Contracts\Service\Attribute\SubscribedService; +trigger_deprecation('symfony/contracts', 'v3.5', '"%s" is deprecated, use "ServiceMethodsSubscriberTrait" instead.', ServiceSubscriberTrait::class); + /** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". + * Implementation of ServiceSubscriberInterface that determines subscribed services + * from methods that have the #[SubscribedService] attribute. + * + * Service ids are available as "ClassName::methodName" so that the implementation + * of subscriber methods can be just `return $this->container->get(__METHOD__);`. + * + * @property ContainerInterface $container * * @author Kevin Bond + * + * @deprecated since symfony/contracts v3.5, use ServiceMethodsSubscriberTrait instead */ 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; + foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { + if (self::class !== $method->getDeclaringClass()->name) { + continue; } - } - - 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 (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { + continue; + } - if (!($returnType = $method->getReturnType()) instanceof \ReflectionNamedType) { - 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->isBuiltin()) { - continue; - } + 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)); + } - 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); - } + /* @var SubscribedService $attribute */ + $attribute = $attribute->newInstance(); + $attribute->key ??= self::class.'::'.$method->name; + $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; + $attribute->nullable = $returnType->allowsNull(); - $services[self::class.'::'.$method->name] = '?'.($returnType instanceof \ReflectionNamedType ? $returnType->getName() : $returnType); + if ($attribute->attributes) { + $services[] = $attribute; + } else { + $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; } } return $services; } - /** - * @required - * - * @return ContainerInterface|null - */ - public function setContainer(ContainerInterface $container) + #[Required] + public function setContainer(ContainerInterface $container): ?ContainerInterface { - $this->container = $container; - + $ret = null; if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { - return parent::setContainer($container); + $ret = parent::setContainer($container); } - return null; + $this->container = $container; + + return $ret; } } diff --git a/api/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/api/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php index 2a1b565f50..07d12b4a5b 100644 --- a/api/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ b/api/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php @@ -11,85 +11,13 @@ namespace Symfony\Contracts\Service\Test; -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; +class_alias(ServiceLocatorTestCase::class, ServiceLocatorTest::class); -abstract class ServiceLocatorTest extends TestCase -{ +if (false) { /** - * @return ContainerInterface + * @deprecated since PHPUnit 9.6 */ - protected function getServiceLocator(array $factories) + class ServiceLocatorTest { - 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/api/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php b/api/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php new file mode 100644 index 0000000000..65a3fe3379 --- /dev/null +++ b/api/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php @@ -0,0 +1,96 @@ + + * + * 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\ContainerExceptionInterface; +use Psr\Container\ContainerInterface; +use Psr\Container\NotFoundExceptionInterface; +use Symfony\Contracts\Service\ServiceLocatorTrait; + +abstract class ServiceLocatorTestCase extends TestCase +{ + protected function getServiceLocator(array $factories): ContainerInterface + { + return new class($factories) implements ContainerInterface { + use ServiceLocatorTrait; + }; + } + + public function testHas() + { + $locator = $this->getServiceLocator([ + 'foo' => fn () => 'bar', + 'bar' => fn () => 'baz', + fn () => 'dummy', + ]); + + $this->assertTrue($locator->has('foo')); + $this->assertTrue($locator->has('bar')); + $this->assertFalse($locator->has('dummy')); + } + + public function testGet() + { + $locator = $this->getServiceLocator([ + 'foo' => fn () => 'bar', + 'bar' => fn () => '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() + { + $locator = $this->getServiceLocator([ + 'foo' => function () use (&$locator) { return $locator->get('bar'); }, + ]); + + if (!$this->getExpectedException()) { + $this->expectException(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->get('foo'); + } + + public function testThrowsOnCircularReference() + { + $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'); }, + ]); + + $this->expectException(ContainerExceptionInterface::class); + $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); + + $locator->get('foo'); + } +} diff --git a/api/vendor/symfony/service-contracts/composer.json b/api/vendor/symfony/service-contracts/composer.json index f058637010..fc8674a727 100644 --- a/api/vendor/symfony/service-contracts/composer.json +++ b/api/vendor/symfony/service-contracts/composer.json @@ -16,23 +16,23 @@ } ], "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "autoload": { - "psr-4": { "Symfony\\Contracts\\Service\\": "" } + "psr-4": { "Symfony\\Contracts\\Service\\": "" }, + "exclude-from-classmap": [ + "/Test/" + ] }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/api/vendor/symfony/string/AbstractString.php b/api/vendor/symfony/string/AbstractString.php index cf96a83780..f55c721615 100644 --- a/api/vendor/symfony/string/AbstractString.php +++ b/api/vendor/symfony/string/AbstractString.php @@ -74,7 +74,7 @@ public static function wrap(array $values): array foreach ($values as $k => $v) { if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) { - $keys = $keys ?? array_keys($values); + $keys ??= array_keys($values); $keys[$i] = $j; } @@ -383,7 +383,7 @@ public function isEmpty(): bool return '' === $this->string; } - abstract public function join(array $strings, string $lastGlue = null): static; + abstract public function join(array $strings, ?string $lastGlue = null): static; public function jsonSerialize(): string { @@ -429,16 +429,16 @@ abstract public function replaceMatches(string $fromRegexp, string|callable $to) abstract public function reverse(): static; - abstract public function slice(int $start = 0, int $length = null): static; + abstract public function slice(int $start = 0, ?int $length = null): static; abstract public function snake(): static; - abstract public function splice(string $replacement, int $start = 0, int $length = null): static; + abstract public function splice(string $replacement, int $start = 0, ?int $length = null): static; /** * @return static[] */ - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { if (null === $flags) { throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); @@ -448,19 +448,11 @@ public function split(string $delimiter, int $limit = null, int $flags = null): $delimiter .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Splitting failed with '.$k.'.'); - } - } - - throw new RuntimeException('Splitting failed with unknown error code.'); + throw new RuntimeException('Splitting failed with error: '.preg_last_error_msg()); } } finally { restore_error_handler(); @@ -503,7 +495,7 @@ public function startsWith(string|iterable $prefix): bool abstract public function title(bool $allWords = false): static; - public function toByteString(string $toEncoding = null): ByteString + public function toByteString(?string $toEncoding = null): ByteString { $b = new ByteString(); @@ -515,20 +507,14 @@ public function toByteString(string $toEncoding = null): ByteString return $b; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - try { - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); + $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); + } catch (\ValueError $e) { + if (!\function_exists('iconv')) { + throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e); } - } finally { - restore_error_handler(); + + $b->string = iconv('UTF-8', $toEncoding, $this->string); } return $b; @@ -558,7 +544,7 @@ abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF */ public function trimPrefix($prefix): static { - if (\is_array($prefix) || $prefix instanceof \Traversable) { + if (\is_array($prefix) || $prefix instanceof \Traversable) { // don't use is_iterable(), it's slow foreach ($prefix as $s) { $t = $this->trimPrefix($s); @@ -592,7 +578,7 @@ abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FE */ public function trimSuffix($suffix): static { - if (\is_array($suffix) || $suffix instanceof \Traversable) { + if (\is_array($suffix) || $suffix instanceof \Traversable) { // don't use is_iterable(), it's slow foreach ($suffix as $s) { $t = $this->trimSuffix($s); diff --git a/api/vendor/symfony/string/AbstractUnicodeString.php b/api/vendor/symfony/string/AbstractUnicodeString.php index 00096df0b0..70598e4099 100644 --- a/api/vendor/symfony/string/AbstractUnicodeString.php +++ b/api/vendor/symfony/string/AbstractUnicodeString.php @@ -37,20 +37,16 @@ abstract class AbstractUnicodeString extends AbstractString private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - - // the subset of upper case mappings that map one code point to many code points - private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; - private const UPPER_TO = ['SS', 'FF', 'FI', 'FL', 'FFI', 'FFL', 'ST', 'ST', 'ԵՒ', 'ՄՆ', 'ՄԵ', 'ՄԻ', 'ՎՆ', 'ՄԽ', 'ʼN', 'Ϊ́', 'Ϋ́', 'J̌', 'H̱', 'T̈', 'W̊', 'Y̊', 'Aʾ', 'Υ̓', 'Υ̓̀', 'Υ̓́', 'Υ̓͂', 'Α͂', 'Η͂', 'Ϊ̀', 'Ϊ́', 'Ι͂', 'Ϊ͂', 'Ϋ̀', 'Ϋ́', 'Ρ̓', 'Υ͂', 'Ϋ͂', 'Ω͂']; + private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; + private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - private static $transliterators = []; - private static $tableZero; - private static $tableWide; + private static array $transliterators = []; + private static array $tableZero; + private static array $tableWide; public static function fromCodePoints(int ...$codes): static { @@ -121,10 +117,10 @@ public function ascii(array $rules = []): self $s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s); $s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s); } elseif (\function_exists('transliterator_transliterate')) { - if (null === $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule)) { + if (null === $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule)) { if ('any-latin/bgn' === $rule) { $rule = 'any-latin'; - $transliterator = self::$transliterators[$rule] ?? self::$transliterators[$rule] = \Transliterator::create($rule); + $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule); } if (null === $transliterator) { @@ -159,7 +155,9 @@ public function ascii(array $rules = []): self public function camel(): static { $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { + $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?!\p{Lu})/u', static function ($m) { + static $i = 0; + return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); @@ -192,7 +190,7 @@ public function folded(bool $compat = true): static if (!$compat || !\defined('Normalizer::NFKC_CF')) { $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); + $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $str->string), 'UTF-8'); } else { $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); } @@ -200,7 +198,7 @@ public function folded(bool $compat = true): static return $str; } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = clone $this; @@ -230,19 +228,11 @@ public function match(string $regexp, int $flags = 0, int $offset = 0): array $regexp .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); + throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); } } finally { restore_error_handler(); @@ -322,14 +312,14 @@ public function replaceMatches(string $fromRegexp, string|callable $to): static $replace = 'preg_replace'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { $lastError = preg_last_error(); foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { + if ($lastError === $v && str_ends_with($k, '_ERROR')) { throw new RuntimeException('Matching failed with '.$k.'.'); } } @@ -368,9 +358,7 @@ public function title(bool $allWords = false): static $limit = $allWords ? -1 : 1; - $str->string = preg_replace_callback('/\b./u', static function (array $m): string { - return mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, $str->string, $limit); + $str->string = preg_replace_callback('/\b./u', static fn (array $m): string => mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'), $str->string, $limit); return $str; } @@ -467,7 +455,7 @@ public function width(bool $ignoreAnsiDecoration = true): int $width = 0; $s = str_replace(["\x00", "\x05", "\x07"], '', $this->string); - if (false !== strpos($s, "\r")) { + if (str_contains($s, "\r")) { $s = str_replace(["\r\n", "\r"], "\n", $s); } @@ -558,9 +546,7 @@ private function wcswidth(string $string): int return -1; } - if (null === self::$tableZero) { - self::$tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php'; - } + self::$tableZero ??= require __DIR__.'/Resources/data/wcswidth_table_zero.php'; if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { $lbound = 0; @@ -577,9 +563,7 @@ private function wcswidth(string $string): int } } - if (null === self::$tableWide) { - self::$tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php'; - } + self::$tableWide ??= require __DIR__.'/Resources/data/wcswidth_table_wide.php'; if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) { $lbound = 0; diff --git a/api/vendor/symfony/string/ByteString.php b/api/vendor/symfony/string/ByteString.php index 639d6435e7..3ebe43c10a 100644 --- a/api/vendor/symfony/string/ByteString.php +++ b/api/vendor/symfony/string/ByteString.php @@ -42,13 +42,13 @@ public function __construct(string $string = '') * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) */ - public static function fromRandom(int $length = 16, string $alphabet = null): self + public static function fromRandom(int $length = 16, ?string $alphabet = null): self { if ($length <= 0) { throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); } - $alphabet = $alphabet ?? self::ALPHABET_ALPHANUMERIC; + $alphabet ??= self::ALPHABET_ALPHANUMERIC; $alphabetSize = \strlen($alphabet); $bits = (int) ceil(log($alphabetSize, 2.0)); if ($bits <= 0 || $bits > 56) { @@ -205,7 +205,7 @@ public function isUtf8(): bool return '' === $this->string || preg_match('//u', $this->string); } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = clone $this; @@ -236,19 +236,11 @@ public function match(string $regexp, int $flags = 0, int $offset = 0): array $regexp .= 'i'; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); + throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); } } finally { restore_error_handler(); @@ -308,14 +300,14 @@ public function replaceMatches(string $fromRegexp, string|callable $to): static $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { if (null === $string = $replace($fromRegexp, $to, $this->string)) { $lastError = preg_last_error(); foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && '_ERROR' === substr($k, -6)) { + if ($lastError === $v && str_ends_with($k, '_ERROR')) { throw new RuntimeException('Matching failed with '.$k.'.'); } } @@ -340,7 +332,7 @@ public function reverse(): static return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); @@ -356,7 +348,7 @@ public function snake(): static return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { $str = clone $this; $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); @@ -364,9 +356,9 @@ public function splice(string $replacement, int $start = 0, int $length = null): return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { - if (1 > $limit = $limit ?? \PHP_INT_MAX) { + if (1 > $limit ??= \PHP_INT_MAX) { throw new InvalidArgumentException('Split limit must be a positive integer.'); } @@ -410,12 +402,12 @@ public function title(bool $allWords = false): static return $str; } - public function toUnicodeString(string $fromEncoding = null): UnicodeString + public function toUnicodeString(?string $fromEncoding = null): UnicodeString { return new UnicodeString($this->toCodePointString($fromEncoding)->string); } - public function toCodePointString(string $fromEncoding = null): CodePointString + public function toCodePointString(?string $fromEncoding = null): CodePointString { $u = new CodePointString(); @@ -425,7 +417,7 @@ public function toCodePointString(string $fromEncoding = null): CodePointString return $u; } - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); + set_error_handler(static fn ($t, $m) => throw new InvalidArgumentException($m)); try { try { diff --git a/api/vendor/symfony/string/CHANGELOG.md b/api/vendor/symfony/string/CHANGELOG.md index 53af364005..31a3b54dbf 100644 --- a/api/vendor/symfony/string/CHANGELOG.md +++ b/api/vendor/symfony/string/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +6.2 +--- + + * Add support for emoji in `AsciiSlugger` + 5.4 --- diff --git a/api/vendor/symfony/string/CodePointString.php b/api/vendor/symfony/string/CodePointString.php index 926ff79849..337bfc12ab 100644 --- a/api/vendor/symfony/string/CodePointString.php +++ b/api/vendor/symfony/string/CodePointString.php @@ -186,7 +186,7 @@ public function replace(string $from, string $to): static return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); @@ -194,7 +194,7 @@ public function slice(int $start = 0, int $length = null): static return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { if (!preg_match('//u', $replacement)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); @@ -208,9 +208,9 @@ public function splice(string $replacement, int $start = 0, int $length = null): return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { - if (1 > $limit = $limit ?? \PHP_INT_MAX) { + if (1 > $limit ??= \PHP_INT_MAX) { throw new InvalidArgumentException('Split limit must be a positive integer.'); } diff --git a/api/vendor/symfony/string/Inflector/EnglishInflector.php b/api/vendor/symfony/string/Inflector/EnglishInflector.php index 9f2fac675c..a5be28d66a 100644 --- a/api/vendor/symfony/string/Inflector/EnglishInflector.php +++ b/api/vendor/symfony/string/Inflector/EnglishInflector.php @@ -21,12 +21,39 @@ final class EnglishInflector implements InflectorInterface private const PLURAL_MAP = [ // First entry: plural suffix, reversed // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vocal + // Third entry: Whether the suffix may succeed a vowel // Fourth entry: Whether the suffix may succeed a consonant // Fifth entry: singular suffix, normal - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['a', 1, true, true, ['on', 'um']], + // bacteria (bacterium) + ['airetcab', 8, true, true, 'bacterium'], + + // corpora (corpus) + ['aroproc', 7, true, true, 'corpus'], + + // criteria (criterion) + ['airetirc', 8, true, true, 'criterion'], + + // curricula (curriculum) + ['alucirruc', 9, true, true, 'curriculum'], + + // quora (quorum) + ['arouq', 5, true, true, 'quorum'], + + // genera (genus) + ['areneg', 6, true, true, 'genus'], + + // media (medium) + ['aidem', 5, true, true, 'medium'], + + // memoranda (memorandum) + ['adnaromem', 9, true, true, 'memorandum'], + + // phenomena (phenomenon) + ['anemonehp', 9, true, true, 'phenomenon'], + + // strata (stratum) + ['atarts', 6, true, true, 'stratum'], // nebulae (nebula) ['ea', 2, true, true, 'a'], @@ -55,6 +82,9 @@ final class EnglishInflector implements InflectorInterface // indices (index), appendices (appendix), prices (price) ['seci', 4, false, true, ['ex', 'ix', 'ice']], + // codes (code) + ['sedoc', 5, false, true, 'code'], + // selfies (selfie) ['seifles', 7, true, true, 'selfie'], @@ -64,6 +94,9 @@ final class EnglishInflector implements InflectorInterface // movies (movie) ['seivom', 6, true, true, 'movie'], + // names (name) + ['seman', 5, true, false, 'name'], + // conspectuses (conspectus), prospectuses (prospectus) ['sesutcep', 8, true, true, 'pectus'], @@ -88,6 +121,12 @@ final class EnglishInflector implements InflectorInterface // accesses (access), addresses (address), kisses (kiss) ['sess', 4, true, false, 'ss'], + // statuses (status) + ['sesutats', 8, true, true, 'status'], + + // article (articles), ancle (ancles) + ['sel', 3, true, true, 'le'], + // analyses (analysis), ellipses (ellipsis), fungi (fungus), // neuroses (neurosis), theses (thesis), emphases (emphasis), // oases (oasis), crises (crisis), houses (house), bases (base), @@ -132,6 +171,9 @@ final class EnglishInflector implements InflectorInterface // shoes (shoe) ['se', 2, true, true, ['', 'e']], + // status (status) + ['sutats', 6, true, true, 'status'], + // tags (tag) ['s', 1, true, true, ''], @@ -150,10 +192,13 @@ final class EnglishInflector implements InflectorInterface private const SINGULAR_MAP = [ // First entry: singular suffix, reversed // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vocal + // Third entry: Whether the suffix may succeed a vowel // Fourth entry: Whether the suffix may succeed a consonant // Fifth entry: plural suffix, normal + // axes (axis) + ['sixa', 4, false, false, 'axes'], + // criterion (criteria) ['airetirc', 8, false, false, 'criterion'], @@ -223,7 +268,13 @@ final class EnglishInflector implements InflectorInterface // teeth (tooth) ['htoot', 5, true, true, 'teeth'], - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) + // albums (album) + ['mubla', 5, true, true, 'albums'], + + // quorums (quorum) + ['murouq', 6, true, true, ['quora', 'quorums']], + + // bacteria (bacterium), curricula (curriculum), media (medium), memoranda (memorandum), phenomena (phenomenon), strata (stratum) ['mu', 2, true, true, 'a'], // men (man), women (woman) @@ -232,17 +283,11 @@ final class EnglishInflector implements InflectorInterface // people (person) ['nosrep', 6, true, true, ['persons', 'people']], - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['noi', 3, true, true, 'ions'], - - // coupon (coupons) - ['nop', 3, true, true, 'pons'], - - // seasons (season), treasons (treason), poisons (poison), lessons (lesson) - ['nos', 3, true, true, 'sons'], + // criteria (criterion) + ['noiretirc', 9, true, true, 'criteria'], - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['no', 2, true, true, 'a'], + // phenomena (phenomenon) + ['nonemonehp', 10, true, true, 'phenomena'], // echoes (echo) ['ohce', 4, true, true, 'echoes'], @@ -253,6 +298,9 @@ final class EnglishInflector implements InflectorInterface // atlases (atlas) ['salta', 5, true, true, 'atlases'], + // aliases (alias) + ['saila', 5, true, true, 'aliases'], + // irises (iris) ['siri', 4, true, true, 'irises'], @@ -273,6 +321,15 @@ final class EnglishInflector implements InflectorInterface // circuses (circus) ['suc', 3, true, true, 'cuses'], + // hippocampi (hippocampus) + ['supmacoppih', 11, false, false, 'hippocampi'], + + // campuses (campus) + ['sup', 3, true, true, 'puses'], + + // status (status) + ['sutats', 6, true, true, ['status', 'statuses']], + // conspectuses (conspectus), prospectuses (prospectus) ['sutcep', 6, true, true, 'pectuses'], @@ -297,14 +354,14 @@ final class EnglishInflector implements InflectorInterface // indices (index) ['xedni', 5, false, true, ['indicies', 'indexes']], + // fax (faxes, faxxes) + ['xaf', 3, true, true, ['faxes', 'faxxes']], + // boxes (box) ['xo', 2, false, true, 'oxes'], - // indexes (index), matrixes (matrix) - ['x', 1, true, false, ['cies', 'xes']], - - // appendices (appendix) - ['xi', 2, false, true, 'ices'], + // indexes (index), matrixes (matrix), appendices (appendix) + ['x', 1, true, false, ['ces', 'xes']], // babies (baby) ['y', 1, false, true, 'ies'], @@ -328,15 +385,30 @@ final class EnglishInflector implements InflectorInterface // deer 'reed', + // equipment + 'tnempiuqe', + // feedback 'kcabdeef', // fish 'hsif', + // health + 'htlaeh', + + // history + 'yrotsih', + // info 'ofni', + // information + 'noitamrofni', + + // money + 'yenom', + // moose 'esoom', @@ -348,11 +420,17 @@ final class EnglishInflector implements InflectorInterface // species 'seiceps', + + // traffic + 'ciffart', + + // aircraft + 'tfarcria', + + // hardware + 'erawdrah', ]; - /** - * {@inheritdoc} - */ public function singularize(string $plural): array { $pluralRev = strrev($plural); @@ -384,14 +462,14 @@ public function singularize(string $plural): array if ($j === $suffixLength) { // Is there any character preceding the suffix in the plural string? if ($j < $pluralLength) { - $nextIsVocal = false !== strpos('aeiou', $lowerPluralRev[$j]); + $nextIsVowel = str_contains('aeiou', $lowerPluralRev[$j]); - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one + if (!$map[2] && $nextIsVowel) { + // suffix may not succeed a vowel but next char is one break; } - if (!$map[3] && !$nextIsVocal) { + if (!$map[3] && !$nextIsVowel) { // suffix may not succeed a consonant but next char is one break; } @@ -429,9 +507,6 @@ public function singularize(string $plural): array return [$plural]; } - /** - * {@inheritdoc} - */ public function pluralize(string $singular): array { $singularRev = strrev($singular); @@ -464,14 +539,14 @@ public function pluralize(string $singular): array if ($j === $suffixLength) { // Is there any character preceding the suffix in the plural string? if ($j < $singularLength) { - $nextIsVocal = false !== strpos('aeiou', $lowerSingularRev[$j]); + $nextIsVowel = str_contains('aeiou', $lowerSingularRev[$j]); - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one + if (!$map[2] && $nextIsVowel) { + // suffix may not succeed a vowel but next char is one break; } - if (!$map[3] && !$nextIsVocal) { + if (!$map[3] && !$nextIsVowel) { // suffix may not succeed a consonant but next char is one break; } diff --git a/api/vendor/symfony/string/Inflector/FrenchInflector.php b/api/vendor/symfony/string/Inflector/FrenchInflector.php index 612c8f2e0d..955abbf464 100644 --- a/api/vendor/symfony/string/Inflector/FrenchInflector.php +++ b/api/vendor/symfony/string/Inflector/FrenchInflector.php @@ -110,9 +110,6 @@ final class FrenchInflector implements InflectorInterface */ private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; - /** - * {@inheritdoc} - */ public function singularize(string $plural): array { if ($this->isInflectedWord($plural)) { @@ -130,9 +127,6 @@ public function singularize(string $plural): array return [$plural]; } - /** - * {@inheritdoc} - */ public function pluralize(string $singular): array { if ($this->isInflectedWord($singular)) { diff --git a/api/vendor/symfony/string/LICENSE b/api/vendor/symfony/string/LICENSE index 5c7ba0551c..f37c76b591 100644 --- a/api/vendor/symfony/string/LICENSE +++ b/api/vendor/symfony/string/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019-2023 Fabien Potencier +Copyright (c) 2019-present 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/api/vendor/symfony/string/LazyString.php b/api/vendor/symfony/string/LazyString.php index 37330782f2..3d893ef9e9 100644 --- a/api/vendor/symfony/string/LazyString.php +++ b/api/vendor/symfony/string/LazyString.php @@ -30,14 +30,16 @@ public static function fromCallable(callable|array $callback, mixed ...$argument } $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments, &$value): string { + $lazyString->value = static function () use (&$callback, &$arguments): string { + static $value; + if (null !== $arguments) { if (!\is_callable($callback)) { $callback[0] = $callback[0](); - $callback[1] = $callback[1] ?? '__invoke'; + $callback[1] ??= '__invoke'; } $value = $callback(...$arguments); - $callback = self::getPrettyName($callback); + $callback = !\is_scalar($value) && !$value instanceof \Stringable ? self::getPrettyName($callback) : 'callable'; $arguments = null; } @@ -50,7 +52,7 @@ public static function fromCallable(callable|array $callback, mixed ...$argument public static function fromStringable(string|int|float|bool|\Stringable $value): static { if (\is_object($value)) { - return static::fromCallable([$value, '__toString']); + return static::fromCallable($value->__toString(...)); } $lazyString = new static(); @@ -86,7 +88,7 @@ public function __toString(): string try { return $this->value = ($this->value)(); } catch (\Throwable $e) { - if (\TypeError::class === \get_class($e) && __FILE__ === $e->getFile()) { + if (\TypeError::class === $e::class && __FILE__ === $e->getFile()) { $type = explode(', ', $e->getMessage()); $type = substr(array_pop($type), 0, -\strlen(' returned')); $r = new \ReflectionFunction($this->value); @@ -127,7 +129,7 @@ private static function getPrettyName(callable $callback): string } elseif ($callback instanceof \Closure) { $r = new \ReflectionFunction($callback); - if (false !== strpos($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { + if (str_contains($r->name, '{closure') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { return $r->name; } diff --git a/api/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/api/vendor/symfony/string/Resources/data/wcswidth_table_wide.php index 5a647e67bf..6a75094212 100644 --- a/api/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ b/api/vendor/symfony/string/Resources/data/wcswidth_table_wide.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 15.0.0 - * Date: 2022-10-05T17:16:36+02:00 + * Unicode version: 16.0.0 + * Date: 2024-09-11T08:21:22+00:00 */ return [ @@ -44,6 +44,10 @@ 9748, 9749, ], + [ + 9776, + 9783, + ], [ 9800, 9811, @@ -52,6 +56,10 @@ 9855, 9855, ], + [ + 9866, + 9871, + ], [ 9875, 9875, @@ -166,7 +174,7 @@ ], [ 12272, - 12283, + 12287, ], [ 12288, @@ -394,7 +402,11 @@ ], [ 12736, - 12771, + 12773, + ], + [ + 12783, + 12783, ], [ 12784, @@ -448,6 +460,10 @@ 13312, 19903, ], + [ + 19904, + 19967, + ], [ 19968, 40959, @@ -832,6 +848,10 @@ 101120, 101589, ], + [ + 101631, + 101631, + ], [ 101632, 101640, @@ -876,6 +896,14 @@ 110960, 111355, ], + [ + 119552, + 119638, + ], + [ + 119648, + 119670, + ], [ 126980, 126980, @@ -1050,23 +1078,19 @@ ], [ 129664, - 129672, - ], - [ - 129680, - 129725, + 129673, ], [ - 129727, - 129733, + 129679, + 129734, ], [ 129742, - 129755, + 129756, ], [ - 129760, - 129768, + 129759, + 129769, ], [ 129776, @@ -1110,6 +1134,14 @@ ], [ 191457, + 191471, + ], + [ + 191472, + 192093, + ], + [ + 192094, 194559, ], [ diff --git a/api/vendor/symfony/string/Resources/data/wcswidth_table_zero.php b/api/vendor/symfony/string/Resources/data/wcswidth_table_zero.php index 9ae7330325..fdd7f3c7e8 100644 --- a/api/vendor/symfony/string/Resources/data/wcswidth_table_zero.php +++ b/api/vendor/symfony/string/Resources/data/wcswidth_table_zero.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 15.0.0 - * Date: 2022-10-05T17:16:37+02:00 + * Unicode version: 16.0.0 + * Date: 2024-09-11T08:21:22+00:00 */ return [ @@ -109,7 +109,7 @@ 2139, ], [ - 2200, + 2199, 2207, ], [ @@ -916,12 +916,16 @@ 68900, 68903, ], + [ + 68969, + 68973, + ], [ 69291, 69292, ], [ - 69373, + 69372, 69375, ], [ @@ -1044,6 +1048,26 @@ 70512, 70516, ], + [ + 70587, + 70592, + ], + [ + 70606, + 70606, + ], + [ + 70608, + 70608, + ], + [ + 70610, + 70610, + ], + [ + 70625, + 70626, + ], [ 70712, 70719, @@ -1122,6 +1146,10 @@ ], [ 71453, + 71453, + ], + [ + 71455, 71455, ], [ @@ -1276,6 +1304,10 @@ 73538, 73538, ], + [ + 73562, + 73562, + ], [ 78912, 78912, @@ -1284,6 +1316,14 @@ 78919, 78933, ], + [ + 90398, + 90409, + ], + [ + 90413, + 90415, + ], [ 92912, 92916, @@ -1400,6 +1440,10 @@ 124140, 124143, ], + [ + 124398, + 124399, + ], [ 125136, 125142, diff --git a/api/vendor/symfony/string/Resources/functions.php b/api/vendor/symfony/string/Resources/functions.php index c950894f39..7a970400a8 100644 --- a/api/vendor/symfony/string/Resources/functions.php +++ b/api/vendor/symfony/string/Resources/functions.php @@ -31,7 +31,7 @@ function b(?string $string = ''): ByteString */ function s(?string $string = ''): AbstractString { - $string = $string ?? ''; + $string ??= ''; return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); } diff --git a/api/vendor/symfony/string/Slugger/AsciiSlugger.php b/api/vendor/symfony/string/Slugger/AsciiSlugger.php index 548a6b93a6..a9693d4942 100644 --- a/api/vendor/symfony/string/Slugger/AsciiSlugger.php +++ b/api/vendor/symfony/string/Slugger/AsciiSlugger.php @@ -11,6 +11,7 @@ namespace Symfony\Component\String\Slugger; +use Symfony\Component\Intl\Transliterator\EmojiTransliterator; use Symfony\Component\String\AbstractUnicodeString; use Symfony\Component\String\UnicodeString; use Symfony\Contracts\Translation\LocaleAwareInterface; @@ -58,6 +59,7 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface private \Closure|array $symbolsMap = [ 'en' => ['@' => 'at', '&' => 'and'], ]; + private bool|string $emoji = false; /** * Cache of transliterators per locale. @@ -66,50 +68,63 @@ class AsciiSlugger implements SluggerInterface, LocaleAwareInterface */ private array $transliterators = []; - public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) + public function __construct(?string $defaultLocale = null, array|\Closure|null $symbolsMap = null) { $this->defaultLocale = $defaultLocale; $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; } /** - * {@inheritdoc} + * @return void */ public function setLocale(string $locale) { $this->defaultLocale = $locale; } - /** - * {@inheritdoc} - */ public function getLocale(): string { return $this->defaultLocale; } /** - * {@inheritdoc} + * @param bool|string $emoji true will use the same locale, + * false will disable emoji, + * and a string to use a specific locale */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString + public function withEmoji(bool|string $emoji = true): static + { + if (false !== $emoji && !class_exists(EmojiTransliterator::class)) { + throw new \LogicException(sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__)); + } + + $new = clone $this; + $new->emoji = $emoji; + + return $new; + } + + public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString { - $locale = $locale ?? $this->defaultLocale; + $locale ??= $this->defaultLocale; $transliterator = []; - if ($locale && ('de' === $locale || 0 === strpos($locale, 'de_'))) { + if ($locale && ('de' === $locale || str_starts_with($locale, 'de_'))) { // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) $transliterator = ['de-ASCII']; } elseif (\function_exists('transliterator_transliterate') && $locale) { $transliterator = (array) $this->createTransliterator($locale); } + if ($emojiTransliterator = $this->createEmojiTransliterator($locale)) { + $transliterator[] = $emojiTransliterator; + } + if ($this->symbolsMap instanceof \Closure) { // If the symbols map is passed as a closure, there is no need to fallback to the parent locale // as the closure can just provide substitutions for all locales of interest. $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static function ($s) use ($symbolsMap, $locale) { - return $symbolsMap($s, $locale); - }); + array_unshift($transliterator, static fn ($s) => $symbolsMap($s, $locale)); } $unicodeString = (new UnicodeString($string))->ascii($transliterator); @@ -161,6 +176,25 @@ private function createTransliterator(string $locale): ?\Transliterator return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; } + private function createEmojiTransliterator(?string $locale): ?EmojiTransliterator + { + if (\is_string($this->emoji)) { + $locale = $this->emoji; + } elseif (!$this->emoji) { + return null; + } + + while (null !== $locale) { + try { + return EmojiTransliterator::create("emoji-$locale"); + } catch (\IntlException) { + $locale = self::getParentLocale($locale); + } + } + + return null; + } + private static function getParentLocale(?string $locale): ?string { if (!$locale) { diff --git a/api/vendor/symfony/string/Slugger/SluggerInterface.php b/api/vendor/symfony/string/Slugger/SluggerInterface.php index c679ed9331..dd0d58102c 100644 --- a/api/vendor/symfony/string/Slugger/SluggerInterface.php +++ b/api/vendor/symfony/string/Slugger/SluggerInterface.php @@ -23,5 +23,5 @@ interface SluggerInterface /** * Creates a slug for the given string and locale, using appropriate transliteration when needed. */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; + public function slug(string $string, string $separator = '-', ?string $locale = null): AbstractUnicodeString; } diff --git a/api/vendor/symfony/string/UnicodeString.php b/api/vendor/symfony/string/UnicodeString.php index 70cf4c5434..75af2da42d 100644 --- a/api/vendor/symfony/string/UnicodeString.php +++ b/api/vendor/symfony/string/UnicodeString.php @@ -34,23 +34,32 @@ class UnicodeString extends AbstractUnicodeString { public function __construct(string $string = '') { - $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); + if ('' === $string || normalizer_is_normalized($this->string = $string)) { + return; + } - if (false === $this->string) { + if (false === $string = normalizer_normalize($string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + + $this->string = $string; } public function append(string ...$suffix): static { $str = clone $this; $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } @@ -139,7 +148,7 @@ public function indexOf(string|iterable|AbstractString $needle, int $offset = 0) try { $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset); - } catch (\ValueError $e) { + } catch (\ValueError) { return null; } @@ -176,7 +185,7 @@ public function indexOfLast(string|iterable|AbstractString $needle, int $offset return false === $i ? null : $i; } - public function join(array $strings, string $lastGlue = null): static + public function join(array $strings, ?string $lastGlue = null): static { $str = parent::join($strings, $lastGlue); normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); @@ -209,12 +218,17 @@ public function prepend(string ...$prefix): static { $str = clone $this; $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } @@ -235,11 +249,16 @@ public function replace(string $from, string $to): static } $str->string = $result.$tail; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + + $str->string = $string; } return $str; @@ -253,7 +272,7 @@ public function replaceMatches(string $fromRegexp, string|callable $to): static return $str; } - public function slice(int $start = 0, int $length = null): static + public function slice(int $start = 0, ?int $length = null): static { $str = clone $this; @@ -262,25 +281,30 @@ public function slice(int $start = 0, int $length = null): static return $str; } - public function splice(string $replacement, int $start = 0, int $length = null): static + public function splice(string $replacement, int $start = 0, ?int $length = null): static { $str = clone $this; $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - if (false === $str->string) { + if (normalizer_is_normalized($str->string)) { + return $str; + } + + if (false === $string = normalizer_normalize($str->string)) { throw new InvalidArgumentException('Invalid UTF-8 string.'); } + $str->string = $string; + return $str; } - public function split(string $delimiter, int $limit = null, int $flags = null): array + public function split(string $delimiter, ?int $limit = null, ?int $flags = null): array { - if (1 > $limit = $limit ?? 2147483647) { + if (1 > $limit ??= 2147483647) { throw new InvalidArgumentException('Split limit must be a positive integer.'); } @@ -338,6 +362,9 @@ public function startsWith(string|iterable|AbstractString $prefix): bool return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); } + /** + * @return void + */ public function __wakeup() { if (!\is_string($this->string)) { diff --git a/api/vendor/symfony/string/composer.json b/api/vendor/symfony/string/composer.json index 187323f8cc..56c1368828 100644 --- a/api/vendor/symfony/string/composer.json +++ b/api/vendor/symfony/string/composer.json @@ -16,20 +16,21 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "autoload": { "psr-4": { "Symfony\\Component\\String\\": "" }, diff --git a/api/vendor/symfony/translation-contracts/.gitignore b/api/vendor/symfony/translation-contracts/.gitignore deleted file mode 100644 index c49a5d8df5..0000000000 --- a/api/vendor/symfony/translation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/api/vendor/symfony/translation-contracts/LICENSE b/api/vendor/symfony/translation-contracts/LICENSE index 74cdc2dbf6..7536caeae8 100644 --- a/api/vendor/symfony/translation-contracts/LICENSE +++ b/api/vendor/symfony/translation-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2022 Fabien Potencier +Copyright (c) 2018-present 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/api/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/api/vendor/symfony/translation-contracts/LocaleAwareInterface.php index 6923b977e4..db40ba13e0 100644 --- a/api/vendor/symfony/translation-contracts/LocaleAwareInterface.php +++ b/api/vendor/symfony/translation-contracts/LocaleAwareInterface.php @@ -16,6 +16,8 @@ interface LocaleAwareInterface /** * Sets the current locale. * + * @return void + * * @throws \InvalidArgumentException If the locale contains invalid characters */ public function setLocale(string $locale); diff --git a/api/vendor/symfony/translation-contracts/README.md b/api/vendor/symfony/translation-contracts/README.md index 42e5c51754..b211d5849c 100644 --- a/api/vendor/symfony/translation-contracts/README.md +++ b/api/vendor/symfony/translation-contracts/README.md @@ -3,7 +3,7 @@ Symfony Translation 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 +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/api/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/api/vendor/symfony/translation-contracts/Test/TranslatorTest.php index 4e5999df4d..756228af54 100644 --- a/api/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ b/api/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -30,7 +30,7 @@ */ class TranslatorTest extends TestCase { - private $defaultLocale; + private string $defaultLocale; protected function setUp(): void { @@ -114,7 +114,7 @@ public function testGetLocaleReturnsDefaultLocaleIfNotSet() $this->assertEquals('en', $translator->getLocale()); } - public function getTransTests() + public static function getTransTests() { return [ ['Symfony is great!', 'Symfony is great!', []], @@ -122,7 +122,7 @@ public function getTransTests() ]; } - public function getTransChoiceTests() + public static function getTransChoiceTests() { return [ ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], @@ -137,7 +137,7 @@ public function getTransChoiceTests() } /** - * @dataProvider getInternal + * @dataProvider getInterval */ public function testInterval($expected, $number, $interval) { @@ -146,7 +146,7 @@ public function testInterval($expected, $number, $interval) $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number])); } - public function getInternal() + public static function getInterval() { return [ ['foo', 3, '{1,2, 3 ,4}'], @@ -183,13 +183,14 @@ public function testReturnMessageIfExactlyOneStandardRuleIsGiven() */ public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) { - $this->expectException(\InvalidArgumentException::class); $translator = $this->getTranslator(); + $this->expectException(\InvalidArgumentException::class); + $translator->trans($id, ['%count%' => $number]); } - public function getNonMatchingMessages() + public static function getNonMatchingMessages() { return [ ['{0} There are no apples|{1} There is one apple', 2], @@ -199,7 +200,7 @@ public function getNonMatchingMessages() ]; } - public function getChooseTests() + public static function getChooseTests() { return [ ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], @@ -255,13 +256,13 @@ public function getChooseTests() new-line in it. Selector = 0.|{1}This is a text with a new-line in it. Selector = 1.|[1,Inf]This is a text with a new-line in it. Selector > 1.', 5], - // with double-quotes and id split accros lines + // with double-quotes and id split across lines ['This is a text with a new-line in it. Selector = 1.', '{0}This is a text with a new-line in it. Selector = 0.|{1}This is a text with a new-line in it. Selector = 1.|[1,Inf]This is a text with a new-line in it. Selector > 1.', 1], - // with single-quotes and id split accros lines + // with single-quotes and id split across lines ['This is a text with a new-line in it. Selector > 1.', '{0}This is a text with a new-line in it. Selector = 0.|{1}This is a text with a @@ -269,9 +270,9 @@ public function getChooseTests() new-line in it. Selector > 1.', 5], // with single-quotes and \n in text ['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0], - // with double-quotes and id split accros lines + // with double-quotes and id split across lines ["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1], - // esacape pipe + // escape pipe ['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0], // Empty plural set (2 plural forms) from a .PO file ['', '|', 1], @@ -315,7 +316,7 @@ public function testLangcodes($nplural, $langCodes) * * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. */ - public function successLangcodes(): array + public static function successLangcodes(): array { return [ ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], @@ -334,7 +335,7 @@ public function successLangcodes(): array * * @return array with nplural together with langcodes */ - public function failingLangcodes(): array + public static function failingLangcodes(): array { return [ ['1', ['fa']], diff --git a/api/vendor/symfony/translation-contracts/TranslatableInterface.php b/api/vendor/symfony/translation-contracts/TranslatableInterface.php index 47fd6fa029..8554697ec0 100644 --- a/api/vendor/symfony/translation-contracts/TranslatableInterface.php +++ b/api/vendor/symfony/translation-contracts/TranslatableInterface.php @@ -16,5 +16,5 @@ */ interface TranslatableInterface { - public function trans(TranslatorInterface $translator, string $locale = null): string; + public function trans(TranslatorInterface $translator, ?string $locale = null): string; } diff --git a/api/vendor/symfony/translation-contracts/TranslatorInterface.php b/api/vendor/symfony/translation-contracts/TranslatorInterface.php index 018db07ebf..7fa69878f8 100644 --- a/api/vendor/symfony/translation-contracts/TranslatorInterface.php +++ b/api/vendor/symfony/translation-contracts/TranslatorInterface.php @@ -59,7 +59,7 @@ interface TranslatorInterface * * @throws \InvalidArgumentException If the locale contains invalid characters */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string; + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string; /** * Returns the default locale. diff --git a/api/vendor/symfony/translation-contracts/TranslatorTrait.php b/api/vendor/symfony/translation-contracts/TranslatorTrait.php index 9c264bd293..63f6fb333d 100644 --- a/api/vendor/symfony/translation-contracts/TranslatorTrait.php +++ b/api/vendor/symfony/translation-contracts/TranslatorTrait.php @@ -23,25 +23,19 @@ trait TranslatorTrait private ?string $locale = null; /** - * {@inheritdoc} + * @return void */ public function setLocale(string $locale) { $this->locale = $locale; } - /** - * {@inheritdoc} - */ public function getLocale(): string { return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); } - /** - * {@inheritdoc} - */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { if (null === $id || '' === $id) { return ''; @@ -140,121 +134,92 @@ private function getPluralizationRule(float $number, string $locale): int { $number = abs($number); - switch ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { - case 'af': - case 'bn': - case 'bg': - case 'ca': - case 'da': - case 'de': - case 'el': - case 'en': - case 'en_US_POSIX': - case 'eo': - case 'es': - case 'et': - case 'eu': - case 'fa': - case 'fi': - case 'fo': - case 'fur': - case 'fy': - case 'gl': - case 'gu': - case 'ha': - case 'he': - case 'hu': - case 'is': - case 'it': - case 'ku': - case 'lb': - case 'ml': - case 'mn': - case 'mr': - case 'nah': - case 'nb': - case 'ne': - case 'nl': - case 'nn': - case 'no': - case 'oc': - case 'om': - case 'or': - case 'pa': - case 'pap': - case 'ps': - case 'pt': - case 'so': - case 'sq': - case 'sv': - case 'sw': - case 'ta': - case 'te': - case 'tk': - case 'ur': - case 'zu': - return (1 == $number) ? 0 : 1; - - case 'am': - case 'bh': - case 'fil': - case 'fr': - case 'gun': - case 'hi': - case 'hy': - case 'ln': - case 'mg': - case 'nso': - case 'pt_BR': - case 'ti': - case 'wa': - return ($number < 2) ? 0 : 1; - - case 'be': - case 'bs': - case 'hr': - case 'ru': - case 'sh': - case 'sr': - case 'uk': - return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - - case 'cs': - case 'sk': - return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); - - case 'ga': - return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2); - - case 'lt': - return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - - case 'sl': - return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3)); - - case 'mk': - return (1 == $number % 10) ? 0 : 1; - - case 'mt': - return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); - - case 'lv': - return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2); - - case 'pl': - return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); - - case 'cy': - return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3)); - - case 'ro': - return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); - - case 'ar': - return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))); - - default: - return 0; - } + return match ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { + 'af', + 'bn', + 'bg', + 'ca', + 'da', + 'de', + 'el', + 'en', + 'en_US_POSIX', + 'eo', + 'es', + 'et', + 'eu', + 'fa', + 'fi', + 'fo', + 'fur', + 'fy', + 'gl', + 'gu', + 'ha', + 'he', + 'hu', + 'is', + 'it', + 'ku', + 'lb', + 'ml', + 'mn', + 'mr', + 'nah', + 'nb', + 'ne', + 'nl', + 'nn', + 'no', + 'oc', + 'om', + 'or', + 'pa', + 'pap', + 'ps', + 'pt', + 'so', + 'sq', + 'sv', + 'sw', + 'ta', + 'te', + 'tk', + 'ur', + 'zu' => (1 == $number) ? 0 : 1, + 'am', + 'bh', + 'fil', + 'fr', + 'gun', + 'hi', + 'hy', + 'ln', + 'mg', + 'nso', + 'pt_BR', + 'ti', + 'wa' => ($number < 2) ? 0 : 1, + 'be', + 'bs', + 'hr', + 'ru', + 'sh', + 'sr', + 'uk' => ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2), + 'cs', + 'sk' => (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2), + 'ga' => (1 == $number) ? 0 : ((2 == $number) ? 1 : 2), + 'lt' => ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2), + 'sl' => (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3)), + 'mk' => (1 == $number % 10) ? 0 : 1, + 'mt' => (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)), + 'lv' => (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2), + 'pl' => (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2), + 'cy' => (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3)), + 'ro' => (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2), + 'ar' => (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))), + default => 0, + }; } } diff --git a/api/vendor/symfony/translation-contracts/composer.json b/api/vendor/symfony/translation-contracts/composer.json index 875242f6d9..181651e0d9 100644 --- a/api/vendor/symfony/translation-contracts/composer.json +++ b/api/vendor/symfony/translation-contracts/composer.json @@ -16,18 +16,18 @@ } ], "require": { - "php": ">=8.0.2" - }, - "suggest": { - "symfony/translation-implementation": "" + "php": ">=8.1" }, "autoload": { - "psr-4": { "Symfony\\Contracts\\Translation\\": "" } + "psr-4": { "Symfony\\Contracts\\Translation\\": "" }, + "exclude-from-classmap": [ + "/Test/" + ] }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/api/vendor/symfony/translation/CHANGELOG.md b/api/vendor/symfony/translation/CHANGELOG.md index 160b5e694f..5f9098c07a 100644 --- a/api/vendor/symfony/translation/CHANGELOG.md +++ b/api/vendor/symfony/translation/CHANGELOG.md @@ -1,6 +1,35 @@ CHANGELOG ========= +6.4 +--- + + * Give current locale to `LocaleSwitcher::runWithLocale()`'s callback + * Add `--as-tree` option to `translation:pull` command to write YAML messages as a tree-like structure + * [BC BREAK] Add argument `$buildDir` to `DataCollectorTranslator::warmUp()` + * Add `DataCollectorTranslatorPass` and `LoggingTranslatorPass` (moved from `FrameworkBundle`) + * Add `PhraseTranslationProvider` + +6.2.7 +----- + + * [BC BREAK] The following data providers for `ProviderFactoryTestCase` are now static: + `supportsProvider()`, `createProvider()`, `unsupportedSchemeProvider()`and `incompleteDsnProvider()` + * [BC BREAK] `ProviderTestCase::toStringProvider()` is now static + +6.2 +--- + + * Deprecate `PhpStringTokenParser` + * Deprecate `PhpExtractor` in favor of `PhpAstExtractor` + * Add `PhpAstExtractor` (requires [nikic/php-parser](https://github.com/nikic/php-parser) to be installed) + +6.1 +--- + + * Parameters implementing `TranslatableInterface` are processed + * Add the file extension to the `XliffFileDumper` constructor + 5.4 --- diff --git a/api/vendor/symfony/translation/Catalogue/AbstractOperation.php b/api/vendor/symfony/translation/Catalogue/AbstractOperation.php index 43a52fab20..7dff58ff40 100644 --- a/api/vendor/symfony/translation/Catalogue/AbstractOperation.php +++ b/api/vendor/symfony/translation/Catalogue/AbstractOperation.php @@ -34,11 +34,6 @@ abstract class AbstractOperation implements OperationInterface protected $target; protected $result; - /** - * @var array|null The domains affected by this operation - */ - private $domains; - /** * This array stores 'all', 'new' and 'obsolete' messages for all valid domains. * @@ -62,6 +57,8 @@ abstract class AbstractOperation implements OperationInterface */ protected $messages; + private array $domains; + /** * @throws LogicException */ @@ -77,12 +74,9 @@ public function __construct(MessageCatalogueInterface $source, MessageCatalogueI $this->messages = []; } - /** - * {@inheritdoc} - */ public function getDomains(): array { - if (null === $this->domains) { + if (!isset($this->domains)) { $domains = []; foreach ([$this->source, $this->target] as $catalogue) { foreach ($catalogue->getDomains() as $domain) { @@ -100,9 +94,6 @@ public function getDomains(): array return $this->domains; } - /** - * {@inheritdoc} - */ public function getMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { @@ -116,9 +107,6 @@ public function getMessages(string $domain): array return $this->messages[$domain][self::ALL_BATCH]; } - /** - * {@inheritdoc} - */ public function getNewMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { @@ -132,9 +120,6 @@ public function getNewMessages(string $domain): array return $this->messages[$domain][self::NEW_BATCH]; } - /** - * {@inheritdoc} - */ public function getObsoleteMessages(string $domain): array { if (!\in_array($domain, $this->getDomains())) { @@ -148,9 +133,6 @@ public function getObsoleteMessages(string $domain): array return $this->messages[$domain][self::OBSOLETE_BATCH]; } - /** - * {@inheritdoc} - */ public function getResult(): MessageCatalogueInterface { foreach ($this->getDomains() as $domain) { @@ -174,12 +156,12 @@ public function moveMessagesToIntlDomainsIfPossible(string $batch = self::ALL_BA foreach ($this->getDomains() as $domain) { $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; - switch ($batch) { - case self::OBSOLETE_BATCH: $messages = $this->getObsoleteMessages($domain); break; - case self::NEW_BATCH: $messages = $this->getNewMessages($domain); break; - case self::ALL_BATCH: $messages = $this->getMessages($domain); break; - default: throw new \InvalidArgumentException(sprintf('$batch argument must be one of ["%s", "%s", "%s"].', self::ALL_BATCH, self::NEW_BATCH, self::OBSOLETE_BATCH)); - } + $messages = match ($batch) { + self::OBSOLETE_BATCH => $this->getObsoleteMessages($domain), + self::NEW_BATCH => $this->getNewMessages($domain), + self::ALL_BATCH => $this->getMessages($domain), + default => throw new \InvalidArgumentException(sprintf('$batch argument must be one of ["%s", "%s", "%s"].', self::ALL_BATCH, self::NEW_BATCH, self::OBSOLETE_BATCH)), + }; if (!$messages || (!$this->source->all($intlDomain) && $this->source->all($domain))) { continue; @@ -198,6 +180,8 @@ public function moveMessagesToIntlDomainsIfPossible(string $batch = self::ALL_BA * stores the results. * * @param string $domain The domain which the operation will be performed for + * + * @return void */ abstract protected function processDomain(string $domain); } diff --git a/api/vendor/symfony/translation/Catalogue/MergeOperation.php b/api/vendor/symfony/translation/Catalogue/MergeOperation.php index 87db2fb031..1b777a8435 100644 --- a/api/vendor/symfony/translation/Catalogue/MergeOperation.php +++ b/api/vendor/symfony/translation/Catalogue/MergeOperation.php @@ -25,7 +25,7 @@ class MergeOperation extends AbstractOperation { /** - * {@inheritdoc} + * @return void */ protected function processDomain(string $domain) { @@ -36,6 +36,18 @@ protected function processDomain(string $domain) ]; $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; + foreach ($this->target->getCatalogueMetadata('', $domain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $domain)) { + $this->result->setCatalogueMetadata($key, $value, $domain); + } + } + + foreach ($this->target->getCatalogueMetadata('', $intlDomain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $intlDomain)) { + $this->result->setCatalogueMetadata($key, $value, $intlDomain); + } + } + foreach ($this->source->all($domain) as $id => $message) { $this->messages[$domain]['all'][$id] = $message; $d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain; diff --git a/api/vendor/symfony/translation/Catalogue/TargetOperation.php b/api/vendor/symfony/translation/Catalogue/TargetOperation.php index 682b5752fc..2c0ec722ee 100644 --- a/api/vendor/symfony/translation/Catalogue/TargetOperation.php +++ b/api/vendor/symfony/translation/Catalogue/TargetOperation.php @@ -26,7 +26,7 @@ class TargetOperation extends AbstractOperation { /** - * {@inheritdoc} + * @return void */ protected function processDomain(string $domain) { @@ -37,6 +37,18 @@ protected function processDomain(string $domain) ]; $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; + foreach ($this->target->getCatalogueMetadata('', $domain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $domain)) { + $this->result->setCatalogueMetadata($key, $value, $domain); + } + } + + foreach ($this->target->getCatalogueMetadata('', $intlDomain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $intlDomain)) { + $this->result->setCatalogueMetadata($key, $value, $intlDomain); + } + } + // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, // because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} // diff --git a/api/vendor/symfony/translation/CatalogueMetadataAwareInterface.php b/api/vendor/symfony/translation/CatalogueMetadataAwareInterface.php new file mode 100644 index 0000000000..c845959f1a --- /dev/null +++ b/api/vendor/symfony/translation/CatalogueMetadataAwareInterface.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * This interface is used to get, set, and delete metadata about the Catalogue. + * + * @author Hugo Alliaume + */ +interface CatalogueMetadataAwareInterface +{ + /** + * Gets catalogue metadata for the given domain and key. + * + * Passing an empty domain will return an array with all catalogue metadata indexed by + * domain and then by key. Passing an empty key will return an array with all + * catalogue metadata for the given domain. + * + * @return mixed The value that was set or an array with the domains/keys or null + */ + public function getCatalogueMetadata(string $key = '', string $domain = 'messages'): mixed; + + /** + * Adds catalogue metadata to a message domain. + * + * @return void + */ + public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages'); + + /** + * Deletes catalogue metadata for the given key and domain. + * + * Passing an empty domain will delete all catalogue metadata. Passing an empty key will + * delete all metadata for the given domain. + * + * @return void + */ + public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages'); +} diff --git a/api/vendor/symfony/translation/Command/TranslationPullCommand.php b/api/vendor/symfony/translation/Command/TranslationPullCommand.php index f30e64d787..5d9c092c38 100644 --- a/api/vendor/symfony/translation/Command/TranslationPullCommand.php +++ b/api/vendor/symfony/translation/Command/TranslationPullCommand.php @@ -34,9 +34,9 @@ final class TranslationPullCommand extends Command { use TranslationTrait; - private $providerCollection; - private $writer; - private $reader; + private TranslationProviderCollection $providerCollection; + private TranslationWriterInterface $writer; + private TranslationReaderInterface $reader; private string $defaultLocale; private array $transPaths; private array $enabledLocales; @@ -64,9 +64,8 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti if ($input->mustSuggestOptionValuesFor('domains')) { $provider = $this->providerCollection->get($input->getArgument('provider')); - if ($provider && method_exists($provider, 'getDomains')) { - $domains = $provider->getDomains(); - $suggestions->suggestValues($domains); + if (method_exists($provider, 'getDomains')) { + $suggestions->suggestValues($provider->getDomains()); } return; @@ -83,10 +82,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti } } - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { $keys = $this->providerCollection->keys(); $defaultProvider = 1 === \count($keys) ? $keys[0] : null; @@ -99,6 +95,7 @@ protected function configure() new InputOption('domains', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Specify the domains to pull.'), new InputOption('locales', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Specify the locales to pull.'), new InputOption('format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format.', 'xlf12'), + new InputOption('as-tree', null, InputOption::VALUE_OPTIONAL, 'Write messages as a tree-like structure. Needs --format=yaml. The given value defines the level where to switch to inline YAML'), ]) ->setHelp(<<<'EOF' The %command.name% command pulls translations from the given provider. Only @@ -120,9 +117,6 @@ protected function configure() ; } - /** - * {@inheritdoc} - */ protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); @@ -133,6 +127,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $locales = $input->getOption('locales') ?: $this->enabledLocales; $domains = $input->getOption('domains'); $format = $input->getOption('format'); + $asTree = (int) $input->getOption('as-tree'); $xliffVersion = '1.2'; if ($intlIcu && !$force) { @@ -149,6 +144,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'path' => end($this->transPaths), 'xliff_version' => $xliffVersion, 'default_locale' => $this->defaultLocale, + 'as_tree' => (bool) $asTree, + 'inline' => $asTree, ]; if (!$domains) { diff --git a/api/vendor/symfony/translation/Command/TranslationPushCommand.php b/api/vendor/symfony/translation/Command/TranslationPushCommand.php index 795e68c130..1d04adbc9d 100644 --- a/api/vendor/symfony/translation/Command/TranslationPushCommand.php +++ b/api/vendor/symfony/translation/Command/TranslationPushCommand.php @@ -34,8 +34,8 @@ final class TranslationPushCommand extends Command { use TranslationTrait; - private $providers; - private $reader; + private TranslationProviderCollection $providers; + private TranslationReaderInterface $reader; private array $transPaths; private array $enabledLocales; @@ -73,10 +73,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti } } - /** - * {@inheritdoc} - */ - protected function configure() + protected function configure(): void { $keys = $this->providers->keys(); $defaultProvider = 1 === \count($keys) ? $keys[0] : null; @@ -113,15 +110,12 @@ protected function configure() ; } - /** - * {@inheritdoc} - */ protected function execute(InputInterface $input, OutputInterface $output): int { $provider = $this->providers->get($input->getArgument('provider')); if (!$this->enabledLocales) { - throw new InvalidArgumentException(sprintf('You must define "framework.translator.enabled_locales" or "framework.translator.providers.%s.locales" config key in order to work with translation providers.', parse_url($provider, \PHP_URL_SCHEME))); + throw new InvalidArgumentException(sprintf('You must define "framework.enabled_locales" or "framework.translator.providers.%s.locales" config key in order to work with translation providers.', parse_url($provider, \PHP_URL_SCHEME))); } $io = new SymfonyStyle($input, $output); diff --git a/api/vendor/symfony/translation/Command/XliffLintCommand.php b/api/vendor/symfony/translation/Command/XliffLintCommand.php index f062fb79f4..ba946389e7 100644 --- a/api/vendor/symfony/translation/Command/XliffLintCommand.php +++ b/api/vendor/symfony/translation/Command/XliffLintCommand.php @@ -41,23 +41,23 @@ class XliffLintCommand extends Command private ?\Closure $isReadableProvider; private bool $requireStrictFileNames; - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true) + public function __construct(?string $name = null, ?callable $directoryIteratorProvider = null, ?callable $isReadableProvider = null, bool $requireStrictFileNames = true) { parent::__construct($name); - $this->directoryIteratorProvider = null === $directoryIteratorProvider || $directoryIteratorProvider instanceof \Closure ? $directoryIteratorProvider : \Closure::fromCallable($directoryIteratorProvider); - $this->isReadableProvider = null === $isReadableProvider || $isReadableProvider instanceof \Closure ? $isReadableProvider : \Closure::fromCallable($isReadableProvider); + $this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...); + $this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...); $this->requireStrictFileNames = $requireStrictFileNames; } /** - * {@inheritdoc} + * @return void */ protected function configure() { $this ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') + ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions()))) ->setHelp(<<%command.name% command lints an XLIFF file and outputs to STDOUT the first encountered syntax error. @@ -109,7 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int return $this->display($io, $filesInfo); } - private function validate(string $content, string $file = null): array + private function validate(string $content, ?string $file = null): array { $errors = []; @@ -154,21 +154,17 @@ private function validate(string $content, string $file = null): array return ['file' => $file, 'valid' => 0 === \count($errors), 'messages' => $errors]; } - private function display(SymfonyStyle $io, array $files) + private function display(SymfonyStyle $io, array $files): int { - switch ($this->format) { - case 'txt': - return $this->displayTxt($io, $files); - case 'json': - return $this->displayJson($io, $files); - case 'github': - return $this->displayTxt($io, $files, true); - default: - throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); - } + return match ($this->format) { + 'txt' => $this->displayTxt($io, $files), + 'json' => $this->displayJson($io, $files), + 'github' => $this->displayTxt($io, $files, true), + default => throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))), + }; } - private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false) + private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int { $countFiles = \count($filesInfo); $erroredFiles = 0; @@ -184,9 +180,7 @@ private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGit // general document errors have a '-1' line number $line = -1 === $error['line'] ? null : $error['line']; - if ($githubReporter) { - $githubReporter->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null); - } + $githubReporter?->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null); return null === $line ? $error['message'] : sprintf('Line %d, Column %d: %s', $line, $error['column'], $error['message']); }, $info['messages'])); @@ -202,7 +196,7 @@ private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGit return min($erroredFiles, 1); } - private function displayJson(SymfonyStyle $io, array $filesInfo) + private function displayJson(SymfonyStyle $io, array $filesInfo): int { $errors = 0; @@ -218,7 +212,10 @@ private function displayJson(SymfonyStyle $io, array $filesInfo) return min($errors, 1); } - private function getFiles(string $fileOrDirectory) + /** + * @return iterable<\SplFileInfo> + */ + private function getFiles(string $fileOrDirectory): iterable { if (is_file($fileOrDirectory)) { yield new \SplFileInfo($fileOrDirectory); @@ -235,14 +232,15 @@ private function getFiles(string $fileOrDirectory) } } - private function getDirectoryIterator(string $directory) + /** + * @return iterable<\SplFileInfo> + */ + private function getDirectoryIterator(string $directory): iterable { - $default = function ($directory) { - return new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - }; + $default = fn ($directory) => new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), + \RecursiveIteratorIterator::LEAVES_ONLY + ); if (null !== $this->directoryIteratorProvider) { return ($this->directoryIteratorProvider)($directory, $default); @@ -251,11 +249,9 @@ private function getDirectoryIterator(string $directory) return $default($directory); } - private function isReadable(string $fileOrDirectory) + private function isReadable(string $fileOrDirectory): bool { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; + $default = fn ($fileOrDirectory) => is_readable($fileOrDirectory); if (null !== $this->isReadableProvider) { return ($this->isReadableProvider)($fileOrDirectory, $default); @@ -278,7 +274,12 @@ private function getTargetLanguageFromFile(\DOMDocument $xliffContents): ?string public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void { if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues(['txt', 'json', 'github']); + $suggestions->suggestValues($this->getAvailableFormatOptions()); } } + + private function getAvailableFormatOptions(): array + { + return ['txt', 'json', 'github']; + } } diff --git a/api/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/api/vendor/symfony/translation/DataCollector/TranslationDataCollector.php index 0f7901d522..d4f49cc66d 100644 --- a/api/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +++ b/api/vendor/symfony/translation/DataCollector/TranslationDataCollector.php @@ -25,17 +25,14 @@ */ class TranslationDataCollector extends DataCollector implements LateDataCollectorInterface { - private $translator; + private DataCollectorTranslator $translator; public function __construct(DataCollectorTranslator $translator) { $this->translator = $translator; } - /** - * {@inheritdoc} - */ - public function lateCollect() + public function lateCollect(): void { $messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages()); @@ -45,19 +42,13 @@ public function lateCollect() $this->data = $this->cloneVar($this->data); } - /** - * {@inheritdoc} - */ - public function collect(Request $request, Response $response, \Throwable $exception = null) + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void { $this->data['locale'] = $this->translator->getLocale(); $this->data['fallback_locales'] = $this->translator->getFallbackLocales(); } - /** - * {@inheritdoc} - */ - public function reset() + public function reset(): void { $this->data = []; } @@ -82,7 +73,7 @@ public function getCountDefines(): int return $this->data[DataCollectorTranslator::MESSAGE_DEFINED] ?? 0; } - public function getLocale() + public function getLocale(): ?string { return !empty($this->data['locale']) ? $this->data['locale'] : null; } @@ -90,20 +81,17 @@ public function getLocale() /** * @internal */ - public function getFallbackLocales() + public function getFallbackLocales(): Data|array { return (isset($this->data['fallback_locales']) && \count($this->data['fallback_locales']) > 0) ? $this->data['fallback_locales'] : []; } - /** - * {@inheritdoc} - */ public function getName(): string { return 'translation'; } - private function sanitizeCollectedMessages(array $messages) + private function sanitizeCollectedMessages(array $messages): array { $result = []; foreach ($messages as $key => $message) { @@ -128,7 +116,7 @@ private function sanitizeCollectedMessages(array $messages) return $result; } - private function computeCount(array $messages) + private function computeCount(array $messages): array { $count = [ DataCollectorTranslator::MESSAGE_DEFINED => 0, @@ -143,7 +131,7 @@ private function computeCount(array $messages) return $count; } - private function sanitizeString(string $string, int $length = 80) + private function sanitizeString(string $string, int $length = 80): string { $string = trim(preg_replace('/\s+/', ' ', $string)); diff --git a/api/vendor/symfony/translation/DataCollectorTranslator.php b/api/vendor/symfony/translation/DataCollectorTranslator.php index 2a08b09604..a2832ee8ef 100644 --- a/api/vendor/symfony/translation/DataCollectorTranslator.php +++ b/api/vendor/symfony/translation/DataCollectorTranslator.php @@ -25,7 +25,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter public const MESSAGE_MISSING = 1; public const MESSAGE_EQUALS_FALLBACK = 2; - private $translator; + private TranslatorInterface $translator; private array $messages = []; /** @@ -40,10 +40,7 @@ public function __construct(TranslatorInterface $translator) $this->translator = $translator; } - /** - * {@inheritdoc} - */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->collectMessage($locale, $domain, $id, $trans, $parameters); @@ -52,46 +49,32 @@ public function trans(?string $id, array $parameters = [], string $domain = null } /** - * {@inheritdoc} + * @return void */ public function setLocale(string $locale) { $this->translator->setLocale($locale); } - /** - * {@inheritdoc} - */ public function getLocale(): string { return $this->translator->getLocale(); } - /** - * {@inheritdoc} - */ - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } - /** - * {@inheritdoc} - */ public function getCatalogues(): array { return $this->translator->getCatalogues(); } - /** - * {@inheritdoc} - * - * @return string[] - */ - public function warmUp(string $cacheDir): array + public function warmUp(string $cacheDir, ?string $buildDir = null): array { if ($this->translator instanceof WarmableInterface) { - return (array) $this->translator->warmUp($cacheDir); + return (array) $this->translator->warmUp($cacheDir, $buildDir); } return []; @@ -110,7 +93,7 @@ public function getFallbackLocales(): array } /** - * Passes through all unknown calls onto the translator object. + * @return mixed */ public function __call(string $method, array $args) { @@ -122,11 +105,9 @@ public function getCollectedMessages(): array return $this->messages; } - private function collectMessage(?string $locale, ?string $domain, string $id, string $translation, ?array $parameters = []) + private function collectMessage(?string $locale, ?string $domain, string $id, string $translation, ?array $parameters = []): void { - if (null === $domain) { - $domain = 'messages'; - } + $domain ??= 'messages'; $catalogue = $this->translator->getCatalogue($locale); $locale = $catalogue->getLocale(); diff --git a/api/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php b/api/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php new file mode 100644 index 0000000000..cdf63be4bc --- /dev/null +++ b/api/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Translation\TranslatorBagInterface; + +/** + * @author Christian Flothmann + */ +class DataCollectorTranslatorPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container): void + { + if (!$container->has('translator')) { + return; + } + + $translatorClass = $container->getParameterBag()->resolveValue($container->findDefinition('translator')->getClass()); + + if (!is_subclass_of($translatorClass, TranslatorBagInterface::class)) { + $container->removeDefinition('translator.data_collector'); + $container->removeDefinition('data_collector.translation'); + } + } +} diff --git a/api/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php b/api/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php new file mode 100644 index 0000000000..c21552f975 --- /dev/null +++ b/api/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\Translation\TranslatorBagInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * @author Abdellatif Ait boudad + */ +class LoggingTranslatorPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container): void + { + if (!$container->hasAlias('logger') || !$container->hasAlias('translator')) { + return; + } + + if (!$container->hasParameter('translator.logging') || !$container->getParameter('translator.logging')) { + return; + } + + $translatorAlias = $container->getAlias('translator'); + $definition = $container->getDefinition((string) $translatorAlias); + $class = $container->getParameterBag()->resolveValue($definition->getClass()); + + if (!$r = $container->getReflectionClass($class)) { + throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $translatorAlias)); + } + + if (!$r->isSubclassOf(TranslatorInterface::class) || !$r->isSubclassOf(TranslatorBagInterface::class)) { + return; + } + + $container->getDefinition('translator.logging')->setDecoratedService('translator'); + $warmer = $container->getDefinition('translation.warmer'); + $subscriberAttributes = $warmer->getTag('container.service_subscriber'); + $warmer->clearTag('container.service_subscriber'); + + foreach ($subscriberAttributes as $k => $v) { + if ((!isset($v['id']) || 'translator' !== $v['id']) && (!isset($v['key']) || 'translator' !== $v['key'])) { + $warmer->addTag('container.service_subscriber', $v); + } + } + $warmer->addTag('container.service_subscriber', ['key' => 'translator', 'id' => 'translator.logging.inner']); + } +} diff --git a/api/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/api/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php index 4020a07889..2ece6ac7b3 100644 --- a/api/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php +++ b/api/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php @@ -20,6 +20,9 @@ */ class TranslationDumperPass implements CompilerPassInterface { + /** + * @return void + */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition('translation.writer')) { diff --git a/api/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/api/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php index ee7c47ae4e..1baf9341e4 100644 --- a/api/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php +++ b/api/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php @@ -21,6 +21,9 @@ */ class TranslationExtractorPass implements CompilerPassInterface { + /** + * @return void + */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition('translation.extractor')) { diff --git a/api/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/api/vendor/symfony/translation/DependencyInjection/TranslatorPass.php index be79cdaf02..dd6ea3c831 100644 --- a/api/vendor/symfony/translation/DependencyInjection/TranslatorPass.php +++ b/api/vendor/symfony/translation/DependencyInjection/TranslatorPass.php @@ -18,6 +18,9 @@ class TranslatorPass implements CompilerPassInterface { + /** + * @return void + */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition('translator.default')) { @@ -49,6 +52,23 @@ public function process(ContainerBuilder $container) ->replaceArgument(3, $loaders) ; + if ($container->hasDefinition('validator') && $container->hasDefinition('translation.extractor.visitor.constraint')) { + $constraintVisitorDefinition = $container->getDefinition('translation.extractor.visitor.constraint'); + $constraintClassNames = []; + + foreach ($container->getDefinitions() as $definition) { + if (!$definition->hasTag('validator.constraint_validator')) { + continue; + } + // Resolve constraint validator FQCN even if defined as %foo.validator.class% parameter + $className = $container->getParameterBag()->resolveValue($definition->getClass()); + // Extraction of the constraint class name from the Constraint Validator FQCN + $constraintClassNames[] = str_replace('Validator', '', substr(strrchr($className, '\\'), 1)); + } + + $constraintVisitorDefinition->setArgument(0, $constraintClassNames); + } + if (!$container->hasParameter('twig.default_path')) { return; } diff --git a/api/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/api/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php index b85c066218..1756e3c8c5 100644 --- a/api/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php +++ b/api/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php @@ -16,12 +16,15 @@ use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ServiceLocator; +use Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver; /** * @author Yonel Ceruto */ class TranslatorPathsPass extends AbstractRecursivePass { + protected bool $skipScalars = true; + private int $level = 0; /** @@ -39,6 +42,9 @@ class TranslatorPathsPass extends AbstractRecursivePass */ private array $controllers = []; + /** + * @return void + */ public function process(ContainerBuilder $container) { if (!$container->hasDefinition('translator')) { @@ -120,28 +126,20 @@ protected function processValue(mixed $value, bool $isRoot = false): mixed private function findControllerArguments(ContainerBuilder $container): array { - if ($container->hasDefinition('argument_resolver.service')) { - $argument = $container->getDefinition('argument_resolver.service')->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } - - return $argument->getArgument(0); + if (!$container->has('argument_resolver.service')) { + return []; } + $resolverDef = $container->findDefinition('argument_resolver.service'); - if ($container->hasDefinition('debug.'.'argument_resolver.service')) { - $argument = $container->getDefinition('debug.'.'argument_resolver.service')->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } - $argument = $argument->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } + if (TraceableValueResolver::class === $resolverDef->getClass()) { + $resolverDef = $container->getDefinition($resolverDef->getArgument(0)); + } - return $argument->getArgument(0); + $argument = $resolverDef->getArgument(0); + if ($argument instanceof Reference) { + $argument = $container->getDefinition($argument); } - return []; + return $argument->getArgument(0); } } diff --git a/api/vendor/symfony/translation/Dumper/CsvFileDumper.php b/api/vendor/symfony/translation/Dumper/CsvFileDumper.php index 0bd3f5e0f1..a4ae476b37 100644 --- a/api/vendor/symfony/translation/Dumper/CsvFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/CsvFileDumper.php @@ -23,15 +23,12 @@ class CsvFileDumper extends FileDumper private string $delimiter = ';'; private string $enclosure = '"'; - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $handle = fopen('php://memory', 'r+'); foreach ($messages->all($domain) as $source => $target) { - fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure); + fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure, '\\'); } rewind($handle); @@ -43,6 +40,8 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra /** * Sets the delimiter and escape character for CSV. + * + * @return void */ public function setCsvControl(string $delimiter = ';', string $enclosure = '"') { @@ -50,9 +49,6 @@ public function setCsvControl(string $delimiter = ';', string $enclosure = '"') $this->enclosure = $enclosure; } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'csv'; diff --git a/api/vendor/symfony/translation/Dumper/DumperInterface.php b/api/vendor/symfony/translation/Dumper/DumperInterface.php index 7cdaef5151..6bf42931ef 100644 --- a/api/vendor/symfony/translation/Dumper/DumperInterface.php +++ b/api/vendor/symfony/translation/Dumper/DumperInterface.php @@ -25,6 +25,8 @@ interface DumperInterface * Dumps the message catalogue. * * @param array $options Options that are used by the dumper + * + * @return void */ public function dump(MessageCatalogue $messages, array $options = []); } diff --git a/api/vendor/symfony/translation/Dumper/FileDumper.php b/api/vendor/symfony/translation/Dumper/FileDumper.php index 6bad4ff323..e30d4770ee 100644 --- a/api/vendor/symfony/translation/Dumper/FileDumper.php +++ b/api/vendor/symfony/translation/Dumper/FileDumper.php @@ -35,7 +35,7 @@ abstract class FileDumper implements DumperInterface /** * Sets the template for the relative paths to files. * - * @param string $relativePathTemplate A template for the relative paths to files + * @return void */ public function setRelativePathTemplate(string $relativePathTemplate) { @@ -43,7 +43,7 @@ public function setRelativePathTemplate(string $relativePathTemplate) } /** - * {@inheritdoc} + * @return void */ public function dump(MessageCatalogue $messages, array $options = []) { diff --git a/api/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/api/vendor/symfony/translation/Dumper/IcuResFileDumper.php index f13f86c801..72c1ec0890 100644 --- a/api/vendor/symfony/translation/Dumper/IcuResFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/IcuResFileDumper.php @@ -20,14 +20,8 @@ */ class IcuResFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ protected $relativePathTemplate = '%domain%/%locale%.%extension%'; - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $data = $indexes = $resources = ''; @@ -89,14 +83,11 @@ private function writePadding(string $data): ?string return $padding ? str_repeat("\xAA", 4 - $padding) : null; } - private function getPosition(string $data) + private function getPosition(string $data): float|int { return (\strlen($data) + 28) / 4; } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'res'; diff --git a/api/vendor/symfony/translation/Dumper/IniFileDumper.php b/api/vendor/symfony/translation/Dumper/IniFileDumper.php index 75032be145..6cbdef6067 100644 --- a/api/vendor/symfony/translation/Dumper/IniFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/IniFileDumper.php @@ -20,9 +20,6 @@ */ class IniFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $output = ''; @@ -35,9 +32,6 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra return $output; } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'ini'; diff --git a/api/vendor/symfony/translation/Dumper/JsonFileDumper.php b/api/vendor/symfony/translation/Dumper/JsonFileDumper.php index 11027303a1..e5035397f7 100644 --- a/api/vendor/symfony/translation/Dumper/JsonFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/JsonFileDumper.php @@ -20,9 +20,6 @@ */ class JsonFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $flags = $options['json_encoding'] ?? \JSON_PRETTY_PRINT; @@ -30,9 +27,6 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra return json_encode($messages->all($domain), $flags); } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'json'; diff --git a/api/vendor/symfony/translation/Dumper/MoFileDumper.php b/api/vendor/symfony/translation/Dumper/MoFileDumper.php index 1ea546275b..9ded5f4ef3 100644 --- a/api/vendor/symfony/translation/Dumper/MoFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/MoFileDumper.php @@ -21,9 +21,6 @@ */ class MoFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $sources = $targets = $sourceOffsets = $targetOffsets = ''; @@ -57,7 +54,7 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra .$this->writeLong($offset[2] + $sourcesStart + $sourcesSize); } - $output = implode('', array_map([$this, 'writeLong'], $header)) + $output = implode('', array_map($this->writeLong(...), $header)) .$sourceOffsets .$targetOffsets .$sources @@ -67,9 +64,6 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra return $output; } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'mo'; diff --git a/api/vendor/symfony/translation/Dumper/PhpFileDumper.php b/api/vendor/symfony/translation/Dumper/PhpFileDumper.php index 565d893754..51e90665d7 100644 --- a/api/vendor/symfony/translation/Dumper/PhpFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/PhpFileDumper.php @@ -20,17 +20,11 @@ */ class PhpFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { return "all($domain), true).";\n"; } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'php'; diff --git a/api/vendor/symfony/translation/Dumper/PoFileDumper.php b/api/vendor/symfony/translation/Dumper/PoFileDumper.php index 313e504587..a2d0deb781 100644 --- a/api/vendor/symfony/translation/Dumper/PoFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/PoFileDumper.php @@ -20,9 +20,6 @@ */ class PoFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $output = 'msgid ""'."\n"; @@ -68,7 +65,7 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra return $output; } - private function getStandardRules(string $id) + private function getStandardRules(string $id): array { // Partly copied from TranslatorTrait::trans. $parts = []; @@ -111,9 +108,6 @@ private function getStandardRules(string $id) return $standardRules; } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'po'; diff --git a/api/vendor/symfony/translation/Dumper/QtFileDumper.php b/api/vendor/symfony/translation/Dumper/QtFileDumper.php index 819409fc07..0373e9c109 100644 --- a/api/vendor/symfony/translation/Dumper/QtFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/QtFileDumper.php @@ -20,9 +20,6 @@ */ class QtFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $dom = new \DOMDocument('1.0', 'utf-8'); @@ -51,9 +48,6 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra return $dom->saveXML(); } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return 'ts'; diff --git a/api/vendor/symfony/translation/Dumper/XliffFileDumper.php b/api/vendor/symfony/translation/Dumper/XliffFileDumper.php index b8a109a41f..d0f016b23c 100644 --- a/api/vendor/symfony/translation/Dumper/XliffFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/XliffFileDumper.php @@ -21,9 +21,11 @@ */ class XliffFileDumper extends FileDumper { - /** - * {@inheritdoc} - */ + public function __construct( + private string $extension = 'xlf', + ) { + } + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { $xliffVersion = '1.2'; @@ -47,15 +49,12 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra throw new InvalidArgumentException(sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion)); } - /** - * {@inheritdoc} - */ protected function getExtension(): string { - return 'xlf'; + return $this->extension; } - private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ?string $domain, array $options = []) + private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ?string $domain, array $options = []): string { $toolInfo = ['tool-id' => 'symfony', 'tool-name' => 'Symfony']; if (\array_key_exists('tool_info', $options)) { @@ -81,6 +80,15 @@ private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ? $xliffTool->setAttribute($id, $value); } + if ($catalogueMetadata = $messages->getCatalogueMetadata('', $domain) ?? []) { + $xliffPropGroup = $xliffHead->appendChild($dom->createElement('prop-group')); + foreach ($catalogueMetadata as $key => $value) { + $xliffProp = $xliffPropGroup->appendChild($dom->createElement('prop')); + $xliffProp->setAttribute('prop-type', $key); + $xliffProp->appendChild($dom->createTextNode($value)); + } + } + $xliffBody = $xliffFile->appendChild($dom->createElement('body')); foreach ($messages->all($domain) as $source => $target) { $translation = $dom->createElement('trans-unit'); @@ -129,7 +137,7 @@ private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ? return $dom->saveXML(); } - private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ?string $domain) + private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ?string $domain): string { $dom = new \DOMDocument('1.0', 'utf-8'); $dom->formatOutput = true; @@ -147,6 +155,16 @@ private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ? $xliffFile->setAttribute('id', $domain.'.'.$messages->getLocale()); } + if ($catalogueMetadata = $messages->getCatalogueMetadata('', $domain) ?? []) { + $xliff->setAttribute('xmlns:m', 'urn:oasis:names:tc:xliff:metadata:2.0'); + $xliffMetadata = $xliffFile->appendChild($dom->createElement('m:metadata')); + foreach ($catalogueMetadata as $key => $value) { + $xliffMeta = $xliffMetadata->appendChild($dom->createElement('prop')); + $xliffMeta->setAttribute('type', $key); + $xliffMeta->appendChild($dom->createTextNode($value)); + } + } + foreach ($messages->all($domain) as $source => $target) { $translation = $dom->createElement('unit'); $translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._')); @@ -196,7 +214,7 @@ private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ? return $dom->saveXML(); } - private function hasMetadataArrayInfo(string $key, array $metadata = null): bool + private function hasMetadataArrayInfo(string $key, ?array $metadata = null): bool { return is_iterable($metadata[$key] ?? null); } diff --git a/api/vendor/symfony/translation/Dumper/YamlFileDumper.php b/api/vendor/symfony/translation/Dumper/YamlFileDumper.php index d0cfbefaa9..d2670331e6 100644 --- a/api/vendor/symfony/translation/Dumper/YamlFileDumper.php +++ b/api/vendor/symfony/translation/Dumper/YamlFileDumper.php @@ -30,9 +30,6 @@ public function __construct(string $extension = 'yml') $this->extension = $extension; } - /** - * {@inheritdoc} - */ public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string { if (!class_exists(Yaml::class)) { @@ -52,9 +49,6 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra return Yaml::dump($data); } - /** - * {@inheritdoc} - */ protected function getExtension(): string { return $this->extension; diff --git a/api/vendor/symfony/translation/Exception/IncompleteDsnException.php b/api/vendor/symfony/translation/Exception/IncompleteDsnException.php index cb0ce027eb..b304bde018 100644 --- a/api/vendor/symfony/translation/Exception/IncompleteDsnException.php +++ b/api/vendor/symfony/translation/Exception/IncompleteDsnException.php @@ -13,7 +13,7 @@ class IncompleteDsnException extends InvalidArgumentException { - public function __construct(string $message, string $dsn = null, \Throwable $previous = null) + public function __construct(string $message, ?string $dsn = null, ?\Throwable $previous = null) { if ($dsn) { $message = sprintf('Invalid "%s" provider DSN: ', $dsn).$message; diff --git a/api/vendor/symfony/translation/Exception/MissingRequiredOptionException.php b/api/vendor/symfony/translation/Exception/MissingRequiredOptionException.php index 2b5f808065..46152e254c 100644 --- a/api/vendor/symfony/translation/Exception/MissingRequiredOptionException.php +++ b/api/vendor/symfony/translation/Exception/MissingRequiredOptionException.php @@ -16,7 +16,7 @@ */ class MissingRequiredOptionException extends IncompleteDsnException { - public function __construct(string $option, string $dsn = null, \Throwable $previous = null) + public function __construct(string $option, ?string $dsn = null, ?\Throwable $previous = null) { $message = sprintf('The option "%s" is required but missing.', $option); diff --git a/api/vendor/symfony/translation/Exception/ProviderException.php b/api/vendor/symfony/translation/Exception/ProviderException.php index 331ff7586e..f2981f58bf 100644 --- a/api/vendor/symfony/translation/Exception/ProviderException.php +++ b/api/vendor/symfony/translation/Exception/ProviderException.php @@ -18,10 +18,10 @@ */ class ProviderException extends RuntimeException implements ProviderExceptionInterface { - private $response; + private ResponseInterface $response; private string $debug; - public function __construct(string $message, ResponseInterface $response, int $code = 0, \Exception $previous = null) + public function __construct(string $message, ResponseInterface $response, int $code = 0, ?\Exception $previous = null) { $this->response = $response; $this->debug = $response->getInfo('debug') ?? ''; diff --git a/api/vendor/symfony/translation/Exception/UnsupportedSchemeException.php b/api/vendor/symfony/translation/Exception/UnsupportedSchemeException.php index 7fbaa8f04d..8d32951847 100644 --- a/api/vendor/symfony/translation/Exception/UnsupportedSchemeException.php +++ b/api/vendor/symfony/translation/Exception/UnsupportedSchemeException.php @@ -29,9 +29,13 @@ class UnsupportedSchemeException extends LogicException 'class' => Bridge\Lokalise\LokaliseProviderFactory::class, 'package' => 'symfony/lokalise-translation-provider', ], + 'phrase' => [ + 'class' => Bridge\Phrase\PhraseProviderFactory::class, + 'package' => 'symfony/phrase-translation-provider', + ], ]; - public function __construct(Dsn $dsn, string $name = null, array $supported = []) + public function __construct(Dsn $dsn, ?string $name = null, array $supported = []) { $provider = $dsn->getScheme(); if (false !== $pos = strpos($provider, '+')) { @@ -39,7 +43,7 @@ public function __construct(Dsn $dsn, string $name = null, array $supported = [] } $package = self::SCHEME_TO_PACKAGE_MAP[$provider] ?? null; if ($package && !class_exists($package['class'])) { - parent::__construct(sprintf('Unable to synchronize translations via "%s" as the provider is not installed; try running "composer require %s".', $provider, $package['package'])); + parent::__construct(sprintf('Unable to synchronize translations via "%s" as the provider is not installed. Try running "composer require %s".', $provider, $package['package'])); return; } diff --git a/api/vendor/symfony/translation/Extractor/ChainExtractor.php b/api/vendor/symfony/translation/Extractor/ChainExtractor.php index e58e82f056..d36f7f385a 100644 --- a/api/vendor/symfony/translation/Extractor/ChainExtractor.php +++ b/api/vendor/symfony/translation/Extractor/ChainExtractor.php @@ -29,6 +29,8 @@ class ChainExtractor implements ExtractorInterface /** * Adds a loader to the translation extractor. + * + * @return void */ public function addExtractor(string $format, ExtractorInterface $extractor) { @@ -36,7 +38,7 @@ public function addExtractor(string $format, ExtractorInterface $extractor) } /** - * {@inheritdoc} + * @return void */ public function setPrefix(string $prefix) { @@ -46,7 +48,7 @@ public function setPrefix(string $prefix) } /** - * {@inheritdoc} + * @return void */ public function extract(string|iterable $directory, MessageCatalogue $catalogue) { diff --git a/api/vendor/symfony/translation/Extractor/ExtractorInterface.php b/api/vendor/symfony/translation/Extractor/ExtractorInterface.php index b76a7f20ba..642130af75 100644 --- a/api/vendor/symfony/translation/Extractor/ExtractorInterface.php +++ b/api/vendor/symfony/translation/Extractor/ExtractorInterface.php @@ -25,11 +25,15 @@ interface ExtractorInterface * Extracts translation messages from files, a file or a directory to the catalogue. * * @param string|iterable $resource Files, a file or a directory + * + * @return void */ public function extract(string|iterable $resource, MessageCatalogue $catalogue); /** * Sets the prefix that should be used for new found messages. + * + * @return void */ public function setPrefix(string $prefix); } diff --git a/api/vendor/symfony/translation/Extractor/PhpAstExtractor.php b/api/vendor/symfony/translation/Extractor/PhpAstExtractor.php new file mode 100644 index 0000000000..06fc77de3c --- /dev/null +++ b/api/vendor/symfony/translation/Extractor/PhpAstExtractor.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; +use PhpParser\Parser; +use PhpParser\ParserFactory; +use Symfony\Component\Finder\Finder; +use Symfony\Component\Translation\Extractor\Visitor\AbstractVisitor; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * PhpAstExtractor extracts translation messages from a PHP AST. + * + * @author Mathieu Santostefano + */ +final class PhpAstExtractor extends AbstractFileExtractor implements ExtractorInterface +{ + private Parser $parser; + + public function __construct( + /** + * @param iterable $visitors + */ + private readonly iterable $visitors, + private string $prefix = '', + ) { + if (!class_exists(ParserFactory::class)) { + throw new \LogicException(sprintf('You cannot use "%s" as the "nikic/php-parser" package is not installed. Try running "composer require nikic/php-parser".', static::class)); + } + + $this->parser = (new ParserFactory())->createForHostVersion(); + } + + public function extract(iterable|string $resource, MessageCatalogue $catalogue): void + { + foreach ($this->extractFiles($resource) as $file) { + $traverser = new NodeTraverser(); + + // This is needed to resolve namespaces in class methods/constants. + $nameResolver = new NodeVisitor\NameResolver(); + $traverser->addVisitor($nameResolver); + + /** @var AbstractVisitor&NodeVisitor $visitor */ + foreach ($this->visitors as $visitor) { + $visitor->initialize($catalogue, $file, $this->prefix); + $traverser->addVisitor($visitor); + } + + $nodes = $this->parser->parse(file_get_contents($file)); + $traverser->traverse($nodes); + } + } + + public function setPrefix(string $prefix): void + { + $this->prefix = $prefix; + } + + protected function canBeExtracted(string $file): bool + { + return 'php' === pathinfo($file, \PATHINFO_EXTENSION) + && $this->isFile($file) + && preg_match('/\bt\(|->trans\(|TranslatableMessage|Symfony\\\\Component\\\\Validator\\\\Constraints/i', file_get_contents($file)); + } + + protected function extractFromDirectory(array|string $resource): iterable|Finder + { + if (!class_exists(Finder::class)) { + throw new \LogicException(sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); + } + + return (new Finder())->files()->name('*.php')->in($resource); + } +} diff --git a/api/vendor/symfony/translation/Extractor/PhpExtractor.php b/api/vendor/symfony/translation/Extractor/PhpExtractor.php index 1b86cc5913..7ff27f7c80 100644 --- a/api/vendor/symfony/translation/Extractor/PhpExtractor.php +++ b/api/vendor/symfony/translation/Extractor/PhpExtractor.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Translation\Extractor; +trigger_deprecation('symfony/translation', '6.2', '"%s" is deprecated, use "%s" instead.', PhpExtractor::class, PhpAstExtractor::class); + use Symfony\Component\Finder\Finder; use Symfony\Component\Translation\MessageCatalogue; @@ -18,6 +20,8 @@ * PhpExtractor extracts translation messages from a PHP template. * * @author Michel Salib + * + * @deprecated since Symfony 6.2, use the PhpAstExtractor instead */ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface { @@ -129,7 +133,7 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface ]; /** - * {@inheritdoc} + * @return void */ public function extract(string|iterable $resource, MessageCatalogue $catalog) { @@ -142,7 +146,7 @@ public function extract(string|iterable $resource, MessageCatalogue $catalog) } /** - * {@inheritdoc} + * @return void */ public function setPrefix(string $prefix) { @@ -164,7 +168,7 @@ protected function normalizeToken(mixed $token): ?string /** * Seeks to a non-whitespace token. */ - private function seekToNextRelevantToken(\Iterator $tokenIterator) + private function seekToNextRelevantToken(\Iterator $tokenIterator): void { for (; $tokenIterator->valid(); $tokenIterator->next()) { $t = $tokenIterator->current(); @@ -174,7 +178,7 @@ private function seekToNextRelevantToken(\Iterator $tokenIterator) } } - private function skipMethodArgument(\Iterator $tokenIterator) + private function skipMethodArgument(\Iterator $tokenIterator): void { $openBraces = 0; @@ -199,7 +203,7 @@ private function skipMethodArgument(\Iterator $tokenIterator) * Extracts the message from the iterator while the tokens * match allowed message tokens. */ - private function getValue(\Iterator $tokenIterator) + private function getValue(\Iterator $tokenIterator): string { $message = ''; $docToken = ''; @@ -257,6 +261,8 @@ private function getValue(\Iterator $tokenIterator) /** * Extracts trans message from PHP tokens. + * + * @return void */ protected function parseTokens(array $tokens, MessageCatalogue $catalog, string $filename) { @@ -314,9 +320,6 @@ protected function canBeExtracted(string $file): bool return $this->isFile($file) && 'php' === pathinfo($file, \PATHINFO_EXTENSION); } - /** - * {@inheritdoc} - */ protected function extractFromDirectory(string|array $directory): iterable { if (!class_exists(Finder::class)) { diff --git a/api/vendor/symfony/translation/Extractor/PhpStringTokenParser.php b/api/vendor/symfony/translation/Extractor/PhpStringTokenParser.php index 7fbd37c688..2dfc1e3875 100644 --- a/api/vendor/symfony/translation/Extractor/PhpStringTokenParser.php +++ b/api/vendor/symfony/translation/Extractor/PhpStringTokenParser.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Translation\Extractor; +trigger_deprecation('symfony/translation', '6.2', '"%s" is deprecated.', PhpStringTokenParser::class); + /* * The following is derived from code at http://github.com/nikic/PHP-Parser * @@ -47,6 +49,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/** + * @deprecated since Symfony 6.2 + */ class PhpStringTokenParser { protected static $replacements = [ @@ -89,7 +94,7 @@ public static function parse(string $str): string * @param string $str String without quotes * @param string|null $quote Quote type */ - public static function parseEscapeSequences(string $str, string $quote = null): string + public static function parseEscapeSequences(string $str, ?string $quote = null): string { if (null !== $quote) { $str = str_replace('\\'.$quote, $quote, $str); diff --git a/api/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php b/api/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php new file mode 100644 index 0000000000..c336896169 --- /dev/null +++ b/api/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * @author Mathieu Santostefano + */ +abstract class AbstractVisitor +{ + private MessageCatalogue $catalogue; + private \SplFileInfo $file; + private string $messagePrefix; + + public function initialize(MessageCatalogue $catalogue, \SplFileInfo $file, string $messagePrefix): void + { + $this->catalogue = $catalogue; + $this->file = $file; + $this->messagePrefix = $messagePrefix; + } + + protected function addMessageToCatalogue(string $message, ?string $domain, int $line): void + { + $domain ??= 'messages'; + $this->catalogue->set($message, $this->messagePrefix.$message, $domain); + $metadata = $this->catalogue->getMetadata($message, $domain) ?? []; + $normalizedFilename = preg_replace('{[\\\\/]+}', '/', $this->file); + $metadata['sources'][] = $normalizedFilename.':'.$line; + $this->catalogue->setMetadata($message, $metadata, $domain); + } + + protected function getStringArguments(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node, int|string $index, bool $indexIsRegex = false): array + { + if (\is_string($index)) { + return $this->getStringNamedArguments($node, $index, $indexIsRegex); + } + + $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; + + if (!($arg = $args[$index] ?? null) instanceof Node\Arg) { + return []; + } + + return (array) $this->getStringValue($arg->value); + } + + protected function hasNodeNamedArguments(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node): bool + { + $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; + + foreach ($args as $arg) { + if ($arg instanceof Node\Arg && null !== $arg->name) { + return true; + } + } + + return false; + } + + protected function nodeFirstNamedArgumentIndex(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node): int + { + $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; + + foreach ($args as $i => $arg) { + if ($arg instanceof Node\Arg && null !== $arg->name) { + return $i; + } + } + + return \PHP_INT_MAX; + } + + private function getStringNamedArguments(Node\Expr\CallLike|Node\Attribute $node, ?string $argumentName = null, bool $isArgumentNamePattern = false): array + { + $args = $node instanceof Node\Expr\CallLike ? $node->getArgs() : $node->args; + $argumentValues = []; + + foreach ($args as $arg) { + if (!$isArgumentNamePattern && $arg->name?->toString() === $argumentName) { + $argumentValues[] = $this->getStringValue($arg->value); + } elseif ($isArgumentNamePattern && preg_match($argumentName, $arg->name?->toString() ?? '') > 0) { + $argumentValues[] = $this->getStringValue($arg->value); + } + } + + return array_filter($argumentValues); + } + + private function getStringValue(Node $node): ?string + { + if ($node instanceof Node\Scalar\String_) { + return $node->value; + } + + if ($node instanceof Node\Expr\BinaryOp\Concat) { + if (null === $left = $this->getStringValue($node->left)) { + return null; + } + + if (null === $right = $this->getStringValue($node->right)) { + return null; + } + + return $left.$right; + } + + if ($node instanceof Node\Expr\Assign && $node->expr instanceof Node\Scalar\String_) { + return $node->expr->value; + } + + if ($node instanceof Node\Expr\ClassConstFetch) { + try { + $reflection = new \ReflectionClass($node->class->toString()); + $constant = $reflection->getReflectionConstant($node->name->toString()); + if (false !== $constant && \is_string($constant->getValue())) { + return $constant->getValue(); + } + } catch (\ReflectionException) { + } + } + + return null; + } +} diff --git a/api/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php b/api/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php new file mode 100644 index 0000000000..00fb9eedc7 --- /dev/null +++ b/api/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use PhpParser\NodeVisitor; + +/** + * @author Mathieu Santostefano + * + * Code mostly comes from https://github.com/php-translation/extractor/blob/master/src/Visitor/Php/Symfony/Constraint.php + */ +final class ConstraintVisitor extends AbstractVisitor implements NodeVisitor +{ + public function __construct( + private readonly array $constraintClassNames = [] + ) { + } + + public function beforeTraverse(array $nodes): ?Node + { + return null; + } + + public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node + { + if (!$node instanceof Node\Expr\New_ && !$node instanceof Node\Attribute) { + return null; + } + + $className = $node instanceof Node\Attribute ? $node->name : $node->class; + if (!$className instanceof Node\Name) { + return null; + } + + $parts = $className->getParts(); + $isConstraintClass = false; + + foreach ($parts as $part) { + if (\in_array($part, $this->constraintClassNames, true)) { + $isConstraintClass = true; + + break; + } + } + + if (!$isConstraintClass) { + return null; + } + + $arg = $node->args[0] ?? null; + if (!$arg instanceof Node\Arg) { + return null; + } + + if ($this->hasNodeNamedArguments($node)) { + $messages = $this->getStringArguments($node, '/message/i', true); + } else { + if (!$arg->value instanceof Node\Expr\Array_) { + // There is no way to guess which argument is a message to be translated. + return null; + } + + $messages = []; + $options = $arg->value; + + /** @var Node\Expr\ArrayItem $item */ + foreach ($options->items as $item) { + if (!$item->key instanceof Node\Scalar\String_) { + continue; + } + + if (false === stripos($item->key->value ?? '', 'message')) { + continue; + } + + if (!$item->value instanceof Node\Scalar\String_) { + continue; + } + + $messages[] = $item->value->value; + + break; + } + } + + foreach ($messages as $message) { + $this->addMessageToCatalogue($message, 'validators', $node->getStartLine()); + } + + return null; + } + + public function afterTraverse(array $nodes): ?Node + { + return null; + } +} diff --git a/api/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php b/api/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php new file mode 100644 index 0000000000..a3dcd6d2b6 --- /dev/null +++ b/api/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use PhpParser\NodeVisitor; + +/** + * @author Mathieu Santostefano + */ +final class TransMethodVisitor extends AbstractVisitor implements NodeVisitor +{ + public function beforeTraverse(array $nodes): ?Node + { + return null; + } + + public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node + { + if (!$node instanceof Node\Expr\MethodCall && !$node instanceof Node\Expr\FuncCall) { + return null; + } + + if (!\is_string($node->name) && !$node->name instanceof Node\Identifier && !$node->name instanceof Node\Name) { + return null; + } + + $name = $node->name instanceof Node\Name ? $node->name->getLast() : (string) $node->name; + + if ('trans' === $name || 't' === $name) { + $firstNamedArgumentIndex = $this->nodeFirstNamedArgumentIndex($node); + + if (!$messages = $this->getStringArguments($node, 0 < $firstNamedArgumentIndex ? 0 : 'id')) { + return null; + } + + $domain = $this->getStringArguments($node, 2 < $firstNamedArgumentIndex ? 2 : 'domain')[0] ?? null; + + foreach ($messages as $message) { + $this->addMessageToCatalogue($message, $domain, $node->getStartLine()); + } + } + + return null; + } + + public function afterTraverse(array $nodes): ?Node + { + return null; + } +} diff --git a/api/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php b/api/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php new file mode 100644 index 0000000000..6bd8bb0223 --- /dev/null +++ b/api/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use PhpParser\NodeVisitor; + +/** + * @author Mathieu Santostefano + */ +final class TranslatableMessageVisitor extends AbstractVisitor implements NodeVisitor +{ + public function beforeTraverse(array $nodes): ?Node + { + return null; + } + + public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node + { + if (!$node instanceof Node\Expr\New_) { + return null; + } + + if (!($className = $node->class) instanceof Node\Name) { + return null; + } + + if (!\in_array('TranslatableMessage', $className->getParts(), true)) { + return null; + } + + $firstNamedArgumentIndex = $this->nodeFirstNamedArgumentIndex($node); + + if (!$messages = $this->getStringArguments($node, 0 < $firstNamedArgumentIndex ? 0 : 'message')) { + return null; + } + + $domain = $this->getStringArguments($node, 2 < $firstNamedArgumentIndex ? 2 : 'domain')[0] ?? null; + + foreach ($messages as $message) { + $this->addMessageToCatalogue($message, $domain, $node->getStartLine()); + } + + return null; + } + + public function afterTraverse(array $nodes): ?Node + { + return null; + } +} diff --git a/api/vendor/symfony/translation/Formatter/IntlFormatter.php b/api/vendor/symfony/translation/Formatter/IntlFormatter.php index f7f1c36a2a..e62de253f8 100644 --- a/api/vendor/symfony/translation/Formatter/IntlFormatter.php +++ b/api/vendor/symfony/translation/Formatter/IntlFormatter.php @@ -20,12 +20,9 @@ */ class IntlFormatter implements IntlFormatterInterface { - private $hasMessageFormatter; - private $cache = []; + private bool $hasMessageFormatter; + private array $cache = []; - /** - * {@inheritdoc} - */ public function formatIntl(string $message, string $locale, array $parameters = []): string { // MessageFormatter constructor throws an exception if the message is empty @@ -34,7 +31,7 @@ public function formatIntl(string $message, string $locale, array $parameters = } if (!$formatter = $this->cache[$locale][$message] ?? null) { - if (!($this->hasMessageFormatter ?? $this->hasMessageFormatter = class_exists(\MessageFormatter::class))) { + if (!$this->hasMessageFormatter ??= class_exists(\MessageFormatter::class)) { throw new LogicException('Cannot parse message translation: please install the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.'); } try { diff --git a/api/vendor/symfony/translation/Formatter/MessageFormatter.php b/api/vendor/symfony/translation/Formatter/MessageFormatter.php index 68821b1d07..d5255bdcb9 100644 --- a/api/vendor/symfony/translation/Formatter/MessageFormatter.php +++ b/api/vendor/symfony/translation/Formatter/MessageFormatter.php @@ -22,33 +22,23 @@ class_exists(IntlFormatter::class); */ class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterface { - private $translator; - private $intlFormatter; + private TranslatorInterface $translator; + private IntlFormatterInterface $intlFormatter; /** * @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization */ - public function __construct(TranslatorInterface $translator = null, IntlFormatterInterface $intlFormatter = null) + public function __construct(?TranslatorInterface $translator = null, ?IntlFormatterInterface $intlFormatter = null) { $this->translator = $translator ?? new IdentityTranslator(); $this->intlFormatter = $intlFormatter ?? new IntlFormatter(); } - /** - * {@inheritdoc} - */ public function format(string $message, string $locale, array $parameters = []): string { - if ($this->translator instanceof TranslatorInterface) { - return $this->translator->trans($message, $parameters, null, $locale); - } - - return strtr($message, $parameters); + return $this->translator->trans($message, $parameters, null, $locale); } - /** - * {@inheritdoc} - */ public function formatIntl(string $message, string $locale, array $parameters = []): string { return $this->intlFormatter->formatIntl($message, $locale, $parameters); diff --git a/api/vendor/symfony/translation/LICENSE b/api/vendor/symfony/translation/LICENSE index 0083704572..0138f8f071 100644 --- a/api/vendor/symfony/translation/LICENSE +++ b/api/vendor/symfony/translation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present 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/api/vendor/symfony/translation/Loader/ArrayLoader.php b/api/vendor/symfony/translation/Loader/ArrayLoader.php index 35de9ef547..e63a7d05be 100644 --- a/api/vendor/symfony/translation/Loader/ArrayLoader.php +++ b/api/vendor/symfony/translation/Loader/ArrayLoader.php @@ -20,9 +20,6 @@ */ class ArrayLoader implements LoaderInterface { - /** - * {@inheritdoc} - */ public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { $resource = $this->flatten($resource); @@ -46,9 +43,11 @@ private function flatten(array $messages): array foreach ($messages as $key => $value) { if (\is_array($value)) { foreach ($this->flatten($value) as $k => $v) { - $result[$key.'.'.$k] = $v; + if (null !== $v) { + $result[$key.'.'.$k] = $v; + } } - } else { + } elseif (null !== $value) { $result[$key] = $value; } } diff --git a/api/vendor/symfony/translation/Loader/CsvFileLoader.php b/api/vendor/symfony/translation/Loader/CsvFileLoader.php index 76b00b151a..93bee730bc 100644 --- a/api/vendor/symfony/translation/Loader/CsvFileLoader.php +++ b/api/vendor/symfony/translation/Loader/CsvFileLoader.php @@ -22,11 +22,8 @@ class CsvFileLoader extends FileLoader { private string $delimiter = ';'; private string $enclosure = '"'; - private string $escape = '\\'; + private string $escape = ''; - /** - * {@inheritdoc} - */ protected function loadResource(string $resource): array { $messages = []; @@ -45,7 +42,7 @@ protected function loadResource(string $resource): array continue; } - if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === \count($data)) { + if (!str_starts_with($data[0], '#') && isset($data[1]) && 2 === \count($data)) { $messages[$data[0]] = $data[1]; } } @@ -55,8 +52,10 @@ protected function loadResource(string $resource): array /** * Sets the delimiter, enclosure, and escape character for CSV. + * + * @return void */ - public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\') + public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '') { $this->delimiter = $delimiter; $this->enclosure = $enclosure; diff --git a/api/vendor/symfony/translation/Loader/FileLoader.php b/api/vendor/symfony/translation/Loader/FileLoader.php index e170d76170..877c3bbc74 100644 --- a/api/vendor/symfony/translation/Loader/FileLoader.php +++ b/api/vendor/symfony/translation/Loader/FileLoader.php @@ -21,9 +21,6 @@ */ abstract class FileLoader extends ArrayLoader { - /** - * {@inheritdoc} - */ public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource)) { @@ -37,9 +34,7 @@ public function load(mixed $resource, string $locale, string $domain = 'messages $messages = $this->loadResource($resource); // empty resource - if (null === $messages) { - $messages = []; - } + $messages ??= []; // not an array if (!\is_array($messages)) { diff --git a/api/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/api/vendor/symfony/translation/Loader/IcuDatFileLoader.php index c3ca5fd08b..76e4e7f02b 100644 --- a/api/vendor/symfony/translation/Loader/IcuDatFileLoader.php +++ b/api/vendor/symfony/translation/Loader/IcuDatFileLoader.php @@ -23,9 +23,6 @@ */ class IcuDatFileLoader extends IcuResFileLoader { - /** - * {@inheritdoc} - */ public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource.'.dat')) { @@ -38,7 +35,7 @@ public function load(mixed $resource, string $locale, string $domain = 'messages try { $rb = new \ResourceBundle($locale, $resource); - } catch (\Exception $e) { + } catch (\Exception) { $rb = null; } diff --git a/api/vendor/symfony/translation/Loader/IcuResFileLoader.php b/api/vendor/symfony/translation/Loader/IcuResFileLoader.php index 54c48f8139..949dd97925 100644 --- a/api/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ b/api/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -23,9 +23,6 @@ */ class IcuResFileLoader implements LoaderInterface { - /** - * {@inheritdoc} - */ public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!stream_is_local($resource)) { @@ -38,7 +35,7 @@ public function load(mixed $resource, string $locale, string $domain = 'messages try { $rb = new \ResourceBundle($locale, $resource); - } catch (\Exception $e) { + } catch (\Exception) { $rb = null; } @@ -71,9 +68,9 @@ public function load(mixed $resource, string $locale, string $domain = 'messages * * @param \ResourceBundle $rb The ResourceBundle that will be flattened * @param array $messages Used internally for recursive calls - * @param string $path Current path being parsed, used internally for recursive calls + * @param string|null $path Current path being parsed, used internally for recursive calls */ - protected function flatten(\ResourceBundle $rb, array &$messages = [], string $path = null): array + protected function flatten(\ResourceBundle $rb, array &$messages = [], ?string $path = null): array { foreach ($rb as $key => $value) { $nodePath = $path ? $path.'.'.$key : $key; diff --git a/api/vendor/symfony/translation/Loader/IniFileLoader.php b/api/vendor/symfony/translation/Loader/IniFileLoader.php index 04e294d119..3126896c84 100644 --- a/api/vendor/symfony/translation/Loader/IniFileLoader.php +++ b/api/vendor/symfony/translation/Loader/IniFileLoader.php @@ -18,9 +18,6 @@ */ class IniFileLoader extends FileLoader { - /** - * {@inheritdoc} - */ protected function loadResource(string $resource): array { return parse_ini_file($resource, true); diff --git a/api/vendor/symfony/translation/Loader/JsonFileLoader.php b/api/vendor/symfony/translation/Loader/JsonFileLoader.php index 67a8d58ede..385553ef64 100644 --- a/api/vendor/symfony/translation/Loader/JsonFileLoader.php +++ b/api/vendor/symfony/translation/Loader/JsonFileLoader.php @@ -20,9 +20,6 @@ */ class JsonFileLoader extends FileLoader { - /** - * {@inheritdoc} - */ protected function loadResource(string $resource): array { $messages = []; @@ -42,19 +39,13 @@ protected function loadResource(string $resource): array */ private function getJSONErrorMessage(int $errorCode): string { - switch ($errorCode) { - case \JSON_ERROR_DEPTH: - return 'Maximum stack depth exceeded'; - case \JSON_ERROR_STATE_MISMATCH: - return 'Underflow or the modes mismatch'; - case \JSON_ERROR_CTRL_CHAR: - return 'Unexpected control character found'; - case \JSON_ERROR_SYNTAX: - return 'Syntax error, malformed JSON'; - case \JSON_ERROR_UTF8: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - default: - return 'Unknown error'; - } + return match ($errorCode) { + \JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + \JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', + \JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + \JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', + \JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', + default => 'Unknown error', + }; } } diff --git a/api/vendor/symfony/translation/Loader/MoFileLoader.php b/api/vendor/symfony/translation/Loader/MoFileLoader.php index b0c891387c..8427c393e1 100644 --- a/api/vendor/symfony/translation/Loader/MoFileLoader.php +++ b/api/vendor/symfony/translation/Loader/MoFileLoader.php @@ -38,8 +38,6 @@ class MoFileLoader extends FileLoader /** * Parses machine object (MO) format, independent of the machine's endian it * was created on. Both 32bit and 64bit systems are supported. - * - * {@inheritdoc} */ protected function loadResource(string $resource): array { diff --git a/api/vendor/symfony/translation/Loader/PhpFileLoader.php b/api/vendor/symfony/translation/Loader/PhpFileLoader.php index ae299c2ac5..541b6c8322 100644 --- a/api/vendor/symfony/translation/Loader/PhpFileLoader.php +++ b/api/vendor/symfony/translation/Loader/PhpFileLoader.php @@ -20,12 +20,9 @@ class PhpFileLoader extends FileLoader { private static ?array $cache = []; - /** - * {@inheritdoc} - */ protected function loadResource(string $resource): array { - if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) { + if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOL))) { self::$cache = null; } @@ -33,10 +30,6 @@ protected function loadResource(string $resource): array return require $resource; } - if (isset(self::$cache[$resource])) { - return self::$cache[$resource]; - } - - return self::$cache[$resource] = require $resource; + return self::$cache[$resource] ??= require $resource; } } diff --git a/api/vendor/symfony/translation/Loader/PoFileLoader.php b/api/vendor/symfony/translation/Loader/PoFileLoader.php index 6df1614872..620d97339a 100644 --- a/api/vendor/symfony/translation/Loader/PoFileLoader.php +++ b/api/vendor/symfony/translation/Loader/PoFileLoader.php @@ -57,8 +57,6 @@ class PoFileLoader extends FileLoader * - Message IDs are allowed to have other encodings as just US-ASCII. * * Items with an empty id are ignored. - * - * {@inheritdoc} */ protected function loadResource(string $resource): array { @@ -83,15 +81,15 @@ protected function loadResource(string $resource): array } $item = $defaults; $flags = []; - } elseif ('#,' === substr($line, 0, 2)) { + } elseif (str_starts_with($line, '#,')) { $flags = array_map('trim', explode(',', substr($line, 2))); - } elseif ('msgid "' === substr($line, 0, 7)) { + } elseif (str_starts_with($line, 'msgid "')) { // We start a new msg so save previous // TODO: this fails when comments or contexts are added $this->addMessage($messages, $item); $item = $defaults; $item['ids']['singular'] = substr($line, 7, -1); - } elseif ('msgstr "' === substr($line, 0, 8)) { + } elseif (str_starts_with($line, 'msgstr "')) { $item['translated'] = substr($line, 8, -1); } elseif ('"' === $line[0]) { $continues = isset($item['translated']) ? 'translated' : 'ids'; @@ -102,9 +100,9 @@ protected function loadResource(string $resource): array } else { $item[$continues] .= substr($line, 1, -1); } - } elseif ('msgid_plural "' === substr($line, 0, 14)) { + } elseif (str_starts_with($line, 'msgid_plural "')) { $item['ids']['plural'] = substr($line, 14, -1); - } elseif ('msgstr[' === substr($line, 0, 7)) { + } elseif (str_starts_with($line, 'msgstr[')) { $size = strpos($line, ']'); $item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1); } @@ -124,7 +122,7 @@ protected function loadResource(string $resource): array * A .po file could contain by error missing plural indexes. We need to * fix these before saving them. */ - private function addMessage(array &$messages, array $item) + private function addMessage(array &$messages, array $item): void { if (!empty($item['ids']['singular'])) { $id = stripcslashes($item['ids']['singular']); diff --git a/api/vendor/symfony/translation/Loader/QtFileLoader.php b/api/vendor/symfony/translation/Loader/QtFileLoader.php index 6d5582d662..235f85ee91 100644 --- a/api/vendor/symfony/translation/Loader/QtFileLoader.php +++ b/api/vendor/symfony/translation/Loader/QtFileLoader.php @@ -25,9 +25,6 @@ */ class QtFileLoader implements LoaderInterface { - /** - * {@inheritdoc} - */ public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!class_exists(XmlUtils::class)) { @@ -67,7 +64,6 @@ public function load(mixed $resource, string $locale, string $domain = 'messages $domain ); } - $translation = $translation->nextSibling; } if (class_exists(FileResource::class)) { diff --git a/api/vendor/symfony/translation/Loader/XliffFileLoader.php b/api/vendor/symfony/translation/Loader/XliffFileLoader.php index 670e199790..ffe4bbbd89 100644 --- a/api/vendor/symfony/translation/Loader/XliffFileLoader.php +++ b/api/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -28,9 +28,6 @@ */ class XliffFileLoader implements LoaderInterface { - /** - * {@inheritdoc} - */ public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue { if (!class_exists(XmlUtils::class)) { @@ -75,7 +72,7 @@ public function load(mixed $resource, string $locale, string $domain = 'messages return $catalogue; } - private function extract(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) + private function extract(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain): void { $xliffVersion = XliffUtils::getVersionNumber($dom); @@ -91,7 +88,7 @@ private function extract(\DOMDocument $dom, MessageCatalogue $catalogue, string /** * Extract messages and metadata from DOMDocument into a MessageCatalogue. */ - private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) + private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain): void { $xml = simplexml_import_dom($dom); $encoding = $dom->encoding ? strtoupper($dom->encoding) : null; @@ -104,6 +101,10 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s $file->registerXPathNamespace('xliff', $namespace); + foreach ($file->xpath('.//xliff:prop') as $prop) { + $catalogue->setCatalogueMetadata($prop->attributes()['prop-type'], (string) $prop, $domain); + } + foreach ($file->xpath('.//xliff:trans-unit') as $translation) { $attributes = $translation->attributes(); @@ -111,12 +112,20 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s continue; } - $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source; + $source = (string) (isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source); + + if (isset($translation->target) + && 'needs-translation' === (string) $translation->target->attributes()['state'] + && \in_array((string) $translation->target, [$source, (string) $translation->source], true) + ) { + continue; + } + // If the xlf file has another encoding specified, try to convert it because // simple_xml will always return utf-8 encoded values $target = $this->utf8ToCharset((string) ($translation->target ?? $translation->source), $encoding); - $catalogue->set((string) $source, $target, $domain); + $catalogue->set($source, $target, $domain); $metadata = [ 'source' => (string) $translation->source, @@ -139,12 +148,12 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s $metadata['id'] = (string) $attributes['id']; } - $catalogue->setMetadata((string) $source, $metadata, $domain); + $catalogue->setMetadata($source, $metadata, $domain); } } } - private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) + private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain): void { $xml = simplexml_import_dom($dom); $encoding = $dom->encoding ? strtoupper($dom->encoding) : null; @@ -190,7 +199,7 @@ private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, s /** * Convert a UTF8 string to the specified encoding. */ - private function utf8ToCharset(string $content, string $encoding = null): string + private function utf8ToCharset(string $content, ?string $encoding = null): string { if ('UTF-8' !== $encoding && !empty($encoding)) { return mb_convert_encoding($content, $encoding, 'UTF-8'); @@ -199,7 +208,7 @@ private function utf8ToCharset(string $content, string $encoding = null): string return $content; } - private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, string $encoding = null): array + private function parseNotesMetadata(?\SimpleXMLElement $noteElement = null, ?string $encoding = null): array { $notes = []; @@ -227,6 +236,6 @@ private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, strin private function isXmlString(string $resource): bool { - return 0 === strpos($resource, 'yamlParser) { + if (!isset($this->yamlParser)) { if (!class_exists(\Symfony\Component\Yaml\Parser::class)) { throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.'); } diff --git a/api/vendor/symfony/translation/LocaleSwitcher.php b/api/vendor/symfony/translation/LocaleSwitcher.php new file mode 100644 index 0000000000..4950a56bbb --- /dev/null +++ b/api/vendor/symfony/translation/LocaleSwitcher.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Routing\RequestContext; +use Symfony\Contracts\Translation\LocaleAwareInterface; + +/** + * @author Kevin Bond + */ +class LocaleSwitcher implements LocaleAwareInterface +{ + private string $defaultLocale; + + /** + * @param LocaleAwareInterface[] $localeAwareServices + */ + public function __construct( + private string $locale, + private iterable $localeAwareServices, + private ?RequestContext $requestContext = null, + ) { + $this->defaultLocale = $locale; + } + + public function setLocale(string $locale): void + { + // Silently ignore if the intl extension is not loaded + try { + if (class_exists(\Locale::class, false)) { + \Locale::setDefault($locale); + } + } catch (\Exception) { + } + + $this->locale = $locale; + $this->requestContext?->setParameter('_locale', $locale); + + foreach ($this->localeAwareServices as $service) { + $service->setLocale($locale); + } + } + + public function getLocale(): string + { + return $this->locale; + } + + /** + * Switch to a new locale, execute a callback, then switch back to the original. + * + * @template T + * + * @param callable(string $locale):T $callback + * + * @return T + */ + public function runWithLocale(string $locale, callable $callback): mixed + { + $original = $this->getLocale(); + $this->setLocale($locale); + + try { + return $callback($locale); + } finally { + $this->setLocale($original); + } + } + + public function reset(): void + { + $this->setLocale($this->defaultLocale); + } +} diff --git a/api/vendor/symfony/translation/LoggingTranslator.php b/api/vendor/symfony/translation/LoggingTranslator.php index 8c8441cdf7..4a560bd6a4 100644 --- a/api/vendor/symfony/translation/LoggingTranslator.php +++ b/api/vendor/symfony/translation/LoggingTranslator.php @@ -21,8 +21,8 @@ */ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface { - private $translator; - private $logger; + private TranslatorInterface $translator; + private LoggerInterface $logger; /** * @param TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator The translator must implement TranslatorBagInterface @@ -37,10 +37,7 @@ public function __construct(TranslatorInterface $translator, LoggerInterface $lo $this->logger = $logger; } - /** - * {@inheritdoc} - */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); $this->log($id, $domain, $locale); @@ -49,7 +46,7 @@ public function trans(?string $id, array $parameters = [], string $domain = null } /** - * {@inheritdoc} + * @return void */ public function setLocale(string $locale) { @@ -62,25 +59,16 @@ public function setLocale(string $locale) $this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale)); } - /** - * {@inheritdoc} - */ public function getLocale(): string { return $this->translator->getLocale(); } - /** - * {@inheritdoc} - */ - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { return $this->translator->getCatalogue($locale); } - /** - * {@inheritdoc} - */ public function getCatalogues(): array { return $this->translator->getCatalogues(); @@ -99,7 +87,7 @@ public function getFallbackLocales(): array } /** - * Passes through all unknown calls onto the translator object. + * @return mixed */ public function __call(string $method, array $args) { @@ -109,11 +97,9 @@ public function __call(string $method, array $args) /** * Logs for missing translations. */ - private function log(string $id, ?string $domain, ?string $locale) + private function log(string $id, ?string $domain, ?string $locale): void { - if (null === $domain) { - $domain = 'messages'; - } + $domain ??= 'messages'; $catalogue = $this->translator->getCatalogue($locale); if ($catalogue->defines($id, $domain)) { diff --git a/api/vendor/symfony/translation/MessageCatalogue.php b/api/vendor/symfony/translation/MessageCatalogue.php index 848594b6be..d56f04393f 100644 --- a/api/vendor/symfony/translation/MessageCatalogue.php +++ b/api/vendor/symfony/translation/MessageCatalogue.php @@ -17,13 +17,14 @@ /** * @author Fabien Potencier */ -class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface +class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface, CatalogueMetadataAwareInterface { private array $messages = []; private array $metadata = []; + private array $catalogueMetadata = []; private array $resources = []; private string $locale; - private $fallbackCatalogue = null; + private ?MessageCatalogueInterface $fallbackCatalogue = null; private ?self $parent = null; /** @@ -35,17 +36,11 @@ public function __construct(string $locale, array $messages = []) $this->messages = $messages; } - /** - * {@inheritdoc} - */ public function getLocale(): string { return $this->locale; } - /** - * {@inheritdoc} - */ public function getDomains(): array { $domains = []; @@ -60,10 +55,7 @@ public function getDomains(): array return array_values($domains); } - /** - * {@inheritdoc} - */ - public function all(string $domain = null): array + public function all(?string $domain = null): array { if (null !== $domain) { // skip messages merge if intl-icu requested explicitly @@ -89,16 +81,13 @@ public function all(string $domain = null): array } /** - * {@inheritdoc} + * @return void */ public function set(string $id, string $translation, string $domain = 'messages') { $this->add([$id => $translation], $domain); } - /** - * {@inheritdoc} - */ public function has(string $id, string $domain = 'messages'): bool { if (isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { @@ -112,17 +101,11 @@ public function has(string $id, string $domain = 'messages'): bool return false; } - /** - * {@inheritdoc} - */ public function defines(string $id, string $domain = 'messages'): bool { return isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]); } - /** - * {@inheritdoc} - */ public function get(string $id, string $domain = 'messages'): string { if (isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { @@ -141,7 +124,7 @@ public function get(string $id, string $domain = 'messages'): string } /** - * {@inheritdoc} + * @return void */ public function replace(array $messages, string $domain = 'messages') { @@ -151,7 +134,7 @@ public function replace(array $messages, string $domain = 'messages') } /** - * {@inheritdoc} + * @return void */ public function add(array $messages, string $domain = 'messages') { @@ -167,7 +150,7 @@ public function add(array $messages, string $domain = 'messages') } /** - * {@inheritdoc} + * @return void */ public function addCatalogue(MessageCatalogueInterface $catalogue) { @@ -191,10 +174,15 @@ public function addCatalogue(MessageCatalogueInterface $catalogue) $metadata = $catalogue->getMetadata('', ''); $this->addMetadata($metadata); } + + if ($catalogue instanceof CatalogueMetadataAwareInterface) { + $catalogueMetadata = $catalogue->getCatalogueMetadata('', ''); + $this->addCatalogueMetadata($catalogueMetadata); + } } /** - * {@inheritdoc} + * @return void */ public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) { @@ -225,33 +213,24 @@ public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) } } - /** - * {@inheritdoc} - */ public function getFallbackCatalogue(): ?MessageCatalogueInterface { return $this->fallbackCatalogue; } - /** - * {@inheritdoc} - */ public function getResources(): array { return array_values($this->resources); } /** - * {@inheritdoc} + * @return void */ public function addResource(ResourceInterface $resource) { $this->resources[$resource->__toString()] = $resource; } - /** - * {@inheritdoc} - */ public function getMetadata(string $key = '', string $domain = 'messages'): mixed { if ('' == $domain) { @@ -272,7 +251,7 @@ public function getMetadata(string $key = '', string $domain = 'messages'): mixe } /** - * {@inheritdoc} + * @return void */ public function setMetadata(string $key, mixed $value, string $domain = 'messages') { @@ -280,7 +259,7 @@ public function setMetadata(string $key, mixed $value, string $domain = 'message } /** - * {@inheritdoc} + * @return void */ public function deleteMetadata(string $key = '', string $domain = 'messages') { @@ -293,12 +272,53 @@ public function deleteMetadata(string $key = '', string $domain = 'messages') } } + public function getCatalogueMetadata(string $key = '', string $domain = 'messages'): mixed + { + if (!$domain) { + return $this->catalogueMetadata; + } + + if (isset($this->catalogueMetadata[$domain])) { + if (!$key) { + return $this->catalogueMetadata[$domain]; + } + + if (isset($this->catalogueMetadata[$domain][$key])) { + return $this->catalogueMetadata[$domain][$key]; + } + } + + return null; + } + + /** + * @return void + */ + public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages') + { + $this->catalogueMetadata[$domain][$key] = $value; + } + + /** + * @return void + */ + public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages') + { + if (!$domain) { + $this->catalogueMetadata = []; + } elseif (!$key) { + unset($this->catalogueMetadata[$domain]); + } else { + unset($this->catalogueMetadata[$domain][$key]); + } + } + /** * Adds current values with the new values. * * @param array $values Values to add */ - private function addMetadata(array $values) + private function addMetadata(array $values): void { foreach ($values as $domain => $keys) { foreach ($keys as $key => $value) { @@ -306,4 +326,13 @@ private function addMetadata(array $values) } } } + + private function addCatalogueMetadata(array $values): void + { + foreach ($values as $domain => $keys) { + foreach ($keys as $key => $value) { + $this->setCatalogueMetadata($key, $value, $domain); + } + } + } } diff --git a/api/vendor/symfony/translation/MessageCatalogueInterface.php b/api/vendor/symfony/translation/MessageCatalogueInterface.php index 75e3a2fa76..fd0d26d7e3 100644 --- a/api/vendor/symfony/translation/MessageCatalogueInterface.php +++ b/api/vendor/symfony/translation/MessageCatalogueInterface.php @@ -36,10 +36,8 @@ public function getDomains(): array; * Gets the messages within a given domain. * * If $domain is null, it returns all messages. - * - * @param string $domain The domain name */ - public function all(string $domain = null): array; + public function all(?string $domain = null): array; /** * Sets a message translation. @@ -47,6 +45,8 @@ public function all(string $domain = null): array; * @param string $id The message id * @param string $translation The messages translation * @param string $domain The domain name + * + * @return void */ public function set(string $id, string $translation, string $domain = 'messages'); @@ -79,6 +79,8 @@ public function get(string $id, string $domain = 'messages'): string; * * @param array $messages An array of translations * @param string $domain The domain name + * + * @return void */ public function replace(array $messages, string $domain = 'messages'); @@ -87,6 +89,8 @@ public function replace(array $messages, string $domain = 'messages'); * * @param array $messages An array of translations * @param string $domain The domain name + * + * @return void */ public function add(array $messages, string $domain = 'messages'); @@ -94,6 +98,8 @@ public function add(array $messages, string $domain = 'messages'); * Merges translations from the given Catalogue into the current one. * * The two catalogues must have the same locale. + * + * @return void */ public function addCatalogue(self $catalogue); @@ -102,6 +108,8 @@ public function addCatalogue(self $catalogue); * only when the translation does not exist. * * This is used to provide default translations when they do not exist for the current locale. + * + * @return void */ public function addFallbackCatalogue(self $catalogue); @@ -119,6 +127,8 @@ public function getResources(): array; /** * Adds a resource for this collection. + * + * @return void */ public function addResource(ResourceInterface $resource); } diff --git a/api/vendor/symfony/translation/MetadataAwareInterface.php b/api/vendor/symfony/translation/MetadataAwareInterface.php index 2eaaceb36e..39e5326c37 100644 --- a/api/vendor/symfony/translation/MetadataAwareInterface.php +++ b/api/vendor/symfony/translation/MetadataAwareInterface.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Translation; /** - * MetadataAwareInterface. + * This interface is used to get, set, and delete metadata about the translation messages. * * @author Fabien Potencier */ @@ -31,6 +31,8 @@ public function getMetadata(string $key = '', string $domain = 'messages'): mixe /** * Adds metadata to a message domain. + * + * @return void */ public function setMetadata(string $key, mixed $value, string $domain = 'messages'); @@ -39,6 +41,8 @@ public function setMetadata(string $key, mixed $value, string $domain = 'message * * Passing an empty domain will delete all metadata. Passing an empty key will * delete all metadata for the given domain. + * + * @return void */ public function deleteMetadata(string $key = '', string $domain = 'messages'); } diff --git a/api/vendor/symfony/translation/Provider/AbstractProviderFactory.php b/api/vendor/symfony/translation/Provider/AbstractProviderFactory.php index 17442fde87..f0c11d85de 100644 --- a/api/vendor/symfony/translation/Provider/AbstractProviderFactory.php +++ b/api/vendor/symfony/translation/Provider/AbstractProviderFactory.php @@ -27,19 +27,11 @@ abstract protected function getSupportedSchemes(): array; protected function getUser(Dsn $dsn): string { - if (null === $user = $dsn->getUser()) { - throw new IncompleteDsnException('User is not set.', $dsn->getOriginalDsn()); - } - - return $user; + return $dsn->getUser() ?? throw new IncompleteDsnException('User is not set.', $dsn->getScheme().'://'.$dsn->getHost()); } protected function getPassword(Dsn $dsn): string { - if (null === $password = $dsn->getPassword()) { - throw new IncompleteDsnException('Password is not set.', $dsn->getOriginalDsn()); - } - - return $password; + return $dsn->getPassword() ?? throw new IncompleteDsnException('Password is not set.', $dsn->getOriginalDsn()); } } diff --git a/api/vendor/symfony/translation/Provider/Dsn.php b/api/vendor/symfony/translation/Provider/Dsn.php index 0f74d17fbd..1d90e27f99 100644 --- a/api/vendor/symfony/translation/Provider/Dsn.php +++ b/api/vendor/symfony/translation/Provider/Dsn.php @@ -29,29 +29,29 @@ final class Dsn private array $options = []; private string $originalDsn; - public function __construct(string $dsn) + public function __construct(#[\SensitiveParameter] string $dsn) { $this->originalDsn = $dsn; - if (false === $parsedDsn = parse_url($dsn)) { - throw new InvalidArgumentException(sprintf('The "%s" translation provider DSN is invalid.', $dsn)); + if (false === $params = parse_url($dsn)) { + throw new InvalidArgumentException('The translation provider DSN is invalid.'); } - if (!isset($parsedDsn['scheme'])) { - throw new InvalidArgumentException(sprintf('The "%s" translation provider DSN must contain a scheme.', $dsn)); + if (!isset($params['scheme'])) { + throw new InvalidArgumentException('The translation provider DSN must contain a scheme.'); } - $this->scheme = $parsedDsn['scheme']; + $this->scheme = $params['scheme']; - if (!isset($parsedDsn['host'])) { - throw new InvalidArgumentException(sprintf('The "%s" translation provider DSN must contain a host (use "default" by default).', $dsn)); + if (!isset($params['host'])) { + throw new InvalidArgumentException('The translation provider DSN must contain a host (use "default" by default).'); } - $this->host = $parsedDsn['host']; + $this->host = $params['host']; - $this->user = '' !== ($parsedDsn['user'] ?? '') ? urldecode($parsedDsn['user']) : null; - $this->password = '' !== ($parsedDsn['pass'] ?? '') ? urldecode($parsedDsn['pass']) : null; - $this->port = $parsedDsn['port'] ?? null; - $this->path = $parsedDsn['path'] ?? null; - parse_str($parsedDsn['query'] ?? '', $this->options); + $this->user = '' !== ($params['user'] ?? '') ? rawurldecode($params['user']) : null; + $this->password = '' !== ($params['pass'] ?? '') ? rawurldecode($params['pass']) : null; + $this->port = $params['port'] ?? null; + $this->path = $params['path'] ?? null; + parse_str($params['query'] ?? '', $this->options); } public function getScheme(): string @@ -74,17 +74,17 @@ public function getPassword(): ?string return $this->password; } - public function getPort(int $default = null): ?int + public function getPort(?int $default = null): ?int { return $this->port ?? $default; } - public function getOption(string $key, mixed $default = null) + public function getOption(string $key, mixed $default = null): mixed { return $this->options[$key] ?? $default; } - public function getRequiredOption(string $key) + public function getRequiredOption(string $key): mixed { if (!\array_key_exists($key, $this->options) || '' === trim($this->options[$key])) { throw new MissingRequiredOptionException($key); diff --git a/api/vendor/symfony/translation/Provider/FilteringProvider.php b/api/vendor/symfony/translation/Provider/FilteringProvider.php index a43fedc71a..d4465b9fd6 100644 --- a/api/vendor/symfony/translation/Provider/FilteringProvider.php +++ b/api/vendor/symfony/translation/Provider/FilteringProvider.php @@ -21,7 +21,7 @@ */ class FilteringProvider implements ProviderInterface { - private $provider; + private ProviderInterface $provider; private array $locales; private array $domains; @@ -37,9 +37,6 @@ public function __toString(): string return (string) $this->provider; } - /** - * {@inheritdoc} - */ public function write(TranslatorBagInterface $translatorBag): void { $this->provider->write($translatorBag); diff --git a/api/vendor/symfony/translation/Provider/ProviderInterface.php b/api/vendor/symfony/translation/Provider/ProviderInterface.php index a32193f29c..0e47083b69 100644 --- a/api/vendor/symfony/translation/Provider/ProviderInterface.php +++ b/api/vendor/symfony/translation/Provider/ProviderInterface.php @@ -14,10 +14,8 @@ use Symfony\Component\Translation\TranslatorBag; use Symfony\Component\Translation\TranslatorBagInterface; -interface ProviderInterface +interface ProviderInterface extends \Stringable { - public function __toString(): string; - /** * Translations available in the TranslatorBag only must be created. * Translations available in both the TranslatorBag and on the provider diff --git a/api/vendor/symfony/translation/Provider/TranslationProviderCollection.php b/api/vendor/symfony/translation/Provider/TranslationProviderCollection.php index 61ac641cd6..b917415ba1 100644 --- a/api/vendor/symfony/translation/Provider/TranslationProviderCollection.php +++ b/api/vendor/symfony/translation/Provider/TranslationProviderCollection.php @@ -21,7 +21,7 @@ final class TranslationProviderCollection /** * @var array */ - private $providers; + private array $providers; /** * @param array $providers diff --git a/api/vendor/symfony/translation/PseudoLocalizationTranslator.php b/api/vendor/symfony/translation/PseudoLocalizationTranslator.php index ba7319d4f0..f26909f5e1 100644 --- a/api/vendor/symfony/translation/PseudoLocalizationTranslator.php +++ b/api/vendor/symfony/translation/PseudoLocalizationTranslator.php @@ -20,7 +20,7 @@ final class PseudoLocalizationTranslator implements TranslatorInterface { private const EXPANSION_CHARACTER = '~'; - private $translator; + private TranslatorInterface $translator; private bool $accents; private float $expansionFactor; private bool $brackets; @@ -83,10 +83,7 @@ public function __construct(TranslatorInterface $translator, array $options = [] $this->localizableHTMLAttributes = $options['localizable_html_attributes'] ?? []; } - /** - * {@inheritdoc} - */ - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { $trans = ''; $visibleText = ''; @@ -123,7 +120,7 @@ private function getParts(string $originalTrans): array return [[true, true, $originalTrans]]; } - $html = mb_encode_numericentity($originalTrans, [0x80, 0xFFFF, 0, 0xFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); + $html = mb_encode_numericentity($originalTrans, [0x80, 0x10FFFF, 0, 0x1FFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); $useInternalErrors = libxml_use_internal_errors(true); diff --git a/api/vendor/symfony/translation/README.md b/api/vendor/symfony/translation/README.md index adda9a5b21..32e4017b72 100644 --- a/api/vendor/symfony/translation/README.md +++ b/api/vendor/symfony/translation/README.md @@ -26,12 +26,7 @@ echo $translator->trans('Hello World!'); // outputs « Bonjour ! » Sponsor ------- -The Translation component for Symfony 5.4/6.0 is [backed][1] by: - - * [Crowdin][2], a cloud-based localization management software helping teams to go global and stay agile. - * [Lokalise][3], a continuous localization and translation management platform that integrates into your development workflow so you can ship localized products, faster. - -Help Symfony by [sponsoring][4] its development! +Help Symfony by [sponsoring][1] its development! Resources --------- @@ -42,7 +37,4 @@ Resources [send Pull Requests](https://github.com/symfony/symfony/pulls) in the [main Symfony repository](https://github.com/symfony/symfony) -[1]: https://symfony.com/backers -[2]: https://crowdin.com -[3]: https://lokalise.com -[4]: https://symfony.com/sponsor +[1]: https://symfony.com/sponsor diff --git a/api/vendor/symfony/translation/Reader/TranslationReader.php b/api/vendor/symfony/translation/Reader/TranslationReader.php index bbc687e139..01408d4dcd 100644 --- a/api/vendor/symfony/translation/Reader/TranslationReader.php +++ b/api/vendor/symfony/translation/Reader/TranslationReader.php @@ -33,6 +33,8 @@ class TranslationReader implements TranslationReaderInterface * Adds a loader to the translation extractor. * * @param string $format The format of the loader + * + * @return void */ public function addLoader(string $format, LoaderInterface $loader) { @@ -40,7 +42,7 @@ public function addLoader(string $format, LoaderInterface $loader) } /** - * {@inheritdoc} + * @return void */ public function read(string $directory, MessageCatalogue $catalogue) { diff --git a/api/vendor/symfony/translation/Reader/TranslationReaderInterface.php b/api/vendor/symfony/translation/Reader/TranslationReaderInterface.php index bc37204f95..ea74dc23ff 100644 --- a/api/vendor/symfony/translation/Reader/TranslationReaderInterface.php +++ b/api/vendor/symfony/translation/Reader/TranslationReaderInterface.php @@ -22,6 +22,8 @@ interface TranslationReaderInterface { /** * Reads translation messages from a directory to the catalogue. + * + * @return void */ public function read(string $directory, MessageCatalogue $catalogue); } diff --git a/api/vendor/symfony/translation/Resources/bin/translation-status.php b/api/vendor/symfony/translation/Resources/bin/translation-status.php index 4fe814cf65..42fa1c69b3 100644 --- a/api/vendor/symfony/translation/Resources/bin/translation-status.php +++ b/api/vendor/symfony/translation/Resources/bin/translation-status.php @@ -87,19 +87,15 @@ $translationFilePaths = findTranslationFiles($originalFilePath, $config['locale_to_analyze']); $translationStatus = calculateTranslationStatus($originalFilePath, $translationFilePaths); - $totalMissingTranslations += array_sum(array_map(function ($translation) { - return count($translation['missingKeys']); - }, array_values($translationStatus))); - $totalTranslationMismatches += array_sum(array_map(function ($translation) { - return count($translation['mismatches']); - }, array_values($translationStatus))); + $totalMissingTranslations += array_sum(array_map(fn ($translation) => count($translation['missingKeys']), array_values($translationStatus))); + $totalTranslationMismatches += array_sum(array_map(fn ($translation) => count($translation['mismatches']), array_values($translationStatus))); printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output'], $config['include_completed_languages']); } exit($totalTranslationMismatches > 0 ? 1 : 0); -function findTranslationFiles($originalFilePath, $localeToAnalyze) +function findTranslationFiles($originalFilePath, $localeToAnalyze): array { $translations = []; @@ -122,7 +118,7 @@ function findTranslationFiles($originalFilePath, $localeToAnalyze) return $translations; } -function calculateTranslationStatus($originalFilePath, $translationFilePaths) +function calculateTranslationStatus($originalFilePath, $translationFilePaths): array { $translationStatus = []; $allTranslationKeys = extractTranslationKeys($originalFilePath); @@ -163,14 +159,14 @@ function extractLocaleFromFilePath($filePath) return $parts[count($parts) - 2]; } -function extractTranslationKeys($filePath) +function extractTranslationKeys($filePath): array { $translationKeys = []; - $contents = new \SimpleXMLElement(file_get_contents($filePath)); + $contents = new SimpleXMLElement(file_get_contents($filePath)); foreach ($contents->file->body->{'trans-unit'} as $translationKey) { $translationId = (string) $translationKey['id']; - $translationKey = (string) $translationKey->source; + $translationKey = (string) ($translationKey['resname'] ?? $translationKey->source); $translationKeys[$translationId] = $translationKey; } diff --git a/api/vendor/symfony/translation/Resources/data/parents.json b/api/vendor/symfony/translation/Resources/data/parents.json index 32a33cdaf7..24d4d119e9 100644 --- a/api/vendor/symfony/translation/Resources/data/parents.json +++ b/api/vendor/symfony/translation/Resources/data/parents.json @@ -35,6 +35,7 @@ "en_GM": "en_001", "en_GY": "en_001", "en_HK": "en_001", + "en_ID": "en_001", "en_IE": "en_001", "en_IL": "en_001", "en_IM": "en_001", diff --git a/api/vendor/symfony/translation/Resources/functions.php b/api/vendor/symfony/translation/Resources/functions.php index 901d2f87ef..0d2a037a2c 100644 --- a/api/vendor/symfony/translation/Resources/functions.php +++ b/api/vendor/symfony/translation/Resources/functions.php @@ -15,7 +15,7 @@ /** * @author Nate Wiebe */ - function t(string $message, array $parameters = [], string $domain = null): TranslatableMessage + function t(string $message, array $parameters = [], ?string $domain = null): TranslatableMessage { return new TranslatableMessage($message, $parameters, $domain); } diff --git a/api/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd b/api/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd similarity index 96% rename from api/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd rename to api/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd index dface628ce..1f38de72f4 100644 --- a/api/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd +++ b/api/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd @@ -1,5 +1,4 @@ - - + - + @@ -1672,14 +1672,16 @@ Jan-10-2006 + + - + @@ -1739,10 +1741,11 @@ Jan-10-2006 + - + @@ -1791,6 +1794,7 @@ Jan-10-2006 + @@ -1838,16 +1842,34 @@ Jan-10-2006 + + + + + + + + + + + + + + + + + + - + - + @@ -1865,8 +1887,9 @@ Jan-10-2006 + - + @@ -1877,6 +1900,7 @@ Jan-10-2006 + @@ -1901,7 +1925,7 @@ Jan-10-2006 - + @@ -1913,10 +1937,11 @@ Jan-10-2006 + - + @@ -1924,6 +1949,7 @@ Jan-10-2006 + @@ -1947,7 +1973,7 @@ Jan-10-2006 - + @@ -1962,7 +1988,8 @@ Jan-10-2006 - + + @@ -1985,7 +2012,8 @@ Jan-10-2006 - + + @@ -2011,6 +2039,8 @@ Jan-10-2006 + + @@ -2018,7 +2048,7 @@ Jan-10-2006 - + @@ -2042,18 +2072,21 @@ Jan-10-2006 - + + - + + + @@ -2070,7 +2103,7 @@ Jan-10-2006 - + @@ -2089,20 +2122,22 @@ Jan-10-2006 + - + + - + @@ -2111,7 +2146,8 @@ Jan-10-2006 - + + @@ -2121,12 +2157,13 @@ Jan-10-2006 + - + @@ -2217,7 +2254,8 @@ Jan-10-2006 - + + diff --git a/api/vendor/symfony/translation/Test/ProviderFactoryTestCase.php b/api/vendor/symfony/translation/Test/ProviderFactoryTestCase.php index d6510e0ddb..95ffcb1e58 100644 --- a/api/vendor/symfony/translation/Test/ProviderFactoryTestCase.php +++ b/api/vendor/symfony/translation/Test/ProviderFactoryTestCase.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Translation\Test; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\MockHttpClient; @@ -20,39 +21,39 @@ use Symfony\Component\Translation\Loader\LoaderInterface; use Symfony\Component\Translation\Provider\Dsn; use Symfony\Component\Translation\Provider\ProviderFactoryInterface; +use Symfony\Component\Translation\TranslatorBagInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; /** * A test case to ease testing a translation provider factory. * * @author Mathieu Santostefano - * - * @internal */ abstract class ProviderFactoryTestCase extends TestCase { - protected $client; - protected $logger; + protected HttpClientInterface $client; + protected LoggerInterface|MockObject $logger; protected string $defaultLocale; - protected $loader; - protected $xliffFileDumper; + protected LoaderInterface|MockObject $loader; + protected XliffFileDumper|MockObject $xliffFileDumper; + protected TranslatorBagInterface|MockObject $translatorBag; abstract public function createFactory(): ProviderFactoryInterface; /** * @return iterable */ - abstract public function supportsProvider(): iterable; + abstract public static function supportsProvider(): iterable; /** - * @return iterable + * @return iterable */ - abstract public function createProvider(): iterable; + abstract public static function createProvider(): iterable; /** * @return iterable */ - public function unsupportedSchemeProvider(): iterable + public static function unsupportedSchemeProvider(): iterable { return []; } @@ -60,7 +61,7 @@ public function unsupportedSchemeProvider(): iterable /** * @return iterable */ - public function incompleteDsnProvider(): iterable + public static function incompleteDsnProvider(): iterable { return []; } @@ -89,7 +90,7 @@ public function testCreate(string $expected, string $dsn) /** * @dataProvider unsupportedSchemeProvider */ - public function testUnsupportedSchemeException(string $dsn, string $message = null) + public function testUnsupportedSchemeException(string $dsn, ?string $message = null) { $factory = $this->createFactory(); @@ -106,7 +107,7 @@ public function testUnsupportedSchemeException(string $dsn, string $message = nu /** * @dataProvider incompleteDsnProvider */ - public function testIncompleteDsnException(string $dsn, string $message = null) + public function testIncompleteDsnException(string $dsn, ?string $message = null) { $factory = $this->createFactory(); @@ -144,4 +145,9 @@ protected function getXliffFileDumper(): XliffFileDumper { return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); } + + protected function getTranslatorBag(): TranslatorBagInterface + { + return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class); + } } diff --git a/api/vendor/symfony/translation/Test/ProviderTestCase.php b/api/vendor/symfony/translation/Test/ProviderTestCase.php index 5ae26829bc..a8fa0b8bbc 100644 --- a/api/vendor/symfony/translation/Test/ProviderTestCase.php +++ b/api/vendor/symfony/translation/Test/ProviderTestCase.php @@ -11,35 +11,36 @@ namespace Symfony\Component\Translation\Test; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\MockHttpClient; use Symfony\Component\Translation\Dumper\XliffFileDumper; use Symfony\Component\Translation\Loader\LoaderInterface; use Symfony\Component\Translation\Provider\ProviderInterface; +use Symfony\Component\Translation\TranslatorBagInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; /** * A test case to ease testing a translation provider. * * @author Mathieu Santostefano - * - * @internal */ abstract class ProviderTestCase extends TestCase { - protected $client; - protected $logger; + protected HttpClientInterface $client; + protected LoggerInterface|MockObject $logger; protected string $defaultLocale; - protected $loader; - protected $xliffFileDumper; + protected LoaderInterface|MockObject $loader; + protected XliffFileDumper|MockObject $xliffFileDumper; + protected TranslatorBagInterface|MockObject $translatorBag; - abstract public function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface; + abstract public static function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface; /** - * @return iterable + * @return iterable */ - abstract public function toStringProvider(): iterable; + abstract public static function toStringProvider(): iterable; /** * @dataProvider toStringProvider @@ -73,4 +74,9 @@ protected function getXliffFileDumper(): XliffFileDumper { return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); } + + protected function getTranslatorBag(): TranslatorBagInterface + { + return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class); + } } diff --git a/api/vendor/symfony/translation/TranslatableMessage.php b/api/vendor/symfony/translation/TranslatableMessage.php index b1a3b6b137..c591e68c28 100644 --- a/api/vendor/symfony/translation/TranslatableMessage.php +++ b/api/vendor/symfony/translation/TranslatableMessage.php @@ -23,7 +23,7 @@ class TranslatableMessage implements TranslatableInterface private array $parameters; private ?string $domain; - public function __construct(string $message, array $parameters = [], string $domain = null) + public function __construct(string $message, array $parameters = [], ?string $domain = null) { $this->message = $message; $this->parameters = $parameters; @@ -50,12 +50,10 @@ public function getDomain(): ?string return $this->domain; } - public function trans(TranslatorInterface $translator, string $locale = null): string + public function trans(TranslatorInterface $translator, ?string $locale = null): string { return $translator->trans($this->getMessage(), array_map( - static function ($parameter) use ($translator, $locale) { - return $parameter instanceof TranslatableInterface ? $parameter->trans($translator, $locale) : $parameter; - }, + static fn ($parameter) => $parameter instanceof TranslatableInterface ? $parameter->trans($translator, $locale) : $parameter, $this->getParameters() ), $this->getDomain(), $locale); } diff --git a/api/vendor/symfony/translation/Translator.php b/api/vendor/symfony/translation/Translator.php index 05e84d0cc0..1973d079fe 100644 --- a/api/vendor/symfony/translation/Translator.php +++ b/api/vendor/symfony/translation/Translator.php @@ -22,6 +22,7 @@ use Symfony\Component\Translation\Formatter\MessageFormatterInterface; use Symfony\Component\Translation\Loader\LoaderInterface; use Symfony\Contracts\Translation\LocaleAwareInterface; +use Symfony\Contracts\Translation\TranslatableInterface; use Symfony\Contracts\Translation\TranslatorInterface; // Help opcache.preload discover always-needed symbols @@ -51,7 +52,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA private array $resources = []; - private $formatter; + private MessageFormatterInterface $formatter; private ?string $cacheDir; @@ -59,7 +60,7 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA private array $cacheVary; - private $configCacheFactory; + private ?ConfigCacheFactoryInterface $configCacheFactory; private array $parentLocales; @@ -68,21 +69,20 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA /** * @throws InvalidArgumentException If a locale contains invalid characters */ - public function __construct(string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false, array $cacheVary = []) + public function __construct(string $locale, ?MessageFormatterInterface $formatter = null, ?string $cacheDir = null, bool $debug = false, array $cacheVary = []) { $this->setLocale($locale); - if (null === $formatter) { - $formatter = new MessageFormatter(); - } - - $this->formatter = $formatter; + $this->formatter = $formatter ??= new MessageFormatter(); $this->cacheDir = $cacheDir; $this->debug = $debug; $this->cacheVary = $cacheVary; $this->hasIntlFormatter = $formatter instanceof IntlFormatterInterface; } + /** + * @return void + */ public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) { $this->configCacheFactory = $configCacheFactory; @@ -92,6 +92,8 @@ public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFa * Adds a Loader. * * @param string $format The name of the loader (@see addResource()) + * + * @return void */ public function addLoader(string $format, LoaderInterface $loader) { @@ -104,13 +106,13 @@ public function addLoader(string $format, LoaderInterface $loader) * @param string $format The name of the loader (@see addLoader()) * @param mixed $resource The resource name * + * @return void + * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function addResource(string $format, mixed $resource, string $locale, string $domain = null) + public function addResource(string $format, mixed $resource, string $locale, ?string $domain = null) { - if (null === $domain) { - $domain = 'messages'; - } + $domain ??= 'messages'; $this->assertValidLocale($locale); $locale ?: $locale = class_exists(\Locale::class) ? \Locale::getDefault() : 'en'; @@ -125,7 +127,7 @@ public function addResource(string $format, mixed $resource, string $locale, str } /** - * {@inheritdoc} + * @return void */ public function setLocale(string $locale) { @@ -133,9 +135,6 @@ public function setLocale(string $locale) $this->locale = $locale; } - /** - * {@inheritdoc} - */ public function getLocale(): string { return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); @@ -146,6 +145,8 @@ public function getLocale(): string * * @param string[] $locales * + * @return void + * * @throws InvalidArgumentException If a locale contains invalid characters */ public function setFallbackLocales(array $locales) @@ -170,18 +171,13 @@ public function getFallbackLocales(): array return $this->fallbackLocales; } - /** - * {@inheritdoc} - */ - public function trans(?string $id, array $parameters = [], string $domain = null, string $locale = null): string + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string { if (null === $id || '' === $id) { return ''; } - if (null === $domain) { - $domain = 'messages'; - } + $domain ??= 'messages'; $catalogue = $this->getCatalogue($locale); $locale = $catalogue->getLocale(); @@ -194,6 +190,8 @@ public function trans(?string $id, array $parameters = [], string $domain = null } } + $parameters = array_map(fn ($parameter) => $parameter instanceof TranslatableInterface ? $parameter->trans($this, $locale) : $parameter, $parameters); + $len = \strlen(MessageCatalogue::INTL_DOMAIN_SUFFIX); if ($this->hasIntlFormatter && ($catalogue->defines($id, $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX) @@ -205,10 +203,7 @@ public function trans(?string $id, array $parameters = [], string $domain = null return $this->formatter->format($catalogue->get($id, $domain), $locale, $parameters); } - /** - * {@inheritdoc} - */ - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { if (!$locale) { $locale = $this->getLocale(); @@ -223,9 +218,6 @@ public function getCatalogue(string $locale = null): MessageCatalogueInterface return $this->catalogues[$locale]; } - /** - * {@inheritdoc} - */ public function getCatalogues(): array { return array_values($this->catalogues); @@ -241,6 +233,9 @@ protected function getLoaders(): array return $this->loaders; } + /** + * @return void + */ protected function loadCatalogue(string $locale) { if (null === $this->cacheDir) { @@ -250,6 +245,9 @@ protected function loadCatalogue(string $locale) } } + /** + * @return void + */ protected function initializeCatalogue(string $locale) { $this->assertValidLocale($locale); @@ -386,6 +384,9 @@ private function loadFallbackCatalogues(string $locale): void } } + /** + * @return array + */ protected function computeFallbackLocales(string $locale) { $this->parentLocales ??= json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); @@ -430,6 +431,8 @@ protected function computeFallbackLocales(string $locale) /** * Asserts that the locale is valid, throws an Exception if not. * + * @return void + * * @throws InvalidArgumentException If the locale contains invalid characters */ protected function assertValidLocale(string $locale) diff --git a/api/vendor/symfony/translation/TranslatorBag.php b/api/vendor/symfony/translation/TranslatorBag.php index 9be3458c15..3b47aecee1 100644 --- a/api/vendor/symfony/translation/TranslatorBag.php +++ b/api/vendor/symfony/translation/TranslatorBag.php @@ -35,10 +35,7 @@ public function addBag(TranslatorBagInterface $bag): void } } - /** - * {@inheritdoc} - */ - public function getCatalogue(string $locale = null): MessageCatalogueInterface + public function getCatalogue(?string $locale = null): MessageCatalogueInterface { if (null === $locale || !isset($this->catalogues[$locale])) { $this->catalogues[$locale] = new MessageCatalogue($locale); @@ -47,9 +44,6 @@ public function getCatalogue(string $locale = null): MessageCatalogueInterface return $this->catalogues[$locale]; } - /** - * {@inheritdoc} - */ public function getCatalogues(): array { return array_values($this->catalogues); @@ -70,7 +64,7 @@ public function diff(TranslatorBagInterface $diffBag): self $operation->moveMessagesToIntlDomainsIfPossible(AbstractOperation::NEW_BATCH); $newCatalogue = new MessageCatalogue($locale); - foreach ($operation->getDomains() as $domain) { + foreach ($catalogue->getDomains() as $domain) { $newCatalogue->add($operation->getNewMessages($domain), $domain); } diff --git a/api/vendor/symfony/translation/TranslatorBagInterface.php b/api/vendor/symfony/translation/TranslatorBagInterface.php index a787acf12f..365d1f13bf 100644 --- a/api/vendor/symfony/translation/TranslatorBagInterface.php +++ b/api/vendor/symfony/translation/TranslatorBagInterface.php @@ -25,7 +25,7 @@ interface TranslatorBagInterface * * @throws InvalidArgumentException If the locale contains invalid characters */ - public function getCatalogue(string $locale = null): MessageCatalogueInterface; + public function getCatalogue(?string $locale = null): MessageCatalogueInterface; /** * Returns all catalogues of the instance. diff --git a/api/vendor/symfony/translation/Util/ArrayConverter.php b/api/vendor/symfony/translation/Util/ArrayConverter.php index 60b8be6e0d..64e15b485d 100644 --- a/api/vendor/symfony/translation/Util/ArrayConverter.php +++ b/api/vendor/symfony/translation/Util/ArrayConverter.php @@ -36,7 +36,7 @@ public static function expandToTree(array $messages): array $tree = []; foreach ($messages as $id => $value) { - $referenceToElement = &self::getElementByPath($tree, explode('.', $id)); + $referenceToElement = &self::getElementByPath($tree, self::getKeyParts($id)); $referenceToElement = $value; @@ -46,7 +46,7 @@ public static function expandToTree(array $messages): array return $tree; } - private static function &getElementByPath(array &$tree, array $parts) + private static function &getElementByPath(array &$tree, array $parts): mixed { $elem = &$tree; $parentOfElem = null; @@ -63,6 +63,7 @@ private static function &getElementByPath(array &$tree, array $parts) $elem = &$elem[implode('.', \array_slice($parts, $i))]; break; } + $parentOfElem = &$elem; $elem = &$elem[$part]; } @@ -82,7 +83,7 @@ private static function &getElementByPath(array &$tree, array $parts) return $elem; } - private static function cancelExpand(array &$tree, string $prefix, array $node) + private static function cancelExpand(array &$tree, string $prefix, array $node): void { $prefix .= '.'; @@ -94,4 +95,48 @@ private static function cancelExpand(array &$tree, string $prefix, array $node) } } } + + /** + * @return string[] + */ + private static function getKeyParts(string $key): array + { + $parts = explode('.', $key); + $partsCount = \count($parts); + + $result = []; + $buffer = ''; + + foreach ($parts as $index => $part) { + if (0 === $index && '' === $part) { + $buffer = '.'; + + continue; + } + + if ($index === $partsCount - 1 && '' === $part) { + $buffer .= '.'; + $result[] = $buffer; + + continue; + } + + if (isset($parts[$index + 1]) && '' === $parts[$index + 1]) { + $buffer .= $part; + + continue; + } + + if ($buffer) { + $result[] = $buffer.$part; + $buffer = ''; + + continue; + } + + $result[] = $part; + } + + return $result; + } } diff --git a/api/vendor/symfony/translation/Util/XliffUtils.php b/api/vendor/symfony/translation/Util/XliffUtils.php index 85ecc85048..335c34beb5 100644 --- a/api/vendor/symfony/translation/Util/XliffUtils.php +++ b/api/vendor/symfony/translation/Util/XliffUtils.php @@ -129,7 +129,7 @@ public static function getErrorsAsString(array $xmlErrors): string private static function getSchema(string $xliffVersion): string { if ('1.2' === $xliffVersion) { - $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-1.2-strict.xsd'); + $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-1.2-transitional.xsd'); $xmlUri = 'http://www.w3.org/2001/xml.xsd'; } elseif ('2.0' === $xliffVersion) { $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-2.0.xsd'); diff --git a/api/vendor/symfony/translation/Writer/TranslationWriter.php b/api/vendor/symfony/translation/Writer/TranslationWriter.php index 5dd3a5c401..61e03cb0ea 100644 --- a/api/vendor/symfony/translation/Writer/TranslationWriter.php +++ b/api/vendor/symfony/translation/Writer/TranslationWriter.php @@ -30,6 +30,8 @@ class TranslationWriter implements TranslationWriterInterface /** * Adds a dumper to the writer. + * + * @return void */ public function addDumper(string $format, DumperInterface $dumper) { @@ -50,6 +52,8 @@ public function getFormats(): array * @param string $format The format to use to dump the messages * @param array $options Options that are passed to the dumper * + * @return void + * * @throws InvalidArgumentException */ public function write(MessageCatalogue $catalogue, string $format, array $options = []) diff --git a/api/vendor/symfony/translation/Writer/TranslationWriterInterface.php b/api/vendor/symfony/translation/Writer/TranslationWriterInterface.php index 43213097e3..5ebb9794a6 100644 --- a/api/vendor/symfony/translation/Writer/TranslationWriterInterface.php +++ b/api/vendor/symfony/translation/Writer/TranslationWriterInterface.php @@ -27,6 +27,8 @@ interface TranslationWriterInterface * @param string $format The format to use to dump the messages * @param array $options Options that are passed to the dumper * + * @return void + * * @throws InvalidArgumentException */ public function write(MessageCatalogue $catalogue, string $format, array $options = []); diff --git a/api/vendor/symfony/translation/composer.json b/api/vendor/symfony/translation/composer.json index abe8b972c1..af6f7a3df0 100644 --- a/api/vendor/symfony/translation/composer.json +++ b/api/vendor/symfony/translation/composer.json @@ -16,27 +16,32 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" + "symfony/translation-contracts": "^2.5|^3.0" }, "require-dev": { - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", + "nikic/php-parser": "^4.18|^5.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/intl": "^5.4|^6.0|^7.0", "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", + "symfony/routing": "^5.4|^6.0|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", "psr/log": "^1|^2|^3" }, "conflict": { "symfony/config": "<5.4", "symfony/dependency-injection": "<5.4", + "symfony/http-client-contracts": "<2.5", "symfony/http-kernel": "<5.4", + "symfony/service-contracts": "<2.5", "symfony/twig-bundle": "<5.4", "symfony/yaml": "<5.4", "symfony/console": "<5.4" @@ -44,11 +49,6 @@ "provide": { "symfony/translation-implementation": "2.3|3.0" }, - "suggest": { - "symfony/config": "", - "symfony/yaml": "", - "psr/log-implementation": "To use logging capability in translator" - }, "autoload": { "files": [ "Resources/functions.php" ], "psr-4": { "Symfony\\Component\\Translation\\": "" }, diff --git a/api/vendor/symfony/var-dumper/Caster/Caster.php b/api/vendor/symfony/var-dumper/Caster/Caster.php index 890f531063..09238093de 100644 --- a/api/vendor/symfony/var-dumper/Caster/Caster.php +++ b/api/vendor/symfony/var-dumper/Caster/Caster.php @@ -42,7 +42,7 @@ class Caster * * @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not */ - public static function castObject(object $obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array + public static function castObject(object $obj, string $class, bool $hasDebugInfo = false, ?string $debugClass = null): array { if ($hasDebugInfo) { try { @@ -115,7 +115,7 @@ public static function castObject(object $obj, string $class, bool $hasDebugInfo * @param array $a The array containing the properties to filter * @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set - * @param int &$count Set to the number of removed properties + * @param int|null &$count Set to the number of removed properties */ public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array { diff --git a/api/vendor/symfony/var-dumper/Caster/ClassStub.php b/api/vendor/symfony/var-dumper/Caster/ClassStub.php index 48f848354b..27c24c9ab9 100644 --- a/api/vendor/symfony/var-dumper/Caster/ClassStub.php +++ b/api/vendor/symfony/var-dumper/Caster/ClassStub.php @@ -56,7 +56,7 @@ public function __construct(string $identifier, $callable = null) } if (str_contains($identifier, "@anonymous\0")) { - $this->value = $identifier = 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) { + $this->value = $identifier = 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]; }, $identifier); } diff --git a/api/vendor/symfony/var-dumper/Caster/DOMCaster.php b/api/vendor/symfony/var-dumper/Caster/DOMCaster.php index 4dd16e0ee7..5d933cf75a 100644 --- a/api/vendor/symfony/var-dumper/Caster/DOMCaster.php +++ b/api/vendor/symfony/var-dumper/Caster/DOMCaster.php @@ -23,7 +23,7 @@ class DOMCaster { private const ERROR_CODES = [ - \DOM_PHP_ERR => 'DOM_PHP_ERR', + 0 => 'DOM_PHP_ERR', \DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR', \DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR', \DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR', @@ -138,16 +138,12 @@ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, boo 'doctype' => $dom->doctype, 'implementation' => $dom->implementation, 'documentElement' => new CutStub($dom->documentElement), - 'actualEncoding' => $dom->actualEncoding, 'encoding' => $dom->encoding, 'xmlEncoding' => $dom->xmlEncoding, - 'standalone' => $dom->standalone, 'xmlStandalone' => $dom->xmlStandalone, - 'version' => $dom->version, 'xmlVersion' => $dom->xmlVersion, 'strictErrorChecking' => $dom->strictErrorChecking, 'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI, - 'config' => $dom->config, 'formatOutput' => $dom->formatOutput, 'validateOnParse' => $dom->validateOnParse, 'resolveExternals' => $dom->resolveExternals, @@ -275,9 +271,6 @@ public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $i 'publicId' => $dom->publicId, 'systemId' => $dom->systemId, 'notationName' => $dom->notationName, - 'actualEncoding' => $dom->actualEncoding, - 'encoding' => $dom->encoding, - 'version' => $dom->version, ]; return $a; diff --git a/api/vendor/symfony/var-dumper/Caster/DateCaster.php b/api/vendor/symfony/var-dumper/Caster/DateCaster.php index 18641fbc1d..d07bac5831 100644 --- a/api/vendor/symfony/var-dumper/Caster/DateCaster.php +++ b/api/vendor/symfony/var-dumper/Caster/DateCaster.php @@ -27,7 +27,7 @@ class DateCaster public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter) { $prefix = Caster::PREFIX_VIRTUAL; - $location = $d->getTimezone()->getLocation(); + $location = $d->getTimezone() ? $d->getTimezone()->getLocation() : null; $fromNow = (new \DateTime())->diff($d); $title = $d->format('l, F j, Y') diff --git a/api/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/api/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index 7f5cb65eb2..299f512524 100644 --- a/api/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/api/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -41,7 +41,7 @@ class ExceptionCaster \E_USER_ERROR => 'E_USER_ERROR', \E_USER_WARNING => 'E_USER_WARNING', \E_USER_NOTICE => 'E_USER_NOTICE', - \E_STRICT => 'E_STRICT', + 2048 => 'E_STRICT', ]; private static $framesCache = []; @@ -288,7 +288,7 @@ private static function filterExceptionArray(string $xClass, array $a, string $x unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); if (isset($a[Caster::PREFIX_PROTECTED.'message']) && str_contains($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { - $a[Caster::PREFIX_PROTECTED.'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) { + $a[Caster::PREFIX_PROTECTED.'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]; }, $a[Caster::PREFIX_PROTECTED.'message']); } diff --git a/api/vendor/symfony/var-dumper/Caster/LinkStub.php b/api/vendor/symfony/var-dumper/Caster/LinkStub.php index 7e0780339a..bd4c796a51 100644 --- a/api/vendor/symfony/var-dumper/Caster/LinkStub.php +++ b/api/vendor/symfony/var-dumper/Caster/LinkStub.php @@ -23,7 +23,7 @@ class LinkStub extends ConstStub private static $vendorRoots; private static $composerRoots; - public function __construct(string $label, int $line = 0, string $href = null) + public function __construct(string $label, int $line = 0, ?string $href = null) { $this->value = $label; diff --git a/api/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/api/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index 5c644053ad..87e5ffcc07 100644 --- a/api/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/api/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -42,7 +42,7 @@ public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNe $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter); - if (!str_contains($c->name, '{closure}')) { + if (!str_contains($c->name, '{closure')) { $stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name; unset($a[$prefix.'class']); } @@ -83,13 +83,13 @@ public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $ // Cannot create ReflectionGenerator based on a terminated Generator try { $reflectionGenerator = new \ReflectionGenerator($c); + + return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested); } catch (\Exception $e) { $a[Caster::PREFIX_VIRTUAL.'closed'] = true; return $a; } - - return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested); } public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $isNested) @@ -116,10 +116,16 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $ public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested) { - self::addMap($a, $c, [ + $map = [ 'name' => 'getName', 'arguments' => 'getArguments', - ]); + ]; + + if (\PHP_VERSION_ID >= 80400) { + unset($map['name']); + } + + self::addMap($a, $c, $map); return $a; } @@ -292,7 +298,7 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st if ($c->isOptional()) { try { $a[$prefix.'default'] = $v = $c->getDefaultValue(); - if ($c->isDefaultValueConstant()) { + if ($c->isDefaultValueConstant() && !\is_object($v)) { $a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v); } if (null === $v) { @@ -362,7 +368,7 @@ public static function getSignature(array $a) if (!$type instanceof \ReflectionNamedType) { $signature .= $type.' '; } else { - if (!$param->isOptional() && $param->allowsNull() && 'mixed' !== $type->getName()) { + if ($param->allowsNull() && 'mixed' !== $type->getName()) { $signature .= '?'; } $signature .= substr(strrchr('\\'.$type->getName(), '\\'), 1).' '; diff --git a/api/vendor/symfony/var-dumper/Caster/SplCaster.php b/api/vendor/symfony/var-dumper/Caster/SplCaster.php index 07f445116f..d7db8f8945 100644 --- a/api/vendor/symfony/var-dumper/Caster/SplCaster.php +++ b/api/vendor/symfony/var-dumper/Caster/SplCaster.php @@ -229,10 +229,11 @@ private static function castSplArray($c, array $a, Stub $stub, bool $isNested): $a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class); $c->setFlags($flags); } - if (\PHP_VERSION_ID < 70400) { - $a[$prefix.'storage'] = $c->getArrayCopy(); - } + + unset($a["\0ArrayObject\0storage"], $a["\0ArrayIterator\0storage"]); + $a += [ + $prefix.'storage' => $c->getArrayCopy(), $prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST), $prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS), ]; diff --git a/api/vendor/symfony/var-dumper/Caster/TraceStub.php b/api/vendor/symfony/var-dumper/Caster/TraceStub.php index 5eea1c8766..d215d8db00 100644 --- a/api/vendor/symfony/var-dumper/Caster/TraceStub.php +++ b/api/vendor/symfony/var-dumper/Caster/TraceStub.php @@ -25,7 +25,7 @@ class TraceStub extends Stub public $sliceLength; public $numberingOffset; - public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) + public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, ?int $sliceLength = null, int $numberingOffset = 0) { $this->value = $trace; $this->keepArgs = $keepArgs; diff --git a/api/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/api/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index f74a61d7a6..e811fbf720 100644 --- a/api/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/api/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -216,7 +216,7 @@ abstract class AbstractCloner implements ClonerInterface * * @see addCasters */ - public function __construct(array $casters = null) + public function __construct(?array $casters = null) { if (null === $casters) { $casters = static::$defaultCasters; diff --git a/api/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/api/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index ae19faf613..66da669de9 100644 --- a/api/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/api/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -42,7 +42,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface * @param string|null $charset The default character encoding to use for non-UTF8 strings * @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation */ - public function __construct($output = null, string $charset = null, int $flags = 0) + public function __construct($output = null, ?string $charset = null, int $flags = 0) { $this->flags = $flags; $this->setCharset($charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8'); diff --git a/api/vendor/symfony/var-dumper/Dumper/CliDumper.php b/api/vendor/symfony/var-dumper/Dumper/CliDumper.php index 94dc8ee973..da1d5b2d6e 100644 --- a/api/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/api/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -64,7 +64,7 @@ class CliDumper extends AbstractDumper /** * {@inheritdoc} */ - public function __construct($output = null, string $charset = null, int $flags = 0) + public function __construct($output = null, ?string $charset = null, int $flags = 0) { parent::__construct($output, $charset, $flags); @@ -128,6 +128,7 @@ public function setDisplayOptions(array $displayOptions) public function dumpScalar(Cursor $cursor, string $type, $value) { $this->dumpKey($cursor); + $this->collapseNextHash = $this->expandNextHash = false; $style = 'const'; $attr = $cursor->attr; @@ -191,6 +192,7 @@ public function dumpScalar(Cursor $cursor, string $type, $value) public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) { $this->dumpKey($cursor); + $this->collapseNextHash = $this->expandNextHash = false; $attr = $cursor->attr; if ($bin) { @@ -198,6 +200,9 @@ public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut) } if ('' === $str) { $this->line .= '""'; + if ($cut) { + $this->line .= '…'.$cut; + } $this->endValue($cursor); } else { $attr += [ @@ -283,6 +288,7 @@ public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild) } $this->dumpKey($cursor); + $this->expandNextHash = false; $attr = $cursor->attr; if ($this->collapseNextHash) { @@ -445,7 +451,8 @@ protected function style(string $style, string $value, array $attr = []) if (null === $this->handlesHrefGracefully) { $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) + && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); } if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { @@ -557,6 +564,10 @@ protected function supportsColors() */ protected function dumpLine(int $depth, bool $endOfValue = false) { + if (null === $this->colors) { + $this->colors = $this->supportsColors(); + } + if ($this->colors) { $this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line); } @@ -595,23 +606,34 @@ private function hasColorSupport($stream): bool } // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { + if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) { return false; } - if ('Hyper' === getenv('TERM_PROGRAM')) { + // Detect msysgit/mingw and assume this is a tty because detection + // does not work correctly, see https://github.com/composer/composer/issues/9690 + if (!@stream_isatty($stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) { + return false; + } + + if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($stream)) { + return true; + } + + if ('Hyper' === getenv('TERM_PROGRAM') + || false !== getenv('COLORTERM') + || false !== getenv('ANSICON') + || 'ON' === getenv('ConEmuANSI') + ) { return true; } - if (\DIRECTORY_SEPARATOR === '\\') { - return (\function_exists('sapi_windows_vt100_support') - && @sapi_windows_vt100_support($stream)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); + if ('dumb' === $term = (string) getenv('TERM')) { + return false; } - return stream_isatty($stream); + // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157 + return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term); } /** diff --git a/api/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/api/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php index 2e2c818161..dee887ec1f 100644 --- a/api/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php +++ b/api/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php @@ -30,7 +30,7 @@ final class SourceContextProvider implements ContextProviderInterface private $projectDir; private $fileLinkFormatter; - public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9) + public function __construct(?string $charset = null, ?string $projectDir = null, ?FileLinkFormatter $fileLinkFormatter = null, int $limit = 9) { $this->charset = $charset; $this->projectDir = $projectDir; @@ -44,7 +44,7 @@ public function getContext(): ?array $file = $trace[1]['file']; $line = $trace[1]['line']; - $name = false; + $name = '-' === $file || 'Standard input code' === $file ? 'Standard input code' : false; $fileExcerpt = false; for ($i = 2; $i < $this->limit; ++$i) { diff --git a/api/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/api/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 75cbe2fcbf..55030cfd02 100644 --- a/api/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/api/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -77,7 +77,7 @@ class HtmlDumper extends CliDumper /** * {@inheritdoc} */ - public function __construct($output = null, string $charset = null, int $flags = 0) + public function __construct($output = null, ?string $charset = null, int $flags = 0) { AbstractDumper::__construct($output, $charset, $flags); $this->dumpId = 'sf-dump-'.mt_rand(); diff --git a/api/vendor/symfony/var-dumper/Dumper/ServerDumper.php b/api/vendor/symfony/var-dumper/Dumper/ServerDumper.php index 94795bf6d6..b8871b00ba 100644 --- a/api/vendor/symfony/var-dumper/Dumper/ServerDumper.php +++ b/api/vendor/symfony/var-dumper/Dumper/ServerDumper.php @@ -30,7 +30,7 @@ class ServerDumper implements DataDumperInterface * @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name */ - public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = []) + public function __construct(string $host, ?DataDumperInterface $wrappedDumper = null, array $contextProviders = []) { $this->connection = new Connection($host, $contextProviders); $this->wrappedDumper = $wrappedDumper; diff --git a/api/vendor/symfony/var-dumper/LICENSE b/api/vendor/symfony/var-dumper/LICENSE index 72412a62b2..29f72d5e95 100644 --- a/api/vendor/symfony/var-dumper/LICENSE +++ b/api/vendor/symfony/var-dumper/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2023 Fabien Potencier +Copyright (c) 2014-present 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/api/vendor/symfony/var-dumper/Server/Connection.php b/api/vendor/symfony/var-dumper/Server/Connection.php index d0611a1f6c..ebfc6506fb 100644 --- a/api/vendor/symfony/var-dumper/Server/Connection.php +++ b/api/vendor/symfony/var-dumper/Server/Connection.php @@ -91,7 +91,7 @@ private function createSocket() { set_error_handler([self::class, 'nullErrorHandler']); try { - return stream_socket_client($this->host, $errno, $errstr, 3, \STREAM_CLIENT_CONNECT | \STREAM_CLIENT_ASYNC_CONNECT); + return stream_socket_client($this->host, $errno, $errstr, 3); } finally { restore_error_handler(); } diff --git a/api/vendor/symfony/var-dumper/Server/DumpServer.php b/api/vendor/symfony/var-dumper/Server/DumpServer.php index f9735db785..b006ea1203 100644 --- a/api/vendor/symfony/var-dumper/Server/DumpServer.php +++ b/api/vendor/symfony/var-dumper/Server/DumpServer.php @@ -32,7 +32,7 @@ class DumpServer */ private $socket; - public function __construct(string $host, LoggerInterface $logger = null) + public function __construct(string $host, ?LoggerInterface $logger = null) { if (!str_contains($host, '://')) { $host = 'tcp://'.$host; diff --git a/api/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php b/api/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php index 33d60c0201..5959195c35 100644 --- a/api/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php +++ b/api/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php @@ -27,7 +27,7 @@ trait VarDumperTestTrait 'flags' => null, ]; - protected function setUpVarDumper(array $casters, int $flags = null): void + protected function setUpVarDumper(array $casters, ?int $flags = null): void { $this->varDumperConfig['casters'] = $casters; $this->varDumperConfig['flags'] = $flags; diff --git a/api/vendor/symfony/var-dumper/VarDumper.php b/api/vendor/symfony/var-dumper/VarDumper.php index 20429ac788..9db5811ea0 100644 --- a/api/vendor/symfony/var-dumper/VarDumper.php +++ b/api/vendor/symfony/var-dumper/VarDumper.php @@ -49,7 +49,7 @@ public static function dump($var) /** * @return callable|null */ - public static function setHandler(callable $callable = null) + public static function setHandler(?callable $callable = null) { $prevHandler = self::$handler; diff --git a/api/vendor/symfony/var-dumper/composer.json b/api/vendor/symfony/var-dumper/composer.json index dc46f58d99..ea46a72bd0 100644 --- a/api/vendor/symfony/var-dumper/composer.json +++ b/api/vendor/symfony/var-dumper/composer.json @@ -23,12 +23,12 @@ "require-dev": { "ext-iconv": "*", "symfony/console": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^4.4|^5.0|^6.0", "symfony/process": "^4.4|^5.0|^6.0", "symfony/uid": "^5.1|^6.0", "twig/twig": "^2.13|^3.0.4" }, "conflict": { - "phpunit/phpunit": "<5.4.3", "symfony/console": "<4.4" }, "suggest": { diff --git a/api/vendor/symfony/yaml/CHANGELOG.md b/api/vendor/symfony/yaml/CHANGELOG.md index b9561b2af2..0c2021f48b 100644 --- a/api/vendor/symfony/yaml/CHANGELOG.md +++ b/api/vendor/symfony/yaml/CHANGELOG.md @@ -1,6 +1,22 @@ CHANGELOG ========= +6.3 +--- + + * Add support to dump int keys as strings by using the `Yaml::DUMP_NUMERIC_KEY_AS_STRING` flag + +6.2 +--- + + * Add support for `!php/enum` and `!php/enum *->value` + * Deprecate the `!php/const:` tag in key which will be replaced by the `!php/const` tag (without the colon) since 3.4 + +6.1 +--- + + * In cases where it will likely improve readability, strings containing single quotes will be double-quoted + 5.4 --- diff --git a/api/vendor/symfony/yaml/Command/LintCommand.php b/api/vendor/symfony/yaml/Command/LintCommand.php index 1412360cb5..e32339e491 100644 --- a/api/vendor/symfony/yaml/Command/LintCommand.php +++ b/api/vendor/symfony/yaml/Command/LintCommand.php @@ -36,28 +36,28 @@ #[AsCommand(name: 'lint:yaml', description: 'Lint a YAML file and outputs encountered errors')] class LintCommand extends Command { - private $parser; + private Parser $parser; private ?string $format = null; private bool $displayCorrectFiles; private ?\Closure $directoryIteratorProvider; private ?\Closure $isReadableProvider; - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) + public function __construct(?string $name = null, ?callable $directoryIteratorProvider = null, ?callable $isReadableProvider = null) { parent::__construct($name); - $this->directoryIteratorProvider = null === $directoryIteratorProvider || $directoryIteratorProvider instanceof \Closure ? $directoryIteratorProvider : \Closure::fromCallable($directoryIteratorProvider); - $this->isReadableProvider = null === $isReadableProvider || $isReadableProvider instanceof \Closure ? $isReadableProvider : \Closure::fromCallable($isReadableProvider); + $this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...); + $this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...); } /** - * {@inheritdoc} + * @return void */ protected function configure() { $this ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format') + ->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions()))) ->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude') ->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null) ->setHelp(<<format = $input->getOption('format'); $flags = $input->getOption('parse-tags'); - if ('github' === $this->format && !class_exists(GithubActionReporter::class)) { - throw new \InvalidArgumentException('The "github" format is only available since "symfony/console" >= 5.3.'); - } - if (null === $this->format) { // Autodetect format according to CI environment $this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt'; @@ -131,7 +127,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int return $this->display($io, $filesInfo); } - private function validate(string $content, int $flags, string $file = null) + private function validate(string $content, int $flags, ?string $file = null): array { $prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) { if (\E_USER_DEPRECATED === $level) { @@ -154,16 +150,12 @@ private function validate(string $content, int $flags, string $file = null) private function display(SymfonyStyle $io, array $files): int { - switch ($this->format) { - case 'txt': - return $this->displayTxt($io, $files); - case 'json': - return $this->displayJson($io, $files); - case 'github': - return $this->displayTxt($io, $files, true); - default: - throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); - } + return match ($this->format) { + 'txt' => $this->displayTxt($io, $files), + 'json' => $this->displayJson($io, $files), + 'github' => $this->displayTxt($io, $files, true), + default => throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))), + }; } private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int @@ -184,7 +176,7 @@ private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGit $io->text(' ERROR '.($info['file'] ? sprintf(' in %s', $info['file']) : '')); $io->text(sprintf(' >> %s', $info['message'])); - if (false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) { + if (str_contains($info['message'], 'PARSE_CUSTOM_TAGS')) { $suggestTagOption = true; } @@ -213,7 +205,7 @@ private function displayJson(SymfonyStyle $io, array $filesInfo): int ++$errors; } - if (isset($v['message']) && false !== strpos($v['message'], 'PARSE_CUSTOM_TAGS')) { + if (isset($v['message']) && str_contains($v['message'], 'PARSE_CUSTOM_TAGS')) { $v['message'] .= ' Use the --parse-tags option if you want parse custom tags.'; } }); @@ -247,12 +239,10 @@ private function getParser(): Parser private function getDirectoryIterator(string $directory): iterable { - $default = function ($directory) { - return new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - }; + $default = fn ($directory) => new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), + \RecursiveIteratorIterator::LEAVES_ONLY + ); if (null !== $this->directoryIteratorProvider) { return ($this->directoryIteratorProvider)($directory, $default); @@ -263,9 +253,7 @@ private function getDirectoryIterator(string $directory): iterable private function isReadable(string $fileOrDirectory): bool { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; + $default = is_readable(...); if (null !== $this->isReadableProvider) { return ($this->isReadableProvider)($fileOrDirectory, $default); @@ -277,7 +265,12 @@ private function isReadable(string $fileOrDirectory): bool public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void { if ($input->mustSuggestOptionValuesFor('format')) { - $suggestions->suggestValues(['txt', 'json', 'github']); + $suggestions->suggestValues($this->getAvailableFormatOptions()); } } + + private function getAvailableFormatOptions(): array + { + return ['txt', 'json', 'github']; + } } diff --git a/api/vendor/symfony/yaml/Dumper.php b/api/vendor/symfony/yaml/Dumper.php index c7e78e76c8..04646c5cdd 100644 --- a/api/vendor/symfony/yaml/Dumper.php +++ b/api/vendor/symfony/yaml/Dumper.php @@ -66,10 +66,12 @@ public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags $output .= "\n"; } - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && false !== strpos($value, "\n") && false === strpos($value, "\r")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value, 0, 1)) ? (string) $this->indentation : ''; + if (\is_int($key) && Yaml::DUMP_NUMERIC_KEY_AS_STRING & $flags) { + $key = (string) $key; + } + + if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && str_contains($value, "\n") && !str_contains($value, "\r")) { + $blockIndentationIndicator = $this->getBlockIndentationIndicator($value); if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) { $blockChompingIndicator = '+'; @@ -95,10 +97,8 @@ public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags if ($value instanceof TaggedValue) { $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag()); - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : ''; + if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) { + $blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue()); $output .= sprintf(' |%s', $blockIndentationIndicator); foreach (explode("\n", $value->getValue()) as $row) { @@ -142,10 +142,8 @@ private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, i { $output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag()); - if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : ''; + if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) { + $blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue()); $output .= sprintf(' |%s', $blockIndentationIndicator); foreach (explode("\n", $value->getValue()) as $row) { @@ -161,4 +159,20 @@ private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, i return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags); } + + private function getBlockIndentationIndicator(string $value): string + { + $lines = explode("\n", $value); + + // If the first line (that is neither empty nor contains only spaces) + // starts with a space character, the spec requires a block indentation indicator + // http://www.yaml.org/spec/1.2/spec.html#id2793979 + foreach ($lines as $line) { + if ('' !== trim($line, ' ')) { + return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : ''; + } + } + + return ''; + } } diff --git a/api/vendor/symfony/yaml/Exception/ParseException.php b/api/vendor/symfony/yaml/Exception/ParseException.php index 005470a3d3..60e8e197bc 100644 --- a/api/vendor/symfony/yaml/Exception/ParseException.php +++ b/api/vendor/symfony/yaml/Exception/ParseException.php @@ -29,7 +29,7 @@ class ParseException extends RuntimeException * @param string|null $snippet The snippet of code near the problem * @param string|null $parsedFile The file name where the error occurred */ - public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null) + public function __construct(string $message, int $parsedLine = -1, ?string $snippet = null, ?string $parsedFile = null, ?\Throwable $previous = null) { $this->parsedFile = $parsedFile; $this->parsedLine = $parsedLine; @@ -51,6 +51,8 @@ public function getSnippet(): string /** * Sets the snippet of code near the error. + * + * @return void */ public function setSnippet(string $snippet) { @@ -71,6 +73,8 @@ public function getParsedFile(): string /** * Sets the filename where the error occurred. + * + * @return void */ public function setParsedFile(string $parsedFile) { @@ -89,6 +93,8 @@ public function getParsedLine(): int /** * Sets the line where the error occurred. + * + * @return void */ public function setParsedLine(int $parsedLine) { @@ -97,12 +103,12 @@ public function setParsedLine(int $parsedLine) $this->updateRepr(); } - private function updateRepr() + private function updateRepr(): void { $this->message = $this->rawMessage; $dot = false; - if ('.' === substr($this->message, -1)) { + if (str_ends_with($this->message, '.')) { $this->message = substr($this->message, 0, -1); $dot = true; } diff --git a/api/vendor/symfony/yaml/Inline.php b/api/vendor/symfony/yaml/Inline.php index 88508d5cbe..e1553f9d24 100644 --- a/api/vendor/symfony/yaml/Inline.php +++ b/api/vendor/symfony/yaml/Inline.php @@ -34,7 +34,7 @@ class Inline private static bool $objectForMap = false; private static bool $constantSupport = false; - public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null) + public static function initialize(int $flags, ?int $parsedLineNumber = null, ?string $parsedFilename = null): void { self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags); self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags); @@ -55,7 +55,7 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri * * @throws ParseException */ - public static function parse(string $value = null, int $flags = 0, array &$references = []): mixed + public static function parse(string $value, int $flags = 0, array &$references = []): mixed { self::initialize($flags); @@ -110,9 +110,13 @@ public static function dump(mixed $value, int $flags = 0): string return self::dumpNull($flags); case $value instanceof \DateTimeInterface: - return $value->format('c'); + return $value->format(match (true) { + !$length = \strlen(rtrim($value->format('u'), '0')) => 'c', + $length < 4 => 'Y-m-d\TH:i:s.vP', + default => 'Y-m-d\TH:i:s.uP', + }); case $value instanceof \UnitEnum: - return sprintf('!php/const %s::%s', \get_class($value), $value->name); + return sprintf('!php/const %s::%s', $value::class, $value->name); case \is_object($value): if ($value instanceof TaggedValue) { return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags); @@ -123,13 +127,7 @@ public static function dump(mixed $value, int $flags = 0): string } if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) { - $output = []; - - foreach ($value as $key => $val) { - $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); - } - - return sprintf('{ %s }', implode(', ', $output)); + return self::dumpHashArray($value, $flags); } if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) { @@ -158,8 +156,8 @@ public static function dump(mixed $value, int $flags = 0): string $repr = str_ireplace('INF', '.Inf', $repr); } elseif (floor($value) == $value && $repr == $value) { // Preserve float data type since storing a whole number will result in integer value. - if (false === strpos($repr, 'E')) { - $repr = $repr.'.0'; + if (!str_contains($repr, 'E')) { + $repr .= '.0'; } } } else { @@ -177,6 +175,14 @@ public static function dump(mixed $value, int $flags = 0): string case Escaper::requiresDoubleQuoting($value): return Escaper::escapeWithDoubleQuotes($value); case Escaper::requiresSingleQuoting($value): + $singleQuoted = Escaper::escapeWithSingleQuotes($value); + if (!str_contains($value, "'")) { + return $singleQuoted; + } + // Attempt double-quoting the string instead to see if it's more efficient. + $doubleQuoted = Escaper::escapeWithDoubleQuotes($value); + + return \strlen($doubleQuoted) < \strlen($singleQuoted) ? $doubleQuoted : $singleQuoted; case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value): case Parser::preg_match(self::getHexRegex(), $value): case Parser::preg_match(self::getTimestampRegex(), $value): @@ -224,9 +230,23 @@ private static function dumpArray(array $value, int $flags): string return sprintf('[%s]', implode(', ', $output)); } - // hash + return self::dumpHashArray($value, $flags); + } + + /** + * Dumps hash array to a YAML string. + * + * @param array|\ArrayObject|\stdClass $value The hash array to dump + * @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string + */ + private static function dumpHashArray(array|\ArrayObject|\stdClass $value, int $flags): string + { $output = []; foreach ($value as $key => $val) { + if (\is_int($key) && Yaml::DUMP_NUMERIC_KEY_AS_STRING & $flags) { + $key = (string) $key; + } + $output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags)); } @@ -247,7 +267,7 @@ private static function dumpNull(int $flags): string * * @throws ParseException When malformed inline YAML string is parsed */ - public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null): mixed + public static function parseScalar(string $scalar, int $flags = 0, ?array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], ?bool &$isQuoted = null): mixed { if (\in_array($scalar[$i], ['"', "'"], true)) { // quoted scalar @@ -333,11 +353,18 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0, ++$i; // [foo, bar, ...] + $lastToken = null; while ($i < $len) { if (']' === $sequence[$i]) { return $output; } if (',' === $sequence[$i] || ' ' === $sequence[$i]) { + if (',' === $sequence[$i] && (null === $lastToken || 'separator' === $lastToken)) { + $output[] = null; + } elseif (',' === $sequence[$i]) { + $lastToken = 'separator'; + } + ++$i; continue; @@ -357,12 +384,12 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0, $value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted); // the value can be an array if a reference has been resolved to an array var - if (\is_string($value) && !$isQuoted && false !== strpos($value, ': ')) { + if (\is_string($value) && !$isQuoted && str_contains($value, ': ')) { // embedded mapping? try { $pos = 0; $value = self::parseMapping('{'.$value.'}', $flags, $pos, $references); - } catch (\InvalidArgumentException $e) { + } catch (\InvalidArgumentException) { // no, it's not } } @@ -381,6 +408,7 @@ private static function parseSequence(string $sequence, int $flags, int &$i = 0, $output[] = $value; + $lastToken = 'value'; ++$i; } @@ -424,7 +452,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a throw new ParseException('Missing mapping key.', self::$parsedLineNumber + 1, $mapping); } - if ('!php/const' === $key) { + if ('!php/const' === $key || '!php/enum' === $key) { $key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false); $key = self::evaluateScalar($key, $flags); } @@ -507,7 +535,7 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a if ('<<' === $key) { $output += $value; } elseif ($allowOverwrite || !isset($output[$key])) { - if (!$isValueQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) { + if (!$isValueQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && !self::isBinaryString($value) && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) { $references[$matches['ref']] = $matches['value']; $value = $matches['value']; } @@ -536,12 +564,12 @@ private static function parseMapping(string $mapping, int $flags, int &$i = 0, a * * @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved */ - private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null): mixed + private static function evaluateScalar(string $scalar, int $flags, array &$references = [], ?bool &$isQuotedString = null): mixed { $isQuotedString = false; $scalar = trim($scalar); - if (0 === strpos($scalar, '*')) { + if (str_starts_with($scalar, '*')) { if (false !== $pos = strpos($scalar, '#')) { $value = substr($scalar, 1, $pos - 2); } else { @@ -573,7 +601,7 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer return false; case '!' === $scalar[0]: switch (true) { - case 0 === strpos($scalar, '!!str '): + case str_starts_with($scalar, '!!str '): $s = (string) substr($scalar, 6); if (\in_array($s[0] ?? '', ['"', "'"], true)) { @@ -582,9 +610,9 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer } return $s; - case 0 === strpos($scalar, '! '): + case str_starts_with($scalar, '! '): return substr($scalar, 2); - case 0 === strpos($scalar, '!php/object'): + case str_starts_with($scalar, '!php/object'): if (self::$objectSupport) { if (!isset($scalar[12])) { throw new ParseException('Missing value for tag "!php/object".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); @@ -598,7 +626,7 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer } return null; - case 0 === strpos($scalar, '!php/const'): + case str_starts_with($scalar, '!php/const'): if (self::$constantSupport) { if (!isset($scalar[11])) { throw new ParseException('Missing value for tag "!php/const".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); @@ -616,9 +644,43 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer } return null; - case 0 === strpos($scalar, '!!float '): + case str_starts_with($scalar, '!php/enum'): + if (self::$constantSupport) { + if (!isset($scalar[11])) { + throw new ParseException('Missing value for tag "!php/enum".', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); + } + + $i = 0; + $enum = self::parseScalar(substr($scalar, 10), 0, null, $i, false); + if ($useValue = str_ends_with($enum, '->value')) { + $enum = substr($enum, 0, -7); + } + if (!\defined($enum)) { + throw new ParseException(sprintf('The enum "%s" is not defined.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); + } + + $value = \constant($enum); + + if (!$value instanceof \UnitEnum) { + throw new ParseException(sprintf('The string "%s" is not the name of a valid enum.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); + } + if (!$useValue) { + return $value; + } + if (!$value instanceof \BackedEnum) { + throw new ParseException(sprintf('The enum "%s" defines no value next to its name.', $enum), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); + } + + return $value->value; + } + if (self::$exceptionOnInvalidType) { + throw new ParseException(sprintf('The string "%s" could not be parsed as an enum. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename); + } + + return null; + case str_starts_with($scalar, '!!float '): return (float) substr($scalar, 8); - case 0 === strpos($scalar, '!!binary '): + case str_starts_with($scalar, '!!binary '): return self::evaluateBinaryScalar(substr($scalar, 9)); } @@ -655,18 +717,27 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar): return (float) str_replace('_', '', $scalar); case Parser::preg_match(self::getTimestampRegex(), $scalar): - // When no timezone is provided in the parsed date, YAML spec says we must assume UTC. - $time = new \DateTime($scalar, new \DateTimeZone('UTC')); + try { + // When no timezone is provided in the parsed date, YAML spec says we must assume UTC. + $time = new \DateTimeImmutable($scalar, new \DateTimeZone('UTC')); + } catch (\Exception $e) { + // Some dates accepted by the regex are not valid dates. + throw new ParseException(\sprintf('The date "%s" could not be parsed as it is an invalid date.', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename, $e); + } if (Yaml::PARSE_DATETIME & $flags) { return $time; } + if ('' !== rtrim($time->format('u'), '0')) { + return (float) $time->format('U.u'); + } + try { if (false !== $scalar = $time->getTimestamp()) { return $scalar; } - } catch (\ValueError $e) { + } catch (\ValueError) { // no-op } @@ -694,7 +765,7 @@ private static function parseTag(string $value, int &$i, int $flags): ?string } // Is followed by a scalar and is a built-in tag - if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || 'str' === $tag || 'php/const' === $tag || 'php/object' === $tag)) { + if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || \in_array($tag, ['str', 'php/const', 'php/enum', 'php/object'], true))) { // Manage in {@link self::evaluateScalar()} return null; } diff --git a/api/vendor/symfony/yaml/LICENSE b/api/vendor/symfony/yaml/LICENSE index 0083704572..0138f8f071 100644 --- a/api/vendor/symfony/yaml/LICENSE +++ b/api/vendor/symfony/yaml/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2023 Fabien Potencier +Copyright (c) 2004-present 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/api/vendor/symfony/yaml/Parser.php b/api/vendor/symfony/yaml/Parser.php index b0c05259fb..2a15bcae3d 100644 --- a/api/vendor/symfony/yaml/Parser.php +++ b/api/vendor/symfony/yaml/Parser.php @@ -99,7 +99,7 @@ public function parse(string $value, int $flags = 0): mixed return $data; } - private function doParse(string $value, int $flags) + private function doParse(string $value, int $flags): mixed { $this->currentLineNb = -1; $this->currentLine = ''; @@ -107,10 +107,7 @@ private function doParse(string $value, int $flags) $this->lines = explode("\n", $value); $this->numberOfParsedLines = \count($this->lines); $this->locallySkippedLineNumbers = []; - - if (null === $this->totalNumberOfLines) { - $this->totalNumberOfLines = $this->numberOfParsedLines; - } + $this->totalNumberOfLines ??= $this->numberOfParsedLines; if (!$this->moveToNextLine()) { return null; @@ -161,7 +158,7 @@ private function doParse(string $value, int $flags) } // array - if (isset($values['value']) && 0 === strpos(ltrim($values['value'], ' '), '-')) { + if (isset($values['value']) && str_starts_with(ltrim($values['value'], ' '), '-')) { // Inline first child $currentLineNumber = $this->getRealCurrentLineNb(); @@ -170,7 +167,7 @@ private function doParse(string $value, int $flags) $sequenceYaml .= "\n".$this->getNextEmbedBlock($sequenceIndentation, true); $data[] = $this->parseBlock($currentLineNumber, rtrim($sequenceYaml), $flags); - } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { + } elseif (!isset($values['value']) || '' == trim($values['value'], ' ') || str_starts_with(ltrim($values['value'], ' '), '#')) { $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true) ?? '', $flags); } elseif (null !== $subTag = $this->getLineTag(ltrim($values['value'], ' '), $flags)) { $data[] = new TaggedValue( @@ -185,9 +182,8 @@ private function doParse(string $value, int $flags) || self::preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $this->trimTag($values['value']), $matches) ) ) { - // this is a compact notation element, add to next block and parse $block = $values['value']; - if ($this->isNextLineIndented()) { + if ($this->isNextLineIndented() || isset($matches['value']) && '>-' === $matches['value']) { $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1); } @@ -201,9 +197,14 @@ private function doParse(string $value, int $flags) array_pop($this->refsBeingParsed); } } elseif ( + // @todo in 7.0 remove legacy "(?:!?!php/const:)?" self::preg_match('#^(?P(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P.+))?$#u', rtrim($this->currentLine), $values) - && (false === strpos($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"])) + && (!str_contains($values['key'], ' #') || \in_array($values['key'][0], ['"', "'"])) ) { + if (str_starts_with($values['key'], '!php/const:')) { + trigger_deprecation('symfony/yaml', '6.2', 'YAML syntax for key "%s" is deprecated and replaced by "!php/const %s".', $values['key'], substr($values['key'], 11)); + } + if ($context && 'sequence' == $context) { throw new ParseException('You cannot define a mapping item when in a sequence.', $this->currentLineNb + 1, $this->currentLine, $this->filename); } @@ -297,7 +298,7 @@ private function doParse(string $value, int $flags) $subTag = null; if ($mergeNode) { // Merge keys - } elseif (!isset($values['value']) || '' === $values['value'] || 0 === strpos($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) { + } elseif (!isset($values['value']) || '' === $values['value'] || str_starts_with($values['value'], '#') || (null !== $subTag = $this->getLineTag($values['value'], $flags)) || '<<' === $key) { // hash // if next line is less indented or equal, then it means that the current value is null if (!$this->isNextLineIndented() && !$this->isNextLineUnIndentedCollection()) { @@ -445,7 +446,7 @@ private function doParse(string $value, int $flags) throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); } - if (false !== strpos($line, ': ')) { + if (str_contains($line, ': ')) { throw new ParseException('Mapping values are not allowed in multi-line blocks.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename); } @@ -455,7 +456,7 @@ private function doParse(string $value, int $flags) $value .= ' '; } - if ('' !== $trimmedLine && '\\' === substr($line, -1)) { + if ('' !== $trimmedLine && str_ends_with($line, '\\')) { $value .= ltrim(substr($line, 0, -1)); } elseif ('' !== $trimmedLine) { $value .= $trimmedLine; @@ -464,7 +465,7 @@ private function doParse(string $value, int $flags) if ('' === $trimmedLine) { $previousLineWasNewline = true; $previousLineWasTerminatedWithBackslash = false; - } elseif ('\\' === substr($line, -1)) { + } elseif (str_ends_with($line, '\\')) { $previousLineWasNewline = false; $previousLineWasTerminatedWithBackslash = true; } else { @@ -475,7 +476,7 @@ private function doParse(string $value, int $flags) try { return Inline::parse(trim($value)); - } catch (ParseException $e) { + } catch (ParseException) { // fall-through to the ParseException thrown below } } @@ -501,7 +502,7 @@ private function doParse(string $value, int $flags) return empty($data) ? null : $data; } - private function parseBlock(int $offset, string $yaml, int $flags) + private function parseBlock(int $offset, string $yaml, int $flags): mixed { $skippedLineNumbers = $this->skippedLineNumbers; @@ -560,7 +561,7 @@ private function getCurrentLineIndentation(): int * * @throws ParseException When indentation problem are detected */ - private function getNextEmbedBlock(int $indentation = null, bool $inSequence = false): string + private function getNextEmbedBlock(?int $indentation = null, bool $inSequence = false): string { $oldLineIndentation = $this->getCurrentLineIndentation(); @@ -637,12 +638,12 @@ private function getNextEmbedBlock(int $indentation = null, bool $inSequence = f } if ($this->isCurrentLineBlank()) { - $data[] = substr($this->currentLine, $newIndent); + $data[] = substr($this->currentLine, $newIndent ?? 0); continue; } if ($indent >= $newIndent) { - $data[] = substr($this->currentLine, $newIndent); + $data[] = substr($this->currentLine, $newIndent ?? 0); } elseif ($this->isCurrentLineComment()) { $data[] = $this->currentLine; } elseif (0 == $indent) { @@ -701,7 +702,7 @@ private function moveToPreviousLine(): bool */ private function parseValue(string $value, int $flags, string $context): mixed { - if (0 === strpos($value, '*')) { + if (str_starts_with($value, '*')) { if (false !== $pos = strpos($value, '#')) { $value = substr($value, 1, $pos - 2); } else { @@ -788,7 +789,7 @@ private function parseValue(string $value, int $flags, string $context): mixed $parsedValue = Inline::parse($value, $flags, $this->refs); - if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && false !== strpos($parsedValue, ': ')) { + if ('mapping' === $context && \is_string($parsedValue) && '"' !== $value[0] && "'" !== $value[0] && '[' !== $value[0] && '{' !== $value[0] && '!' !== $value[0] && str_contains($parsedValue, ': ')) { throw new ParseException('A colon cannot be used in an unquoted mapping value.', $this->getRealCurrentLineNb() + 1, $value, $this->filename); } @@ -842,8 +843,8 @@ private function parseBlockScalar(string $style, string $chomping = '', int $ind while ( $notEOF && ( - $isCurrentLineBlank || - self::preg_match($pattern, $this->currentLine, $matches) + $isCurrentLineBlank + || self::preg_match($pattern, $this->currentLine, $matches) ) ) { if ($isCurrentLineBlank && \strlen($this->currentLine) > $indentation) { @@ -930,6 +931,10 @@ private function isNextLineIndented(): bool } while (!$EOF && ($this->isCurrentLineEmpty() || $this->isCurrentLineComment())); if ($EOF) { + for ($i = 0; $i < $movements; ++$i) { + $this->moveToPreviousLine(); + } + return false; } @@ -1024,7 +1029,7 @@ private function isNextLineUnIndentedCollection(): bool private function isStringUnIndentedCollectionItem(): bool { - return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- '); + return '-' === rtrim($this->currentLine) || str_starts_with($this->currentLine, '- '); } /** @@ -1036,34 +1041,12 @@ private function isStringUnIndentedCollectionItem(): bool * * @throws ParseException on a PCRE internal error * - * @see preg_last_error() - * * @internal */ - public static function preg_match(string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int + public static function preg_match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int { if (false === $ret = preg_match($pattern, $subject, $matches, $flags, $offset)) { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - $error = 'Internal PCRE error.'; - break; - case \PREG_BACKTRACK_LIMIT_ERROR: - $error = 'pcre.backtrack_limit reached.'; - break; - case \PREG_RECURSION_LIMIT_ERROR: - $error = 'pcre.recursion_limit reached.'; - break; - case \PREG_BAD_UTF8_ERROR: - $error = 'Malformed UTF-8 data.'; - break; - case \PREG_BAD_UTF8_OFFSET_ERROR: - $error = 'Offset doesn\'t correspond to the begin of a valid UTF-8 code point.'; - break; - default: - $error = 'Error.'; - } - - throw new ParseException($error); + throw new ParseException(preg_last_error_msg()); } return $ret; diff --git a/api/vendor/symfony/yaml/Tag/TaggedValue.php b/api/vendor/symfony/yaml/Tag/TaggedValue.php index c7946c27ec..3e09b93ee0 100644 --- a/api/vendor/symfony/yaml/Tag/TaggedValue.php +++ b/api/vendor/symfony/yaml/Tag/TaggedValue.php @@ -31,7 +31,7 @@ public function getTag(): string return $this->tag; } - public function getValue() + public function getValue(): mixed { return $this->value; } diff --git a/api/vendor/symfony/yaml/Unescaper.php b/api/vendor/symfony/yaml/Unescaper.php index d1ef041233..9e640ff248 100644 --- a/api/vendor/symfony/yaml/Unescaper.php +++ b/api/vendor/symfony/yaml/Unescaper.php @@ -45,9 +45,7 @@ public function unescapeSingleQuotedString(string $value): string */ public function unescapeDoubleQuotedString(string $value): string { - $callback = function ($match) { - return $this->unescapeCharacter($match[0]); - }; + $callback = fn ($match) => $this->unescapeCharacter($match[0]); // evaluate the string return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); @@ -60,56 +58,34 @@ public function unescapeDoubleQuotedString(string $value): string */ private function unescapeCharacter(string $value): string { - switch ($value[1]) { - case '0': - return "\x0"; - case 'a': - return "\x7"; - case 'b': - return "\x8"; - case 't': - return "\t"; - case "\t": - return "\t"; - case 'n': - return "\n"; - case 'v': - return "\xB"; - case 'f': - return "\xC"; - case 'r': - return "\r"; - case 'e': - return "\x1B"; - case ' ': - return ' '; - case '"': - return '"'; - case '/': - return '/'; - case '\\': - return '\\'; - case 'N': - // U+0085 NEXT LINE - return "\xC2\x85"; - case '_': - // U+00A0 NO-BREAK SPACE - return "\xC2\xA0"; - case 'L': - // U+2028 LINE SEPARATOR - return "\xE2\x80\xA8"; - case 'P': - // U+2029 PARAGRAPH SEPARATOR - return "\xE2\x80\xA9"; - case 'x': - return self::utf8chr(hexdec(substr($value, 2, 2))); - case 'u': - return self::utf8chr(hexdec(substr($value, 2, 4))); - case 'U': - return self::utf8chr(hexdec(substr($value, 2, 8))); - default: - throw new ParseException(sprintf('Found unknown escape character "%s".', $value)); - } + return match ($value[1]) { + '0' => "\x0", + 'a' => "\x7", + 'b' => "\x8", + 't' => "\t", + "\t" => "\t", + 'n' => "\n", + 'v' => "\xB", + 'f' => "\xC", + 'r' => "\r", + 'e' => "\x1B", + ' ' => ' ', + '"' => '"', + '/' => '/', + '\\' => '\\', + // U+0085 NEXT LINE + 'N' => "\xC2\x85", + // U+00A0 NO-BREAK SPACE + '_' => "\xC2\xA0", + // U+2028 LINE SEPARATOR + 'L' => "\xE2\x80\xA8", + // U+2029 PARAGRAPH SEPARATOR + 'P' => "\xE2\x80\xA9", + 'x' => self::utf8chr(hexdec(substr($value, 2, 2))), + 'u' => self::utf8chr(hexdec(substr($value, 2, 4))), + 'U' => self::utf8chr(hexdec(substr($value, 2, 8))), + default => throw new ParseException(sprintf('Found unknown escape character "%s".', $value)), + }; } /** diff --git a/api/vendor/symfony/yaml/Yaml.php b/api/vendor/symfony/yaml/Yaml.php index 49784216e9..e2d2af7310 100644 --- a/api/vendor/symfony/yaml/Yaml.php +++ b/api/vendor/symfony/yaml/Yaml.php @@ -34,6 +34,7 @@ class Yaml public const PARSE_CUSTOM_TAGS = 512; public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024; public const DUMP_NULL_AS_TILDE = 2048; + public const DUMP_NUMERIC_KEY_AS_STRING = 4096; /** * Parses a YAML file into a PHP value. diff --git a/api/vendor/symfony/yaml/composer.json b/api/vendor/symfony/yaml/composer.json index 356b9ac79a..7dfb7d0a18 100644 --- a/api/vendor/symfony/yaml/composer.json +++ b/api/vendor/symfony/yaml/composer.json @@ -16,18 +16,16 @@ } ], "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0" }, "conflict": { "symfony/console": "<5.4" }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" }, "exclude-from-classmap": [ diff --git a/api/vendor/theseer/tokenizer/CHANGELOG.md b/api/vendor/theseer/tokenizer/CHANGELOG.md index 1eff3830d6..d867649fb6 100644 --- a/api/vendor/theseer/tokenizer/CHANGELOG.md +++ b/api/vendor/theseer/tokenizer/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to Tokenizer are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [1.2.3] - 2024-03-03 + +### Changed + +* Do not use implicitly nullable parameters + +## [1.2.2] - 2023-11-20 + +### Fixed + +* [#18](https://github.com/theseer/tokenizer/issues/18): Tokenizer fails on protobuf metadata files + ## [1.2.1] - 2021-07-28 @@ -64,6 +76,10 @@ This release is now PHP 8.0 compliant. Initial Release +[1.2.3]: https://github.com/theseer/tokenizer/compare/1.2.2...1.2.3 +[1.2.2]: https://github.com/theseer/tokenizer/compare/1.2.1...1.2.2 +[1.2.1]: https://github.com/theseer/tokenizer/compare/1.2.0...1.2.1 +[1.2.0]: https://github.com/theseer/tokenizer/compare/1.1.3...1.2.0 [1.1.3]: https://github.com/theseer/tokenizer/compare/1.1.2...1.1.3 [1.1.2]: https://github.com/theseer/tokenizer/compare/1.1.1...1.1.2 [1.1.1]: https://github.com/theseer/tokenizer/compare/1.1.0...1.1.1 diff --git a/api/vendor/theseer/tokenizer/README.md b/api/vendor/theseer/tokenizer/README.md index e91ed89173..a5f891b488 100644 --- a/api/vendor/theseer/tokenizer/README.md +++ b/api/vendor/theseer/tokenizer/README.md @@ -3,9 +3,6 @@ A small library for converting tokenized PHP source code into XML. [![Test](https://github.com/theseer/tokenizer/actions/workflows/ci.yml/badge.svg)](https://github.com/theseer/tokenizer/actions/workflows/ci.yml) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) -[![Build Status](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/build-status/master) ## Installation diff --git a/api/vendor/theseer/tokenizer/src/Tokenizer.php b/api/vendor/theseer/tokenizer/src/Tokenizer.php index f582d95873..2dc79fea76 100644 --- a/api/vendor/theseer/tokenizer/src/Tokenizer.php +++ b/api/vendor/theseer/tokenizer/src/Tokenizer.php @@ -70,6 +70,18 @@ public function parse(string $source): TokenCollection { $line = $tok[2]; $values = \preg_split('/\R+/Uu', $tok[1]); + if (!$values) { + $result->addToken( + new Token( + $line, + \token_name($tok[0]), + '{binary data}' + ) + ); + + continue; + } + foreach ($values as $v) { $token = new Token( $line, @@ -100,13 +112,6 @@ private function fillBlanks(TokenCollection $tokens, int $maxLine): TokenCollect $final = new TokenCollection(); foreach ($tokens as $token) { - if ($prev === null) { - $final->addToken($token); - $prev = $token; - - continue; - } - $gap = $token->getLine() - $prev->getLine(); while ($gap > 1) { diff --git a/api/vendor/theseer/tokenizer/src/XMLSerializer.php b/api/vendor/theseer/tokenizer/src/XMLSerializer.php index e67a7fe8bf..518bfb06fb 100644 --- a/api/vendor/theseer/tokenizer/src/XMLSerializer.php +++ b/api/vendor/theseer/tokenizer/src/XMLSerializer.php @@ -19,7 +19,7 @@ class XMLSerializer { * * @param NamespaceUri $xmlns */ - public function __construct(NamespaceUri $xmlns = null) { + public function __construct(?NamespaceUri $xmlns = null) { if ($xmlns === null) { $xmlns = new NamespaceUri('https://github.com/theseer/tokenizer'); } diff --git a/api/vendor/vlucas/phpdotenv/composer.json b/api/vendor/vlucas/phpdotenv/composer.json index 46fdbafd5e..3636317fd4 100644 --- a/api/vendor/vlucas/phpdotenv/composer.json +++ b/api/vendor/vlucas/phpdotenv/composer.json @@ -16,18 +16,18 @@ } ], "require": { - "php": "^7.1.3 || ^8.0", + "php": "^7.2.5 || ^8.0", "ext-pcre": "*", - "graham-campbell/result-type": "^1.0.2", - "phpoption/phpoption": "^1.8", - "symfony/polyfill-ctype": "^1.23", - "symfony/polyfill-mbstring": "^1.23.1", - "symfony/polyfill-php80": "^1.23.1" + "graham-campbell/result-type": "^1.1.3", + "phpoption/phpoption": "^1.9.3", + "symfony/polyfill-ctype": "^1.24", + "symfony/polyfill-mbstring": "^1.24", + "symfony/polyfill-php80": "^1.24" }, "require-dev": { "ext-filter": "*", - "bamarni/composer-bin-plugin": "^1.4.1", - "phpunit/phpunit": "^7.5.20 || ^8.5.30 || ^9.5.25" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit":"^8.5.34 || ^9.6.13 || ^10.4.2" }, "autoload": { "psr-4": { @@ -51,10 +51,10 @@ "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { - "dev-master": "5.5-dev" + "dev-master": "5.6-dev" } } } diff --git a/api/vendor/vlucas/phpdotenv/src/Dotenv.php b/api/vendor/vlucas/phpdotenv/src/Dotenv.php index 0460ced200..6821c7d98d 100644 --- a/api/vendor/vlucas/phpdotenv/src/Dotenv.php +++ b/api/vendor/vlucas/phpdotenv/src/Dotenv.php @@ -80,7 +80,7 @@ public function __construct( * * @return \Dotenv\Dotenv */ - public static function create(RepositoryInterface $repository, $paths, $names = null, bool $shortCircuit = true, string $fileEncoding = null) + public static function create(RepositoryInterface $repository, $paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) { $builder = $names === null ? StoreBuilder::createWithDefaultName() : StoreBuilder::createWithNoNames(); @@ -109,7 +109,7 @@ public static function create(RepositoryInterface $repository, $paths, $names = * * @return \Dotenv\Dotenv */ - public static function createMutable($paths, $names = null, bool $shortCircuit = true, string $fileEncoding = null) + public static function createMutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) { $repository = RepositoryBuilder::createWithDefaultAdapters()->make(); @@ -126,7 +126,7 @@ public static function createMutable($paths, $names = null, bool $shortCircuit = * * @return \Dotenv\Dotenv */ - public static function createUnsafeMutable($paths, $names = null, bool $shortCircuit = true, string $fileEncoding = null) + public static function createUnsafeMutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) { $repository = RepositoryBuilder::createWithDefaultAdapters() ->addAdapter(PutenvAdapter::class) @@ -145,7 +145,7 @@ public static function createUnsafeMutable($paths, $names = null, bool $shortCir * * @return \Dotenv\Dotenv */ - public static function createImmutable($paths, $names = null, bool $shortCircuit = true, string $fileEncoding = null) + public static function createImmutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) { $repository = RepositoryBuilder::createWithDefaultAdapters()->immutable()->make(); @@ -162,7 +162,7 @@ public static function createImmutable($paths, $names = null, bool $shortCircuit * * @return \Dotenv\Dotenv */ - public static function createUnsafeImmutable($paths, $names = null, bool $shortCircuit = true, string $fileEncoding = null) + public static function createUnsafeImmutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) { $repository = RepositoryBuilder::createWithDefaultAdapters() ->addAdapter(PutenvAdapter::class) @@ -182,7 +182,7 @@ public static function createUnsafeImmutable($paths, $names = null, bool $shortC * * @return \Dotenv\Dotenv */ - public static function createArrayBacked($paths, $names = null, bool $shortCircuit = true, string $fileEncoding = null) + public static function createArrayBacked($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) { $repository = RepositoryBuilder::createWithNoAdapters()->addAdapter(ArrayAdapter::class)->make(); diff --git a/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php b/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php index 7570f58743..716f422eed 100644 --- a/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php +++ b/api/vendor/vlucas/phpdotenv/src/Parser/Entry.php @@ -30,7 +30,7 @@ final class Entry * * @return void */ - public function __construct(string $name, Value $value = null) + public function __construct(string $name, ?Value $value = null) { $this->name = $name; $this->value = $value; diff --git a/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php b/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php index a042f9a1f0..7607924461 100644 --- a/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php +++ b/api/vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php @@ -65,7 +65,7 @@ final class RepositoryBuilder * * @return void */ - private function __construct(array $readers = [], array $writers = [], bool $immutable = false, array $allowList = null) + private function __construct(array $readers = [], array $writers = [], bool $immutable = false, ?array $allowList = null) { $this->readers = $readers; $this->writers = $writers; @@ -244,7 +244,7 @@ public function immutable() * * @return \Dotenv\Repository\RepositoryBuilder */ - public function allowList(array $allowList = null) + public function allowList(?array $allowList = null) { return new self($this->readers, $this->writers, $this->immutable, $allowList); } diff --git a/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php b/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php index bcbbf7ad29..b0b7c5b4e3 100644 --- a/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php +++ b/api/vendor/vlucas/phpdotenv/src/Store/File/Reader.php @@ -40,7 +40,7 @@ private function __construct() * * @return array */ - public static function read(array $filePaths, bool $shortCircuit = true, string $fileEncoding = null) + public static function read(array $filePaths, bool $shortCircuit = true, ?string $fileEncoding = null) { $output = []; @@ -67,7 +67,7 @@ public static function read(array $filePaths, bool $shortCircuit = true, string * * @return \PhpOption\Option */ - private static function readFromFile(string $path, string $encoding = null) + private static function readFromFile(string $path, ?string $encoding = null) { /** @var Option */ $content = Option::fromValue(@\file_get_contents($path), false); diff --git a/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php b/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php index 43f6135c0f..e7a4d3f121 100644 --- a/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php +++ b/api/vendor/vlucas/phpdotenv/src/Store/FileStore.php @@ -39,7 +39,7 @@ final class FileStore implements StoreInterface * * @return void */ - public function __construct(array $filePaths, bool $shortCircuit, string $fileEncoding = null) + public function __construct(array $filePaths, bool $shortCircuit, ?string $fileEncoding = null) { $this->filePaths = $filePaths; $this->shortCircuit = $shortCircuit; diff --git a/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php b/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php index 304117fce2..2ce085158e 100644 --- a/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php +++ b/api/vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php @@ -51,7 +51,7 @@ final class StoreBuilder * * @return void */ - private function __construct(array $paths = [], array $names = [], bool $shortCircuit = false, string $fileEncoding = null) + private function __construct(array $paths = [], array $names = [], bool $shortCircuit = false, ?string $fileEncoding = null) { $this->paths = $paths; $this->names = $names; @@ -120,7 +120,7 @@ public function shortCircuit() * * @return \Dotenv\Store\StoreBuilder */ - public function fileEncoding(string $fileEncoding = null) + public function fileEncoding(?string $fileEncoding = null) { return new self($this->paths, $this->names, $this->shortCircuit, $fileEncoding); } diff --git a/api/vendor/vlucas/phpdotenv/src/Util/Regex.php b/api/vendor/vlucas/phpdotenv/src/Util/Regex.php index 52c15780cf..b17355c649 100644 --- a/api/vendor/vlucas/phpdotenv/src/Util/Regex.php +++ b/api/vendor/vlucas/phpdotenv/src/Util/Regex.php @@ -64,7 +64,7 @@ public static function occurrences(string $pattern, string $subject) * * @return \GrahamCampbell\ResultType\Result */ - public static function replaceCallback(string $pattern, callable $callback, string $subject, int $limit = null) + public static function replaceCallback(string $pattern, callable $callback, string $subject, ?int $limit = null) { return self::pregAndWrap(static function (string $subject) use ($pattern, $callback, $limit) { return (string) @\preg_replace_callback($pattern, $callback, $subject, $limit ?? -1); diff --git a/api/vendor/vlucas/phpdotenv/src/Util/Str.php b/api/vendor/vlucas/phpdotenv/src/Util/Str.php index 087e236afd..15257bdf9d 100644 --- a/api/vendor/vlucas/phpdotenv/src/Util/Str.php +++ b/api/vendor/vlucas/phpdotenv/src/Util/Str.php @@ -33,7 +33,7 @@ private function __construct() * * @return \GrahamCampbell\ResultType\Result */ - public static function utf8(string $input, string $encoding = null) + public static function utf8(string $input, ?string $encoding = null) { if ($encoding !== null && !\in_array($encoding, \mb_list_encodings(), true)) { /** @var \GrahamCampbell\ResultType\Result */ @@ -79,7 +79,7 @@ public static function pos(string $haystack, string $needle) * * @return string */ - public static function substr(string $input, int $start, int $length = null) + public static function substr(string $input, int $start, ?int $length = null) { return \mb_substr($input, $start, $length, 'UTF-8'); } diff --git a/classes/OccurrenceEditorManager.php b/classes/OccurrenceEditorManager.php index ee8ffff83e..b5ca7f08f2 100644 --- a/classes/OccurrenceEditorManager.php +++ b/classes/OccurrenceEditorManager.php @@ -784,12 +784,11 @@ private function setAdditionalIdentifiers(&$occurrenceArr){ $ocnStr = str_replace(array(',',';'),'|',$ocnStr); $ocnArr = explode('|',$ocnStr); foreach($ocnArr as $identUnit){ - $identUnit = trim($identUnit, ': '); if($identUnit){ $tag = ''; $value = $identUnit; if(preg_match('/^([A-Za-z\s]+[\s#:]+)(\d+)$/', $identUnit, $m)){ - $tag = $m[1]; + $tag = trim($m[1], ': '); $value = $m[2]; } $otherCatNumArr[$value] = $tag; @@ -1341,7 +1340,7 @@ public function addOccurrence($postArr){ } //Deal with host data if(array_key_exists('host',$postArr)){ - $sql = 'INSERT INTO omoccurassociations(occid, associationType, relationship, verbatimsciname) + $sql = 'INSERT INTO omoccurassociations(occid, associationType, relationship, verbatimsciname) VALUES('.$this->occid.', "observational", "host", "'.$this->cleanInStr($postArr['host']).'")'; if(!$this->conn->query($sql)){ $status .= '(WARNING adding host: '.$this->conn->error.') '; @@ -2414,13 +2413,20 @@ public function getExternalEditArr(){ //Edit locking functions (session variables) public function getLock(){ $isLocked = false; - //Check lock - $delSql = 'DELETE FROM omoccureditlocks WHERE (ts < '.(time()-900).') OR (uid = '.$GLOBALS['SYMB_UID'].')'; - if(!$this->conn->query($delSql)) return false; - //Try to insert lock for , existing lock is assumed if fails - $sql = 'INSERT INTO omoccureditlocks(occid,uid,ts) VALUES ('.$this->occid.','.$GLOBALS['SYMB_UID'].','.time().')'; - if(!$this->conn->query($sql)){ - $isLocked = true; + //Delete all expired locks and other locks associated with current user + $delSql = 'DELETE FROM omoccureditlocks WHERE (ts < ' . (time()-900) . ') OR (uid = ?)'; + if($stmt = $this->conn->prepare($delSql)){ + $stmt->bind_param('i', $GLOBALS['SYMB_UID']); + $stmt->execute(); + $stmt->close(); + } + //Try to insert lock for this record; if a lock exists for another user, INSERT will silently fail with no rows affected + $sql = 'INSERT IGNORE INTO omoccureditlocks(occid,uid,ts) VALUES(?,?,' . time() . ')'; + if($stmt = $this->conn->prepare($sql)){ + $stmt->bind_param('ii', $this->occid, $GLOBALS['SYMB_UID']); + $stmt->execute(); + if(!$stmt->affected_rows) $isLocked = true; + $stmt->close(); } return $isLocked; } diff --git a/collections/map/index.php b/collections/map/index.php index d5ade3faf6..486c6cda02 100644 --- a/collections/map/index.php +++ b/collections/map/index.php @@ -157,6 +157,9 @@ @@ -341,13 +344,23 @@ function hideWorking(){ function buildPanels(cross_portal_enabled) { const cross_portal_results = document.getElementById("cross_portal_results"); const cross_portal_list = document.getElementById("cross_portal_list"); + const record_label = document.getElementById("standard_record_label"); + const cross_portal_record_label = document.getElementById("cross_portal_record_label"); if(cross_portal_results) { if(cross_portal_enabled) { cross_portal_results.style.display = "block"; cross_portal_list.style.display = "block"; + + //Swap record table label for cross portal searches + cross_portal_record_label.style.display = "block"; + standard_record_label.style.display = "none"; } else { cross_portal_results.style.display = "none"; cross_portal_list.style.display = "none"; + + //Swap record table label for standard searches + cross_portal_record_label.style.display = "none"; + standard_record_label.style.display = "block"; } } setPanels(true); @@ -2280,7 +2293,14 @@ class="service-container" + +

    + +

    +

    '; diff --git a/collections/misc/collprofiles.php b/collections/misc/collprofiles.php index 85abac30bd..c0422a84bd 100644 --- a/collections/misc/collprofiles.php +++ b/collections/misc/collprofiles.php @@ -914,17 +914,21 @@ function directSubmitAction(e) { include('collprofilestats.php'); ?>
    -
    - - -
    +
    + + +
    - - - +
    + + + +
    - +
    @@ -221,9 +221,9 @@
    @@ -238,7 +238,7 @@